var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __esm = (fn2, res) => function __init() {
  return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to2, from2, except, desc) => {
  if (from2 && typeof from2 === "object" || typeof from2 === "function") {
    for (let key of __getOwnPropNames(from2))
      if (!__hasOwnProp.call(to2, key) && key !== except)
        __defProp(to2, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
  }
  return to2;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};

// ../../node_modules/.pnpm/big-integer@1.6.52/node_modules/big-integer/BigInteger.js
var require_BigInteger = __commonJS({
  "../../node_modules/.pnpm/big-integer@1.6.52/node_modules/big-integer/BigInteger.js"(exports, module) {
    var bigInt = function(undefined2) {
      "use strict";
      var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
      var supportsNativeBigInt = typeof BigInt === "function";
      function Integer(v3, radix, alphabet, caseSensitive) {
        if (typeof v3 === "undefined")
          return Integer[0];
        if (typeof radix !== "undefined")
          return +radix === 10 && !alphabet ? parseValue2(v3) : parseBase(v3, radix, alphabet, caseSensitive);
        return parseValue2(v3);
      }
      function BigInteger(value, sign3) {
        this.value = value;
        this.sign = sign3;
        this.isSmall = false;
      }
      BigInteger.prototype = Object.create(Integer.prototype);
      function SmallInteger(value) {
        this.value = value;
        this.sign = value < 0;
        this.isSmall = true;
      }
      SmallInteger.prototype = Object.create(Integer.prototype);
      function NativeBigInt(value) {
        this.value = value;
      }
      NativeBigInt.prototype = Object.create(Integer.prototype);
      function isPrecise(n2) {
        return -MAX_INT < n2 && n2 < MAX_INT;
      }
      function smallToArray(n2) {
        if (n2 < 1e7)
          return [n2];
        if (n2 < 1e14)
          return [n2 % 1e7, Math.floor(n2 / 1e7)];
        return [n2 % 1e7, Math.floor(n2 / 1e7) % 1e7, Math.floor(n2 / 1e14)];
      }
      function arrayToSmall(arr) {
        trim(arr);
        var length = arr.length;
        if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
          switch (length) {
            case 0:
              return 0;
            case 1:
              return arr[0];
            case 2:
              return arr[0] + arr[1] * BASE;
            default:
              return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
          }
        }
        return arr;
      }
      function trim(v3) {
        var i6 = v3.length;
        while (v3[--i6] === 0)
          ;
        v3.length = i6 + 1;
      }
      function createArray(length) {
        var x6 = new Array(length);
        var i6 = -1;
        while (++i6 < length) {
          x6[i6] = 0;
        }
        return x6;
      }
      function truncate(n2) {
        if (n2 > 0)
          return Math.floor(n2);
        return Math.ceil(n2);
      }
      function add4(a6, b5) {
        var l_a = a6.length, l_b = b5.length, r3 = new Array(l_a), carry = 0, base2 = BASE, sum2, i6;
        for (i6 = 0; i6 < l_b; i6++) {
          sum2 = a6[i6] + b5[i6] + carry;
          carry = sum2 >= base2 ? 1 : 0;
          r3[i6] = sum2 - carry * base2;
        }
        while (i6 < l_a) {
          sum2 = a6[i6] + carry;
          carry = sum2 === base2 ? 1 : 0;
          r3[i6++] = sum2 - carry * base2;
        }
        if (carry > 0)
          r3.push(carry);
        return r3;
      }
      function addAny(a6, b5) {
        if (a6.length >= b5.length)
          return add4(a6, b5);
        return add4(b5, a6);
      }
      function addSmall(a6, carry) {
        var l3 = a6.length, r3 = new Array(l3), base2 = BASE, sum2, i6;
        for (i6 = 0; i6 < l3; i6++) {
          sum2 = a6[i6] - base2 + carry;
          carry = Math.floor(sum2 / base2);
          r3[i6] = sum2 - carry * base2;
          carry += 1;
        }
        while (carry > 0) {
          r3[i6++] = carry % base2;
          carry = Math.floor(carry / base2);
        }
        return r3;
      }
      BigInteger.prototype.add = function(v3) {
        var n2 = parseValue2(v3);
        if (this.sign !== n2.sign) {
          return this.subtract(n2.negate());
        }
        var a6 = this.value, b5 = n2.value;
        if (n2.isSmall) {
          return new BigInteger(addSmall(a6, Math.abs(b5)), this.sign);
        }
        return new BigInteger(addAny(a6, b5), this.sign);
      };
      BigInteger.prototype.plus = BigInteger.prototype.add;
      SmallInteger.prototype.add = function(v3) {
        var n2 = parseValue2(v3);
        var a6 = this.value;
        if (a6 < 0 !== n2.sign) {
          return this.subtract(n2.negate());
        }
        var b5 = n2.value;
        if (n2.isSmall) {
          if (isPrecise(a6 + b5))
            return new SmallInteger(a6 + b5);
          b5 = smallToArray(Math.abs(b5));
        }
        return new BigInteger(addSmall(b5, Math.abs(a6)), a6 < 0);
      };
      SmallInteger.prototype.plus = SmallInteger.prototype.add;
      NativeBigInt.prototype.add = function(v3) {
        return new NativeBigInt(this.value + parseValue2(v3).value);
      };
      NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
      function subtract(a6, b5) {
        var a_l = a6.length, b_l = b5.length, r3 = new Array(a_l), borrow = 0, base2 = BASE, i6, difference2;
        for (i6 = 0; i6 < b_l; i6++) {
          difference2 = a6[i6] - borrow - b5[i6];
          if (difference2 < 0) {
            difference2 += base2;
            borrow = 1;
          } else
            borrow = 0;
          r3[i6] = difference2;
        }
        for (i6 = b_l; i6 < a_l; i6++) {
          difference2 = a6[i6] - borrow;
          if (difference2 < 0)
            difference2 += base2;
          else {
            r3[i6++] = difference2;
            break;
          }
          r3[i6] = difference2;
        }
        for (; i6 < a_l; i6++) {
          r3[i6] = a6[i6];
        }
        trim(r3);
        return r3;
      }
      function subtractAny(a6, b5, sign3) {
        var value;
        if (compareAbs(a6, b5) >= 0) {
          value = subtract(a6, b5);
        } else {
          value = subtract(b5, a6);
          sign3 = !sign3;
        }
        value = arrayToSmall(value);
        if (typeof value === "number") {
          if (sign3)
            value = -value;
          return new SmallInteger(value);
        }
        return new BigInteger(value, sign3);
      }
      function subtractSmall(a6, b5, sign3) {
        var l3 = a6.length, r3 = new Array(l3), carry = -b5, base2 = BASE, i6, difference2;
        for (i6 = 0; i6 < l3; i6++) {
          difference2 = a6[i6] + carry;
          carry = Math.floor(difference2 / base2);
          difference2 %= base2;
          r3[i6] = difference2 < 0 ? difference2 + base2 : difference2;
        }
        r3 = arrayToSmall(r3);
        if (typeof r3 === "number") {
          if (sign3)
            r3 = -r3;
          return new SmallInteger(r3);
        }
        return new BigInteger(r3, sign3);
      }
      BigInteger.prototype.subtract = function(v3) {
        var n2 = parseValue2(v3);
        if (this.sign !== n2.sign) {
          return this.add(n2.negate());
        }
        var a6 = this.value, b5 = n2.value;
        if (n2.isSmall)
          return subtractSmall(a6, Math.abs(b5), this.sign);
        return subtractAny(a6, b5, this.sign);
      };
      BigInteger.prototype.minus = BigInteger.prototype.subtract;
      SmallInteger.prototype.subtract = function(v3) {
        var n2 = parseValue2(v3);
        var a6 = this.value;
        if (a6 < 0 !== n2.sign) {
          return this.add(n2.negate());
        }
        var b5 = n2.value;
        if (n2.isSmall) {
          return new SmallInteger(a6 - b5);
        }
        return subtractSmall(b5, Math.abs(a6), a6 >= 0);
      };
      SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
      NativeBigInt.prototype.subtract = function(v3) {
        return new NativeBigInt(this.value - parseValue2(v3).value);
      };
      NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
      BigInteger.prototype.negate = function() {
        return new BigInteger(this.value, !this.sign);
      };
      SmallInteger.prototype.negate = function() {
        var sign3 = this.sign;
        var small = new SmallInteger(-this.value);
        small.sign = !sign3;
        return small;
      };
      NativeBigInt.prototype.negate = function() {
        return new NativeBigInt(-this.value);
      };
      BigInteger.prototype.abs = function() {
        return new BigInteger(this.value, false);
      };
      SmallInteger.prototype.abs = function() {
        return new SmallInteger(Math.abs(this.value));
      };
      NativeBigInt.prototype.abs = function() {
        return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
      };
      function multiplyLong(a6, b5) {
        var a_l = a6.length, b_l = b5.length, l3 = a_l + b_l, r3 = createArray(l3), base2 = BASE, product, carry, i6, a_i, b_j;
        for (i6 = 0; i6 < a_l; ++i6) {
          a_i = a6[i6];
          for (var j4 = 0; j4 < b_l; ++j4) {
            b_j = b5[j4];
            product = a_i * b_j + r3[i6 + j4];
            carry = Math.floor(product / base2);
            r3[i6 + j4] = product - carry * base2;
            r3[i6 + j4 + 1] += carry;
          }
        }
        trim(r3);
        return r3;
      }
      function multiplySmall(a6, b5) {
        var l3 = a6.length, r3 = new Array(l3), base2 = BASE, carry = 0, product, i6;
        for (i6 = 0; i6 < l3; i6++) {
          product = a6[i6] * b5 + carry;
          carry = Math.floor(product / base2);
          r3[i6] = product - carry * base2;
        }
        while (carry > 0) {
          r3[i6++] = carry % base2;
          carry = Math.floor(carry / base2);
        }
        return r3;
      }
      function shiftLeft(x6, n2) {
        var r3 = [];
        while (n2-- > 0)
          r3.push(0);
        return r3.concat(x6);
      }
      function multiplyKaratsuba(x6, y6) {
        var n2 = Math.max(x6.length, y6.length);
        if (n2 <= 30)
          return multiplyLong(x6, y6);
        n2 = Math.ceil(n2 / 2);
        var b5 = x6.slice(n2), a6 = x6.slice(0, n2), d6 = y6.slice(n2), c5 = y6.slice(0, n2);
        var ac = multiplyKaratsuba(a6, c5), bd = multiplyKaratsuba(b5, d6), abcd = multiplyKaratsuba(addAny(a6, b5), addAny(c5, d6));
        var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n2)), shiftLeft(bd, 2 * n2));
        trim(product);
        return product;
      }
      function useKaratsuba(l1, l22) {
        return -0.012 * l1 - 0.012 * l22 + 15e-6 * l1 * l22 > 0;
      }
      BigInteger.prototype.multiply = function(v3) {
        var n2 = parseValue2(v3), a6 = this.value, b5 = n2.value, sign3 = this.sign !== n2.sign, abs;
        if (n2.isSmall) {
          if (b5 === 0)
            return Integer[0];
          if (b5 === 1)
            return this;
          if (b5 === -1)
            return this.negate();
          abs = Math.abs(b5);
          if (abs < BASE) {
            return new BigInteger(multiplySmall(a6, abs), sign3);
          }
          b5 = smallToArray(abs);
        }
        if (useKaratsuba(a6.length, b5.length))
          return new BigInteger(multiplyKaratsuba(a6, b5), sign3);
        return new BigInteger(multiplyLong(a6, b5), sign3);
      };
      BigInteger.prototype.times = BigInteger.prototype.multiply;
      function multiplySmallAndArray(a6, b5, sign3) {
        if (a6 < BASE) {
          return new BigInteger(multiplySmall(b5, a6), sign3);
        }
        return new BigInteger(multiplyLong(b5, smallToArray(a6)), sign3);
      }
      SmallInteger.prototype._multiplyBySmall = function(a6) {
        if (isPrecise(a6.value * this.value)) {
          return new SmallInteger(a6.value * this.value);
        }
        return multiplySmallAndArray(Math.abs(a6.value), smallToArray(Math.abs(this.value)), this.sign !== a6.sign);
      };
      BigInteger.prototype._multiplyBySmall = function(a6) {
        if (a6.value === 0)
          return Integer[0];
        if (a6.value === 1)
          return this;
        if (a6.value === -1)
          return this.negate();
        return multiplySmallAndArray(Math.abs(a6.value), this.value, this.sign !== a6.sign);
      };
      SmallInteger.prototype.multiply = function(v3) {
        return parseValue2(v3)._multiplyBySmall(this);
      };
      SmallInteger.prototype.times = SmallInteger.prototype.multiply;
      NativeBigInt.prototype.multiply = function(v3) {
        return new NativeBigInt(this.value * parseValue2(v3).value);
      };
      NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
      function square(a6) {
        var l3 = a6.length, r3 = createArray(l3 + l3), base2 = BASE, product, carry, i6, a_i, a_j;
        for (i6 = 0; i6 < l3; i6++) {
          a_i = a6[i6];
          carry = 0 - a_i * a_i;
          for (var j4 = i6; j4 < l3; j4++) {
            a_j = a6[j4];
            product = 2 * (a_i * a_j) + r3[i6 + j4] + carry;
            carry = Math.floor(product / base2);
            r3[i6 + j4] = product - carry * base2;
          }
          r3[i6 + l3] = carry;
        }
        trim(r3);
        return r3;
      }
      BigInteger.prototype.square = function() {
        return new BigInteger(square(this.value), false);
      };
      SmallInteger.prototype.square = function() {
        var value = this.value * this.value;
        if (isPrecise(value))
          return new SmallInteger(value);
        return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
      };
      NativeBigInt.prototype.square = function(v3) {
        return new NativeBigInt(this.value * this.value);
      };
      function divMod1(a6, b5) {
        var a_l = a6.length, b_l = b5.length, base2 = BASE, result = createArray(b5.length), divisorMostSignificantDigit = b5[b_l - 1], lambda = Math.ceil(base2 / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a6, lambda), divisor = multiplySmall(b5, lambda), quotientDigit, shift, carry, borrow, i6, l3, q6;
        if (remainder.length <= a_l)
          remainder.push(0);
        divisor.push(0);
        divisorMostSignificantDigit = divisor[b_l - 1];
        for (shift = a_l - b_l; shift >= 0; shift--) {
          quotientDigit = base2 - 1;
          if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
            quotientDigit = Math.floor((remainder[shift + b_l] * base2 + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
          }
          carry = 0;
          borrow = 0;
          l3 = divisor.length;
          for (i6 = 0; i6 < l3; i6++) {
            carry += quotientDigit * divisor[i6];
            q6 = Math.floor(carry / base2);
            borrow += remainder[shift + i6] - (carry - q6 * base2);
            carry = q6;
            if (borrow < 0) {
              remainder[shift + i6] = borrow + base2;
              borrow = -1;
            } else {
              remainder[shift + i6] = borrow;
              borrow = 0;
            }
          }
          while (borrow !== 0) {
            quotientDigit -= 1;
            carry = 0;
            for (i6 = 0; i6 < l3; i6++) {
              carry += remainder[shift + i6] - base2 + divisor[i6];
              if (carry < 0) {
                remainder[shift + i6] = carry + base2;
                carry = 0;
              } else {
                remainder[shift + i6] = carry;
                carry = 1;
              }
            }
            borrow += carry;
          }
          result[shift] = quotientDigit;
        }
        remainder = divModSmall(remainder, lambda)[0];
        return [arrayToSmall(result), arrayToSmall(remainder)];
      }
      function divMod2(a6, b5) {
        var a_l = a6.length, b_l = b5.length, result = [], part = [], base2 = BASE, guess, xlen, highx, highy, check;
        while (a_l) {
          part.unshift(a6[--a_l]);
          trim(part);
          if (compareAbs(part, b5) < 0) {
            result.push(0);
            continue;
          }
          xlen = part.length;
          highx = part[xlen - 1] * base2 + part[xlen - 2];
          highy = b5[b_l - 1] * base2 + b5[b_l - 2];
          if (xlen > b_l) {
            highx = (highx + 1) * base2;
          }
          guess = Math.ceil(highx / highy);
          do {
            check = multiplySmall(b5, guess);
            if (compareAbs(check, part) <= 0)
              break;
            guess--;
          } while (guess);
          result.push(guess);
          part = subtract(part, check);
        }
        result.reverse();
        return [arrayToSmall(result), arrayToSmall(part)];
      }
      function divModSmall(value, lambda) {
        var length = value.length, quotient = createArray(length), base2 = BASE, i6, q6, remainder, divisor;
        remainder = 0;
        for (i6 = length - 1; i6 >= 0; --i6) {
          divisor = remainder * base2 + value[i6];
          q6 = truncate(divisor / lambda);
          remainder = divisor - q6 * lambda;
          quotient[i6] = q6 | 0;
        }
        return [quotient, remainder | 0];
      }
      function divModAny(self2, v3) {
        var value, n2 = parseValue2(v3);
        if (supportsNativeBigInt) {
          return [new NativeBigInt(self2.value / n2.value), new NativeBigInt(self2.value % n2.value)];
        }
        var a6 = self2.value, b5 = n2.value;
        var quotient;
        if (b5 === 0)
          throw new Error("Cannot divide by zero");
        if (self2.isSmall) {
          if (n2.isSmall) {
            return [new SmallInteger(truncate(a6 / b5)), new SmallInteger(a6 % b5)];
          }
          return [Integer[0], self2];
        }
        if (n2.isSmall) {
          if (b5 === 1)
            return [self2, Integer[0]];
          if (b5 == -1)
            return [self2.negate(), Integer[0]];
          var abs = Math.abs(b5);
          if (abs < BASE) {
            value = divModSmall(a6, abs);
            quotient = arrayToSmall(value[0]);
            var remainder = value[1];
            if (self2.sign)
              remainder = -remainder;
            if (typeof quotient === "number") {
              if (self2.sign !== n2.sign)
                quotient = -quotient;
              return [new SmallInteger(quotient), new SmallInteger(remainder)];
            }
            return [new BigInteger(quotient, self2.sign !== n2.sign), new SmallInteger(remainder)];
          }
          b5 = smallToArray(abs);
        }
        var comparison = compareAbs(a6, b5);
        if (comparison === -1)
          return [Integer[0], self2];
        if (comparison === 0)
          return [Integer[self2.sign === n2.sign ? 1 : -1], Integer[0]];
        if (a6.length + b5.length <= 200)
          value = divMod1(a6, b5);
        else
          value = divMod2(a6, b5);
        quotient = value[0];
        var qSign = self2.sign !== n2.sign, mod = value[1], mSign = self2.sign;
        if (typeof quotient === "number") {
          if (qSign)
            quotient = -quotient;
          quotient = new SmallInteger(quotient);
        } else
          quotient = new BigInteger(quotient, qSign);
        if (typeof mod === "number") {
          if (mSign)
            mod = -mod;
          mod = new SmallInteger(mod);
        } else
          mod = new BigInteger(mod, mSign);
        return [quotient, mod];
      }
      BigInteger.prototype.divmod = function(v3) {
        var result = divModAny(this, v3);
        return {
          quotient: result[0],
          remainder: result[1]
        };
      };
      NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
      BigInteger.prototype.divide = function(v3) {
        return divModAny(this, v3)[0];
      };
      NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v3) {
        return new NativeBigInt(this.value / parseValue2(v3).value);
      };
      SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
      BigInteger.prototype.mod = function(v3) {
        return divModAny(this, v3)[1];
      };
      NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v3) {
        return new NativeBigInt(this.value % parseValue2(v3).value);
      };
      SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
      BigInteger.prototype.pow = function(v3) {
        var n2 = parseValue2(v3), a6 = this.value, b5 = n2.value, value, x6, y6;
        if (b5 === 0)
          return Integer[1];
        if (a6 === 0)
          return Integer[0];
        if (a6 === 1)
          return Integer[1];
        if (a6 === -1)
          return n2.isEven() ? Integer[1] : Integer[-1];
        if (n2.sign) {
          return Integer[0];
        }
        if (!n2.isSmall)
          throw new Error("The exponent " + n2.toString() + " is too large.");
        if (this.isSmall) {
          if (isPrecise(value = Math.pow(a6, b5)))
            return new SmallInteger(truncate(value));
        }
        x6 = this;
        y6 = Integer[1];
        while (true) {
          if (b5 & true) {
            y6 = y6.times(x6);
            --b5;
          }
          if (b5 === 0)
            break;
          b5 /= 2;
          x6 = x6.square();
        }
        return y6;
      };
      SmallInteger.prototype.pow = BigInteger.prototype.pow;
      NativeBigInt.prototype.pow = function(v3) {
        var n2 = parseValue2(v3);
        var a6 = this.value, b5 = n2.value;
        var _0 = BigInt(0), _1 = BigInt(1), _22 = BigInt(2);
        if (b5 === _0)
          return Integer[1];
        if (a6 === _0)
          return Integer[0];
        if (a6 === _1)
          return Integer[1];
        if (a6 === BigInt(-1))
          return n2.isEven() ? Integer[1] : Integer[-1];
        if (n2.isNegative())
          return new NativeBigInt(_0);
        var x6 = this;
        var y6 = Integer[1];
        while (true) {
          if ((b5 & _1) === _1) {
            y6 = y6.times(x6);
            --b5;
          }
          if (b5 === _0)
            break;
          b5 /= _22;
          x6 = x6.square();
        }
        return y6;
      };
      BigInteger.prototype.modPow = function(exp, mod) {
        exp = parseValue2(exp);
        mod = parseValue2(mod);
        if (mod.isZero())
          throw new Error("Cannot take modPow with modulus 0");
        var r3 = Integer[1], base2 = this.mod(mod);
        if (exp.isNegative()) {
          exp = exp.multiply(Integer[-1]);
          base2 = base2.modInv(mod);
        }
        while (exp.isPositive()) {
          if (base2.isZero())
            return Integer[0];
          if (exp.isOdd())
            r3 = r3.multiply(base2).mod(mod);
          exp = exp.divide(2);
          base2 = base2.square().mod(mod);
        }
        return r3;
      };
      NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
      function compareAbs(a6, b5) {
        if (a6.length !== b5.length) {
          return a6.length > b5.length ? 1 : -1;
        }
        for (var i6 = a6.length - 1; i6 >= 0; i6--) {
          if (a6[i6] !== b5[i6])
            return a6[i6] > b5[i6] ? 1 : -1;
        }
        return 0;
      }
      BigInteger.prototype.compareAbs = function(v3) {
        var n2 = parseValue2(v3), a6 = this.value, b5 = n2.value;
        if (n2.isSmall)
          return 1;
        return compareAbs(a6, b5);
      };
      SmallInteger.prototype.compareAbs = function(v3) {
        var n2 = parseValue2(v3), a6 = Math.abs(this.value), b5 = n2.value;
        if (n2.isSmall) {
          b5 = Math.abs(b5);
          return a6 === b5 ? 0 : a6 > b5 ? 1 : -1;
        }
        return -1;
      };
      NativeBigInt.prototype.compareAbs = function(v3) {
        var a6 = this.value;
        var b5 = parseValue2(v3).value;
        a6 = a6 >= 0 ? a6 : -a6;
        b5 = b5 >= 0 ? b5 : -b5;
        return a6 === b5 ? 0 : a6 > b5 ? 1 : -1;
      };
      BigInteger.prototype.compare = function(v3) {
        if (v3 === Infinity) {
          return -1;
        }
        if (v3 === -Infinity) {
          return 1;
        }
        var n2 = parseValue2(v3), a6 = this.value, b5 = n2.value;
        if (this.sign !== n2.sign) {
          return n2.sign ? 1 : -1;
        }
        if (n2.isSmall) {
          return this.sign ? -1 : 1;
        }
        return compareAbs(a6, b5) * (this.sign ? -1 : 1);
      };
      BigInteger.prototype.compareTo = BigInteger.prototype.compare;
      SmallInteger.prototype.compare = function(v3) {
        if (v3 === Infinity) {
          return -1;
        }
        if (v3 === -Infinity) {
          return 1;
        }
        var n2 = parseValue2(v3), a6 = this.value, b5 = n2.value;
        if (n2.isSmall) {
          return a6 == b5 ? 0 : a6 > b5 ? 1 : -1;
        }
        if (a6 < 0 !== n2.sign) {
          return a6 < 0 ? -1 : 1;
        }
        return a6 < 0 ? 1 : -1;
      };
      SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
      NativeBigInt.prototype.compare = function(v3) {
        if (v3 === Infinity) {
          return -1;
        }
        if (v3 === -Infinity) {
          return 1;
        }
        var a6 = this.value;
        var b5 = parseValue2(v3).value;
        return a6 === b5 ? 0 : a6 > b5 ? 1 : -1;
      };
      NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
      BigInteger.prototype.equals = function(v3) {
        return this.compare(v3) === 0;
      };
      NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
      BigInteger.prototype.notEquals = function(v3) {
        return this.compare(v3) !== 0;
      };
      NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
      BigInteger.prototype.greater = function(v3) {
        return this.compare(v3) > 0;
      };
      NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
      BigInteger.prototype.lesser = function(v3) {
        return this.compare(v3) < 0;
      };
      NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
      BigInteger.prototype.greaterOrEquals = function(v3) {
        return this.compare(v3) >= 0;
      };
      NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
      BigInteger.prototype.lesserOrEquals = function(v3) {
        return this.compare(v3) <= 0;
      };
      NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
      BigInteger.prototype.isEven = function() {
        return (this.value[0] & 1) === 0;
      };
      SmallInteger.prototype.isEven = function() {
        return (this.value & 1) === 0;
      };
      NativeBigInt.prototype.isEven = function() {
        return (this.value & BigInt(1)) === BigInt(0);
      };
      BigInteger.prototype.isOdd = function() {
        return (this.value[0] & 1) === 1;
      };
      SmallInteger.prototype.isOdd = function() {
        return (this.value & 1) === 1;
      };
      NativeBigInt.prototype.isOdd = function() {
        return (this.value & BigInt(1)) === BigInt(1);
      };
      BigInteger.prototype.isPositive = function() {
        return !this.sign;
      };
      SmallInteger.prototype.isPositive = function() {
        return this.value > 0;
      };
      NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
      BigInteger.prototype.isNegative = function() {
        return this.sign;
      };
      SmallInteger.prototype.isNegative = function() {
        return this.value < 0;
      };
      NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
      BigInteger.prototype.isUnit = function() {
        return false;
      };
      SmallInteger.prototype.isUnit = function() {
        return Math.abs(this.value) === 1;
      };
      NativeBigInt.prototype.isUnit = function() {
        return this.abs().value === BigInt(1);
      };
      BigInteger.prototype.isZero = function() {
        return false;
      };
      SmallInteger.prototype.isZero = function() {
        return this.value === 0;
      };
      NativeBigInt.prototype.isZero = function() {
        return this.value === BigInt(0);
      };
      BigInteger.prototype.isDivisibleBy = function(v3) {
        var n2 = parseValue2(v3);
        if (n2.isZero())
          return false;
        if (n2.isUnit())
          return true;
        if (n2.compareAbs(2) === 0)
          return this.isEven();
        return this.mod(n2).isZero();
      };
      NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
      function isBasicPrime(v3) {
        var n2 = v3.abs();
        if (n2.isUnit())
          return false;
        if (n2.equals(2) || n2.equals(3) || n2.equals(5))
          return true;
        if (n2.isEven() || n2.isDivisibleBy(3) || n2.isDivisibleBy(5))
          return false;
        if (n2.lesser(49))
          return true;
      }
      function millerRabinTest(n2, a6) {
        var nPrev = n2.prev(), b5 = nPrev, r3 = 0, d6, t5, i6, x6;
        while (b5.isEven())
          b5 = b5.divide(2), r3++;
        next:
          for (i6 = 0; i6 < a6.length; i6++) {
            if (n2.lesser(a6[i6]))
              continue;
            x6 = bigInt(a6[i6]).modPow(b5, n2);
            if (x6.isUnit() || x6.equals(nPrev))
              continue;
            for (d6 = r3 - 1; d6 != 0; d6--) {
              x6 = x6.square().mod(n2);
              if (x6.isUnit())
                return false;
              if (x6.equals(nPrev))
                continue next;
            }
            return false;
          }
        return true;
      }
      BigInteger.prototype.isPrime = function(strict) {
        var isPrime = isBasicPrime(this);
        if (isPrime !== undefined2)
          return isPrime;
        var n2 = this.abs();
        var bits = n2.bitLength();
        if (bits <= 64)
          return millerRabinTest(n2, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
        var logN = Math.log(2) * bits.toJSNumber();
        var t5 = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN);
        for (var a6 = [], i6 = 0; i6 < t5; i6++) {
          a6.push(bigInt(i6 + 2));
        }
        return millerRabinTest(n2, a6);
      };
      NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
      BigInteger.prototype.isProbablePrime = function(iterations, rng) {
        var isPrime = isBasicPrime(this);
        if (isPrime !== undefined2)
          return isPrime;
        var n2 = this.abs();
        var t5 = iterations === undefined2 ? 5 : iterations;
        for (var a6 = [], i6 = 0; i6 < t5; i6++) {
          a6.push(bigInt.randBetween(2, n2.minus(2), rng));
        }
        return millerRabinTest(n2, a6);
      };
      NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
      BigInteger.prototype.modInv = function(n2) {
        var t5 = bigInt.zero, newT = bigInt.one, r3 = parseValue2(n2), newR = this.abs(), q6, lastT, lastR;
        while (!newR.isZero()) {
          q6 = r3.divide(newR);
          lastT = t5;
          lastR = r3;
          t5 = newT;
          r3 = newR;
          newT = lastT.subtract(q6.multiply(newT));
          newR = lastR.subtract(q6.multiply(newR));
        }
        if (!r3.isUnit())
          throw new Error(this.toString() + " and " + n2.toString() + " are not co-prime");
        if (t5.compare(0) === -1) {
          t5 = t5.add(n2);
        }
        if (this.isNegative()) {
          return t5.negate();
        }
        return t5;
      };
      NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
      BigInteger.prototype.next = function() {
        var value = this.value;
        if (this.sign) {
          return subtractSmall(value, 1, this.sign);
        }
        return new BigInteger(addSmall(value, 1), this.sign);
      };
      SmallInteger.prototype.next = function() {
        var value = this.value;
        if (value + 1 < MAX_INT)
          return new SmallInteger(value + 1);
        return new BigInteger(MAX_INT_ARR, false);
      };
      NativeBigInt.prototype.next = function() {
        return new NativeBigInt(this.value + BigInt(1));
      };
      BigInteger.prototype.prev = function() {
        var value = this.value;
        if (this.sign) {
          return new BigInteger(addSmall(value, 1), true);
        }
        return subtractSmall(value, 1, this.sign);
      };
      SmallInteger.prototype.prev = function() {
        var value = this.value;
        if (value - 1 > -MAX_INT)
          return new SmallInteger(value - 1);
        return new BigInteger(MAX_INT_ARR, true);
      };
      NativeBigInt.prototype.prev = function() {
        return new NativeBigInt(this.value - BigInt(1));
      };
      var powersOfTwo = [1];
      while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE)
        powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
      var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
      function shift_isSmall(n2) {
        return Math.abs(n2) <= BASE;
      }
      BigInteger.prototype.shiftLeft = function(v3) {
        var n2 = parseValue2(v3).toJSNumber();
        if (!shift_isSmall(n2)) {
          throw new Error(String(n2) + " is too large for shifting.");
        }
        if (n2 < 0)
          return this.shiftRight(-n2);
        var result = this;
        if (result.isZero())
          return result;
        while (n2 >= powers2Length) {
          result = result.multiply(highestPower2);
          n2 -= powers2Length - 1;
        }
        return result.multiply(powersOfTwo[n2]);
      };
      NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
      BigInteger.prototype.shiftRight = function(v3) {
        var remQuo;
        var n2 = parseValue2(v3).toJSNumber();
        if (!shift_isSmall(n2)) {
          throw new Error(String(n2) + " is too large for shifting.");
        }
        if (n2 < 0)
          return this.shiftLeft(-n2);
        var result = this;
        while (n2 >= powers2Length) {
          if (result.isZero() || result.isNegative() && result.isUnit())
            return result;
          remQuo = divModAny(result, highestPower2);
          result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
          n2 -= powers2Length - 1;
        }
        remQuo = divModAny(result, powersOfTwo[n2]);
        return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
      };
      NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
      function bitwise(x6, y6, fn2) {
        y6 = parseValue2(y6);
        var xSign = x6.isNegative(), ySign = y6.isNegative();
        var xRem = xSign ? x6.not() : x6, yRem = ySign ? y6.not() : y6;
        var xDigit = 0, yDigit = 0;
        var xDivMod = null, yDivMod = null;
        var result = [];
        while (!xRem.isZero() || !yRem.isZero()) {
          xDivMod = divModAny(xRem, highestPower2);
          xDigit = xDivMod[1].toJSNumber();
          if (xSign) {
            xDigit = highestPower2 - 1 - xDigit;
          }
          yDivMod = divModAny(yRem, highestPower2);
          yDigit = yDivMod[1].toJSNumber();
          if (ySign) {
            yDigit = highestPower2 - 1 - yDigit;
          }
          xRem = xDivMod[0];
          yRem = yDivMod[0];
          result.push(fn2(xDigit, yDigit));
        }
        var sum2 = fn2(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
        for (var i6 = result.length - 1; i6 >= 0; i6 -= 1) {
          sum2 = sum2.multiply(highestPower2).add(bigInt(result[i6]));
        }
        return sum2;
      }
      BigInteger.prototype.not = function() {
        return this.negate().prev();
      };
      NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
      BigInteger.prototype.and = function(n2) {
        return bitwise(this, n2, function(a6, b5) {
          return a6 & b5;
        });
      };
      NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
      BigInteger.prototype.or = function(n2) {
        return bitwise(this, n2, function(a6, b5) {
          return a6 | b5;
        });
      };
      NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
      BigInteger.prototype.xor = function(n2) {
        return bitwise(this, n2, function(a6, b5) {
          return a6 ^ b5;
        });
      };
      NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
      var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
      function roughLOB(n2) {
        var v3 = n2.value, x6 = typeof v3 === "number" ? v3 | LOBMASK_I : typeof v3 === "bigint" ? v3 | BigInt(LOBMASK_I) : v3[0] + v3[1] * BASE | LOBMASK_BI;
        return x6 & -x6;
      }
      function integerLogarithm(value, base2) {
        if (base2.compareTo(value) <= 0) {
          var tmp = integerLogarithm(value, base2.square(base2));
          var p4 = tmp.p;
          var e5 = tmp.e;
          var t5 = p4.multiply(base2);
          return t5.compareTo(value) <= 0 ? { p: t5, e: e5 * 2 + 1 } : { p: p4, e: e5 * 2 };
        }
        return { p: bigInt(1), e: 0 };
      }
      BigInteger.prototype.bitLength = function() {
        var n2 = this;
        if (n2.compareTo(bigInt(0)) < 0) {
          n2 = n2.negate().subtract(bigInt(1));
        }
        if (n2.compareTo(bigInt(0)) === 0) {
          return bigInt(0);
        }
        return bigInt(integerLogarithm(n2, bigInt(2)).e).add(bigInt(1));
      };
      NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
      function max(a6, b5) {
        a6 = parseValue2(a6);
        b5 = parseValue2(b5);
        return a6.greater(b5) ? a6 : b5;
      }
      function min(a6, b5) {
        a6 = parseValue2(a6);
        b5 = parseValue2(b5);
        return a6.lesser(b5) ? a6 : b5;
      }
      function gcd(a6, b5) {
        a6 = parseValue2(a6).abs();
        b5 = parseValue2(b5).abs();
        if (a6.equals(b5))
          return a6;
        if (a6.isZero())
          return b5;
        if (b5.isZero())
          return a6;
        var c5 = Integer[1], d6, t5;
        while (a6.isEven() && b5.isEven()) {
          d6 = min(roughLOB(a6), roughLOB(b5));
          a6 = a6.divide(d6);
          b5 = b5.divide(d6);
          c5 = c5.multiply(d6);
        }
        while (a6.isEven()) {
          a6 = a6.divide(roughLOB(a6));
        }
        do {
          while (b5.isEven()) {
            b5 = b5.divide(roughLOB(b5));
          }
          if (a6.greater(b5)) {
            t5 = b5;
            b5 = a6;
            a6 = t5;
          }
          b5 = b5.subtract(a6);
        } while (!b5.isZero());
        return c5.isUnit() ? a6 : a6.multiply(c5);
      }
      function lcm(a6, b5) {
        a6 = parseValue2(a6).abs();
        b5 = parseValue2(b5).abs();
        return a6.divide(gcd(a6, b5)).multiply(b5);
      }
      function randBetween(a6, b5, rng) {
        a6 = parseValue2(a6);
        b5 = parseValue2(b5);
        var usedRNG = rng || Math.random;
        var low = min(a6, b5), high = max(a6, b5);
        var range = high.subtract(low).add(1);
        if (range.isSmall)
          return low.add(Math.floor(usedRNG() * range));
        var digits = toBase(range, BASE).value;
        var result = [], restricted = true;
        for (var i6 = 0; i6 < digits.length; i6++) {
          var top = restricted ? digits[i6] + (i6 + 1 < digits.length ? digits[i6 + 1] / BASE : 0) : BASE;
          var digit = truncate(usedRNG() * top);
          result.push(digit);
          if (digit < digits[i6])
            restricted = false;
        }
        return low.add(Integer.fromArray(result, BASE, false));
      }
      var parseBase = function(text, base2, alphabet, caseSensitive) {
        alphabet = alphabet || DEFAULT_ALPHABET;
        text = String(text);
        if (!caseSensitive) {
          text = text.toLowerCase();
          alphabet = alphabet.toLowerCase();
        }
        var length = text.length;
        var i6;
        var absBase = Math.abs(base2);
        var alphabetValues = {};
        for (i6 = 0; i6 < alphabet.length; i6++) {
          alphabetValues[alphabet[i6]] = i6;
        }
        for (i6 = 0; i6 < length; i6++) {
          var c5 = text[i6];
          if (c5 === "-")
            continue;
          if (c5 in alphabetValues) {
            if (alphabetValues[c5] >= absBase) {
              if (c5 === "1" && absBase === 1)
                continue;
              throw new Error(c5 + " is not a valid digit in base " + base2 + ".");
            }
          }
        }
        base2 = parseValue2(base2);
        var digits = [];
        var isNegative = text[0] === "-";
        for (i6 = isNegative ? 1 : 0; i6 < text.length; i6++) {
          var c5 = text[i6];
          if (c5 in alphabetValues)
            digits.push(parseValue2(alphabetValues[c5]));
          else if (c5 === "<") {
            var start = i6;
            do {
              i6++;
            } while (text[i6] !== ">" && i6 < text.length);
            digits.push(parseValue2(text.slice(start + 1, i6)));
          } else
            throw new Error(c5 + " is not a valid character");
        }
        return parseBaseFromArray(digits, base2, isNegative);
      };
      function parseBaseFromArray(digits, base2, isNegative) {
        var val = Integer[0], pow = Integer[1], i6;
        for (i6 = digits.length - 1; i6 >= 0; i6--) {
          val = val.add(digits[i6].times(pow));
          pow = pow.times(base2);
        }
        return isNegative ? val.negate() : val;
      }
      function stringify(digit, alphabet) {
        alphabet = alphabet || DEFAULT_ALPHABET;
        if (digit < alphabet.length) {
          return alphabet[digit];
        }
        return "<" + digit + ">";
      }
      function toBase(n2, base2) {
        base2 = bigInt(base2);
        if (base2.isZero()) {
          if (n2.isZero())
            return { value: [0], isNegative: false };
          throw new Error("Cannot convert nonzero numbers to base 0.");
        }
        if (base2.equals(-1)) {
          if (n2.isZero())
            return { value: [0], isNegative: false };
          if (n2.isNegative())
            return {
              value: [].concat.apply(
                [],
                Array.apply(null, Array(-n2.toJSNumber())).map(Array.prototype.valueOf, [1, 0])
              ),
              isNegative: false
            };
          var arr = Array.apply(null, Array(n2.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]);
          arr.unshift([1]);
          return {
            value: [].concat.apply([], arr),
            isNegative: false
          };
        }
        var neg = false;
        if (n2.isNegative() && base2.isPositive()) {
          neg = true;
          n2 = n2.abs();
        }
        if (base2.isUnit()) {
          if (n2.isZero())
            return { value: [0], isNegative: false };
          return {
            value: Array.apply(null, Array(n2.toJSNumber())).map(Number.prototype.valueOf, 1),
            isNegative: neg
          };
        }
        var out = [];
        var left = n2, divmod;
        while (left.isNegative() || left.compareAbs(base2) >= 0) {
          divmod = left.divmod(base2);
          left = divmod.quotient;
          var digit = divmod.remainder;
          if (digit.isNegative()) {
            digit = base2.minus(digit).abs();
            left = left.next();
          }
          out.push(digit.toJSNumber());
        }
        out.push(left.toJSNumber());
        return { value: out.reverse(), isNegative: neg };
      }
      function toBaseString(n2, base2, alphabet) {
        var arr = toBase(n2, base2);
        return (arr.isNegative ? "-" : "") + arr.value.map(function(x6) {
          return stringify(x6, alphabet);
        }).join("");
      }
      BigInteger.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      SmallInteger.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      NativeBigInt.prototype.toArray = function(radix) {
        return toBase(this, radix);
      };
      BigInteger.prototype.toString = function(radix, alphabet) {
        if (radix === undefined2)
          radix = 10;
        if (radix !== 10 || alphabet)
          return toBaseString(this, radix, alphabet);
        var v3 = this.value, l3 = v3.length, str = String(v3[--l3]), zeros = "0000000", digit;
        while (--l3 >= 0) {
          digit = String(v3[l3]);
          str += zeros.slice(digit.length) + digit;
        }
        var sign3 = this.sign ? "-" : "";
        return sign3 + str;
      };
      SmallInteger.prototype.toString = function(radix, alphabet) {
        if (radix === undefined2)
          radix = 10;
        if (radix != 10 || alphabet)
          return toBaseString(this, radix, alphabet);
        return String(this.value);
      };
      NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
      NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() {
        return this.toString();
      };
      BigInteger.prototype.valueOf = function() {
        return parseInt(this.toString(), 10);
      };
      BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
      SmallInteger.prototype.valueOf = function() {
        return this.value;
      };
      SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
      NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() {
        return parseInt(this.toString(), 10);
      };
      function parseStringValue(v3) {
        if (isPrecise(+v3)) {
          var x6 = +v3;
          if (x6 === truncate(x6))
            return supportsNativeBigInt ? new NativeBigInt(BigInt(x6)) : new SmallInteger(x6);
          throw new Error("Invalid integer: " + v3);
        }
        var sign3 = v3[0] === "-";
        if (sign3)
          v3 = v3.slice(1);
        var split = v3.split(/e/i);
        if (split.length > 2)
          throw new Error("Invalid integer: " + split.join("e"));
        if (split.length === 2) {
          var exp = split[1];
          if (exp[0] === "+")
            exp = exp.slice(1);
          exp = +exp;
          if (exp !== truncate(exp) || !isPrecise(exp))
            throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
          var text = split[0];
          var decimalPlace = text.indexOf(".");
          if (decimalPlace >= 0) {
            exp -= text.length - decimalPlace - 1;
            text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
          }
          if (exp < 0)
            throw new Error("Cannot include negative exponent part for integers");
          text += new Array(exp + 1).join("0");
          v3 = text;
        }
        var isValid3 = /^([0-9][0-9]*)$/.test(v3);
        if (!isValid3)
          throw new Error("Invalid integer: " + v3);
        if (supportsNativeBigInt) {
          return new NativeBigInt(BigInt(sign3 ? "-" + v3 : v3));
        }
        var r3 = [], max2 = v3.length, l3 = LOG_BASE, min2 = max2 - l3;
        while (max2 > 0) {
          r3.push(+v3.slice(min2, max2));
          min2 -= l3;
          if (min2 < 0)
            min2 = 0;
          max2 -= l3;
        }
        trim(r3);
        return new BigInteger(r3, sign3);
      }
      function parseNumberValue(v3) {
        if (supportsNativeBigInt) {
          return new NativeBigInt(BigInt(v3));
        }
        if (isPrecise(v3)) {
          if (v3 !== truncate(v3))
            throw new Error(v3 + " is not an integer.");
          return new SmallInteger(v3);
        }
        return parseStringValue(v3.toString());
      }
      function parseValue2(v3) {
        if (typeof v3 === "number") {
          return parseNumberValue(v3);
        }
        if (typeof v3 === "string") {
          return parseStringValue(v3);
        }
        if (typeof v3 === "bigint") {
          return new NativeBigInt(v3);
        }
        return v3;
      }
      for (var i5 = 0; i5 < 1e3; i5++) {
        Integer[i5] = parseValue2(i5);
        if (i5 > 0)
          Integer[-i5] = parseValue2(-i5);
      }
      Integer.one = Integer[1];
      Integer.zero = Integer[0];
      Integer.minusOne = Integer[-1];
      Integer.max = max;
      Integer.min = min;
      Integer.gcd = gcd;
      Integer.lcm = lcm;
      Integer.isInstance = function(x6) {
        return x6 instanceof BigInteger || x6 instanceof SmallInteger || x6 instanceof NativeBigInt;
      };
      Integer.randBetween = randBetween;
      Integer.fromArray = function(digits, base2, isNegative) {
        return parseBaseFromArray(digits.map(parseValue2), parseValue2(base2 || 10), isNegative);
      };
      return Integer;
    }();
    if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
      module.exports = bigInt;
    }
    if (typeof define === "function" && define.amd) {
      define(function() {
        return bigInt;
      });
    }
  }
});

// ../../node_modules/.pnpm/jed@1.1.1/node_modules/jed/jed.js
var require_jed = __commonJS({
  "../../node_modules/.pnpm/jed@1.1.1/node_modules/jed/jed.js"(exports, module) {
    (function(root, undef) {
      var ArrayProto = Array.prototype, ObjProto = Object.prototype, slice = ArrayProto.slice, hasOwnProp = ObjProto.hasOwnProperty, nativeForEach = ArrayProto.forEach, breaker = {};
      var _3 = {
        forEach: function(obj, iterator, context) {
          var i5, l3, key;
          if (obj === null) {
            return;
          }
          if (nativeForEach && obj.forEach === nativeForEach) {
            obj.forEach(iterator, context);
          } else if (obj.length === +obj.length) {
            for (i5 = 0, l3 = obj.length; i5 < l3; i5++) {
              if (i5 in obj && iterator.call(context, obj[i5], i5, obj) === breaker) {
                return;
              }
            }
          } else {
            for (key in obj) {
              if (hasOwnProp.call(obj, key)) {
                if (iterator.call(context, obj[key], key, obj) === breaker) {
                  return;
                }
              }
            }
          }
        },
        extend: function(obj) {
          this.forEach(slice.call(arguments, 1), function(source) {
            for (var prop in source) {
              obj[prop] = source[prop];
            }
          });
          return obj;
        }
      };
      var Jed2 = function(options) {
        this.defaults = {
          "locale_data": {
            "messages": {
              "": {
                "domain": "messages",
                "lang": "en",
                "plural_forms": "nplurals=2; plural=(n != 1);"
              }
              // There are no default keys, though
            }
          },
          // The default domain if one is missing
          "domain": "messages",
          // enable debug mode to log untranslated strings to the console
          "debug": false
        };
        this.options = _3.extend({}, this.defaults, options);
        this.textdomain(this.options.domain);
        if (options.domain && !this.options.locale_data[this.options.domain]) {
          throw new Error("Text domain set to non-existent domain: `" + options.domain + "`");
        }
      };
      Jed2.context_delimiter = String.fromCharCode(4);
      function getPluralFormFunc(plural_form_string) {
        return Jed2.PF.compile(plural_form_string || "nplurals=2; plural=(n != 1);");
      }
      function Chain(key, i18n2) {
        this._key = key;
        this._i18n = i18n2;
      }
      _3.extend(Chain.prototype, {
        onDomain: function(domain) {
          this._domain = domain;
          return this;
        },
        withContext: function(context) {
          this._context = context;
          return this;
        },
        ifPlural: function(num, pkey) {
          this._val = num;
          this._pkey = pkey;
          return this;
        },
        fetch: function(sArr) {
          if ({}.toString.call(sArr) != "[object Array]") {
            sArr = [].slice.call(arguments, 0);
          }
          return (sArr && sArr.length ? Jed2.sprintf : function(x6) {
            return x6;
          })(
            this._i18n.dcnpgettext(this._domain, this._context, this._key, this._pkey, this._val),
            sArr
          );
        }
      });
      _3.extend(Jed2.prototype, {
        // The sexier api start point
        translate: function(key) {
          return new Chain(key, this);
        },
        textdomain: function(domain) {
          if (!domain) {
            return this._textdomain;
          }
          this._textdomain = domain;
        },
        gettext: function(key) {
          return this.dcnpgettext.call(this, undef, undef, key);
        },
        dgettext: function(domain, key) {
          return this.dcnpgettext.call(this, domain, undef, key);
        },
        dcgettext: function(domain, key) {
          return this.dcnpgettext.call(this, domain, undef, key);
        },
        ngettext: function(skey, pkey, val) {
          return this.dcnpgettext.call(this, undef, undef, skey, pkey, val);
        },
        dngettext: function(domain, skey, pkey, val) {
          return this.dcnpgettext.call(this, domain, undef, skey, pkey, val);
        },
        dcngettext: function(domain, skey, pkey, val) {
          return this.dcnpgettext.call(this, domain, undef, skey, pkey, val);
        },
        pgettext: function(context, key) {
          return this.dcnpgettext.call(this, undef, context, key);
        },
        dpgettext: function(domain, context, key) {
          return this.dcnpgettext.call(this, domain, context, key);
        },
        dcpgettext: function(domain, context, key) {
          return this.dcnpgettext.call(this, domain, context, key);
        },
        npgettext: function(context, skey, pkey, val) {
          return this.dcnpgettext.call(this, undef, context, skey, pkey, val);
        },
        dnpgettext: function(domain, context, skey, pkey, val) {
          return this.dcnpgettext.call(this, domain, context, skey, pkey, val);
        },
        // The most fully qualified gettext function. It has every option.
        // Since it has every option, we can use it from every other method.
        // This is the bread and butter.
        // Technically there should be one more argument in this function for 'Category',
        // but since we never use it, we might as well not waste the bytes to define it.
        dcnpgettext: function(domain, context, singular_key, plural_key, val) {
          plural_key = plural_key || singular_key;
          domain = domain || this._textdomain;
          var fallback;
          if (!this.options) {
            fallback = new Jed2();
            return fallback.dcnpgettext.call(fallback, void 0, void 0, singular_key, plural_key, val);
          }
          if (!this.options.locale_data) {
            throw new Error("No locale data provided.");
          }
          if (!this.options.locale_data[domain]) {
            throw new Error("Domain `" + domain + "` was not found.");
          }
          if (!this.options.locale_data[domain][""]) {
            throw new Error("No locale meta information provided.");
          }
          if (!singular_key) {
            throw new Error("No translation key found.");
          }
          var key = context ? context + Jed2.context_delimiter + singular_key : singular_key, locale_data = this.options.locale_data, dict = locale_data[domain], defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""], pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"], val_list, res;
          var val_idx;
          if (val === void 0) {
            val_idx = 0;
          } else {
            if (typeof val != "number") {
              val = parseInt(val, 10);
              if (isNaN(val)) {
                throw new Error("The number that was passed in is not a number.");
              }
            }
            val_idx = getPluralFormFunc(pluralForms)(val);
          }
          if (!dict) {
            throw new Error("No domain named `" + domain + "` could be found.");
          }
          val_list = dict[key];
          if (!val_list || val_idx > val_list.length) {
            if (this.options.missing_key_callback) {
              this.options.missing_key_callback(key, domain);
            }
            res = [singular_key, plural_key];
            if (this.options.debug === true) {
              console.log(res[getPluralFormFunc(pluralForms)(val)]);
            }
            return res[getPluralFormFunc()(val)];
          }
          res = val_list[val_idx];
          if (!res) {
            res = [singular_key, plural_key];
            return res[getPluralFormFunc()(val)];
          }
          return res;
        }
      });
      var sprintf = function() {
        function get_type(variable) {
          return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
        }
        function str_repeat(input, multiplier) {
          for (var output = []; multiplier > 0; output[--multiplier] = input) {
          }
          return output.join("");
        }
        var str_format = function() {
          if (!str_format.cache.hasOwnProperty(arguments[0])) {
            str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
          }
          return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
        };
        str_format.format = function(parse_tree, argv) {
          var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i5, k6, match6, pad, pad_character, pad_length;
          for (i5 = 0; i5 < tree_length; i5++) {
            node_type = get_type(parse_tree[i5]);
            if (node_type === "string") {
              output.push(parse_tree[i5]);
            } else if (node_type === "array") {
              match6 = parse_tree[i5];
              if (match6[2]) {
                arg = argv[cursor];
                for (k6 = 0; k6 < match6[2].length; k6++) {
                  if (!arg.hasOwnProperty(match6[2][k6])) {
                    throw sprintf('[sprintf] property "%s" does not exist', match6[2][k6]);
                  }
                  arg = arg[match6[2][k6]];
                }
              } else if (match6[1]) {
                arg = argv[match6[1]];
              } else {
                arg = argv[cursor++];
              }
              if (/[^s]/.test(match6[8]) && get_type(arg) != "number") {
                throw sprintf("[sprintf] expecting number but found %s", get_type(arg));
              }
              if (typeof arg == "undefined" || arg === null) {
                arg = "";
              }
              switch (match6[8]) {
                case "b":
                  arg = arg.toString(2);
                  break;
                case "c":
                  arg = String.fromCharCode(arg);
                  break;
                case "d":
                  arg = parseInt(arg, 10);
                  break;
                case "e":
                  arg = match6[7] ? arg.toExponential(match6[7]) : arg.toExponential();
                  break;
                case "f":
                  arg = match6[7] ? parseFloat(arg).toFixed(match6[7]) : parseFloat(arg);
                  break;
                case "o":
                  arg = arg.toString(8);
                  break;
                case "s":
                  arg = (arg = String(arg)) && match6[7] ? arg.substring(0, match6[7]) : arg;
                  break;
                case "u":
                  arg = Math.abs(arg);
                  break;
                case "x":
                  arg = arg.toString(16);
                  break;
                case "X":
                  arg = arg.toString(16).toUpperCase();
                  break;
              }
              arg = /[def]/.test(match6[8]) && match6[3] && arg >= 0 ? "+" + arg : arg;
              pad_character = match6[4] ? match6[4] == "0" ? "0" : match6[4].charAt(1) : " ";
              pad_length = match6[6] - String(arg).length;
              pad = match6[6] ? str_repeat(pad_character, pad_length) : "";
              output.push(match6[5] ? arg + pad : pad + arg);
            }
          }
          return output.join("");
        };
        str_format.cache = {};
        str_format.parse = function(fmt) {
          var _fmt = fmt, match6 = [], parse_tree = [], arg_names = 0;
          while (_fmt) {
            if ((match6 = /^[^\x25]+/.exec(_fmt)) !== null) {
              parse_tree.push(match6[0]);
            } else if ((match6 = /^\x25{2}/.exec(_fmt)) !== null) {
              parse_tree.push("%");
            } else if ((match6 = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
              if (match6[2]) {
                arg_names |= 1;
                var field_list = [], replacement_field = match6[2], field_match = [];
                if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
                  field_list.push(field_match[1]);
                  while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") {
                    if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
                      field_list.push(field_match[1]);
                    } else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
                      field_list.push(field_match[1]);
                    } else {
                      throw "[sprintf] huh?";
                    }
                  }
                } else {
                  throw "[sprintf] huh?";
                }
                match6[2] = field_list;
              } else {
                arg_names |= 2;
              }
              if (arg_names === 3) {
                throw "[sprintf] mixing positional and named placeholders is not (yet) supported";
              }
              parse_tree.push(match6);
            } else {
              throw "[sprintf] huh?";
            }
            _fmt = _fmt.substring(match6[0].length);
          }
          return parse_tree;
        };
        return str_format;
      }();
      var vsprintf = function(fmt, argv) {
        argv.unshift(fmt);
        return sprintf.apply(null, argv);
      };
      Jed2.parse_plural = function(plural_forms, n2) {
        plural_forms = plural_forms.replace(/n/g, n2);
        return Jed2.parse_expression(plural_forms);
      };
      Jed2.sprintf = function(fmt, args) {
        if ({}.toString.call(args) == "[object Array]") {
          return vsprintf(fmt, [].slice.call(args));
        }
        return sprintf.apply(this, [].slice.call(arguments));
      };
      Jed2.prototype.sprintf = function() {
        return Jed2.sprintf.apply(this, arguments);
      };
      Jed2.PF = {};
      Jed2.PF.parse = function(p4) {
        var plural_str = Jed2.PF.extractPluralExpr(p4);
        return Jed2.PF.parser.parse.call(Jed2.PF.parser, plural_str);
      };
      Jed2.PF.compile = function(p4) {
        function imply(val) {
          return val === true ? 1 : val ? val : 0;
        }
        var ast = Jed2.PF.parse(p4);
        return function(n2) {
          return imply(Jed2.PF.interpreter(ast)(n2));
        };
      };
      Jed2.PF.interpreter = function(ast) {
        return function(n2) {
          var res;
          switch (ast.type) {
            case "GROUP":
              return Jed2.PF.interpreter(ast.expr)(n2);
            case "TERNARY":
              if (Jed2.PF.interpreter(ast.expr)(n2)) {
                return Jed2.PF.interpreter(ast.truthy)(n2);
              }
              return Jed2.PF.interpreter(ast.falsey)(n2);
            case "OR":
              return Jed2.PF.interpreter(ast.left)(n2) || Jed2.PF.interpreter(ast.right)(n2);
            case "AND":
              return Jed2.PF.interpreter(ast.left)(n2) && Jed2.PF.interpreter(ast.right)(n2);
            case "LT":
              return Jed2.PF.interpreter(ast.left)(n2) < Jed2.PF.interpreter(ast.right)(n2);
            case "GT":
              return Jed2.PF.interpreter(ast.left)(n2) > Jed2.PF.interpreter(ast.right)(n2);
            case "LTE":
              return Jed2.PF.interpreter(ast.left)(n2) <= Jed2.PF.interpreter(ast.right)(n2);
            case "GTE":
              return Jed2.PF.interpreter(ast.left)(n2) >= Jed2.PF.interpreter(ast.right)(n2);
            case "EQ":
              return Jed2.PF.interpreter(ast.left)(n2) == Jed2.PF.interpreter(ast.right)(n2);
            case "NEQ":
              return Jed2.PF.interpreter(ast.left)(n2) != Jed2.PF.interpreter(ast.right)(n2);
            case "MOD":
              return Jed2.PF.interpreter(ast.left)(n2) % Jed2.PF.interpreter(ast.right)(n2);
            case "VAR":
              return n2;
            case "NUM":
              return ast.val;
            default:
              throw new Error("Invalid Token found.");
          }
        };
      };
      Jed2.PF.extractPluralExpr = function(p4) {
        p4 = p4.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
        if (!/;\s*$/.test(p4)) {
          p4 = p4.concat(";");
        }
        var nplurals_re = /nplurals\=(\d+);/, plural_re = /plural\=(.*);/, nplurals_matches = p4.match(nplurals_re), res = {}, plural_matches;
        if (nplurals_matches.length > 1) {
          res.nplurals = nplurals_matches[1];
        } else {
          throw new Error("nplurals not found in plural_forms string: " + p4);
        }
        p4 = p4.replace(nplurals_re, "");
        plural_matches = p4.match(plural_re);
        if (!(plural_matches && plural_matches.length > 1)) {
          throw new Error("`plural` expression not found: " + p4);
        }
        return plural_matches[1];
      };
      Jed2.PF.parser = function() {
        var parser = {
          trace: function trace() {
          },
          yy: {},
          symbols_: { "error": 2, "expressions": 3, "e": 4, "EOF": 5, "?": 6, ":": 7, "||": 8, "&&": 9, "<": 10, "<=": 11, ">": 12, ">=": 13, "!=": 14, "==": 15, "%": 16, "(": 17, ")": 18, "n": 19, "NUMBER": 20, "$accept": 0, "$end": 1 },
          terminals_: { 2: "error", 5: "EOF", 6: "?", 7: ":", 8: "||", 9: "&&", 10: "<", 11: "<=", 12: ">", 13: ">=", 14: "!=", 15: "==", 16: "%", 17: "(", 18: ")", 19: "n", 20: "NUMBER" },
          productions_: [0, [3, 2], [4, 5], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 1], [4, 1]],
          performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
            var $0 = $$.length - 1;
            switch (yystate) {
              case 1:
                return { type: "GROUP", expr: $$[$0 - 1] };
                break;
              case 2:
                this.$ = { type: "TERNARY", expr: $$[$0 - 4], truthy: $$[$0 - 2], falsey: $$[$0] };
                break;
              case 3:
                this.$ = { type: "OR", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 4:
                this.$ = { type: "AND", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 5:
                this.$ = { type: "LT", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 6:
                this.$ = { type: "LTE", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 7:
                this.$ = { type: "GT", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 8:
                this.$ = { type: "GTE", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 9:
                this.$ = { type: "NEQ", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 10:
                this.$ = { type: "EQ", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 11:
                this.$ = { type: "MOD", left: $$[$0 - 2], right: $$[$0] };
                break;
              case 12:
                this.$ = { type: "GROUP", expr: $$[$0 - 1] };
                break;
              case 13:
                this.$ = { type: "VAR" };
                break;
              case 14:
                this.$ = { type: "NUM", val: Number(yytext) };
                break;
            }
          },
          table: [{ 3: 1, 4: 2, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 1: [3] }, { 5: [1, 6], 6: [1, 7], 8: [1, 8], 9: [1, 9], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16] }, { 4: 17, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 5: [2, 13], 6: [2, 13], 7: [2, 13], 8: [2, 13], 9: [2, 13], 10: [2, 13], 11: [2, 13], 12: [2, 13], 13: [2, 13], 14: [2, 13], 15: [2, 13], 16: [2, 13], 18: [2, 13] }, { 5: [2, 14], 6: [2, 14], 7: [2, 14], 8: [2, 14], 9: [2, 14], 10: [2, 14], 11: [2, 14], 12: [2, 14], 13: [2, 14], 14: [2, 14], 15: [2, 14], 16: [2, 14], 18: [2, 14] }, { 1: [2, 1] }, { 4: 18, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 19, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 20, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 21, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 22, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 23, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 24, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 25, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 26, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 4: 27, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 6: [1, 7], 8: [1, 8], 9: [1, 9], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16], 18: [1, 28] }, { 6: [1, 7], 7: [1, 29], 8: [1, 8], 9: [1, 9], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16] }, { 5: [2, 3], 6: [2, 3], 7: [2, 3], 8: [2, 3], 9: [1, 9], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16], 18: [2, 3] }, { 5: [2, 4], 6: [2, 4], 7: [2, 4], 8: [2, 4], 9: [2, 4], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16], 18: [2, 4] }, { 5: [2, 5], 6: [2, 5], 7: [2, 5], 8: [2, 5], 9: [2, 5], 10: [2, 5], 11: [2, 5], 12: [2, 5], 13: [2, 5], 14: [2, 5], 15: [2, 5], 16: [1, 16], 18: [2, 5] }, { 5: [2, 6], 6: [2, 6], 7: [2, 6], 8: [2, 6], 9: [2, 6], 10: [2, 6], 11: [2, 6], 12: [2, 6], 13: [2, 6], 14: [2, 6], 15: [2, 6], 16: [1, 16], 18: [2, 6] }, { 5: [2, 7], 6: [2, 7], 7: [2, 7], 8: [2, 7], 9: [2, 7], 10: [2, 7], 11: [2, 7], 12: [2, 7], 13: [2, 7], 14: [2, 7], 15: [2, 7], 16: [1, 16], 18: [2, 7] }, { 5: [2, 8], 6: [2, 8], 7: [2, 8], 8: [2, 8], 9: [2, 8], 10: [2, 8], 11: [2, 8], 12: [2, 8], 13: [2, 8], 14: [2, 8], 15: [2, 8], 16: [1, 16], 18: [2, 8] }, { 5: [2, 9], 6: [2, 9], 7: [2, 9], 8: [2, 9], 9: [2, 9], 10: [2, 9], 11: [2, 9], 12: [2, 9], 13: [2, 9], 14: [2, 9], 15: [2, 9], 16: [1, 16], 18: [2, 9] }, { 5: [2, 10], 6: [2, 10], 7: [2, 10], 8: [2, 10], 9: [2, 10], 10: [2, 10], 11: [2, 10], 12: [2, 10], 13: [2, 10], 14: [2, 10], 15: [2, 10], 16: [1, 16], 18: [2, 10] }, { 5: [2, 11], 6: [2, 11], 7: [2, 11], 8: [2, 11], 9: [2, 11], 10: [2, 11], 11: [2, 11], 12: [2, 11], 13: [2, 11], 14: [2, 11], 15: [2, 11], 16: [2, 11], 18: [2, 11] }, { 5: [2, 12], 6: [2, 12], 7: [2, 12], 8: [2, 12], 9: [2, 12], 10: [2, 12], 11: [2, 12], 12: [2, 12], 13: [2, 12], 14: [2, 12], 15: [2, 12], 16: [2, 12], 18: [2, 12] }, { 4: 30, 17: [1, 3], 19: [1, 4], 20: [1, 5] }, { 5: [2, 2], 6: [1, 7], 7: [2, 2], 8: [1, 8], 9: [1, 9], 10: [1, 10], 11: [1, 11], 12: [1, 12], 13: [1, 13], 14: [1, 14], 15: [1, 15], 16: [1, 16], 18: [2, 2] }],
          defaultActions: { 6: [2, 1] },
          parseError: function parseError(str, hash3) {
            throw new Error(str);
          },
          parse: function parse3(input) {
            var self2 = this, stack = [0], vstack = [null], lstack = [], table2 = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
            this.lexer.setInput(input);
            this.lexer.yy = this.yy;
            this.yy.lexer = this.lexer;
            if (typeof this.lexer.yylloc == "undefined")
              this.lexer.yylloc = {};
            var yyloc = this.lexer.yylloc;
            lstack.push(yyloc);
            if (typeof this.yy.parseError === "function")
              this.parseError = this.yy.parseError;
            function popStack(n2) {
              stack.length = stack.length - 2 * n2;
              vstack.length = vstack.length - n2;
              lstack.length = lstack.length - n2;
            }
            function lex() {
              var token;
              token = self2.lexer.lex() || 1;
              if (typeof token !== "number") {
                token = self2.symbols_[token] || token;
              }
              return token;
            }
            var symbol, preErrorSymbol, state, action, a6, r3, yyval = {}, p4, len, newState, expected;
            while (true) {
              state = stack[stack.length - 1];
              if (this.defaultActions[state]) {
                action = this.defaultActions[state];
              } else {
                if (symbol == null)
                  symbol = lex();
                action = table2[state] && table2[state][symbol];
              }
              _handle_error:
                if (typeof action === "undefined" || !action.length || !action[0]) {
                  if (!recovering) {
                    expected = [];
                    for (p4 in table2[state])
                      if (this.terminals_[p4] && p4 > 2) {
                        expected.push("'" + this.terminals_[p4] + "'");
                      }
                    var errStr = "";
                    if (this.lexer.showPosition) {
                      errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'";
                    } else {
                      errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
                    }
                    this.parseError(
                      errStr,
                      { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected }
                    );
                  }
                  if (recovering == 3) {
                    if (symbol == EOF) {
                      throw new Error(errStr || "Parsing halted.");
                    }
                    yyleng = this.lexer.yyleng;
                    yytext = this.lexer.yytext;
                    yylineno = this.lexer.yylineno;
                    yyloc = this.lexer.yylloc;
                    symbol = lex();
                  }
                  while (1) {
                    if (TERROR.toString() in table2[state]) {
                      break;
                    }
                    if (state == 0) {
                      throw new Error(errStr || "Parsing halted.");
                    }
                    popStack(1);
                    state = stack[stack.length - 1];
                  }
                  preErrorSymbol = symbol;
                  symbol = TERROR;
                  state = stack[stack.length - 1];
                  action = table2[state] && table2[state][TERROR];
                  recovering = 3;
                }
              if (action[0] instanceof Array && action.length > 1) {
                throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
              }
              switch (action[0]) {
                case 1:
                  stack.push(symbol);
                  vstack.push(this.lexer.yytext);
                  lstack.push(this.lexer.yylloc);
                  stack.push(action[1]);
                  symbol = null;
                  if (!preErrorSymbol) {
                    yyleng = this.lexer.yyleng;
                    yytext = this.lexer.yytext;
                    yylineno = this.lexer.yylineno;
                    yyloc = this.lexer.yylloc;
                    if (recovering > 0)
                      recovering--;
                  } else {
                    symbol = preErrorSymbol;
                    preErrorSymbol = null;
                  }
                  break;
                case 2:
                  len = this.productions_[action[1]][1];
                  yyval.$ = vstack[vstack.length - len];
                  yyval._$ = {
                    first_line: lstack[lstack.length - (len || 1)].first_line,
                    last_line: lstack[lstack.length - 1].last_line,
                    first_column: lstack[lstack.length - (len || 1)].first_column,
                    last_column: lstack[lstack.length - 1].last_column
                  };
                  r3 = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
                  if (typeof r3 !== "undefined") {
                    return r3;
                  }
                  if (len) {
                    stack = stack.slice(0, -1 * len * 2);
                    vstack = vstack.slice(0, -1 * len);
                    lstack = lstack.slice(0, -1 * len);
                  }
                  stack.push(this.productions_[action[1]][0]);
                  vstack.push(yyval.$);
                  lstack.push(yyval._$);
                  newState = table2[stack[stack.length - 2]][stack[stack.length - 1]];
                  stack.push(newState);
                  break;
                case 3:
                  return true;
              }
            }
            return true;
          }
        };
        var lexer = function() {
          var lexer2 = {
            EOF: 1,
            parseError: function parseError(str, hash3) {
              if (this.yy.parseError) {
                this.yy.parseError(str, hash3);
              } else {
                throw new Error(str);
              }
            },
            setInput: function(input) {
              this._input = input;
              this._more = this._less = this.done = false;
              this.yylineno = this.yyleng = 0;
              this.yytext = this.matched = this.match = "";
              this.conditionStack = ["INITIAL"];
              this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
              return this;
            },
            input: function() {
              var ch = this._input[0];
              this.yytext += ch;
              this.yyleng++;
              this.match += ch;
              this.matched += ch;
              var lines = ch.match(/\n/);
              if (lines)
                this.yylineno++;
              this._input = this._input.slice(1);
              return ch;
            },
            unput: function(ch) {
              this._input = ch + this._input;
              return this;
            },
            more: function() {
              this._more = true;
              return this;
            },
            pastInput: function() {
              var past = this.matched.substr(0, this.matched.length - this.match.length);
              return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
            },
            upcomingInput: function() {
              var next = this.match;
              if (next.length < 20) {
                next += this._input.substr(0, 20 - next.length);
              }
              return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
            },
            showPosition: function() {
              var pre = this.pastInput();
              var c5 = new Array(pre.length + 1).join("-");
              return pre + this.upcomingInput() + "\n" + c5 + "^";
            },
            next: function() {
              if (this.done) {
                return this.EOF;
              }
              if (!this._input)
                this.done = true;
              var token, match6, col, lines;
              if (!this._more) {
                this.yytext = "";
                this.match = "";
              }
              var rules = this._currentRules();
              for (var i5 = 0; i5 < rules.length; i5++) {
                match6 = this._input.match(this.rules[rules[i5]]);
                if (match6) {
                  lines = match6[0].match(/\n.*/g);
                  if (lines)
                    this.yylineno += lines.length;
                  this.yylloc = {
                    first_line: this.yylloc.last_line,
                    last_line: this.yylineno + 1,
                    first_column: this.yylloc.last_column,
                    last_column: lines ? lines[lines.length - 1].length - 1 : this.yylloc.last_column + match6[0].length
                  };
                  this.yytext += match6[0];
                  this.match += match6[0];
                  this.matches = match6;
                  this.yyleng = this.yytext.length;
                  this._more = false;
                  this._input = this._input.slice(match6[0].length);
                  this.matched += match6[0];
                  token = this.performAction.call(this, this.yy, this, rules[i5], this.conditionStack[this.conditionStack.length - 1]);
                  if (token)
                    return token;
                  else
                    return;
                }
              }
              if (this._input === "") {
                return this.EOF;
              } else {
                this.parseError(
                  "Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(),
                  { text: "", token: null, line: this.yylineno }
                );
              }
            },
            lex: function lex() {
              var r3 = this.next();
              if (typeof r3 !== "undefined") {
                return r3;
              } else {
                return this.lex();
              }
            },
            begin: function begin(condition) {
              this.conditionStack.push(condition);
            },
            popState: function popState() {
              return this.conditionStack.pop();
            },
            _currentRules: function _currentRules() {
              return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
            },
            topState: function() {
              return this.conditionStack[this.conditionStack.length - 2];
            },
            pushState: function begin(condition) {
              this.begin(condition);
            }
          };
          lexer2.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
            var YYSTATE = YY_START;
            switch ($avoiding_name_collisions) {
              case 0:
                break;
              case 1:
                return 20;
                break;
              case 2:
                return 19;
                break;
              case 3:
                return 8;
                break;
              case 4:
                return 9;
                break;
              case 5:
                return 6;
                break;
              case 6:
                return 7;
                break;
              case 7:
                return 11;
                break;
              case 8:
                return 13;
                break;
              case 9:
                return 10;
                break;
              case 10:
                return 12;
                break;
              case 11:
                return 14;
                break;
              case 12:
                return 15;
                break;
              case 13:
                return 16;
                break;
              case 14:
                return 17;
                break;
              case 15:
                return 18;
                break;
              case 16:
                return 5;
                break;
              case 17:
                return "INVALID";
                break;
            }
          };
          lexer2.rules = [/^\s+/, /^[0-9]+(\.[0-9]+)?\b/, /^n\b/, /^\|\|/, /^&&/, /^\?/, /^:/, /^<=/, /^>=/, /^</, /^>/, /^!=/, /^==/, /^%/, /^\(/, /^\)/, /^$/, /^./];
          lexer2.conditions = { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], "inclusive": true } };
          return lexer2;
        }();
        parser.lexer = lexer;
        return parser;
      }();
      if (typeof exports !== "undefined") {
        if (typeof module !== "undefined" && module.exports) {
          exports = module.exports = Jed2;
        }
        exports.Jed = Jed2;
      } else {
        if (typeof define === "function" && define.amd) {
          define(function() {
            return Jed2;
          });
        }
        root["Jed"] = Jed2;
      }
    })(exports);
  }
});

// ../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/dist/preact.module.js
function s(n2, l3) {
  for (var u5 in l3)
    n2[u5] = l3[u5];
  return n2;
}
function a(n2) {
  var l3 = n2.parentNode;
  l3 && l3.removeChild(n2);
}
function h(l3, u5, i5) {
  var t5, o3, r3, f3 = {};
  for (r3 in u5)
    "key" == r3 ? t5 = u5[r3] : "ref" == r3 ? o3 = u5[r3] : f3[r3] = u5[r3];
  if (arguments.length > 2 && (f3.children = arguments.length > 3 ? n.call(arguments, 2) : i5), "function" == typeof l3 && null != l3.defaultProps)
    for (r3 in l3.defaultProps)
      void 0 === f3[r3] && (f3[r3] = l3.defaultProps[r3]);
  return v(l3, f3, t5, o3, null);
}
function v(n2, i5, t5, o3, r3) {
  var f3 = { type: n2, props: i5, key: t5, ref: o3, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == r3 ? ++u : r3 };
  return null == r3 && null != l.vnode && l.vnode(f3), f3;
}
function y() {
  return { current: null };
}
function p2(n2) {
  return n2.children;
}
function d(n2, l3) {
  this.props = n2, this.context = l3;
}
function _(n2, l3) {
  if (null == l3)
    return n2.__ ? _(n2.__, n2.__.__k.indexOf(n2) + 1) : null;
  for (var u5; l3 < n2.__k.length; l3++)
    if (null != (u5 = n2.__k[l3]) && null != u5.__e)
      return u5.__e;
  return "function" == typeof n2.type ? _(n2) : null;
}
function k(n2) {
  var l3, u5;
  if (null != (n2 = n2.__) && null != n2.__c) {
    for (n2.__e = n2.__c.base = null, l3 = 0; l3 < n2.__k.length; l3++)
      if (null != (u5 = n2.__k[l3]) && null != u5.__e) {
        n2.__e = n2.__c.base = u5.__e;
        break;
      }
    return k(n2);
  }
}
function b(n2) {
  (!n2.__d && (n2.__d = true) && t.push(n2) && !g.__r++ || o !== l.debounceRendering) && ((o = l.debounceRendering) || setTimeout)(g);
}
function g() {
  for (var n2; g.__r = t.length; )
    n2 = t.sort(function(n3, l3) {
      return n3.__v.__b - l3.__v.__b;
    }), t = [], n2.some(function(n3) {
      var l3, u5, i5, t5, o3, r3;
      n3.__d && (o3 = (t5 = (l3 = n3).__v).__e, (r3 = l3.__P) && (u5 = [], (i5 = s({}, t5)).__v = t5.__v + 1, j(r3, t5, i5, l3.__n, void 0 !== r3.ownerSVGElement, null != t5.__h ? [o3] : null, u5, null == o3 ? _(t5) : o3, t5.__h), z(u5, t5), t5.__e != o3 && k(t5)));
    });
}
function w(n2, l3, u5, i5, t5, o3, r3, c5, s6, a6) {
  var h5, y6, d6, k6, b5, g4, w6, x6 = i5 && i5.__k || e, C3 = x6.length;
  for (u5.__k = [], h5 = 0; h5 < l3.length; h5++)
    if (null != (k6 = u5.__k[h5] = null == (k6 = l3[h5]) || "boolean" == typeof k6 ? null : "string" == typeof k6 || "number" == typeof k6 || "bigint" == typeof k6 ? v(null, k6, null, null, k6) : Array.isArray(k6) ? v(p2, { children: k6 }, null, null, null) : k6.__b > 0 ? v(k6.type, k6.props, k6.key, k6.ref ? k6.ref : null, k6.__v) : k6)) {
      if (k6.__ = u5, k6.__b = u5.__b + 1, null === (d6 = x6[h5]) || d6 && k6.key == d6.key && k6.type === d6.type)
        x6[h5] = void 0;
      else
        for (y6 = 0; y6 < C3; y6++) {
          if ((d6 = x6[y6]) && k6.key == d6.key && k6.type === d6.type) {
            x6[y6] = void 0;
            break;
          }
          d6 = null;
        }
      j(n2, k6, d6 = d6 || f, t5, o3, r3, c5, s6, a6), b5 = k6.__e, (y6 = k6.ref) && d6.ref != y6 && (w6 || (w6 = []), d6.ref && w6.push(d6.ref, null, k6), w6.push(y6, k6.__c || b5, k6)), null != b5 ? (null == g4 && (g4 = b5), "function" == typeof k6.type && k6.__k === d6.__k ? k6.__d = s6 = m(k6, s6, n2) : s6 = A2(n2, k6, d6, x6, b5, s6), "function" == typeof u5.type && (u5.__d = s6)) : s6 && d6.__e == s6 && s6.parentNode != n2 && (s6 = _(d6));
    }
  for (u5.__e = g4, h5 = C3; h5--; )
    null != x6[h5] && N(x6[h5], x6[h5]);
  if (w6)
    for (h5 = 0; h5 < w6.length; h5++)
      M2(w6[h5], w6[++h5], w6[++h5]);
}
function m(n2, l3, u5) {
  for (var i5, t5 = n2.__k, o3 = 0; t5 && o3 < t5.length; o3++)
    (i5 = t5[o3]) && (i5.__ = n2, l3 = "function" == typeof i5.type ? m(i5, l3, u5) : A2(u5, i5, i5, t5, i5.__e, l3));
  return l3;
}
function x(n2, l3) {
  return l3 = l3 || [], null == n2 || "boolean" == typeof n2 || (Array.isArray(n2) ? n2.some(function(n3) {
    x(n3, l3);
  }) : l3.push(n2)), l3;
}
function A2(n2, l3, u5, i5, t5, o3) {
  var r3, f3, e5;
  if (void 0 !== l3.__d)
    r3 = l3.__d, l3.__d = void 0;
  else if (null == u5 || t5 != o3 || null == t5.parentNode)
    n:
      if (null == o3 || o3.parentNode !== n2)
        n2.appendChild(t5), r3 = null;
      else {
        for (f3 = o3, e5 = 0; (f3 = f3.nextSibling) && e5 < i5.length; e5 += 1)
          if (f3 == t5)
            break n;
        n2.insertBefore(t5, o3), r3 = o3;
      }
  return void 0 !== r3 ? r3 : t5.nextSibling;
}
function C(n2, l3, u5, i5, t5) {
  var o3;
  for (o3 in u5)
    "children" === o3 || "key" === o3 || o3 in l3 || H(n2, o3, null, u5[o3], i5);
  for (o3 in l3)
    t5 && "function" != typeof l3[o3] || "children" === o3 || "key" === o3 || "value" === o3 || "checked" === o3 || u5[o3] === l3[o3] || H(n2, o3, l3[o3], u5[o3], i5);
}
function $(n2, l3, u5) {
  "-" === l3[0] ? n2.setProperty(l3, u5) : n2[l3] = null == u5 ? "" : "number" != typeof u5 || c.test(l3) ? u5 : u5 + "px";
}
function H(n2, l3, u5, i5, t5) {
  var o3;
  n:
    if ("style" === l3)
      if ("string" == typeof u5)
        n2.style.cssText = u5;
      else {
        if ("string" == typeof i5 && (n2.style.cssText = i5 = ""), i5)
          for (l3 in i5)
            u5 && l3 in u5 || $(n2.style, l3, "");
        if (u5)
          for (l3 in u5)
            i5 && u5[l3] === i5[l3] || $(n2.style, l3, u5[l3]);
      }
    else if ("o" === l3[0] && "n" === l3[1])
      o3 = l3 !== (l3 = l3.replace(/Capture$/, "")), l3 = l3.toLowerCase() in n2 ? l3.toLowerCase().slice(2) : l3.slice(2), n2.l || (n2.l = {}), n2.l[l3 + o3] = u5, u5 ? i5 || n2.addEventListener(l3, o3 ? T : I2, o3) : n2.removeEventListener(l3, o3 ? T : I2, o3);
    else if ("dangerouslySetInnerHTML" !== l3) {
      if (t5)
        l3 = l3.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
      else if ("href" !== l3 && "list" !== l3 && "form" !== l3 && "tabIndex" !== l3 && "download" !== l3 && l3 in n2)
        try {
          n2[l3] = null == u5 ? "" : u5;
          break n;
        } catch (n3) {
        }
      "function" == typeof u5 || (null == u5 || false === u5 && -1 == l3.indexOf("-") ? n2.removeAttribute(l3) : n2.setAttribute(l3, u5));
    }
}
function I2(n2) {
  this.l[n2.type + false](l.event ? l.event(n2) : n2);
}
function T(n2) {
  this.l[n2.type + true](l.event ? l.event(n2) : n2);
}
function j(n2, u5, i5, t5, o3, r3, f3, e5, c5) {
  var a6, h5, v3, y6, _3, k6, b5, g4, m6, x6, A5, C3, $3, H6, I6, T6 = u5.type;
  if (void 0 !== u5.constructor)
    return null;
  null != i5.__h && (c5 = i5.__h, e5 = u5.__e = i5.__e, u5.__h = null, r3 = [e5]), (a6 = l.__b) && a6(u5);
  try {
    n:
      if ("function" == typeof T6) {
        if (g4 = u5.props, m6 = (a6 = T6.contextType) && t5[a6.__c], x6 = a6 ? m6 ? m6.props.value : a6.__ : t5, i5.__c ? b5 = (h5 = u5.__c = i5.__c).__ = h5.__E : ("prototype" in T6 && T6.prototype.render ? u5.__c = h5 = new T6(g4, x6) : (u5.__c = h5 = new d(g4, x6), h5.constructor = T6, h5.render = O), m6 && m6.sub(h5), h5.props = g4, h5.state || (h5.state = {}), h5.context = x6, h5.__n = t5, v3 = h5.__d = true, h5.__h = [], h5._sb = []), null == h5.__s && (h5.__s = h5.state), null != T6.getDerivedStateFromProps && (h5.__s == h5.state && (h5.__s = s({}, h5.__s)), s(h5.__s, T6.getDerivedStateFromProps(g4, h5.__s))), y6 = h5.props, _3 = h5.state, v3)
          null == T6.getDerivedStateFromProps && null != h5.componentWillMount && h5.componentWillMount(), null != h5.componentDidMount && h5.__h.push(h5.componentDidMount);
        else {
          if (null == T6.getDerivedStateFromProps && g4 !== y6 && null != h5.componentWillReceiveProps && h5.componentWillReceiveProps(g4, x6), !h5.__e && null != h5.shouldComponentUpdate && false === h5.shouldComponentUpdate(g4, h5.__s, x6) || u5.__v === i5.__v) {
            for (h5.props = g4, h5.state = h5.__s, u5.__v !== i5.__v && (h5.__d = false), h5.__v = u5, u5.__e = i5.__e, u5.__k = i5.__k, u5.__k.forEach(function(n3) {
              n3 && (n3.__ = u5);
            }), A5 = 0; A5 < h5._sb.length; A5++)
              h5.__h.push(h5._sb[A5]);
            h5._sb = [], h5.__h.length && f3.push(h5);
            break n;
          }
          null != h5.componentWillUpdate && h5.componentWillUpdate(g4, h5.__s, x6), null != h5.componentDidUpdate && h5.__h.push(function() {
            h5.componentDidUpdate(y6, _3, k6);
          });
        }
        if (h5.context = x6, h5.props = g4, h5.__v = u5, h5.__P = n2, C3 = l.__r, $3 = 0, "prototype" in T6 && T6.prototype.render) {
          for (h5.state = h5.__s, h5.__d = false, C3 && C3(u5), a6 = h5.render(h5.props, h5.state, h5.context), H6 = 0; H6 < h5._sb.length; H6++)
            h5.__h.push(h5._sb[H6]);
          h5._sb = [];
        } else
          do {
            h5.__d = false, C3 && C3(u5), a6 = h5.render(h5.props, h5.state, h5.context), h5.state = h5.__s;
          } while (h5.__d && ++$3 < 25);
        h5.state = h5.__s, null != h5.getChildContext && (t5 = s(s({}, t5), h5.getChildContext())), v3 || null == h5.getSnapshotBeforeUpdate || (k6 = h5.getSnapshotBeforeUpdate(y6, _3)), I6 = null != a6 && a6.type === p2 && null == a6.key ? a6.props.children : a6, w(n2, Array.isArray(I6) ? I6 : [I6], u5, i5, t5, o3, r3, f3, e5, c5), h5.base = u5.__e, u5.__h = null, h5.__h.length && f3.push(h5), b5 && (h5.__E = h5.__ = null), h5.__e = false;
      } else
        null == r3 && u5.__v === i5.__v ? (u5.__k = i5.__k, u5.__e = i5.__e) : u5.__e = L2(i5.__e, u5, i5, t5, o3, r3, f3, c5);
    (a6 = l.diffed) && a6(u5);
  } catch (n3) {
    u5.__v = null, (c5 || null != r3) && (u5.__e = e5, u5.__h = !!c5, r3[r3.indexOf(e5)] = null), l.__e(n3, u5, i5);
  }
}
function z(n2, u5) {
  l.__c && l.__c(u5, n2), n2.some(function(u6) {
    try {
      n2 = u6.__h, u6.__h = [], n2.some(function(n3) {
        n3.call(u6);
      });
    } catch (n3) {
      l.__e(n3, u6.__v);
    }
  });
}
function L2(l3, u5, i5, t5, o3, r3, e5, c5) {
  var s6, h5, v3, y6 = i5.props, p4 = u5.props, d6 = u5.type, k6 = 0;
  if ("svg" === d6 && (o3 = true), null != r3) {
    for (; k6 < r3.length; k6++)
      if ((s6 = r3[k6]) && "setAttribute" in s6 == !!d6 && (d6 ? s6.localName === d6 : 3 === s6.nodeType)) {
        l3 = s6, r3[k6] = null;
        break;
      }
  }
  if (null == l3) {
    if (null === d6)
      return document.createTextNode(p4);
    l3 = o3 ? document.createElementNS("http://www.w3.org/2000/svg", d6) : document.createElement(d6, p4.is && p4), r3 = null, c5 = false;
  }
  if (null === d6)
    y6 === p4 || c5 && l3.data === p4 || (l3.data = p4);
  else {
    if (r3 = r3 && n.call(l3.childNodes), h5 = (y6 = i5.props || f).dangerouslySetInnerHTML, v3 = p4.dangerouslySetInnerHTML, !c5) {
      if (null != r3)
        for (y6 = {}, k6 = 0; k6 < l3.attributes.length; k6++)
          y6[l3.attributes[k6].name] = l3.attributes[k6].value;
      (v3 || h5) && (v3 && (h5 && v3.__html == h5.__html || v3.__html === l3.innerHTML) || (l3.innerHTML = v3 && v3.__html || ""));
    }
    if (C(l3, p4, y6, o3, c5), v3)
      u5.__k = [];
    else if (k6 = u5.props.children, w(l3, Array.isArray(k6) ? k6 : [k6], u5, i5, t5, o3 && "foreignObject" !== d6, r3, e5, r3 ? r3[0] : i5.__k && _(i5, 0), c5), null != r3)
      for (k6 = r3.length; k6--; )
        null != r3[k6] && a(r3[k6]);
    c5 || ("value" in p4 && void 0 !== (k6 = p4.value) && (k6 !== l3.value || "progress" === d6 && !k6 || "option" === d6 && k6 !== y6.value) && H(l3, "value", k6, y6.value, false), "checked" in p4 && void 0 !== (k6 = p4.checked) && k6 !== l3.checked && H(l3, "checked", k6, y6.checked, false));
  }
  return l3;
}
function M2(n2, u5, i5) {
  try {
    "function" == typeof n2 ? n2(u5) : n2.current = u5;
  } catch (n3) {
    l.__e(n3, i5);
  }
}
function N(n2, u5, i5) {
  var t5, o3;
  if (l.unmount && l.unmount(n2), (t5 = n2.ref) && (t5.current && t5.current !== n2.__e || M2(t5, null, u5)), null != (t5 = n2.__c)) {
    if (t5.componentWillUnmount)
      try {
        t5.componentWillUnmount();
      } catch (n3) {
        l.__e(n3, u5);
      }
    t5.base = t5.__P = null, n2.__c = void 0;
  }
  if (t5 = n2.__k)
    for (o3 = 0; o3 < t5.length; o3++)
      t5[o3] && N(t5[o3], u5, i5 || "function" != typeof n2.type);
  i5 || null == n2.__e || a(n2.__e), n2.__ = n2.__e = n2.__d = void 0;
}
function O(n2, l3, u5) {
  return this.constructor(n2, u5);
}
function P(u5, i5, t5) {
  var o3, r3, e5;
  l.__ && l.__(u5, i5), r3 = (o3 = "function" == typeof t5) ? null : t5 && t5.__k || i5.__k, e5 = [], j(i5, u5 = (!o3 && t5 || i5).__k = h(p2, null, [u5]), r3 || f, f, void 0 !== i5.ownerSVGElement, !o3 && t5 ? [t5] : r3 ? null : i5.firstChild ? n.call(i5.childNodes) : null, e5, !o3 && t5 ? t5 : r3 ? r3.__e : i5.firstChild, o3), z(e5, u5);
}
function S2(n2, l3) {
  P(n2, l3, S2);
}
function q(l3, u5, i5) {
  var t5, o3, r3, f3 = s({}, l3.props);
  for (r3 in u5)
    "key" == r3 ? t5 = u5[r3] : "ref" == r3 ? o3 = u5[r3] : f3[r3] = u5[r3];
  return arguments.length > 2 && (f3.children = arguments.length > 3 ? n.call(arguments, 2) : i5), v(l3.type, f3, t5 || l3.key, o3 || l3.ref, null);
}
function B(n2, l3) {
  var u5 = { __c: l3 = "__cC" + r++, __: n2, Consumer: function(n3, l4) {
    return n3.children(l4);
  }, Provider: function(n3) {
    var u6, i5;
    return this.getChildContext || (u6 = [], (i5 = {})[l3] = this, this.getChildContext = function() {
      return i5;
    }, this.shouldComponentUpdate = function(n4) {
      this.props.value !== n4.value && u6.some(b);
    }, this.sub = function(n4) {
      u6.push(n4);
      var l4 = n4.componentWillUnmount;
      n4.componentWillUnmount = function() {
        u6.splice(u6.indexOf(n4), 1), l4 && l4.call(n4);
      };
    }), n3.children;
  } };
  return u5.Provider.__ = u5.Consumer.contextType = u5;
}
var n, l, u, i, t, o, r, f, e, c;
var init_preact_module = __esm({
  "../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/dist/preact.module.js"() {
    f = {};
    e = [];
    c = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
    n = e.slice, l = { __e: function(n2, l3, u5, i5) {
      for (var t5, o3, r3; l3 = l3.__; )
        if ((t5 = l3.__c) && !t5.__)
          try {
            if ((o3 = t5.constructor) && null != o3.getDerivedStateFromError && (t5.setState(o3.getDerivedStateFromError(n2)), r3 = t5.__d), null != t5.componentDidCatch && (t5.componentDidCatch(n2, i5 || {}), r3 = t5.__d), r3)
              return t5.__E = t5;
          } catch (l4) {
            n2 = l4;
          }
      throw n2;
    } }, u = 0, i = function(n2) {
      return null != n2 && void 0 === n2.constructor;
    }, d.prototype.setState = function(n2, l3) {
      var u5;
      u5 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = s({}, this.state), "function" == typeof n2 && (n2 = n2(s({}, u5), this.props)), n2 && s(u5, n2), null != n2 && this.__v && (l3 && this._sb.push(l3), b(this));
    }, d.prototype.forceUpdate = function(n2) {
      this.__v && (this.__e = true, n2 && this.__h.push(n2), b(this));
    }, d.prototype.render = p2, t = [], g.__r = 0, r = 0;
  }
});

// ../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/hooks/dist/hooks.module.js
function d2(t5, u5) {
  l.__h && l.__h(r2, t5, o2 || u5), o2 = 0;
  var i5 = r2.__H || (r2.__H = { __: [], __h: [] });
  return t5 >= i5.__.length && i5.__.push({ __V: c2 }), i5.__[t5];
}
function p3(n2) {
  return o2 = 1, y2(B2, n2);
}
function y2(n2, u5, i5) {
  var o3 = d2(t2++, 2);
  if (o3.t = n2, !o3.__c && (o3.__ = [i5 ? i5(u5) : B2(void 0, u5), function(n3) {
    var t5 = o3.__N ? o3.__N[0] : o3.__[0], r3 = o3.t(t5, n3);
    t5 !== r3 && (o3.__N = [r3, o3.__[1]], o3.__c.setState({}));
  }], o3.__c = r2, !r2.u)) {
    r2.u = true;
    var f3 = r2.shouldComponentUpdate;
    r2.shouldComponentUpdate = function(n3, t5, r3) {
      if (!o3.__c.__H)
        return true;
      var u6 = o3.__c.__H.__.filter(function(n4) {
        return n4.__c;
      });
      if (u6.every(function(n4) {
        return !n4.__N;
      }))
        return !f3 || f3.call(this, n3, t5, r3);
      var i6 = false;
      return u6.forEach(function(n4) {
        if (n4.__N) {
          var t6 = n4.__[0];
          n4.__ = n4.__N, n4.__N = void 0, t6 !== n4.__[0] && (i6 = true);
        }
      }), !(!i6 && o3.__c.props === n3) && (!f3 || f3.call(this, n3, t5, r3));
    };
  }
  return o3.__N || o3.__;
}
function h2(u5, i5) {
  var o3 = d2(t2++, 3);
  !l.__s && z2(o3.__H, i5) && (o3.__ = u5, o3.i = i5, r2.__H.__h.push(o3));
}
function s2(u5, i5) {
  var o3 = d2(t2++, 4);
  !l.__s && z2(o3.__H, i5) && (o3.__ = u5, o3.i = i5, r2.__h.push(o3));
}
function _2(n2) {
  return o2 = 5, F(function() {
    return { current: n2 };
  }, []);
}
function A3(n2, t5, r3) {
  o2 = 6, s2(function() {
    return "function" == typeof n2 ? (n2(t5()), function() {
      return n2(null);
    }) : n2 ? (n2.current = t5(), function() {
      return n2.current = null;
    }) : void 0;
  }, null == r3 ? r3 : r3.concat(n2));
}
function F(n2, r3) {
  var u5 = d2(t2++, 7);
  return z2(u5.__H, r3) ? (u5.__V = n2(), u5.i = r3, u5.__h = n2, u5.__V) : u5.__;
}
function T2(n2, t5) {
  return o2 = 8, F(function() {
    return n2;
  }, t5);
}
function q2(n2) {
  var u5 = r2.context[n2.__c], i5 = d2(t2++, 9);
  return i5.c = n2, u5 ? (null == i5.__ && (i5.__ = true, u5.sub(r2)), u5.props.value) : n2.__;
}
function x2(t5, r3) {
  l.useDebugValue && l.useDebugValue(r3 ? r3(t5) : t5);
}
function P2(n2) {
  var u5 = d2(t2++, 10), i5 = p3();
  return u5.__ = n2, r2.componentDidCatch || (r2.componentDidCatch = function(n3, t5) {
    u5.__ && u5.__(n3, t5), i5[1](n3);
  }), [i5[0], function() {
    i5[1](void 0);
  }];
}
function V() {
  var n2 = d2(t2++, 11);
  if (!n2.__) {
    for (var u5 = r2.__v; null !== u5 && !u5.__m && null !== u5.__; )
      u5 = u5.__;
    var i5 = u5.__m || (u5.__m = [0, 0]);
    n2.__ = "P" + i5[0] + "-" + i5[1]++;
  }
  return n2.__;
}
function b2() {
  for (var t5; t5 = f2.shift(); )
    if (t5.__P && t5.__H)
      try {
        t5.__H.__h.forEach(k2), t5.__H.__h.forEach(w2), t5.__H.__h = [];
      } catch (r3) {
        t5.__H.__h = [], l.__e(r3, t5.__v);
      }
}
function j2(n2) {
  var t5, r3 = function() {
    clearTimeout(u5), g2 && cancelAnimationFrame(t5), setTimeout(n2);
  }, u5 = setTimeout(r3, 100);
  g2 && (t5 = requestAnimationFrame(r3));
}
function k2(n2) {
  var t5 = r2, u5 = n2.__c;
  "function" == typeof u5 && (n2.__c = void 0, u5()), r2 = t5;
}
function w2(n2) {
  var t5 = r2;
  n2.__c = n2.__(), r2 = t5;
}
function z2(n2, t5) {
  return !n2 || n2.length !== t5.length || t5.some(function(t6, r3) {
    return t6 !== n2[r3];
  });
}
function B2(n2, t5) {
  return "function" == typeof t5 ? t5(n2) : t5;
}
var t2, r2, u2, i2, o2, f2, c2, e2, a2, v2, l2, m2, g2;
var init_hooks_module = __esm({
  "../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/hooks/dist/hooks.module.js"() {
    init_preact_module();
    o2 = 0;
    f2 = [];
    c2 = [];
    e2 = l.__b;
    a2 = l.__r;
    v2 = l.diffed;
    l2 = l.__c;
    m2 = l.unmount;
    l.__b = function(n2) {
      r2 = null, e2 && e2(n2);
    }, l.__r = function(n2) {
      a2 && a2(n2), t2 = 0;
      var i5 = (r2 = n2.__c).__H;
      i5 && (u2 === r2 ? (i5.__h = [], r2.__h = [], i5.__.forEach(function(n3) {
        n3.__N && (n3.__ = n3.__N), n3.__V = c2, n3.__N = n3.i = void 0;
      })) : (i5.__h.forEach(k2), i5.__h.forEach(w2), i5.__h = [])), u2 = r2;
    }, l.diffed = function(t5) {
      v2 && v2(t5);
      var o3 = t5.__c;
      o3 && o3.__H && (o3.__H.__h.length && (1 !== f2.push(o3) && i2 === l.requestAnimationFrame || ((i2 = l.requestAnimationFrame) || j2)(b2)), o3.__H.__.forEach(function(n2) {
        n2.i && (n2.__H = n2.i), n2.__V !== c2 && (n2.__ = n2.__V), n2.i = void 0, n2.__V = c2;
      })), u2 = r2 = null;
    }, l.__c = function(t5, r3) {
      r3.some(function(t6) {
        try {
          t6.__h.forEach(k2), t6.__h = t6.__h.filter(function(n2) {
            return !n2.__ || w2(n2);
          });
        } catch (u5) {
          r3.some(function(n2) {
            n2.__h && (n2.__h = []);
          }), r3 = [], l.__e(u5, t6.__v);
        }
      }), l2 && l2(t5, r3);
    }, l.unmount = function(t5) {
      m2 && m2(t5);
      var r3, u5 = t5.__c;
      u5 && u5.__H && (u5.__H.__.forEach(function(n2) {
        try {
          k2(n2);
        } catch (n3) {
          r3 = n3;
        }
      }), u5.__H = void 0, r3 && l.__e(r3, u5.__v));
    };
    g2 = "function" == typeof requestAnimationFrame;
  }
});

// ../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/compat/dist/compat.module.js
var compat_module_exports = {};
__export(compat_module_exports, {
  Children: () => O2,
  Component: () => d,
  Fragment: () => p2,
  PureComponent: () => w3,
  StrictMode: () => vn2,
  Suspense: () => D3,
  SuspenseList: () => V2,
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: () => rn,
  cloneElement: () => cn,
  createContext: () => B,
  createElement: () => h,
  createFactory: () => on,
  createPortal: () => j3,
  createRef: () => y,
  default: () => bn,
  findDOMNode: () => an,
  flushSync: () => hn,
  forwardRef: () => k3,
  hydrate: () => q3,
  isValidElement: () => ln,
  lazy: () => M3,
  memo: () => R,
  render: () => Y2,
  startTransition: () => dn,
  unmountComponentAtNode: () => fn,
  unstable_batchedUpdates: () => sn,
  useCallback: () => T2,
  useContext: () => q2,
  useDebugValue: () => x2,
  useDeferredValue: () => pn,
  useEffect: () => h2,
  useErrorBoundary: () => P2,
  useId: () => V,
  useImperativeHandle: () => A3,
  useInsertionEffect: () => yn,
  useLayoutEffect: () => s2,
  useMemo: () => F,
  useReducer: () => y2,
  useRef: () => _2,
  useState: () => p3,
  useSyncExternalStore: () => _n,
  useTransition: () => mn,
  version: () => un
});
function g3(n2, t5) {
  for (var e5 in t5)
    n2[e5] = t5[e5];
  return n2;
}
function C2(n2, t5) {
  for (var e5 in n2)
    if ("__source" !== e5 && !(e5 in t5))
      return true;
  for (var r3 in t5)
    if ("__source" !== r3 && n2[r3] !== t5[r3])
      return true;
  return false;
}
function E(n2, t5) {
  return n2 === t5 && (0 !== n2 || 1 / n2 == 1 / t5) || n2 != n2 && t5 != t5;
}
function w3(n2) {
  this.props = n2;
}
function R(n2, e5) {
  function r3(n3) {
    var t5 = this.props.ref, r4 = t5 == n3.ref;
    return !r4 && t5 && (t5.call ? t5(null) : t5.current = null), e5 ? !e5(this.props, n3) || !r4 : C2(this.props, n3);
  }
  function u5(e6) {
    return this.shouldComponentUpdate = r3, h(n2, e6);
  }
  return u5.displayName = "Memo(" + (n2.displayName || n2.name) + ")", u5.prototype.isReactComponent = true, u5.__f = true, u5;
}
function k3(n2) {
  function t5(t6) {
    var e5 = g3({}, t6);
    return delete e5.ref, n2(e5, t6.ref || null);
  }
  return t5.$$typeof = N2, t5.render = t5, t5.prototype.isReactComponent = t5.__f = true, t5.displayName = "ForwardRef(" + (n2.displayName || n2.name) + ")", t5;
}
function L3(n2, t5, e5) {
  return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) {
    "function" == typeof n3.__c && n3.__c();
  }), n2.__c.__H = null), null != (n2 = g3({}, n2)).__c && (n2.__c.__P === e5 && (n2.__c.__P = t5), n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) {
    return L3(n3, t5, e5);
  })), n2;
}
function U(n2, t5, e5) {
  return n2 && (n2.__v = null, n2.__k = n2.__k && n2.__k.map(function(n3) {
    return U(n3, t5, e5);
  }), n2.__c && n2.__c.__P === t5 && (n2.__e && e5.insertBefore(n2.__e, n2.__d), n2.__c.__e = true, n2.__c.__P = e5)), n2;
}
function D3() {
  this.__u = 0, this.t = null, this.__b = null;
}
function F2(n2) {
  var t5 = n2.__.__c;
  return t5 && t5.__a && t5.__a(n2);
}
function M3(n2) {
  var e5, r3, u5;
  function o3(o4) {
    if (e5 || (e5 = n2()).then(function(n3) {
      r3 = n3.default || n3;
    }, function(n3) {
      u5 = n3;
    }), u5)
      throw u5;
    if (!r3)
      throw e5;
    return h(r3, o4);
  }
  return o3.displayName = "Lazy", o3.__f = true, o3;
}
function V2() {
  this.u = null, this.o = null;
}
function P3(n2) {
  return this.getChildContext = function() {
    return n2.context;
  }, n2.children;
}
function $2(n2) {
  var e5 = this, r3 = n2.i;
  e5.componentWillUnmount = function() {
    P(null, e5.l), e5.l = null, e5.i = null;
  }, e5.i && e5.i !== r3 && e5.componentWillUnmount(), n2.__v ? (e5.l || (e5.i = r3, e5.l = { nodeType: 1, parentNode: r3, childNodes: [], appendChild: function(n3) {
    this.childNodes.push(n3), e5.i.appendChild(n3);
  }, insertBefore: function(n3, t5) {
    this.childNodes.push(n3), e5.i.appendChild(n3);
  }, removeChild: function(n3) {
    this.childNodes.splice(this.childNodes.indexOf(n3) >>> 1, 1), e5.i.removeChild(n3);
  } }), P(h(P3, { context: e5.context }, n2.__v), e5.l)) : e5.l && e5.componentWillUnmount();
}
function j3(n2, e5) {
  var r3 = h($2, { __v: n2, i: e5 });
  return r3.containerInfo = e5, r3;
}
function Y2(n2, t5, e5) {
  return null == t5.__k && (t5.textContent = ""), P(n2, t5), "function" == typeof e5 && e5(), n2 ? n2.__c : null;
}
function q3(n2, t5, e5) {
  return S2(n2, t5), "function" == typeof e5 && e5(), n2 ? n2.__c : null;
}
function J() {
}
function K3() {
  return this.cancelBubble;
}
function Q() {
  return this.defaultPrevented;
}
function on(n2) {
  return h.bind(null, n2);
}
function ln(n2) {
  return !!n2 && n2.$$typeof === z3;
}
function cn(n2) {
  return ln(n2) ? q.apply(null, arguments) : n2;
}
function fn(n2) {
  return !!n2.__k && (P(null, n2), true);
}
function an(n2) {
  return n2 && (n2.base || 1 === n2.nodeType && n2) || null;
}
function dn(n2) {
  n2();
}
function pn(n2) {
  return n2;
}
function mn() {
  return [false, dn];
}
function _n(n2, t5) {
  var e5 = t5(), r3 = p3({ h: { __: e5, v: t5 } }), u5 = r3[0].h, o3 = r3[1];
  return s2(function() {
    u5.__ = e5, u5.v = t5, E(u5.__, t5()) || o3({ h: u5 });
  }, [n2, e5, t5]), h2(function() {
    return E(u5.__, u5.v()) || o3({ h: u5 }), n2(function() {
      E(u5.__, u5.v()) || o3({ h: u5 });
    });
  }, [n2]), e5;
}
var x3, N2, A4, O2, T3, I3, W, z3, B3, H2, Z2, G, X2, nn, tn, en, rn, un, sn, hn, vn2, yn, bn;
var init_compat_module = __esm({
  "../../node_modules/.pnpm/preact@10.11.3/node_modules/preact/compat/dist/compat.module.js"() {
    init_preact_module();
    init_preact_module();
    init_hooks_module();
    init_hooks_module();
    (w3.prototype = new d()).isPureReactComponent = true, w3.prototype.shouldComponentUpdate = function(n2, t5) {
      return C2(this.props, n2) || C2(this.state, t5);
    };
    x3 = l.__b;
    l.__b = function(n2) {
      n2.type && n2.type.__f && n2.ref && (n2.props.ref = n2.ref, n2.ref = null), x3 && x3(n2);
    };
    N2 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.forward_ref") || 3911;
    A4 = function(n2, t5) {
      return null == n2 ? null : x(x(n2).map(t5));
    };
    O2 = { map: A4, forEach: A4, count: function(n2) {
      return n2 ? x(n2).length : 0;
    }, only: function(n2) {
      var t5 = x(n2);
      if (1 !== t5.length)
        throw "Children.only";
      return t5[0];
    }, toArray: x };
    T3 = l.__e;
    l.__e = function(n2, t5, e5, r3) {
      if (n2.then) {
        for (var u5, o3 = t5; o3 = o3.__; )
          if ((u5 = o3.__c) && u5.__c)
            return null == t5.__e && (t5.__e = e5.__e, t5.__k = e5.__k), u5.__c(n2, t5);
      }
      T3(n2, t5, e5, r3);
    };
    I3 = l.unmount;
    l.unmount = function(n2) {
      var t5 = n2.__c;
      t5 && t5.__R && t5.__R(), t5 && true === n2.__h && (n2.type = null), I3 && I3(n2);
    }, (D3.prototype = new d()).__c = function(n2, t5) {
      var e5 = t5.__c, r3 = this;
      null == r3.t && (r3.t = []), r3.t.push(e5);
      var u5 = F2(r3.__v), o3 = false, i5 = function() {
        o3 || (o3 = true, e5.__R = null, u5 ? u5(l3) : l3());
      };
      e5.__R = i5;
      var l3 = function() {
        if (!--r3.__u) {
          if (r3.state.__a) {
            var n3 = r3.state.__a;
            r3.__v.__k[0] = U(n3, n3.__c.__P, n3.__c.__O);
          }
          var t6;
          for (r3.setState({ __a: r3.__b = null }); t6 = r3.t.pop(); )
            t6.forceUpdate();
        }
      }, c5 = true === t5.__h;
      r3.__u++ || c5 || r3.setState({ __a: r3.__b = r3.__v.__k[0] }), n2.then(i5, i5);
    }, D3.prototype.componentWillUnmount = function() {
      this.t = [];
    }, D3.prototype.render = function(n2, e5) {
      if (this.__b) {
        if (this.__v.__k) {
          var r3 = document.createElement("div"), o3 = this.__v.__k[0].__c;
          this.__v.__k[0] = L3(this.__b, r3, o3.__O = o3.__P);
        }
        this.__b = null;
      }
      var i5 = e5.__a && h(p2, null, n2.fallback);
      return i5 && (i5.__h = null), [h(p2, null, e5.__a ? null : n2.children), i5];
    };
    W = function(n2, t5, e5) {
      if (++e5[1] === e5[0] && n2.o.delete(t5), n2.props.revealOrder && ("t" !== n2.props.revealOrder[0] || !n2.o.size))
        for (e5 = n2.u; e5; ) {
          for (; e5.length > 3; )
            e5.pop()();
          if (e5[1] < e5[0])
            break;
          n2.u = e5 = e5[2];
        }
    };
    (V2.prototype = new d()).__a = function(n2) {
      var t5 = this, e5 = F2(t5.__v), r3 = t5.o.get(n2);
      return r3[0]++, function(u5) {
        var o3 = function() {
          t5.props.revealOrder ? (r3.push(u5), W(t5, n2, r3)) : u5();
        };
        e5 ? e5(o3) : o3();
      };
    }, V2.prototype.render = function(n2) {
      this.u = null, this.o = /* @__PURE__ */ new Map();
      var t5 = x(n2.children);
      n2.revealOrder && "b" === n2.revealOrder[0] && t5.reverse();
      for (var e5 = t5.length; e5--; )
        this.o.set(t5[e5], this.u = [1, 0, this.u]);
      return n2.children;
    }, V2.prototype.componentDidUpdate = V2.prototype.componentDidMount = function() {
      var n2 = this;
      this.o.forEach(function(t5, e5) {
        W(n2, e5, t5);
      });
    };
    z3 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103;
    B3 = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
    H2 = "undefined" != typeof document;
    Z2 = function(n2) {
      return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n2);
    };
    d.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t5) {
      Object.defineProperty(d.prototype, t5, { configurable: true, get: function() {
        return this["UNSAFE_" + t5];
      }, set: function(n2) {
        Object.defineProperty(this, t5, { configurable: true, writable: true, value: n2 });
      } });
    });
    G = l.event;
    l.event = function(n2) {
      return G && (n2 = G(n2)), n2.persist = J, n2.isPropagationStopped = K3, n2.isDefaultPrevented = Q, n2.nativeEvent = n2;
    };
    nn = { configurable: true, get: function() {
      return this.class;
    } };
    tn = l.vnode;
    l.vnode = function(n2) {
      var t5 = n2.type, e5 = n2.props, u5 = e5;
      if ("string" == typeof t5) {
        var o3 = -1 === t5.indexOf("-");
        for (var i5 in u5 = {}, e5) {
          var l3 = e5[i5];
          H2 && "children" === i5 && "noscript" === t5 || "value" === i5 && "defaultValue" in e5 && null == l3 || ("defaultValue" === i5 && "value" in e5 && null == e5.value ? i5 = "value" : "download" === i5 && true === l3 ? l3 = "" : /ondoubleclick/i.test(i5) ? i5 = "ondblclick" : /^onchange(textarea|input)/i.test(i5 + t5) && !Z2(e5.type) ? i5 = "oninput" : /^onfocus$/i.test(i5) ? i5 = "onfocusin" : /^onblur$/i.test(i5) ? i5 = "onfocusout" : /^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i5) ? i5 = i5.toLowerCase() : o3 && B3.test(i5) ? i5 = i5.replace(/[A-Z0-9]/g, "-$&").toLowerCase() : null === l3 && (l3 = void 0), /^oninput$/i.test(i5) && (i5 = i5.toLowerCase(), u5[i5] && (i5 = "oninputCapture")), u5[i5] = l3);
        }
        "select" == t5 && u5.multiple && Array.isArray(u5.value) && (u5.value = x(e5.children).forEach(function(n3) {
          n3.props.selected = -1 != u5.value.indexOf(n3.props.value);
        })), "select" == t5 && null != u5.defaultValue && (u5.value = x(e5.children).forEach(function(n3) {
          n3.props.selected = u5.multiple ? -1 != u5.defaultValue.indexOf(n3.props.value) : u5.defaultValue == n3.props.value;
        })), n2.props = u5, e5.class != e5.className && (nn.enumerable = "className" in e5, null != e5.className && (u5.class = e5.className), Object.defineProperty(u5, "className", nn));
      }
      n2.$$typeof = z3, tn && tn(n2);
    };
    en = l.__r;
    l.__r = function(n2) {
      en && en(n2), X2 = n2.__c;
    };
    rn = { ReactCurrentDispatcher: { current: { readContext: function(n2) {
      return X2.__n[n2.__c].props.value;
    } } } };
    un = "17.0.2";
    sn = function(n2, t5) {
      return n2(t5);
    };
    hn = function(n2, t5) {
      return n2(t5);
    };
    vn2 = p2;
    yn = s2;
    bn = { useState: p3, useId: V, useReducer: y2, useEffect: h2, useLayoutEffect: s2, useInsertionEffect: yn, useTransition: mn, useDeferredValue: pn, useSyncExternalStore: _n, startTransition: dn, useRef: _2, useImperativeHandle: A3, useMemo: F, useCallback: T2, useContext: q2, useDebugValue: x2, version: "17.0.2", Children: O2, render: Y2, hydrate: q3, unmountComponentAtNode: fn, createPortal: j3, createElement: h, createContext: B, createFactory: on, cloneElement: cn, createRef: y, Fragment: p2, isValidElement: ln, findDOMNode: an, Component: d, PureComponent: w3, memo: R, forwardRef: k3, flushSync: hn, unstable_batchedUpdates: sn, StrictMode: vn2, Suspense: D3, SuspenseList: V2, lazy: M3, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: rn };
  }
});

// ../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js
var require_use_sync_external_store_shim_production_min = __commonJS({
  "../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js"(exports) {
    "use strict";
    var e5 = (init_compat_module(), __toCommonJS(compat_module_exports));
    function h5(a6, b5) {
      return a6 === b5 && (0 !== a6 || 1 / a6 === 1 / b5) || a6 !== a6 && b5 !== b5;
    }
    var k6 = "function" === typeof Object.is ? Object.is : h5;
    var l3 = e5.useState;
    var m6 = e5.useEffect;
    var n2 = e5.useLayoutEffect;
    var p4 = e5.useDebugValue;
    function q6(a6, b5) {
      var d6 = b5(), f3 = l3({ inst: { value: d6, getSnapshot: b5 } }), c5 = f3[0].inst, g4 = f3[1];
      n2(function() {
        c5.value = d6;
        c5.getSnapshot = b5;
        r3(c5) && g4({ inst: c5 });
      }, [a6, d6, b5]);
      m6(function() {
        r3(c5) && g4({ inst: c5 });
        return a6(function() {
          r3(c5) && g4({ inst: c5 });
        });
      }, [a6]);
      p4(d6);
      return d6;
    }
    function r3(a6) {
      var b5 = a6.getSnapshot;
      a6 = a6.value;
      try {
        var d6 = b5();
        return !k6(a6, d6);
      } catch (f3) {
        return true;
      }
    }
    function t5(a6, b5) {
      return b5();
    }
    var u5 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t5 : q6;
    exports.useSyncExternalStore = void 0 !== e5.useSyncExternalStore ? e5.useSyncExternalStore : u5;
  }
});

// ../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
  "../../node_modules/.pnpm/use-sync-external-store@1.2.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
    "use strict";
    if (true) {
      module.exports = require_use_sync_external_store_shim_production_min();
    } else {
      module.exports = null;
    }
  }
});

// ../../node_modules/.pnpm/qrcode-generator@1.4.4/node_modules/qrcode-generator/qrcode.js
var require_qrcode = __commonJS({
  "../../node_modules/.pnpm/qrcode-generator@1.4.4/node_modules/qrcode-generator/qrcode.js"(exports, module) {
    var qrcode2 = function() {
      var qrcode3 = function(typeNumber, errorCorrectionLevel) {
        var PAD0 = 236;
        var PAD1 = 17;
        var _typeNumber = typeNumber;
        var _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
        var _modules = null;
        var _moduleCount = 0;
        var _dataCache = null;
        var _dataList = [];
        var _this = {};
        var makeImpl = function(test, maskPattern) {
          _moduleCount = _typeNumber * 4 + 17;
          _modules = function(moduleCount) {
            var modules = new Array(moduleCount);
            for (var row = 0; row < moduleCount; row += 1) {
              modules[row] = new Array(moduleCount);
              for (var col = 0; col < moduleCount; col += 1) {
                modules[row][col] = null;
              }
            }
            return modules;
          }(_moduleCount);
          setupPositionProbePattern(0, 0);
          setupPositionProbePattern(_moduleCount - 7, 0);
          setupPositionProbePattern(0, _moduleCount - 7);
          setupPositionAdjustPattern();
          setupTimingPattern();
          setupTypeInfo(test, maskPattern);
          if (_typeNumber >= 7) {
            setupTypeNumber(test);
          }
          if (_dataCache == null) {
            _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
          }
          mapData(_dataCache, maskPattern);
        };
        var setupPositionProbePattern = function(row, col) {
          for (var r3 = -1; r3 <= 7; r3 += 1) {
            if (row + r3 <= -1 || _moduleCount <= row + r3)
              continue;
            for (var c5 = -1; c5 <= 7; c5 += 1) {
              if (col + c5 <= -1 || _moduleCount <= col + c5)
                continue;
              if (0 <= r3 && r3 <= 6 && (c5 == 0 || c5 == 6) || 0 <= c5 && c5 <= 6 && (r3 == 0 || r3 == 6) || 2 <= r3 && r3 <= 4 && 2 <= c5 && c5 <= 4) {
                _modules[row + r3][col + c5] = true;
              } else {
                _modules[row + r3][col + c5] = false;
              }
            }
          }
        };
        var getBestMaskPattern = function() {
          var minLostPoint = 0;
          var pattern = 0;
          for (var i5 = 0; i5 < 8; i5 += 1) {
            makeImpl(true, i5);
            var lostPoint = QRUtil.getLostPoint(_this);
            if (i5 == 0 || minLostPoint > lostPoint) {
              minLostPoint = lostPoint;
              pattern = i5;
            }
          }
          return pattern;
        };
        var setupTimingPattern = function() {
          for (var r3 = 8; r3 < _moduleCount - 8; r3 += 1) {
            if (_modules[r3][6] != null) {
              continue;
            }
            _modules[r3][6] = r3 % 2 == 0;
          }
          for (var c5 = 8; c5 < _moduleCount - 8; c5 += 1) {
            if (_modules[6][c5] != null) {
              continue;
            }
            _modules[6][c5] = c5 % 2 == 0;
          }
        };
        var setupPositionAdjustPattern = function() {
          var pos = QRUtil.getPatternPosition(_typeNumber);
          for (var i5 = 0; i5 < pos.length; i5 += 1) {
            for (var j4 = 0; j4 < pos.length; j4 += 1) {
              var row = pos[i5];
              var col = pos[j4];
              if (_modules[row][col] != null) {
                continue;
              }
              for (var r3 = -2; r3 <= 2; r3 += 1) {
                for (var c5 = -2; c5 <= 2; c5 += 1) {
                  if (r3 == -2 || r3 == 2 || c5 == -2 || c5 == 2 || r3 == 0 && c5 == 0) {
                    _modules[row + r3][col + c5] = true;
                  } else {
                    _modules[row + r3][col + c5] = false;
                  }
                }
              }
            }
          }
        };
        var setupTypeNumber = function(test) {
          var bits = QRUtil.getBCHTypeNumber(_typeNumber);
          for (var i5 = 0; i5 < 18; i5 += 1) {
            var mod = !test && (bits >> i5 & 1) == 1;
            _modules[Math.floor(i5 / 3)][i5 % 3 + _moduleCount - 8 - 3] = mod;
          }
          for (var i5 = 0; i5 < 18; i5 += 1) {
            var mod = !test && (bits >> i5 & 1) == 1;
            _modules[i5 % 3 + _moduleCount - 8 - 3][Math.floor(i5 / 3)] = mod;
          }
        };
        var setupTypeInfo = function(test, maskPattern) {
          var data = _errorCorrectionLevel << 3 | maskPattern;
          var bits = QRUtil.getBCHTypeInfo(data);
          for (var i5 = 0; i5 < 15; i5 += 1) {
            var mod = !test && (bits >> i5 & 1) == 1;
            if (i5 < 6) {
              _modules[i5][8] = mod;
            } else if (i5 < 8) {
              _modules[i5 + 1][8] = mod;
            } else {
              _modules[_moduleCount - 15 + i5][8] = mod;
            }
          }
          for (var i5 = 0; i5 < 15; i5 += 1) {
            var mod = !test && (bits >> i5 & 1) == 1;
            if (i5 < 8) {
              _modules[8][_moduleCount - i5 - 1] = mod;
            } else if (i5 < 9) {
              _modules[8][15 - i5 - 1 + 1] = mod;
            } else {
              _modules[8][15 - i5 - 1] = mod;
            }
          }
          _modules[_moduleCount - 8][8] = !test;
        };
        var mapData = function(data, maskPattern) {
          var inc = -1;
          var row = _moduleCount - 1;
          var bitIndex = 7;
          var byteIndex = 0;
          var maskFunc = QRUtil.getMaskFunction(maskPattern);
          for (var col = _moduleCount - 1; col > 0; col -= 2) {
            if (col == 6)
              col -= 1;
            while (true) {
              for (var c5 = 0; c5 < 2; c5 += 1) {
                if (_modules[row][col - c5] == null) {
                  var dark = false;
                  if (byteIndex < data.length) {
                    dark = (data[byteIndex] >>> bitIndex & 1) == 1;
                  }
                  var mask = maskFunc(row, col - c5);
                  if (mask) {
                    dark = !dark;
                  }
                  _modules[row][col - c5] = dark;
                  bitIndex -= 1;
                  if (bitIndex == -1) {
                    byteIndex += 1;
                    bitIndex = 7;
                  }
                }
              }
              row += inc;
              if (row < 0 || _moduleCount <= row) {
                row -= inc;
                inc = -inc;
                break;
              }
            }
          }
        };
        var createBytes = function(buffer, rsBlocks) {
          var offset = 0;
          var maxDcCount = 0;
          var maxEcCount = 0;
          var dcdata = new Array(rsBlocks.length);
          var ecdata = new Array(rsBlocks.length);
          for (var r3 = 0; r3 < rsBlocks.length; r3 += 1) {
            var dcCount = rsBlocks[r3].dataCount;
            var ecCount = rsBlocks[r3].totalCount - dcCount;
            maxDcCount = Math.max(maxDcCount, dcCount);
            maxEcCount = Math.max(maxEcCount, ecCount);
            dcdata[r3] = new Array(dcCount);
            for (var i5 = 0; i5 < dcdata[r3].length; i5 += 1) {
              dcdata[r3][i5] = 255 & buffer.getBuffer()[i5 + offset];
            }
            offset += dcCount;
            var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
            var rawPoly = qrPolynomial(dcdata[r3], rsPoly.getLength() - 1);
            var modPoly = rawPoly.mod(rsPoly);
            ecdata[r3] = new Array(rsPoly.getLength() - 1);
            for (var i5 = 0; i5 < ecdata[r3].length; i5 += 1) {
              var modIndex = i5 + modPoly.getLength() - ecdata[r3].length;
              ecdata[r3][i5] = modIndex >= 0 ? modPoly.getAt(modIndex) : 0;
            }
          }
          var totalCodeCount = 0;
          for (var i5 = 0; i5 < rsBlocks.length; i5 += 1) {
            totalCodeCount += rsBlocks[i5].totalCount;
          }
          var data = new Array(totalCodeCount);
          var index2 = 0;
          for (var i5 = 0; i5 < maxDcCount; i5 += 1) {
            for (var r3 = 0; r3 < rsBlocks.length; r3 += 1) {
              if (i5 < dcdata[r3].length) {
                data[index2] = dcdata[r3][i5];
                index2 += 1;
              }
            }
          }
          for (var i5 = 0; i5 < maxEcCount; i5 += 1) {
            for (var r3 = 0; r3 < rsBlocks.length; r3 += 1) {
              if (i5 < ecdata[r3].length) {
                data[index2] = ecdata[r3][i5];
                index2 += 1;
              }
            }
          }
          return data;
        };
        var createData = function(typeNumber2, errorCorrectionLevel2, dataList) {
          var rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, errorCorrectionLevel2);
          var buffer = qrBitBuffer();
          for (var i5 = 0; i5 < dataList.length; i5 += 1) {
            var data = dataList[i5];
            buffer.put(data.getMode(), 4);
            buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
            data.write(buffer);
          }
          var totalDataCount = 0;
          for (var i5 = 0; i5 < rsBlocks.length; i5 += 1) {
            totalDataCount += rsBlocks[i5].dataCount;
          }
          if (buffer.getLengthInBits() > totalDataCount * 8) {
            throw "code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")";
          }
          if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
            buffer.put(0, 4);
          }
          while (buffer.getLengthInBits() % 8 != 0) {
            buffer.putBit(false);
          }
          while (true) {
            if (buffer.getLengthInBits() >= totalDataCount * 8) {
              break;
            }
            buffer.put(PAD0, 8);
            if (buffer.getLengthInBits() >= totalDataCount * 8) {
              break;
            }
            buffer.put(PAD1, 8);
          }
          return createBytes(buffer, rsBlocks);
        };
        _this.addData = function(data, mode) {
          mode = mode || "Byte";
          var newData = null;
          switch (mode) {
            case "Numeric":
              newData = qrNumber(data);
              break;
            case "Alphanumeric":
              newData = qrAlphaNum(data);
              break;
            case "Byte":
              newData = qr8BitByte(data);
              break;
            case "Kanji":
              newData = qrKanji(data);
              break;
            default:
              throw "mode:" + mode;
          }
          _dataList.push(newData);
          _dataCache = null;
        };
        _this.isDark = function(row, col) {
          if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
            throw row + "," + col;
          }
          return _modules[row][col];
        };
        _this.getModuleCount = function() {
          return _moduleCount;
        };
        _this.make = function() {
          if (_typeNumber < 1) {
            var typeNumber2 = 1;
            for (; typeNumber2 < 40; typeNumber2++) {
              var rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, _errorCorrectionLevel);
              var buffer = qrBitBuffer();
              for (var i5 = 0; i5 < _dataList.length; i5++) {
                var data = _dataList[i5];
                buffer.put(data.getMode(), 4);
                buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
                data.write(buffer);
              }
              var totalDataCount = 0;
              for (var i5 = 0; i5 < rsBlocks.length; i5++) {
                totalDataCount += rsBlocks[i5].dataCount;
              }
              if (buffer.getLengthInBits() <= totalDataCount * 8) {
                break;
              }
            }
            _typeNumber = typeNumber2;
          }
          makeImpl(false, getBestMaskPattern());
        };
        _this.createTableTag = function(cellSize, margin) {
          cellSize = cellSize || 2;
          margin = typeof margin == "undefined" ? cellSize * 4 : margin;
          var qrHtml = "";
          qrHtml += '<table style="';
          qrHtml += " border-width: 0px; border-style: none;";
          qrHtml += " border-collapse: collapse;";
          qrHtml += " padding: 0px; margin: " + margin + "px;";
          qrHtml += '">';
          qrHtml += "<tbody>";
          for (var r3 = 0; r3 < _this.getModuleCount(); r3 += 1) {
            qrHtml += "<tr>";
            for (var c5 = 0; c5 < _this.getModuleCount(); c5 += 1) {
              qrHtml += '<td style="';
              qrHtml += " border-width: 0px; border-style: none;";
              qrHtml += " border-collapse: collapse;";
              qrHtml += " padding: 0px; margin: 0px;";
              qrHtml += " width: " + cellSize + "px;";
              qrHtml += " height: " + cellSize + "px;";
              qrHtml += " background-color: ";
              qrHtml += _this.isDark(r3, c5) ? "#000000" : "#ffffff";
              qrHtml += ";";
              qrHtml += '"/>';
            }
            qrHtml += "</tr>";
          }
          qrHtml += "</tbody>";
          qrHtml += "</table>";
          return qrHtml;
        };
        _this.createSvgTag = function(cellSize, margin, alt, title) {
          var opts = {};
          if (typeof arguments[0] == "object") {
            opts = arguments[0];
            cellSize = opts.cellSize;
            margin = opts.margin;
            alt = opts.alt;
            title = opts.title;
          }
          cellSize = cellSize || 2;
          margin = typeof margin == "undefined" ? cellSize * 4 : margin;
          alt = typeof alt === "string" ? { text: alt } : alt || {};
          alt.text = alt.text || null;
          alt.id = alt.text ? alt.id || "qrcode-description" : null;
          title = typeof title === "string" ? { text: title } : title || {};
          title.text = title.text || null;
          title.id = title.text ? title.id || "qrcode-title" : null;
          var size = _this.getModuleCount() * cellSize + margin * 2;
          var c5, mc, r3, mr, qrSvg = "", rect;
          rect = "l" + cellSize + ",0 0," + cellSize + " -" + cellSize + ",0 0,-" + cellSize + "z ";
          qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
          qrSvg += !opts.scalable ? ' width="' + size + 'px" height="' + size + 'px"' : "";
          qrSvg += ' viewBox="0 0 ' + size + " " + size + '" ';
          qrSvg += ' preserveAspectRatio="xMinYMin meet"';
          qrSvg += title.text || alt.text ? ' role="img" aria-labelledby="' + escapeXml([title.id, alt.id].join(" ").trim()) + '"' : "";
          qrSvg += ">";
          qrSvg += title.text ? '<title id="' + escapeXml(title.id) + '">' + escapeXml(title.text) + "</title>" : "";
          qrSvg += alt.text ? '<description id="' + escapeXml(alt.id) + '">' + escapeXml(alt.text) + "</description>" : "";
          qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
          qrSvg += '<path d="';
          for (r3 = 0; r3 < _this.getModuleCount(); r3 += 1) {
            mr = r3 * cellSize + margin;
            for (c5 = 0; c5 < _this.getModuleCount(); c5 += 1) {
              if (_this.isDark(r3, c5)) {
                mc = c5 * cellSize + margin;
                qrSvg += "M" + mc + "," + mr + rect;
              }
            }
          }
          qrSvg += '" stroke="transparent" fill="black"/>';
          qrSvg += "</svg>";
          return qrSvg;
        };
        _this.createDataURL = function(cellSize, margin) {
          cellSize = cellSize || 2;
          margin = typeof margin == "undefined" ? cellSize * 4 : margin;
          var size = _this.getModuleCount() * cellSize + margin * 2;
          var min = margin;
          var max = size - margin;
          return createDataURL(size, size, function(x6, y6) {
            if (min <= x6 && x6 < max && min <= y6 && y6 < max) {
              var c5 = Math.floor((x6 - min) / cellSize);
              var r3 = Math.floor((y6 - min) / cellSize);
              return _this.isDark(r3, c5) ? 0 : 1;
            } else {
              return 1;
            }
          });
        };
        _this.createImgTag = function(cellSize, margin, alt) {
          cellSize = cellSize || 2;
          margin = typeof margin == "undefined" ? cellSize * 4 : margin;
          var size = _this.getModuleCount() * cellSize + margin * 2;
          var img = "";
          img += "<img";
          img += ' src="';
          img += _this.createDataURL(cellSize, margin);
          img += '"';
          img += ' width="';
          img += size;
          img += '"';
          img += ' height="';
          img += size;
          img += '"';
          if (alt) {
            img += ' alt="';
            img += escapeXml(alt);
            img += '"';
          }
          img += "/>";
          return img;
        };
        var escapeXml = function(s6) {
          var escaped = "";
          for (var i5 = 0; i5 < s6.length; i5 += 1) {
            var c5 = s6.charAt(i5);
            switch (c5) {
              case "<":
                escaped += "&lt;";
                break;
              case ">":
                escaped += "&gt;";
                break;
              case "&":
                escaped += "&amp;";
                break;
              case '"':
                escaped += "&quot;";
                break;
              default:
                escaped += c5;
                break;
            }
          }
          return escaped;
        };
        var _createHalfASCII = function(margin) {
          var cellSize = 1;
          margin = typeof margin == "undefined" ? cellSize * 2 : margin;
          var size = _this.getModuleCount() * cellSize + margin * 2;
          var min = margin;
          var max = size - margin;
          var y6, x6, r1, r22, p4;
          var blocks = {
            "\u2588\u2588": "\u2588",
            "\u2588 ": "\u2580",
            " \u2588": "\u2584",
            "  ": " "
          };
          var blocksLastLineNoMargin = {
            "\u2588\u2588": "\u2580",
            "\u2588 ": "\u2580",
            " \u2588": " ",
            "  ": " "
          };
          var ascii = "";
          for (y6 = 0; y6 < size; y6 += 2) {
            r1 = Math.floor((y6 - min) / cellSize);
            r22 = Math.floor((y6 + 1 - min) / cellSize);
            for (x6 = 0; x6 < size; x6 += 1) {
              p4 = "\u2588";
              if (min <= x6 && x6 < max && min <= y6 && y6 < max && _this.isDark(r1, Math.floor((x6 - min) / cellSize))) {
                p4 = " ";
              }
              if (min <= x6 && x6 < max && min <= y6 + 1 && y6 + 1 < max && _this.isDark(r22, Math.floor((x6 - min) / cellSize))) {
                p4 += " ";
              } else {
                p4 += "\u2588";
              }
              ascii += margin < 1 && y6 + 1 >= max ? blocksLastLineNoMargin[p4] : blocks[p4];
            }
            ascii += "\n";
          }
          if (size % 2 && margin > 0) {
            return ascii.substring(0, ascii.length - size - 1) + Array(size + 1).join("\u2580");
          }
          return ascii.substring(0, ascii.length - 1);
        };
        _this.createASCII = function(cellSize, margin) {
          cellSize = cellSize || 1;
          if (cellSize < 2) {
            return _createHalfASCII(margin);
          }
          cellSize -= 1;
          margin = typeof margin == "undefined" ? cellSize * 2 : margin;
          var size = _this.getModuleCount() * cellSize + margin * 2;
          var min = margin;
          var max = size - margin;
          var y6, x6, r3, p4;
          var white = Array(cellSize + 1).join("\u2588\u2588");
          var black = Array(cellSize + 1).join("  ");
          var ascii = "";
          var line = "";
          for (y6 = 0; y6 < size; y6 += 1) {
            r3 = Math.floor((y6 - min) / cellSize);
            line = "";
            for (x6 = 0; x6 < size; x6 += 1) {
              p4 = 1;
              if (min <= x6 && x6 < max && min <= y6 && y6 < max && _this.isDark(r3, Math.floor((x6 - min) / cellSize))) {
                p4 = 0;
              }
              line += p4 ? white : black;
            }
            for (r3 = 0; r3 < cellSize; r3 += 1) {
              ascii += line + "\n";
            }
          }
          return ascii.substring(0, ascii.length - 1);
        };
        _this.renderTo2dContext = function(context, cellSize) {
          cellSize = cellSize || 2;
          var length = _this.getModuleCount();
          for (var row = 0; row < length; row++) {
            for (var col = 0; col < length; col++) {
              context.fillStyle = _this.isDark(row, col) ? "black" : "white";
              context.fillRect(row * cellSize, col * cellSize, cellSize, cellSize);
            }
          }
        };
        return _this;
      };
      qrcode3.stringToBytesFuncs = {
        "default": function(s6) {
          var bytes = [];
          for (var i5 = 0; i5 < s6.length; i5 += 1) {
            var c5 = s6.charCodeAt(i5);
            bytes.push(c5 & 255);
          }
          return bytes;
        }
      };
      qrcode3.stringToBytes = qrcode3.stringToBytesFuncs["default"];
      qrcode3.createStringToBytes = function(unicodeData, numChars) {
        var unicodeMap = function() {
          var bin = base64DecodeInputStream(unicodeData);
          var read = function() {
            var b5 = bin.read();
            if (b5 == -1)
              throw "eof";
            return b5;
          };
          var count = 0;
          var unicodeMap2 = {};
          while (true) {
            var b0 = bin.read();
            if (b0 == -1)
              break;
            var b1 = read();
            var b22 = read();
            var b32 = read();
            var k6 = String.fromCharCode(b0 << 8 | b1);
            var v3 = b22 << 8 | b32;
            unicodeMap2[k6] = v3;
            count += 1;
          }
          if (count != numChars) {
            throw count + " != " + numChars;
          }
          return unicodeMap2;
        }();
        var unknownChar = "?".charCodeAt(0);
        return function(s6) {
          var bytes = [];
          for (var i5 = 0; i5 < s6.length; i5 += 1) {
            var c5 = s6.charCodeAt(i5);
            if (c5 < 128) {
              bytes.push(c5);
            } else {
              var b5 = unicodeMap[s6.charAt(i5)];
              if (typeof b5 == "number") {
                if ((b5 & 255) == b5) {
                  bytes.push(b5);
                } else {
                  bytes.push(b5 >>> 8);
                  bytes.push(b5 & 255);
                }
              } else {
                bytes.push(unknownChar);
              }
            }
          }
          return bytes;
        };
      };
      var QRMode = {
        MODE_NUMBER: 1 << 0,
        MODE_ALPHA_NUM: 1 << 1,
        MODE_8BIT_BYTE: 1 << 2,
        MODE_KANJI: 1 << 3
      };
      var QRErrorCorrectionLevel = {
        L: 1,
        M: 0,
        Q: 3,
        H: 2
      };
      var QRMaskPattern = {
        PATTERN000: 0,
        PATTERN001: 1,
        PATTERN010: 2,
        PATTERN011: 3,
        PATTERN100: 4,
        PATTERN101: 5,
        PATTERN110: 6,
        PATTERN111: 7
      };
      var QRUtil = function() {
        var PATTERN_POSITION_TABLE = [
          [],
          [6, 18],
          [6, 22],
          [6, 26],
          [6, 30],
          [6, 34],
          [6, 22, 38],
          [6, 24, 42],
          [6, 26, 46],
          [6, 28, 50],
          [6, 30, 54],
          [6, 32, 58],
          [6, 34, 62],
          [6, 26, 46, 66],
          [6, 26, 48, 70],
          [6, 26, 50, 74],
          [6, 30, 54, 78],
          [6, 30, 56, 82],
          [6, 30, 58, 86],
          [6, 34, 62, 90],
          [6, 28, 50, 72, 94],
          [6, 26, 50, 74, 98],
          [6, 30, 54, 78, 102],
          [6, 28, 54, 80, 106],
          [6, 32, 58, 84, 110],
          [6, 30, 58, 86, 114],
          [6, 34, 62, 90, 118],
          [6, 26, 50, 74, 98, 122],
          [6, 30, 54, 78, 102, 126],
          [6, 26, 52, 78, 104, 130],
          [6, 30, 56, 82, 108, 134],
          [6, 34, 60, 86, 112, 138],
          [6, 30, 58, 86, 114, 142],
          [6, 34, 62, 90, 118, 146],
          [6, 30, 54, 78, 102, 126, 150],
          [6, 24, 50, 76, 102, 128, 154],
          [6, 28, 54, 80, 106, 132, 158],
          [6, 32, 58, 84, 110, 136, 162],
          [6, 26, 54, 82, 110, 138, 166],
          [6, 30, 58, 86, 114, 142, 170]
        ];
        var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
        var G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
        var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
        var _this = {};
        var getBCHDigit = function(data) {
          var digit = 0;
          while (data != 0) {
            digit += 1;
            data >>>= 1;
          }
          return digit;
        };
        _this.getBCHTypeInfo = function(data) {
          var d6 = data << 10;
          while (getBCHDigit(d6) - getBCHDigit(G15) >= 0) {
            d6 ^= G15 << getBCHDigit(d6) - getBCHDigit(G15);
          }
          return (data << 10 | d6) ^ G15_MASK;
        };
        _this.getBCHTypeNumber = function(data) {
          var d6 = data << 12;
          while (getBCHDigit(d6) - getBCHDigit(G18) >= 0) {
            d6 ^= G18 << getBCHDigit(d6) - getBCHDigit(G18);
          }
          return data << 12 | d6;
        };
        _this.getPatternPosition = function(typeNumber) {
          return PATTERN_POSITION_TABLE[typeNumber - 1];
        };
        _this.getMaskFunction = function(maskPattern) {
          switch (maskPattern) {
            case QRMaskPattern.PATTERN000:
              return function(i5, j4) {
                return (i5 + j4) % 2 == 0;
              };
            case QRMaskPattern.PATTERN001:
              return function(i5, j4) {
                return i5 % 2 == 0;
              };
            case QRMaskPattern.PATTERN010:
              return function(i5, j4) {
                return j4 % 3 == 0;
              };
            case QRMaskPattern.PATTERN011:
              return function(i5, j4) {
                return (i5 + j4) % 3 == 0;
              };
            case QRMaskPattern.PATTERN100:
              return function(i5, j4) {
                return (Math.floor(i5 / 2) + Math.floor(j4 / 3)) % 2 == 0;
              };
            case QRMaskPattern.PATTERN101:
              return function(i5, j4) {
                return i5 * j4 % 2 + i5 * j4 % 3 == 0;
              };
            case QRMaskPattern.PATTERN110:
              return function(i5, j4) {
                return (i5 * j4 % 2 + i5 * j4 % 3) % 2 == 0;
              };
            case QRMaskPattern.PATTERN111:
              return function(i5, j4) {
                return (i5 * j4 % 3 + (i5 + j4) % 2) % 2 == 0;
              };
            default:
              throw "bad maskPattern:" + maskPattern;
          }
        };
        _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
          var a6 = qrPolynomial([1], 0);
          for (var i5 = 0; i5 < errorCorrectLength; i5 += 1) {
            a6 = a6.multiply(qrPolynomial([1, QRMath.gexp(i5)], 0));
          }
          return a6;
        };
        _this.getLengthInBits = function(mode, type) {
          if (1 <= type && type < 10) {
            switch (mode) {
              case QRMode.MODE_NUMBER:
                return 10;
              case QRMode.MODE_ALPHA_NUM:
                return 9;
              case QRMode.MODE_8BIT_BYTE:
                return 8;
              case QRMode.MODE_KANJI:
                return 8;
              default:
                throw "mode:" + mode;
            }
          } else if (type < 27) {
            switch (mode) {
              case QRMode.MODE_NUMBER:
                return 12;
              case QRMode.MODE_ALPHA_NUM:
                return 11;
              case QRMode.MODE_8BIT_BYTE:
                return 16;
              case QRMode.MODE_KANJI:
                return 10;
              default:
                throw "mode:" + mode;
            }
          } else if (type < 41) {
            switch (mode) {
              case QRMode.MODE_NUMBER:
                return 14;
              case QRMode.MODE_ALPHA_NUM:
                return 13;
              case QRMode.MODE_8BIT_BYTE:
                return 16;
              case QRMode.MODE_KANJI:
                return 12;
              default:
                throw "mode:" + mode;
            }
          } else {
            throw "type:" + type;
          }
        };
        _this.getLostPoint = function(qrcode4) {
          var moduleCount = qrcode4.getModuleCount();
          var lostPoint = 0;
          for (var row = 0; row < moduleCount; row += 1) {
            for (var col = 0; col < moduleCount; col += 1) {
              var sameCount = 0;
              var dark = qrcode4.isDark(row, col);
              for (var r3 = -1; r3 <= 1; r3 += 1) {
                if (row + r3 < 0 || moduleCount <= row + r3) {
                  continue;
                }
                for (var c5 = -1; c5 <= 1; c5 += 1) {
                  if (col + c5 < 0 || moduleCount <= col + c5) {
                    continue;
                  }
                  if (r3 == 0 && c5 == 0) {
                    continue;
                  }
                  if (dark == qrcode4.isDark(row + r3, col + c5)) {
                    sameCount += 1;
                  }
                }
              }
              if (sameCount > 5) {
                lostPoint += 3 + sameCount - 5;
              }
            }
          }
          ;
          for (var row = 0; row < moduleCount - 1; row += 1) {
            for (var col = 0; col < moduleCount - 1; col += 1) {
              var count = 0;
              if (qrcode4.isDark(row, col))
                count += 1;
              if (qrcode4.isDark(row + 1, col))
                count += 1;
              if (qrcode4.isDark(row, col + 1))
                count += 1;
              if (qrcode4.isDark(row + 1, col + 1))
                count += 1;
              if (count == 0 || count == 4) {
                lostPoint += 3;
              }
            }
          }
          for (var row = 0; row < moduleCount; row += 1) {
            for (var col = 0; col < moduleCount - 6; col += 1) {
              if (qrcode4.isDark(row, col) && !qrcode4.isDark(row, col + 1) && qrcode4.isDark(row, col + 2) && qrcode4.isDark(row, col + 3) && qrcode4.isDark(row, col + 4) && !qrcode4.isDark(row, col + 5) && qrcode4.isDark(row, col + 6)) {
                lostPoint += 40;
              }
            }
          }
          for (var col = 0; col < moduleCount; col += 1) {
            for (var row = 0; row < moduleCount - 6; row += 1) {
              if (qrcode4.isDark(row, col) && !qrcode4.isDark(row + 1, col) && qrcode4.isDark(row + 2, col) && qrcode4.isDark(row + 3, col) && qrcode4.isDark(row + 4, col) && !qrcode4.isDark(row + 5, col) && qrcode4.isDark(row + 6, col)) {
                lostPoint += 40;
              }
            }
          }
          var darkCount = 0;
          for (var col = 0; col < moduleCount; col += 1) {
            for (var row = 0; row < moduleCount; row += 1) {
              if (qrcode4.isDark(row, col)) {
                darkCount += 1;
              }
            }
          }
          var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
          lostPoint += ratio * 10;
          return lostPoint;
        };
        return _this;
      }();
      var QRMath = function() {
        var EXP_TABLE = new Array(256);
        var LOG_TABLE = new Array(256);
        for (var i5 = 0; i5 < 8; i5 += 1) {
          EXP_TABLE[i5] = 1 << i5;
        }
        for (var i5 = 8; i5 < 256; i5 += 1) {
          EXP_TABLE[i5] = EXP_TABLE[i5 - 4] ^ EXP_TABLE[i5 - 5] ^ EXP_TABLE[i5 - 6] ^ EXP_TABLE[i5 - 8];
        }
        for (var i5 = 0; i5 < 255; i5 += 1) {
          LOG_TABLE[EXP_TABLE[i5]] = i5;
        }
        var _this = {};
        _this.glog = function(n2) {
          if (n2 < 1) {
            throw "glog(" + n2 + ")";
          }
          return LOG_TABLE[n2];
        };
        _this.gexp = function(n2) {
          while (n2 < 0) {
            n2 += 255;
          }
          while (n2 >= 256) {
            n2 -= 255;
          }
          return EXP_TABLE[n2];
        };
        return _this;
      }();
      function qrPolynomial(num, shift) {
        if (typeof num.length == "undefined") {
          throw num.length + "/" + shift;
        }
        var _num = function() {
          var offset = 0;
          while (offset < num.length && num[offset] == 0) {
            offset += 1;
          }
          var _num2 = new Array(num.length - offset + shift);
          for (var i5 = 0; i5 < num.length - offset; i5 += 1) {
            _num2[i5] = num[i5 + offset];
          }
          return _num2;
        }();
        var _this = {};
        _this.getAt = function(index2) {
          return _num[index2];
        };
        _this.getLength = function() {
          return _num.length;
        };
        _this.multiply = function(e5) {
          var num2 = new Array(_this.getLength() + e5.getLength() - 1);
          for (var i5 = 0; i5 < _this.getLength(); i5 += 1) {
            for (var j4 = 0; j4 < e5.getLength(); j4 += 1) {
              num2[i5 + j4] ^= QRMath.gexp(QRMath.glog(_this.getAt(i5)) + QRMath.glog(e5.getAt(j4)));
            }
          }
          return qrPolynomial(num2, 0);
        };
        _this.mod = function(e5) {
          if (_this.getLength() - e5.getLength() < 0) {
            return _this;
          }
          var ratio = QRMath.glog(_this.getAt(0)) - QRMath.glog(e5.getAt(0));
          var num2 = new Array(_this.getLength());
          for (var i5 = 0; i5 < _this.getLength(); i5 += 1) {
            num2[i5] = _this.getAt(i5);
          }
          for (var i5 = 0; i5 < e5.getLength(); i5 += 1) {
            num2[i5] ^= QRMath.gexp(QRMath.glog(e5.getAt(i5)) + ratio);
          }
          return qrPolynomial(num2, 0).mod(e5);
        };
        return _this;
      }
      ;
      var QRRSBlock = function() {
        var RS_BLOCK_TABLE = [
          // L
          // M
          // Q
          // H
          // 1
          [1, 26, 19],
          [1, 26, 16],
          [1, 26, 13],
          [1, 26, 9],
          // 2
          [1, 44, 34],
          [1, 44, 28],
          [1, 44, 22],
          [1, 44, 16],
          // 3
          [1, 70, 55],
          [1, 70, 44],
          [2, 35, 17],
          [2, 35, 13],
          // 4
          [1, 100, 80],
          [2, 50, 32],
          [2, 50, 24],
          [4, 25, 9],
          // 5
          [1, 134, 108],
          [2, 67, 43],
          [2, 33, 15, 2, 34, 16],
          [2, 33, 11, 2, 34, 12],
          // 6
          [2, 86, 68],
          [4, 43, 27],
          [4, 43, 19],
          [4, 43, 15],
          // 7
          [2, 98, 78],
          [4, 49, 31],
          [2, 32, 14, 4, 33, 15],
          [4, 39, 13, 1, 40, 14],
          // 8
          [2, 121, 97],
          [2, 60, 38, 2, 61, 39],
          [4, 40, 18, 2, 41, 19],
          [4, 40, 14, 2, 41, 15],
          // 9
          [2, 146, 116],
          [3, 58, 36, 2, 59, 37],
          [4, 36, 16, 4, 37, 17],
          [4, 36, 12, 4, 37, 13],
          // 10
          [2, 86, 68, 2, 87, 69],
          [4, 69, 43, 1, 70, 44],
          [6, 43, 19, 2, 44, 20],
          [6, 43, 15, 2, 44, 16],
          // 11
          [4, 101, 81],
          [1, 80, 50, 4, 81, 51],
          [4, 50, 22, 4, 51, 23],
          [3, 36, 12, 8, 37, 13],
          // 12
          [2, 116, 92, 2, 117, 93],
          [6, 58, 36, 2, 59, 37],
          [4, 46, 20, 6, 47, 21],
          [7, 42, 14, 4, 43, 15],
          // 13
          [4, 133, 107],
          [8, 59, 37, 1, 60, 38],
          [8, 44, 20, 4, 45, 21],
          [12, 33, 11, 4, 34, 12],
          // 14
          [3, 145, 115, 1, 146, 116],
          [4, 64, 40, 5, 65, 41],
          [11, 36, 16, 5, 37, 17],
          [11, 36, 12, 5, 37, 13],
          // 15
          [5, 109, 87, 1, 110, 88],
          [5, 65, 41, 5, 66, 42],
          [5, 54, 24, 7, 55, 25],
          [11, 36, 12, 7, 37, 13],
          // 16
          [5, 122, 98, 1, 123, 99],
          [7, 73, 45, 3, 74, 46],
          [15, 43, 19, 2, 44, 20],
          [3, 45, 15, 13, 46, 16],
          // 17
          [1, 135, 107, 5, 136, 108],
          [10, 74, 46, 1, 75, 47],
          [1, 50, 22, 15, 51, 23],
          [2, 42, 14, 17, 43, 15],
          // 18
          [5, 150, 120, 1, 151, 121],
          [9, 69, 43, 4, 70, 44],
          [17, 50, 22, 1, 51, 23],
          [2, 42, 14, 19, 43, 15],
          // 19
          [3, 141, 113, 4, 142, 114],
          [3, 70, 44, 11, 71, 45],
          [17, 47, 21, 4, 48, 22],
          [9, 39, 13, 16, 40, 14],
          // 20
          [3, 135, 107, 5, 136, 108],
          [3, 67, 41, 13, 68, 42],
          [15, 54, 24, 5, 55, 25],
          [15, 43, 15, 10, 44, 16],
          // 21
          [4, 144, 116, 4, 145, 117],
          [17, 68, 42],
          [17, 50, 22, 6, 51, 23],
          [19, 46, 16, 6, 47, 17],
          // 22
          [2, 139, 111, 7, 140, 112],
          [17, 74, 46],
          [7, 54, 24, 16, 55, 25],
          [34, 37, 13],
          // 23
          [4, 151, 121, 5, 152, 122],
          [4, 75, 47, 14, 76, 48],
          [11, 54, 24, 14, 55, 25],
          [16, 45, 15, 14, 46, 16],
          // 24
          [6, 147, 117, 4, 148, 118],
          [6, 73, 45, 14, 74, 46],
          [11, 54, 24, 16, 55, 25],
          [30, 46, 16, 2, 47, 17],
          // 25
          [8, 132, 106, 4, 133, 107],
          [8, 75, 47, 13, 76, 48],
          [7, 54, 24, 22, 55, 25],
          [22, 45, 15, 13, 46, 16],
          // 26
          [10, 142, 114, 2, 143, 115],
          [19, 74, 46, 4, 75, 47],
          [28, 50, 22, 6, 51, 23],
          [33, 46, 16, 4, 47, 17],
          // 27
          [8, 152, 122, 4, 153, 123],
          [22, 73, 45, 3, 74, 46],
          [8, 53, 23, 26, 54, 24],
          [12, 45, 15, 28, 46, 16],
          // 28
          [3, 147, 117, 10, 148, 118],
          [3, 73, 45, 23, 74, 46],
          [4, 54, 24, 31, 55, 25],
          [11, 45, 15, 31, 46, 16],
          // 29
          [7, 146, 116, 7, 147, 117],
          [21, 73, 45, 7, 74, 46],
          [1, 53, 23, 37, 54, 24],
          [19, 45, 15, 26, 46, 16],
          // 30
          [5, 145, 115, 10, 146, 116],
          [19, 75, 47, 10, 76, 48],
          [15, 54, 24, 25, 55, 25],
          [23, 45, 15, 25, 46, 16],
          // 31
          [13, 145, 115, 3, 146, 116],
          [2, 74, 46, 29, 75, 47],
          [42, 54, 24, 1, 55, 25],
          [23, 45, 15, 28, 46, 16],
          // 32
          [17, 145, 115],
          [10, 74, 46, 23, 75, 47],
          [10, 54, 24, 35, 55, 25],
          [19, 45, 15, 35, 46, 16],
          // 33
          [17, 145, 115, 1, 146, 116],
          [14, 74, 46, 21, 75, 47],
          [29, 54, 24, 19, 55, 25],
          [11, 45, 15, 46, 46, 16],
          // 34
          [13, 145, 115, 6, 146, 116],
          [14, 74, 46, 23, 75, 47],
          [44, 54, 24, 7, 55, 25],
          [59, 46, 16, 1, 47, 17],
          // 35
          [12, 151, 121, 7, 152, 122],
          [12, 75, 47, 26, 76, 48],
          [39, 54, 24, 14, 55, 25],
          [22, 45, 15, 41, 46, 16],
          // 36
          [6, 151, 121, 14, 152, 122],
          [6, 75, 47, 34, 76, 48],
          [46, 54, 24, 10, 55, 25],
          [2, 45, 15, 64, 46, 16],
          // 37
          [17, 152, 122, 4, 153, 123],
          [29, 74, 46, 14, 75, 47],
          [49, 54, 24, 10, 55, 25],
          [24, 45, 15, 46, 46, 16],
          // 38
          [4, 152, 122, 18, 153, 123],
          [13, 74, 46, 32, 75, 47],
          [48, 54, 24, 14, 55, 25],
          [42, 45, 15, 32, 46, 16],
          // 39
          [20, 147, 117, 4, 148, 118],
          [40, 75, 47, 7, 76, 48],
          [43, 54, 24, 22, 55, 25],
          [10, 45, 15, 67, 46, 16],
          // 40
          [19, 148, 118, 6, 149, 119],
          [18, 75, 47, 31, 76, 48],
          [34, 54, 24, 34, 55, 25],
          [20, 45, 15, 61, 46, 16]
        ];
        var qrRSBlock = function(totalCount, dataCount) {
          var _this2 = {};
          _this2.totalCount = totalCount;
          _this2.dataCount = dataCount;
          return _this2;
        };
        var _this = {};
        var getRsBlockTable = function(typeNumber, errorCorrectionLevel) {
          switch (errorCorrectionLevel) {
            case QRErrorCorrectionLevel.L:
              return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
            case QRErrorCorrectionLevel.M:
              return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
            case QRErrorCorrectionLevel.Q:
              return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
            case QRErrorCorrectionLevel.H:
              return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
            default:
              return void 0;
          }
        };
        _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) {
          var rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel);
          if (typeof rsBlock == "undefined") {
            throw "bad rs block @ typeNumber:" + typeNumber + "/errorCorrectionLevel:" + errorCorrectionLevel;
          }
          var length = rsBlock.length / 3;
          var list = [];
          for (var i5 = 0; i5 < length; i5 += 1) {
            var count = rsBlock[i5 * 3 + 0];
            var totalCount = rsBlock[i5 * 3 + 1];
            var dataCount = rsBlock[i5 * 3 + 2];
            for (var j4 = 0; j4 < count; j4 += 1) {
              list.push(qrRSBlock(totalCount, dataCount));
            }
          }
          return list;
        };
        return _this;
      }();
      var qrBitBuffer = function() {
        var _buffer = [];
        var _length = 0;
        var _this = {};
        _this.getBuffer = function() {
          return _buffer;
        };
        _this.getAt = function(index2) {
          var bufIndex = Math.floor(index2 / 8);
          return (_buffer[bufIndex] >>> 7 - index2 % 8 & 1) == 1;
        };
        _this.put = function(num, length) {
          for (var i5 = 0; i5 < length; i5 += 1) {
            _this.putBit((num >>> length - i5 - 1 & 1) == 1);
          }
        };
        _this.getLengthInBits = function() {
          return _length;
        };
        _this.putBit = function(bit) {
          var bufIndex = Math.floor(_length / 8);
          if (_buffer.length <= bufIndex) {
            _buffer.push(0);
          }
          if (bit) {
            _buffer[bufIndex] |= 128 >>> _length % 8;
          }
          _length += 1;
        };
        return _this;
      };
      var qrNumber = function(data) {
        var _mode = QRMode.MODE_NUMBER;
        var _data = data;
        var _this = {};
        _this.getMode = function() {
          return _mode;
        };
        _this.getLength = function(buffer) {
          return _data.length;
        };
        _this.write = function(buffer) {
          var data2 = _data;
          var i5 = 0;
          while (i5 + 2 < data2.length) {
            buffer.put(strToNum(data2.substring(i5, i5 + 3)), 10);
            i5 += 3;
          }
          if (i5 < data2.length) {
            if (data2.length - i5 == 1) {
              buffer.put(strToNum(data2.substring(i5, i5 + 1)), 4);
            } else if (data2.length - i5 == 2) {
              buffer.put(strToNum(data2.substring(i5, i5 + 2)), 7);
            }
          }
        };
        var strToNum = function(s6) {
          var num = 0;
          for (var i5 = 0; i5 < s6.length; i5 += 1) {
            num = num * 10 + chatToNum(s6.charAt(i5));
          }
          return num;
        };
        var chatToNum = function(c5) {
          if ("0" <= c5 && c5 <= "9") {
            return c5.charCodeAt(0) - "0".charCodeAt(0);
          }
          throw "illegal char :" + c5;
        };
        return _this;
      };
      var qrAlphaNum = function(data) {
        var _mode = QRMode.MODE_ALPHA_NUM;
        var _data = data;
        var _this = {};
        _this.getMode = function() {
          return _mode;
        };
        _this.getLength = function(buffer) {
          return _data.length;
        };
        _this.write = function(buffer) {
          var s6 = _data;
          var i5 = 0;
          while (i5 + 1 < s6.length) {
            buffer.put(
              getCode(s6.charAt(i5)) * 45 + getCode(s6.charAt(i5 + 1)),
              11
            );
            i5 += 2;
          }
          if (i5 < s6.length) {
            buffer.put(getCode(s6.charAt(i5)), 6);
          }
        };
        var getCode = function(c5) {
          if ("0" <= c5 && c5 <= "9") {
            return c5.charCodeAt(0) - "0".charCodeAt(0);
          } else if ("A" <= c5 && c5 <= "Z") {
            return c5.charCodeAt(0) - "A".charCodeAt(0) + 10;
          } else {
            switch (c5) {
              case " ":
                return 36;
              case "$":
                return 37;
              case "%":
                return 38;
              case "*":
                return 39;
              case "+":
                return 40;
              case "-":
                return 41;
              case ".":
                return 42;
              case "/":
                return 43;
              case ":":
                return 44;
              default:
                throw "illegal char :" + c5;
            }
          }
        };
        return _this;
      };
      var qr8BitByte = function(data) {
        var _mode = QRMode.MODE_8BIT_BYTE;
        var _data = data;
        var _bytes = qrcode3.stringToBytes(data);
        var _this = {};
        _this.getMode = function() {
          return _mode;
        };
        _this.getLength = function(buffer) {
          return _bytes.length;
        };
        _this.write = function(buffer) {
          for (var i5 = 0; i5 < _bytes.length; i5 += 1) {
            buffer.put(_bytes[i5], 8);
          }
        };
        return _this;
      };
      var qrKanji = function(data) {
        var _mode = QRMode.MODE_KANJI;
        var _data = data;
        var stringToBytes2 = qrcode3.stringToBytesFuncs["SJIS"];
        if (!stringToBytes2) {
          throw "sjis not supported.";
        }
        !function(c5, code) {
          var test = stringToBytes2(c5);
          if (test.length != 2 || (test[0] << 8 | test[1]) != code) {
            throw "sjis not supported.";
          }
        }("\u53CB", 38726);
        var _bytes = stringToBytes2(data);
        var _this = {};
        _this.getMode = function() {
          return _mode;
        };
        _this.getLength = function(buffer) {
          return ~~(_bytes.length / 2);
        };
        _this.write = function(buffer) {
          var data2 = _bytes;
          var i5 = 0;
          while (i5 + 1 < data2.length) {
            var c5 = (255 & data2[i5]) << 8 | 255 & data2[i5 + 1];
            if (33088 <= c5 && c5 <= 40956) {
              c5 -= 33088;
            } else if (57408 <= c5 && c5 <= 60351) {
              c5 -= 49472;
            } else {
              throw "illegal char at " + (i5 + 1) + "/" + c5;
            }
            c5 = (c5 >>> 8 & 255) * 192 + (c5 & 255);
            buffer.put(c5, 13);
            i5 += 2;
          }
          if (i5 < data2.length) {
            throw "illegal char at " + (i5 + 1);
          }
        };
        return _this;
      };
      var byteArrayOutputStream = function() {
        var _bytes = [];
        var _this = {};
        _this.writeByte = function(b5) {
          _bytes.push(b5 & 255);
        };
        _this.writeShort = function(i5) {
          _this.writeByte(i5);
          _this.writeByte(i5 >>> 8);
        };
        _this.writeBytes = function(b5, off, len) {
          off = off || 0;
          len = len || b5.length;
          for (var i5 = 0; i5 < len; i5 += 1) {
            _this.writeByte(b5[i5 + off]);
          }
        };
        _this.writeString = function(s6) {
          for (var i5 = 0; i5 < s6.length; i5 += 1) {
            _this.writeByte(s6.charCodeAt(i5));
          }
        };
        _this.toByteArray = function() {
          return _bytes;
        };
        _this.toString = function() {
          var s6 = "";
          s6 += "[";
          for (var i5 = 0; i5 < _bytes.length; i5 += 1) {
            if (i5 > 0) {
              s6 += ",";
            }
            s6 += _bytes[i5];
          }
          s6 += "]";
          return s6;
        };
        return _this;
      };
      var base64EncodeOutputStream = function() {
        var _buffer = 0;
        var _buflen = 0;
        var _length = 0;
        var _base64 = "";
        var _this = {};
        var writeEncoded = function(b5) {
          _base64 += String.fromCharCode(encode2(b5 & 63));
        };
        var encode2 = function(n2) {
          if (n2 < 0) {
          } else if (n2 < 26) {
            return 65 + n2;
          } else if (n2 < 52) {
            return 97 + (n2 - 26);
          } else if (n2 < 62) {
            return 48 + (n2 - 52);
          } else if (n2 == 62) {
            return 43;
          } else if (n2 == 63) {
            return 47;
          }
          throw "n:" + n2;
        };
        _this.writeByte = function(n2) {
          _buffer = _buffer << 8 | n2 & 255;
          _buflen += 8;
          _length += 1;
          while (_buflen >= 6) {
            writeEncoded(_buffer >>> _buflen - 6);
            _buflen -= 6;
          }
        };
        _this.flush = function() {
          if (_buflen > 0) {
            writeEncoded(_buffer << 6 - _buflen);
            _buffer = 0;
            _buflen = 0;
          }
          if (_length % 3 != 0) {
            var padlen = 3 - _length % 3;
            for (var i5 = 0; i5 < padlen; i5 += 1) {
              _base64 += "=";
            }
          }
        };
        _this.toString = function() {
          return _base64;
        };
        return _this;
      };
      var base64DecodeInputStream = function(str) {
        var _str = str;
        var _pos = 0;
        var _buffer = 0;
        var _buflen = 0;
        var _this = {};
        _this.read = function() {
          while (_buflen < 8) {
            if (_pos >= _str.length) {
              if (_buflen == 0) {
                return -1;
              }
              throw "unexpected end of file./" + _buflen;
            }
            var c5 = _str.charAt(_pos);
            _pos += 1;
            if (c5 == "=") {
              _buflen = 0;
              return -1;
            } else if (c5.match(/^\s$/)) {
              continue;
            }
            _buffer = _buffer << 6 | decode2(c5.charCodeAt(0));
            _buflen += 6;
          }
          var n2 = _buffer >>> _buflen - 8 & 255;
          _buflen -= 8;
          return n2;
        };
        var decode2 = function(c5) {
          if (65 <= c5 && c5 <= 90) {
            return c5 - 65;
          } else if (97 <= c5 && c5 <= 122) {
            return c5 - 97 + 26;
          } else if (48 <= c5 && c5 <= 57) {
            return c5 - 48 + 52;
          } else if (c5 == 43) {
            return 62;
          } else if (c5 == 47) {
            return 63;
          } else {
            throw "c:" + c5;
          }
        };
        return _this;
      };
      var gifImage = function(width, height) {
        var _width = width;
        var _height = height;
        var _data = new Array(width * height);
        var _this = {};
        _this.setPixel = function(x6, y6, pixel) {
          _data[y6 * _width + x6] = pixel;
        };
        _this.write = function(out) {
          out.writeString("GIF87a");
          out.writeShort(_width);
          out.writeShort(_height);
          out.writeByte(128);
          out.writeByte(0);
          out.writeByte(0);
          out.writeByte(0);
          out.writeByte(0);
          out.writeByte(0);
          out.writeByte(255);
          out.writeByte(255);
          out.writeByte(255);
          out.writeString(",");
          out.writeShort(0);
          out.writeShort(0);
          out.writeShort(_width);
          out.writeShort(_height);
          out.writeByte(0);
          var lzwMinCodeSize = 2;
          var raster = getLZWRaster(lzwMinCodeSize);
          out.writeByte(lzwMinCodeSize);
          var offset = 0;
          while (raster.length - offset > 255) {
            out.writeByte(255);
            out.writeBytes(raster, offset, 255);
            offset += 255;
          }
          out.writeByte(raster.length - offset);
          out.writeBytes(raster, offset, raster.length - offset);
          out.writeByte(0);
          out.writeString(";");
        };
        var bitOutputStream = function(out) {
          var _out = out;
          var _bitLength = 0;
          var _bitBuffer = 0;
          var _this2 = {};
          _this2.write = function(data, length) {
            if (data >>> length != 0) {
              throw "length over";
            }
            while (_bitLength + length >= 8) {
              _out.writeByte(255 & (data << _bitLength | _bitBuffer));
              length -= 8 - _bitLength;
              data >>>= 8 - _bitLength;
              _bitBuffer = 0;
              _bitLength = 0;
            }
            _bitBuffer = data << _bitLength | _bitBuffer;
            _bitLength = _bitLength + length;
          };
          _this2.flush = function() {
            if (_bitLength > 0) {
              _out.writeByte(_bitBuffer);
            }
          };
          return _this2;
        };
        var getLZWRaster = function(lzwMinCodeSize) {
          var clearCode = 1 << lzwMinCodeSize;
          var endCode = (1 << lzwMinCodeSize) + 1;
          var bitLength = lzwMinCodeSize + 1;
          var table2 = lzwTable();
          for (var i5 = 0; i5 < clearCode; i5 += 1) {
            table2.add(String.fromCharCode(i5));
          }
          table2.add(String.fromCharCode(clearCode));
          table2.add(String.fromCharCode(endCode));
          var byteOut = byteArrayOutputStream();
          var bitOut = bitOutputStream(byteOut);
          bitOut.write(clearCode, bitLength);
          var dataIndex = 0;
          var s6 = String.fromCharCode(_data[dataIndex]);
          dataIndex += 1;
          while (dataIndex < _data.length) {
            var c5 = String.fromCharCode(_data[dataIndex]);
            dataIndex += 1;
            if (table2.contains(s6 + c5)) {
              s6 = s6 + c5;
            } else {
              bitOut.write(table2.indexOf(s6), bitLength);
              if (table2.size() < 4095) {
                if (table2.size() == 1 << bitLength) {
                  bitLength += 1;
                }
                table2.add(s6 + c5);
              }
              s6 = c5;
            }
          }
          bitOut.write(table2.indexOf(s6), bitLength);
          bitOut.write(endCode, bitLength);
          bitOut.flush();
          return byteOut.toByteArray();
        };
        var lzwTable = function() {
          var _map = {};
          var _size = 0;
          var _this2 = {};
          _this2.add = function(key) {
            if (_this2.contains(key)) {
              throw "dup key:" + key;
            }
            _map[key] = _size;
            _size += 1;
          };
          _this2.size = function() {
            return _size;
          };
          _this2.indexOf = function(key) {
            return _map[key];
          };
          _this2.contains = function(key) {
            return typeof _map[key] != "undefined";
          };
          return _this2;
        };
        return _this;
      };
      var createDataURL = function(width, height, getPixel) {
        var gif = gifImage(width, height);
        for (var y6 = 0; y6 < height; y6 += 1) {
          for (var x6 = 0; x6 < width; x6 += 1) {
            gif.setPixel(x6, y6, getPixel(x6, y6));
          }
        }
        var b5 = byteArrayOutputStream();
        gif.write(b5);
        var base64 = base64EncodeOutputStream();
        var bytes = b5.toByteArray();
        for (var i5 = 0; i5 < bytes.length; i5 += 1) {
          base64.writeByte(bytes[i5]);
        }
        base64.flush();
        return "data:image/gif;base64," + base64;
      };
      return qrcode3;
    }();
    !function() {
      qrcode2.stringToBytesFuncs["UTF-8"] = function(s6) {
        function toUTF8Array(str) {
          var utf8 = [];
          for (var i5 = 0; i5 < str.length; i5++) {
            var charcode = str.charCodeAt(i5);
            if (charcode < 128)
              utf8.push(charcode);
            else if (charcode < 2048) {
              utf8.push(
                192 | charcode >> 6,
                128 | charcode & 63
              );
            } else if (charcode < 55296 || charcode >= 57344) {
              utf8.push(
                224 | charcode >> 12,
                128 | charcode >> 6 & 63,
                128 | charcode & 63
              );
            } else {
              i5++;
              charcode = 65536 + ((charcode & 1023) << 10 | str.charCodeAt(i5) & 1023);
              utf8.push(
                240 | charcode >> 18,
                128 | charcode >> 12 & 63,
                128 | charcode >> 6 & 63,
                128 | charcode & 63
              );
            }
          }
          return utf8;
        }
        return toUTF8Array(s6);
      };
    }();
    (function(factory) {
      if (typeof define === "function" && define.amd) {
        define([], factory);
      } else if (typeof exports === "object") {
        module.exports = factory();
      }
    })(function() {
      return qrcode2;
    });
  }
});

// ../taler-util/lib/nacl-fast.js
var gf = function(init = []) {
  const r3 = new Float64Array(16);
  if (init)
    for (let i5 = 0; i5 < init.length; i5++)
      r3[i5] = init[i5];
  return r3;
};
var randombytes = function(x6, n2) {
  throw new Error("no PRNG");
};
var _9 = new Uint8Array(32);
_9[0] = 9;
var gf0 = gf();
var gf1 = gf([1]);
var _121665 = gf([56129, 1]);
var D = gf([
  30883,
  4953,
  19914,
  30187,
  55467,
  16705,
  2637,
  112,
  59544,
  30585,
  16505,
  36039,
  65139,
  11119,
  27886,
  20995
]);
var D2 = gf([
  61785,
  9906,
  39828,
  60374,
  45398,
  33411,
  5274,
  224,
  53552,
  61171,
  33010,
  6542,
  64743,
  22239,
  55772,
  9222
]);
var X = gf([
  54554,
  36645,
  11616,
  51542,
  42930,
  38181,
  51040,
  26924,
  56412,
  64982,
  57905,
  49316,
  21502,
  52590,
  14035,
  8553
]);
var Y = gf([
  26200,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214,
  26214
]);
var I = gf([
  41136,
  18958,
  6951,
  50414,
  58488,
  44335,
  6150,
  12099,
  55207,
  15867,
  153,
  11085,
  57099,
  20417,
  9344,
  11139
]);
function ts64(x6, i5, h5, l3) {
  x6[i5] = h5 >> 24 & 255;
  x6[i5 + 1] = h5 >> 16 & 255;
  x6[i5 + 2] = h5 >> 8 & 255;
  x6[i5 + 3] = h5 & 255;
  x6[i5 + 4] = l3 >> 24 & 255;
  x6[i5 + 5] = l3 >> 16 & 255;
  x6[i5 + 6] = l3 >> 8 & 255;
  x6[i5 + 7] = l3 & 255;
}
function vn(x6, xi, y6, yi, n2) {
  let i5, d6 = 0;
  for (i5 = 0; i5 < n2; i5++)
    d6 |= x6[xi + i5] ^ y6[yi + i5];
  return (1 & d6 - 1 >>> 8) - 1;
}
function crypto_verify_32(x6, xi, y6, yi) {
  return vn(x6, xi, y6, yi, 32);
}
var sigma = new Uint8Array([
  101,
  120,
  112,
  97,
  110,
  100,
  32,
  51,
  50,
  45,
  98,
  121,
  116,
  101,
  32,
  107
]);
function set25519(r3, a6) {
  let i5;
  for (i5 = 0; i5 < 16; i5++)
    r3[i5] = a6[i5] | 0;
}
function car25519(o3) {
  let i5, v3, c5 = 1;
  for (i5 = 0; i5 < 16; i5++) {
    v3 = o3[i5] + c5 + 65535;
    c5 = Math.floor(v3 / 65536);
    o3[i5] = v3 - c5 * 65536;
  }
  o3[0] += c5 - 1 + 37 * (c5 - 1);
}
function sel25519(p4, q6, b5) {
  let t5;
  const c5 = ~(b5 - 1);
  for (let i5 = 0; i5 < 16; i5++) {
    t5 = c5 & (p4[i5] ^ q6[i5]);
    p4[i5] ^= t5;
    q6[i5] ^= t5;
  }
}
function pack25519(o3, n2) {
  let i5, j4, b5;
  const m6 = gf(), t5 = gf();
  for (i5 = 0; i5 < 16; i5++)
    t5[i5] = n2[i5];
  car25519(t5);
  car25519(t5);
  car25519(t5);
  for (j4 = 0; j4 < 2; j4++) {
    m6[0] = t5[0] - 65517;
    for (i5 = 1; i5 < 15; i5++) {
      m6[i5] = t5[i5] - 65535 - (m6[i5 - 1] >> 16 & 1);
      m6[i5 - 1] &= 65535;
    }
    m6[15] = t5[15] - 32767 - (m6[14] >> 16 & 1);
    b5 = m6[15] >> 16 & 1;
    m6[14] &= 65535;
    sel25519(t5, m6, 1 - b5);
  }
  for (i5 = 0; i5 < 16; i5++) {
    o3[2 * i5] = t5[i5] & 255;
    o3[2 * i5 + 1] = t5[i5] >> 8;
  }
}
function neq25519(a6, b5) {
  const c5 = new Uint8Array(32), d6 = new Uint8Array(32);
  pack25519(c5, a6);
  pack25519(d6, b5);
  return crypto_verify_32(c5, 0, d6, 0);
}
function par25519(a6) {
  const d6 = new Uint8Array(32);
  pack25519(d6, a6);
  return d6[0] & 1;
}
function unpack25519(o3, n2) {
  let i5;
  for (i5 = 0; i5 < 16; i5++)
    o3[i5] = n2[2 * i5] + (n2[2 * i5 + 1] << 8);
  o3[15] &= 32767;
}
function A(o3, a6, b5) {
  for (let i5 = 0; i5 < 16; i5++)
    o3[i5] = a6[i5] + b5[i5];
}
function Z(o3, a6, b5) {
  for (let i5 = 0; i5 < 16; i5++)
    o3[i5] = a6[i5] - b5[i5];
}
function M(o3, a6, b5) {
  let v3, c5, t0 = 0, t1 = 0, t22 = 0, t32 = 0, t42 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t222 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0;
  const b0 = b5[0], b1 = b5[1], b22 = b5[2], b32 = b5[3], b42 = b5[4], b52 = b5[5], b6 = b5[6], b7 = b5[7], b8 = b5[8], b9 = b5[9], b10 = b5[10], b11 = b5[11], b12 = b5[12], b13 = b5[13], b14 = b5[14], b15 = b5[15];
  v3 = a6[0];
  t0 += v3 * b0;
  t1 += v3 * b1;
  t22 += v3 * b22;
  t32 += v3 * b32;
  t42 += v3 * b42;
  t5 += v3 * b52;
  t6 += v3 * b6;
  t7 += v3 * b7;
  t8 += v3 * b8;
  t9 += v3 * b9;
  t10 += v3 * b10;
  t11 += v3 * b11;
  t12 += v3 * b12;
  t13 += v3 * b13;
  t14 += v3 * b14;
  t15 += v3 * b15;
  v3 = a6[1];
  t1 += v3 * b0;
  t22 += v3 * b1;
  t32 += v3 * b22;
  t42 += v3 * b32;
  t5 += v3 * b42;
  t6 += v3 * b52;
  t7 += v3 * b6;
  t8 += v3 * b7;
  t9 += v3 * b8;
  t10 += v3 * b9;
  t11 += v3 * b10;
  t12 += v3 * b11;
  t13 += v3 * b12;
  t14 += v3 * b13;
  t15 += v3 * b14;
  t16 += v3 * b15;
  v3 = a6[2];
  t22 += v3 * b0;
  t32 += v3 * b1;
  t42 += v3 * b22;
  t5 += v3 * b32;
  t6 += v3 * b42;
  t7 += v3 * b52;
  t8 += v3 * b6;
  t9 += v3 * b7;
  t10 += v3 * b8;
  t11 += v3 * b9;
  t12 += v3 * b10;
  t13 += v3 * b11;
  t14 += v3 * b12;
  t15 += v3 * b13;
  t16 += v3 * b14;
  t17 += v3 * b15;
  v3 = a6[3];
  t32 += v3 * b0;
  t42 += v3 * b1;
  t5 += v3 * b22;
  t6 += v3 * b32;
  t7 += v3 * b42;
  t8 += v3 * b52;
  t9 += v3 * b6;
  t10 += v3 * b7;
  t11 += v3 * b8;
  t12 += v3 * b9;
  t13 += v3 * b10;
  t14 += v3 * b11;
  t15 += v3 * b12;
  t16 += v3 * b13;
  t17 += v3 * b14;
  t18 += v3 * b15;
  v3 = a6[4];
  t42 += v3 * b0;
  t5 += v3 * b1;
  t6 += v3 * b22;
  t7 += v3 * b32;
  t8 += v3 * b42;
  t9 += v3 * b52;
  t10 += v3 * b6;
  t11 += v3 * b7;
  t12 += v3 * b8;
  t13 += v3 * b9;
  t14 += v3 * b10;
  t15 += v3 * b11;
  t16 += v3 * b12;
  t17 += v3 * b13;
  t18 += v3 * b14;
  t19 += v3 * b15;
  v3 = a6[5];
  t5 += v3 * b0;
  t6 += v3 * b1;
  t7 += v3 * b22;
  t8 += v3 * b32;
  t9 += v3 * b42;
  t10 += v3 * b52;
  t11 += v3 * b6;
  t12 += v3 * b7;
  t13 += v3 * b8;
  t14 += v3 * b9;
  t15 += v3 * b10;
  t16 += v3 * b11;
  t17 += v3 * b12;
  t18 += v3 * b13;
  t19 += v3 * b14;
  t20 += v3 * b15;
  v3 = a6[6];
  t6 += v3 * b0;
  t7 += v3 * b1;
  t8 += v3 * b22;
  t9 += v3 * b32;
  t10 += v3 * b42;
  t11 += v3 * b52;
  t12 += v3 * b6;
  t13 += v3 * b7;
  t14 += v3 * b8;
  t15 += v3 * b9;
  t16 += v3 * b10;
  t17 += v3 * b11;
  t18 += v3 * b12;
  t19 += v3 * b13;
  t20 += v3 * b14;
  t21 += v3 * b15;
  v3 = a6[7];
  t7 += v3 * b0;
  t8 += v3 * b1;
  t9 += v3 * b22;
  t10 += v3 * b32;
  t11 += v3 * b42;
  t12 += v3 * b52;
  t13 += v3 * b6;
  t14 += v3 * b7;
  t15 += v3 * b8;
  t16 += v3 * b9;
  t17 += v3 * b10;
  t18 += v3 * b11;
  t19 += v3 * b12;
  t20 += v3 * b13;
  t21 += v3 * b14;
  t222 += v3 * b15;
  v3 = a6[8];
  t8 += v3 * b0;
  t9 += v3 * b1;
  t10 += v3 * b22;
  t11 += v3 * b32;
  t12 += v3 * b42;
  t13 += v3 * b52;
  t14 += v3 * b6;
  t15 += v3 * b7;
  t16 += v3 * b8;
  t17 += v3 * b9;
  t18 += v3 * b10;
  t19 += v3 * b11;
  t20 += v3 * b12;
  t21 += v3 * b13;
  t222 += v3 * b14;
  t23 += v3 * b15;
  v3 = a6[9];
  t9 += v3 * b0;
  t10 += v3 * b1;
  t11 += v3 * b22;
  t12 += v3 * b32;
  t13 += v3 * b42;
  t14 += v3 * b52;
  t15 += v3 * b6;
  t16 += v3 * b7;
  t17 += v3 * b8;
  t18 += v3 * b9;
  t19 += v3 * b10;
  t20 += v3 * b11;
  t21 += v3 * b12;
  t222 += v3 * b13;
  t23 += v3 * b14;
  t24 += v3 * b15;
  v3 = a6[10];
  t10 += v3 * b0;
  t11 += v3 * b1;
  t12 += v3 * b22;
  t13 += v3 * b32;
  t14 += v3 * b42;
  t15 += v3 * b52;
  t16 += v3 * b6;
  t17 += v3 * b7;
  t18 += v3 * b8;
  t19 += v3 * b9;
  t20 += v3 * b10;
  t21 += v3 * b11;
  t222 += v3 * b12;
  t23 += v3 * b13;
  t24 += v3 * b14;
  t25 += v3 * b15;
  v3 = a6[11];
  t11 += v3 * b0;
  t12 += v3 * b1;
  t13 += v3 * b22;
  t14 += v3 * b32;
  t15 += v3 * b42;
  t16 += v3 * b52;
  t17 += v3 * b6;
  t18 += v3 * b7;
  t19 += v3 * b8;
  t20 += v3 * b9;
  t21 += v3 * b10;
  t222 += v3 * b11;
  t23 += v3 * b12;
  t24 += v3 * b13;
  t25 += v3 * b14;
  t26 += v3 * b15;
  v3 = a6[12];
  t12 += v3 * b0;
  t13 += v3 * b1;
  t14 += v3 * b22;
  t15 += v3 * b32;
  t16 += v3 * b42;
  t17 += v3 * b52;
  t18 += v3 * b6;
  t19 += v3 * b7;
  t20 += v3 * b8;
  t21 += v3 * b9;
  t222 += v3 * b10;
  t23 += v3 * b11;
  t24 += v3 * b12;
  t25 += v3 * b13;
  t26 += v3 * b14;
  t27 += v3 * b15;
  v3 = a6[13];
  t13 += v3 * b0;
  t14 += v3 * b1;
  t15 += v3 * b22;
  t16 += v3 * b32;
  t17 += v3 * b42;
  t18 += v3 * b52;
  t19 += v3 * b6;
  t20 += v3 * b7;
  t21 += v3 * b8;
  t222 += v3 * b9;
  t23 += v3 * b10;
  t24 += v3 * b11;
  t25 += v3 * b12;
  t26 += v3 * b13;
  t27 += v3 * b14;
  t28 += v3 * b15;
  v3 = a6[14];
  t14 += v3 * b0;
  t15 += v3 * b1;
  t16 += v3 * b22;
  t17 += v3 * b32;
  t18 += v3 * b42;
  t19 += v3 * b52;
  t20 += v3 * b6;
  t21 += v3 * b7;
  t222 += v3 * b8;
  t23 += v3 * b9;
  t24 += v3 * b10;
  t25 += v3 * b11;
  t26 += v3 * b12;
  t27 += v3 * b13;
  t28 += v3 * b14;
  t29 += v3 * b15;
  v3 = a6[15];
  t15 += v3 * b0;
  t16 += v3 * b1;
  t17 += v3 * b22;
  t18 += v3 * b32;
  t19 += v3 * b42;
  t20 += v3 * b52;
  t21 += v3 * b6;
  t222 += v3 * b7;
  t23 += v3 * b8;
  t24 += v3 * b9;
  t25 += v3 * b10;
  t26 += v3 * b11;
  t27 += v3 * b12;
  t28 += v3 * b13;
  t29 += v3 * b14;
  t30 += v3 * b15;
  t0 += 38 * t16;
  t1 += 38 * t17;
  t22 += 38 * t18;
  t32 += 38 * t19;
  t42 += 38 * t20;
  t5 += 38 * t21;
  t6 += 38 * t222;
  t7 += 38 * t23;
  t8 += 38 * t24;
  t9 += 38 * t25;
  t10 += 38 * t26;
  t11 += 38 * t27;
  t12 += 38 * t28;
  t13 += 38 * t29;
  t14 += 38 * t30;
  c5 = 1;
  v3 = t0 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t0 = v3 - c5 * 65536;
  v3 = t1 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t1 = v3 - c5 * 65536;
  v3 = t22 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t22 = v3 - c5 * 65536;
  v3 = t32 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t32 = v3 - c5 * 65536;
  v3 = t42 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t42 = v3 - c5 * 65536;
  v3 = t5 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t5 = v3 - c5 * 65536;
  v3 = t6 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t6 = v3 - c5 * 65536;
  v3 = t7 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t7 = v3 - c5 * 65536;
  v3 = t8 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t8 = v3 - c5 * 65536;
  v3 = t9 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t9 = v3 - c5 * 65536;
  v3 = t10 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t10 = v3 - c5 * 65536;
  v3 = t11 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t11 = v3 - c5 * 65536;
  v3 = t12 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t12 = v3 - c5 * 65536;
  v3 = t13 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t13 = v3 - c5 * 65536;
  v3 = t14 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t14 = v3 - c5 * 65536;
  v3 = t15 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t15 = v3 - c5 * 65536;
  t0 += c5 - 1 + 37 * (c5 - 1);
  c5 = 1;
  v3 = t0 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t0 = v3 - c5 * 65536;
  v3 = t1 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t1 = v3 - c5 * 65536;
  v3 = t22 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t22 = v3 - c5 * 65536;
  v3 = t32 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t32 = v3 - c5 * 65536;
  v3 = t42 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t42 = v3 - c5 * 65536;
  v3 = t5 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t5 = v3 - c5 * 65536;
  v3 = t6 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t6 = v3 - c5 * 65536;
  v3 = t7 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t7 = v3 - c5 * 65536;
  v3 = t8 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t8 = v3 - c5 * 65536;
  v3 = t9 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t9 = v3 - c5 * 65536;
  v3 = t10 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t10 = v3 - c5 * 65536;
  v3 = t11 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t11 = v3 - c5 * 65536;
  v3 = t12 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t12 = v3 - c5 * 65536;
  v3 = t13 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t13 = v3 - c5 * 65536;
  v3 = t14 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t14 = v3 - c5 * 65536;
  v3 = t15 + c5 + 65535;
  c5 = Math.floor(v3 / 65536);
  t15 = v3 - c5 * 65536;
  t0 += c5 - 1 + 37 * (c5 - 1);
  o3[0] = t0;
  o3[1] = t1;
  o3[2] = t22;
  o3[3] = t32;
  o3[4] = t42;
  o3[5] = t5;
  o3[6] = t6;
  o3[7] = t7;
  o3[8] = t8;
  o3[9] = t9;
  o3[10] = t10;
  o3[11] = t11;
  o3[12] = t12;
  o3[13] = t13;
  o3[14] = t14;
  o3[15] = t15;
}
function S(o3, a6) {
  M(o3, a6, a6);
}
function inv25519(o3, i5) {
  const c5 = gf();
  let a6;
  for (a6 = 0; a6 < 16; a6++)
    c5[a6] = i5[a6];
  for (a6 = 253; a6 >= 0; a6--) {
    S(c5, c5);
    if (a6 !== 2 && a6 !== 4)
      M(c5, c5, i5);
  }
  for (a6 = 0; a6 < 16; a6++)
    o3[a6] = c5[a6];
}
function pow2523(o3, i5) {
  const c5 = gf();
  let a6;
  for (a6 = 0; a6 < 16; a6++)
    c5[a6] = i5[a6];
  for (a6 = 250; a6 >= 0; a6--) {
    S(c5, c5);
    if (a6 !== 1)
      M(c5, c5, i5);
  }
  for (a6 = 0; a6 < 16; a6++)
    o3[a6] = c5[a6];
}
var K = [
  1116352408,
  3609767458,
  1899447441,
  602891725,
  3049323471,
  3964484399,
  3921009573,
  2173295548,
  961987163,
  4081628472,
  1508970993,
  3053834265,
  2453635748,
  2937671579,
  2870763221,
  3664609560,
  3624381080,
  2734883394,
  310598401,
  1164996542,
  607225278,
  1323610764,
  1426881987,
  3590304994,
  1925078388,
  4068182383,
  2162078206,
  991336113,
  2614888103,
  633803317,
  3248222580,
  3479774868,
  3835390401,
  2666613458,
  4022224774,
  944711139,
  264347078,
  2341262773,
  604807628,
  2007800933,
  770255983,
  1495990901,
  1249150122,
  1856431235,
  1555081692,
  3175218132,
  1996064986,
  2198950837,
  2554220882,
  3999719339,
  2821834349,
  766784016,
  2952996808,
  2566594879,
  3210313671,
  3203337956,
  3336571891,
  1034457026,
  3584528711,
  2466948901,
  113926993,
  3758326383,
  338241895,
  168717936,
  666307205,
  1188179964,
  773529912,
  1546045734,
  1294757372,
  1522805485,
  1396182291,
  2643833823,
  1695183700,
  2343527390,
  1986661051,
  1014477480,
  2177026350,
  1206759142,
  2456956037,
  344077627,
  2730485921,
  1290863460,
  2820302411,
  3158454273,
  3259730800,
  3505952657,
  3345764771,
  106217008,
  3516065817,
  3606008344,
  3600352804,
  1432725776,
  4094571909,
  1467031594,
  275423344,
  851169720,
  430227734,
  3100823752,
  506948616,
  1363258195,
  659060556,
  3750685593,
  883997877,
  3785050280,
  958139571,
  3318307427,
  1322822218,
  3812723403,
  1537002063,
  2003034995,
  1747873779,
  3602036899,
  1955562222,
  1575990012,
  2024104815,
  1125592928,
  2227730452,
  2716904306,
  2361852424,
  442776044,
  2428436474,
  593698344,
  2756734187,
  3733110249,
  3204031479,
  2999351573,
  3329325298,
  3815920427,
  3391569614,
  3928383900,
  3515267271,
  566280711,
  3940187606,
  3454069534,
  4118630271,
  4000239992,
  116418474,
  1914138554,
  174292421,
  2731055270,
  289380356,
  3203993006,
  460393269,
  320620315,
  685471733,
  587496836,
  852142971,
  1086792851,
  1017036298,
  365543100,
  1126000580,
  2618297676,
  1288033470,
  3409855158,
  1501505948,
  4234509866,
  1607167915,
  987167468,
  1816402316,
  1246189591
];
function crypto_hashblocks_hl(hh, hl, m6, n2) {
  const wh = new Int32Array(16), wl = new Int32Array(16);
  let bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i5, j4, h5, l3, a6, b5, c5, d6;
  let ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7];
  let pos = 0;
  while (n2 >= 128) {
    for (i5 = 0; i5 < 16; i5++) {
      j4 = 8 * i5 + pos;
      wh[i5] = m6[j4 + 0] << 24 | m6[j4 + 1] << 16 | m6[j4 + 2] << 8 | m6[j4 + 3];
      wl[i5] = m6[j4 + 4] << 24 | m6[j4 + 5] << 16 | m6[j4 + 6] << 8 | m6[j4 + 7];
    }
    for (i5 = 0; i5 < 80; i5++) {
      bh0 = ah0;
      bh1 = ah1;
      bh2 = ah2;
      bh3 = ah3;
      bh4 = ah4;
      bh5 = ah5;
      bh6 = ah6;
      bh7 = ah7;
      bl0 = al0;
      bl1 = al1;
      bl2 = al2;
      bl3 = al3;
      bl4 = al4;
      bl5 = al5;
      bl6 = al6;
      bl7 = al7;
      h5 = ah7;
      l3 = al7;
      a6 = l3 & 65535;
      b5 = l3 >>> 16;
      c5 = h5 & 65535;
      d6 = h5 >>> 16;
      h5 = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32));
      l3 = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32));
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      h5 = ah4 & ah5 ^ ~ah4 & ah6;
      l3 = al4 & al5 ^ ~al4 & al6;
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      h5 = K[i5 * 2];
      l3 = K[i5 * 2 + 1];
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      h5 = wh[i5 % 16];
      l3 = wl[i5 % 16];
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      b5 += a6 >>> 16;
      c5 += b5 >>> 16;
      d6 += c5 >>> 16;
      th = c5 & 65535 | d6 << 16;
      tl = a6 & 65535 | b5 << 16;
      h5 = th;
      l3 = tl;
      a6 = l3 & 65535;
      b5 = l3 >>> 16;
      c5 = h5 & 65535;
      d6 = h5 >>> 16;
      h5 = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32));
      l3 = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32));
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      h5 = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2;
      l3 = al0 & al1 ^ al0 & al2 ^ al1 & al2;
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      b5 += a6 >>> 16;
      c5 += b5 >>> 16;
      d6 += c5 >>> 16;
      bh7 = c5 & 65535 | d6 << 16;
      bl7 = a6 & 65535 | b5 << 16;
      h5 = bh3;
      l3 = bl3;
      a6 = l3 & 65535;
      b5 = l3 >>> 16;
      c5 = h5 & 65535;
      d6 = h5 >>> 16;
      h5 = th;
      l3 = tl;
      a6 += l3 & 65535;
      b5 += l3 >>> 16;
      c5 += h5 & 65535;
      d6 += h5 >>> 16;
      b5 += a6 >>> 16;
      c5 += b5 >>> 16;
      d6 += c5 >>> 16;
      bh3 = c5 & 65535 | d6 << 16;
      bl3 = a6 & 65535 | b5 << 16;
      ah1 = bh0;
      ah2 = bh1;
      ah3 = bh2;
      ah4 = bh3;
      ah5 = bh4;
      ah6 = bh5;
      ah7 = bh6;
      ah0 = bh7;
      al1 = bl0;
      al2 = bl1;
      al3 = bl2;
      al4 = bl3;
      al5 = bl4;
      al6 = bl5;
      al7 = bl6;
      al0 = bl7;
      if (i5 % 16 === 15) {
        for (j4 = 0; j4 < 16; j4++) {
          h5 = wh[j4];
          l3 = wl[j4];
          a6 = l3 & 65535;
          b5 = l3 >>> 16;
          c5 = h5 & 65535;
          d6 = h5 >>> 16;
          h5 = wh[(j4 + 9) % 16];
          l3 = wl[(j4 + 9) % 16];
          a6 += l3 & 65535;
          b5 += l3 >>> 16;
          c5 += h5 & 65535;
          d6 += h5 >>> 16;
          th = wh[(j4 + 1) % 16];
          tl = wl[(j4 + 1) % 16];
          h5 = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7;
          l3 = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7);
          a6 += l3 & 65535;
          b5 += l3 >>> 16;
          c5 += h5 & 65535;
          d6 += h5 >>> 16;
          th = wh[(j4 + 14) % 16];
          tl = wl[(j4 + 14) % 16];
          h5 = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6;
          l3 = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6);
          a6 += l3 & 65535;
          b5 += l3 >>> 16;
          c5 += h5 & 65535;
          d6 += h5 >>> 16;
          b5 += a6 >>> 16;
          c5 += b5 >>> 16;
          d6 += c5 >>> 16;
          wh[j4] = c5 & 65535 | d6 << 16;
          wl[j4] = a6 & 65535 | b5 << 16;
        }
      }
    }
    h5 = ah0;
    l3 = al0;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[0];
    l3 = hl[0];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[0] = ah0 = c5 & 65535 | d6 << 16;
    hl[0] = al0 = a6 & 65535 | b5 << 16;
    h5 = ah1;
    l3 = al1;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[1];
    l3 = hl[1];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[1] = ah1 = c5 & 65535 | d6 << 16;
    hl[1] = al1 = a6 & 65535 | b5 << 16;
    h5 = ah2;
    l3 = al2;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[2];
    l3 = hl[2];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[2] = ah2 = c5 & 65535 | d6 << 16;
    hl[2] = al2 = a6 & 65535 | b5 << 16;
    h5 = ah3;
    l3 = al3;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[3];
    l3 = hl[3];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[3] = ah3 = c5 & 65535 | d6 << 16;
    hl[3] = al3 = a6 & 65535 | b5 << 16;
    h5 = ah4;
    l3 = al4;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[4];
    l3 = hl[4];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[4] = ah4 = c5 & 65535 | d6 << 16;
    hl[4] = al4 = a6 & 65535 | b5 << 16;
    h5 = ah5;
    l3 = al5;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[5];
    l3 = hl[5];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[5] = ah5 = c5 & 65535 | d6 << 16;
    hl[5] = al5 = a6 & 65535 | b5 << 16;
    h5 = ah6;
    l3 = al6;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[6];
    l3 = hl[6];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[6] = ah6 = c5 & 65535 | d6 << 16;
    hl[6] = al6 = a6 & 65535 | b5 << 16;
    h5 = ah7;
    l3 = al7;
    a6 = l3 & 65535;
    b5 = l3 >>> 16;
    c5 = h5 & 65535;
    d6 = h5 >>> 16;
    h5 = hh[7];
    l3 = hl[7];
    a6 += l3 & 65535;
    b5 += l3 >>> 16;
    c5 += h5 & 65535;
    d6 += h5 >>> 16;
    b5 += a6 >>> 16;
    c5 += b5 >>> 16;
    d6 += c5 >>> 16;
    hh[7] = ah7 = c5 & 65535 | d6 << 16;
    hl[7] = al7 = a6 & 65535 | b5 << 16;
    pos += 128;
    n2 -= 128;
  }
  return n2;
}
function crypto_hash(out, m6, n2) {
  const hh = new Int32Array(8);
  const hl = new Int32Array(8);
  const x6 = new Uint8Array(256);
  const b5 = n2;
  hh[0] = 1779033703;
  hh[1] = 3144134277;
  hh[2] = 1013904242;
  hh[3] = 2773480762;
  hh[4] = 1359893119;
  hh[5] = 2600822924;
  hh[6] = 528734635;
  hh[7] = 1541459225;
  hl[0] = 4089235720;
  hl[1] = 2227873595;
  hl[2] = 4271175723;
  hl[3] = 1595750129;
  hl[4] = 2917565137;
  hl[5] = 725511199;
  hl[6] = 4215389547;
  hl[7] = 327033209;
  crypto_hashblocks_hl(hh, hl, m6, n2);
  n2 %= 128;
  for (let i5 = 0; i5 < n2; i5++)
    x6[i5] = m6[b5 - n2 + i5];
  x6[n2] = 128;
  n2 = 256 - 128 * (n2 < 112 ? 1 : 0);
  x6[n2 - 9] = 0;
  ts64(x6, n2 - 8, b5 / 536870912 | 0, b5 << 3);
  crypto_hashblocks_hl(hh, hl, x6, n2);
  for (let i5 = 0; i5 < 8; i5++)
    ts64(out, 8 * i5, hh[i5], hl[i5]);
  return 0;
}
var HashState = class {
  constructor() {
    this.hh = new Int32Array(8);
    this.hl = new Int32Array(8);
    this.next = new Uint8Array(128);
    this.p = 0;
    this.total = 0;
    this.hh[0] = 1779033703;
    this.hh[1] = 3144134277;
    this.hh[2] = 1013904242;
    this.hh[3] = 2773480762;
    this.hh[4] = 1359893119;
    this.hh[5] = 2600822924;
    this.hh[6] = 528734635;
    this.hh[7] = 1541459225;
    this.hl[0] = 4089235720;
    this.hl[1] = 2227873595;
    this.hl[2] = 4271175723;
    this.hl[3] = 1595750129;
    this.hl[4] = 2917565137;
    this.hl[5] = 725511199;
    this.hl[6] = 4215389547;
    this.hl[7] = 327033209;
  }
  update(data) {
    this.total += data.length;
    let i5 = 0;
    while (i5 < data.length) {
      const r3 = 128 - this.p;
      if (r3 > data.length - i5) {
        for (let j4 = 0; i5 + j4 < data.length; j4++) {
          this.next[this.p + j4] = data[i5 + j4];
        }
        this.p += data.length - i5;
        break;
      } else {
        for (let j4 = 0; this.p + j4 < 128; j4++) {
          this.next[this.p + j4] = data[i5 + j4];
        }
        crypto_hashblocks_hl(this.hh, this.hl, this.next, 128);
        i5 += 128 - this.p;
        this.p = 0;
      }
    }
    return this;
  }
  finish() {
    const out = new Uint8Array(64);
    let n2 = this.p;
    const x6 = new Uint8Array(256);
    const b5 = this.total;
    for (let i5 = 0; i5 < n2; i5++)
      x6[i5] = this.next[i5];
    x6[n2] = 128;
    n2 = 256 - 128 * (n2 < 112 ? 1 : 0);
    x6[n2 - 9] = 0;
    ts64(x6, n2 - 8, b5 / 536870912 | 0, b5 << 3);
    crypto_hashblocks_hl(this.hh, this.hl, x6, n2);
    for (let i5 = 0; i5 < 8; i5++)
      ts64(out, 8 * i5, this.hh[i5], this.hl[i5]);
    return out;
  }
};
function add(p4, q6) {
  const a6 = gf(), b5 = gf(), c5 = gf(), d6 = gf(), e5 = gf(), f3 = gf(), g4 = gf(), h5 = gf(), t5 = gf();
  Z(a6, p4[1], p4[0]);
  Z(t5, q6[1], q6[0]);
  M(a6, a6, t5);
  A(b5, p4[0], p4[1]);
  A(t5, q6[0], q6[1]);
  M(b5, b5, t5);
  M(c5, p4[3], q6[3]);
  M(c5, c5, D2);
  M(d6, p4[2], q6[2]);
  A(d6, d6, d6);
  Z(e5, b5, a6);
  Z(f3, d6, c5);
  A(g4, d6, c5);
  A(h5, b5, a6);
  M(p4[0], e5, f3);
  M(p4[1], h5, g4);
  M(p4[2], g4, f3);
  M(p4[3], e5, h5);
}
function cswap(p4, q6, b5) {
  let i5;
  for (i5 = 0; i5 < 4; i5++) {
    sel25519(p4[i5], q6[i5], b5);
  }
}
function pack(r3, p4) {
  const tx = gf(), ty = gf(), zi = gf();
  inv25519(zi, p4[2]);
  M(tx, p4[0], zi);
  M(ty, p4[1], zi);
  pack25519(r3, ty);
  r3[31] ^= par25519(tx) << 7;
}
function scalarmult(p4, q6, s6) {
  let b5, i5;
  set25519(p4[0], gf0);
  set25519(p4[1], gf1);
  set25519(p4[2], gf1);
  set25519(p4[3], gf0);
  for (i5 = 255; i5 >= 0; --i5) {
    b5 = s6[i5 / 8 | 0] >> (i5 & 7) & 1;
    cswap(p4, q6, b5);
    add(q6, p4);
    add(p4, p4);
    cswap(p4, q6, b5);
  }
}
function scalarbase(p4, s6) {
  const q6 = [gf(), gf(), gf(), gf()];
  set25519(q6[0], X);
  set25519(q6[1], Y);
  set25519(q6[2], gf1);
  M(q6[3], X, Y);
  scalarmult(p4, q6, s6);
}
function crypto_sign_keypair(pk, sk, seeded) {
  const d6 = new Uint8Array(64);
  const p4 = [gf(), gf(), gf(), gf()];
  if (!seeded)
    randombytes(sk, 32);
  crypto_hash(d6, sk, 32);
  d6[0] &= 248;
  d6[31] &= 127;
  d6[31] |= 64;
  scalarbase(p4, d6);
  pack(pk, p4);
  for (let i5 = 0; i5 < 32; i5++)
    sk[i5 + 32] = pk[i5];
  return 0;
}
var L = new Float64Array([
  237,
  211,
  245,
  92,
  26,
  99,
  18,
  88,
  214,
  156,
  247,
  162,
  222,
  249,
  222,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  16
]);
function modL(r3, x6) {
  let carry, i5, j4, k6;
  for (i5 = 63; i5 >= 32; --i5) {
    carry = 0;
    for (j4 = i5 - 32, k6 = i5 - 12; j4 < k6; ++j4) {
      x6[j4] += carry - 16 * x6[i5] * L[j4 - (i5 - 32)];
      carry = Math.floor((x6[j4] + 128) / 256);
      x6[j4] -= carry * 256;
    }
    x6[j4] += carry;
    x6[i5] = 0;
  }
  carry = 0;
  for (j4 = 0; j4 < 32; j4++) {
    x6[j4] += carry - (x6[31] >> 4) * L[j4];
    carry = x6[j4] >> 8;
    x6[j4] &= 255;
  }
  for (j4 = 0; j4 < 32; j4++)
    x6[j4] -= carry * L[j4];
  for (i5 = 0; i5 < 32; i5++) {
    x6[i5 + 1] += x6[i5] >> 8;
    r3[i5] = x6[i5] & 255;
  }
}
function reduce(r3) {
  const x6 = new Float64Array(64);
  for (let i5 = 0; i5 < 64; i5++)
    x6[i5] = r3[i5];
  for (let i5 = 0; i5 < 64; i5++)
    r3[i5] = 0;
  modL(r3, x6);
}
function crypto_sign(sm, m6, n2, sk) {
  const d6 = new Uint8Array(64), h5 = new Uint8Array(64), r3 = new Uint8Array(64);
  let i5, j4;
  const x6 = new Float64Array(64);
  const p4 = [gf(), gf(), gf(), gf()];
  crypto_hash(d6, sk, 32);
  d6[0] &= 248;
  d6[31] &= 127;
  d6[31] |= 64;
  const smlen = n2 + 64;
  for (i5 = 0; i5 < n2; i5++)
    sm[64 + i5] = m6[i5];
  for (i5 = 0; i5 < 32; i5++)
    sm[32 + i5] = d6[32 + i5];
  crypto_hash(r3, sm.subarray(32), n2 + 32);
  reduce(r3);
  scalarbase(p4, r3);
  pack(sm, p4);
  for (i5 = 32; i5 < 64; i5++)
    sm[i5] = sk[i5];
  crypto_hash(h5, sm, n2 + 64);
  reduce(h5);
  for (i5 = 0; i5 < 64; i5++)
    x6[i5] = 0;
  for (i5 = 0; i5 < 32; i5++)
    x6[i5] = r3[i5];
  for (i5 = 0; i5 < 32; i5++) {
    for (j4 = 0; j4 < 32; j4++) {
      x6[i5 + j4] += h5[i5] * d6[j4];
    }
  }
  modL(sm.subarray(32), x6);
  return smlen;
}
function unpackpos(r3, p4) {
  const q6 = [gf(), gf(), gf(), gf()];
  if (unpackneg(q6, p4))
    return -1;
  const scalar0 = new Uint8Array(32);
  const scalar1 = new Uint8Array(32);
  scalar1[0] = 1;
  const scalarNeg1 = crypto_core_ed25519_scalar_sub(scalar0, scalar1);
  scalarmult(r3, q6, scalarNeg1);
  return 0;
}
function unpackneg(r3, p4) {
  const t5 = gf();
  const chk = gf();
  const num = gf();
  const den = gf();
  const den2 = gf();
  const den4 = gf();
  const den6 = gf();
  set25519(r3[2], gf1);
  unpack25519(r3[1], p4);
  S(num, r3[1]);
  M(den, num, D);
  Z(num, num, r3[2]);
  A(den, r3[2], den);
  S(den2, den);
  S(den4, den2);
  M(den6, den4, den2);
  M(t5, den6, num);
  M(t5, t5, den);
  pow2523(t5, t5);
  M(t5, t5, num);
  M(t5, t5, den);
  M(t5, t5, den);
  M(r3[0], t5, den);
  S(chk, r3[0]);
  M(chk, chk, den);
  if (neq25519(chk, num))
    M(r3[0], r3[0], I);
  S(chk, r3[0]);
  M(chk, chk, den);
  if (neq25519(chk, num))
    return -1;
  if (par25519(r3[0]) === p4[31] >> 7)
    Z(r3[0], gf0, r3[0]);
  M(r3[3], r3[0], r3[1]);
  return 0;
}
function crypto_scalarmult_ed25519_base_noclamp(s6) {
  const r3 = new Uint8Array(32);
  const p4 = [gf(), gf(), gf(), gf()];
  scalarbase(p4, s6);
  pack(r3, p4);
  return r3;
}
function crypto_scalarmult_ed25519_noclamp(s6, q6) {
  const r3 = new Uint8Array(32);
  const p4 = [gf(), gf(), gf(), gf()];
  const ql = [gf(), gf(), gf(), gf()];
  if (unpackpos(ql, q6))
    throw new Error();
  scalarmult(p4, ql, s6);
  pack(r3, p4);
  return r3;
}
function crypto_sign_open(m6, sm, n2, pk) {
  let i5, mlen;
  const t5 = new Uint8Array(32), h5 = new Uint8Array(64);
  const p4 = [gf(), gf(), gf(), gf()], q6 = [gf(), gf(), gf(), gf()];
  mlen = -1;
  if (n2 < 64)
    return -1;
  if (unpackneg(q6, pk))
    return -1;
  for (i5 = 0; i5 < n2; i5++)
    m6[i5] = sm[i5];
  for (i5 = 0; i5 < 32; i5++)
    m6[i5 + 32] = pk[i5];
  crypto_hash(h5, m6, n2);
  reduce(h5);
  scalarmult(p4, q6, h5);
  scalarbase(q6, sm.subarray(32));
  add(p4, q6);
  pack(t5, p4);
  n2 -= 64;
  if (crypto_verify_32(sm, 0, t5, 0)) {
    for (i5 = 0; i5 < n2; i5++)
      m6[i5] = 0;
    return -1;
  }
  for (i5 = 0; i5 < n2; i5++)
    m6[i5] = sm[i5 + 64];
  mlen = n2;
  return mlen;
}
var crypto_sign_BYTES = 64;
var crypto_sign_PUBLICKEYBYTES = 32;
var crypto_sign_SECRETKEYBYTES = 64;
var crypto_sign_SEEDBYTES = 32;
var crypto_hash_BYTES = 64;
function checkArrayTypes(...args) {
  for (let i5 = 0; i5 < args.length; i5++) {
    if (!(args[i5] instanceof Uint8Array))
      throw new TypeError("unexpected type, use Uint8Array");
  }
}
function randomBytes(n2) {
  const b5 = new Uint8Array(n2);
  randombytes(b5, n2);
  return b5;
}
function sign(msg, secretKey) {
  checkArrayTypes(msg, secretKey);
  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
    throw new Error("bad secret key size");
  const signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length);
  crypto_sign(signedMsg, msg, msg.length, secretKey);
  return signedMsg;
}
function sign_detached(msg, secretKey) {
  const signedMsg = sign(msg, secretKey);
  const sig = new Uint8Array(crypto_sign_BYTES);
  for (let i5 = 0; i5 < sig.length; i5++)
    sig[i5] = signedMsg[i5];
  return sig;
}
function crypto_sign_keyPair_fromSeed(seed) {
  checkArrayTypes(seed);
  if (seed.length !== crypto_sign_SEEDBYTES)
    throw new Error(`bad seed size: ${seed.length}`);
  const pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  const sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  for (let i5 = 0; i5 < 32; i5++)
    sk[i5] = seed[i5];
  crypto_sign_keypair(pk, sk, true);
  return { publicKey: pk, secretKey: sk };
}
function hash(msg) {
  checkArrayTypes(msg);
  const h5 = new Uint8Array(crypto_hash_BYTES);
  crypto_hash(h5, msg, msg.length);
  return h5;
}
function setPRNG(fn2) {
  randombytes = fn2;
}
function crypto_core_ed25519_scalar_reduce(x6) {
  const len = x6.length;
  const z6 = new Float64Array(64);
  for (let i5 = 0; i5 < len; i5++)
    z6[i5] = x6[i5];
  const o3 = new Uint8Array(32);
  modL(o3, z6);
  return o3;
}
function crypto_core_ed25519_scalar_sub(x6, y6) {
  const z6 = new Float64Array(64);
  for (let i5 = 0; i5 < 32; i5++) {
    z6[i5] = x6[i5] - y6[i5];
  }
  const o3 = new Uint8Array(32);
  modL(o3, z6);
  return o3;
}
function crypto_edx25519_private_key_create() {
  const seed = new Uint8Array(32);
  randombytes(seed, 32);
  return crypto_edx25519_private_key_create_from_seed(seed);
}
function crypto_edx25519_private_key_create_from_seed(seed) {
  const pk = hash(seed);
  pk[0] &= 248;
  pk[31] &= 127;
  pk[31] |= 64;
  return pk;
}
function crypto_edx25519_get_public(priv) {
  return crypto_scalarmult_ed25519_base_noclamp(priv.subarray(0, 32));
}
function crypto_edx25519_sign_detached(m6, skx, pkx) {
  const n2 = m6.length;
  const h5 = new Uint8Array(64);
  const r3 = new Uint8Array(64);
  let i5, j4;
  const x6 = new Float64Array(64);
  const p4 = [gf(), gf(), gf(), gf()];
  const sm = new Uint8Array(n2 + 64);
  for (i5 = 0; i5 < n2; i5++)
    sm[64 + i5] = m6[i5];
  for (i5 = 0; i5 < 32; i5++)
    sm[32 + i5] = skx[32 + i5];
  crypto_hash(r3, sm.subarray(32), n2 + 32);
  reduce(r3);
  scalarbase(p4, r3);
  pack(sm, p4);
  for (i5 = 32; i5 < 64; i5++)
    sm[i5] = pkx[i5 - 32];
  crypto_hash(h5, sm, n2 + 64);
  reduce(h5);
  for (i5 = 0; i5 < 64; i5++)
    x6[i5] = 0;
  for (i5 = 0; i5 < 32; i5++)
    x6[i5] = r3[i5];
  for (i5 = 0; i5 < 32; i5++) {
    for (j4 = 0; j4 < 32; j4++) {
      x6[i5 + j4] += h5[i5] * skx[j4];
    }
  }
  modL(sm.subarray(32), x6);
  return sm.subarray(0, 64);
}
function crypto_edx25519_sign_detached_verify(msg, sig, publicKey) {
  checkArrayTypes(msg, sig, publicKey);
  if (sig.length !== crypto_sign_BYTES)
    throw new Error("bad signature size");
  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
    throw new Error("bad public key size");
  const sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  const m6 = new Uint8Array(crypto_sign_BYTES + msg.length);
  let i5;
  for (i5 = 0; i5 < crypto_sign_BYTES; i5++)
    sm[i5] = sig[i5];
  for (i5 = 0; i5 < msg.length; i5++)
    sm[i5 + crypto_sign_BYTES] = msg[i5];
  return crypto_sign_open(m6, sm, sm.length, publicKey) >= 0;
}

// ../taler-util/lib/prng-browser.js
function loadBrowserPrng() {
  const cr = typeof self !== "undefined" ? self.crypto || self.msCrypto : null;
  const QUOTA = 65536;
  setPRNG(function(x6, n2) {
    let i5;
    const v3 = new Uint8Array(n2);
    for (i5 = 0; i5 < n2; i5 += QUOTA) {
      cr.getRandomValues(v3.subarray(i5, i5 + Math.min(n2 - i5, QUOTA)));
    }
    for (i5 = 0; i5 < n2; i5++)
      x6[i5] = v3[i5];
    for (i5 = 0; i5 < v3.length; i5++)
      v3[i5] = 0;
  });
}

// ../taler-util/lib/punycode.js
var maxInt = 2147483647;
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128;
var delimiter = "-";
var regexPunycode = /^xn--/;
var regexNonASCII = /[^\0-\x7E]/;
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
var errors = {
  overflow: "Overflow: input needs wider integers to process",
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  "invalid-input": "Invalid input"
};
var baseMinusTMin = base - tMin;
var floor = Math.floor;
var stringFromCharCode = String.fromCharCode;
function error(type) {
  throw new RangeError(errors[type]);
}
function map(array, fn2) {
  const result = [];
  let length = array.length;
  while (length--) {
    result[length] = fn2(array[length]);
  }
  return result;
}
function mapDomain(string, fn2) {
  const parts = string.split("@");
  let result = "";
  if (parts.length > 1) {
    result = parts[0] + "@";
    string = parts[1];
  }
  string = string.replace(regexSeparators, ".");
  const labels = string.split(".");
  const encoded = map(labels, fn2).join(".");
  return result + encoded;
}
function ucs2decode(string) {
  const output = [];
  let counter2 = 0;
  const length = string.length;
  while (counter2 < length) {
    const value = string.charCodeAt(counter2++);
    if (value >= 55296 && value <= 56319 && counter2 < length) {
      const extra = string.charCodeAt(counter2++);
      if ((extra & 64512) == 56320) {
        output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
      } else {
        output.push(value);
        counter2--;
      }
    } else {
      output.push(value);
    }
  }
  return output;
}
var ucs2encode = (array) => String.fromCodePoint(...array);
var basicToDigit = function(codePoint) {
  if (codePoint - 48 < 10) {
    return codePoint - 22;
  }
  if (codePoint - 65 < 26) {
    return codePoint - 65;
  }
  if (codePoint - 97 < 26) {
    return codePoint - 97;
  }
  return base;
};
var digitToBasic = function(digit, flag) {
  return digit + 22 + 75 * Number(digit < 26) - (Number(flag != 0) << 5);
};
var adapt = function(delta, numPoints, firstTime) {
  let k6 = 0;
  delta = firstTime ? floor(delta / damp) : delta >> 1;
  delta += floor(delta / numPoints);
  for (
    ;
    /* no initialization */
    delta > baseMinusTMin * tMax >> 1;
    k6 += base
  ) {
    delta = floor(delta / baseMinusTMin);
  }
  return floor(k6 + (baseMinusTMin + 1) * delta / (delta + skew));
};
var decode = function(input) {
  const output = [];
  const inputLength = input.length;
  let i5 = 0;
  let n2 = initialN;
  let bias = initialBias;
  let basic = input.lastIndexOf(delimiter);
  if (basic < 0) {
    basic = 0;
  }
  for (let j4 = 0; j4 < basic; ++j4) {
    if (input.charCodeAt(j4) >= 128) {
      error("not-basic");
    }
    output.push(input.charCodeAt(j4));
  }
  for (let index2 = basic > 0 ? basic + 1 : 0; index2 < inputLength; ) {
    let oldi = i5;
    for (let w6 = 1, k6 = base; ; k6 += base) {
      if (index2 >= inputLength) {
        error("invalid-input");
      }
      const digit = basicToDigit(input.charCodeAt(index2++));
      if (digit >= base || digit > floor((maxInt - i5) / w6)) {
        error("overflow");
      }
      i5 += digit * w6;
      const t5 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias;
      if (digit < t5) {
        break;
      }
      const baseMinusT = base - t5;
      if (w6 > floor(maxInt / baseMinusT)) {
        error("overflow");
      }
      w6 *= baseMinusT;
    }
    const out = output.length + 1;
    bias = adapt(i5 - oldi, out, oldi == 0);
    if (floor(i5 / out) > maxInt - n2) {
      error("overflow");
    }
    n2 += floor(i5 / out);
    i5 %= out;
    output.splice(i5++, 0, n2);
  }
  return String.fromCodePoint(...output);
};
var encode = function(inputArg) {
  const output = [];
  let input = ucs2decode(inputArg);
  let inputLength = input.length;
  let n2 = initialN;
  let delta = 0;
  let bias = initialBias;
  for (const currentValue of input) {
    if (currentValue < 128) {
      output.push(stringFromCharCode(currentValue));
    }
  }
  let basicLength = output.length;
  let handledCPCount = basicLength;
  if (basicLength) {
    output.push(delimiter);
  }
  while (handledCPCount < inputLength) {
    let m6 = maxInt;
    for (const currentValue of input) {
      if (currentValue >= n2 && currentValue < m6) {
        m6 = currentValue;
      }
    }
    const handledCPCountPlusOne = handledCPCount + 1;
    if (m6 - n2 > floor((maxInt - delta) / handledCPCountPlusOne)) {
      error("overflow");
    }
    delta += (m6 - n2) * handledCPCountPlusOne;
    n2 = m6;
    for (const currentValue of input) {
      if (currentValue < n2 && ++delta > maxInt) {
        error("overflow");
      }
      if (currentValue == n2) {
        let q6 = delta;
        for (let k6 = base; ; k6 += base) {
          const t5 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias;
          if (q6 < t5) {
            break;
          }
          const qMinusT = q6 - t5;
          const baseMinusT = base - t5;
          output.push(stringFromCharCode(digitToBasic(t5 + qMinusT % baseMinusT, 0)));
          q6 = floor(qMinusT / baseMinusT);
        }
        output.push(stringFromCharCode(digitToBasic(q6, 0)));
        bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
        delta = 0;
        ++handledCPCount;
      }
    }
    ++delta;
    ++n2;
  }
  return output.join("");
};
var toUnicode = function(input) {
  return mapDomain(input, function(string) {
    return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
  });
};
var toASCII = function(input) {
  return mapDomain(input, function(string) {
    return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
  });
};
var punycode = {
  /**
   * A string representing the current Punycode.js version number.
   * @memberOf punycode
   * @type String
   */
  version: "2.1.0",
  /**
   * An object of methods to convert from JavaScript's internal character
   * representation (UCS-2) to Unicode code points, and back.
   * @see <https://mathiasbynens.be/notes/javascript-encoding>
   * @memberOf punycode
   * @type Object
   */
  ucs2: {
    decode: ucs2decode,
    encode: ucs2encode
  },
  decode,
  encode,
  toASCII,
  toUnicode
};

// ../taler-util/lib/whatwg-url.js
var utf8Encoder = new TextEncoder();
var utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
function utf8Encode(string) {
  return utf8Encoder.encode(string);
}
function utf8DecodeWithoutBOM(bytes) {
  return utf8Decoder.decode(bytes);
}
function parseUrlencoded(input) {
  const sequences = strictlySplitByteSequence(input, p("&"));
  const output = [];
  for (const bytes of sequences) {
    if (bytes.length === 0) {
      continue;
    }
    let name, value;
    const indexOfEqual = bytes.indexOf(p("="));
    if (indexOfEqual >= 0) {
      name = bytes.slice(0, indexOfEqual);
      value = bytes.slice(indexOfEqual + 1);
    } else {
      name = bytes;
      value = new Uint8Array(0);
    }
    name = replaceByteInByteSequence(name, 43, 32);
    value = replaceByteInByteSequence(value, 43, 32);
    const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name));
    const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value));
    output.push([nameString, valueString]);
  }
  return output;
}
function parseUrlencodedString(input) {
  return parseUrlencoded(utf8Encode(input));
}
function serializeUrlencoded(tuples, encodingOverride = void 0) {
  let encoding = "utf-8";
  if (encodingOverride !== void 0) {
    encoding = encodingOverride;
  }
  let output = "";
  for (const [i5, tuple] of tuples.entries()) {
    const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true);
    let value = tuple[1];
    if (tuple.length > 2 && tuple[2] !== void 0) {
      if (tuple[2] === "hidden" && name === "_charset_") {
        value = encoding;
      } else if (tuple[2] === "file") {
        value = value.name;
      }
    }
    value = utf8PercentEncodeString(value, isURLEncodedPercentEncode, true);
    if (i5 !== 0) {
      output += "&";
    }
    output += `${name}=${value}`;
  }
  return output;
}
function strictlySplitByteSequence(buf, cp) {
  const list = [];
  let last = 0;
  let i5 = buf.indexOf(cp);
  while (i5 >= 0) {
    list.push(buf.slice(last, i5));
    last = i5 + 1;
    i5 = buf.indexOf(cp, last);
  }
  if (last !== buf.length) {
    list.push(buf.slice(last));
  }
  return list;
}
function replaceByteInByteSequence(buf, from2, to2) {
  let i5 = buf.indexOf(from2);
  while (i5 >= 0) {
    buf[i5] = to2;
    i5 = buf.indexOf(from2, i5 + 1);
  }
  return buf;
}
function p(char) {
  return char.codePointAt(0);
}
function percentEncode(c5) {
  let hex2 = c5.toString(16).toUpperCase();
  if (hex2.length === 1) {
    hex2 = `0${hex2}`;
  }
  return `%${hex2}`;
}
function percentDecodeBytes(input) {
  const output = new Uint8Array(input.byteLength);
  let outputIndex = 0;
  for (let i5 = 0; i5 < input.byteLength; ++i5) {
    const byte = input[i5];
    if (byte !== 37) {
      output[outputIndex++] = byte;
    } else if (byte === 37 && (!isASCIIHex(input[i5 + 1]) || !isASCIIHex(input[i5 + 2]))) {
      output[outputIndex++] = byte;
    } else {
      const bytePoint = parseInt(String.fromCodePoint(input[i5 + 1], input[i5 + 2]), 16);
      output[outputIndex++] = bytePoint;
      i5 += 2;
    }
  }
  return output.slice(0, outputIndex);
}
function percentDecodeString(input) {
  const bytes = utf8Encode(input);
  return percentDecodeBytes(bytes);
}
function isC0ControlPercentEncode(c5) {
  return c5 <= 31 || c5 > 126;
}
var extraFragmentPercentEncodeSet = /* @__PURE__ */ new Set([
  p(" "),
  p('"'),
  p("<"),
  p(">"),
  p("`")
]);
function isFragmentPercentEncode(c5) {
  return isC0ControlPercentEncode(c5) || extraFragmentPercentEncodeSet.has(c5);
}
var extraQueryPercentEncodeSet = /* @__PURE__ */ new Set([
  p(" "),
  p('"'),
  p("#"),
  p("<"),
  p(">")
]);
function isQueryPercentEncode(c5) {
  return isC0ControlPercentEncode(c5) || extraQueryPercentEncodeSet.has(c5);
}
function isSpecialQueryPercentEncode(c5) {
  return isQueryPercentEncode(c5) || c5 === p("'");
}
var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([p("?"), p("`"), p("{"), p("}")]);
function isPathPercentEncode(c5) {
  return isQueryPercentEncode(c5) || extraPathPercentEncodeSet.has(c5);
}
var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([
  p("/"),
  p(":"),
  p(";"),
  p("="),
  p("@"),
  p("["),
  p("\\"),
  p("]"),
  p("^"),
  p("|")
]);
function isUserinfoPercentEncode(c5) {
  return isPathPercentEncode(c5) || extraUserinfoPercentEncodeSet.has(c5);
}
var extraComponentPercentEncodeSet = /* @__PURE__ */ new Set([
  p("$"),
  p("%"),
  p("&"),
  p("+"),
  p(",")
]);
function isComponentPercentEncode(c5) {
  return isUserinfoPercentEncode(c5) || extraComponentPercentEncodeSet.has(c5);
}
var extraURLEncodedPercentEncodeSet = /* @__PURE__ */ new Set([
  p("!"),
  p("'"),
  p("("),
  p(")"),
  p("~")
]);
function isURLEncodedPercentEncode(c5) {
  return isComponentPercentEncode(c5) || extraURLEncodedPercentEncodeSet.has(c5);
}
function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) {
  const bytes = utf8Encode(codePoint);
  let output = "";
  for (const byte of bytes) {
    if (!percentEncodePredicate(byte)) {
      output += String.fromCharCode(byte);
    } else {
      output += percentEncode(byte);
    }
  }
  return output;
}
function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) {
  return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate);
}
function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) {
  let output = "";
  for (const codePoint of input) {
    if (spaceAsPlus && codePoint === " ") {
      output += "+";
    } else {
      output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate);
    }
  }
  return output;
}
function isASCIIDigit(c5) {
  return c5 >= 48 && c5 <= 57;
}
function isASCIIAlpha(c5) {
  return c5 >= 65 && c5 <= 90 || c5 >= 97 && c5 <= 122;
}
function isASCIIAlphanumeric(c5) {
  return isASCIIAlpha(c5) || isASCIIDigit(c5);
}
function isASCIIHex(c5) {
  return isASCIIDigit(c5) || c5 >= 65 && c5 <= 70 || c5 >= 97 && c5 <= 102;
}
var URLSearchParamsImpl = class {
  constructor(init, { doNotStripQMark = false } = {}) {
    this._list = [];
    this._url = null;
    if (!doNotStripQMark && typeof init === "string" && init[0] === "?") {
      init = init.slice(1);
    }
    if (Array.isArray(init)) {
      for (const pair of init) {
        if (pair.length !== 2) {
          throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements.");
        }
        this._list.push([pair[0], pair[1]]);
      }
    } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) {
      for (const name of Object.keys(init)) {
        const value = init[name];
        this._list.push([name, value]);
      }
    } else {
      this._list = parseUrlencodedString(init);
    }
  }
  _updateSteps() {
    if (this._url !== null) {
      let query = serializeUrlencoded(this._list);
      if (query === "") {
        query = null;
      }
      this._url._url.query = query;
    }
  }
  append(name, value) {
    this._list.push([name, value]);
    this._updateSteps();
  }
  delete(name) {
    let i5 = 0;
    while (i5 < this._list.length) {
      if (this._list[i5][0] === name) {
        this._list.splice(i5, 1);
      } else {
        i5++;
      }
    }
    this._updateSteps();
  }
  get(name) {
    for (const tuple of this._list) {
      if (tuple[0] === name) {
        return tuple[1];
      }
    }
    return null;
  }
  getAll(name) {
    const output = [];
    for (const tuple of this._list) {
      if (tuple[0] === name) {
        output.push(tuple[1]);
      }
    }
    return output;
  }
  entries() {
    return [...this._list.map((x6) => [x6[0], x6[1]])];
  }
  forEach(callbackfn, thisArg) {
    for (const tuple of this._list) {
      callbackfn.call(thisArg, tuple[1], tuple[0], this);
    }
  }
  has(name) {
    for (const tuple of this._list) {
      if (tuple[0] === name) {
        return true;
      }
    }
    return false;
  }
  set(name, value) {
    let found = false;
    let i5 = 0;
    while (i5 < this._list.length) {
      if (this._list[i5][0] === name) {
        if (found) {
          this._list.splice(i5, 1);
        } else {
          found = true;
          this._list[i5][1] = value;
          i5++;
        }
      } else {
        i5++;
      }
    }
    if (!found) {
      this._list.push([name, value]);
    }
    this._updateSteps();
  }
  sort() {
    this._list.sort((a6, b5) => {
      if (a6[0] < b5[0]) {
        return -1;
      }
      if (a6[0] > b5[0]) {
        return 1;
      }
      return 0;
    });
    this._updateSteps();
  }
  [Symbol.iterator]() {
    return this._list[Symbol.iterator]();
  }
  toString() {
    return serializeUrlencoded(this._list);
  }
};
var specialSchemes = {
  ftp: 21,
  file: null,
  http: 80,
  https: 443,
  ws: 80,
  wss: 443
};
var failure = Symbol("failure");
function countSymbols(str) {
  return [...str].length;
}
function at(input, idx) {
  const c5 = input[idx];
  return isNaN(c5) ? void 0 : String.fromCodePoint(c5);
}
function isSingleDot(buffer) {
  return buffer === "." || buffer.toLowerCase() === "%2e";
}
function isDoubleDot(buffer) {
  buffer = buffer.toLowerCase();
  return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e";
}
function isWindowsDriveLetterCodePoints(cp1, cp2) {
  return isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|"));
}
function isWindowsDriveLetterString(string) {
  return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|");
}
function isNormalizedWindowsDriveLetterString(string) {
  return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":";
}
function containsForbiddenHostCodePoint(string) {
  return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1;
}
function containsForbiddenDomainCodePoint(string) {
  return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1;
}
function isSpecialScheme(scheme) {
  return specialSchemes[scheme] !== void 0;
}
function isSpecial(url) {
  return isSpecialScheme(url.scheme);
}
function isNotSpecial(url) {
  return !isSpecialScheme(url.scheme);
}
function defaultPort(scheme) {
  return specialSchemes[scheme];
}
function parseIPv4Number(input) {
  if (input === "") {
    return failure;
  }
  let R4 = 10;
  if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") {
    input = input.substring(2);
    R4 = 16;
  } else if (input.length >= 2 && input.charAt(0) === "0") {
    input = input.substring(1);
    R4 = 8;
  }
  if (input === "") {
    return 0;
  }
  let regex = /[^0-7]/u;
  if (R4 === 10) {
    regex = /[^0-9]/u;
  }
  if (R4 === 16) {
    regex = /[^0-9A-Fa-f]/u;
  }
  if (regex.test(input)) {
    return failure;
  }
  return parseInt(input, R4);
}
function parseIPv4(input) {
  const parts = input.split(".");
  if (parts[parts.length - 1] === "") {
    if (parts.length > 1) {
      parts.pop();
    }
  }
  if (parts.length > 4) {
    return failure;
  }
  const numbers2 = [];
  for (const part of parts) {
    const n2 = parseIPv4Number(part);
    if (n2 === failure) {
      return failure;
    }
    numbers2.push(n2);
  }
  for (let i5 = 0; i5 < numbers2.length - 1; ++i5) {
    if (numbers2[i5] > 255) {
      return failure;
    }
  }
  if (numbers2[numbers2.length - 1] >= 256 ** (5 - numbers2.length)) {
    return failure;
  }
  let ipv4 = numbers2.pop();
  let counter2 = 0;
  for (const n2 of numbers2) {
    ipv4 += n2 * 256 ** (3 - counter2);
    ++counter2;
  }
  return ipv4;
}
function serializeIPv4(address) {
  let output = "";
  let n2 = address;
  for (let i5 = 1; i5 <= 4; ++i5) {
    output = String(n2 % 256) + output;
    if (i5 !== 4) {
      output = `.${output}`;
    }
    n2 = Math.floor(n2 / 256);
  }
  return output;
}
function parseIPv6(inputArg) {
  const address = [0, 0, 0, 0, 0, 0, 0, 0];
  let pieceIndex = 0;
  let compress2 = null;
  let pointer = 0;
  const input = Array.from(inputArg, (c5) => c5.codePointAt(0));
  if (input[pointer] === p(":")) {
    if (input[pointer + 1] !== p(":")) {
      return failure;
    }
    pointer += 2;
    ++pieceIndex;
    compress2 = pieceIndex;
  }
  while (pointer < input.length) {
    if (pieceIndex === 8) {
      return failure;
    }
    if (input[pointer] === p(":")) {
      if (compress2 !== null) {
        return failure;
      }
      ++pointer;
      ++pieceIndex;
      compress2 = pieceIndex;
      continue;
    }
    let value = 0;
    let length = 0;
    while (length < 4 && isASCIIHex(input[pointer])) {
      value = value * 16 + parseInt(at(input, pointer), 16);
      ++pointer;
      ++length;
    }
    if (input[pointer] === p(".")) {
      if (length === 0) {
        return failure;
      }
      pointer -= length;
      if (pieceIndex > 6) {
        return failure;
      }
      let numbersSeen = 0;
      while (input[pointer] !== void 0) {
        let ipv4Piece = null;
        if (numbersSeen > 0) {
          if (input[pointer] === p(".") && numbersSeen < 4) {
            ++pointer;
          } else {
            return failure;
          }
        }
        if (!isASCIIDigit(input[pointer])) {
          return failure;
        }
        while (isASCIIDigit(input[pointer])) {
          const number = parseInt(at(input, pointer));
          if (ipv4Piece === null) {
            ipv4Piece = number;
          } else if (ipv4Piece === 0) {
            return failure;
          } else {
            ipv4Piece = ipv4Piece * 10 + number;
          }
          if (ipv4Piece > 255) {
            return failure;
          }
          ++pointer;
        }
        address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
        ++numbersSeen;
        if (numbersSeen === 2 || numbersSeen === 4) {
          ++pieceIndex;
        }
      }
      if (numbersSeen !== 4) {
        return failure;
      }
      break;
    } else if (input[pointer] === p(":")) {
      ++pointer;
      if (input[pointer] === void 0) {
        return failure;
      }
    } else if (input[pointer] !== void 0) {
      return failure;
    }
    address[pieceIndex] = value;
    ++pieceIndex;
  }
  if (compress2 !== null) {
    let swaps = pieceIndex - compress2;
    pieceIndex = 7;
    while (pieceIndex !== 0 && swaps > 0) {
      const temp = address[compress2 + swaps - 1];
      address[compress2 + swaps - 1] = address[pieceIndex];
      address[pieceIndex] = temp;
      --pieceIndex;
      --swaps;
    }
  } else if (compress2 === null && pieceIndex !== 8) {
    return failure;
  }
  return address;
}
function serializeIPv6(address) {
  let output = "";
  const compress2 = findLongestZeroSequence(address);
  let ignore0 = false;
  for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
    if (ignore0 && address[pieceIndex] === 0) {
      continue;
    } else if (ignore0) {
      ignore0 = false;
    }
    if (compress2 === pieceIndex) {
      const separator = pieceIndex === 0 ? "::" : ":";
      output += separator;
      ignore0 = true;
      continue;
    }
    output += address[pieceIndex].toString(16);
    if (pieceIndex !== 7) {
      output += ":";
    }
  }
  return output;
}
function parseHost(input, isNotSpecialArg = false) {
  if (input[0] === "[") {
    if (input[input.length - 1] !== "]") {
      return failure;
    }
    return parseIPv6(input.substring(1, input.length - 1));
  }
  if (isNotSpecialArg) {
    return parseOpaqueHost(input);
  }
  const domain = utf8DecodeWithoutBOM(percentDecodeString(input));
  const asciiDomain = domainToASCII(domain);
  if (asciiDomain === failure) {
    return failure;
  }
  if (containsForbiddenDomainCodePoint(asciiDomain)) {
    return failure;
  }
  if (endsInANumber(asciiDomain)) {
    return parseIPv4(asciiDomain);
  }
  return asciiDomain;
}
function endsInANumber(input) {
  const parts = input.split(".");
  if (parts[parts.length - 1] === "") {
    if (parts.length === 1) {
      return false;
    }
    parts.pop();
  }
  const last = parts[parts.length - 1];
  if (parseIPv4Number(last) !== failure) {
    return true;
  }
  if (/^[0-9]+$/u.test(last)) {
    return true;
  }
  return false;
}
function parseOpaqueHost(input) {
  if (containsForbiddenHostCodePoint(input)) {
    return failure;
  }
  return utf8PercentEncodeString(input, isC0ControlPercentEncode);
}
function findLongestZeroSequence(arr) {
  let maxIdx = null;
  let maxLen = 1;
  let currStart = null;
  let currLen = 0;
  for (let i5 = 0; i5 < arr.length; ++i5) {
    if (arr[i5] !== 0) {
      if (currLen > maxLen) {
        maxIdx = currStart;
        maxLen = currLen;
      }
      currStart = null;
      currLen = 0;
    } else {
      if (currStart === null) {
        currStart = i5;
      }
      ++currLen;
    }
  }
  if (currLen > maxLen) {
    return currStart;
  }
  return maxIdx;
}
function serializeHost(host) {
  if (typeof host === "number") {
    return serializeIPv4(host);
  }
  if (host instanceof Array) {
    return `[${serializeIPv6(host)}]`;
  }
  return host;
}
function domainToASCII(domain, beStrict = false) {
  let result;
  try {
    result = punycode.toASCII(domain);
  } catch (e5) {
    return failure;
  }
  if (result === null || result === "") {
    return failure;
  }
  return result;
}
function trimControlChars(url) {
  return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/gu, "");
}
function trimTabAndNewline(url) {
  return url.replace(/\u0009|\u000A|\u000D/gu, "");
}
function shortenPath(url) {
  const { path } = url;
  if (path.length === 0) {
    return;
  }
  if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {
    return;
  }
  path.pop();
}
function includesCredentials(url) {
  return url.username !== "" || url.password !== "";
}
function cannotHaveAUsernamePasswordPort(url) {
  return url.host === null || url.host === "" || url.scheme === "file";
}
function hasAnOpaquePath(url) {
  return typeof url.path === "string";
}
function isNormalizedWindowsDriveLetter(string) {
  return /^[A-Za-z]:$/u.test(string);
}
var URLStateMachine = class {
  constructor(input, base2, encodingOverride, url, stateOverride) {
    this.table = {
      "parse scheme start": this.parseSchemeStart,
      "parse scheme": this.parseScheme,
      "parse no scheme": this.parseNoScheme,
      "parse special relative or authority": this.parseSpecialRelativeOrAuthority,
      "parse path or authority": this.parsePathOrAuthority,
      "parse relative": this.parseRelative,
      "parse relative slash": this.parseRelativeSlash,
      "parse special authority slashes": this.parseSpecialAuthoritySlashes,
      "parse special authority ignore slashes": this.parseSpecialAuthorityIgnoreSlashes,
      "parse authority": this.parseAuthority,
      "parse host": this.parseHostName,
      "parse hostname": this.parseHostName,
      "parse port": this.parsePort,
      "parse file": this.parseFile,
      "parse file slash": this.parseFileSlash,
      "parse file host": this.parseFileHost,
      "parse path start": this.parsePathStart,
      "parse path": this.parsePath,
      "parse opaque path": this.parseOpaquePath,
      "parse query": this.parseQuery,
      "parse fragment": this.parseFragment
    };
    this.pointer = 0;
    this.base = base2 || null;
    this.encodingOverride = encodingOverride || "utf-8";
    this.url = url;
    this.failure = false;
    this.parseError = false;
    if (!this.url) {
      this.url = {
        scheme: "",
        username: "",
        password: "",
        host: null,
        port: null,
        path: [],
        query: null,
        fragment: null
      };
      const res2 = trimControlChars(input);
      if (res2 !== input) {
        this.parseError = true;
      }
      input = res2;
    }
    const res = trimTabAndNewline(input);
    if (res !== input) {
      this.parseError = true;
    }
    input = res;
    this.state = stateOverride || "scheme start";
    this.buffer = "";
    this.atFlag = false;
    this.arrFlag = false;
    this.passwordTokenSeenFlag = false;
    this.input = Array.from(input, (c5) => c5.codePointAt(0));
    for (; this.pointer <= this.input.length; ++this.pointer) {
      const c5 = this.input[this.pointer];
      const cStr = isNaN(c5) ? void 0 : String.fromCodePoint(c5);
      const ret = this.table[`parse ${this.state}`].call(this, c5, cStr);
      if (!ret) {
        break;
      } else if (ret === failure) {
        this.failure = true;
        break;
      }
    }
  }
  parseSchemeStart(c5, cStr) {
    if (isASCIIAlpha(c5)) {
      this.buffer += cStr.toLowerCase();
      this.state = "scheme";
    } else if (!this.stateOverride) {
      this.state = "no scheme";
      --this.pointer;
    } else {
      this.parseError = true;
      return failure;
    }
    return true;
  }
  parseScheme(c5, cStr) {
    if (isASCIIAlphanumeric(c5) || c5 === p("+") || c5 === p("-") || c5 === p(".")) {
      this.buffer += cStr.toLowerCase();
    } else if (c5 === p(":")) {
      if (this.stateOverride) {
        if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {
          return false;
        }
        if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {
          return false;
        }
        if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") {
          return false;
        }
        if (this.url.scheme === "file" && this.url.host === "") {
          return false;
        }
      }
      this.url.scheme = this.buffer;
      if (this.stateOverride) {
        if (this.url.port === defaultPort(this.url.scheme)) {
          this.url.port = null;
        }
        return false;
      }
      this.buffer = "";
      if (this.url.scheme === "file") {
        if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) {
          this.parseError = true;
        }
        this.state = "file";
      } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {
        this.state = "special relative or authority";
      } else if (isSpecial(this.url)) {
        this.state = "special authority slashes";
      } else if (this.input[this.pointer + 1] === p("/")) {
        this.state = "path or authority";
        ++this.pointer;
      } else {
        this.url.path = [""];
        this.state = "opaque path";
      }
    } else if (!this.stateOverride) {
      this.buffer = "";
      this.state = "no scheme";
      this.pointer = -1;
    } else {
      this.parseError = true;
      return failure;
    }
    return true;
  }
  parseNoScheme(c5) {
    if (this.base === null || hasAnOpaquePath(this.base) && c5 !== p("#")) {
      return failure;
    } else if (hasAnOpaquePath(this.base) && c5 === p("#")) {
      this.url.scheme = this.base.scheme;
      this.url.path = this.base.path;
      this.url.query = this.base.query;
      this.url.fragment = "";
      this.state = "fragment";
    } else if (this.base.scheme === "file") {
      this.state = "file";
      --this.pointer;
    } else {
      this.state = "relative";
      --this.pointer;
    }
    return true;
  }
  parseSpecialRelativeOrAuthority(c5) {
    if (c5 === p("/") && this.input[this.pointer + 1] === p("/")) {
      this.state = "special authority ignore slashes";
      ++this.pointer;
    } else {
      this.parseError = true;
      this.state = "relative";
      --this.pointer;
    }
    return true;
  }
  parsePathOrAuthority(c5) {
    if (c5 === p("/")) {
      this.state = "authority";
    } else {
      this.state = "path";
      --this.pointer;
    }
    return true;
  }
  parseRelative(c5) {
    this.url.scheme = this.base.scheme;
    if (c5 === p("/")) {
      this.state = "relative slash";
    } else if (isSpecial(this.url) && c5 === p("\\")) {
      this.parseError = true;
      this.state = "relative slash";
    } else {
      this.url.username = this.base.username;
      this.url.password = this.base.password;
      this.url.host = this.base.host;
      this.url.port = this.base.port;
      this.url.path = this.base.path.slice();
      this.url.query = this.base.query;
      if (c5 === p("?")) {
        this.url.query = "";
        this.state = "query";
      } else if (c5 === p("#")) {
        this.url.fragment = "";
        this.state = "fragment";
      } else if (!isNaN(c5)) {
        this.url.query = null;
        this.url.path.pop();
        this.state = "path";
        --this.pointer;
      }
    }
    return true;
  }
  parseRelativeSlash(c5) {
    if (isSpecial(this.url) && (c5 === p("/") || c5 === p("\\"))) {
      if (c5 === p("\\")) {
        this.parseError = true;
      }
      this.state = "special authority ignore slashes";
    } else if (c5 === p("/")) {
      this.state = "authority";
    } else {
      this.url.username = this.base.username;
      this.url.password = this.base.password;
      this.url.host = this.base.host;
      this.url.port = this.base.port;
      this.state = "path";
      --this.pointer;
    }
    return true;
  }
  parseSpecialAuthoritySlashes(c5) {
    if (c5 === p("/") && this.input[this.pointer + 1] === p("/")) {
      this.state = "special authority ignore slashes";
      ++this.pointer;
    } else {
      this.parseError = true;
      this.state = "special authority ignore slashes";
      --this.pointer;
    }
    return true;
  }
  parseSpecialAuthorityIgnoreSlashes(c5) {
    if (c5 !== p("/") && c5 !== p("\\")) {
      this.state = "authority";
      --this.pointer;
    } else {
      this.parseError = true;
    }
    return true;
  }
  parseAuthority(c5, cStr) {
    if (c5 === p("@")) {
      this.parseError = true;
      if (this.atFlag) {
        this.buffer = `%40${this.buffer}`;
      }
      this.atFlag = true;
      const len = countSymbols(this.buffer);
      for (let pointer = 0; pointer < len; ++pointer) {
        const codePoint = this.buffer.codePointAt(pointer);
        if (codePoint === p(":") && !this.passwordTokenSeenFlag) {
          this.passwordTokenSeenFlag = true;
          continue;
        }
        const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode);
        if (this.passwordTokenSeenFlag) {
          this.url.password += encodedCodePoints;
        } else {
          this.url.username += encodedCodePoints;
        }
      }
      this.buffer = "";
    } else if (isNaN(c5) || c5 === p("/") || c5 === p("?") || c5 === p("#") || isSpecial(this.url) && c5 === p("\\")) {
      if (this.atFlag && this.buffer === "") {
        this.parseError = true;
        return failure;
      }
      this.pointer -= countSymbols(this.buffer) + 1;
      this.buffer = "";
      this.state = "host";
    } else {
      this.buffer += cStr;
    }
    return true;
  }
  parseHostName(c5, cStr) {
    if (this.stateOverride && this.url.scheme === "file") {
      --this.pointer;
      this.state = "file host";
    } else if (c5 === p(":") && !this.arrFlag) {
      if (this.buffer === "") {
        this.parseError = true;
        return failure;
      }
      if (this.stateOverride === "hostname") {
        return false;
      }
      const host = parseHost(this.buffer, isNotSpecial(this.url));
      if (host === failure) {
        return failure;
      }
      this.url.host = host;
      this.buffer = "";
      this.state = "port";
    } else if (isNaN(c5) || c5 === p("/") || c5 === p("?") || c5 === p("#") || isSpecial(this.url) && c5 === p("\\")) {
      --this.pointer;
      if (isSpecial(this.url) && this.buffer === "") {
        this.parseError = true;
        return failure;
      } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) {
        this.parseError = true;
        return false;
      }
      const host = parseHost(this.buffer, isNotSpecial(this.url));
      if (host === failure) {
        return failure;
      }
      this.url.host = host;
      this.buffer = "";
      this.state = "path start";
      if (this.stateOverride) {
        return false;
      }
    } else {
      if (c5 === p("[")) {
        this.arrFlag = true;
      } else if (c5 === p("]")) {
        this.arrFlag = false;
      }
      this.buffer += cStr;
    }
    return true;
  }
  parsePort(c5, cStr) {
    if (isASCIIDigit(c5)) {
      this.buffer += cStr;
    } else if (isNaN(c5) || c5 === p("/") || c5 === p("?") || c5 === p("#") || isSpecial(this.url) && c5 === p("\\") || this.stateOverride) {
      if (this.buffer !== "") {
        const port = parseInt(this.buffer);
        if (port > 2 ** 16 - 1) {
          this.parseError = true;
          return failure;
        }
        this.url.port = port === defaultPort(this.url.scheme) ? null : port;
        this.buffer = "";
      }
      if (this.stateOverride) {
        return false;
      }
      this.state = "path start";
      --this.pointer;
    } else {
      this.parseError = true;
      return failure;
    }
    return true;
  }
  parseFile(c5) {
    this.url.scheme = "file";
    this.url.host = "";
    if (c5 === p("/") || c5 === p("\\")) {
      if (c5 === p("\\")) {
        this.parseError = true;
      }
      this.state = "file slash";
    } else if (this.base !== null && this.base.scheme === "file") {
      this.url.host = this.base.host;
      this.url.path = this.base.path.slice();
      this.url.query = this.base.query;
      if (c5 === p("?")) {
        this.url.query = "";
        this.state = "query";
      } else if (c5 === p("#")) {
        this.url.fragment = "";
        this.state = "fragment";
      } else if (!isNaN(c5)) {
        this.url.query = null;
        if (!startsWithWindowsDriveLetter(this.input, this.pointer)) {
          shortenPath(this.url);
        } else {
          this.parseError = true;
          this.url.path = [];
        }
        this.state = "path";
        --this.pointer;
      }
    } else {
      this.state = "path";
      --this.pointer;
    }
    return true;
  }
  parseFileSlash(c5) {
    if (c5 === p("/") || c5 === p("\\")) {
      if (c5 === p("\\")) {
        this.parseError = true;
      }
      this.state = "file host";
    } else {
      if (this.base !== null && this.base.scheme === "file") {
        if (!startsWithWindowsDriveLetter(this.input, this.pointer) && isNormalizedWindowsDriveLetterString(this.base.path[0])) {
          this.url.path.push(this.base.path[0]);
        }
        this.url.host = this.base.host;
      }
      this.state = "path";
      --this.pointer;
    }
    return true;
  }
  parseFileHost(c5, cStr) {
    if (isNaN(c5) || c5 === p("/") || c5 === p("\\") || c5 === p("?") || c5 === p("#")) {
      --this.pointer;
      if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {
        this.parseError = true;
        this.state = "path";
      } else if (this.buffer === "") {
        this.url.host = "";
        if (this.stateOverride) {
          return false;
        }
        this.state = "path start";
      } else {
        let host = parseHost(this.buffer, isNotSpecial(this.url));
        if (host === failure) {
          return failure;
        }
        if (host === "localhost") {
          host = "";
        }
        this.url.host = host;
        if (this.stateOverride) {
          return false;
        }
        this.buffer = "";
        this.state = "path start";
      }
    } else {
      this.buffer += cStr;
    }
    return true;
  }
  parsePathStart(c5) {
    if (isSpecial(this.url)) {
      if (c5 === p("\\")) {
        this.parseError = true;
      }
      this.state = "path";
      if (c5 !== p("/") && c5 !== p("\\")) {
        --this.pointer;
      }
    } else if (!this.stateOverride && c5 === p("?")) {
      this.url.query = "";
      this.state = "query";
    } else if (!this.stateOverride && c5 === p("#")) {
      this.url.fragment = "";
      this.state = "fragment";
    } else if (c5 !== void 0) {
      this.state = "path";
      if (c5 !== p("/")) {
        --this.pointer;
      }
    } else if (this.stateOverride && this.url.host === null) {
      this.url.path.push("");
    }
    return true;
  }
  parsePath(c5) {
    if (isNaN(c5) || c5 === p("/") || isSpecial(this.url) && c5 === p("\\") || !this.stateOverride && (c5 === p("?") || c5 === p("#"))) {
      if (isSpecial(this.url) && c5 === p("\\")) {
        this.parseError = true;
      }
      if (isDoubleDot(this.buffer)) {
        shortenPath(this.url);
        if (c5 !== p("/") && !(isSpecial(this.url) && c5 === p("\\"))) {
          this.url.path.push("");
        }
      } else if (isSingleDot(this.buffer) && c5 !== p("/") && !(isSpecial(this.url) && c5 === p("\\"))) {
        this.url.path.push("");
      } else if (!isSingleDot(this.buffer)) {
        if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {
          this.buffer = `${this.buffer[0]}:`;
        }
        this.url.path.push(this.buffer);
      }
      this.buffer = "";
      if (c5 === p("?")) {
        this.url.query = "";
        this.state = "query";
      }
      if (c5 === p("#")) {
        this.url.fragment = "";
        this.state = "fragment";
      }
    } else {
      if (c5 === p("%") && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
        this.parseError = true;
      }
      this.buffer += utf8PercentEncodeCodePoint(c5, isPathPercentEncode);
    }
    return true;
  }
  parseOpaquePath(c5) {
    if (c5 === p("?")) {
      this.url.query = "";
      this.state = "query";
    } else if (c5 === p("#")) {
      this.url.fragment = "";
      this.state = "fragment";
    } else {
      if (!isNaN(c5) && c5 !== p("%")) {
        this.parseError = true;
      }
      if (c5 === p("%") && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
        this.parseError = true;
      }
      if (!isNaN(c5)) {
        this.url.path += utf8PercentEncodeCodePoint(c5, isC0ControlPercentEncode);
      }
    }
    return true;
  }
  parseQuery(c5, cStr) {
    if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") {
      this.encodingOverride = "utf-8";
    }
    if (!this.stateOverride && c5 === p("#") || isNaN(c5)) {
      const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode;
      this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate);
      this.buffer = "";
      if (c5 === p("#")) {
        this.url.fragment = "";
        this.state = "fragment";
      }
    } else if (!isNaN(c5)) {
      if (c5 === p("%") && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
        this.parseError = true;
      }
      this.buffer += cStr;
    }
    return true;
  }
  parseFragment(c5) {
    if (!isNaN(c5)) {
      if (c5 === p("%") && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) {
        this.parseError = true;
      }
      this.url.fragment += utf8PercentEncodeCodePoint(c5, isFragmentPercentEncode);
    }
    return true;
  }
};
var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([p("/"), p("\\"), p("?"), p("#")]);
function startsWithWindowsDriveLetter(input, pointer) {
  const length = input.length - pointer;
  return length >= 2 && isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2]));
}
function serializeURL(url, excludeFragment) {
  let output = `${url.scheme}:`;
  if (url.host !== null) {
    output += "//";
    if (url.username !== "" || url.password !== "") {
      output += url.username;
      if (url.password !== "") {
        output += `:${url.password}`;
      }
      output += "@";
    }
    output += serializeHost(url.host);
    if (url.port !== null) {
      output += `:${url.port}`;
    }
  }
  if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") {
    output += "/.";
  }
  output += serializePath(url);
  if (url.query !== null) {
    output += `?${url.query}`;
  }
  if (!excludeFragment && url.fragment !== null) {
    output += `#${url.fragment}`;
  }
  return output;
}
function serializeOrigin(tuple) {
  let result = `${tuple.scheme}://`;
  result += serializeHost(tuple.host);
  if (tuple.port !== null) {
    result += `:${tuple.port}`;
  }
  return result;
}
function serializePath(url) {
  if (typeof url.path === "string") {
    return url.path;
  }
  let output = "";
  for (const segment of url.path) {
    output += `/${segment}`;
  }
  return output;
}
function serializeURLOrigin(url) {
  switch (url.scheme) {
    case "blob":
      try {
        return serializeURLOrigin(parseURL(serializePath(url)));
      } catch (e5) {
        return "null";
      }
    case "ftp":
    case "http":
    case "https":
    case "ws":
    case "wss":
      return serializeOrigin({
        scheme: url.scheme,
        host: url.host,
        port: url.port
      });
    case "file":
      return "null";
    default:
      return "null";
  }
}
function basicURLParse(input, options) {
  if (options === void 0) {
    options = {};
  }
  const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
  if (usm.failure) {
    return null;
  }
  return usm.url;
}
function setTheUsername(url, username) {
  url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode);
}
function setThePassword(url, password) {
  url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
}
function serializeInteger(integer) {
  return String(integer);
}
function parseURL(input, options) {
  if (options === void 0) {
    options = {};
  }
  return basicURLParse(input, {
    baseURL: options.baseURL,
    encodingOverride: options.encodingOverride
  });
}
var NativeURL = typeof URL !== "undefined" ? URL : void 0;
var URLImpl = class {
  //Include URL type for "url" and "base" params.
  constructor(url, base2) {
    let parsedBase = null;
    if (base2 !== void 0) {
      if (base2 instanceof URL) {
        base2 = base2.href;
      }
      parsedBase = basicURLParse(base2);
      if (parsedBase === null) {
        throw new TypeError(`Invalid base URL: ${base2}`);
      }
    }
    if (url instanceof URL) {
      url = url.href;
    }
    const parsedURL = basicURLParse(url, { baseURL: parsedBase });
    if (parsedURL === null) {
      throw new TypeError(`Invalid URL: ${url}`);
    }
    const query = parsedURL.query !== null ? parsedURL.query : "";
    this._url = parsedURL;
    this._query = new URLSearchParamsImpl(query, {
      doNotStripQMark: true
    });
    this._query._url = this;
  }
  get href() {
    return serializeURL(this._url);
  }
  set href(v3) {
    const parsedURL = basicURLParse(v3);
    if (parsedURL === null) {
      throw new TypeError(`Invalid URL: ${v3}`);
    }
    this._url = parsedURL;
    this._query._list.splice(0);
    const { query } = parsedURL;
    if (query !== null) {
      this._query._list = parseUrlencodedString(query);
    }
  }
  get origin() {
    return serializeURLOrigin(this._url);
  }
  get protocol() {
    return `${this._url.scheme}:`;
  }
  set protocol(v3) {
    basicURLParse(`${v3}:`, {
      url: this._url,
      stateOverride: "scheme start"
    });
  }
  get username() {
    return this._url.username;
  }
  set username(v3) {
    if (cannotHaveAUsernamePasswordPort(this._url)) {
      return;
    }
    setTheUsername(this._url, v3);
  }
  get password() {
    return this._url.password;
  }
  set password(v3) {
    if (cannotHaveAUsernamePasswordPort(this._url)) {
      return;
    }
    setThePassword(this._url, v3);
  }
  get host() {
    const url = this._url;
    if (url.host === null) {
      return "";
    }
    if (url.port === null) {
      return serializeHost(url.host);
    }
    return `${serializeHost(url.host)}:${serializeInteger(url.port)}`;
  }
  set host(v3) {
    if (hasAnOpaquePath(this._url)) {
      return;
    }
    basicURLParse(v3, { url: this._url, stateOverride: "host" });
  }
  get hostname() {
    if (this._url.host === null) {
      return "";
    }
    return serializeHost(this._url.host);
  }
  set hostname(v3) {
    if (hasAnOpaquePath(this._url)) {
      return;
    }
    basicURLParse(v3, { url: this._url, stateOverride: "hostname" });
  }
  get port() {
    if (this._url.port === null) {
      return "";
    }
    return serializeInteger(this._url.port);
  }
  set port(v3) {
    if (cannotHaveAUsernamePasswordPort(this._url)) {
      return;
    }
    if (v3 === "") {
      this._url.port = null;
    } else {
      basicURLParse(v3, { url: this._url, stateOverride: "port" });
    }
  }
  get pathname() {
    return serializePath(this._url);
  }
  set pathname(v3) {
    if (hasAnOpaquePath(this._url)) {
      return;
    }
    this._url.path = [];
    basicURLParse(v3, { url: this._url, stateOverride: "path start" });
  }
  get search() {
    if (this._url.query === null || this._url.query === "") {
      return "";
    }
    return `?${this._url.query}`;
  }
  set search(v3) {
    const url = this._url;
    if (v3 === "") {
      url.query = null;
      this._query._list = [];
      return;
    }
    const input = v3[0] === "?" ? v3.substring(1) : v3;
    url.query = "";
    basicURLParse(input, { url, stateOverride: "query" });
    this._query._list = parseUrlencodedString(input);
  }
  get searchParams() {
    return this._query;
  }
  get hash() {
    if (this._url.fragment === null || this._url.fragment === "") {
      return "";
    }
    return `#${this._url.fragment}`;
  }
  set hash(v3) {
    if (v3 === "") {
      this._url.fragment = null;
      return;
    }
    const input = v3[0] === "#" ? v3.substring(1) : v3;
    this._url.fragment = "";
    basicURLParse(input, { url: this._url, stateOverride: "fragment" });
  }
  toJSON() {
    return this.href;
  }
  static createObjectURL(blob) {
    if (!NativeURL)
      throw new Error("This method requires a native implementation, which does not exist");
    return NativeURL.createObjectURL(blob);
  }
  static revokeObjectURL(url) {
    if (!NativeURL)
      throw new Error("This method requires a native implementation, which does not exist");
    return NativeURL.revokeObjectURL(url);
  }
};

// ../taler-util/lib/url.js
(function() {
  if (typeof globalThis === "object")
    return;
  Object.defineProperty(Object.prototype, "__magic__", {
    get: function() {
      return this;
    },
    configurable: true
    // This makes it possible to `delete` the getter later.
  });
  __magic__.globalThis = __magic__;
  delete Object.prototype.__magic__;
})();
var useOwnUrlImp = true;
var _URL = globalThis.URL;
if (useOwnUrlImp || !_URL) {
  globalThis.URL = _URL = URLImpl;
  _URL = URLImpl;
}
var URL2 = _URL;
var _URLSearchParams = globalThis.URLSearchParams;
if (useOwnUrlImp || !_URLSearchParams) {
  globalThis.URLSearchParams = URLSearchParamsImpl;
  _URLSearchParams = URLSearchParamsImpl;
}
var URLSearchParams2 = _URLSearchParams;

// ../taler-util/lib/helpers.js
function canonicalizeBaseUrl(url) {
  if (!url.startsWith("http") && !url.startsWith("https")) {
    url = "https://" + url;
  }
  const x6 = new URL2(url);
  if (!x6.pathname.endsWith("/")) {
    x6.pathname = x6.pathname + "/";
  }
  x6.search = "";
  x6.hash = "";
  return x6.href;
}
function canonicalJson(obj) {
  obj = JSON.parse(JSON.stringify(obj));
  if (typeof obj === "string") {
    return JSON.stringify(obj);
  }
  if (typeof obj === "number" || typeof obj === "boolean" || obj === null) {
    return JSON.stringify(obj);
  }
  if (Array.isArray(obj)) {
    const objs = obj.map((e5) => canonicalJson(e5));
    return `[${objs.join(",")}]`;
  }
  const keys = [];
  for (const key in obj) {
    keys.push(key);
  }
  keys.sort();
  let s6 = "{";
  for (let i5 = 0; i5 < keys.length; i5++) {
    const key = keys[i5];
    s6 += JSON.stringify(key) + ":" + canonicalJson(obj[key]);
    if (i5 !== keys.length - 1) {
      s6 += ",";
    }
  }
  return s6 + "}";
}
function strcmp(s1, s23) {
  if (s1 < s23) {
    return -1;
  }
  if (s1 > s23) {
    return 1;
  }
  return 0;
}
function j2s(x6) {
  return JSON.stringify(x6, void 0, 2);
}

// ../taler-util/lib/logging.js
var isNode = typeof process !== "undefined" && typeof process.release !== "undefined" && process.release.name === "node";
var LogLevel;
(function(LogLevel2) {
  LogLevel2["Trace"] = "trace";
  LogLevel2["Message"] = "message";
  LogLevel2["Info"] = "info";
  LogLevel2["Warn"] = "warn";
  LogLevel2["Error"] = "error";
  LogLevel2["None"] = "none";
})(LogLevel || (LogLevel = {}));
var globalLogLevel = LogLevel.Info;
var byTagLogLevel = {};
var nativeLogging = false;
Error.prototype.toString = function() {
  if (this === null || typeof this !== "object" && typeof this !== "function") {
    throw new TypeError();
  }
  let name = this.name;
  name = name === void 0 ? "Error" : `${name}`;
  let msg = this.message;
  msg = msg === void 0 ? "" : `${msg}`;
  let cause = "";
  if ("cause" in this) {
    cause = `
 Caused by: ${this.cause}`;
  }
  return `${name}: ${msg}${cause}`;
};
function writeNativeLog(message, tag, level, args) {
  const logFn = globalThis.__nativeLog;
  if (logFn) {
    let m6;
    if (args.length == 0) {
      m6 = message;
    } else {
      m6 = message + " " + args.toString();
    }
    logFn(level, tag, message);
  }
}
function writeNodeLog(message, tag, level, args) {
  try {
    let msg = `${(/* @__PURE__ */ new Date()).toISOString()} ${tag} ${level} ${message}`;
    if (args.length != 0) {
      msg += ` ${JSON.stringify(args, void 0, 2)}
`;
    } else {
      msg += `
`;
    }
    process.stderr.write(msg);
  } catch (e5) {
    let msg = `${(/* @__PURE__ */ new Date()).toISOString()} (logger) FATAL `;
    if (e5 instanceof Error) {
      msg += `failed to write log: ${e5.message}
`;
    } else {
      msg += "failed to write log\n";
    }
    process.stderr.write(msg);
  }
}
var Logger = class {
  constructor(tag) {
    this.tag = tag;
  }
  getGlobalLogLevel() {
    return globalLogLevel;
  }
  shouldLogTrace() {
    const level = byTagLogLevel[this.tag] ?? globalLogLevel;
    switch (level) {
      case LogLevel.Trace:
        return true;
      case LogLevel.Message:
      case LogLevel.Info:
      case LogLevel.Warn:
      case LogLevel.Error:
      case LogLevel.None:
        return false;
    }
  }
  shouldLogInfo() {
    const level = byTagLogLevel[this.tag] ?? globalLogLevel;
    switch (level) {
      case LogLevel.Trace:
      case LogLevel.Message:
      case LogLevel.Info:
        return true;
      case LogLevel.Warn:
      case LogLevel.Error:
      case LogLevel.None:
        return false;
    }
  }
  shouldLogWarn() {
    const level = byTagLogLevel[this.tag] ?? globalLogLevel;
    switch (level) {
      case LogLevel.Trace:
      case LogLevel.Message:
      case LogLevel.Info:
      case LogLevel.Warn:
        return true;
      case LogLevel.Error:
      case LogLevel.None:
        return false;
    }
  }
  shouldLogError() {
    const level = byTagLogLevel[this.tag] ?? globalLogLevel;
    switch (level) {
      case LogLevel.Trace:
      case LogLevel.Message:
      case LogLevel.Info:
      case LogLevel.Warn:
      case LogLevel.Error:
        return true;
      case LogLevel.None:
        return false;
    }
  }
  info(message, ...args) {
    if (!this.shouldLogInfo()) {
      return;
    }
    if (nativeLogging) {
      writeNativeLog(message, this.tag, 2, args);
      return;
    }
    if (isNode) {
      writeNodeLog(message, this.tag, "INFO", args);
    } else {
      console.info(`${(/* @__PURE__ */ new Date()).toISOString()} ${this.tag} INFO ` + message, ...args);
    }
  }
  warn(message, ...args) {
    if (!this.shouldLogWarn()) {
      return;
    }
    if (nativeLogging) {
      writeNativeLog(message, this.tag, 3, args);
      return;
    }
    if (isNode) {
      writeNodeLog(message, this.tag, "WARN", args);
    } else {
      console.warn(`${(/* @__PURE__ */ new Date()).toISOString()} ${this.tag} INFO ` + message, ...args);
    }
  }
  error(message, ...args) {
    if (!this.shouldLogError()) {
      return;
    }
    if (nativeLogging) {
      writeNativeLog(message, this.tag, 4, args);
      return;
    }
    if (isNode) {
      writeNodeLog(message, this.tag, "ERROR", args);
    } else {
      console.info(`${(/* @__PURE__ */ new Date()).toISOString()} ${this.tag} ERROR ` + message, ...args);
    }
  }
  trace(message, ...args) {
    if (!this.shouldLogTrace()) {
      return;
    }
    if (nativeLogging) {
      writeNativeLog(message, this.tag, 1, args);
      return;
    }
    if (isNode) {
      writeNodeLog(message, this.tag, "TRACE", args);
    } else {
      console.info(`${(/* @__PURE__ */ new Date()).toISOString()} ${this.tag} TRACE ` + message, ...args);
    }
  }
  reportBreak() {
    if (!this.shouldLogError()) {
      return;
    }
    const location2 = new Error("programming error");
    this.error(`assertion failed: ${location2.stack}`);
  }
};

// ../taler-util/lib/codec.js
var logger = new Logger("codec.ts");
var DecodingError = class _DecodingError extends Error {
  constructor(message) {
    super(message);
    Object.setPrototypeOf(this, _DecodingError.prototype);
    this.name = "DecodingError";
  }
};
function renderContext(c5) {
  const p4 = c5?.path;
  if (p4) {
    return p4.join(".");
  } else {
    return "(unknown)";
  }
}
function joinContext(c5, part) {
  const path = c5?.path ?? [];
  return {
    path: path.concat([part])
  };
}
var ObjectCodecBuilder = class {
  constructor() {
    this.propList = [];
    this.deprecatedProps = /* @__PURE__ */ new Set();
    this._allowExtra = false;
  }
  /**
   * Define a property for the object.
   */
  property(x6, codec) {
    if (!codec) {
      throw Error("inner codec must be defined");
    }
    this.propList.push({ name: x6, codec });
    return this;
  }
  /**
   * Define a property for the object.
   */
  propertyStrict(x6, codec) {
    if (!codec) {
      throw Error("inner codec must be defined");
    }
    this.propList.push({ name: x6, codec });
    return this;
  }
  /**
   * Concatenate properties from @a codec.
   *
   * @param other codec to concat properties from
   *
   * FIXME: do proper union of all `other' props.
   */
  mixin(other) {
    this.propList.push(...other.getProps());
    return this;
  }
  /**
   * Define a deprecated property for the object.
   *
   * Deprecated properties won't be validated, their presence will
   * be validated in TRACE mode.
   */
  deprecatedProperty(x6) {
    this.deprecatedProps.add(x6);
    return this;
  }
  /**
   * Do not log warnings if the object has extra properties.
   */
  allowExtra() {
    this._allowExtra = true;
    return this;
  }
  /**
   * Return the built codec.
   *
   * @param objectDisplayName name of the object that this codec operates on,
   *   used in error messages.
   */
  build(objectDisplayName) {
    const propList = this.propList;
    const allowExtra = this._allowExtra;
    const deprecatedPros = this.deprecatedProps;
    return {
      decode(x6, c5) {
        if (!c5) {
          c5 = {
            path: [`(${objectDisplayName})`]
          };
        }
        if (typeof x6 !== "object") {
          throw new DecodingError(`expected object for ${objectDisplayName} at ${renderContext(c5)} but got ${typeof x6}`);
        }
        const obj = {};
        for (const prop of propList) {
          const propRawVal = x6[prop.name];
          const propVal = prop.codec.decode(propRawVal, joinContext(c5, prop.name));
          obj[prop.name] = propVal;
        }
        for (const prop in x6) {
          if (prop in obj) {
            continue;
          }
          if (allowExtra) {
            obj[prop] = x6[prop];
          } else if (deprecatedPros.has(prop)) {
            logger.trace(`Deprecated property ${prop} for ${objectDisplayName} at ${renderContext(c5)}`);
          } else {
            logger.warn(`Extra property ${prop} for ${objectDisplayName} at ${renderContext(c5)}`);
          }
        }
        return obj;
      },
      getProps() {
        return propList;
      }
    };
  }
};
var UnionCodecBuilder = class {
  constructor(discriminator, baseCodec) {
    this.discriminator = discriminator;
    this.baseCodec = baseCodec;
    this.alternatives = /* @__PURE__ */ new Map();
  }
  /**
   * Define a property for the object.
   */
  alternative(tagValue, codec) {
    if (!codec) {
      throw Error("inner codec must be defined");
    }
    this.alternatives.set(tagValue, { codec, tagValue });
    return this;
  }
  /**
   * Return the built codec.
   *
   * @param objectDisplayName name of the object that this codec operates on,
   *   used in error messages.
   */
  build(objectDisplayName) {
    const alternatives = this.alternatives;
    const discriminator = this.discriminator;
    const baseCodec = this.baseCodec;
    return {
      decode(x6, c5) {
        if (!c5) {
          c5 = {
            path: [`(${objectDisplayName})`]
          };
        }
        const d6 = x6[discriminator];
        if (d6 === void 0 && !alternatives.has(d6)) {
          throw new DecodingError(`expected tag for ${objectDisplayName} at ${renderContext(c5)}.${String(discriminator)}`);
        }
        const alt = alternatives.get(d6);
        if (!alt) {
          throw new DecodingError(`unknown tag for ${objectDisplayName} ${d6} at ${renderContext(c5)}.${String(discriminator)}`);
        }
        const altDecoded = alt.codec.decode(x6);
        if (baseCodec) {
          const baseDecoded = baseCodec.decode(x6, c5);
          return { ...baseDecoded, ...altDecoded };
        } else {
          return altDecoded;
        }
      }
    };
  }
};
var UnionCodecPreBuilder = class {
  discriminateOn(discriminator, baseCodec) {
    return new UnionCodecBuilder(discriminator, baseCodec);
  }
};
function buildCodecForObject() {
  return new ObjectCodecBuilder();
}
function buildCodecForUnion() {
  return new UnionCodecPreBuilder();
}
function codecForMap(innerCodec) {
  if (!innerCodec) {
    throw Error("inner codec must be defined");
  }
  return {
    decode(x6, c5) {
      const map3 = {};
      if (typeof x6 !== "object") {
        throw new DecodingError(`expected object at ${renderContext(c5)}`);
      }
      for (const i5 in x6) {
        map3[i5] = innerCodec.decode(x6[i5], joinContext(c5, `[${i5}]`));
      }
      return map3;
    }
  };
}
function codecForList(innerCodec) {
  if (!innerCodec) {
    throw Error("inner codec must be defined");
  }
  return {
    decode(x6, c5) {
      const arr = [];
      if (!Array.isArray(x6)) {
        throw new DecodingError(`expected array at ${renderContext(c5)}`);
      }
      for (const i5 in x6) {
        arr.push(innerCodec.decode(x6[i5], joinContext(c5, `[${i5}]`)));
      }
      return arr;
    }
  };
}
function codecForNumber() {
  return {
    decode(x6, c5) {
      if (typeof x6 === "number") {
        return x6;
      }
      throw new DecodingError(`expected number at ${renderContext(c5)} but got ${typeof x6}`);
    }
  };
}
function codecForBoolean() {
  return {
    decode(x6, c5) {
      if (typeof x6 === "boolean") {
        return x6;
      }
      throw new DecodingError(`expected boolean at ${renderContext(c5)} but got ${typeof x6}`);
    }
  };
}
function codecForString() {
  return {
    decode(x6, c5) {
      if (typeof x6 === "string") {
        return x6;
      }
      throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
    }
  };
}
function codecForStringURL(shouldEndWithSlash) {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (shouldEndWithSlash && !x6.endsWith("/")) {
        throw new DecodingError(`expected URL string that ends with slash at ${renderContext(c5)} but got ${x6}`);
      }
      try {
        const url = new URL(x6);
        return x6;
      } catch (e5) {
        if (e5 instanceof Error) {
          throw new DecodingError(e5.message);
        } else {
          throw new DecodingError(`expected an URL string at ${renderContext(c5)} but got "${x6}"`);
        }
      }
    }
  };
}
function codecForURL(shouldEndWithSlash) {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (shouldEndWithSlash && !x6.endsWith("/")) {
        throw new DecodingError(`expected URL string that ends with slash at ${renderContext(c5)} but got ${x6}`);
      }
      try {
        const url = new URL(x6);
        return url;
      } catch (e5) {
        if (e5 instanceof Error) {
          throw new DecodingError(e5.message);
        } else {
          throw new DecodingError(`expected an URL string at ${renderContext(c5)} but got "${x6}"`);
        }
      }
    }
  };
}
function codecForAny() {
  return {
    decode(x6, c5) {
      return x6;
    }
  };
}
function codecForConstString(s6) {
  return {
    decode(x6, c5) {
      if (x6 === s6) {
        return x6;
      }
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string constant "${s6}" at ${renderContext(c5)} but got ${typeof x6}`);
      }
      throw new DecodingError(`expected string constant "${s6}" at ${renderContext(c5)} but got string value "${x6}"`);
    }
  };
}
function codecForConstNumber(n2) {
  return {
    decode(x6, c5) {
      if (x6 === n2) {
        return x6;
      }
      throw new DecodingError(`expected number constant "${n2}" at ${renderContext(c5)}  but got ${typeof x6}`);
    }
  };
}
function codecOptional(innerCodec) {
  return {
    decode(x6, c5) {
      if (x6 === void 0 || x6 === null) {
        return void 0;
      }
      return innerCodec.decode(x6, c5);
    }
  };
}
function codecOptionalDefault(innerCodec, def) {
  return {
    decode(x6, c5) {
      if (x6 === void 0 || x6 === null) {
        return def;
      }
      return innerCodec.decode(x6, c5);
    }
  };
}
function codecForEither(...alts) {
  return {
    decode(x6, c5) {
      for (const alt of alts) {
        try {
          return alt.decode(x6, c5);
        } catch (e5) {
          continue;
        }
      }
      if (logger.shouldLogTrace()) {
        logger.trace(`offending value: ${j2s(x6)}`);
      }
      throw new DecodingError(`No alternative matched at ${renderContext(c5)}`);
    }
  };
}

// ../taler-util/lib/errors.js
function makeErrorDetail(code, detail, hint) {
  if (!hint && !detail.hint) {
    hint = getDefaultTalerErrorHint(code);
  }
  const when = AbsoluteTime.now();
  return { code, when, hint, ...detail };
}
function getDefaultTalerErrorHint(code) {
  const errName = TalerErrorCode[code];
  if (errName) {
    return `Error (${errName})`;
  } else {
    return `Error (<unknown>)`;
  }
}
var TalerError = class _TalerError extends Error {
  constructor(d6, cause) {
    super(d6.hint ?? `Error (code ${d6.code})`);
    this.errorDetail = d6;
    this.cause = cause;
    Object.setPrototypeOf(this, _TalerError.prototype);
  }
  static fromDetail(code, detail, hint, cause) {
    if (!hint) {
      hint = getDefaultTalerErrorHint(code);
    }
    const when = AbsoluteTime.now();
    return new _TalerError({ code, when, hint, ...detail }, cause);
  }
  static fromUncheckedDetail(d6, c5) {
    return new _TalerError({ ...d6 }, c5);
  }
  static fromException(e5) {
    const errDetail = getErrorDetailFromException(e5);
    return new _TalerError(errDetail, e5);
  }
  hasErrorCode(code) {
    return this.errorDetail.code === code;
  }
  toString() {
    return `TalerError: ${JSON.stringify(this.errorDetail)}`;
  }
};
function getErrorDetailFromException(e5) {
  if (e5 instanceof TalerError) {
    return e5.errorDetail;
  }
  if (e5 instanceof CancellationToken.CancellationError) {
    const err2 = makeErrorDetail(TalerErrorCode.WALLET_CORE_REQUEST_CANCELLED, {});
    return err2;
  }
  if (e5 instanceof Error) {
    const err2 = makeErrorDetail(TalerErrorCode.WALLET_UNEXPECTED_EXCEPTION, {
      stack: e5.stack
    }, `unexpected exception (message: ${e5.message})`);
    return err2;
  }
  let excString;
  try {
    excString = e5.toString();
  } catch (e6) {
    excString = "can't stringify exception";
  }
  const err = makeErrorDetail(TalerErrorCode.WALLET_UNEXPECTED_EXCEPTION, {}, `unexpected exception (not an exception, ${excString})`);
  return err;
}
function assertUnreachable(x6) {
  throw new Error("Didn't expect to get here");
}

// ../taler-util/lib/taler-error-codes.js
var TalerErrorCode;
(function(TalerErrorCode2) {
  TalerErrorCode2[TalerErrorCode2["NONE"] = 0] = "NONE";
  TalerErrorCode2[TalerErrorCode2["INVALID"] = 1] = "INVALID";
  TalerErrorCode2[TalerErrorCode2["GENERIC_CLIENT_INTERNAL_ERROR"] = 2] = "GENERIC_CLIENT_INTERNAL_ERROR";
  TalerErrorCode2[TalerErrorCode2["GENERIC_CLIENT_UNSUPPORTED_PROTOCOL_VERSION"] = 3] = "GENERIC_CLIENT_UNSUPPORTED_PROTOCOL_VERSION";
  TalerErrorCode2[TalerErrorCode2["GENERIC_INVALID_RESPONSE"] = 10] = "GENERIC_INVALID_RESPONSE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_TIMEOUT"] = 11] = "GENERIC_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["GENERIC_VERSION_MALFORMED"] = 12] = "GENERIC_VERSION_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_REPLY_MALFORMED"] = 13] = "GENERIC_REPLY_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_CONFIGURATION_INVALID"] = 14] = "GENERIC_CONFIGURATION_INVALID";
  TalerErrorCode2[TalerErrorCode2["GENERIC_UNEXPECTED_REQUEST_ERROR"] = 15] = "GENERIC_UNEXPECTED_REQUEST_ERROR";
  TalerErrorCode2[TalerErrorCode2["GENERIC_TOKEN_PERMISSION_INSUFFICIENT"] = 16] = "GENERIC_TOKEN_PERMISSION_INSUFFICIENT";
  TalerErrorCode2[TalerErrorCode2["GENERIC_METHOD_INVALID"] = 20] = "GENERIC_METHOD_INVALID";
  TalerErrorCode2[TalerErrorCode2["GENERIC_ENDPOINT_UNKNOWN"] = 21] = "GENERIC_ENDPOINT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["GENERIC_JSON_INVALID"] = 22] = "GENERIC_JSON_INVALID";
  TalerErrorCode2[TalerErrorCode2["GENERIC_HTTP_HEADERS_MALFORMED"] = 23] = "GENERIC_HTTP_HEADERS_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_PAYTO_URI_MALFORMED"] = 24] = "GENERIC_PAYTO_URI_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_PARAMETER_MISSING"] = 25] = "GENERIC_PARAMETER_MISSING";
  TalerErrorCode2[TalerErrorCode2["GENERIC_PARAMETER_MALFORMED"] = 26] = "GENERIC_PARAMETER_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_RESERVE_PUB_MALFORMED"] = 27] = "GENERIC_RESERVE_PUB_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_COMPRESSION_INVALID"] = 28] = "GENERIC_COMPRESSION_INVALID";
  TalerErrorCode2[TalerErrorCode2["GENERIC_PATH_SEGMENT_MALFORMED"] = 29] = "GENERIC_PATH_SEGMENT_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_CURRENCY_MISMATCH"] = 30] = "GENERIC_CURRENCY_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["GENERIC_URI_TOO_LONG"] = 31] = "GENERIC_URI_TOO_LONG";
  TalerErrorCode2[TalerErrorCode2["GENERIC_UPLOAD_EXCEEDS_LIMIT"] = 32] = "GENERIC_UPLOAD_EXCEEDS_LIMIT";
  TalerErrorCode2[TalerErrorCode2["GENERIC_UNAUTHORIZED"] = 40] = "GENERIC_UNAUTHORIZED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_TOKEN_UNKNOWN"] = 41] = "GENERIC_TOKEN_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["GENERIC_TOKEN_EXPIRED"] = 42] = "GENERIC_TOKEN_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_TOKEN_MALFORMED"] = 43] = "GENERIC_TOKEN_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FORBIDDEN"] = 44] = "GENERIC_FORBIDDEN";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_SETUP_FAILED"] = 50] = "GENERIC_DB_SETUP_FAILED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_START_FAILED"] = 51] = "GENERIC_DB_START_FAILED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_STORE_FAILED"] = 52] = "GENERIC_DB_STORE_FAILED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_FETCH_FAILED"] = 53] = "GENERIC_DB_FETCH_FAILED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_COMMIT_FAILED"] = 54] = "GENERIC_DB_COMMIT_FAILED";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_SOFT_FAILURE"] = 55] = "GENERIC_DB_SOFT_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_DB_INVARIANT_FAILURE"] = 56] = "GENERIC_DB_INVARIANT_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_INTERNAL_INVARIANT_FAILURE"] = 60] = "GENERIC_INTERNAL_INVARIANT_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FAILED_COMPUTE_JSON_HASH"] = 61] = "GENERIC_FAILED_COMPUTE_JSON_HASH";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FAILED_COMPUTE_AMOUNT"] = 62] = "GENERIC_FAILED_COMPUTE_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["GENERIC_PARSER_OUT_OF_MEMORY"] = 70] = "GENERIC_PARSER_OUT_OF_MEMORY";
  TalerErrorCode2[TalerErrorCode2["GENERIC_ALLOCATION_FAILURE"] = 71] = "GENERIC_ALLOCATION_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_JSON_ALLOCATION_FAILURE"] = 72] = "GENERIC_JSON_ALLOCATION_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_CURL_ALLOCATION_FAILURE"] = 73] = "GENERIC_CURL_ALLOCATION_FAILURE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FAILED_TO_LOAD_TEMPLATE"] = 74] = "GENERIC_FAILED_TO_LOAD_TEMPLATE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FAILED_TO_EXPAND_TEMPLATE"] = 75] = "GENERIC_FAILED_TO_EXPAND_TEMPLATE";
  TalerErrorCode2[TalerErrorCode2["GENERIC_FEATURE_NOT_IMPLEMENTED"] = 76] = "GENERIC_FEATURE_NOT_IMPLEMENTED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_BAD_CONFIGURATION"] = 1e3] = "EXCHANGE_GENERIC_BAD_CONFIGURATION";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_OPERATION_UNKNOWN"] = 1001] = "EXCHANGE_GENERIC_OPERATION_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_WRONG_NUMBER_OF_SEGMENTS"] = 1002] = "EXCHANGE_GENERIC_WRONG_NUMBER_OF_SEGMENTS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY"] = 1003] = "EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_COINS_INVALID_COIN_PUB"] = 1004] = "EXCHANGE_GENERIC_COINS_INVALID_COIN_PUB";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN"] = 1005] = "EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DENOMINATION_SIGNATURE_INVALID"] = 1006] = "EXCHANGE_DENOMINATION_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KEYS_MISSING"] = 1007] = "EXCHANGE_GENERIC_KEYS_MISSING";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE"] = 1008] = "EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_DENOMINATION_EXPIRED"] = 1009] = "EXCHANGE_GENERIC_DENOMINATION_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_DENOMINATION_REVOKED"] = 1010] = "EXCHANGE_GENERIC_DENOMINATION_REVOKED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_SECMOD_TIMEOUT"] = 1011] = "EXCHANGE_GENERIC_SECMOD_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_INSUFFICIENT_FUNDS"] = 1012] = "EXCHANGE_GENERIC_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_COIN_HISTORY_COMPUTATION_FAILED"] = 1013] = "EXCHANGE_GENERIC_COIN_HISTORY_COMPUTATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS"] = 1014] = "EXCHANGE_GENERIC_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH"] = 1015] = "EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_INVALID_DENOMINATION_CIPHER_FOR_OPERATION"] = 1016] = "EXCHANGE_GENERIC_INVALID_DENOMINATION_CIPHER_FOR_OPERATION";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_CIPHER_MISMATCH"] = 1017] = "EXCHANGE_GENERIC_CIPHER_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_NEW_DENOMS_ARRAY_SIZE_EXCESSIVE"] = 1018] = "EXCHANGE_GENERIC_NEW_DENOMS_ARRAY_SIZE_EXCESSIVE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_COIN_UNKNOWN"] = 1019] = "EXCHANGE_GENERIC_COIN_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_CLOCK_SKEW"] = 1020] = "EXCHANGE_GENERIC_CLOCK_SKEW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AMOUNT_EXCEEDS_DENOMINATION_VALUE"] = 1021] = "EXCHANGE_GENERIC_AMOUNT_EXCEEDS_DENOMINATION_VALUE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_GLOBAL_FEES_MISSING"] = 1022] = "EXCHANGE_GENERIC_GLOBAL_FEES_MISSING";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_WIRE_FEES_MISSING"] = 1023] = "EXCHANGE_GENERIC_WIRE_FEES_MISSING";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PURSE_PUB_MALFORMED"] = 1024] = "EXCHANGE_GENERIC_PURSE_PUB_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PURSE_UNKNOWN"] = 1025] = "EXCHANGE_GENERIC_PURSE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PURSE_EXPIRED"] = 1026] = "EXCHANGE_GENERIC_PURSE_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_RESERVE_UNKNOWN"] = 1027] = "EXCHANGE_GENERIC_RESERVE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_REQUIRED"] = 1028] = "EXCHANGE_GENERIC_KYC_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT"] = 1029] = "EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE"] = 1030] = "EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PURSE_DELETED"] = 1031] = "EXCHANGE_GENERIC_PURSE_DELETED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_OFFICER_PUB_MALFORMED"] = 1032] = "EXCHANGE_GENERIC_AML_OFFICER_PUB_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_OFFICER_GET_SIGNATURE_INVALID"] = 1033] = "EXCHANGE_GENERIC_AML_OFFICER_GET_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_OFFICER_ACCESS_DENIED"] = 1034] = "EXCHANGE_GENERIC_AML_OFFICER_ACCESS_DENIED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_PENDING"] = 1035] = "EXCHANGE_GENERIC_AML_PENDING";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_FROZEN"] = 1036] = "EXCHANGE_GENERIC_AML_FROZEN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_CONVERTER_FAILED"] = 1037] = "EXCHANGE_GENERIC_KYC_CONVERTER_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_FAILED"] = 1038] = "EXCHANGE_GENERIC_KYC_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_FALLBACK_FAILED"] = 1039] = "EXCHANGE_GENERIC_KYC_FALLBACK_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_FALLBACK_UNKNOWN"] = 1040] = "EXCHANGE_GENERIC_KYC_FALLBACK_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_BANK_ACCOUNT_UNKNOWN"] = 1041] = "EXCHANGE_GENERIC_BANK_ACCOUNT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_AML_PROGRAM_RECURSION_DETECTED"] = 1042] = "EXCHANGE_GENERIC_AML_PROGRAM_RECURSION_DETECTED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_KYC_SANCTION_LIST_CHECK_FAILED"] = 1043] = "EXCHANGE_GENERIC_KYC_SANCTION_LIST_CHECK_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_TYPST_TEMPLATE_FAILURE"] = 1044] = "EXCHANGE_GENERIC_TYPST_TEMPLATE_FAILURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PDFTK_FAILURE"] = 1045] = "EXCHANGE_GENERIC_PDFTK_FAILURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_TYPST_CRASH"] = 1046] = "EXCHANGE_GENERIC_TYPST_CRASH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_PDFTK_CRASH"] = 1047] = "EXCHANGE_GENERIC_PDFTK_CRASH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GENERIC_NO_TYPST_OR_PDFTK"] = 1048] = "EXCHANGE_GENERIC_NO_TYPST_OR_PDFTK";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_NOT_FOUND"] = 1100] = "EXCHANGE_DEPOSITS_GET_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_INVALID_H_WIRE"] = 1101] = "EXCHANGE_DEPOSITS_GET_INVALID_H_WIRE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_INVALID_MERCHANT_PUB"] = 1102] = "EXCHANGE_DEPOSITS_GET_INVALID_MERCHANT_PUB";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_INVALID_H_CONTRACT_TERMS"] = 1103] = "EXCHANGE_DEPOSITS_GET_INVALID_H_CONTRACT_TERMS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_INVALID_COIN_PUB"] = 1104] = "EXCHANGE_DEPOSITS_GET_INVALID_COIN_PUB";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_INVALID_SIGNATURE_BY_EXCHANGE"] = 1105] = "EXCHANGE_DEPOSITS_GET_INVALID_SIGNATURE_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_GET_MERCHANT_SIGNATURE_INVALID"] = 1106] = "EXCHANGE_DEPOSITS_GET_MERCHANT_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSITS_POLICY_NOT_ACCEPTED"] = 1107] = "EXCHANGE_DEPOSITS_POLICY_NOT_ACCEPTED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS"] = 1150] = "EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AGE_WITHDRAW_INSUFFICIENT_FUNDS"] = 1151] = "EXCHANGE_AGE_WITHDRAW_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW"] = 1152] = "EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_SIGNATURE_FAILED"] = 1153] = "EXCHANGE_WITHDRAW_SIGNATURE_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_RESERVE_SIGNATURE_INVALID"] = 1154] = "EXCHANGE_WITHDRAW_RESERVE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS"] = 1155] = "EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_GET_RESERVE_HISTORY_ERROR_INSUFFICIENT_BALANCE"] = 1156] = "EXCHANGE_GET_RESERVE_HISTORY_ERROR_INSUFFICIENT_BALANCE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST"] = 1158] = "EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_UNBLIND_FAILURE"] = 1159] = "EXCHANGE_WITHDRAW_UNBLIND_FAILURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_NONCE_REUSE"] = 1160] = "EXCHANGE_WITHDRAW_NONCE_REUSE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_COMMITMENT_UNKNOWN"] = 1161] = "EXCHANGE_WITHDRAW_COMMITMENT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_AMOUNT_OVERFLOW"] = 1162] = "EXCHANGE_WITHDRAW_AMOUNT_OVERFLOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AGE_WITHDRAW_AMOUNT_INCORRECT"] = 1163] = "EXCHANGE_AGE_WITHDRAW_AMOUNT_INCORRECT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_REVEAL_INVALID_HASH"] = 1164] = "EXCHANGE_WITHDRAW_REVEAL_INVALID_HASH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_MAXIMUM_AGE_TOO_LARGE"] = 1165] = "EXCHANGE_WITHDRAW_MAXIMUM_AGE_TOO_LARGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WITHDRAW_IDEMPOTENT_PLANCHET"] = 1175] = "EXCHANGE_WITHDRAW_IDEMPOTENT_PLANCHET";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_COIN_SIGNATURE_INVALID"] = 1205] = "EXCHANGE_DEPOSIT_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT"] = 1206] = "EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_NEGATIVE_VALUE_AFTER_FEE"] = 1207] = "EXCHANGE_DEPOSIT_NEGATIVE_VALUE_AFTER_FEE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_REFUND_DEADLINE_AFTER_WIRE_DEADLINE"] = 1208] = "EXCHANGE_DEPOSIT_REFUND_DEADLINE_AFTER_WIRE_DEADLINE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_WIRE_DEADLINE_IS_NEVER"] = 1209] = "EXCHANGE_DEPOSIT_WIRE_DEADLINE_IS_NEVER";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_JSON"] = 1210] = "EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_JSON";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_CONTRACT_HASH_CONFLICT"] = 1211] = "EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_CONTRACT_HASH_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE"] = 1221] = "EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DEPOSIT_FEE_ABOVE_AMOUNT"] = 1222] = "EXCHANGE_DEPOSIT_FEE_ABOVE_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_EXTENSIONS_INVALID_FULFILLMENT"] = 1240] = "EXCHANGE_EXTENSIONS_INVALID_FULFILLMENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_COIN_HISTORY_BAD_SIGNATURE"] = 1251] = "EXCHANGE_COIN_HISTORY_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVE_HISTORY_BAD_SIGNATURE"] = 1252] = "EXCHANGE_RESERVE_HISTORY_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION"] = 1302] = "EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MELT_COIN_SIGNATURE_INVALID"] = 1303] = "EXCHANGE_MELT_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MELT_COIN_EXPIRED_NO_ZOMBIE"] = 1305] = "EXCHANGE_MELT_COIN_EXPIRED_NO_ZOMBIE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MELT_INVALID_SIGNATURE_BY_EXCHANGE"] = 1306] = "EXCHANGE_MELT_INVALID_SIGNATURE_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_COMMITMENT_VIOLATION"] = 1353] = "EXCHANGE_REFRESHES_REVEAL_COMMITMENT_VIOLATION";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_SIGNING_ERROR"] = 1354] = "EXCHANGE_REFRESHES_REVEAL_SIGNING_ERROR";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_SESSION_UNKNOWN"] = 1355] = "EXCHANGE_REFRESHES_REVEAL_SESSION_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_CNC_TRANSFER_ARRAY_SIZE_INVALID"] = 1356] = "EXCHANGE_REFRESHES_REVEAL_CNC_TRANSFER_ARRAY_SIZE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_NEW_DENOMS_ARRAY_SIZE_MISMATCH"] = 1358] = "EXCHANGE_REFRESHES_REVEAL_NEW_DENOMS_ARRAY_SIZE_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_COST_CALCULATION_OVERFLOW"] = 1359] = "EXCHANGE_REFRESHES_REVEAL_COST_CALCULATION_OVERFLOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_AMOUNT_INSUFFICIENT"] = 1360] = "EXCHANGE_REFRESHES_REVEAL_AMOUNT_INSUFFICIENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_LINK_SIGNATURE_INVALID"] = 1361] = "EXCHANGE_REFRESHES_REVEAL_LINK_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_INVALID_RCH"] = 1362] = "EXCHANGE_REFRESHES_REVEAL_INVALID_RCH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_OPERATION_INVALID"] = 1363] = "EXCHANGE_REFRESHES_REVEAL_OPERATION_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_NOT_SUPPORTED"] = 1364] = "EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_NOT_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_COMMITMENT_INVALID"] = 1365] = "EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_COMMITMENT_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_LINK_COIN_UNKNOWN"] = 1400] = "EXCHANGE_LINK_COIN_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_TRANSFERS_GET_WTID_MALFORMED"] = 1450] = "EXCHANGE_TRANSFERS_GET_WTID_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_TRANSFERS_GET_WTID_NOT_FOUND"] = 1451] = "EXCHANGE_TRANSFERS_GET_WTID_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_TRANSFERS_GET_WIRE_FEE_NOT_FOUND"] = 1452] = "EXCHANGE_TRANSFERS_GET_WIRE_FEE_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_TRANSFERS_GET_WIRE_FEE_INCONSISTENT"] = 1453] = "EXCHANGE_TRANSFERS_GET_WIRE_FEE_INCONSISTENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSES_INVALID_WAIT_TARGET"] = 1475] = "EXCHANGE_PURSES_INVALID_WAIT_TARGET";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSES_GET_INVALID_SIGNATURE_BY_EXCHANGE"] = 1476] = "EXCHANGE_PURSES_GET_INVALID_SIGNATURE_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_COIN_NOT_FOUND"] = 1500] = "EXCHANGE_REFUND_COIN_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_CONFLICT_DEPOSIT_INSUFFICIENT"] = 1501] = "EXCHANGE_REFUND_CONFLICT_DEPOSIT_INSUFFICIENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_DEPOSIT_NOT_FOUND"] = 1502] = "EXCHANGE_REFUND_DEPOSIT_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_MERCHANT_ALREADY_PAID"] = 1503] = "EXCHANGE_REFUND_MERCHANT_ALREADY_PAID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_FEE_TOO_LOW"] = 1504] = "EXCHANGE_REFUND_FEE_TOO_LOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_FEE_ABOVE_AMOUNT"] = 1505] = "EXCHANGE_REFUND_FEE_ABOVE_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_MERCHANT_SIGNATURE_INVALID"] = 1506] = "EXCHANGE_REFUND_MERCHANT_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_MERCHANT_SIGNING_FAILED"] = 1507] = "EXCHANGE_REFUND_MERCHANT_SIGNING_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_INVALID_SIGNATURE_BY_EXCHANGE"] = 1508] = "EXCHANGE_REFUND_INVALID_SIGNATURE_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_INVALID_FAILURE_PROOF_BY_EXCHANGE"] = 1509] = "EXCHANGE_REFUND_INVALID_FAILURE_PROOF_BY_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_REFUND_INCONSISTENT_AMOUNT"] = 1510] = "EXCHANGE_REFUND_INCONSISTENT_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_SIGNATURE_INVALID"] = 1550] = "EXCHANGE_RECOUP_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND"] = 1551] = "EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_COIN_BALANCE_ZERO"] = 1552] = "EXCHANGE_RECOUP_COIN_BALANCE_ZERO";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_BLINDING_FAILED"] = 1553] = "EXCHANGE_RECOUP_BLINDING_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_COIN_BALANCE_NEGATIVE"] = 1554] = "EXCHANGE_RECOUP_COIN_BALANCE_NEGATIVE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_NOT_ELIGIBLE"] = 1555] = "EXCHANGE_RECOUP_NOT_ELIGIBLE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_REFRESH_SIGNATURE_INVALID"] = 1575] = "EXCHANGE_RECOUP_REFRESH_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_REFRESH_MELT_NOT_FOUND"] = 1576] = "EXCHANGE_RECOUP_REFRESH_MELT_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED"] = 1578] = "EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RECOUP_REFRESH_NOT_ELIGIBLE"] = 1580] = "EXCHANGE_RECOUP_REFRESH_NOT_ELIGIBLE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KEYS_TIMETRAVEL_FORBIDDEN"] = 1600] = "EXCHANGE_KEYS_TIMETRAVEL_FORBIDDEN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WIRE_SIGNATURE_INVALID"] = 1650] = "EXCHANGE_WIRE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WIRE_NO_ACCOUNTS_CONFIGURED"] = 1651] = "EXCHANGE_WIRE_NO_ACCOUNTS_CONFIGURED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WIRE_INVALID_PAYTO_CONFIGURED"] = 1652] = "EXCHANGE_WIRE_INVALID_PAYTO_CONFIGURED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_WIRE_FEES_NOT_CONFIGURED"] = 1653] = "EXCHANGE_WIRE_FEES_NOT_CONFIGURED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_CREATE_CONFLICTING_META_DATA"] = 1675] = "EXCHANGE_RESERVES_PURSE_CREATE_CONFLICTING_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_MERGE_CONFLICTING_META_DATA"] = 1676] = "EXCHANGE_RESERVES_PURSE_MERGE_CONFLICTING_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_CREATE_INSUFFICIENT_FUNDS"] = 1677] = "EXCHANGE_RESERVES_PURSE_CREATE_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_FEE_TOO_LOW"] = 1678] = "EXCHANGE_RESERVES_PURSE_FEE_TOO_LOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DELETE_ALREADY_DECIDED"] = 1679] = "EXCHANGE_PURSE_DELETE_ALREADY_DECIDED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DELETE_SIGNATURE_INVALID"] = 1680] = "EXCHANGE_PURSE_DELETE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED"] = 1681] = "EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE"] = 1700] = "EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DENOMINATION_HELPER_BUG"] = 1701] = "EXCHANGE_DENOMINATION_HELPER_BUG";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_DENOMINATION_HELPER_TOO_EARLY"] = 1702] = "EXCHANGE_DENOMINATION_HELPER_TOO_EARLY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_EXCHANGE_SIGNATURE_INVALID"] = 1725] = "EXCHANGE_PURSE_DEPOSIT_EXCHANGE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE"] = 1750] = "EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_SIGNKEY_HELPER_BUG"] = 1751] = "EXCHANGE_SIGNKEY_HELPER_BUG";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_SIGNKEY_HELPER_TOO_EARLY"] = 1752] = "EXCHANGE_SIGNKEY_HELPER_TOO_EARLY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_SIGNKEY_HELPER_OFFLINE_MISSING"] = 1753] = "EXCHANGE_SIGNKEY_HELPER_OFFLINE_MISSING";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_EXPIRATION_BEFORE_NOW"] = 1775] = "EXCHANGE_RESERVES_PURSE_EXPIRATION_BEFORE_NOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER"] = 1776] = "EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_PURSE_MERGE_SIGNATURE_INVALID"] = 1777] = "EXCHANGE_RESERVES_PURSE_MERGE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_RESERVE_MERGE_SIGNATURE_INVALID"] = 1778] = "EXCHANGE_RESERVES_RESERVE_MERGE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE"] = 1785] = "EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE"] = 1786] = "EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_ATTEST_BAD_SIGNATURE"] = 1787] = "EXCHANGE_RESERVES_ATTEST_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT"] = 1788] = "EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS"] = 1789] = "EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND"] = 1800] = "EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_AUDITOR_MORE_RECENT_PRESENT"] = 1801] = "EXCHANGE_MANAGEMENT_AUDITOR_MORE_RECENT_PRESENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_AUDITOR_ADD_SIGNATURE_INVALID"] = 1802] = "EXCHANGE_MANAGEMENT_AUDITOR_ADD_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_AUDITOR_DEL_SIGNATURE_INVALID"] = 1803] = "EXCHANGE_MANAGEMENT_AUDITOR_DEL_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_DENOMINATION_REVOKE_SIGNATURE_INVALID"] = 1804] = "EXCHANGE_MANAGEMENT_DENOMINATION_REVOKE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_SIGNKEY_REVOKE_SIGNATURE_INVALID"] = 1805] = "EXCHANGE_MANAGEMENT_SIGNKEY_REVOKE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_MORE_RECENT_PRESENT"] = 1806] = "EXCHANGE_MANAGEMENT_WIRE_MORE_RECENT_PRESENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_UNKNOWN"] = 1807] = "EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_DETAILS_SIGNATURE_INVALID"] = 1808] = "EXCHANGE_MANAGEMENT_WIRE_DETAILS_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_ADD_SIGNATURE_INVALID"] = 1809] = "EXCHANGE_MANAGEMENT_WIRE_ADD_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_DEL_SIGNATURE_INVALID"] = 1810] = "EXCHANGE_MANAGEMENT_WIRE_DEL_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_NOT_FOUND"] = 1811] = "EXCHANGE_MANAGEMENT_WIRE_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_FEE_SIGNATURE_INVALID"] = 1812] = "EXCHANGE_MANAGEMENT_WIRE_FEE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_WIRE_FEE_MISMATCH"] = 1813] = "EXCHANGE_MANAGEMENT_WIRE_FEE_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_KEYS_DENOMKEY_ADD_SIGNATURE_INVALID"] = 1814] = "EXCHANGE_MANAGEMENT_KEYS_DENOMKEY_ADD_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_ADD_SIGNATURE_INVALID"] = 1815] = "EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_ADD_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_GLOBAL_FEE_MISMATCH"] = 1816] = "EXCHANGE_MANAGEMENT_GLOBAL_FEE_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_GLOBAL_FEE_SIGNATURE_INVALID"] = 1817] = "EXCHANGE_MANAGEMENT_GLOBAL_FEE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_DRAIN_PROFITS_SIGNATURE_INVALID"] = 1818] = "EXCHANGE_MANAGEMENT_DRAIN_PROFITS_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AML_DECISION_ADD_SIGNATURE_INVALID"] = 1825] = "EXCHANGE_AML_DECISION_ADD_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AML_DECISION_INVALID_OFFICER"] = 1826] = "EXCHANGE_AML_DECISION_INVALID_OFFICER";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AML_DECISION_MORE_RECENT_PRESENT"] = 1827] = "EXCHANGE_AML_DECISION_MORE_RECENT_PRESENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AML_DECISION_UNKNOWN_CHECK"] = 1828] = "EXCHANGE_AML_DECISION_UNKNOWN_CHECK";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_UPDATE_AML_OFFICER_SIGNATURE_INVALID"] = 1830] = "EXCHANGE_MANAGEMENT_UPDATE_AML_OFFICER_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_AML_OFFICERS_MORE_RECENT_PRESENT"] = 1831] = "EXCHANGE_MANAGEMENT_AML_OFFICERS_MORE_RECENT_PRESENT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_CONFLICTING_DENOMINATION_META_DATA"] = 1832] = "EXCHANGE_MANAGEMENT_CONFLICTING_DENOMINATION_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_CONFLICTING_SIGNKEY_META_DATA"] = 1833] = "EXCHANGE_MANAGEMENT_CONFLICTING_SIGNKEY_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA"] = 1850] = "EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_CONFLICTING_CONTRACT_STORED"] = 1851] = "EXCHANGE_PURSE_CREATE_CONFLICTING_CONTRACT_STORED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_COIN_SIGNATURE_INVALID"] = 1852] = "EXCHANGE_PURSE_CREATE_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_EXPIRATION_BEFORE_NOW"] = 1853] = "EXCHANGE_PURSE_CREATE_EXPIRATION_BEFORE_NOW";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_EXPIRATION_IS_NEVER"] = 1854] = "EXCHANGE_PURSE_CREATE_EXPIRATION_IS_NEVER";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID"] = 1855] = "EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_ECONTRACT_SIGNATURE_INVALID"] = 1856] = "EXCHANGE_PURSE_ECONTRACT_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_CREATE_EXCHANGE_SIGNATURE_INVALID"] = 1857] = "EXCHANGE_PURSE_CREATE_EXCHANGE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA"] = 1858] = "EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA"] = 1859] = "EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CREATE_PURSE_NEGATIVE_VALUE_AFTER_FEE"] = 1860] = "EXCHANGE_CREATE_PURSE_NEGATIVE_VALUE_AFTER_FEE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE"] = 1876] = "EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE"] = 1877] = "EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_NOT_FULL"] = 1878] = "EXCHANGE_PURSE_NOT_FULL";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_MERGE_EXCHANGE_SIGNATURE_INVALID"] = 1879] = "EXCHANGE_PURSE_MERGE_EXCHANGE_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN"] = 1880] = "EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_ADD_PARTNER_SIGNATURE_INVALID"] = 1890] = "EXCHANGE_MANAGEMENT_ADD_PARTNER_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_MANAGEMENT_ADD_PARTNER_DATA_CONFLICT"] = 1891] = "EXCHANGE_MANAGEMENT_ADD_PARTNER_DATA_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AUDITORS_AUDITOR_SIGNATURE_INVALID"] = 1900] = "EXCHANGE_AUDITORS_AUDITOR_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AUDITORS_AUDITOR_UNKNOWN"] = 1901] = "EXCHANGE_AUDITORS_AUDITOR_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_AUDITORS_AUDITOR_INACTIVE"] = 1902] = "EXCHANGE_AUDITORS_AUDITOR_INACTIVE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_AML_PROGRAM_TIMEOUT"] = 1918] = "EXCHANGE_KYC_GENERIC_AML_PROGRAM_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_INFO_AUTHORIZATION_FAILED"] = 1919] = "EXCHANGE_KYC_INFO_AUTHORIZATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_RECURSIVE_RULE_DETECTED"] = 1920] = "EXCHANGE_KYC_RECURSIVE_RULE_DETECTED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_AML_FORM_INCOMPLETE"] = 1921] = "EXCHANGE_KYC_AML_FORM_INCOMPLETE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_AML_PROGRAM_GONE"] = 1922] = "EXCHANGE_KYC_GENERIC_AML_PROGRAM_GONE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_NOT_A_FORM"] = 1923] = "EXCHANGE_KYC_NOT_A_FORM";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_CHECK_GONE"] = 1924] = "EXCHANGE_KYC_GENERIC_CHECK_GONE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_WALLET_SIGNATURE_INVALID"] = 1925] = "EXCHANGE_KYC_WALLET_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_PROOF_BACKEND_INVALID_RESPONSE"] = 1926] = "EXCHANGE_KYC_PROOF_BACKEND_INVALID_RESPONSE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_PROOF_BACKEND_ERROR"] = 1927] = "EXCHANGE_KYC_PROOF_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_PROOF_BACKEND_AUTHORIZATION_FAILED"] = 1928] = "EXCHANGE_KYC_PROOF_BACKEND_AUTHORIZATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_PROOF_REQUEST_UNKNOWN"] = 1929] = "EXCHANGE_KYC_PROOF_REQUEST_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED"] = 1930] = "EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN"] = 1931] = "EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_LOGIC_GONE"] = 1932] = "EXCHANGE_KYC_GENERIC_LOGIC_GONE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_LOGIC_BUG"] = 1933] = "EXCHANGE_KYC_GENERIC_LOGIC_BUG";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_ACCESS_REFUSED"] = 1934] = "EXCHANGE_KYC_GENERIC_PROVIDER_ACCESS_REFUSED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_TIMEOUT"] = 1935] = "EXCHANGE_KYC_GENERIC_PROVIDER_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY"] = 1936] = "EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_RATE_LIMIT_EXCEEDED"] = 1937] = "EXCHANGE_KYC_GENERIC_PROVIDER_RATE_LIMIT_EXCEEDED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED"] = 1938] = "EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_CHECK_REQUEST_UNKNOWN"] = 1939] = "EXCHANGE_KYC_CHECK_REQUEST_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_CHECK_AUTHORIZATION_KEY_UNKNOWN"] = 1940] = "EXCHANGE_KYC_CHECK_AUTHORIZATION_KEY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_FORM_ALREADY_UPLOADED"] = 1941] = "EXCHANGE_KYC_FORM_ALREADY_UPLOADED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_MEASURES_MALFORMED"] = 1942] = "EXCHANGE_KYC_MEASURES_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_MEASURE_INDEX_INVALID"] = 1943] = "EXCHANGE_KYC_MEASURE_INDEX_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_INVALID_LOGIC_TO_CHECK"] = 1944] = "EXCHANGE_KYC_INVALID_LOGIC_TO_CHECK";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_AML_PROGRAM_FAILURE"] = 1945] = "EXCHANGE_KYC_AML_PROGRAM_FAILURE";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_AML_PROGRAM_MALFORMED_RESULT"] = 1946] = "EXCHANGE_KYC_AML_PROGRAM_MALFORMED_RESULT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_INCOMPLETE_REPLY"] = 1947] = "EXCHANGE_KYC_GENERIC_PROVIDER_INCOMPLETE_REPLY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_PROVIDER_INCOMPLETE_CONTEXT"] = 1948] = "EXCHANGE_KYC_GENERIC_PROVIDER_INCOMPLETE_CONTEXT";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_GENERIC_AML_LOGIC_BUG"] = 1949] = "EXCHANGE_KYC_GENERIC_AML_LOGIC_BUG";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CONTRACTS_UNKNOWN"] = 1950] = "EXCHANGE_CONTRACTS_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CONTRACTS_INVALID_CONTRACT_PUB"] = 1951] = "EXCHANGE_CONTRACTS_INVALID_CONTRACT_PUB";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CONTRACTS_DECRYPTION_FAILED"] = 1952] = "EXCHANGE_CONTRACTS_DECRYPTION_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CONTRACTS_SIGNATURE_INVALID"] = 1953] = "EXCHANGE_CONTRACTS_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_CONTRACTS_DECODING_FAILED"] = 1954] = "EXCHANGE_CONTRACTS_DECODING_FAILED";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID"] = 1975] = "EXCHANGE_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_PURSE_DEPOSIT_DECIDED_ALREADY"] = 1976] = "EXCHANGE_PURSE_DEPOSIT_DECIDED_ALREADY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_KYC_INFO_BUSY"] = 1977] = "EXCHANGE_KYC_INFO_BUSY";
  TalerErrorCode2[TalerErrorCode2["EXCHANGE_TOTP_KEY_INVALID"] = 1980] = "EXCHANGE_TOTP_KEY_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_INSTANCE_UNKNOWN"] = 2e3] = "MERCHANT_GENERIC_INSTANCE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_HOLE_IN_WIRE_FEE_STRUCTURE"] = 2001] = "MERCHANT_GENERIC_HOLE_IN_WIRE_FEE_STRUCTURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED"] = 2002] = "MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_CATEGORY_UNKNOWN"] = 2003] = "MERCHANT_GENERIC_CATEGORY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_UNIT_UNKNOWN"] = 2004] = "MERCHANT_GENERIC_UNIT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_ORDER_UNKNOWN"] = 2005] = "MERCHANT_GENERIC_ORDER_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_PRODUCT_UNKNOWN"] = 2006] = "MERCHANT_GENERIC_PRODUCT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_REWARD_ID_UNKNOWN"] = 2007] = "MERCHANT_GENERIC_REWARD_ID_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_DB_CONTRACT_CONTENT_INVALID"] = 2008] = "MERCHANT_GENERIC_DB_CONTRACT_CONTENT_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_CONTRACT_HASH_DOES_NOT_MATCH_ORDER"] = 2009] = "MERCHANT_GENERIC_CONTRACT_HASH_DOES_NOT_MATCH_ORDER";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_KEYS_FAILURE"] = 2010] = "MERCHANT_GENERIC_EXCHANGE_KEYS_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_TIMEOUT"] = 2011] = "MERCHANT_GENERIC_EXCHANGE_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_CONNECT_FAILURE"] = 2012] = "MERCHANT_GENERIC_EXCHANGE_CONNECT_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_REPLY_MALFORMED"] = 2013] = "MERCHANT_GENERIC_EXCHANGE_REPLY_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_UNEXPECTED_STATUS"] = 2014] = "MERCHANT_GENERIC_EXCHANGE_UNEXPECTED_STATUS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_UNAUTHORIZED"] = 2015] = "MERCHANT_GENERIC_UNAUTHORIZED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_INSTANCE_DELETED"] = 2016] = "MERCHANT_GENERIC_INSTANCE_DELETED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_TRANSFER_UNKNOWN"] = 2017] = "MERCHANT_GENERIC_TRANSFER_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_TEMPLATE_UNKNOWN"] = 2018] = "MERCHANT_GENERIC_TEMPLATE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_WEBHOOK_UNKNOWN"] = 2019] = "MERCHANT_GENERIC_WEBHOOK_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_PENDING_WEBHOOK_UNKNOWN"] = 2020] = "MERCHANT_GENERIC_PENDING_WEBHOOK_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN"] = 2021] = "MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_ACCOUNT_UNKNOWN"] = 2022] = "MERCHANT_GENERIC_ACCOUNT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_H_WIRE_MALFORMED"] = 2023] = "MERCHANT_GENERIC_H_WIRE_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_CURRENCY_MISMATCH"] = 2024] = "MERCHANT_GENERIC_CURRENCY_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_EXCHANGE_UNTRUSTED"] = 2025] = "MERCHANT_GENERIC_EXCHANGE_UNTRUSTED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_TOKEN_FAMILY_UNKNOWN"] = 2026] = "MERCHANT_GENERIC_TOKEN_FAMILY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_TOKEN_KEY_UNKNOWN"] = 2027] = "MERCHANT_GENERIC_TOKEN_KEY_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_DONAU_NOT_CONFIGURED"] = 2028] = "MERCHANT_GENERIC_DONAU_NOT_CONFIGURED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_SIGN_PUB_UNKNOWN"] = 2029] = "MERCHANT_EXCHANGE_SIGN_PUB_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_FEATURE_NOT_AVAILABLE"] = 2030] = "MERCHANT_GENERIC_FEATURE_NOT_AVAILABLE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_MFA_MISSING"] = 2031] = "MERCHANT_GENERIC_MFA_MISSING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_DONAU_INVALID_RESPONSE"] = 2032] = "MERCHANT_GENERIC_DONAU_INVALID_RESPONSE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GENERIC_UNIT_BUILTIN"] = 2033] = "MERCHANT_GENERIC_UNIT_BUILTIN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_EXCHANGE_TRACKING_FAILURE"] = 2100] = "MERCHANT_GET_ORDERS_EXCHANGE_TRACKING_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE"] = 2103] = "MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_ID_EXCHANGE_LOOKUP_START_FAILURE"] = 2104] = "MERCHANT_GET_ORDERS_ID_EXCHANGE_LOOKUP_START_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_ID_INVALID_TOKEN"] = 2105] = "MERCHANT_GET_ORDERS_ID_INVALID_TOKEN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_ID_INVALID_CONTRACT_HASH"] = 2106] = "MERCHANT_GET_ORDERS_ID_INVALID_CONTRACT_HASH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_GET_ORDERS_ID_INVALID_CONTRACT_VERSION"] = 2107] = "MERCHANT_GET_ORDERS_ID_INVALID_CONTRACT_VERSION";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_CHALLENGE_FAILED"] = 2125] = "MERCHANT_TAN_CHALLENGE_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_CHALLENGE_UNKNOWN"] = 2126] = "MERCHANT_TAN_CHALLENGE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_TOO_MANY_ATTEMPTS"] = 2127] = "MERCHANT_TAN_TOO_MANY_ATTEMPTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_MFA_HELPER_EXEC_FAILED"] = 2128] = "MERCHANT_TAN_MFA_HELPER_EXEC_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_CHALLENGE_SOLVED"] = 2129] = "MERCHANT_TAN_CHALLENGE_SOLVED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_TAN_TOO_EARLY"] = 2130] = "MERCHANT_TAN_TOO_EARLY";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_MFA_FORBIDDEN"] = 2131] = "MERCHANT_MFA_FORBIDDEN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_FUNDS"] = 2150] = "MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_NOT_FOUND"] = 2151] = "MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_AUDITOR_FAILURE"] = 2152] = "MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_AUDITOR_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_AMOUNT_OVERFLOW"] = 2153] = "MERCHANT_POST_ORDERS_ID_PAY_AMOUNT_OVERFLOW";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_FEES_EXCEED_PAYMENT"] = 2154] = "MERCHANT_POST_ORDERS_ID_PAY_FEES_EXCEED_PAYMENT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES"] = 2155] = "MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT"] = 2156] = "MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID"] = 2157] = "MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_LOOKUP_FAILED"] = 2158] = "MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_LOOKUP_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE"] = 2159] = "MERCHANT_POST_ORDERS_ID_PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_ALREADY_PAID"] = 2160] = "MERCHANT_POST_ORDERS_ID_PAY_ALREADY_PAID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_OFFER_EXPIRED"] = 2161] = "MERCHANT_POST_ORDERS_ID_PAY_OFFER_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_MERCHANT_FIELD_MISSING"] = 2162] = "MERCHANT_POST_ORDERS_ID_PAY_MERCHANT_FIELD_MISSING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_WIRE_HASH_UNKNOWN"] = 2163] = "MERCHANT_POST_ORDERS_ID_PAY_WIRE_HASH_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_DEPOSIT_EXPIRED"] = 2165] = "MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_DEPOSIT_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_WIRE_FEE_ADDITION_FAILED"] = 2166] = "MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_WIRE_FEE_ADDITION_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_REFUNDED"] = 2167] = "MERCHANT_POST_ORDERS_ID_PAY_REFUNDED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_REFUNDS_EXCEED_PAYMENTS"] = 2168] = "MERCHANT_POST_ORDERS_ID_PAY_REFUNDS_EXCEED_PAYMENTS";
  TalerErrorCode2[TalerErrorCode2["DEAD_QQQ_PAY_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE"] = 2169] = "DEAD_QQQ_PAY_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_FAILED"] = 2170] = "MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_MISSING"] = 2171] = "MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_MISSING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_SIZE_MISMATCH"] = 2172] = "MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_SIZE_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_AGE_VERIFICATION_FAILED"] = 2173] = "MERCHANT_POST_ORDERS_ID_PAY_AGE_VERIFICATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_HASH_MISSING"] = 2174] = "MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_HASH_MISSING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_WIRE_METHOD_UNSUPPORTED"] = 2175] = "MERCHANT_POST_ORDERS_ID_PAY_WIRE_METHOD_UNSUPPORTED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_MISSING"] = 2176] = "MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_MISSING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_OUT_OF_BOUNDS"] = 2177] = "MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_OUT_OF_BOUNDS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_INPUT_TOKENS_MISMATCH"] = 2178] = "MERCHANT_POST_ORDERS_ID_PAY_INPUT_TOKENS_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ISSUE_SIG_INVALID"] = 2179] = "MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ISSUE_SIG_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_TOKEN_USE_SIG_INVALID"] = 2180] = "MERCHANT_POST_ORDERS_ID_PAY_TOKEN_USE_SIG_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_TOKEN_COUNT_MISMATCH"] = 2181] = "MERCHANT_POST_ORDERS_ID_PAY_TOKEN_COUNT_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ENVELOPE_COUNT_MISMATCH"] = 2182] = "MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ENVELOPE_COUNT_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_TOKEN_INVALID"] = 2183] = "MERCHANT_POST_ORDERS_ID_PAY_TOKEN_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_TRANSACTION_LIMIT_VIOLATION"] = 2184] = "MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_TRANSACTION_LIMIT_VIOLATION";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAY_DONATION_AMOUNT_MISMATCH"] = 2185] = "MERCHANT_POST_ORDERS_ID_PAY_DONATION_AMOUNT_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH"] = 2200] = "MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_PAID_COIN_SIGNATURE_INVALID"] = 2201] = "MERCHANT_POST_ORDERS_ID_PAID_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_TOKEN_FAMILY_CONFLICT"] = 2225] = "MERCHANT_POST_TOKEN_FAMILY_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PATCH_TOKEN_FAMILY_NOT_FOUND"] = 2226] = "MERCHANT_PATCH_TOKEN_FAMILY_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED"] = 2251] = "MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_LOOKUP_FAILED"] = 2252] = "MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_LOOKUP_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_NOT_FOUND"] = 2253] = "MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE"] = 2254] = "MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_HASH_MISSMATCH"] = 2255] = "MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_HASH_MISSMATCH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_ABORT_COINS_ARRAY_EMPTY"] = 2256] = "MERCHANT_POST_ORDERS_ID_ABORT_COINS_ARRAY_EMPTY";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_AWAITING_KEYS"] = 2258] = "MERCHANT_EXCHANGE_TRANSFERS_AWAITING_KEYS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_AWAITING_LIST"] = 2259] = "MERCHANT_EXCHANGE_TRANSFERS_AWAITING_LIST";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_FATAL_NO_EXCHANGE"] = 2260] = "MERCHANT_EXCHANGE_TRANSFERS_FATAL_NO_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_FATAL_NOT_FOUND"] = 2261] = "MERCHANT_EXCHANGE_TRANSFERS_FATAL_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_RATE_LIMITED"] = 2262] = "MERCHANT_EXCHANGE_TRANSFERS_RATE_LIMITED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_TRANSIENT_FAILURE"] = 2263] = "MERCHANT_EXCHANGE_TRANSFERS_TRANSIENT_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_HARD_FAILURE"] = 2264] = "MERCHANT_EXCHANGE_TRANSFERS_HARD_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_CLAIM_NOT_FOUND"] = 2300] = "MERCHANT_POST_ORDERS_ID_CLAIM_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_CLAIM_ALREADY_CLAIMED"] = 2301] = "MERCHANT_POST_ORDERS_ID_CLAIM_ALREADY_CLAIMED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_CLAIM_CLIENT_INTERNAL_FAILURE"] = 2302] = "MERCHANT_POST_ORDERS_ID_CLAIM_CLIENT_INTERNAL_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_REFUND_SIGNATURE_FAILED"] = 2350] = "MERCHANT_POST_ORDERS_ID_REFUND_SIGNATURE_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_UNBLIND_FAILURE"] = 2400] = "MERCHANT_REWARD_PICKUP_UNBLIND_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_EXCHANGE_ERROR"] = 2403] = "MERCHANT_REWARD_PICKUP_EXCHANGE_ERROR";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_SUMMATION_FAILED"] = 2404] = "MERCHANT_REWARD_PICKUP_SUMMATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_HAS_EXPIRED"] = 2405] = "MERCHANT_REWARD_PICKUP_HAS_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING"] = 2406] = "MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_REWARD_PICKUP_DENOMINATION_UNKNOWN"] = 2407] = "MERCHANT_REWARD_PICKUP_DENOMINATION_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE"] = 2500] = "MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME"] = 2501] = "MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR"] = 2502] = "MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS"] = 2503] = "MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE"] = 2504] = "MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST"] = 2505] = "MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER"] = 2506] = "MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST"] = 2507] = "MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST"] = 2508] = "MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGES_FOR_WIRE_METHOD"] = 2509] = "MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGES_FOR_WIRE_METHOD";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT"] = 2510] = "MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_NOT_FORGETTABLE"] = 2511] = "MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_NOT_FORGETTABLE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_ORDERS_ID_REFUND_EXCHANGE_TRANSACTION_LIMIT_VIOLATION"] = 2512] = "MERCHANT_POST_ORDERS_ID_REFUND_EXCHANGE_TRANSACTION_LIMIT_VIOLATION";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_AMOUNT_EXCEEDS_LEGAL_LIMITS"] = 2513] = "MERCHANT_PRIVATE_POST_ORDERS_AMOUNT_EXCEEDS_LEGAL_LIMITS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGE_FOR_CURRENCY"] = 2514] = "MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGE_FOR_CURRENCY";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT"] = 2520] = "MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_DELETE_ORDERS_ALREADY_PAID"] = 2521] = "MERCHANT_PRIVATE_DELETE_ORDERS_ALREADY_PAID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT"] = 2530] = "MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID"] = 2531] = "MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT"] = 2532] = "MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_SLUG_UNKNOWN"] = 2533] = "MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_SLUG_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_NOT_VALID"] = 2534] = "MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_NOT_VALID";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_EXCHANGE_UNKNOWN"] = 2550] = "MERCHANT_PRIVATE_POST_TRANSFERS_EXCHANGE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_REQUEST_ERROR"] = 2551] = "MERCHANT_PRIVATE_POST_TRANSFERS_REQUEST_ERROR";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_TRANSFERS"] = 2552] = "MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_TRANSFERS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_REPORTS"] = 2553] = "MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_REPORTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_BAD_WIRE_FEE"] = 2554] = "MERCHANT_PRIVATE_POST_TRANSFERS_BAD_WIRE_FEE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_ACCOUNT_NOT_FOUND"] = 2555] = "MERCHANT_PRIVATE_POST_TRANSFERS_ACCOUNT_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_DELETE_TRANSFERS_ALREADY_CONFIRMED"] = 2556] = "MERCHANT_PRIVATE_DELETE_TRANSFERS_ALREADY_CONFIRMED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_SUBMISSION"] = 2557] = "MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_SUBMISSION";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_TARGET_ACCOUNT_UNKNOWN"] = 2558] = "MERCHANT_EXCHANGE_TRANSFERS_TARGET_ACCOUNT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_EXCHANGE_TRANSFERS_CONFLICTING_TRANSFERS"] = 2563] = "MERCHANT_EXCHANGE_TRANSFERS_CONFLICTING_TRANSFERS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_INSTANCES_ALREADY_EXISTS"] = 2600] = "MERCHANT_PRIVATE_POST_INSTANCES_ALREADY_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_INSTANCES_BAD_AUTH"] = 2601] = "MERCHANT_PRIVATE_POST_INSTANCES_BAD_AUTH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_INSTANCE_AUTH_BAD_AUTH"] = 2602] = "MERCHANT_PRIVATE_POST_INSTANCE_AUTH_BAD_AUTH";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_INSTANCES_PURGE_REQUIRED"] = 2603] = "MERCHANT_PRIVATE_POST_INSTANCES_PURGE_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_INSTANCES_PURGE_REQUIRED"] = 2625] = "MERCHANT_PRIVATE_PATCH_INSTANCES_PURGE_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_ACCOUNT_DELETE_UNKNOWN_ACCOUNT"] = 2626] = "MERCHANT_PRIVATE_ACCOUNT_DELETE_UNKNOWN_ACCOUNT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_ACCOUNT_EXISTS"] = 2627] = "MERCHANT_PRIVATE_ACCOUNT_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_PRODUCTS_CONFLICT_PRODUCT_EXISTS"] = 2650] = "MERCHANT_PRIVATE_POST_PRODUCTS_CONFLICT_PRODUCT_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_CATEGORIES_CONFLICT_CATEGORY_EXISTS"] = 2651] = "MERCHANT_PRIVATE_POST_CATEGORIES_CONFLICT_CATEGORY_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_REDUCED"] = 2660] = "MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_REDUCED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_EXCEEDS_STOCKS"] = 2661] = "MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_EXCEEDS_STOCKS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_STOCKED_REDUCED"] = 2662] = "MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_STOCKED_REDUCED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_SOLD_REDUCED"] = 2663] = "MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_SOLD_REDUCED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_PRODUCTS_LOCK_INSUFFICIENT_STOCKS"] = 2670] = "MERCHANT_PRIVATE_POST_PRODUCTS_LOCK_INSUFFICIENT_STOCKS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_DELETE_PRODUCTS_CONFLICTING_LOCK"] = 2680] = "MERCHANT_PRIVATE_DELETE_PRODUCTS_CONFLICTING_LOCK";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD"] = 2700] = "MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_RESERVES_REWARDS_NOT_ALLOWED"] = 2701] = "MERCHANT_PRIVATE_POST_RESERVES_REWARDS_NOT_ALLOWED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE"] = 2710] = "MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_EXPIRED"] = 2750] = "MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_UNKNOWN"] = 2751] = "MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_INSUFFICIENT_FUNDS"] = 2752] = "MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_INSUFFICIENT_FUNDS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_NOT_FOUND"] = 2753] = "MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_GET_ORDERS_ID_AMOUNT_ARITHMETIC_FAILURE"] = 2800] = "MERCHANT_PRIVATE_GET_ORDERS_ID_AMOUNT_ARITHMETIC_FAILURE";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_TEMPLATES_CONFLICT_TEMPLATE_EXISTS"] = 2850] = "MERCHANT_PRIVATE_POST_TEMPLATES_CONFLICT_TEMPLATE_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_OTP_DEVICES_CONFLICT_OTP_DEVICE_EXISTS"] = 2851] = "MERCHANT_PRIVATE_POST_OTP_DEVICES_CONFLICT_OTP_DEVICE_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT"] = 2860] = "MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_USING_TEMPLATES_SUMMARY_CONFLICT_TEMPLATES_CONTRACT_SUBJECT"] = 2861] = "MERCHANT_POST_USING_TEMPLATES_SUMMARY_CONFLICT_TEMPLATES_CONTRACT_SUBJECT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_USING_TEMPLATES_NO_AMOUNT"] = 2862] = "MERCHANT_POST_USING_TEMPLATES_NO_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_POST_USING_TEMPLATES_NO_SUMMARY"] = 2863] = "MERCHANT_POST_USING_TEMPLATES_NO_SUMMARY";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_WEBHOOKS_CONFLICT_WEBHOOK_EXISTS"] = 2900] = "MERCHANT_PRIVATE_POST_WEBHOOKS_CONFLICT_WEBHOOK_EXISTS";
  TalerErrorCode2[TalerErrorCode2["MERCHANT_PRIVATE_POST_PENDING_WEBHOOKS_CONFLICT_PENDING_WEBHOOK_EXISTS"] = 2910] = "MERCHANT_PRIVATE_POST_PENDING_WEBHOOKS_CONFLICT_PENDING_WEBHOOK_EXISTS";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_GENERIC_UNAUTHORIZED"] = 3001] = "AUDITOR_GENERIC_UNAUTHORIZED";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_GENERIC_METHOD_NOT_ALLOWED"] = 3002] = "AUDITOR_GENERIC_METHOD_NOT_ALLOWED";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID"] = 3100] = "AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_EXCHANGE_SIGNING_KEY_REVOKED"] = 3101] = "AUDITOR_EXCHANGE_SIGNING_KEY_REVOKED";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_RESOURCE_NOT_FOUND"] = 3102] = "AUDITOR_RESOURCE_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["AUDITOR_URI_MISSING_PATH_COMPONENT"] = 3103] = "AUDITOR_URI_MISSING_PATH_COMPONENT";
  TalerErrorCode2[TalerErrorCode2["BANK_SAME_ACCOUNT"] = 5101] = "BANK_SAME_ACCOUNT";
  TalerErrorCode2[TalerErrorCode2["BANK_UNALLOWED_DEBIT"] = 5102] = "BANK_UNALLOWED_DEBIT";
  TalerErrorCode2[TalerErrorCode2["BANK_NEGATIVE_NUMBER_AMOUNT"] = 5103] = "BANK_NEGATIVE_NUMBER_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["BANK_NUMBER_TOO_BIG"] = 5104] = "BANK_NUMBER_TOO_BIG";
  TalerErrorCode2[TalerErrorCode2["BANK_UNKNOWN_ACCOUNT"] = 5106] = "BANK_UNKNOWN_ACCOUNT";
  TalerErrorCode2[TalerErrorCode2["BANK_TRANSACTION_NOT_FOUND"] = 5107] = "BANK_TRANSACTION_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["BANK_BAD_FORMAT_AMOUNT"] = 5108] = "BANK_BAD_FORMAT_AMOUNT";
  TalerErrorCode2[TalerErrorCode2["BANK_REJECT_NO_RIGHTS"] = 5109] = "BANK_REJECT_NO_RIGHTS";
  TalerErrorCode2[TalerErrorCode2["BANK_UNMANAGED_EXCEPTION"] = 5110] = "BANK_UNMANAGED_EXCEPTION";
  TalerErrorCode2[TalerErrorCode2["BANK_SOFT_EXCEPTION"] = 5111] = "BANK_SOFT_EXCEPTION";
  TalerErrorCode2[TalerErrorCode2["BANK_TRANSFER_REQUEST_UID_REUSED"] = 5112] = "BANK_TRANSFER_REQUEST_UID_REUSED";
  TalerErrorCode2[TalerErrorCode2["BANK_WITHDRAWAL_OPERATION_RESERVE_SELECTION_CONFLICT"] = 5113] = "BANK_WITHDRAWAL_OPERATION_RESERVE_SELECTION_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_DUPLICATE_RESERVE_PUB_SUBJECT"] = 5114] = "BANK_DUPLICATE_RESERVE_PUB_SUBJECT";
  TalerErrorCode2[TalerErrorCode2["BANK_ANCIENT_TRANSACTION_GONE"] = 5115] = "BANK_ANCIENT_TRANSACTION_GONE";
  TalerErrorCode2[TalerErrorCode2["BANK_ABORT_CONFIRM_CONFLICT"] = 5116] = "BANK_ABORT_CONFIRM_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_CONFIRM_ABORT_CONFLICT"] = 5117] = "BANK_CONFIRM_ABORT_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_REGISTER_CONFLICT"] = 5118] = "BANK_REGISTER_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_POST_WITHDRAWAL_OPERATION_REQUIRED"] = 5119] = "BANK_POST_WITHDRAWAL_OPERATION_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["BANK_RESERVED_USERNAME_CONFLICT"] = 5120] = "BANK_RESERVED_USERNAME_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_REGISTER_USERNAME_REUSE"] = 5121] = "BANK_REGISTER_USERNAME_REUSE";
  TalerErrorCode2[TalerErrorCode2["BANK_REGISTER_PAYTO_URI_REUSE"] = 5122] = "BANK_REGISTER_PAYTO_URI_REUSE";
  TalerErrorCode2[TalerErrorCode2["BANK_ACCOUNT_BALANCE_NOT_ZERO"] = 5123] = "BANK_ACCOUNT_BALANCE_NOT_ZERO";
  TalerErrorCode2[TalerErrorCode2["BANK_UNKNOWN_CREDITOR"] = 5124] = "BANK_UNKNOWN_CREDITOR";
  TalerErrorCode2[TalerErrorCode2["BANK_UNKNOWN_DEBTOR"] = 5125] = "BANK_UNKNOWN_DEBTOR";
  TalerErrorCode2[TalerErrorCode2["BANK_ACCOUNT_IS_EXCHANGE"] = 5126] = "BANK_ACCOUNT_IS_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["BANK_ACCOUNT_IS_NOT_EXCHANGE"] = 5127] = "BANK_ACCOUNT_IS_NOT_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["BANK_BAD_CONVERSION"] = 5128] = "BANK_BAD_CONVERSION";
  TalerErrorCode2[TalerErrorCode2["BANK_MISSING_TAN_INFO"] = 5129] = "BANK_MISSING_TAN_INFO";
  TalerErrorCode2[TalerErrorCode2["BANK_CONFIRM_INCOMPLETE"] = 5130] = "BANK_CONFIRM_INCOMPLETE";
  TalerErrorCode2[TalerErrorCode2["BANK_TAN_RATE_LIMITED"] = 5131] = "BANK_TAN_RATE_LIMITED";
  TalerErrorCode2[TalerErrorCode2["BANK_TAN_CHANNEL_NOT_SUPPORTED"] = 5132] = "BANK_TAN_CHANNEL_NOT_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["BANK_TAN_CHANNEL_SCRIPT_FAILED"] = 5133] = "BANK_TAN_CHANNEL_SCRIPT_FAILED";
  TalerErrorCode2[TalerErrorCode2["BANK_TAN_CHALLENGE_FAILED"] = 5134] = "BANK_TAN_CHALLENGE_FAILED";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_PATCH_LEGAL_NAME"] = 5135] = "BANK_NON_ADMIN_PATCH_LEGAL_NAME";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_PATCH_DEBT_LIMIT"] = 5136] = "BANK_NON_ADMIN_PATCH_DEBT_LIMIT";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_PATCH_MISSING_OLD_PASSWORD"] = 5137] = "BANK_NON_ADMIN_PATCH_MISSING_OLD_PASSWORD";
  TalerErrorCode2[TalerErrorCode2["BANK_PATCH_BAD_OLD_PASSWORD"] = 5138] = "BANK_PATCH_BAD_OLD_PASSWORD";
  TalerErrorCode2[TalerErrorCode2["BANK_PATCH_ADMIN_EXCHANGE"] = 5139] = "BANK_PATCH_ADMIN_EXCHANGE";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_PATCH_CASHOUT"] = 5140] = "BANK_NON_ADMIN_PATCH_CASHOUT";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_PATCH_CONTACT"] = 5141] = "BANK_NON_ADMIN_PATCH_CONTACT";
  TalerErrorCode2[TalerErrorCode2["BANK_ADMIN_CREDITOR"] = 5142] = "BANK_ADMIN_CREDITOR";
  TalerErrorCode2[TalerErrorCode2["BANK_CHALLENGE_NOT_FOUND"] = 5143] = "BANK_CHALLENGE_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["BANK_TAN_CHALLENGE_EXPIRED"] = 5144] = "BANK_TAN_CHALLENGE_EXPIRED";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_SET_TAN_CHANNEL"] = 5145] = "BANK_NON_ADMIN_SET_TAN_CHANNEL";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_SET_MIN_CASHOUT"] = 5146] = "BANK_NON_ADMIN_SET_MIN_CASHOUT";
  TalerErrorCode2[TalerErrorCode2["BANK_CONVERSION_AMOUNT_TO_SMALL"] = 5147] = "BANK_CONVERSION_AMOUNT_TO_SMALL";
  TalerErrorCode2[TalerErrorCode2["BANK_AMOUNT_DIFFERS"] = 5148] = "BANK_AMOUNT_DIFFERS";
  TalerErrorCode2[TalerErrorCode2["BANK_AMOUNT_REQUIRED"] = 5149] = "BANK_AMOUNT_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["BANK_PASSWORD_TOO_SHORT"] = 5150] = "BANK_PASSWORD_TOO_SHORT";
  TalerErrorCode2[TalerErrorCode2["BANK_PASSWORD_TOO_LONG"] = 5151] = "BANK_PASSWORD_TOO_LONG";
  TalerErrorCode2[TalerErrorCode2["BANK_ACCOUNT_LOCKED"] = 5152] = "BANK_ACCOUNT_LOCKED";
  TalerErrorCode2[TalerErrorCode2["BANK_UPDATE_ABORT_CONFLICT"] = 5153] = "BANK_UPDATE_ABORT_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["BANK_TRANSFER_WTID_REUSED"] = 5154] = "BANK_TRANSFER_WTID_REUSED";
  TalerErrorCode2[TalerErrorCode2["BANK_NON_ADMIN_SET_CONVERSION_RATE_CLASS"] = 5155] = "BANK_NON_ADMIN_SET_CONVERSION_RATE_CLASS";
  TalerErrorCode2[TalerErrorCode2["BANK_CONVERSION_RATE_CLASS_UNKNOWN"] = 5156] = "BANK_CONVERSION_RATE_CLASS_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["BANK_NAME_REUSE"] = 5157] = "BANK_NAME_REUSE";
  TalerErrorCode2[TalerErrorCode2["SYNC_ACCOUNT_UNKNOWN"] = 6100] = "SYNC_ACCOUNT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["SYNC_BAD_IF_NONE_MATCH"] = 6101] = "SYNC_BAD_IF_NONE_MATCH";
  TalerErrorCode2[TalerErrorCode2["SYNC_BAD_IF_MATCH"] = 6102] = "SYNC_BAD_IF_MATCH";
  TalerErrorCode2[TalerErrorCode2["SYNC_BAD_SYNC_SIGNATURE"] = 6103] = "SYNC_BAD_SYNC_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["SYNC_INVALID_SIGNATURE"] = 6104] = "SYNC_INVALID_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["SYNC_MALFORMED_CONTENT_LENGTH"] = 6105] = "SYNC_MALFORMED_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["SYNC_EXCESSIVE_CONTENT_LENGTH"] = 6106] = "SYNC_EXCESSIVE_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["SYNC_OUT_OF_MEMORY_ON_CONTENT_LENGTH"] = 6107] = "SYNC_OUT_OF_MEMORY_ON_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["SYNC_INVALID_UPLOAD"] = 6108] = "SYNC_INVALID_UPLOAD";
  TalerErrorCode2[TalerErrorCode2["SYNC_PAYMENT_GENERIC_TIMEOUT"] = 6109] = "SYNC_PAYMENT_GENERIC_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["SYNC_PAYMENT_CREATE_BACKEND_ERROR"] = 6110] = "SYNC_PAYMENT_CREATE_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["SYNC_PREVIOUS_BACKUP_UNKNOWN"] = 6111] = "SYNC_PREVIOUS_BACKUP_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["SYNC_MISSING_CONTENT_LENGTH"] = 6112] = "SYNC_MISSING_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["SYNC_GENERIC_BACKEND_ERROR"] = 6113] = "SYNC_GENERIC_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["SYNC_GENERIC_BACKEND_TIMEOUT"] = 6114] = "SYNC_GENERIC_BACKEND_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE"] = 7e3] = "WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE";
  TalerErrorCode2[TalerErrorCode2["WALLET_UNEXPECTED_EXCEPTION"] = 7001] = "WALLET_UNEXPECTED_EXCEPTION";
  TalerErrorCode2[TalerErrorCode2["WALLET_RECEIVED_MALFORMED_RESPONSE"] = 7002] = "WALLET_RECEIVED_MALFORMED_RESPONSE";
  TalerErrorCode2[TalerErrorCode2["WALLET_NETWORK_ERROR"] = 7003] = "WALLET_NETWORK_ERROR";
  TalerErrorCode2[TalerErrorCode2["WALLET_HTTP_REQUEST_THROTTLED"] = 7004] = "WALLET_HTTP_REQUEST_THROTTLED";
  TalerErrorCode2[TalerErrorCode2["WALLET_UNEXPECTED_REQUEST_ERROR"] = 7005] = "WALLET_UNEXPECTED_REQUEST_ERROR";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_DENOMINATIONS_INSUFFICIENT"] = 7006] = "WALLET_EXCHANGE_DENOMINATIONS_INSUFFICIENT";
  TalerErrorCode2[TalerErrorCode2["WALLET_CORE_API_OPERATION_UNKNOWN"] = 7007] = "WALLET_CORE_API_OPERATION_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["WALLET_INVALID_TALER_PAY_URI"] = 7008] = "WALLET_INVALID_TALER_PAY_URI";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_COIN_SIGNATURE_INVALID"] = 7009] = "WALLET_EXCHANGE_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["WALLET_CORE_NOT_AVAILABLE"] = 7011] = "WALLET_CORE_NOT_AVAILABLE";
  TalerErrorCode2[TalerErrorCode2["WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK"] = 7012] = "WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK";
  TalerErrorCode2[TalerErrorCode2["WALLET_HTTP_REQUEST_GENERIC_TIMEOUT"] = 7013] = "WALLET_HTTP_REQUEST_GENERIC_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["WALLET_ORDER_ALREADY_CLAIMED"] = 7014] = "WALLET_ORDER_ALREADY_CLAIMED";
  TalerErrorCode2[TalerErrorCode2["WALLET_WITHDRAWAL_GROUP_INCOMPLETE"] = 7015] = "WALLET_WITHDRAWAL_GROUP_INCOMPLETE";
  TalerErrorCode2[TalerErrorCode2["WALLET_REWARD_COIN_SIGNATURE_INVALID"] = 7016] = "WALLET_REWARD_COIN_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["WALLET_BANK_INTEGRATION_PROTOCOL_VERSION_INCOMPATIBLE"] = 7017] = "WALLET_BANK_INTEGRATION_PROTOCOL_VERSION_INCOMPATIBLE";
  TalerErrorCode2[TalerErrorCode2["WALLET_CONTRACT_TERMS_BASE_URL_MISMATCH"] = 7018] = "WALLET_CONTRACT_TERMS_BASE_URL_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["WALLET_CONTRACT_TERMS_SIGNATURE_INVALID"] = 7019] = "WALLET_CONTRACT_TERMS_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["WALLET_CONTRACT_TERMS_MALFORMED"] = 7020] = "WALLET_CONTRACT_TERMS_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["WALLET_PENDING_OPERATION_FAILED"] = 7021] = "WALLET_PENDING_OPERATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["WALLET_PAY_MERCHANT_SERVER_ERROR"] = 7022] = "WALLET_PAY_MERCHANT_SERVER_ERROR";
  TalerErrorCode2[TalerErrorCode2["WALLET_CRYPTO_WORKER_ERROR"] = 7023] = "WALLET_CRYPTO_WORKER_ERROR";
  TalerErrorCode2[TalerErrorCode2["WALLET_CRYPTO_WORKER_BAD_REQUEST"] = 7024] = "WALLET_CRYPTO_WORKER_BAD_REQUEST";
  TalerErrorCode2[TalerErrorCode2["WALLET_WITHDRAWAL_KYC_REQUIRED"] = 7025] = "WALLET_WITHDRAWAL_KYC_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE"] = 7026] = "WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE";
  TalerErrorCode2[TalerErrorCode2["WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE"] = 7027] = "WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE";
  TalerErrorCode2[TalerErrorCode2["WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE"] = 7028] = "WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE";
  TalerErrorCode2[TalerErrorCode2["WALLET_REFRESH_GROUP_INCOMPLETE"] = 7029] = "WALLET_REFRESH_GROUP_INCOMPLETE";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_BASE_URL_MISMATCH"] = 7030] = "WALLET_EXCHANGE_BASE_URL_MISMATCH";
  TalerErrorCode2[TalerErrorCode2["WALLET_ORDER_ALREADY_PAID"] = 7031] = "WALLET_ORDER_ALREADY_PAID";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_UNAVAILABLE"] = 7032] = "WALLET_EXCHANGE_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_ENTRY_USED"] = 7033] = "WALLET_EXCHANGE_ENTRY_USED";
  TalerErrorCode2[TalerErrorCode2["WALLET_DB_UNAVAILABLE"] = 7034] = "WALLET_DB_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["WALLET_TALER_URI_MALFORMED"] = 7035] = "WALLET_TALER_URI_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["WALLET_CORE_REQUEST_CANCELLED"] = 7036] = "WALLET_CORE_REQUEST_CANCELLED";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_TOS_NOT_ACCEPTED"] = 7037] = "WALLET_EXCHANGE_TOS_NOT_ACCEPTED";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_ENTRY_UPDATE_CONFLICT"] = 7038] = "WALLET_EXCHANGE_ENTRY_UPDATE_CONFLICT";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_ENTRY_OUTDATED"] = 7039] = "WALLET_EXCHANGE_ENTRY_OUTDATED";
  TalerErrorCode2[TalerErrorCode2["WALLET_PAY_MERCHANT_KYC_MISSING"] = 7040] = "WALLET_PAY_MERCHANT_KYC_MISSING";
  TalerErrorCode2[TalerErrorCode2["WALLET_PEER_PULL_DEBIT_PURSE_GONE"] = 7041] = "WALLET_PEER_PULL_DEBIT_PURSE_GONE";
  TalerErrorCode2[TalerErrorCode2["WALLET_TRANSACTION_ABORTED_BY_USER"] = 7042] = "WALLET_TRANSACTION_ABORTED_BY_USER";
  TalerErrorCode2[TalerErrorCode2["WALLET_TRANSACTION_ABANDONED_BY_USER"] = 7043] = "WALLET_TRANSACTION_ABANDONED_BY_USER";
  TalerErrorCode2[TalerErrorCode2["WALLET_PAY_MERCHANT_ORDER_GONE"] = 7044] = "WALLET_PAY_MERCHANT_ORDER_GONE";
  TalerErrorCode2[TalerErrorCode2["WALLET_EXCHANGE_ENTRY_NOT_FOUND"] = 7045] = "WALLET_EXCHANGE_ENTRY_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["WALLET_REQUEST_TRANSACTION_STATE_UNSUPPORTED"] = 7046] = "WALLET_REQUEST_TRANSACTION_STATE_UNSUPPORTED";
  TalerErrorCode2[TalerErrorCode2["WALLET_TRANSACTION_PROTOCOL_VIOLATION"] = 7047] = "WALLET_TRANSACTION_PROTOCOL_VIOLATION";
  TalerErrorCode2[TalerErrorCode2["WALLET_CORE_API_BAD_REQUEST"] = 7048] = "WALLET_CORE_API_BAD_REQUEST";
  TalerErrorCode2[TalerErrorCode2["WALLET_MERCHANT_ORDER_NOT_FOUND"] = 7049] = "WALLET_MERCHANT_ORDER_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_BACKEND_TIMEOUT"] = 8e3] = "ANASTASIS_GENERIC_BACKEND_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_INVALID_PAYMENT_REQUEST"] = 8001] = "ANASTASIS_GENERIC_INVALID_PAYMENT_REQUEST";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_BACKEND_ERROR"] = 8002] = "ANASTASIS_GENERIC_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_MISSING_CONTENT_LENGTH"] = 8003] = "ANASTASIS_GENERIC_MISSING_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_MALFORMED_CONTENT_LENGTH"] = 8004] = "ANASTASIS_GENERIC_MALFORMED_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_ORDER_CREATE_BACKEND_ERROR"] = 8005] = "ANASTASIS_GENERIC_ORDER_CREATE_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_PAYMENT_CHECK_UNAUTHORIZED"] = 8006] = "ANASTASIS_GENERIC_PAYMENT_CHECK_UNAUTHORIZED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_PAYMENT_CHECK_START_FAILED"] = 8007] = "ANASTASIS_GENERIC_PAYMENT_CHECK_START_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_GENERIC_PROVIDER_UNREACHABLE"] = 8008] = "ANASTASIS_GENERIC_PROVIDER_UNREACHABLE";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_PAYMENT_GENERIC_TIMEOUT"] = 8009] = "ANASTASIS_PAYMENT_GENERIC_TIMEOUT";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_UNKNOWN"] = 8108] = "ANASTASIS_TRUTH_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_AUTHORIZATION_METHOD_NO_LONGER_SUPPORTED"] = 8109] = "ANASTASIS_TRUTH_AUTHORIZATION_METHOD_NO_LONGER_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_CHALLENGE_RESPONSE_REQUIRED"] = 8110] = "ANASTASIS_TRUTH_CHALLENGE_RESPONSE_REQUIRED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_CHALLENGE_FAILED"] = 8111] = "ANASTASIS_TRUTH_CHALLENGE_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_CHALLENGE_UNKNOWN"] = 8112] = "ANASTASIS_TRUTH_CHALLENGE_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_AUTHORIZATION_START_FAILED"] = 8114] = "ANASTASIS_TRUTH_AUTHORIZATION_START_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_KEY_SHARE_GONE"] = 8115] = "ANASTASIS_TRUTH_KEY_SHARE_GONE";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_ORDER_DISAPPEARED"] = 8116] = "ANASTASIS_TRUTH_ORDER_DISAPPEARED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_BACKEND_EXCHANGE_BAD"] = 8117] = "ANASTASIS_TRUTH_BACKEND_EXCHANGE_BAD";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_UNEXPECTED_PAYMENT_STATUS"] = 8118] = "ANASTASIS_TRUTH_UNEXPECTED_PAYMENT_STATUS";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_PAYMENT_CREATE_BACKEND_ERROR"] = 8119] = "ANASTASIS_TRUTH_PAYMENT_CREATE_BACKEND_ERROR";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_DECRYPTION_FAILED"] = 8120] = "ANASTASIS_TRUTH_DECRYPTION_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_RATE_LIMITED"] = 8121] = "ANASTASIS_TRUTH_RATE_LIMITED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_CHALLENGE_WRONG_METHOD"] = 8123] = "ANASTASIS_TRUTH_CHALLENGE_WRONG_METHOD";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_UPLOAD_UUID_EXISTS"] = 8150] = "ANASTASIS_TRUTH_UPLOAD_UUID_EXISTS";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TRUTH_UPLOAD_METHOD_NOT_SUPPORTED"] = 8151] = "ANASTASIS_TRUTH_UPLOAD_METHOD_NOT_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_SMS_PHONE_INVALID"] = 8200] = "ANASTASIS_SMS_PHONE_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_SMS_HELPER_EXEC_FAILED"] = 8201] = "ANASTASIS_SMS_HELPER_EXEC_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_SMS_HELPER_COMMAND_FAILED"] = 8202] = "ANASTASIS_SMS_HELPER_COMMAND_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_EMAIL_INVALID"] = 8210] = "ANASTASIS_EMAIL_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_EMAIL_HELPER_EXEC_FAILED"] = 8211] = "ANASTASIS_EMAIL_HELPER_EXEC_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_EMAIL_HELPER_COMMAND_FAILED"] = 8212] = "ANASTASIS_EMAIL_HELPER_COMMAND_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POST_INVALID"] = 8220] = "ANASTASIS_POST_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POST_HELPER_EXEC_FAILED"] = 8221] = "ANASTASIS_POST_HELPER_EXEC_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POST_HELPER_COMMAND_FAILED"] = 8222] = "ANASTASIS_POST_HELPER_COMMAND_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_IBAN_INVALID"] = 8230] = "ANASTASIS_IBAN_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_IBAN_MISSING_TRANSFER"] = 8231] = "ANASTASIS_IBAN_MISSING_TRANSFER";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TOTP_KEY_MISSING"] = 8240] = "ANASTASIS_TOTP_KEY_MISSING";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_TOTP_KEY_INVALID"] = 8241] = "ANASTASIS_TOTP_KEY_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_BAD_IF_NONE_MATCH"] = 8301] = "ANASTASIS_POLICY_BAD_IF_NONE_MATCH";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_OUT_OF_MEMORY_ON_CONTENT_LENGTH"] = 8304] = "ANASTASIS_POLICY_OUT_OF_MEMORY_ON_CONTENT_LENGTH";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_BAD_SIGNATURE"] = 8305] = "ANASTASIS_POLICY_BAD_SIGNATURE";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_BAD_IF_MATCH"] = 8306] = "ANASTASIS_POLICY_BAD_IF_MATCH";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_INVALID_UPLOAD"] = 8307] = "ANASTASIS_POLICY_INVALID_UPLOAD";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_POLICY_NOT_FOUND"] = 8350] = "ANASTASIS_POLICY_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_ACTION_INVALID"] = 8400] = "ANASTASIS_REDUCER_ACTION_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_STATE_INVALID"] = 8401] = "ANASTASIS_REDUCER_STATE_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_INPUT_INVALID"] = 8402] = "ANASTASIS_REDUCER_INPUT_INVALID";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_AUTHENTICATION_METHOD_NOT_SUPPORTED"] = 8403] = "ANASTASIS_REDUCER_AUTHENTICATION_METHOD_NOT_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_INPUT_INVALID_FOR_STATE"] = 8404] = "ANASTASIS_REDUCER_INPUT_INVALID_FOR_STATE";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_BACKEND_FAILURE"] = 8405] = "ANASTASIS_REDUCER_BACKEND_FAILURE";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_RESOURCE_MALFORMED"] = 8406] = "ANASTASIS_REDUCER_RESOURCE_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_RESOURCE_MISSING"] = 8407] = "ANASTASIS_REDUCER_RESOURCE_MISSING";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_INPUT_REGEX_FAILED"] = 8408] = "ANASTASIS_REDUCER_INPUT_REGEX_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_INPUT_VALIDATION_FAILED"] = 8409] = "ANASTASIS_REDUCER_INPUT_VALIDATION_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_POLICY_LOOKUP_FAILED"] = 8410] = "ANASTASIS_REDUCER_POLICY_LOOKUP_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_BACKUP_PROVIDER_FAILED"] = 8411] = "ANASTASIS_REDUCER_BACKUP_PROVIDER_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED"] = 8412] = "ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_POLICY_MALFORMED"] = 8413] = "ANASTASIS_REDUCER_POLICY_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_NETWORK_FAILED"] = 8414] = "ANASTASIS_REDUCER_NETWORK_FAILED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_SECRET_MALFORMED"] = 8415] = "ANASTASIS_REDUCER_SECRET_MALFORMED";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_CHALLENGE_DATA_TOO_BIG"] = 8416] = "ANASTASIS_REDUCER_CHALLENGE_DATA_TOO_BIG";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_SECRET_TOO_BIG"] = 8417] = "ANASTASIS_REDUCER_SECRET_TOO_BIG";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG"] = 8418] = "ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_INTERNAL_ERROR"] = 8419] = "ANASTASIS_REDUCER_INTERNAL_ERROR";
  TalerErrorCode2[TalerErrorCode2["ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED"] = 8420] = "ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED";
  TalerErrorCode2[TalerErrorCode2["DONAU_GENERIC_KEYS_MISSING"] = 8607] = "DONAU_GENERIC_KEYS_MISSING";
  TalerErrorCode2[TalerErrorCode2["DONAU_CHARITY_SIGNATURE_INVALID"] = 8608] = "DONAU_CHARITY_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["DONAU_CHARITY_NOT_FOUND"] = 8609] = "DONAU_CHARITY_NOT_FOUND";
  TalerErrorCode2[TalerErrorCode2["DONAU_EXCEEDING_DONATION_LIMIT"] = 8610] = "DONAU_EXCEEDING_DONATION_LIMIT";
  TalerErrorCode2[TalerErrorCode2["DONAU_GENERIC_DONATION_UNIT_UNKNOWN"] = 8611] = "DONAU_GENERIC_DONATION_UNIT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["DONAU_DONATION_UNIT_HELPER_UNAVAILABLE"] = 8612] = "DONAU_DONATION_UNIT_HELPER_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["DONAU_SIGNKEY_HELPER_UNAVAILABLE"] = 8613] = "DONAU_SIGNKEY_HELPER_UNAVAILABLE";
  TalerErrorCode2[TalerErrorCode2["DONAU_SIGNKEY_HELPER_BUG"] = 8614] = "DONAU_SIGNKEY_HELPER_BUG";
  TalerErrorCode2[TalerErrorCode2["DONAU_GENERIC_WRONG_NUMBER_OF_SEGMENTS"] = 8615] = "DONAU_GENERIC_WRONG_NUMBER_OF_SEGMENTS";
  TalerErrorCode2[TalerErrorCode2["DONAU_DONATION_RECEIPT_SIGNATURE_INVALID"] = 8616] = "DONAU_DONATION_RECEIPT_SIGNATURE_INVALID";
  TalerErrorCode2[TalerErrorCode2["DONAU_DONOR_IDENTIFIER_NONCE_REUSE"] = 8617] = "DONAU_DONOR_IDENTIFIER_NONCE_REUSE";
  TalerErrorCode2[TalerErrorCode2["DONAU_CHARITY_PUB_EXISTS"] = 8618] = "DONAU_CHARITY_PUB_EXISTS";
  TalerErrorCode2[TalerErrorCode2["LIBEUFIN_NEXUS_GENERIC_ERROR"] = 9e3] = "LIBEUFIN_NEXUS_GENERIC_ERROR";
  TalerErrorCode2[TalerErrorCode2["LIBEUFIN_NEXUS_UNCAUGHT_EXCEPTION"] = 9001] = "LIBEUFIN_NEXUS_UNCAUGHT_EXCEPTION";
  TalerErrorCode2[TalerErrorCode2["LIBEUFIN_SANDBOX_GENERIC_ERROR"] = 9500] = "LIBEUFIN_SANDBOX_GENERIC_ERROR";
  TalerErrorCode2[TalerErrorCode2["LIBEUFIN_SANDBOX_UNCAUGHT_EXCEPTION"] = 9501] = "LIBEUFIN_SANDBOX_UNCAUGHT_EXCEPTION";
  TalerErrorCode2[TalerErrorCode2["TALDIR_METHOD_NOT_SUPPORTED"] = 9600] = "TALDIR_METHOD_NOT_SUPPORTED";
  TalerErrorCode2[TalerErrorCode2["TALDIR_REGISTER_RATE_LIMITED"] = 9601] = "TALDIR_REGISTER_RATE_LIMITED";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_GENERIC_CLIENT_UNKNOWN"] = 9750] = "CHALLENGER_GENERIC_CLIENT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_GENERIC_CLIENT_FORBIDDEN_BAD_REDIRECT_URI"] = 9751] = "CHALLENGER_GENERIC_CLIENT_FORBIDDEN_BAD_REDIRECT_URI";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_HELPER_EXEC_FAILED"] = 9752] = "CHALLENGER_HELPER_EXEC_FAILED";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_GRANT_UNKNOWN"] = 9753] = "CHALLENGER_GRANT_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_CLIENT_FORBIDDEN_BAD_CODE"] = 9754] = "CHALLENGER_CLIENT_FORBIDDEN_BAD_CODE";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_GENERIC_VALIDATION_UNKNOWN"] = 9755] = "CHALLENGER_GENERIC_VALIDATION_UNKNOWN";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_CLIENT_FORBIDDEN_INVALID_CODE"] = 9756] = "CHALLENGER_CLIENT_FORBIDDEN_INVALID_CODE";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_TOO_MANY_ATTEMPTS"] = 9757] = "CHALLENGER_TOO_MANY_ATTEMPTS";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_INVALID_PIN"] = 9758] = "CHALLENGER_INVALID_PIN";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_MISSING_ADDRESS"] = 9759] = "CHALLENGER_MISSING_ADDRESS";
  TalerErrorCode2[TalerErrorCode2["CHALLENGER_CLIENT_FORBIDDEN_READ_ONLY"] = 9760] = "CHALLENGER_CLIENT_FORBIDDEN_READ_ONLY";
  TalerErrorCode2[TalerErrorCode2["END"] = 9999] = "END";
})(TalerErrorCode || (TalerErrorCode = {}));

// ../taler-util/lib/time.js
var opaque_AbsoluteTime = Symbol("opaque_AbsoluteTime");
var TalerPreciseTimestamp;
(function(TalerPreciseTimestamp2) {
  function now2() {
    const absNow = AbsoluteTime.now();
    return AbsoluteTime.toPreciseTimestamp(absNow);
  }
  TalerPreciseTimestamp2.now = now2;
  function round2(t5) {
    return {
      t_s: t5.t_s
    };
  }
  TalerPreciseTimestamp2.round = round2;
  function fromSeconds(s6) {
    return {
      t_s: Math.floor(s6),
      off_us: Math.floor((s6 - Math.floor(s6)) / 1e3 / 1e3)
    };
  }
  TalerPreciseTimestamp2.fromSeconds = fromSeconds;
  function fromMilliseconds(ms) {
    return {
      t_s: Math.floor(ms / 1e3),
      off_us: Math.floor((ms - Math.floor(ms / 1e3) * 1e3) * 1e3)
    };
  }
  TalerPreciseTimestamp2.fromMilliseconds = fromMilliseconds;
})(TalerPreciseTimestamp || (TalerPreciseTimestamp = {}));
var TalerProtocolDuration;
(function(TalerProtocolDuration3) {
  function fromSpec(d6) {
    return Duration.toTalerProtocolDuration(Duration.fromSpec(d6));
  }
  TalerProtocolDuration3.fromSpec = fromSpec;
  function forever() {
    return {
      d_us: "forever"
    };
  }
  TalerProtocolDuration3.forever = forever;
})(TalerProtocolDuration || (TalerProtocolDuration = {}));
var TalerProtocolTimestamp;
(function(TalerProtocolTimestamp2) {
  function isTimestamp(x6) {
    return typeof x6 === "object" && x6 !== null && "t_s" in x6 && (typeof x6.t_s === "number" || x6.t_s === "never");
  }
  TalerProtocolTimestamp2.isTimestamp = isTimestamp;
  function now2() {
    return AbsoluteTime.toProtocolTimestamp(AbsoluteTime.now());
  }
  TalerProtocolTimestamp2.now = now2;
  function zero() {
    return {
      t_s: 0
    };
  }
  TalerProtocolTimestamp2.zero = zero;
  function never() {
    return {
      t_s: "never"
    };
  }
  TalerProtocolTimestamp2.never = never;
  function isNever(t5) {
    return t5.t_s === "never";
  }
  TalerProtocolTimestamp2.isNever = isNever;
  function fromSeconds(s6) {
    return {
      t_s: s6
    };
  }
  TalerProtocolTimestamp2.fromSeconds = fromSeconds;
  function min(t1, t22) {
    if (t1.t_s === "never") {
      return { t_s: t22.t_s };
    }
    if (t22.t_s === "never") {
      return { t_s: t1.t_s };
    }
    return { t_s: Math.min(t1.t_s, t22.t_s) };
  }
  TalerProtocolTimestamp2.min = min;
  function max(t1, t22) {
    if (t1.t_s === "never" || t22.t_s === "never") {
      return { t_s: "never" };
    }
    return { t_s: Math.max(t1.t_s, t22.t_s) };
  }
  TalerProtocolTimestamp2.max = max;
})(TalerProtocolTimestamp || (TalerProtocolTimestamp = {}));
var timeshift = 0;
var Duration;
(function(Duration2) {
  function toMilliseconds(d6) {
    if (d6.d_ms === "forever") {
      return Number.MAX_VALUE;
    }
    return d6.d_ms;
  }
  Duration2.toMilliseconds = toMilliseconds;
  function getRemaining(deadline, now2 = AbsoluteTime.now()) {
    if (deadline.t_ms === "never") {
      return { d_ms: "forever" };
    }
    if (now2.t_ms === "never") {
      throw Error("invalid argument for 'now'");
    }
    if (deadline.t_ms < now2.t_ms) {
      return { d_ms: 0 };
    }
    return { d_ms: deadline.t_ms - now2.t_ms };
  }
  Duration2.getRemaining = getRemaining;
  function fromPrettyString(s6) {
    let dMs = 0;
    let currentNum = "";
    let parsingNum = true;
    for (let i5 = 0; i5 < s6.length; i5++) {
      const cc = s6.charCodeAt(i5);
      if (cc >= "0".charCodeAt(0) && cc <= "9".charCodeAt(0)) {
        if (!parsingNum) {
          throw Error("invalid duration, unexpected number");
        }
        currentNum += s6[i5];
        continue;
      }
      if (s6[i5] == " ") {
        if (currentNum != "") {
          parsingNum = false;
        }
        continue;
      }
      if (currentNum == "") {
        throw Error("invalid duration, missing number");
      }
      if (s6[i5] === "s") {
        if (s6.startsWith("seconds", i5)) {
          i5 += "seconds".length - 1;
        }
        dMs += 1e3 * Number.parseInt(currentNum, 10);
      } else if (s6[i5] === "m") {
        if (s6.startsWith("minutes", i5)) {
          i5 += "minutes".length - 1;
        }
        dMs += 60 * 1e3 * Number.parseInt(currentNum, 10);
      } else if (s6[i5] === "h") {
        if (s6.startsWith("hours", i5)) {
          i5 += "hours".length - 1;
        }
        dMs += 60 * 60 * 1e3 * Number.parseInt(currentNum, 10);
      } else if (s6[i5] === "d") {
        if (s6.startsWith("days", i5)) {
          i5 += "days".length - 1;
        }
        dMs += 24 * 60 * 60 * 1e3 * Number.parseInt(currentNum, 10);
      } else {
        throw Error("invalid duration, unsupported unit");
      }
      currentNum = "";
      parsingNum = true;
    }
    return {
      d_ms: dMs
    };
  }
  Duration2.fromPrettyString = fromPrettyString;
  function cmp(d1, d23) {
    if (d1.d_ms === "forever") {
      if (d23.d_ms === "forever") {
        return 0;
      }
      return 1;
    }
    if (d23.d_ms === "forever") {
      return -1;
    }
    if (d1.d_ms == d23.d_ms) {
      return 0;
    }
    if (d1.d_ms > d23.d_ms) {
      return 1;
    }
    return -1;
  }
  Duration2.cmp = cmp;
  function add4(d1, d23) {
    if (d1.d_ms === "forever") {
      return Duration2.getForever();
    }
    if (d23.d_ms === "forever") {
      return Duration2.getForever();
    }
    return Duration2.fromMilliseconds(d1.d_ms + d23.d_ms);
  }
  Duration2.add = add4;
  function max(d1, d23) {
    return durationMax(d1, d23);
  }
  Duration2.max = max;
  function min(d1, d23) {
    return durationMin(d1, d23);
  }
  Duration2.min = min;
  function multiply(d1, n2) {
    return durationMul(d1, n2);
  }
  Duration2.multiply = multiply;
  function toIntegerYears(d6) {
    if (typeof d6.d_ms !== "number") {
      throw Error("infinite duration");
    }
    return Math.ceil(d6.d_ms / 1e3 / 60 / 60 / 24 / 365);
  }
  Duration2.toIntegerYears = toIntegerYears;
  function fromSpec(spec) {
    let d_ms = 0;
    d_ms += (spec.seconds ?? 0) * SECONDS;
    d_ms += (spec.minutes ?? 0) * MINUTES;
    d_ms += (spec.hours ?? 0) * HOURS;
    d_ms += (spec.days ?? 0) * DAYS;
    d_ms += (spec.months ?? 0) * MONTHS;
    d_ms += (spec.years ?? 0) * YEARS;
    return { d_ms };
  }
  Duration2.fromSpec = fromSpec;
  function fromSpecOrUndefined(spec) {
    if (spec.seconds == void 0 && spec.minutes == void 0 && spec.hours == void 0 && spec.days == void 0 && spec.months == void 0 && spec.years == void 0) {
      return void 0;
    }
    return Duration2.fromSpec(spec);
  }
  Duration2.fromSpecOrUndefined = fromSpecOrUndefined;
  function toSpec({ d_ms }) {
    if (d_ms === "forever")
      return void 0;
    const ms = d_ms > 0 ? d_ms : 0;
    const Y_rest = ms % YEARS;
    const M_rest = Y_rest % MONTHS;
    const D_rest = M_rest % DAYS;
    const h_rest = D_rest % HOURS;
    const m_rest = h_rest % MINUTES;
    const millis = m_rest % SECONDS;
    return {
      years: (ms - Y_rest) / YEARS,
      month: (Y_rest - M_rest) / MONTHS,
      days: (M_rest - D_rest) / DAYS,
      hours: (D_rest - h_rest) / HOURS,
      minutes: (h_rest - m_rest) / MINUTES,
      seconds: (m_rest - millis) / SECONDS
    };
  }
  Duration2.toSpec = toSpec;
  function getForever() {
    return { d_ms: "forever" };
  }
  Duration2.getForever = getForever;
  function getZero() {
    return { d_ms: 0 };
  }
  Duration2.getZero = getZero;
  function fromTalerProtocolDuration(d6) {
    if (d6.d_us === "forever") {
      return {
        d_ms: "forever"
      };
    }
    return {
      d_ms: Math.floor(d6.d_us / 1e3)
    };
  }
  Duration2.fromTalerProtocolDuration = fromTalerProtocolDuration;
  function toTalerProtocolDuration(d6) {
    if (d6.d_ms === "forever") {
      return {
        d_us: "forever"
      };
    }
    return {
      d_us: d6.d_ms * 1e3
    };
  }
  Duration2.toTalerProtocolDuration = toTalerProtocolDuration;
  function fromMilliseconds(ms) {
    return {
      d_ms: ms
    };
  }
  Duration2.fromMilliseconds = fromMilliseconds;
  function clamp(args) {
    return durationMax(durationMin(args.value, args.upper), args.lower);
  }
  Duration2.clamp = clamp;
})(Duration || (Duration = {}));
var AbsoluteTime;
(function(AbsoluteTime3) {
  function getStampMsNow() {
    return (/* @__PURE__ */ new Date()).getTime();
  }
  AbsoluteTime3.getStampMsNow = getStampMsNow;
  function getStampMsNever() {
    return Number.MAX_SAFE_INTEGER;
  }
  AbsoluteTime3.getStampMsNever = getStampMsNever;
  function now2() {
    return {
      t_ms: (/* @__PURE__ */ new Date()).getTime() + timeshift,
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.now = now2;
  function zero() {
    return {
      t_ms: 0,
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.zero = zero;
  function never() {
    return {
      t_ms: "never",
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.never = never;
  function fromMilliseconds(ms) {
    return {
      t_ms: ms,
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.fromMilliseconds = fromMilliseconds;
  function cmp(t1, t22) {
    if (t1.t_ms === "never") {
      if (t22.t_ms === "never") {
        return 0;
      }
      return 1;
    }
    if (t22.t_ms === "never") {
      return -1;
    }
    if (t1.t_ms == t22.t_ms) {
      return 0;
    }
    if (t1.t_ms > t22.t_ms) {
      return 1;
    }
    return -1;
  }
  AbsoluteTime3.cmp = cmp;
  function min(t1, t22) {
    if (t1.t_ms === "never") {
      return { t_ms: t22.t_ms, [opaque_AbsoluteTime]: true };
    }
    if (t22.t_ms === "never") {
      return { t_ms: t22.t_ms, [opaque_AbsoluteTime]: true };
    }
    return { t_ms: Math.min(t1.t_ms, t22.t_ms), [opaque_AbsoluteTime]: true };
  }
  AbsoluteTime3.min = min;
  function max(t1, t22) {
    if (t1.t_ms === "never") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    if (t22.t_ms === "never") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    return { t_ms: Math.max(t1.t_ms, t22.t_ms), [opaque_AbsoluteTime]: true };
  }
  AbsoluteTime3.max = max;
  function difference2(t1, t22) {
    if (t1.t_ms === "never") {
      return { d_ms: "forever" };
    }
    if (t22.t_ms === "never") {
      return { d_ms: "forever" };
    }
    return { d_ms: Math.abs(t1.t_ms - t22.t_ms) };
  }
  AbsoluteTime3.difference = difference2;
  function isExpired(t5) {
    return cmp(t5, now2()) <= 0;
  }
  AbsoluteTime3.isExpired = isExpired;
  function isNever(t5) {
    return t5.t_ms === "never";
  }
  AbsoluteTime3.isNever = isNever;
  function fromProtocolTimestamp(t5) {
    if (t5.t_s === "never") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    return {
      t_ms: t5.t_s * 1e3,
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.fromProtocolTimestamp = fromProtocolTimestamp;
  function fromStampMs(stampMs) {
    return {
      t_ms: stampMs,
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.fromStampMs = fromStampMs;
  function fromPreciseTimestamp(t5) {
    if (t5.t_s === "never") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    const offsetUs = t5.off_us ?? 0;
    return {
      t_ms: t5.t_s * 1e3 + Math.floor(offsetUs / 1e3),
      [opaque_AbsoluteTime]: true
    };
  }
  AbsoluteTime3.fromPreciseTimestamp = fromPreciseTimestamp;
  function toStampMs(at2) {
    if (at2.t_ms === "never") {
      return Number.MAX_SAFE_INTEGER;
    }
    return at2.t_ms;
  }
  AbsoluteTime3.toStampMs = toStampMs;
  function toPreciseTimestamp(at2) {
    if (at2.t_ms == "never") {
      return {
        t_s: "never"
      };
    }
    const t_s = Math.floor(at2.t_ms / 1e3);
    const off_us = Math.floor(1e3 * (at2.t_ms - t_s * 1e3));
    return {
      t_s,
      off_us
    };
  }
  AbsoluteTime3.toPreciseTimestamp = toPreciseTimestamp;
  function toProtocolTimestamp(at2) {
    if (at2.t_ms === "never") {
      return { t_s: "never" };
    }
    return {
      t_s: Math.floor(at2.t_ms / 1e3)
    };
  }
  AbsoluteTime3.toProtocolTimestamp = toProtocolTimestamp;
  function isBetween(t5, start, end) {
    if (cmp(t5, start) < 0) {
      return false;
    }
    if (cmp(t5, end) > 0) {
      return false;
    }
    return true;
  }
  AbsoluteTime3.isBetween = isBetween;
  function toIsoString(t5) {
    if (t5.t_ms === "never") {
      return "<never>";
    } else {
      return new Date(t5.t_ms).toISOString();
    }
  }
  AbsoluteTime3.toIsoString = toIsoString;
  function addDuration(t1, d6) {
    if (t1.t_ms === "never" || d6.d_ms === "forever") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    return { t_ms: t1.t_ms + d6.d_ms, [opaque_AbsoluteTime]: true };
  }
  AbsoluteTime3.addDuration = addDuration;
  function remaining(t1) {
    if (t1.t_ms === "never") {
      return Duration.getForever();
    }
    const stampNow = now2();
    if (stampNow.t_ms === "never") {
      throw Error("invariant violated");
    }
    return Duration.fromMilliseconds(Math.max(0, t1.t_ms - stampNow.t_ms));
  }
  AbsoluteTime3.remaining = remaining;
  function subtractDuraction(t1, d6) {
    if (t1.t_ms === "never") {
      return { t_ms: "never", [opaque_AbsoluteTime]: true };
    }
    if (d6.d_ms === "forever") {
      return { t_ms: 0, [opaque_AbsoluteTime]: true };
    }
    return { t_ms: Math.max(0, t1.t_ms - d6.d_ms), [opaque_AbsoluteTime]: true };
  }
  AbsoluteTime3.subtractDuraction = subtractDuraction;
  function stringify(t5) {
    if (t5.t_ms === "never") {
      return "never";
    }
    return new Date(t5.t_ms).toISOString();
  }
  AbsoluteTime3.stringify = stringify;
})(AbsoluteTime || (AbsoluteTime = {}));
var SECONDS = 1e3;
var MINUTES = SECONDS * 60;
var HOURS = MINUTES * 60;
var DAYS = HOURS * 24;
var MONTHS = DAYS * 30;
var YEARS = DAYS * 365;
function durationMin(d1, d23) {
  if (d1.d_ms === "forever") {
    return { d_ms: d23.d_ms };
  }
  if (d23.d_ms === "forever") {
    return { d_ms: d1.d_ms };
  }
  return { d_ms: Math.min(d1.d_ms, d23.d_ms) };
}
function durationMax(d1, d23) {
  if (d1.d_ms === "forever") {
    return { d_ms: "forever" };
  }
  if (d23.d_ms === "forever") {
    return { d_ms: "forever" };
  }
  return { d_ms: Math.max(d1.d_ms, d23.d_ms) };
}
function durationMul(d6, n2) {
  if (d6.d_ms === "forever") {
    return { d_ms: "forever" };
  }
  return { d_ms: Math.round(d6.d_ms * n2) };
}
var codecForAbsoluteTime = {
  decode(x6, c5) {
    if (x6 === void 0) {
      throw Error(`got undefined and expected absolute time at ${renderContext(c5)}`);
    }
    const t_ms = x6.t_ms;
    if (typeof t_ms === "string") {
      if (t_ms === "never") {
        return { t_ms: "never", [opaque_AbsoluteTime]: true };
      }
    } else if (typeof t_ms === "number") {
      return { t_ms, [opaque_AbsoluteTime]: true };
    }
    throw Error(`expected timestamp at ${renderContext(c5)}`);
  }
};
var codecForTimestamp = {
  decode(x6, c5) {
    if (x6 === void 0) {
      throw Error(`got undefined and expected timestamp at ${renderContext(c5)}`);
    }
    const t_ms = x6.t_ms;
    if (typeof t_ms === "string") {
      if (t_ms === "never") {
        return { t_s: "never" };
      }
    } else if (typeof t_ms === "number") {
      return { t_s: Math.floor(t_ms / 1e3) };
    }
    const t_s = x6.t_s;
    if (typeof t_s === "string") {
      if (t_s === "never") {
        return { t_s: "never" };
      }
      throw Error(`expected timestamp at ${renderContext(c5)}`);
    }
    if (typeof t_s === "number") {
      return { t_s };
    }
    throw Error(`expected protocol timestamp at ${renderContext(c5)}`);
  }
};
var codecForPreciseTimestamp = {
  decode(x6, c5) {
    const t_ms = x6.t_ms;
    if (typeof t_ms === "string") {
      if (t_ms === "never") {
        return { t_s: "never" };
      }
    } else if (typeof t_ms === "number") {
      return { t_s: Math.floor(t_ms / 1e3) };
    }
    throw Error(`expected precise timestamp at ${renderContext(c5)}`);
  }
};
var codecForDuration = {
  decode(x6, c5) {
    const d_us = x6.d_us;
    if (typeof d_us === "string") {
      if (d_us === "forever") {
        return { d_us: "forever" };
      }
      throw Error(`expected duration at ${renderContext(c5)}`);
    }
    if (typeof d_us === "number") {
      return { d_us };
    }
    throw Error(`expected duration at ${renderContext(c5)}`);
  }
};

// ../taler-util/lib/http-common.js
var textEncoder = new TextEncoder();
var logger2 = new Logger("http.ts");
var DEFAULT_REQUEST_TIMEOUT_MS = 6e4;
var HeadersImpl = class {
  constructor() {
    this.headerMap = /* @__PURE__ */ new Map();
  }
  get(name) {
    const r3 = this.headerMap.get(name.toLowerCase());
    if (r3) {
      return r3;
    }
    return null;
  }
  set(name, value) {
    const normalizedName = name.toLowerCase();
    const existing = this.headerMap.get(normalizedName);
    if (existing !== void 0) {
      this.headerMap.set(normalizedName, existing + "," + value);
    } else {
      this.headerMap.set(normalizedName, value);
    }
  }
  toJSON() {
    const m6 = {};
    this.headerMap.forEach((v3, k6) => m6[k6] = v3);
    return m6;
  }
};
async function readTalerErrorResponse(httpResponse) {
  const contentType = httpResponse.headers.get("content-type");
  if (contentType !== "application/json") {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      contentType: contentType || "<null>"
    }, "Error response did not even contain JSON. The request URL might be wrong or the service might be unavailable.");
  }
  let errJson;
  try {
    errJson = await httpResponse.json();
  } catch (e5) {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      validationError: e5 instanceof Error ? e5.message : String(e5)
    }, "Couldn't parse JSON format from error response");
  }
  const talerErrorCode = errJson.code;
  if (typeof talerErrorCode !== "number") {
    logger2.warn(`malformed error response (status ${httpResponse.status}): ${j2s(errJson)}`);
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text()
    }, "Error response did not contain error code");
  }
  return errJson;
}
async function readSuccessResponseJsonOrErrorCode(httpResponse, codec) {
  if (!(httpResponse.status >= 200 && httpResponse.status < 300)) {
    return {
      isError: true,
      talerErrorResponse: await readTalerErrorResponse(httpResponse)
    };
  }
  let respJson;
  try {
    respJson = await httpResponse.json();
  } catch (e5) {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      validationError: e5 instanceof Error ? e5.message : String(e5)
    }, "Couldn't parse JSON format from response");
  }
  let parsedResponse;
  try {
    parsedResponse = codec.decode(respJson);
  } catch (e5) {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      validationError: e5 instanceof Error ? e5.message : String(e5)
    }, "Response invalid");
  }
  return {
    isError: false,
    response: parsedResponse
  };
}
async function readResponseJsonOrThrow(httpResponse, codec) {
  let respJson;
  try {
    respJson = await httpResponse.json();
  } catch (e5) {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      validationError: e5 instanceof Error ? e5.message : String(e5)
    }, "Couldn't parse JSON format from response");
  }
  let parsedResponse;
  try {
    parsedResponse = codec.decode(respJson);
  } catch (e5) {
    throw TalerError.fromDetail(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, {
      requestUrl: httpResponse.requestUrl,
      requestMethod: httpResponse.requestMethod,
      httpStatusCode: httpResponse.status,
      response: await httpResponse.text(),
      validationError: e5 instanceof Error ? e5.message : String(e5)
    }, "Response invalid");
  }
  return parsedResponse;
}
function throwUnexpectedRequestError(httpResponse, talerErrorResponse) {
  const errorDetails = {
    requestUrl: httpResponse.requestUrl,
    requestMethod: httpResponse.requestMethod,
    httpStatusCode: httpResponse.status,
    errorResponse: talerErrorResponse
  };
  logger2.trace(`unexpected request error: ${j2s(errorDetails)}`);
  throw TalerError.fromDetail(TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR, errorDetails, `Unexpected HTTP status ${httpResponse.status} in response`);
}
async function readSuccessResponseJsonOrThrow(httpResponse, codec) {
  const r3 = await readSuccessResponseJsonOrErrorCode(httpResponse, codec);
  if (!r3.isError) {
    return r3.response;
  }
  throwUnexpectedRequestError(httpResponse, r3.talerErrorResponse);
}
function encodeBody(body) {
  if (body == null) {
    return new ArrayBuffer(0);
  }
  if (typeof body === "string") {
    return textEncoder.encode(body).buffer;
  } else if (ArrayBuffer.isView(body)) {
    return body.buffer;
  } else if (body instanceof ArrayBuffer) {
    return body;
  } else if (body instanceof URLSearchParams) {
    return textEncoder.encode(body.toString()).buffer;
  } else if (typeof body === "object" && body.constructor.name === "FormData") {
    return body;
  } else if (typeof body === "object") {
    return textEncoder.encode(JSON.stringify(body)).buffer;
  }
  throw new TypeError("unsupported request body type");
}
function getDefaultHeaders(method) {
  const headers = {};
  if (method === "POST" || method === "PUT" || method === "PATCH") {
    headers["Content-Type"] = "application/json";
  }
  headers["Accept"] = "application/json";
  return headers;
}
function makeBasicAuthHeader(username, password) {
  const auth = `${username}:${password}`;
  const authEncoded = base64FromArrayBuffer(stringToBytes(auth));
  return `Basic ${authEncoded}`;
}

// ../taler-util/lib/libtool-version.js
var LibtoolVersion;
(function(LibtoolVersion2) {
  function compare2(me, other) {
    const meVer = parseVersion(me);
    const otherVer = parseVersion(other);
    if (!(meVer && otherVer)) {
      return void 0;
    }
    const compatible = meVer.current - meVer.age <= otherVer.current && meVer.current >= otherVer.current - otherVer.age;
    const currentCmp = Math.sign(meVer.current - otherVer.current);
    return { compatible, currentCmp };
  }
  LibtoolVersion2.compare = compare2;
  function parseVersionOrThrow(v3) {
    const res = parseVersion(v3);
    if (!res) {
      throw Error("invalid libtool version");
    }
    return res;
  }
  LibtoolVersion2.parseVersionOrThrow = parseVersionOrThrow;
  function parseVersion(v3) {
    const [currentStr, revisionStr, ageStr, ...rest] = v3.split(":");
    if (rest.length !== 0) {
      return void 0;
    }
    const current = Number.parseInt(currentStr);
    const revision = Number.parseInt(revisionStr);
    const age = Number.parseInt(ageStr);
    if (Number.isNaN(current)) {
      return void 0;
    }
    if (Number.isNaN(revision)) {
      return void 0;
    }
    if (Number.isNaN(age)) {
      return void 0;
    }
    return { current, revision, age };
  }
  LibtoolVersion2.parseVersion = parseVersion;
})(LibtoolVersion || (LibtoolVersion = {}));

// ../taler-util/lib/types-taler-common.js
var codecForURLString = codecForString;
var codecForCurrencyName = codecForString;
var codecForDecimalNumber = codecForString;
var codecForEddsaPublicKey = codecForString;
var codecForEddsaSignature = codecForString;
var codecForInternationalizedString = () => codecForMap(codecForString());
var codecForCurrencySpecificiation = () => buildCodecForObject().property("name", codecForString()).property("num_fractional_input_digits", codecForNumber()).property("num_fractional_normal_digits", codecForNumber()).property("num_fractional_trailing_zero_digits", codecForNumber()).property("alt_unit_names", codecForMap(codecForString())).property("common_amounts", codecOptional(codecForList(codecForAmountString()))).deprecatedProperty("currency").build("CurrencySpecification");
var codecForTalerCommonConfigResponse = () => buildCodecForObject().allowExtra().property("name", codecForString()).property("version", codecForString()).build("TalerCommonConfigResponse");
var ExchangeProtocolVersion;
(function(ExchangeProtocolVersion2) {
  ExchangeProtocolVersion2[ExchangeProtocolVersion2["V12"] = 12] = "V12";
})(ExchangeProtocolVersion || (ExchangeProtocolVersion = {}));
var MerchantProtocolVersion;
(function(MerchantProtocolVersion2) {
  MerchantProtocolVersion2[MerchantProtocolVersion2["V3"] = 3] = "V3";
})(MerchantProtocolVersion || (MerchantProtocolVersion = {}));
var codecForTokenInfo = () => buildCodecForObject().property("creation_time", codecForTimestamp).property("expiration", codecForTimestamp).property("scope", codecForString()).property("refreshable", codecForBoolean()).property("description", codecOptional(codecForString())).property("serial", codecForNumber()).build("TokenInfo");
var codecForTokenInfoList = () => buildCodecForObject().property("tokens", codecForList(codecForTokenInfo())).build("TokenInfoList");
var codecForAccessToken = codecForString;
var codecForTokenSuccessResponse = () => buildCodecForObject().property("access_token", codecForAccessToken()).property("expiration", codecForTimestamp).build("TalerAuthentication.TokenSuccessResponse");
var codecForURN = codecForString;

// ../taler-util/lib/operation.js
function isOperationOk(c5) {
  return c5.type === "ok";
}
function isOperationFail(c5) {
  return c5.type === "fail";
}
async function opSuccessFromHttp(resp, codec) {
  const body = await readSuccessResponseJsonOrThrow(resp, codec);
  return { type: "ok", case: "ok", body };
}
function opFixedSuccess(body) {
  return { type: "ok", case: "ok", body };
}
function opEmptySuccess() {
  return { type: "ok", case: "ok", body: void 0 };
}
function opKnownFailure(case_) {
  return { type: "fail", case: case_ };
}
function opKnownFailureWithBody(case_, body) {
  return { type: "fail", case: case_, body };
}
async function carefullyParseConfig(expectedName, clientVersion, httpResponse, codec) {
  const minBody = await readSuccessResponseJsonOrThrow(httpResponse, codecForTalerCommonConfigResponse());
  if (minBody.name !== expectedName) {
    throw TalerError.fromUncheckedDetail({
      code: TalerErrorCode.GENERIC_UNEXPECTED_REQUEST_ERROR,
      requestUrl: httpResponse.requestUrl,
      httpStatusCode: httpResponse.status,
      detail: `Unexpected server component name (got ${minBody.name}, expected ${expectedName}})`
    });
  }
  if (!LibtoolVersion.compare(clientVersion, minBody.version)) {
    throw TalerError.fromUncheckedDetail({
      code: TalerErrorCode.GENERIC_CLIENT_UNSUPPORTED_PROTOCOL_VERSION,
      requestUrl: httpResponse.requestUrl,
      httpStatusCode: httpResponse.status,
      detail: `Unsupported protocol version, client supports ${clientVersion}, server supports ${minBody.version}`
    });
  }
  const body = await readSuccessResponseJsonOrThrow(httpResponse, codec);
  return opFixedSuccess(body);
}
async function opKnownAlternativeHttpFailure(resp, s6, codec) {
  const body = await readResponseJsonOrThrow(resp, codec);
  return { type: "fail", case: s6, body };
}
async function opKnownHttpFailure(_case, resp, detail) {
  if (!detail) {
    detail = await readTalerErrorResponse(resp);
  }
  return { type: "fail", case: _case, detail };
}
async function opUnknownHttpFailure(resp, detail) {
  if (!detail) {
    detail = await readTalerErrorResponse(resp);
  }
  throw TalerError.fromDetail(TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR, {
    requestUrl: resp.requestUrl,
    requestMethod: resp.requestMethod,
    httpStatusCode: resp.status,
    errorResponse: detail
  }, `Unexpected HTTP status ${resp.status} in response`);
}
function opKnownTalerFailure(_case, detail) {
  return { type: "fail", case: _case, detail };
}
function succeedOrThrow(resp) {
  if (isOperationOk(resp)) {
    return resp.body;
  }
  if (isOperationFail(resp)) {
    throw TalerError.fromUncheckedDetail({ ...resp, case: resp.case });
  }
  throw TalerError.fromException(resp);
}

// ../taler-util/lib/amounts.js
var amountFractionalBase = 1e8;
var amountFractionalLength = 8;
var amountMaxValue = 2 ** 52;
var FRAC_SEPARATOR = ".";
var CURRENCY_SEPARATOR = ":";
var Amount = class _Amount {
  static from(a6) {
    return new _Amount(Amounts.parseOrThrow(a6), 0);
  }
  static zeroOfCurrency(currency) {
    return new _Amount(Amounts.zeroOfCurrency(currency), 0);
  }
  add(...a6) {
    if (this.saturated) {
      return this;
    }
    const r3 = Amounts.add(this.val, ...a6);
    return new _Amount(r3.amount, r3.saturated ? 1 : 0);
  }
  isZero() {
    return this.val.fraction === 0 && this.val.value === 0;
  }
  sub(...a6) {
    if (this.saturated) {
      return this;
    }
    const r3 = Amounts.sub(this.val, ...a6);
    return new _Amount(r3.amount, r3.saturated ? 1 : 0);
  }
  mult(n2) {
    if (this.saturated) {
      return this;
    }
    const r3 = Amounts.mult(this, n2);
    return new _Amount(r3.amount, r3.saturated ? 1 : 0);
  }
  toJson() {
    return { ...this.val };
  }
  toString() {
    return Amounts.stringify(this.val);
  }
  constructor(val, saturated) {
    this.val = val;
    this.saturated = saturated;
  }
};
function codecForAmountString() {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (Amounts.parse(x6) === void 0) {
        throw new DecodingError(`invalid amount at ${renderContext(c5)} got "${x6}"`);
      }
      return x6;
    }
  };
}
var AmountParseError;
(function(AmountParseError2) {
  AmountParseError2[AmountParseError2["MISSING_CURRENCY"] = 0] = "MISSING_CURRENCY";
  AmountParseError2[AmountParseError2["CURRENCY_TOO_LONG"] = 1] = "CURRENCY_TOO_LONG";
  AmountParseError2[AmountParseError2["BAD_CURRENCY"] = 2] = "BAD_CURRENCY";
  AmountParseError2[AmountParseError2["BAD_NUMBER"] = 3] = "BAD_NUMBER";
  AmountParseError2[AmountParseError2["TOO_HIGH"] = 4] = "TOO_HIGH";
  AmountParseError2[AmountParseError2["TOO_PRECISE"] = 5] = "TOO_PRECISE";
})(AmountParseError || (AmountParseError = {}));
var Amounts = class _Amounts {
  constructor() {
    throw Error("not instantiable");
  }
  static currencyOf(amount) {
    const amt = _Amounts.parseOrThrow(amount);
    return amt.currency;
  }
  static zeroOfAmount(amount) {
    const amt = _Amounts.parseOrThrow(amount);
    return {
      currency: amt.currency,
      fraction: 0,
      value: 0
    };
  }
  /**
   * Get an amount that represents zero units of a currency.
   */
  static zeroOfCurrency(currency) {
    return {
      currency,
      fraction: 0,
      value: 0
    };
  }
  static jsonifyAmount(amt) {
    if (typeof amt === "string") {
      return _Amounts.parseOrThrow(amt);
    }
    if (amt instanceof Amount) {
      return amt.toJson();
    }
    return amt;
  }
  static divmod(a1, a23) {
    const am1 = _Amounts.jsonifyAmount(a1);
    const am2 = _Amounts.jsonifyAmount(a23);
    if (am1.currency != am2.currency) {
      throw Error(`incompatible currency (${am1.currency} vs${am2.currency})`);
    }
    const x1 = BigInt(am1.value) * BigInt(amountFractionalBase) + BigInt(am1.fraction);
    const x22 = BigInt(am2.value) * BigInt(amountFractionalBase) + BigInt(am2.fraction);
    const quotient = x1 / x22;
    const remainderScaled = x1 % x22;
    return {
      quotient: Number(quotient),
      remainder: {
        currency: am1.currency,
        value: Number(remainderScaled / BigInt(amountFractionalBase)),
        fraction: Number(remainderScaled % BigInt(amountFractionalBase))
      }
    };
  }
  static sum(amounts) {
    if (amounts.length <= 0) {
      throw Error("can't sum zero amounts");
    }
    const jsonAmounts = amounts.map((x6) => _Amounts.jsonifyAmount(x6));
    return _Amounts.add(jsonAmounts[0], ...jsonAmounts.slice(1));
  }
  static sumOrZero(currency, amounts) {
    if (amounts.length <= 0) {
      return {
        amount: _Amounts.zeroOfCurrency(currency),
        saturated: false
      };
    }
    const jsonAmounts = amounts.map((x6) => _Amounts.jsonifyAmount(x6));
    return _Amounts.add(jsonAmounts[0], ...jsonAmounts.slice(1));
  }
  /**
   * Add two amounts.  Return the result and whether
   * the addition overflowed.  The overflow is always handled
   * by saturating and never by wrapping.
   *
   * Throws when currencies don't match.
   */
  static add(first, ...rest) {
    const firstJ = _Amounts.jsonifyAmount(first);
    const currency = firstJ.currency;
    let value = firstJ.value + Math.floor(firstJ.fraction / amountFractionalBase);
    if (value > amountMaxValue) {
      return {
        amount: {
          currency,
          value: amountMaxValue,
          fraction: amountFractionalBase - 1
        },
        saturated: true
      };
    }
    let fraction = firstJ.fraction % amountFractionalBase;
    for (const x6 of rest) {
      const xJ = _Amounts.jsonifyAmount(x6);
      if (xJ.currency.toUpperCase() !== currency.toUpperCase()) {
        throw Error(`Mismatched currency: ${xJ.currency} and ${currency}`);
      }
      value = value + xJ.value + Math.floor((fraction + xJ.fraction) / amountFractionalBase);
      fraction = Math.floor((fraction + xJ.fraction) % amountFractionalBase);
      if (value > amountMaxValue) {
        return {
          amount: {
            currency,
            value: amountMaxValue,
            fraction: amountFractionalBase - 1
          },
          saturated: true
        };
      }
    }
    return { amount: { currency, value, fraction }, saturated: false };
  }
  /**
   * Subtract two amounts.  Return the result and whether
   * the subtraction overflowed.  The overflow is always handled
   * by saturating and never by wrapping.
   *
   * Throws when currencies don't match.
   */
  static sub(a6, ...rest) {
    const aJ = _Amounts.jsonifyAmount(a6);
    const currency = aJ.currency;
    let value = aJ.value;
    let fraction = aJ.fraction;
    for (const b5 of rest) {
      const bJ = _Amounts.jsonifyAmount(b5);
      if (bJ.currency.toUpperCase() !== aJ.currency.toUpperCase()) {
        throw Error(`Mismatched currency: ${bJ.currency} and ${currency}`);
      }
      if (fraction < bJ.fraction) {
        if (value < 1) {
          return {
            amount: { currency, value: 0, fraction: 0 },
            saturated: true
          };
        }
        value--;
        fraction += amountFractionalBase;
      }
      console.assert(fraction >= bJ.fraction);
      fraction -= bJ.fraction;
      if (value < bJ.value) {
        return { amount: { currency, value: 0, fraction: 0 }, saturated: true };
      }
      value -= bJ.value;
    }
    return { amount: { currency, value, fraction }, saturated: false };
  }
  /**
   * Compare two amounts.  Returns 0 when equal, -1 when a < b
   * and +1 when a > b.  Throws when currencies don't match.
   */
  static cmp(a6, b5) {
    a6 = _Amounts.jsonifyAmount(a6);
    b5 = _Amounts.jsonifyAmount(b5);
    if (a6.currency !== b5.currency) {
      throw Error(`Mismatched currency: ${a6.currency} and ${b5.currency}`);
    }
    const av = a6.value + Math.floor(a6.fraction / amountFractionalBase);
    const af = a6.fraction % amountFractionalBase;
    const bv = b5.value + Math.floor(b5.fraction / amountFractionalBase);
    const bf = b5.fraction % amountFractionalBase;
    switch (true) {
      case av < bv:
        return -1;
      case av > bv:
        return 1;
      case af < bf:
        return -1;
      case af > bf:
        return 1;
      case af === bf:
        return 0;
      default:
        throw Error("assertion failed");
    }
  }
  /**
   * Create a copy of an amount.
   */
  static copy(a6) {
    return {
      currency: a6.currency,
      fraction: a6.fraction,
      value: a6.value
    };
  }
  /**
   * Divide an amount.  Throws on division by zero.
   */
  static divide(a6, n2) {
    if (n2 === 0) {
      throw Error(`Division by 0`);
    }
    if (n2 === 1) {
      return { value: a6.value, fraction: a6.fraction, currency: a6.currency };
    }
    const r3 = a6.value % n2;
    return {
      currency: a6.currency,
      fraction: Math.floor((r3 * amountFractionalBase + a6.fraction) / n2),
      value: Math.floor(a6.value / n2)
    };
  }
  /**
   * Check if an amount is non-zero.
   */
  static isNonZero(a6) {
    a6 = _Amounts.jsonifyAmount(a6);
    return a6.value > 0 || a6.fraction > 0;
  }
  static isZero(a6) {
    a6 = _Amounts.jsonifyAmount(a6);
    return a6.value === 0 && a6.fraction === 0;
  }
  /**
   * Check whether a string is a valid currency for a Taler amount.
   */
  static isCurrency(s6) {
    return /^[a-zA-Z]{1,11}$/.test(s6);
  }
  /**
   * Parse an amount like 'EUR:20.5' for 20 Euros and 50 ct.
   *
   * Currency name size limit is 11 of ASCII letters
   * Fraction size limit is 8
   */
  static parseWithError(s6) {
    const c_idx = s6.indexOf(CURRENCY_SEPARATOR);
    if (c_idx === -1 || c_idx === 0) {
      return opKnownFailure(AmountParseError.MISSING_CURRENCY);
    }
    if (c_idx > 11) {
      return opKnownFailure(AmountParseError.MISSING_CURRENCY);
    }
    const currency = s6.substring(0, c_idx).toUpperCase();
    if (!/^[a-zA-Z]+$/.test(currency)) {
      return opKnownFailure(AmountParseError.BAD_CURRENCY);
    }
    const number = s6.substring(c_idx + 1);
    const d_idx = number.indexOf(FRAC_SEPARATOR);
    const integerStr = d_idx === -1 ? number : number.substring(0, d_idx);
    const fractStr = d_idx === -1 || d_idx === number.length ? "0" : number.substring(d_idx + 1);
    if (!/^[0-9]+$/.test(integerStr) || !/^[0-9]+$/.test(fractStr)) {
      return opKnownFailure(AmountParseError.BAD_NUMBER);
    }
    const value = Number.parseInt(integerStr, 10);
    const fraction = Math.round(amountFractionalBase * Number.parseFloat(FRAC_SEPARATOR + fractStr));
    if (!Number.isInteger(value) || !Number.isInteger(fraction)) {
      return opKnownFailure(AmountParseError.BAD_NUMBER);
    }
    if (value > amountMaxValue) {
      return opKnownFailure(AmountParseError.TOO_HIGH);
    }
    if (fractStr.length > amountFractionalLength) {
      return opKnownFailure(AmountParseError.TOO_PRECISE);
    }
    return opFixedSuccess({
      currency,
      fraction,
      value
    });
  }
  /**
   * Parse an amount like 'EUR:20.5' for 20 Euros and 50 ct.
   *
   * Currency name size limit is 11 of ASCII letters
   * Fraction size limit is 8
   */
  static parse(s6) {
    const res = s6.match(/^([a-zA-Z]{1,11}):([0-9]+)([.][0-9]{1,8})?$/);
    if (!res) {
      return void 0;
    }
    const tail = res[3] || FRAC_SEPARATOR + "0";
    if (tail.length > amountFractionalLength + 1) {
      return void 0;
    }
    const value = Number.parseInt(res[2]);
    if (value > amountMaxValue) {
      return void 0;
    }
    return {
      currency: res[1].toUpperCase(),
      fraction: Math.round(amountFractionalBase * Number.parseFloat(tail)),
      value
    };
  }
  /**
   * Parse amount in standard string form (like 'EUR:20.5'),
   * throw if the input is not a valid amount.
   */
  static parseOrThrow(s6) {
    if (s6 instanceof Amount) {
      return s6.toJson();
    }
    if (typeof s6 === "object") {
      if (typeof s6.currency !== "string") {
        throw Error("invalid amount object");
      }
      if (typeof s6.value !== "number") {
        throw Error("invalid amount object");
      }
      if (typeof s6.fraction !== "number") {
        throw Error("invalid amount object");
      }
      return { currency: s6.currency, value: s6.value, fraction: s6.fraction };
    } else if (typeof s6 === "string") {
      const res = _Amounts.parse(s6);
      if (!res) {
        throw Error(`Can't parse amount: "${s6}"`);
      }
      return res;
    } else {
      throw Error("invalid amount (illegal type)");
    }
  }
  static min(a6, b5) {
    const cr = _Amounts.cmp(a6, b5);
    if (cr >= 0) {
      return _Amounts.jsonifyAmount(b5);
    } else {
      return _Amounts.jsonifyAmount(a6);
    }
  }
  static max(a6, b5) {
    const cr = _Amounts.cmp(a6, b5);
    if (cr >= 0) {
      return _Amounts.jsonifyAmount(a6);
    } else {
      return _Amounts.jsonifyAmount(b5);
    }
  }
  static mult(a6, n2) {
    a6 = this.jsonifyAmount(a6);
    if (!Number.isInteger(n2)) {
      throw Error("amount can only be multiplied by an integer");
    }
    if (n2 < 0) {
      throw Error("amount can only be multiplied by a positive integer");
    }
    if (n2 == 0) {
      return {
        amount: _Amounts.zeroOfCurrency(a6.currency),
        saturated: false
      };
    }
    let x6 = a6;
    let acc = _Amounts.zeroOfCurrency(a6.currency);
    while (n2 > 1) {
      if (n2 % 2 == 0) {
        n2 = n2 / 2;
      } else {
        n2 = (n2 - 1) / 2;
        const r23 = _Amounts.add(acc, x6);
        if (r23.saturated) {
          return r23;
        }
        acc = r23.amount;
      }
      const r22 = _Amounts.add(x6, x6);
      if (r22.saturated) {
        return r22;
      }
      x6 = r22.amount;
    }
    return _Amounts.add(acc, x6);
  }
  /**
   * Check if the argument is a valid amount in string form.
   */
  static check(a6) {
    if (typeof a6 !== "string") {
      return false;
    }
    try {
      const parsedAmount = _Amounts.parse(a6);
      return !!parsedAmount;
    } catch {
      return false;
    }
  }
  /**
   * Convert to standard human-readable string representation that's
   * also used in JSON formats.
   */
  static stringify(a6) {
    a6 = _Amounts.jsonifyAmount(a6);
    const s6 = this.stringifyValue(a6);
    return `${a6.currency}:${s6}`;
  }
  /**
   * Show an amount in a form suitable for the user.
   * FIXME:  In the future, this should consider currency-specific
   * settings such as significant digits or currency symbols.
   */
  static toPretty(amount) {
    const x6 = amount.value + amount.fraction / amountFractionalBase;
    return `${x6} ${amount.currency}`;
  }
  static amountHasSameCurrency(a1, a23) {
    const x1 = this.jsonifyAmount(a1);
    const x22 = this.jsonifyAmount(a23);
    return x1.currency.toUpperCase() === x22.currency.toUpperCase();
  }
  static isSameCurrency(curr1, curr2) {
    return curr1.toLowerCase() === curr2.toLowerCase();
  }
  static stringifyValue(a6, minFractional = 0) {
    const aJ = _Amounts.jsonifyAmount(a6);
    const av = aJ.value + Math.floor(aJ.fraction / amountFractionalBase);
    const af = aJ.fraction % amountFractionalBase;
    let s6 = av.toString();
    if (af || minFractional) {
      s6 = s6 + FRAC_SEPARATOR;
      let n2 = af;
      for (let i5 = 0; i5 < amountFractionalLength; i5++) {
        if (!n2 && i5 >= minFractional) {
          break;
        }
        s6 = s6 + Math.floor(n2 / amountFractionalBase * 10).toString();
        n2 = n2 * 10 % amountFractionalBase;
      }
    }
    return s6;
  }
  /**
   * Number of fractional digits needed to fully represent the amount
   * @param a amount
   * @returns
   */
  static maxFractionalDigits(a6) {
    if (a6.fraction === 0)
      return 0;
    if (a6.fraction < 0) {
      console.error("amount fraction can not be negative", a6);
      return 0;
    }
    let i5 = 0;
    let check = true;
    let rest = a6.fraction;
    while (rest > 0 && check) {
      check = rest % 10 === 0;
      rest = rest / 10;
      i5++;
    }
    return amountFractionalLength - i5 + 1;
  }
  static stringifyValueWithSpec(value, spec) {
    const strValue = _Amounts.stringifyValue(value);
    const pos = strValue.indexOf(FRAC_SEPARATOR);
    const originalPosition = pos < 0 ? strValue.length : pos;
    let currency = value.currency;
    const names3 = Object.keys(spec.alt_unit_names);
    let FRAC_POS_NEW_POSITION = originalPosition;
    if (names3.length > 0) {
      let unitIndex = "0";
      names3.forEach((index2) => {
        const i5 = Number.parseInt(index2, 10);
        if (Number.isNaN(i5))
          return;
        if (originalPosition - i5 <= 0)
          return;
        if (originalPosition - i5 < FRAC_POS_NEW_POSITION) {
          FRAC_POS_NEW_POSITION = originalPosition - i5;
          unitIndex = index2;
        }
      });
      currency = spec.alt_unit_names[unitIndex];
    }
    if (originalPosition === FRAC_POS_NEW_POSITION) {
      const { normal: normal2, small: small2 } = splitNormalAndSmall(strValue, originalPosition, spec);
      return { currency, normal: normal2, small: small2 };
    }
    const intPart = strValue.substring(0, originalPosition);
    const fracPArt = strValue.substring(originalPosition + 1);
    const newValue = intPart.substring(0, FRAC_POS_NEW_POSITION) + FRAC_SEPARATOR + intPart.substring(FRAC_POS_NEW_POSITION) + fracPArt;
    const { normal, small } = splitNormalAndSmall(newValue, FRAC_POS_NEW_POSITION, spec);
    return { currency, normal, small };
  }
};
function splitNormalAndSmall(decimal, fracSeparatorIndex, spec) {
  let normal;
  let small;
  if (decimal.length - fracSeparatorIndex - 1 > spec.num_fractional_normal_digits) {
    const limit = fracSeparatorIndex + spec.num_fractional_normal_digits + 1;
    normal = decimal.substring(0, limit);
    small = decimal.substring(limit);
  } else {
    normal = decimal;
    small = void 0;
  }
  return { normal, small };
}

// ../taler-util/lib/http-impl.missing.js
var HttpLibImpl = class {
  fetch(url, opt) {
    throw new Error("Method not implemented.");
  }
};

// ../taler-util/lib/http.js
function createPlatformHttpLib(args) {
  return new HttpLibImpl(args);
}

// ../taler-util/lib/bank-api-client.js
var logger3 = new Logger("bank-api-client.ts");
var CreditDebitIndicator;
(function(CreditDebitIndicator2) {
  CreditDebitIndicator2["Credit"] = "credit";
  CreditDebitIndicator2["Debit"] = "debit";
})(CreditDebitIndicator || (CreditDebitIndicator = {}));

// ../taler-util/lib/base64.js
function base64FromArrayBuffer(arrayBuffer) {
  var base64 = "";
  var encodings = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var bytes = new Uint8Array(arrayBuffer);
  var byteLength = bytes.byteLength;
  var byteRemainder = byteLength % 3;
  var mainLength = byteLength - byteRemainder;
  var a6, b5, c5, d6;
  var chunk;
  for (var i5 = 0; i5 < mainLength; i5 = i5 + 3) {
    chunk = bytes[i5] << 16 | bytes[i5 + 1] << 8 | bytes[i5 + 2];
    a6 = (chunk & 16515072) >> 18;
    b5 = (chunk & 258048) >> 12;
    c5 = (chunk & 4032) >> 6;
    d6 = chunk & 63;
    base64 += encodings[a6] + encodings[b5] + encodings[c5] + encodings[d6];
  }
  if (byteRemainder == 1) {
    chunk = bytes[mainLength];
    a6 = (chunk & 252) >> 2;
    b5 = (chunk & 3) << 4;
    base64 += encodings[a6] + encodings[b5] + "==";
  } else if (byteRemainder == 2) {
    chunk = bytes[mainLength] << 8 | bytes[mainLength + 1];
    a6 = (chunk & 64512) >> 10;
    b5 = (chunk & 1008) >> 4;
    c5 = (chunk & 15) << 2;
    base64 += encodings[a6] + encodings[b5] + encodings[c5] + "=";
  }
  return base64;
}

// ../taler-util/lib/bech32.js
var CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
var GENERATOR = [996825010, 642813549, 513874426, 1027748829, 705979059];
function polymod(values) {
  var chk = 1;
  for (var p4 = 0; p4 < values.length; ++p4) {
    var top = chk >> 25;
    chk = (chk & 33554431) << 5 ^ values[p4];
    for (var i5 = 0; i5 < 5; ++i5) {
      if (top >> i5 & 1) {
        chk ^= GENERATOR[i5];
      }
    }
  }
  return chk;
}
function hrpExpand(hrp) {
  const ret = [];
  for (let p4 = 0; p4 < hrp.length; ++p4) {
    ret.push(hrp.charCodeAt(p4) >> 5);
  }
  ret.push(0);
  for (let p4 = 0; p4 < hrp.length; ++p4) {
    ret.push(hrp.charCodeAt(p4) & 31);
  }
  return ret;
}
function getEncodingConst(enc) {
  switch (enc) {
    case BitcoinBech32.Encodings.BECH32:
      return 1;
    case BitcoinBech32.Encodings.BECH32M:
      return 734539939;
    default: {
      assertUnreachable(enc);
    }
  }
}
function verifyChecksum(hrp, data, enc) {
  return polymod(hrpExpand(hrp).concat(data)) === getEncodingConst(enc);
}
function createChecksum(hrp, data, enc) {
  const values = hrpExpand(hrp).concat(data).concat([0, 0, 0, 0, 0, 0]);
  const mod = polymod(values) ^ getEncodingConst(enc);
  const ret = [];
  for (let p4 = 0; p4 < 6; ++p4) {
    ret.push(mod >> 5 * (5 - p4) & 31);
  }
  return ret;
}
var BitcoinBech32;
(function(BitcoinBech322) {
  let Encodings;
  (function(Encodings2) {
    Encodings2["BECH32"] = "bech32";
    Encodings2["BECH32M"] = "bech32m";
  })(Encodings = BitcoinBech322.Encodings || (BitcoinBech322.Encodings = {}));
  ;
  function encode2(hrp, data, enc) {
    var combined = data.concat(createChecksum(hrp, data, enc));
    var ret = hrp + "1";
    for (var p4 = 0; p4 < combined.length; ++p4) {
      ret += CHARSET.charAt(combined[p4]);
    }
    return ret;
  }
  BitcoinBech322.encode = encode2;
  let BitcoinParseError;
  (function(BitcoinParseError2) {
    BitcoinParseError2[BitcoinParseError2["WRONG_CHARSET"] = 0] = "WRONG_CHARSET";
    BitcoinParseError2[BitcoinParseError2["MIXING_UPPER_AND_LOWER"] = 1] = "MIXING_UPPER_AND_LOWER";
    BitcoinParseError2[BitcoinParseError2["MISSING_HRP"] = 2] = "MISSING_HRP";
    BitcoinParseError2[BitcoinParseError2["TOO_LONG"] = 3] = "TOO_LONG";
    BitcoinParseError2[BitcoinParseError2["TOO_SHORT"] = 4] = "TOO_SHORT";
    BitcoinParseError2[BitcoinParseError2["WRONG_CHECKSUM"] = 5] = "WRONG_CHECKSUM";
  })(BitcoinParseError = BitcoinBech322.BitcoinParseError || (BitcoinBech322.BitcoinParseError = {}));
  function decode2(bechString, enc) {
    let p4;
    let has_lower = false;
    let has_upper = false;
    for (p4 = 0; p4 < bechString.length; ++p4) {
      if (bechString.charCodeAt(p4) < 33 || bechString.charCodeAt(p4) > 126) {
        return opKnownFailure(BitcoinParseError.WRONG_CHARSET);
      }
      if (bechString.charCodeAt(p4) >= 97 && bechString.charCodeAt(p4) <= 122) {
        has_lower = true;
      }
      if (bechString.charCodeAt(p4) >= 65 && bechString.charCodeAt(p4) <= 90) {
        has_upper = true;
      }
    }
    if (has_lower && has_upper) {
      return opKnownFailure(BitcoinParseError.MIXING_UPPER_AND_LOWER);
    }
    bechString = bechString.toLowerCase();
    const pos = bechString.lastIndexOf("1");
    if (pos < 1) {
      return opKnownFailure(BitcoinParseError.MISSING_HRP);
    }
    if (pos + 7 > bechString.length) {
      return opKnownFailure(BitcoinParseError.TOO_SHORT);
    }
    if (bechString.length > 90) {
      return opKnownFailure(BitcoinParseError.TOO_LONG);
    }
    const hrp = bechString.substring(0, pos);
    var data = [];
    for (p4 = pos + 1; p4 < bechString.length; ++p4) {
      var d6 = CHARSET.indexOf(bechString.charAt(p4));
      if (d6 === -1) {
        return opKnownFailure(BitcoinParseError.WRONG_CHARSET);
      }
      data.push(d6);
    }
    if (enc && !verifyChecksum(hrp, data, enc)) {
      return opKnownFailure(BitcoinParseError.WRONG_CHECKSUM);
    }
    return opFixedSuccess({ hrp, data: data.slice(0, data.length - 6) });
  }
  BitcoinBech322.decode = decode2;
})(BitcoinBech32 || (BitcoinBech32 = {}));

// ../taler-util/lib/segwit_addr.js
function convertbits(data, frombits, tobits, pad) {
  let acc = 0;
  let bits = 0;
  const ret = [];
  const maxv = (1 << tobits) - 1;
  for (let p4 = 0; p4 < data.length; ++p4) {
    const value = data[p4];
    if (value < 0 || value >> frombits !== 0) {
      return null;
    }
    acc = acc << frombits | value;
    bits += frombits;
    while (bits >= tobits) {
      bits -= tobits;
      ret.push(acc >> bits & maxv);
    }
  }
  if (pad) {
    if (bits > 0) {
      ret.push(acc << tobits - bits & maxv);
    }
  } else if (bits >= frombits || acc << tobits - bits & maxv) {
    return null;
  }
  return ret;
}
var BitcoinSewgit;
(function(BitcoinSewgit2) {
  let BitcoinSewgitParseError;
  (function(BitcoinSewgitParseError2) {
    BitcoinSewgitParseError2["INVALID_DATA"] = "invalid-data";
    BitcoinSewgitParseError2["DECODING_PROBLEM"] = "decoding-problem";
  })(BitcoinSewgitParseError = BitcoinSewgit2.BitcoinSewgitParseError || (BitcoinSewgit2.BitcoinSewgitParseError = {}));
  function decode2(addr, enc) {
    const decResp = BitcoinBech32.decode(addr, enc);
    if (decResp.type === "fail") {
      return decResp;
    }
    const { body: dec } = decResp;
    if (dec.data.length < 1 || dec.data[0] > 16) {
      return opKnownFailure(BitcoinSewgitParseError.INVALID_DATA);
    }
    const res = convertbits(dec.data.slice(1), 5, 8, false);
    if (res === null || res.length < 2 || res.length > 40) {
      return opKnownFailure(BitcoinSewgitParseError.DECODING_PROBLEM);
    }
    if (dec.data[0] === 0 && res.length !== 20 && res.length !== 32) {
      return opKnownFailure(BitcoinSewgitParseError.DECODING_PROBLEM);
    }
    if (dec.data[0] === 0 && enc === BitcoinBech32.Encodings.BECH32) {
      return opKnownFailure(BitcoinSewgitParseError.DECODING_PROBLEM);
    }
    if (dec.data[0] !== 0 && enc === BitcoinBech32.Encodings.BECH32M) {
      return opKnownFailure(BitcoinSewgitParseError.DECODING_PROBLEM);
    }
    return opFixedSuccess({ version: dec.data[0], program: res });
  }
  BitcoinSewgit2.decode = decode2;
  function encode2(hrp, version2, program) {
    const enc = version2 > 0 ? BitcoinBech32.Encodings.BECH32M : BitcoinBech32.Encodings.BECH32;
    const bits = convertbits(program, 8, 5, true);
    if (!bits) {
      return opKnownFailure(BitcoinSewgitParseError.INVALID_DATA);
    }
    const ret = BitcoinBech32.encode(hrp, [version2].concat(bits), enc);
    return opFixedSuccess(ret);
  }
  BitcoinSewgit2.encode = encode2;
})(BitcoinSewgit || (BitcoinSewgit = {}));

// ../taler-util/lib/bitcoin.js
var GenerateSegwitAddrError;
(function(GenerateSegwitAddrError2) {
  GenerateSegwitAddrError2["WRONG_RESERVE_PUB"] = "wrong-reserve-pub";
  GenerateSegwitAddrError2["WRONG_PREFIX"] = "wrong-prefix";
  GenerateSegwitAddrError2["INVALID_SEGWIT"] = "invalid-segwit";
})(GenerateSegwitAddrError || (GenerateSegwitAddrError = {}));
function generateFakeSegwitAddress(pub, addr) {
  const first_rnd = new Uint8Array(4);
  first_rnd.set(pub.subarray(0, 4));
  const second_rnd = new Uint8Array(4);
  second_rnd.set(pub.subarray(0, 4));
  first_rnd[0] = first_rnd[0] & 127;
  second_rnd[0] = second_rnd[0] | 128;
  const first_part = new Uint8Array(first_rnd.length + pub.length / 2);
  first_part.set(first_rnd, 0);
  first_part.set(pub.subarray(0, 16), 4);
  const second_part = new Uint8Array(first_rnd.length + pub.length / 2);
  second_part.set(second_rnd, 0);
  second_part.set(pub.subarray(16, 32), 4);
  const prefix2 = addr[0] === "t" && addr[1] == "b" ? "tb" : addr[0] === "b" && addr[1] == "c" && addr[2] === "r" && addr[3] == "t" ? "bcrt" : addr[0] === "b" && addr[1] == "c" ? "bc" : void 0;
  if (prefix2 === void 0) {
    return opKnownFailure(GenerateSegwitAddrError.WRONG_PREFIX);
  }
  const addr1 = BitcoinSewgit.encode(prefix2, 0, Array.from(first_part));
  if (addr1.type === "fail") {
    return opKnownFailure(GenerateSegwitAddrError.INVALID_SEGWIT);
  }
  const addr2 = BitcoinSewgit.encode(prefix2, 0, Array.from(second_part));
  if (addr2.type === "fail") {
    return opKnownFailure(GenerateSegwitAddrError.INVALID_SEGWIT);
  }
  const result = [addr1.body, addr2.body];
  return opFixedSuccess(result);
}

// ../taler-util/lib/CancellationToken.js
var NOOP = () => {
};
var CancellationToken = class _CancellationToken {
  /**
   * Whether the token has been cancelled.
   */
  get isCancelled() {
    return this._isCancelled;
  }
  /**
   * Whether the token can be cancelled.
   */
  get canBeCancelled() {
    return this._canBeCancelled;
  }
  /**
   * Why this token has been cancelled.
   */
  get reason() {
    if (this.isCancelled) {
      return this._reason;
    } else {
      throw new Error("This token is not cancelled.");
    }
  }
  /**
   * Make a promise that resolves when the async operation resolves,
   * or rejects when the operation is rejected or this token is cancelled.
   */
  racePromise(asyncOperation) {
    if (!this.canBeCancelled) {
      return asyncOperation;
    }
    return new Promise((resolve2, reject) => {
      const unregister = this.onCancelled((reason) => reject(new _CancellationToken.CancellationError(reason)));
      asyncOperation.then((value) => {
        resolve2(value);
        unregister();
      }, (err) => {
        reject(err);
        unregister();
      });
    });
  }
  /**
   * Throw a {CancellationToken.CancellationError} if this token is cancelled.
   */
  throwIfCancelled() {
    if (this._isCancelled) {
      throw new _CancellationToken.CancellationError(this._reason);
    }
  }
  /**
   * Invoke the callback when this token is cancelled.
   * If this token is already cancelled, the callback is invoked immediately.
   * Returns a function that unregisters the cancellation callback.
   */
  onCancelled(cb) {
    if (!this.canBeCancelled) {
      return NOOP;
    }
    if (this.isCancelled) {
      cb(this.reason);
      return NOOP;
    }
    this._callbacks?.add(cb);
    return () => this._callbacks?.delete(cb);
  }
  constructor(_isCancelled, _canBeCancelled) {
    this._isCancelled = _isCancelled;
    this._canBeCancelled = _canBeCancelled;
    this._callbacks = /* @__PURE__ */ new Set();
  }
  /**
   * Create a {CancellationTokenSource}.
   */
  static create() {
    const token = new _CancellationToken(false, true);
    const cancel = (reason) => {
      if (token._isCancelled)
        return;
      token._isCancelled = true;
      token._reason = reason;
      token._callbacks?.forEach((cb) => cb(reason));
      dispose();
    };
    const dispose = () => {
      token._canBeCancelled = token.isCancelled;
      delete token._callbacks;
    };
    return { token, cancel, dispose };
  }
  /**
   * Create a {CancellationTokenSource}.
   * The token will be cancelled automatically after the specified timeout in milliseconds.
   */
  static timeout(ms) {
    const { token, cancel: originalCancel, dispose: originalDispose } = _CancellationToken.create();
    let timer2;
    timer2 = setTimeout(() => originalCancel(`CancellationToken.timeout ${ms}`), ms);
    const disposeTimer = () => {
      if (timer2 == null)
        return;
      clearTimeout(timer2);
      timer2 = null;
    };
    const cancel = (reason) => {
      disposeTimer();
      originalCancel(reason);
    };
    const dispose = () => {
      disposeTimer();
      originalDispose();
    };
    return { token, cancel, dispose };
  }
  /**
   * Create a {CancellationToken} that is cancelled when all of the given tokens are cancelled.
   *
   * This is like {Promise<T>.all} for {CancellationToken}s.
   */
  static all(...tokens) {
    if (tokens.some((token) => !token.canBeCancelled)) {
      return _CancellationToken.CONTINUE;
    }
    const combined = _CancellationToken.create();
    let countdown = tokens.length;
    const handleNextTokenCancelled = () => {
      if (--countdown === 0) {
        const reasons = tokens.map((token) => token._reason);
        combined.cancel(reasons);
      }
    };
    tokens.forEach((token) => token.onCancelled(handleNextTokenCancelled));
    return combined.token;
  }
  /**
   * Create a {CancellationToken} that is cancelled when at least one of the given tokens is cancelled.
   *
   * This is like {Promise<T>.race} for {CancellationToken}s.
   */
  static race(...tokens) {
    for (const token of tokens) {
      if (token._isCancelled) {
        return token;
      }
    }
    const combined = _CancellationToken.create();
    let unregistrations;
    const handleAnyTokenCancelled = (reason) => {
      unregistrations.forEach((unregister) => unregister());
      combined.cancel(reason);
    };
    unregistrations = tokens.map((token) => token.onCancelled(handleAnyTokenCancelled));
    return combined.token;
  }
};
CancellationToken.CANCELLED = new CancellationToken(true, true);
CancellationToken.CONTINUE = new CancellationToken(false, false);
(function(CancellationToken2) {
  class CancellationError extends Error {
    constructor(reason) {
      super("Operation cancelled");
      this.reason = reason;
      Object.setPrototypeOf(this, CancellationError.prototype);
    }
  }
  CancellationToken2.CancellationError = CancellationError;
})(CancellationToken || (CancellationToken = {}));

// ../taler-util/lib/taler-crypto.js
var import_big_integer = __toESM(require_BigInteger(), 1);

// ../taler-util/lib/sha256.js
var digestLength = 32;
var blockSize = 64;
var K2 = new Uint32Array([
  1116352408,
  1899447441,
  3049323471,
  3921009573,
  961987163,
  1508970993,
  2453635748,
  2870763221,
  3624381080,
  310598401,
  607225278,
  1426881987,
  1925078388,
  2162078206,
  2614888103,
  3248222580,
  3835390401,
  4022224774,
  264347078,
  604807628,
  770255983,
  1249150122,
  1555081692,
  1996064986,
  2554220882,
  2821834349,
  2952996808,
  3210313671,
  3336571891,
  3584528711,
  113926993,
  338241895,
  666307205,
  773529912,
  1294757372,
  1396182291,
  1695183700,
  1986661051,
  2177026350,
  2456956037,
  2730485921,
  2820302411,
  3259730800,
  3345764771,
  3516065817,
  3600352804,
  4094571909,
  275423344,
  430227734,
  506948616,
  659060556,
  883997877,
  958139571,
  1322822218,
  1537002063,
  1747873779,
  1955562222,
  2024104815,
  2227730452,
  2361852424,
  2428436474,
  2756734187,
  3204031479,
  3329325298
]);
function hashBlocks(w6, v3, p4, pos, len) {
  let a6, b5, c5, d6, e5, f3, g4, h5, u5, i5, j4, t1, t22;
  while (len >= 64) {
    a6 = v3[0];
    b5 = v3[1];
    c5 = v3[2];
    d6 = v3[3];
    e5 = v3[4];
    f3 = v3[5];
    g4 = v3[6];
    h5 = v3[7];
    for (i5 = 0; i5 < 16; i5++) {
      j4 = pos + i5 * 4;
      w6[i5] = (p4[j4] & 255) << 24 | (p4[j4 + 1] & 255) << 16 | (p4[j4 + 2] & 255) << 8 | p4[j4 + 3] & 255;
    }
    for (i5 = 16; i5 < 64; i5++) {
      u5 = w6[i5 - 2];
      t1 = (u5 >>> 17 | u5 << 32 - 17) ^ (u5 >>> 19 | u5 << 32 - 19) ^ u5 >>> 10;
      u5 = w6[i5 - 15];
      t22 = (u5 >>> 7 | u5 << 32 - 7) ^ (u5 >>> 18 | u5 << 32 - 18) ^ u5 >>> 3;
      w6[i5] = (t1 + w6[i5 - 7] | 0) + (t22 + w6[i5 - 16] | 0);
    }
    for (i5 = 0; i5 < 64; i5++) {
      t1 = (((e5 >>> 6 | e5 << 32 - 6) ^ (e5 >>> 11 | e5 << 32 - 11) ^ (e5 >>> 25 | e5 << 32 - 25)) + (e5 & f3 ^ ~e5 & g4) | 0) + (h5 + (K2[i5] + w6[i5] | 0) | 0) | 0;
      t22 = ((a6 >>> 2 | a6 << 32 - 2) ^ (a6 >>> 13 | a6 << 32 - 13) ^ (a6 >>> 22 | a6 << 32 - 22)) + (a6 & b5 ^ a6 & c5 ^ b5 & c5) | 0;
      h5 = g4;
      g4 = f3;
      f3 = e5;
      e5 = d6 + t1 | 0;
      d6 = c5;
      c5 = b5;
      b5 = a6;
      a6 = t1 + t22 | 0;
    }
    v3[0] += a6;
    v3[1] += b5;
    v3[2] += c5;
    v3[3] += d6;
    v3[4] += e5;
    v3[5] += f3;
    v3[6] += g4;
    v3[7] += h5;
    pos += 64;
    len -= 64;
  }
  return pos;
}
var HashSha256 = class {
  constructor() {
    this.digestLength = digestLength;
    this.blockSize = blockSize;
    this.state = new Int32Array(8);
    this.temp = new Int32Array(64);
    this.buffer = new Uint8Array(128);
    this.bufferLength = 0;
    this.bytesHashed = 0;
    this.finished = false;
    this.reset();
  }
  // Resets hash state making it possible
  // to reuse this instance to hash other data.
  reset() {
    this.state[0] = 1779033703;
    this.state[1] = 3144134277;
    this.state[2] = 1013904242;
    this.state[3] = 2773480762;
    this.state[4] = 1359893119;
    this.state[5] = 2600822924;
    this.state[6] = 528734635;
    this.state[7] = 1541459225;
    this.bufferLength = 0;
    this.bytesHashed = 0;
    this.finished = false;
    return this;
  }
  // Cleans internal buffers and re-initializes hash state.
  clean() {
    for (let i5 = 0; i5 < this.buffer.length; i5++) {
      this.buffer[i5] = 0;
    }
    for (let i5 = 0; i5 < this.temp.length; i5++) {
      this.temp[i5] = 0;
    }
    this.reset();
  }
  // Updates hash state with the given data.
  //
  // Optionally, length of the data can be specified to hash
  // fewer bytes than data.length.
  //
  // Throws error when trying to update already finalized hash:
  // instance must be reset to use it again.
  update(data, dataLength = data.length) {
    if (this.finished) {
      throw new Error("SHA256: can't update because hash was finished.");
    }
    let dataPos = 0;
    this.bytesHashed += dataLength;
    if (this.bufferLength > 0) {
      while (this.bufferLength < 64 && dataLength > 0) {
        this.buffer[this.bufferLength++] = data[dataPos++];
        dataLength--;
      }
      if (this.bufferLength === 64) {
        hashBlocks(this.temp, this.state, this.buffer, 0, 64);
        this.bufferLength = 0;
      }
    }
    if (dataLength >= 64) {
      dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength);
      dataLength %= 64;
    }
    while (dataLength > 0) {
      this.buffer[this.bufferLength++] = data[dataPos++];
      dataLength--;
    }
    return this;
  }
  // Finalizes hash state and puts hash into out.
  //
  // If hash was already finalized, puts the same value.
  finish(out) {
    if (!this.finished) {
      const bytesHashed = this.bytesHashed;
      const left = this.bufferLength;
      const bitLenHi = bytesHashed / 536870912 | 0;
      const bitLenLo = bytesHashed << 3;
      const padLength = bytesHashed % 64 < 56 ? 64 : 128;
      this.buffer[left] = 128;
      for (let i5 = left + 1; i5 < padLength - 8; i5++) {
        this.buffer[i5] = 0;
      }
      this.buffer[padLength - 8] = bitLenHi >>> 24 & 255;
      this.buffer[padLength - 7] = bitLenHi >>> 16 & 255;
      this.buffer[padLength - 6] = bitLenHi >>> 8 & 255;
      this.buffer[padLength - 5] = bitLenHi >>> 0 & 255;
      this.buffer[padLength - 4] = bitLenLo >>> 24 & 255;
      this.buffer[padLength - 3] = bitLenLo >>> 16 & 255;
      this.buffer[padLength - 2] = bitLenLo >>> 8 & 255;
      this.buffer[padLength - 1] = bitLenLo >>> 0 & 255;
      hashBlocks(this.temp, this.state, this.buffer, 0, padLength);
      this.finished = true;
    }
    for (let i5 = 0; i5 < 8; i5++) {
      out[i5 * 4 + 0] = this.state[i5] >>> 24 & 255;
      out[i5 * 4 + 1] = this.state[i5] >>> 16 & 255;
      out[i5 * 4 + 2] = this.state[i5] >>> 8 & 255;
      out[i5 * 4 + 3] = this.state[i5] >>> 0 & 255;
    }
    return this;
  }
  // Returns the final hash digest.
  digest() {
    const out = new Uint8Array(this.digestLength);
    this.finish(out);
    return out;
  }
  // Internal function for use in HMAC for optimization.
  _saveState(out) {
    for (let i5 = 0; i5 < this.state.length; i5++) {
      out[i5] = this.state[i5];
    }
  }
  // Internal function for use in HMAC for optimization.
  _restoreState(from2, bytesHashed) {
    for (let i5 = 0; i5 < this.state.length; i5++) {
      this.state[i5] = from2[i5];
    }
    this.bytesHashed = bytesHashed;
    this.finished = false;
    this.bufferLength = 0;
  }
};
function sha256(data) {
  const h5 = new HashSha256().update(data);
  const digest = h5.digest();
  h5.clean();
  return digest;
}

// ../taler-util/lib/kdf.js
function sha512(data) {
  return hash(data);
}
function hmac(digest, blockSize2, key, message) {
  if (key.byteLength > blockSize2) {
    key = digest(key);
  }
  if (key.byteLength < blockSize2) {
    const k6 = key;
    key = new Uint8Array(blockSize2);
    key.set(k6, 0);
  }
  const okp = new Uint8Array(blockSize2);
  const ikp = new Uint8Array(blockSize2);
  for (let i5 = 0; i5 < blockSize2; i5++) {
    ikp[i5] = key[i5] ^ 54;
    okp[i5] = key[i5] ^ 92;
  }
  const b1 = new Uint8Array(blockSize2 + message.byteLength);
  b1.set(ikp, 0);
  b1.set(message, blockSize2);
  const h0 = digest(b1);
  const b22 = new Uint8Array(blockSize2 + h0.length);
  b22.set(okp, 0);
  b22.set(h0, blockSize2);
  return digest(b22);
}
function hmacSha512(key, message) {
  return hmac(sha512, 128, key, message);
}
function hmacSha256(key, message) {
  return hmac(sha256, 64, key, message);
}

// ../taler-util/lib/iban.js
var ParseIbanError;
(function(ParseIbanError2) {
  ParseIbanError2[ParseIbanError2["UNSUPPORTED_COUNTRY"] = 0] = "UNSUPPORTED_COUNTRY";
  ParseIbanError2[ParseIbanError2["TOO_LONG"] = 1] = "TOO_LONG";
  ParseIbanError2[ParseIbanError2["TOO_SHORT"] = 2] = "TOO_SHORT";
  ParseIbanError2[ParseIbanError2["INVALID_CHARSET"] = 3] = "INVALID_CHARSET";
  ParseIbanError2[ParseIbanError2["INVALID_CHECKSUM"] = 4] = "INVALID_CHECKSUM";
})(ParseIbanError || (ParseIbanError = {}));
var ccZero = "0".charCodeAt(0);
var ccNine = "9".charCodeAt(0);
var ccA = "A".charCodeAt(0);
var ccZ = "Z".charCodeAt(0);
function appendDigit(digits, cc) {
  if (cc >= ccZero && cc <= ccNine) {
    digits.push(cc - ccZero);
  } else if (cc >= ccA && cc <= ccZ) {
    const n2 = cc - ccA + 10;
    digits.push(Math.floor(n2 / 10) % 10);
    digits.push(n2 % 10);
  } else {
    return false;
  }
  return true;
}
function mod97(digits) {
  let i5 = 0;
  let modAccum = 0;
  while (i5 < digits.length) {
    let n2 = 0;
    while (n2 < 9 && i5 < digits.length) {
      modAccum = modAccum * 10 + digits[i5];
      i5++;
      n2++;
    }
    modAccum = modAccum % 97;
  }
  return modAccum;
}
function parseIban(ibanString) {
  if (ibanString.length < 4) {
    return opKnownFailure(ParseIbanError.TOO_SHORT);
  }
  if (ibanString.length > 34) {
    return opKnownFailure(ParseIbanError.TOO_LONG);
  }
  const myIban = ibanString.toUpperCase().replace(/[\s-\._]/g, "");
  const countryCode = myIban.substring(0, 2);
  const countryInfo = ibanCountryInfoTable[countryCode];
  if (!countryInfo) {
    return opKnownFailure(ParseIbanError.UNSUPPORTED_COUNTRY);
  }
  let digits = [];
  for (let i5 = 4; i5 < myIban.length; i5++) {
    const cc = myIban.charCodeAt(i5);
    if (!appendDigit(digits, cc)) {
      return opKnownFailure(ParseIbanError.INVALID_CHARSET);
    }
  }
  for (let i5 = 0; i5 < 4; i5++) {
    const cc = myIban.charCodeAt(i5);
    if (!appendDigit(digits, cc)) {
      return opKnownFailure(ParseIbanError.INVALID_CHARSET);
    }
  }
  const rem = mod97(digits);
  if (rem === 1) {
    return opFixedSuccess(myIban);
  } else {
    return opKnownFailure(ParseIbanError.INVALID_CHECKSUM);
  }
}
var ibanCountryInfoTable = {
  AE: { name: "U.A.E." },
  AF: { name: "Afghanistan" },
  AL: { name: "Albania" },
  AM: { name: "Armenia" },
  AN: { name: "Netherlands Antilles" },
  AR: { name: "Argentina" },
  AT: { name: "Austria" },
  AU: { name: "Australia" },
  AZ: { name: "Azerbaijan" },
  BA: { name: "Bosnia and Herzegovina" },
  BD: { name: "Bangladesh" },
  BE: { name: "Belgium" },
  BG: { name: "Bulgaria" },
  BH: { name: "Bahrain" },
  BN: { name: "Brunei Darussalam" },
  BO: { name: "Bolivia" },
  BR: { name: "Brazil" },
  BT: { name: "Bhutan" },
  BY: { name: "Belarus" },
  BZ: { name: "Belize" },
  CA: { name: "Canada" },
  CG: { name: "Congo" },
  CH: { name: "Switzerland" },
  CI: { name: "Cote d'Ivoire" },
  CL: { name: "Chile" },
  CM: { name: "Cameroon" },
  CN: { name: "People's Republic of China" },
  CO: { name: "Colombia" },
  CR: { name: "Costa Rica" },
  CS: { name: "Serbia and Montenegro" },
  CZ: { name: "Czech Republic" },
  DE: { name: "Germany" },
  DK: { name: "Denmark" },
  DO: { name: "Dominican Republic" },
  DZ: { name: "Algeria" },
  EC: { name: "Ecuador" },
  EE: { name: "Estonia" },
  EG: { name: "Egypt" },
  ER: { name: "Eritrea" },
  ES: { name: "Spain" },
  ET: { name: "Ethiopia" },
  FI: { name: "Finland" },
  FO: { name: "Faroe Islands" },
  FR: { name: "France" },
  GB: { name: "United Kingdom" },
  GD: { name: "Caribbean" },
  GE: { name: "Georgia" },
  GL: { name: "Greenland" },
  GR: { name: "Greece" },
  GT: { name: "Guatemala" },
  HK: { name: "Hong Kong S.A.R." },
  HN: { name: "Honduras" },
  HR: { name: "Croatia" },
  HT: { name: "Haiti" },
  HU: { name: "Hungary" },
  ID: { name: "Indonesia" },
  IE: { name: "Ireland" },
  IL: { name: "Israel" },
  IN: { name: "India" },
  IQ: { name: "Iraq" },
  IR: { name: "Iran" },
  IS: { name: "Iceland" },
  IT: { name: "Italy" },
  JM: { name: "Jamaica" },
  JO: { name: "Jordan" },
  JP: { name: "Japan" },
  KE: { name: "Kenya" },
  KG: { name: "Kyrgyzstan" },
  KH: { name: "Cambodia" },
  KR: { name: "South Korea" },
  KW: { name: "Kuwait" },
  KZ: { name: "Kazakhstan" },
  LA: { name: "Laos" },
  LB: { name: "Lebanon" },
  LI: { name: "Liechtenstein" },
  LK: { name: "Sri Lanka" },
  LT: { name: "Lithuania" },
  LU: { name: "Luxembourg" },
  LV: { name: "Latvia" },
  LY: { name: "Libya" },
  MA: { name: "Morocco" },
  MC: { name: "Principality of Monaco" },
  MD: { name: "Moldava" },
  ME: { name: "Montenegro" },
  MK: { name: "Former Yugoslav Republic of Macedonia" },
  ML: { name: "Mali" },
  MM: { name: "Myanmar" },
  MN: { name: "Mongolia" },
  MO: { name: "Macau S.A.R." },
  MT: { name: "Malta" },
  MV: { name: "Maldives" },
  MX: { name: "Mexico" },
  MY: { name: "Malaysia" },
  NG: { name: "Nigeria" },
  NI: { name: "Nicaragua" },
  NL: { name: "Netherlands" },
  NO: { name: "Norway" },
  NP: { name: "Nepal" },
  NZ: { name: "New Zealand" },
  OM: { name: "Oman" },
  PA: { name: "Panama" },
  PE: { name: "Peru" },
  PH: { name: "Philippines" },
  PK: { name: "Islamic Republic of Pakistan" },
  PL: { name: "Poland" },
  PR: { name: "Puerto Rico" },
  PT: { name: "Portugal" },
  PY: { name: "Paraguay" },
  QA: { name: "Qatar" },
  RE: { name: "Reunion" },
  RO: { name: "Romania" },
  RS: { name: "Serbia" },
  RU: { name: "Russia" },
  RW: { name: "Rwanda" },
  SA: { name: "Saudi Arabia" },
  SE: { name: "Sweden" },
  SG: { name: "Singapore" },
  SI: { name: "Slovenia" },
  SK: { name: "Slovak" },
  SN: { name: "Senegal" },
  SO: { name: "Somalia" },
  SR: { name: "Suriname" },
  SV: { name: "El Salvador" },
  SY: { name: "Syria" },
  TH: { name: "Thailand" },
  TJ: { name: "Tajikistan" },
  TM: { name: "Turkmenistan" },
  TN: { name: "Tunisia" },
  TR: { name: "Turkey" },
  TT: { name: "Trinidad and Tobago" },
  TW: { name: "Taiwan" },
  TZ: { name: "Tanzania" },
  UA: { name: "Ukraine" },
  US: { name: "United States" },
  UY: { name: "Uruguay" },
  VA: { name: "Vatican" },
  VE: { name: "Venezuela" },
  VN: { name: "Viet Nam" },
  YE: { name: "Yemen" },
  ZA: { name: "South Africa" },
  ZW: { name: "Zimbabwe" }
};

// ../taler-util/lib/payto.js
var PAYTO_PREFIX = "payto://";
var PaytoType;
(function(PaytoType3) {
  PaytoType3["IBAN"] = "iban";
  PaytoType3["Bitcoin"] = "bitcoin";
  PaytoType3["TalerBank"] = "x-taler-bank";
  PaytoType3["TalerReserve"] = "taler-reserve";
  PaytoType3["TalerReserveHttp"] = "taler-reserve-http";
  PaytoType3["Ethereum"] = "ethereum";
})(PaytoType || (PaytoType = {}));
var ReservePubParseError;
(function(ReservePubParseError2) {
  ReservePubParseError2[ReservePubParseError2["WRONG_LENGTH"] = 0] = "WRONG_LENGTH";
  ReservePubParseError2[ReservePubParseError2["DECODE_ERROR"] = 1] = "DECODE_ERROR";
})(ReservePubParseError || (ReservePubParseError = {}));
var PaytoParseError;
(function(PaytoParseError2) {
  PaytoParseError2[PaytoParseError2["WRONG_PREFIX"] = 0] = "WRONG_PREFIX";
  PaytoParseError2[PaytoParseError2["INCOMPLETE"] = 1] = "INCOMPLETE";
  PaytoParseError2[PaytoParseError2["UNSUPPORTED"] = 2] = "UNSUPPORTED";
  PaytoParseError2[PaytoParseError2["COMPONENTS_LENGTH"] = 3] = "COMPONENTS_LENGTH";
  PaytoParseError2[PaytoParseError2["INVALID_TARGET_PATH"] = 4] = "INVALID_TARGET_PATH";
})(PaytoParseError || (PaytoParseError = {}));
var Paytos;
(function(Paytos2) {
  const supported_targets = {
    iban: true,
    bitcoin: true,
    "x-taler-bank": true,
    "taler-reserve": true,
    "taler-reserve-http": true,
    ethereum: true
  };
  function hash3(p4) {
    return hashTruncate32(stringToBytes(p4 + "\0"));
  }
  Paytos2.hash = hash3;
  function toNormalizedString(p4) {
    const url = new URL(`${PAYTO_PREFIX}${p4.targetType}/${p4.normalizedPath}`);
    return url.href;
  }
  Paytos2.toNormalizedString = toNormalizedString;
  function toFullString(p4) {
    const url = new URL(`${PAYTO_PREFIX}${p4.targetType}/${p4.fullPath}`);
    const paramList = !p4.params ? [] : Object.entries(p4.params);
    url.search = createSearchParams(paramList);
    return url.href;
  }
  Paytos2.toFullString = toFullString;
  function parseReservePub(reserve) {
    if (!reserve)
      return opKnownFailure(ReservePubParseError.WRONG_LENGTH);
    try {
      const pub = decodeCrock(reserve);
      if (!pub || pub.length !== 32) {
        return opKnownFailure(ReservePubParseError.WRONG_LENGTH);
      }
      return opFixedSuccess(pub);
    } catch (e5) {
      return opKnownFailureWithBody(ReservePubParseError.DECODE_ERROR, {
        message: String(e5)
      });
    }
  }
  Paytos2.parseReservePub = parseReservePub;
  function parseHostPortPath2(hostname, path, scheme = "https") {
    try {
      if (path === void 0) {
        path = "";
      }
      if (!path.endsWith("/")) {
        path = path + "/";
      }
      const url = new URL(path, `${scheme}://${hostname.toLowerCase()}`);
      url.search = "";
      url.password = "";
      url.username = "";
      url.hash = "";
      return url.href;
    } catch (e5) {
      console.log(e5);
      return void 0;
    }
  }
  Paytos2.parseHostPortPath2 = parseHostPortPath2;
  function withoutScheme(h5) {
    return h5.startsWith("http://") ? h5.substring(7) : h5.startsWith("https://") ? h5.substring(8) : h5;
  }
  function parseHostPortPath(hostnameAndPath) {
    const [host, path] = hostnameAndPath.split("/", 1);
    return parseHostPortPath2(host, path ?? "");
  }
  Paytos2.parseHostPortPath = parseHostPortPath;
  function parseEthereumAddress(str) {
    if (!str) {
      return void 0;
    }
    return str;
  }
  Paytos2.parseEthereumAddress = parseEthereumAddress;
  function parseTalerBankAccount(account) {
    if (!account) {
      return void 0;
    }
    return account;
  }
  Paytos2.parseTalerBankAccount = parseTalerBankAccount;
  function createUnsupported(targetType, path, params = {}) {
    return {
      targetType: void 0,
      target: targetType,
      params,
      normalizedPath: path.toLocaleLowerCase(),
      fullPath: path,
      displayName: path
    };
  }
  Paytos2.createUnsupported = createUnsupported;
  function createIban(iban, bic, params = {}) {
    iban = iban.toUpperCase();
    return {
      targetType: PaytoType.IBAN,
      iban,
      bic,
      params,
      normalizedPath: iban,
      fullPath: !bic ? iban : `${bic}/${iban}`,
      displayName: iban
    };
  }
  Paytos2.createIban = createIban;
  function createBitcoin(address, reservePub, params = {}) {
    const sgRes = !reservePub ? void 0 : generateFakeSegwitAddress(reservePub, address);
    const segwitAddrs = !sgRes || sgRes.type === "fail" ? [] : sgRes.body;
    return {
      targetType: PaytoType.Bitcoin,
      address,
      reservePub,
      segwitAddrs,
      params,
      normalizedPath: address.toLocaleLowerCase(),
      fullPath: !reservePub ? address : `${address}/${encodeCrock(reservePub)}`,
      displayName: address
    };
  }
  Paytos2.createBitcoin = createBitcoin;
  function createEthereum(address, params = {}) {
    return {
      targetType: PaytoType.Ethereum,
      address,
      params,
      normalizedPath: address,
      fullPath: address,
      displayName: address
    };
  }
  Paytos2.createEthereum = createEthereum;
  function createTalerReserve(exchange, reservePub, params = {}) {
    const path = withoutScheme(exchange);
    const pub = encodeCrock(reservePub);
    return {
      targetType: PaytoType.TalerReserve,
      exchange,
      reservePub,
      params,
      normalizedPath: `${path.toLocaleLowerCase()}${pub}`,
      fullPath: `${path}${pub}`,
      displayName: `${path}@${pub}`
    };
  }
  Paytos2.createTalerReserve = createTalerReserve;
  function createTalerReserveHttp(exchange, reservePub, params = {}) {
    const path = withoutScheme(exchange);
    const pub = encodeCrock(reservePub);
    return {
      targetType: PaytoType.TalerReserveHttp,
      exchange,
      reservePub,
      params,
      normalizedPath: `${path.toLocaleLowerCase()}${pub}`,
      fullPath: `${path}${pub}`,
      displayName: `${path}@${pub}`
    };
  }
  Paytos2.createTalerReserveHttp = createTalerReserveHttp;
  function createTalerBank(url, account, params = {}) {
    const path = withoutScheme(url);
    const host = path.endsWith("/") ? path.substring(0, path.length - 1) : path;
    return {
      targetType: PaytoType.TalerBank,
      host,
      url,
      account,
      params,
      normalizedPath: `${path.toLocaleLowerCase()}${account}`,
      fullPath: `${path}${account}`,
      displayName: `${account}@${url}`
    };
  }
  Paytos2.createTalerBank = createTalerBank;
  function asString(p4) {
    return succeedOrThrow(fromString(p4));
  }
  Paytos2.asString = asString;
  function fromString(s6, opts = {}) {
    if (!s6.startsWith(PAYTO_PREFIX)) {
      return opKnownFailure(PaytoParseError.WRONG_PREFIX);
    }
    const [acct, search] = s6.slice(PAYTO_PREFIX.length).split("?", 2);
    const firstSlashPos = acct.indexOf("/");
    const targetType = firstSlashPos === -1 ? acct : acct.slice(0, firstSlashPos);
    if (!opts.allowUnsupported && !supported_targets[targetType]) {
      const d6 = opKnownFailureWithBody(PaytoParseError.UNSUPPORTED, {
        targetType
      });
      return d6;
    }
    const targetPath = acct.slice(firstSlashPos + 1);
    if (firstSlashPos === -1 || !targetPath) {
      return opKnownFailureWithBody(PaytoParseError.INCOMPLETE, { targetType });
    }
    const params = {};
    if (search) {
      const searchParams = new URLSearchParams2(search);
      searchParams.forEach((v3, k6) => {
        params[k6] = v3;
      });
    }
    const cs = targetPath.split("/");
    switch (targetType) {
      case PaytoType.IBAN: {
        if (cs.length !== 1 && cs.length !== 2) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const bic = cs.length === 2 ? cs[0] : void 0;
        const iban = cs.length === 1 ? cs[0] : cs[1];
        const ibaRes = parseIban(iban);
        if (!opts.ignoreComponentError && ibaRes.type === "fail") {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: ibaRes
          });
        }
        return opFixedSuccess(createIban(iban, bic, params));
      }
      case PaytoType.Bitcoin: {
        if (cs.length !== 1 && cs.length !== 2) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const address = cs[0].toLocaleLowerCase();
        const btRes = BitcoinBech32.decode(address, BitcoinBech32.Encodings.BECH32);
        if (!opts.ignoreComponentError && btRes.type === "fail") {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: btRes
          });
        }
        const pubRes = cs.length === 1 ? void 0 : parseReservePub(cs[1]);
        if (!opts.ignoreComponentError && pubRes && pubRes.type === "fail") {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 1,
            targetType,
            error: pubRes
          });
        }
        return opFixedSuccess(createBitcoin(address, pubRes && pubRes.type === "ok" ? pubRes.body : void 0, params));
      }
      case PaytoType.TalerBank: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const host = parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"));
        if (!opts.ignoreComponentError && !host) {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: host
          });
        }
        const account = parseTalerBankAccount(cs[cs.length - 1]);
        if (!opts.ignoreComponentError && !account) {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 1,
            targetType,
            error: account
          });
        }
        return opFixedSuccess(createTalerBank(host ?? cs[0], account ?? cs[1], params));
      }
      case PaytoType.TalerReserve: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const exchange = parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"));
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: exchange
          });
        }
        const reservePub = cs[cs.length - 1];
        const pubRes = parseReservePub(reservePub);
        if (!opts.ignoreComponentError && pubRes.type === "fail") {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 1,
            targetType,
            error: pubRes
          });
        }
        return opFixedSuccess(createTalerReserve(exchange ?? cs[0], pubRes.type === "ok" ? pubRes.body : decodeCrock(reservePub), params));
      }
      case PaytoType.TalerReserveHttp: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const exchange = parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), "http");
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: exchange
          });
        }
        const reservePub = cs[cs.length - 1];
        const pubRes = parseReservePub(reservePub);
        if (!opts.ignoreComponentError && pubRes.type === "fail") {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 1,
            targetType,
            error: pubRes
          });
        }
        return opFixedSuccess(createTalerReserveHttp(exchange ?? cs[0], pubRes.type === "ok" ? pubRes.body : decodeCrock(reservePub), params));
      }
      case PaytoType.Ethereum: {
        if (cs.length !== 1) {
          return opKnownFailureWithBody(PaytoParseError.COMPONENTS_LENGTH, {
            targetType
          });
        }
        const address = parseEthereumAddress(cs[0]);
        if (!opts.ignoreComponentError && !address) {
          return opKnownFailureWithBody(PaytoParseError.INVALID_TARGET_PATH, {
            pos: 0,
            targetType,
            error: address
          });
        }
        return opFixedSuccess(createEthereum(address ?? cs[0], params));
      }
      default: {
        if (opts.allowUnsupported) {
          return opFixedSuccess(createUnsupported(targetType, targetPath, params));
        }
        assertUnreachable(targetType);
      }
    }
  }
  Paytos2.fromString = fromString;
})(Paytos || (Paytos = {}));
function codecForPaytoHash() {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      return x6;
    }
  };
}
function codecFullForPaytoString() {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (!x6.startsWith(PAYTO_PREFIX)) {
        throw new DecodingError(`expected start with payto at ${renderContext(c5)} but got "${x6}"`);
      }
      return x6;
    }
  };
}
function codecForPaytoString() {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (!x6.startsWith(PAYTO_PREFIX)) {
        throw new DecodingError(`expected start with payto at ${renderContext(c5)} but got "${x6}"`);
      }
      return x6;
    }
  };
}
function encodeRFC3986URIComponent(str) {
  return encodeURIComponent(str).replace(/[!'()*]/g, (c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`);
}
var rfc3986 = encodeRFC3986URIComponent;
function createSearchParams(paramList) {
  return paramList.map(([key, value]) => `${rfc3986(key)}=${rfc3986(value)}`).join("&");
}
function stringifyPaytoUri(p4) {
  const url = new URL(`${PAYTO_PREFIX}${p4.targetType}/${p4.targetPath}`);
  const paramList = !p4.params ? [] : Object.entries(p4.params);
  url.search = createSearchParams(paramList);
  return url.href;
}
function parsePaytoUri(s6) {
  if (!s6.startsWith(PAYTO_PREFIX)) {
    return void 0;
  }
  const [acct, search] = s6.slice(PAYTO_PREFIX.length).split("?");
  const firstSlashPos = acct.indexOf("/");
  if (firstSlashPos === -1) {
    return void 0;
  }
  const targetType = acct.slice(0, firstSlashPos);
  const targetPath = acct.slice(firstSlashPos + 1);
  const params = {};
  const searchParams = new URLSearchParams2(search || "");
  searchParams.forEach((v3, k6) => {
    params[k6] = v3;
  });
  switch (targetType) {
    case "iban": {
      const parts = targetPath.split("/");
      let iban = void 0;
      let bic = void 0;
      if (parts.length === 1) {
        iban = parts[0].toUpperCase();
      }
      if (parts.length === 2) {
        bic = parts[0];
        iban = parts[1].toUpperCase();
      } else {
        iban = targetPath.toUpperCase();
      }
      return {
        isKnown: true,
        targetPath,
        targetType,
        params,
        iban,
        bic
      };
    }
    case "bitcoin": {
      const msg = /\b([A-Z0-9]{52})\b/.exec(params["message"]);
      const reserve = !msg ? params["subject"] : msg[0];
      const pubRes = !reserve ? void 0 : Paytos.parseReservePub(reserve);
      const addr = !pubRes || pubRes.type === "fail" ? void 0 : generateFakeSegwitAddress(pubRes.body, targetPath);
      const segwitAddrs = !addr || addr.type === "fail" ? [] : addr.body;
      const result = {
        isKnown: true,
        targetPath,
        targetType,
        address: targetPath,
        params,
        segwitAddrs
      };
      return result;
    }
    case "x-taler-bank": {
      const parts = targetPath.split("/");
      const host = parts[0];
      const account = parts[1];
      return {
        targetPath,
        targetType,
        params,
        isKnown: true,
        host,
        account
      };
    }
    case "taler-reserve": {
      const parts = targetPath.split("/");
      const exchange = parts[0];
      const reservePub = parts[1];
      return {
        targetPath,
        targetType,
        params,
        isKnown: true,
        exchange,
        reservePub
      };
    }
    case "ethereum": {
      const result = {
        isKnown: true,
        targetPath,
        targetType,
        address: targetPath,
        params
      };
      return result;
    }
    default: {
      return {
        targetPath,
        targetType,
        params,
        isKnown: false
      };
    }
  }
}

// ../taler-util/lib/types-taler-exchange.js
var DenominationPubKey;
(function(DenominationPubKey2) {
  function cmp(p1, p22) {
    if (p1.cipher < p22.cipher) {
      return -1;
    } else if (p1.cipher > p22.cipher) {
      return 1;
    } else if (p1.cipher === DenomKeyType.Rsa && p22.cipher === DenomKeyType.Rsa) {
      if ((p1.age_mask ?? 0) < (p22.age_mask ?? 0)) {
        return -1;
      } else if ((p1.age_mask ?? 0) > (p22.age_mask ?? 0)) {
        return 1;
      }
      return strcmp(p1.rsa_public_key, p22.rsa_public_key);
    } else if (p1.cipher === DenomKeyType.ClauseSchnorr && p22.cipher === DenomKeyType.ClauseSchnorr) {
      if ((p1.age_mask ?? 0) < (p22.age_mask ?? 0)) {
        return -1;
      } else if ((p1.age_mask ?? 0) > (p22.age_mask ?? 0)) {
        return 1;
      }
      return strcmp(p1.cs_public_key, p22.cs_public_key);
    } else {
      throw Error("unsupported cipher");
    }
  }
  DenominationPubKey2.cmp = cmp;
})(DenominationPubKey || (DenominationPubKey = {}));
var codecForExchangeWireAccount = () => buildCodecForObject().property("conversion_url", codecOptional(codecForStringURL())).property("credit_restrictions", codecForList(codecForAny())).property("debit_restrictions", codecForList(codecForAny())).property("master_sig", codecForEddsaSignature()).property("payto_uri", codecForString()).property("bank_label", codecOptional(codecForString())).property("priority", codecOptional(codecForNumber())).build("WireAccount");
var codecForNgDenominations = codecForAny();
var DenomKeyType;
(function(DenomKeyType2) {
  DenomKeyType2["Rsa"] = "RSA";
  DenomKeyType2["ClauseSchnorr"] = "CS";
})(DenomKeyType || (DenomKeyType = {}));
(function(DenomKeyType2) {
  function toIntTag(t5) {
    switch (t5) {
      case DenomKeyType2.Rsa:
        return 1;
      case DenomKeyType2.ClauseSchnorr:
        return 2;
    }
  }
  DenomKeyType2.toIntTag = toIntTag;
})(DenomKeyType || (DenomKeyType = {}));
var codecForRsaBlindedDenominationSignature = () => buildCodecForObject().property("cipher", codecForConstString(DenomKeyType.Rsa)).property("blinded_rsa_signature", codecForString()).build("RsaBlindedDenominationSignature");
var codecForBlindedDenominationSignature = () => buildCodecForUnion().discriminateOn("cipher").alternative(DenomKeyType.Rsa, codecForRsaBlindedDenominationSignature()).build("BlindedDenominationSignature");
var codecForExchangeWithdrawResponse = () => buildCodecForObject().property("ev_sigs", codecForList(codecForBlindedDenominationSignature())).build("WithdrawResponse");
var codecForExchangeMeltResponse = () => buildCodecForObject().property("exchange_pub", codecForEddsaPublicKey()).property("exchange_sig", codecForEddsaSignature()).property("noreveal_index", codecForNumber()).property("refresh_base_url", codecOptional(codecForString())).build("ExchangeMeltResponse");
var codecForExchangeGetContractResponse = () => buildCodecForObject().property("purse_pub", codecForString()).property("econtract_sig", codecForString()).property("econtract", codecForString()).build("ExchangeGetContractResponse");
var codecForExchangeMergeSuccessResponse = () => buildCodecForObject().property("merge_amount", codecForAmountString()).property("exchange_timestamp", codecForTimestamp).property("exchange_sig", codecForEddsaSignature()).property("exchange_pub", codecForEddsaPublicKey()).build("ExchangeMergeSuccessResponse");
var codecForExchangeMergeConflictResponse = () => buildCodecForObject().property("merge_timestamp", codecForTimestamp).property("merge_sig", codecForEddsaSignature()).property("reserve_pub", codecForEddsaPublicKey()).property("partner_url", codecOptional(codecForString())).build("ExchangeMergeConflictResponse");
var codecForExchangePurseStatus = () => buildCodecForObject().property("balance", codecForAmountString()).property("deposit_timestamp", codecOptional(codecForTimestamp)).property("merge_timestamp", codecOptional(codecForTimestamp)).build("ExchangePurseStatus");
var AmlSpaDialect;
(function(AmlSpaDialect2) {
  AmlSpaDialect2["TOPS"] = "tops";
  AmlSpaDialect2["GLS"] = "gls";
  AmlSpaDialect2["TESTING"] = "testing";
})(AmlSpaDialect || (AmlSpaDialect = {}));
var LimitOperationType;
(function(LimitOperationType2) {
  LimitOperationType2["withdraw"] = "WITHDRAW";
  LimitOperationType2["deposit"] = "DEPOSIT";
  LimitOperationType2["merge"] = "MERGE";
  LimitOperationType2["aggregate"] = "AGGREGATE";
  LimitOperationType2["balance"] = "BALANCE";
  LimitOperationType2["refund"] = "REFUND";
  LimitOperationType2["close"] = "CLOSE";
  LimitOperationType2["transaction"] = "TRANSACTION";
})(LimitOperationType || (LimitOperationType = {}));
var AmlState;
(function(AmlState2) {
  AmlState2[AmlState2["normal"] = 0] = "normal";
  AmlState2[AmlState2["pending"] = 1] = "pending";
  AmlState2[AmlState2["frozen"] = 2] = "frozen";
})(AmlState || (AmlState = {}));
var codecForAmlSpaDialect = codecForEither(codecForConstString(AmlSpaDialect.GLS), codecForConstString(AmlSpaDialect.TOPS), codecForConstString(AmlSpaDialect.TESTING));
var codecForExchangeConfig = () => buildCodecForObject().property("version", codecForString()).property("name", codecForConstString("taler-exchange")).property("implementation", codecOptional(codecForURN())).property("currency", codecForString()).property("currency_specification", codecForCurrencySpecificiation()).property("supported_kyc_requirements", codecForList(codecForString())).property("aml_spa_dialect", codecOptional(codecForAmlSpaDialect)).deprecatedProperty("shopping_url").deprecatedProperty("wallet_balance_limit_without_kyc").build("TalerExchangeApi.ExchangeVersionResponse");
var codecForExchangeKeysResponse = () => buildCodecForObject().property("version", codecForString()).property("base_url", codecForURLString()).property("currency", codecForString()).property("accounts", codecForAny()).property("asset_type", codecForAny()).property("auditors", codecForAny()).property("currency_specification", codecForAny()).property("zero_limits", codecForAny()).property("hard_limits", codecForAny()).property("denominations", codecForAny()).property("exchange_pub", codecForAny()).property("exchange_sig", codecForAny()).property("extensions", codecForAny()).property("extensions_sig", codecForAny()).property("global_fees", codecForAny()).property("list_issue_date", codecForAny()).property("master_public_key", codecForAny()).property("recoup", codecForAny()).property("reserve_closing_delay", codecForAny()).property("signkeys", codecForAny()).property("stefan_abs", codecForAny()).property("stefan_lin", codecForAny()).property("stefan_log", codecForAny()).property("wads", codecForAny()).property("wallet_balance_limit_without_kyc", codecForAny()).property("wire_fees", codecForAny()).property("kyc_enabled", codecOptional(codecForBoolean())).property("shopping_url", codecOptional(codecForString())).property("tiny_amount", codecOptional(codecForAmountString())).property("disable_direct_deposit", codecOptional(codecForBoolean())).property("bank_compliance_language", codecOptional(codecForString())).property("open_banking_gateway", codecOptional(codecForURLString())).deprecatedProperty("rewards_allowed").build("TalerExchangeApi.ExchangeKeysResponse");
var codecForAmlStatisticsResponse = () => buildCodecForObject().property("statistics", codecForList(codecForEventCounter())).build("TalerExchangeApi.AmlStatisticsResponse");
var codecForEventCounter = () => buildCodecForObject().property("name", codecForString()).property("counter", codecForNumber()).build("TalerExchangeApi.EventCounter");
var codecForLegitimizationMeasuresList = () => buildCodecForObject().property("measures", codecForList(codecForLegitimizationMeasureDetails())).build("TalerExchangeApi.LegitimizationMeasuresList");
var codecForLegitimizationMeasureDetails = () => buildCodecForObject().property("h_payto", codecForAny()).property("rowid", codecForAny()).property("start_time", codecForAny()).property("measures", codecForAny()).property("is_finished", codecForAny()).build("TalerExchangeApi.LegitimizationMeasureDetails");
var codecForAvailableMeasureSummary = () => buildCodecForObject().property("checks", codecForMap(codecForKycCheckInformation())).property("programs", codecForMap(codecForAmlProgramRequirement())).property("roots", codecForMap(codecForMeasureInformation())).property("default_rules", codecForList(codecForKycRules())).build("TalerExchangeApi.AvailableMeasureSummary");
var codecForAmlProgramRequirement = () => buildCodecForObject().property("description", codecForString()).property("context", codecForList(codecForString())).property("inputs", codecForList(codecForString())).build("TalerExchangeApi.AmlProgramRequirement");
var codecForKycCheckInformation = () => buildCodecForObject().property("description", codecForString()).property("description_i18n", codecOptional(codecForInternationalizedString())).property("fallback", codecForString()).property("outputs", codecForList(codecForString())).property("requires", codecForList(codecForString())).build("TalerExchangeApi.KycCheckInformation");
var codecForMeasureInformation = () => buildCodecForObject().property("prog_name", codecOptional(codecForString())).property("check_name", codecForString()).property("context", codecForAny()).property("operation_type", codecOptional(codecForOperationType)).property("voluntary", codecOptional(codecForBoolean())).build("TalerExchangeApi.MeasureInformation");
var codecForAmlDecisionsResponse = () => buildCodecForObject().property("records", codecForList(codecForAmlDecision())).build("TalerExchangeApi.AmlDecisionsResponse");
var codecForAmlCustomerAccountSummary = () => buildCodecForObject().property("h_payto", codecForPaytoHash()).property("close_time", codecForTimestamp).property("open_time", codecForTimestamp).property("comments", codecOptional(codecForString())).property("full_payto", codecFullForPaytoString()).property("high_risk", codecForBoolean()).property("rowid", codecForNumber()).property("to_investigate", codecForBoolean()).build("TalerExchangeApi.CustomerAccountSummary");
var codecForAmlDecisionsAccounts = () => buildCodecForObject().property("accounts", codecForList(codecForAmlCustomerAccountSummary())).build("TalerExchangeApi.AmlAccountsResponse");
var codecForAmlDecision = () => buildCodecForObject().property("h_payto", codecForString()).property("full_payto", codecOptional(codecForString())).property("rowid", codecForNumber()).property("is_wallet", codecForBoolean()).property("justification", codecOptional(codecForString())).property("decision_time", codecForTimestamp).property("properties", codecOptional(codecForAccountProperties())).property("limits", codecForLegitimizationRuleSet()).property("to_investigate", codecForBoolean()).property("is_active", codecForBoolean()).build("TalerExchangeApi.AmlDecision");
var codecForAccountProperties = () => buildCodecForObject().property("pep", codecOptional(codecForBoolean())).property("sanctioned", codecOptional(codecForBoolean())).property("high_risk", codecOptional(codecForBoolean())).property("business_domain", codecOptional(codecForString())).property("is_frozen", codecOptional(codecForBoolean())).property("was_reported", codecOptional(codecForBoolean())).allowExtra().build("TalerExchangeApi.AccountProperties");
var codecForLegitimizationRuleSet = () => buildCodecForObject().property("expiration_time", codecForTimestamp).property("successor_measure", codecOptional(codecForString())).property("rules", codecForList(codecForKycRules())).property("custom_measures", codecForMap(codecForMeasureInformation())).build("TalerExchangeApi.LegitimizationRuleSet");
var codecForKycRules = () => buildCodecForObject().property("operation_type", codecForOperationType).property("threshold", codecForAmountString()).property("timeframe", codecForDuration).property("measures", codecForList(codecForString())).property("display_priority", codecForNumber()).property("exposed", codecOptional(codecForBoolean())).property("is_and_combinator", codecOptional(codecForBoolean())).property("rule_name", codecOptional(codecForString())).build("TalerExchangeApi.KycRule");
var codecForAmlKycAttributes = () => buildCodecForObject().property("details", codecForList(codecForKycAttributeCollectionEvent())).build("TalerExchangeApi.KycAttributes");
var codecForKycAttributeCollectionEvent = () => buildCodecForObject().property("rowid", codecForNumber()).property("provider_name", codecOptional(codecForString())).property("collection_time", codecForTimestamp).property("attributes", codecOptional(codecForAny())).build("TalerExchangeApi.KycAttributeCollectionEvent");
var codecForAmlWalletKycCheckResponse = () => buildCodecForObject().property("next_threshold", codecOptional(codecForAmountString())).property("expiration_time", codecForTimestamp).build("TalerExchangeApi.WalletKycCheckResponse");
var codecForLegitimizationNeededResponse = () => buildCodecForObject().property("code", codecForNumber()).property("hint", codecOptional(codecForString())).property("h_payto", codecForString()).property("account_pub", codecOptional(codecForEddsaPublicKey())).property("requirement_row", codecForNumber()).property("bad_kyc_auth", codecOptional(codecForBoolean())).build("TalerExchangeApi.LegitimizationNeededResponse");
var codecForAccountKycStatus = () => buildCodecForObject().property("aml_review", codecForBoolean()).property("access_token", codecForAccessToken()).property("limits", codecOptional(codecForList(codecForAccountLimit()))).property("rule_gen", codecForNumber()).build("TalerExchangeApi.AccountKycStatus");
var codecForOperationType = codecForEither(codecForConstString(LimitOperationType.withdraw), codecForConstString(LimitOperationType.deposit), codecForConstString(LimitOperationType.merge), codecForConstString(LimitOperationType.balance), codecForConstString(LimitOperationType.close), codecForConstString(LimitOperationType.aggregate), codecForConstString(LimitOperationType.transaction), codecForConstString(LimitOperationType.refund));
var codecForAccountLimit = () => buildCodecForObject().property("operation_type", codecForOperationType).property("timeframe", codecForDuration).property("threshold", codecForAmountString()).property("soft_limit", codecOptional(codecForBoolean())).property("rule_name", codecOptional(codecForString())).build("TalerExchangeApi.AccountLimit");
var codecForKycRequirementInformationId = () => codecForString();
var codecForKycFormId = () => codecForString();
var codecForKycRequirementInformation = () => buildCodecForObject().property("form", codecForEither(codecForConstString("LINK"), codecForConstString("INFO"), codecForKycFormId())).property("description", codecForString()).property("context", codecOptional(codecForAny())).property("description_i18n", codecOptional(codecForInternationalizedString())).property("id", codecOptional(codecForKycRequirementInformationId())).build("TalerExchangeApi.KycRequirementInformation");
var codecForKycProcessClientInformation = () => buildCodecForObject().property("requirements", codecOptionalDefault(codecForList(codecForKycRequirementInformation()), [])).property("is_and_combinator", codecOptional(codecForBoolean())).property("voluntary_measures", codecOptional(codecForList(codecForKycRequirementInformation()))).build("TalerExchangeApi.KycProcessClientInformation");
var codecForExchangeTransferList = () => buildCodecForObject().property("transfers", codecForList(codecForExchangeTransferListEntry())).build("TalerExchangeApi.ExchangeTransferList");
var codecForExchangeTransferListEntry = () => buildCodecForObject().property("rowid", codecForNumber()).property("payto_uri", codecForPaytoString()).property("amount", codecForAmountString()).property("execution_time", codecForTimestamp).build("TalerExchangeApi.ExchangeTransferListEntry");
var codecForKycProcessStartInformation = () => buildCodecForObject().property("redirect_url", codecForURLString()).build("TalerExchangeApi.KycProcessStartInformation");
var TransactionHistoryType;
(function(TransactionHistoryType2) {
  TransactionHistoryType2["setup"] = "SETUP";
  TransactionHistoryType2["withdraw"] = "WITHDRAW";
  TransactionHistoryType2["ageWithdraw"] = "AGEWITHDRAW";
  TransactionHistoryType2["credit"] = "CREDIT";
  TransactionHistoryType2["closing"] = "CLOSING";
  TransactionHistoryType2["open"] = "OPEN";
  TransactionHistoryType2["close"] = "CLOSE";
  TransactionHistoryType2["merge"] = "MERGE";
})(TransactionHistoryType || (TransactionHistoryType = {}));
var codecForPurseConflict = () => buildCodecForUnion().discriminateOn("code").alternative(TalerErrorCode.EXCHANGE_GENERIC_INSUFFICIENT_FUNDS, codecForDepositDoubleSpendError()).alternative(TalerErrorCode.EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA, codecForPurseCreateConflict()).alternative(TalerErrorCode.EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA, codecForPurseDepositConflict()).alternative(TalerErrorCode.EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA, codecForPurseContractConflict()).build("PurseConflict");
var codecForPurseConflictPartial = () => buildCodecForUnion().discriminateOn("code").alternative(TalerErrorCode.EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA, codecForPurseCreateConflict()).alternative(TalerErrorCode.EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA, codecForPurseDepositConflict()).alternative(TalerErrorCode.EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA, codecForPurseContractConflict()).build("PurseConflictPartial");
var codecForDepositDoubleSpendError = () => buildCodecForObject().property("code", codecForNumber()).property("hint", codecForString()).property("coin_pub", codecForString()).build("DepositDoubleSpendError");
var codecForPurseCreateConflict = () => buildCodecForObject().property("code", codecForNumber()).property("amount", codecForAmountString()).property("min_age", codecForNumber()).property("purse_expiration", codecForTimestamp).property("purse_sig", codecForString()).property("h_contract_terms", codecForString()).property("merge_pub", codecForString()).build("PurseCreateConflict");
var codecForPurseDepositConflict = () => buildCodecForObject().property("code", codecForNumber()).property("coin_pub", codecForString()).property("partner_url", codecOptional(codecForString())).property("amount", codecForAmountString()).build("PurseDepositConflict");
var codecForPurseContractConflict = () => buildCodecForObject().property("code", codecForNumber()).property("h_econtract", codecForString()).property("econtract_sig", codecForString()).property("contract_pub", codecForString()).build("PurseContractConflict");

// ../taler-util/lib/taler_signatures.js
var TalerSignaturePurpose;
(function(TalerSignaturePurpose2) {
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_AML_KEY"] = 1017] = "MASTER_AML_KEY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_DRAIN_PROFIT"] = 1018] = "MASTER_DRAIN_PROFIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_PARTNER_DETAILS"] = 1019] = "MASTER_PARTNER_DETAILS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_SIGNING_KEY_REVOKED"] = 1020] = "MASTER_SIGNING_KEY_REVOKED";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_ADD_WIRE"] = 1021] = "MASTER_ADD_WIRE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_GLOBAL_FEES"] = 1022] = "MASTER_GLOBAL_FEES";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_DEL_WIRE"] = 1023] = "MASTER_DEL_WIRE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_SIGNING_KEY_VALIDITY"] = 1024] = "MASTER_SIGNING_KEY_VALIDITY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_DENOMINATION_KEY_VALIDITY"] = 1025] = "MASTER_DENOMINATION_KEY_VALIDITY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_ADD_AUDITOR"] = 1026] = "MASTER_ADD_AUDITOR";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_DEL_AUDITOR"] = 1027] = "MASTER_DEL_AUDITOR";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_WIRE_FEES"] = 1028] = "MASTER_WIRE_FEES";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_DENOMINATION_KEY_REVOKED"] = 1029] = "MASTER_DENOMINATION_KEY_REVOKED";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_WIRE_DETAILS"] = 1030] = "MASTER_WIRE_DETAILS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MASTER_EXTENSION"] = 1031] = "MASTER_EXTENSION";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_RESERVE_STATUS"] = 1032] = "EXCHANGE_RESERVE_STATUS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_DEPOSIT"] = 1033] = "EXCHANGE_CONFIRM_DEPOSIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_MELT"] = 1034] = "EXCHANGE_CONFIRM_MELT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_KEY_SET"] = 1035] = "EXCHANGE_KEY_SET";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_WIRE"] = 1036] = "EXCHANGE_CONFIRM_WIRE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_WIRE_DEPOSIT"] = 1037] = "EXCHANGE_CONFIRM_WIRE_DEPOSIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_REFUND"] = 1038] = "EXCHANGE_CONFIRM_REFUND";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_RECOUP"] = 1039] = "EXCHANGE_CONFIRM_RECOUP";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_RESERVE_CLOSED"] = 1040] = "EXCHANGE_RESERVE_CLOSED";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_RECOUP_REFRESH"] = 1041] = "EXCHANGE_CONFIRM_RECOUP_REFRESH";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_AFFIRM_DENOM_UNKNOWN"] = 1042] = "EXCHANGE_AFFIRM_DENOM_UNKNOWN";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_AFFIRM_DENOM_EXPIRED"] = 1043] = "EXCHANGE_AFFIRM_DENOM_EXPIRED";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_PURSE_CREATION"] = 1045] = "EXCHANGE_CONFIRM_PURSE_CREATION";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_PURSE_MERGED"] = 1046] = "EXCHANGE_CONFIRM_PURSE_MERGED";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_PURSE_STATUS"] = 1047] = "EXCHANGE_PURSE_STATUS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_RESERVE_ATTEST_DETAILS"] = 1048] = "EXCHANGE_RESERVE_ATTEST_DETAILS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_PURSE_REFUND"] = 1049] = "EXCHANGE_CONFIRM_PURSE_REFUND";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_CONFIRM_WITHDRAW"] = 1050] = "EXCHANGE_CONFIRM_WITHDRAW";
  TalerSignaturePurpose2[TalerSignaturePurpose2["AUDITOR_EXCHANGE_KEYS"] = 1064] = "AUDITOR_EXCHANGE_KEYS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_CONTRACT"] = 1101] = "MERCHANT_CONTRACT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_REFUND"] = 1102] = "MERCHANT_REFUND";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_TRACK_TRANSACTION"] = 1103] = "MERCHANT_TRACK_TRANSACTION";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_PAYMENT_OK"] = 1104] = "MERCHANT_PAYMENT_OK";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_WIRE_DETAILS"] = 1107] = "MERCHANT_WIRE_DETAILS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MERCHANT_TOKEN_ISSUE"] = 1108] = "MERCHANT_TOKEN_ISSUE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_WITHDRAW"] = 1200] = "WALLET_RESERVE_WITHDRAW";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_DEPOSIT"] = 1201] = "WALLET_COIN_DEPOSIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_MELT"] = 1202] = "WALLET_COIN_MELT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_RECOUP"] = 1203] = "WALLET_COIN_RECOUP";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_LINK"] = 1204] = "WALLET_COIN_LINK";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_ACCOUNT_SETUP"] = 1205] = "WALLET_ACCOUNT_SETUP";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_RECOUP_REFRESH"] = 1206] = "WALLET_COIN_RECOUP_REFRESH";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_AGE_ATTESTATION"] = 1207] = "WALLET_AGE_ATTESTATION";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_HISTORY"] = 1208] = "WALLET_RESERVE_HISTORY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_COIN_HISTORY"] = 1209] = "WALLET_COIN_HISTORY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_CREATE"] = 1210] = "WALLET_PURSE_CREATE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_DEPOSIT"] = 1211] = "WALLET_PURSE_DEPOSIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_STATUS"] = 1212] = "WALLET_PURSE_STATUS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_MERGE"] = 1213] = "WALLET_PURSE_MERGE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_ACCOUNT_MERGE"] = 1214] = "WALLET_ACCOUNT_MERGE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_CLOSE"] = 1215] = "WALLET_RESERVE_CLOSE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_ECONTRACT"] = 1216] = "WALLET_PURSE_ECONTRACT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_OPEN"] = 1217] = "WALLET_RESERVE_OPEN";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_OPEN_DEPOSIT"] = 1218] = "WALLET_RESERVE_OPEN_DEPOSIT";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_ATTEST_DETAILS"] = 1219] = "WALLET_RESERVE_ATTEST_DETAILS";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_PURSE_DELETE"] = 1220] = "WALLET_PURSE_DELETE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_RESERVE_AGE_WITHDRAW"] = 1221] = "WALLET_RESERVE_AGE_WITHDRAW";
  TalerSignaturePurpose2[TalerSignaturePurpose2["WALLET_TOKEN_USE"] = 1222] = "WALLET_TOKEN_USE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["SM_RSA_DENOMINATION_KEY"] = 1250] = "SM_RSA_DENOMINATION_KEY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["SM_SIGNING_KEY"] = 1251] = "SM_SIGNING_KEY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["SM_CS_DENOMINATION_KEY"] = 1252] = "SM_CS_DENOMINATION_KEY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["CLIENT_TEST_EDDSA"] = 1302] = "CLIENT_TEST_EDDSA";
  TalerSignaturePurpose2[TalerSignaturePurpose2["EXCHANGE_TEST_EDDSA"] = 1303] = "EXCHANGE_TEST_EDDSA";
  TalerSignaturePurpose2[TalerSignaturePurpose2["AML_DECISION"] = 1350] = "AML_DECISION";
  TalerSignaturePurpose2[TalerSignaturePurpose2["AML_QUERY"] = 1351] = "AML_QUERY";
  TalerSignaturePurpose2[TalerSignaturePurpose2["KYC_AUTH"] = 1360] = "KYC_AUTH";
  TalerSignaturePurpose2[TalerSignaturePurpose2["ANASTASIS_POLICY_UPLOAD"] = 1400] = "ANASTASIS_POLICY_UPLOAD";
  TalerSignaturePurpose2[TalerSignaturePurpose2["SYNC_BACKUP_UPLOAD"] = 1450] = "SYNC_BACKUP_UPLOAD";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MAILBOX_MESSAGES_DELETE"] = 1551] = "MAILBOX_MESSAGES_DELETE";
  TalerSignaturePurpose2[TalerSignaturePurpose2["MAILBOX_KEYS_UPDATE"] = 1552] = "MAILBOX_KEYS_UPDATE";
})(TalerSignaturePurpose || (TalerSignaturePurpose = {}));

// ../taler-util/lib/taler-crypto.js
var isEddsaPubP = Symbol("isEddsaPubP");
var isEddsaPrivP = Symbol("isEddsaPrivP");
var isEddsaSigP = Symbol("isEddsaSigP");
var isEdx25519PublicKey = Symbol("isEdx25519PublicKey");
var isEdx25519PrivateKey = Symbol("isEdx25519PrivateKey");
var isEcdhePrivP = Symbol("isEcdhePrivP");
var isEdx25519Signature = Symbol("isEdx25519Signature");
var isEdx25519PublicKeyEnc = Symbol("isEdx25519PublicKeyEnc");
var isEdx25519PrivateKeyEnc = Symbol("isEdx25519PrivateKeyEnc");
var isEncryptionNonce = Symbol("isEncryptionNone");
function getRandomBytes(n2) {
  return randomBytes(n2);
}
var useNative = true;
var tart;
if (useNative) {
  tart = globalThis._tart;
}
var encTable = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
var EncodingError = class _EncodingError extends Error {
  constructor() {
    super("Encoding error");
    Object.setPrototypeOf(this, _EncodingError.prototype);
  }
};
function getValue(chr) {
  let a6 = chr;
  switch (chr) {
    case "O":
    case "o":
      a6 = "0";
      break;
    case "i":
    case "I":
    case "l":
    case "L":
      a6 = "1";
      break;
    case "u":
    case "U":
      a6 = "V";
  }
  if (a6 >= "0" && a6 <= "9") {
    return a6.charCodeAt(0) - "0".charCodeAt(0);
  }
  if (a6 >= "a" && a6 <= "z")
    a6 = a6.toUpperCase();
  let dec = 0;
  if (a6 >= "A" && a6 <= "Z") {
    if ("I" < a6)
      dec++;
    if ("L" < a6)
      dec++;
    if ("O" < a6)
      dec++;
    if ("U" < a6)
      dec++;
    return a6.charCodeAt(0) - "A".charCodeAt(0) + 10 - dec;
  }
  throw new EncodingError();
}
function encodeCrock(data) {
  if (tart) {
    return tart.encodeCrock(data);
  }
  const dataBytes = new Uint8Array(data);
  let sb = "";
  const size = data.byteLength;
  let bitBuf = 0;
  let numBits = 0;
  let pos = 0;
  while (pos < size || numBits > 0) {
    if (pos < size && numBits < 5) {
      const d6 = dataBytes[pos++];
      bitBuf = bitBuf << 8 | d6;
      numBits += 8;
    }
    if (numBits < 5) {
      bitBuf = bitBuf << 5 - numBits;
      numBits = 5;
    }
    const v3 = bitBuf >>> numBits - 5 & 31;
    sb += encTable[v3];
    numBits -= 5;
  }
  return sb;
}
function kdf(outputLength, ikm, salt, info) {
  if (tart) {
    return tart.kdf(outputLength, ikm, salt, info);
  }
  salt = salt ?? new Uint8Array(64);
  const prk = hmacSha512(salt, ikm);
  info = info ?? new Uint8Array(0);
  const N3 = Math.ceil(outputLength / 32);
  const output = new Uint8Array(N3 * 32);
  for (let i5 = 0; i5 < N3; i5++) {
    let buf;
    if (i5 == 0) {
      buf = new Uint8Array(info.byteLength + 1);
      buf.set(info, 0);
    } else {
      buf = new Uint8Array(info.byteLength + 1 + 32);
      for (let j4 = 0; j4 < 32; j4++) {
        buf[j4] = output[(i5 - 1) * 32 + j4];
      }
      buf.set(info, 32);
    }
    buf[buf.length - 1] = i5 + 1;
    const chunk = hmacSha256(prk, buf);
    output.set(chunk, i5 * 32);
  }
  return output.slice(0, outputLength);
}
function kdfKw(args) {
  return kdf(args.outputLength, args.ikm, args.salt, args.info);
}
function decodeCrock(encoded) {
  if (tart) {
    return tart.decodeCrock(encoded);
  }
  const size = encoded.length;
  let bitpos = 0;
  let bitbuf = 0;
  let readPosition = 0;
  const outLen = Math.floor(size * 5 / 8);
  const out = new Uint8Array(outLen);
  let outPos = 0;
  while (readPosition < size || bitpos > 0) {
    if (readPosition < size) {
      const v3 = getValue(encoded[readPosition++]);
      bitbuf = bitbuf << 5 | v3;
      bitpos += 5;
    }
    while (bitpos >= 8) {
      const d6 = bitbuf >>> bitpos - 8 & 255;
      out[outPos++] = d6;
      bitpos -= 8;
    }
    if (readPosition == size && bitpos > 0) {
      bitbuf = bitbuf << 8 - bitpos & 255;
      bitpos = bitbuf == 0 ? 0 : 8;
    }
  }
  return out;
}
function eddsaGetPublic(eddsaPriv) {
  if (tart) {
    return tart.eddsaGetPublic(eddsaPriv);
  }
  const pair = crypto_sign_keyPair_fromSeed(eddsaPriv);
  return pair.publicKey;
}
var encoder;
function stringToBytes(s6) {
  if (!encoder) {
    encoder = new TextEncoder();
  }
  return encoder.encode(s6);
}
function typedArrayConcat(chunks) {
  let payloadLen = 0;
  for (const c5 of chunks) {
    payloadLen += c5.byteLength;
  }
  const buf = new ArrayBuffer(payloadLen);
  const u8buf = new Uint8Array(buf);
  let p4 = 0;
  for (const c5 of chunks) {
    u8buf.set(c5, p4);
    p4 += c5.byteLength;
  }
  return u8buf;
}
function hash2(d6) {
  if (tart) {
    return tart.hash(d6);
  }
  return hash(d6);
}
function hashTruncate32(d6) {
  const sha512HashCode = hash2(d6);
  return sha512HashCode.subarray(0, 32);
}
var logger4 = new Logger("talerCrypto.ts");
function eddsaSign(msg, eddsaPriv) {
  if (tart) {
    return tart.eddsaSign(msg, eddsaPriv);
  }
  const pair = crypto_sign_keyPair_fromSeed(eddsaPriv);
  return sign_detached(msg, pair.secretKey);
}
function bufferForUint32(n2) {
  const arrBuf = new ArrayBuffer(4);
  const buf = new Uint8Array(arrBuf);
  const dv = new DataView(arrBuf);
  dv.setUint32(0, n2);
  return buf;
}
function bufferForUint64(n2) {
  const arrBuf = new ArrayBuffer(8);
  const buf = new Uint8Array(arrBuf);
  const dv = new DataView(arrBuf);
  if (n2 < 0 || !Number.isInteger(n2)) {
    throw Error("non-negative integer expected");
  }
  dv.setBigUint64(0, BigInt(n2));
  return buf;
}
var WalletAccountMergeFlags;
(function(WalletAccountMergeFlags2) {
  WalletAccountMergeFlags2[WalletAccountMergeFlags2["None"] = 0] = "None";
  WalletAccountMergeFlags2[WalletAccountMergeFlags2["MergeFullyPaidPurse"] = 1] = "MergeFullyPaidPurse";
  WalletAccountMergeFlags2[WalletAccountMergeFlags2["CreateFromPurseQuota"] = 2] = "CreateFromPurseQuota";
  WalletAccountMergeFlags2[WalletAccountMergeFlags2["CreateWithPurseFee"] = 3] = "CreateWithPurseFee";
})(WalletAccountMergeFlags || (WalletAccountMergeFlags = {}));
var SignaturePurposeBuilder = class {
  constructor(purposeNum) {
    this.purposeNum = purposeNum;
    this.chunks = [];
  }
  put(bytes) {
    this.chunks.push(Uint8Array.from(bytes));
    return this;
  }
  build() {
    let payloadLen = 0;
    for (const c5 of this.chunks) {
      payloadLen += c5.byteLength;
    }
    const buf = new ArrayBuffer(4 + 4 + payloadLen);
    const u8buf = new Uint8Array(buf);
    let p4 = 8;
    for (const c5 of this.chunks) {
      u8buf.set(c5, p4);
      p4 += c5.byteLength;
    }
    const dvbuf = new DataView(buf);
    dvbuf.setUint32(0, payloadLen + 4 + 4);
    dvbuf.setUint32(4, this.purposeNum);
    return u8buf;
  }
};
function buildSigPS(purposeNum) {
  return new SignaturePurposeBuilder(purposeNum);
}
function bigintToNaclArr(x6, size) {
  const byteArr = new Uint8Array(size);
  const arr = x6.toArray(256).value.reverse();
  byteArr.set(arr, 0);
  return byteArr;
}
function bigintFromNaclArr(arr) {
  let rev = new Uint8Array(arr);
  rev = rev.reverse();
  return import_big_integer.default.fromArray(Array.from(rev), 256, false);
}
var Edx25519;
(function(Edx255192) {
  const revL = [
    237,
    211,
    245,
    92,
    26,
    99,
    18,
    88,
    214,
    156,
    247,
    162,
    222,
    249,
    222,
    20,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    16
  ];
  const L6 = import_big_integer.default.fromArray(revL.reverse(), 256, false);
  async function keyCreateFromSeed(seed) {
    return crypto_edx25519_private_key_create_from_seed(seed);
  }
  Edx255192.keyCreateFromSeed = keyCreateFromSeed;
  async function keyCreate() {
    return crypto_edx25519_private_key_create();
  }
  Edx255192.keyCreate = keyCreate;
  async function getPublic(priv) {
    return crypto_edx25519_get_public(priv);
  }
  Edx255192.getPublic = getPublic;
  function sign3(msg, key) {
    throw Error("not implemented");
  }
  Edx255192.sign = sign3;
  async function deriveFactor(pub, seed) {
    const res = kdfKw({
      outputLength: 64,
      ikm: pub,
      salt: stringToBytes("edx25519-derivation"),
      info: seed
    });
    return res;
  }
  async function privateKeyDerive(priv, seed) {
    const pub = await getPublic(priv);
    const privDec = priv;
    const a6 = bigintFromNaclArr(privDec.subarray(0, 32));
    const factorEnc = await deriveFactor(pub, seed);
    const factorModL = bigintFromNaclArr(factorEnc).mod(L6);
    const aPrime = a6.divide(8).multiply(factorModL).mod(L6).multiply(8).mod(L6);
    const bPrime = hash(typedArrayConcat([privDec.subarray(32, 64), factorEnc])).subarray(0, 32);
    const newPriv = typedArrayConcat([bigintToNaclArr(aPrime, 32), bPrime]);
    return newPriv;
  }
  Edx255192.privateKeyDerive = privateKeyDerive;
  async function publicKeyDerive(pub, seed) {
    const factorEnc = await deriveFactor(pub, seed);
    const factorReduced = crypto_core_ed25519_scalar_reduce(factorEnc);
    const res = crypto_scalarmult_ed25519_noclamp(factorReduced, pub);
    return res;
  }
  Edx255192.publicKeyDerive = publicKeyDerive;
})(Edx25519 || (Edx25519 = {}));
function invariant(cond) {
  if (!cond) {
    throw Error("invariant failed");
  }
}
var AgeRestriction;
(function(AgeRestriction2) {
  AgeRestriction2.AGE_UNRESTRICTED = 32;
  function hashCommitment(ac) {
    const hc = new HashState();
    for (const pub of ac.publicKeys) {
      hc.update(decodeCrock(pub));
    }
    return encodeCrock(hc.finish().subarray(0, 32));
  }
  AgeRestriction2.hashCommitment = hashCommitment;
  function countAgeGroups(mask) {
    let count = 0;
    let m6 = mask;
    while (m6 > 0) {
      count += m6 & 1;
      m6 = m6 >> 1;
    }
    return count;
  }
  AgeRestriction2.countAgeGroups = countAgeGroups;
  function getAgeGroupsFromMask(mask) {
    const groups = [];
    let age = 1;
    let m6 = mask >> 1;
    while (m6 > 0) {
      if (m6 & 1) {
        groups.push(age);
      }
      m6 = m6 >> 1;
      age++;
    }
    return groups;
  }
  AgeRestriction2.getAgeGroupsFromMask = getAgeGroupsFromMask;
  function getAgeGroupIndex(mask, age) {
    invariant((mask & 1) === 1);
    let i5 = 0;
    let m6 = mask;
    let a6 = age;
    while (m6 > 0) {
      if (a6 <= 0) {
        break;
      }
      m6 = m6 >> 1;
      i5 += m6 & 1;
      a6--;
    }
    return i5;
  }
  AgeRestriction2.getAgeGroupIndex = getAgeGroupIndex;
  function ageGroupSpecToMask(ageGroupSpec) {
    throw Error("not implemented");
  }
  AgeRestriction2.ageGroupSpecToMask = ageGroupSpecToMask;
  async function restrictionCommit(ageMask, age) {
    invariant((ageMask & 1) === 1);
    const numPubs = countAgeGroups(ageMask) - 1;
    const numPrivs = getAgeGroupIndex(ageMask, age);
    const pubs = [];
    const privs = [];
    for (let i5 = 0; i5 < numPubs; i5++) {
      const priv = await Edx25519.keyCreate();
      const pub = await Edx25519.getPublic(priv);
      pubs.push(pub);
      if (i5 < numPrivs) {
        privs.push(priv);
      }
    }
    return {
      commitment: {
        mask: ageMask,
        publicKeys: pubs.map((x6) => encodeCrock(x6))
      },
      proof: {
        privateKeys: privs.map((x6) => encodeCrock(x6))
      }
    };
  }
  AgeRestriction2.restrictionCommit = restrictionCommit;
  const PublishedAgeRestrictionBaseKey = decodeCrock("CH0VKFDZ2GWRWHQBBGEK9MWV5YDQVJ0RXEE0KYT3NMB69F0R96TG");
  async function restrictionCommitSeeded(ageMask, age, seed) {
    invariant((ageMask & 1) === 1);
    const numPubs = countAgeGroups(ageMask) - 1;
    const numPrivs = getAgeGroupIndex(ageMask, age);
    const pubs = [];
    const privs = [];
    for (let i5 = 0; i5 < numPrivs; i5++) {
      const privSeed = await kdfKw({
        outputLength: 32,
        ikm: seed,
        info: stringToBytes("age-commitment"),
        salt: bufferForUint32(i5)
      });
      const priv = await Edx25519.keyCreateFromSeed(privSeed);
      const pub = await Edx25519.getPublic(priv);
      pubs.push(pub);
      privs.push(priv);
    }
    for (let i5 = numPrivs; i5 < numPubs; i5++) {
      const deriveSeed = await kdfKw({
        outputLength: 32,
        ikm: seed,
        info: stringToBytes("age-factor"),
        salt: bufferForUint32(i5)
      });
      const pub = await Edx25519.publicKeyDerive(PublishedAgeRestrictionBaseKey, deriveSeed);
      pubs.push(pub);
    }
    return {
      commitment: {
        mask: ageMask,
        publicKeys: pubs.map((x6) => encodeCrock(x6))
      },
      proof: {
        privateKeys: privs.map((x6) => encodeCrock(x6))
      }
    };
  }
  AgeRestriction2.restrictionCommitSeeded = restrictionCommitSeeded;
  async function commitCompare(c1, c22, salt) {
    if (c1.publicKeys.length != c22.publicKeys.length) {
      return false;
    }
    for (let i5 = 0; i5 < c1.publicKeys.length; i5++) {
      const k1 = decodeCrock(c1.publicKeys[i5]);
      const k22 = await Edx25519.publicKeyDerive(decodeCrock(c22.publicKeys[i5]), salt);
      if (k1 != k22) {
        return false;
      }
    }
    return true;
  }
  AgeRestriction2.commitCompare = commitCompare;
  async function commitmentDerive(commitmentProof, salt) {
    const newPrivs = [];
    const newPubs = [];
    for (const oldPub of commitmentProof.commitment.publicKeys) {
      newPubs.push(await Edx25519.publicKeyDerive(decodeCrock(oldPub), salt));
    }
    for (const oldPriv of commitmentProof.proof.privateKeys) {
      newPrivs.push(await Edx25519.privateKeyDerive(decodeCrock(oldPriv), salt));
    }
    return {
      commitment: {
        mask: commitmentProof.commitment.mask,
        publicKeys: newPubs.map((x6) => encodeCrock(x6))
      },
      proof: {
        privateKeys: newPrivs.map((x6) => encodeCrock(x6))
      }
    };
  }
  AgeRestriction2.commitmentDerive = commitmentDerive;
  function commitmentAttest(commitmentProof, age) {
    const d6 = buildSigPS(TalerSignaturePurpose.WALLET_AGE_ATTESTATION).put(bufferForUint32(commitmentProof.commitment.mask)).put(bufferForUint32(age)).build();
    const group = getAgeGroupIndex(commitmentProof.commitment.mask, age);
    if (group === 0) {
      return new Uint8Array(64);
    }
    const priv = commitmentProof.proof.privateKeys[group - 1];
    const pub = commitmentProof.commitment.publicKeys[group - 1];
    const sig = crypto_edx25519_sign_detached(d6, decodeCrock(priv), decodeCrock(pub));
    return sig;
  }
  AgeRestriction2.commitmentAttest = commitmentAttest;
  function commitmentVerify(commitment, sig, age) {
    const d6 = buildSigPS(TalerSignaturePurpose.WALLET_AGE_ATTESTATION).put(bufferForUint32(commitment.mask)).put(bufferForUint32(age)).build();
    const group = getAgeGroupIndex(commitment.mask, age);
    if (group === 0) {
      return true;
    }
    const pub = commitment.publicKeys[group - 1];
    return crypto_edx25519_sign_detached_verify(d6, decodeCrock(sig), decodeCrock(pub));
  }
  AgeRestriction2.commitmentVerify = commitmentVerify;
})(AgeRestriction || (AgeRestriction = {}));
var ContractFormatTag;
(function(ContractFormatTag2) {
  ContractFormatTag2[ContractFormatTag2["PaymentOffer"] = 0] = "PaymentOffer";
  ContractFormatTag2[ContractFormatTag2["PaymentRequest"] = 1] = "PaymentRequest";
})(ContractFormatTag || (ContractFormatTag = {}));
var foreverNum = 2n ** 64n - 1n;
function timestampRoundedToBuffer(ts) {
  const b5 = new ArrayBuffer(8);
  const v3 = new DataView(b5);
  const numVal = ts.t_s === "never" ? foreverNum : BigInt(ts.t_s) * 1000n * 1000n;
  if (typeof v3.setBigUint64 !== "undefined") {
    v3.setBigUint64(0, numVal);
  } else {
    const s6 = ts.t_s === "never" ? (0, import_big_integer.default)(foreverNum) : (0, import_big_integer.default)(ts.t_s).multiply(1e3 * 1e3);
    const arr = s6.toArray(2 ** 8).value;
    let offset = 8 - arr.length;
    for (let i5 = 0; i5 < arr.length; i5++) {
      v3.setUint8(offset++, arr[i5]);
    }
  }
  return new Uint8Array(b5);
}
var HpkeRole;
(function(HpkeRole2) {
  HpkeRole2[HpkeRole2["Sender"] = 0] = "Sender";
  HpkeRole2[HpkeRole2["Receiver"] = 1] = "Receiver";
})(HpkeRole || (HpkeRole = {}));
var HpkeMode;
(function(HpkeMode2) {
  HpkeMode2[HpkeMode2["Base"] = 0] = "Base";
  HpkeMode2[HpkeMode2["PSK"] = 1] = "PSK";
})(HpkeMode || (HpkeMode = {}));

// ../taler-util/lib/types-taler-merchant.js
var types_taler_merchant_exports = {};
__export(types_taler_merchant_exports, {
  CheckPaymentResponse: () => CheckPaymentResponse,
  KycStatusLongPollingReason: () => KycStatusLongPollingReason,
  LoginTokenScope: () => LoginTokenScope,
  MerchantAccountKycStatus: () => MerchantAccountKycStatus,
  MerchantAccountKycStatusSimplified: () => MerchantAccountKycStatusSimplified,
  MerchantAuthMethod: () => MerchantAuthMethod,
  MerchantContractInputType: () => MerchantContractInputType,
  MerchantContractOutputType: () => MerchantContractOutputType,
  MerchantContractTokenKind: () => MerchantContractTokenKind,
  MerchantContractVersion: () => MerchantContractVersion,
  OrderInputType: () => OrderInputType,
  OrderOutputType: () => OrderOutputType,
  OrderVersion: () => OrderVersion,
  RoundingInterval: () => RoundingInterval,
  StatisticBucketRange: () => StatisticBucketRange,
  TanChannel: () => TanChannel,
  TokenFamilyKind: () => TokenFamilyKind,
  codecForAbortResponse: () => codecForAbortResponse,
  codecForAccountAddResponse: () => codecForAccountAddResponse,
  codecForAccountKycRedirects: () => codecForAccountKycRedirects,
  codecForAccountsSummaryResponse: () => codecForAccountsSummaryResponse,
  codecForAuditorHandle: () => codecForAuditorHandle,
  codecForBankAccountDetail: () => codecForBankAccountDetail,
  codecForBankAccountEntry: () => codecForBankAccountEntry,
  codecForCategoryListEntry: () => codecForCategoryListEntry,
  codecForCategoryListResponse: () => codecForCategoryListResponse,
  codecForCategoryProductList: () => codecForCategoryProductList,
  codecForChallenge: () => codecForChallenge,
  codecForChallengeRequestResponse: () => codecForChallengeRequestResponse,
  codecForChallengeResponse: () => codecForChallengeResponse,
  codecForCheckPaymentClaimedResponse: () => codecForCheckPaymentClaimedResponse,
  codecForCheckPaymentPaidResponse: () => codecForCheckPaymentPaidResponse,
  codecForCheckPaymentResponse: () => codecForCheckPaymentResponse,
  codecForCheckPaymentUnpaidResponse: () => codecForCheckPaymentUnpaidResponse,
  codecForClaimResponse: () => codecForClaimResponse,
  codecForCsTokenIssueBlindSig: () => codecForCsTokenIssueBlindSig,
  codecForExchange: () => codecForExchange,
  codecForExchangeKycTimeout: () => codecForExchangeKycTimeout,
  codecForFullInventoryDetailsResponse: () => codecForFullInventoryDetailsResponse,
  codecForIncomingTansferList: () => codecForIncomingTansferList,
  codecForIncomingTransferDetails: () => codecForIncomingTransferDetails,
  codecForInstance: () => codecForInstance,
  codecForInstancesResponse: () => codecForInstancesResponse,
  codecForInventoryEntry: () => codecForInventoryEntry,
  codecForInventorySummaryResponse: () => codecForInventorySummaryResponse,
  codecForLocation: () => codecForLocation,
  codecForLoginTokenSuccessResponse: () => codecForLoginTokenSuccessResponse,
  codecForMerchant: () => codecForMerchant,
  codecForMerchantAbortPayRefundFailureStatus: () => codecForMerchantAbortPayRefundFailureStatus,
  codecForMerchantAbortPayRefundStatus: () => codecForMerchantAbortPayRefundStatus,
  codecForMerchantAbortPayRefundSuccessStatus: () => codecForMerchantAbortPayRefundSuccessStatus,
  codecForMerchantAbortPayRefundUndepositedStatus: () => codecForMerchantAbortPayRefundUndepositedStatus,
  codecForMerchantAccountKycRedirect: () => codecForMerchantAccountKycRedirect,
  codecForMerchantAccountKycStatus: () => codecForMerchantAccountKycStatus,
  codecForMerchantAuthMethod: () => codecForMerchantAuthMethod,
  codecForMerchantCategory: () => codecForMerchantCategory,
  codecForMerchantClaimResponse: () => codecForMerchantClaimResponse,
  codecForMerchantCoinRefundFailureStatus: () => codecForMerchantCoinRefundFailureStatus,
  codecForMerchantCoinRefundStatus: () => codecForMerchantCoinRefundStatus,
  codecForMerchantCoinRefundSuccessStatus: () => codecForMerchantCoinRefundSuccessStatus,
  codecForMerchantContractChoice: () => codecForMerchantContractChoice,
  codecForMerchantContractDiscountTokenDetails: () => codecForMerchantContractDiscountTokenDetails,
  codecForMerchantContractInput: () => codecForMerchantContractInput,
  codecForMerchantContractInputToken: () => codecForMerchantContractInputToken,
  codecForMerchantContractOutput: () => codecForMerchantContractOutput,
  codecForMerchantContractOutputTaxReceipt: () => codecForMerchantContractOutputTaxReceipt,
  codecForMerchantContractOutputToken: () => codecForMerchantContractOutputToken,
  codecForMerchantContractSubscriptionTokenDetails: () => codecForMerchantContractSubscriptionTokenDetails,
  codecForMerchantContractTerms: () => codecForMerchantContractTerms,
  codecForMerchantContractTermsV0: () => codecForMerchantContractTermsV0,
  codecForMerchantContractTermsV1: () => codecForMerchantContractTermsV1,
  codecForMerchantContractTokenDetails: () => codecForMerchantContractTokenDetails,
  codecForMerchantContractTokenFamily: () => codecForMerchantContractTokenFamily,
  codecForMerchantInfo: () => codecForMerchantInfo,
  codecForMerchantOrderPrivateStatusResponse: () => codecForMerchantOrderPrivateStatusResponse,
  codecForMerchantOrderStatusPaid: () => codecForMerchantOrderStatusPaid,
  codecForMerchantOrderStatusUnpaid: () => codecForMerchantOrderStatusUnpaid,
  codecForMerchantPayResponse: () => codecForMerchantPayResponse,
  codecForMerchantPosProductDetail: () => codecForMerchantPosProductDetail,
  codecForMerchantRefundPermission: () => codecForMerchantRefundPermission,
  codecForMerchantRefundResponse: () => codecForMerchantRefundResponse,
  codecForMerchantReserveCreateConfirmation: () => codecForMerchantReserveCreateConfirmation,
  codecForOrder: () => codecForOrder,
  codecForOrderChoice: () => codecForOrderChoice,
  codecForOrderHistory: () => codecForOrderHistory,
  codecForOrderHistoryEntry: () => codecForOrderHistoryEntry,
  codecForOrderInput: () => codecForOrderInput,
  codecForOrderInputToken: () => codecForOrderInputToken,
  codecForOrderOutput: () => codecForOrderOutput,
  codecForOrderOutputTaxReceipt: () => codecForOrderOutputTaxReceipt,
  codecForOrderOutputToken: () => codecForOrderOutputToken,
  codecForOrderV0: () => codecForOrderV0,
  codecForOrderV1: () => codecForOrderV1,
  codecForOtpDeviceDetails: () => codecForOtpDeviceDetails,
  codecForOtpDeviceEntry: () => codecForOtpDeviceEntry,
  codecForOtpDeviceSummaryResponse: () => codecForOtpDeviceSummaryResponse,
  codecForOutOfStockResponse: () => codecForOutOfStockResponse,
  codecForPaidRefundStatusResponse: () => codecForPaidRefundStatusResponse,
  codecForPaymentDeniedLegallyResponse: () => codecForPaymentDeniedLegallyResponse,
  codecForPaymentResponse: () => codecForPaymentResponse,
  codecForPostOrderResponse: () => codecForPostOrderResponse,
  codecForProduct: () => codecForProduct,
  codecForProductDetail: () => codecForProductDetail,
  codecForProductSummary: () => codecForProductSummary,
  codecForQueryInstancesResponse: () => codecForQueryInstancesResponse,
  codecForRSATokenIssueBlindSig: () => codecForRSATokenIssueBlindSig,
  codecForRefundDetails: () => codecForRefundDetails,
  codecForRoundingInterval: () => codecForRoundingInterval,
  codecForSignedTokenEnvelope: () => codecForSignedTokenEnvelope,
  codecForStatisticBucketRange: () => codecForStatisticBucketRange,
  codecForStatisticsAmountBucket: () => codecForStatisticsAmountBucket,
  codecForStatisticsAmountInterval: () => codecForStatisticsAmountInterval,
  codecForStatisticsAmountResponse: () => codecForStatisticsAmountResponse,
  codecForStatisticsCounterBucket: () => codecForStatisticsCounterBucket,
  codecForStatisticsCounterInterval: () => codecForStatisticsCounterInterval,
  codecForStatisticsCounterResponse: () => codecForStatisticsCounterResponse,
  codecForStatusGoto: () => codecForStatusGoto,
  codecForStatusPaid: () => codecForStatusPaid,
  codecForStatusStatusUnpaid: () => codecForStatusStatusUnpaid,
  codecForTalerMerchantConfigResponse: () => codecForTalerMerchantConfigResponse,
  codecForTansferList: () => codecForTansferList,
  codecForTax: () => codecForTax,
  codecForTemplateContractDetails: () => codecForTemplateContractDetails,
  codecForTemplateContractDetailsDefaults: () => codecForTemplateContractDetailsDefaults,
  codecForTemplateDetails: () => codecForTemplateDetails,
  codecForTemplateEditableDetails: () => codecForTemplateEditableDetails,
  codecForTemplateEntry: () => codecForTemplateEntry,
  codecForTemplateSummaryResponse: () => codecForTemplateSummaryResponse,
  codecForTokenFamiliesList: () => codecForTokenFamiliesList,
  codecForTokenFamilyDetails: () => codecForTokenFamilyDetails,
  codecForTokenFamilyKind: () => codecForTokenFamilyKind,
  codecForTokenFamilySummary: () => codecForTokenFamilySummary,
  codecForTokenIssueBlindSig: () => codecForTokenIssueBlindSig,
  codecForTokenIssueCsPublicKey: () => codecForTokenIssueCsPublicKey,
  codecForTokenIssuePublicKey: () => codecForTokenIssuePublicKey,
  codecForTokenIssueRsaPublicKey: () => codecForTokenIssueRsaPublicKey,
  codecForTokenScope: () => codecForTokenScope,
  codecForTransactionWireReport: () => codecForTransactionWireReport,
  codecForTransactionWireTransfer: () => codecForTransactionWireTransfer,
  codecForTransferDetails: () => codecForTransferDetails,
  codecForWalletRefundResponse: () => codecForWalletRefundResponse,
  codecForWalletTemplateDetails: () => codecForWalletTemplateDetails,
  codecForWebhookDetails: () => codecForWebhookDetails,
  codecForWebhookEntry: () => codecForWebhookEntry,
  codecForWebhookSummaryResponse: () => codecForWebhookSummaryResponse,
  getMerchantAccountKycStatusSimplified: () => getMerchantAccountKycStatusSimplified
});
var CheckPaymentResponse = class {
};
var codecForMerchantRefundPermission = () => buildCodecForObject().property("refund_amount", codecForAmountString()).property("refund_fee", codecForAmountString()).property("coin_pub", codecForString()).property("rtransaction_id", codecForNumber()).property("exchange_http_status", codecForNumber()).property("exchange_code", codecOptional(codecForNumber())).property("exchange_reply", codecOptional(codecForAny())).property("exchange_sig", codecOptional(codecForString())).property("exchange_pub", codecOptional(codecForString())).build("MerchantRefundPermission");
var codecForMerchantClaimResponse = () => buildCodecForObject().property("contract_terms", codecForMerchantContractTerms()).property("sig", codecForString()).build("MerchantClaimResponse");
var codecForCheckPaymentResponse = () => buildCodecForObject().property("order_status", codecForString()).property("refunded", codecOptional(codecForBoolean())).property("refunded_amount", codecOptional(codecForString())).property("contract_terms", codecOptional(codecForAny())).property("taler_pay_uri", codecOptional(codecForString())).property("contract_url", codecOptional(codecForString())).build("CheckPaymentResponse");
var codecForMerchantPayResponse = () => buildCodecForObject().property("sig", codecForString()).property("pos_confirmation", codecOptional(codecForString())).property("token_sigs", codecOptional(codecForList(codecForSignedTokenEnvelope()))).build("MerchantPayResponse");
var codecForSignedTokenEnvelope = () => buildCodecForObject().property("blind_sig", codecForTokenIssueBlindSig()).build("SignedTokenEnvelope");
var codecForTokenIssueBlindSig = () => buildCodecForUnion().discriminateOn("cipher").alternative(DenomKeyType.Rsa, codecForRSATokenIssueBlindSig()).alternative(DenomKeyType.ClauseSchnorr, codecForCsTokenIssueBlindSig()).build("TokenIssueBlindSig");
var codecForRSATokenIssueBlindSig = () => buildCodecForObject().property("cipher", codecForConstString(DenomKeyType.Rsa)).property("blinded_rsa_signature", codecForString()).build("RSATokenIssueBlindSig");
var codecForCsTokenIssueBlindSig = () => buildCodecForObject().property("cipher", codecForConstString(DenomKeyType.ClauseSchnorr)).property("b", codecForNumber()).property("s", codecForString()).build("CSTokenIssueBlindSig");
var codecForMerchantOrderStatusPaid = () => buildCodecForObject().property("refund_amount", codecForAmountString()).property("refund_taken", codecForAmountString()).property("refund_pending", codecForBoolean()).property("refunded", codecForBoolean()).build("MerchantOrderStatusPaid");
var codecForMerchantOrderStatusUnpaid = () => buildCodecForObject().property("taler_pay_uri", codecForString()).property("already_paid_order_id", codecOptional(codecForString())).build("MerchantOrderStatusUnpaid");
var MerchantContractVersion;
(function(MerchantContractVersion3) {
  MerchantContractVersion3[MerchantContractVersion3["V0"] = 0] = "V0";
  MerchantContractVersion3[MerchantContractVersion3["V1"] = 1] = "V1";
})(MerchantContractVersion || (MerchantContractVersion = {}));
var MerchantContractInputType;
(function(MerchantContractInputType2) {
  MerchantContractInputType2["Token"] = "token";
})(MerchantContractInputType || (MerchantContractInputType = {}));
var MerchantContractOutputType;
(function(MerchantContractOutputType2) {
  MerchantContractOutputType2["Token"] = "token";
  MerchantContractOutputType2["TaxReceipt"] = "tax-receipt";
})(MerchantContractOutputType || (MerchantContractOutputType = {}));
var MerchantContractTokenKind;
(function(MerchantContractTokenKind2) {
  MerchantContractTokenKind2["Subscription"] = "subscription";
  MerchantContractTokenKind2["Discount"] = "discount";
})(MerchantContractTokenKind || (MerchantContractTokenKind = {}));
var codecForAuditorHandle = () => buildCodecForObject().property("name", codecForString()).property("auditor_pub", codecForEddsaPublicKey()).property("url", codecForString()).build("AuditorHandle");
var codecForLocation = () => buildCodecForObject().property("country", codecOptional(codecForString())).property("country_subdivision", codecOptional(codecForString())).property("building_name", codecOptional(codecForString())).property("building_number", codecOptional(codecForString())).property("district", codecOptional(codecForString())).property("street", codecOptional(codecForString())).property("post_code", codecOptional(codecForString())).property("town", codecOptional(codecForString())).property("town_location", codecOptional(codecForString())).property("address_lines", codecOptional(codecForList(codecForString()))).build("Location");
var codecForMerchantInfo = () => buildCodecForObject().property("name", codecForString()).property("address", codecOptional(codecForLocation())).property("jurisdiction", codecOptional(codecForLocation())).build("MerchantInfo");
var codecForMerchantContractTermsCommon = () => buildCodecForObject().property("order_id", codecForString()).property("fulfillment_url", codecOptional(codecForString())).property("fulfillment_message", codecOptional(codecForString())).property("fulfillment_message_i18n", codecOptional(codecForInternationalizedString())).property("public_reorder_url", codecOptional(codecForString())).property("merchant_base_url", codecForString()).property("h_wire", codecForString()).property("auto_refund", codecOptional(codecForDuration)).property("wire_method", codecForString()).property("summary", codecForString()).property("summary_i18n", codecOptional(codecForInternationalizedString())).property("nonce", codecForString()).property("pay_deadline", codecForTimestamp).property("refund_deadline", codecForTimestamp).property("wire_transfer_deadline", codecForTimestamp).property("timestamp", codecForTimestamp).property("delivery_location", codecOptional(codecForLocation())).property("delivery_date", codecOptional(codecForTimestamp)).property("merchant", codecForMerchantInfo()).property("merchant_pub", codecForString()).property("exchanges", codecForList(codecForExchange())).property("products", codecOptional(codecForList(codecForProduct()))).property("extra", codecForAny()).property("minimum_age", codecOptional(codecForNumber())).build("TalerMerchantApi.ContractTermsCommon");
var codecForMerchantContractTermsV0 = () => buildCodecForObject().property("version", codecOptional(codecForConstNumber(MerchantContractVersion.V0))).property("amount", codecForAmountString()).property("max_fee", codecForAmountString()).mixin(codecForMerchantContractTermsCommon()).build("TalerMerchantApi.ContractTermsV0");
var codecForMerchantContractTermsV1 = () => buildCodecForObject().property("version", codecForConstNumber(MerchantContractVersion.V1)).property("choices", codecForList(codecForMerchantContractChoice())).property("token_families", codecForMap(codecForMerchantContractTokenFamily())).mixin(codecForMerchantContractTermsCommon()).build("TalerMerchantApi.ContractTermsV1");
var codecForMerchantContractTerms = () => buildCodecForUnion().discriminateOn("version").alternative(void 0, codecForMerchantContractTermsV0()).alternative(MerchantContractVersion.V0, codecForMerchantContractTermsV0()).alternative(MerchantContractVersion.V1, codecForMerchantContractTermsV1()).build("TalerMerchantApi.ContractTerms");
var codecForMerchantContractChoice = () => buildCodecForObject().property("amount", codecForAmountString()).property("description", codecOptional(codecForString())).property("description_i18n", codecOptional(codecForInternationalizedString())).property("inputs", codecForList(codecForMerchantContractInput())).property("outputs", codecForList(codecForMerchantContractOutput())).property("max_fee", codecForAmountString()).build("TalerMerchantApi.ContractChoice");
var codecForMerchantContractInput = () => buildCodecForUnion().discriminateOn("type").alternative(MerchantContractInputType.Token, codecForMerchantContractInputToken()).build("TalerMerchantApi.ContractInput");
var codecForMerchantContractInputToken = () => buildCodecForObject().property("type", codecForConstString(MerchantContractInputType.Token)).property("token_family_slug", codecForString()).property("count", codecOptional(codecForNumber())).build("TalerMerchantApi.ContractInputToken");
var codecForMerchantContractOutput = () => buildCodecForUnion().discriminateOn("type").alternative(MerchantContractOutputType.Token, codecForMerchantContractOutputToken()).alternative(MerchantContractOutputType.TaxReceipt, codecForMerchantContractOutputTaxReceipt()).build("TalerMerchantApi.ContractOutput");
var codecForMerchantContractOutputToken = () => buildCodecForObject().property("type", codecForConstString(MerchantContractOutputType.Token)).property("token_family_slug", codecForString()).property("count", codecOptional(codecForNumber())).property("key_index", codecForNumber()).build("TalerMerchantApi.ContractOutputToken");
var codecForMerchantContractOutputTaxReceipt = () => buildCodecForObject().property("type", codecForConstString(MerchantContractOutputType.TaxReceipt)).property("donau_urls", codecForList(codecForString())).property("amount", codecOptional(codecForAmountString())).build("TalerMerchantApi.ContractOutputTaxReceipt");
var codecForMerchantContractTokenFamily = () => buildCodecForObject().property("name", codecForString()).property("description", codecForString()).property("description_i18n", codecOptional(codecForInternationalizedString())).property("keys", codecForList(codecForTokenIssuePublicKey())).property("details", codecForMerchantContractTokenDetails()).property("critical", codecForBoolean()).build("TalerMerchantApi.ContractTokenFamily");
var codecForTokenIssuePublicKey = () => buildCodecForUnion().discriminateOn("cipher").alternative("RSA", codecForTokenIssueRsaPublicKey()).alternative("CS", codecForTokenIssueCsPublicKey()).build("TalerMerchantApi.TokenIssuePublicKey");
var codecForTokenIssueRsaPublicKey = () => buildCodecForObject().property("cipher", codecForConstString("RSA")).property("rsa_pub", codecForString()).property("signature_validity_start", codecForTimestamp).property("signature_validity_end", codecForTimestamp).build("TalerMerchantApi.TokenIssueRsaPublicKey");
var codecForTokenIssueCsPublicKey = () => buildCodecForObject().property("cipher", codecForConstString("CS")).property("cs_pub", codecForString()).property("signature_validity_start", codecForTimestamp).property("signature_validity_end", codecForTimestamp).build("TalerMerchantApi.TokenIssueRsaPublicKey");
var codecForMerchantContractTokenDetails = () => buildCodecForUnion().discriminateOn("class").alternative(MerchantContractTokenKind.Subscription, codecForMerchantContractSubscriptionTokenDetails()).alternative(MerchantContractTokenKind.Discount, codecForMerchantContractDiscountTokenDetails()).build("TalerMerchantApi.ContractTokenDetails");
var codecForMerchantContractSubscriptionTokenDetails = () => buildCodecForObject().property("class", codecForConstString(MerchantContractTokenKind.Subscription)).property("trusted_domains", codecForList(codecForString())).build("TalerMerchantApi.ContractSubscriptionTokenDetails");
var codecForMerchantContractDiscountTokenDetails = () => buildCodecForObject().property("class", codecForConstString(MerchantContractTokenKind.Discount)).property("expected_domains", codecForList(codecForString())).build("TalerMerchantApi.ContractDiscountTokenDetails");
var RoundingInterval;
(function(RoundingInterval2) {
  RoundingInterval2["NONE"] = "NONE";
  RoundingInterval2["SECOND"] = "SECOND";
  RoundingInterval2["MINUTE"] = "MINUTE";
  RoundingInterval2["HOUR"] = "HOUR";
  RoundingInterval2["DAY"] = "DAY";
  RoundingInterval2["WEEK"] = "WEEK";
  RoundingInterval2["MONTH"] = "MONTH";
  RoundingInterval2["QUARTER"] = "QUARTER";
  RoundingInterval2["YEAR"] = "YEAR";
})(RoundingInterval || (RoundingInterval = {}));
var KycStatusLongPollingReason;
(function(KycStatusLongPollingReason2) {
  KycStatusLongPollingReason2[KycStatusLongPollingReason2["AUTH_TRANSFER"] = 1] = "AUTH_TRANSFER";
  KycStatusLongPollingReason2[KycStatusLongPollingReason2["AML_INVESTIGATION"] = 2] = "AML_INVESTIGATION";
  KycStatusLongPollingReason2[KycStatusLongPollingReason2["TO_BE_OK"] = 3] = "TO_BE_OK";
})(KycStatusLongPollingReason || (KycStatusLongPollingReason = {}));
var LoginTokenScope;
(function(LoginTokenScope2) {
  LoginTokenScope2["ReadOnly"] = "readonly";
  LoginTokenScope2["All"] = "all";
  LoginTokenScope2["Spa"] = "spa";
  LoginTokenScope2["OrderSimple"] = "order-simple";
  LoginTokenScope2["OrderPos"] = "order-pos";
  LoginTokenScope2["OrderManagement"] = "order-mgmt";
  LoginTokenScope2["OrderFull"] = "order-full";
  LoginTokenScope2["ReadOnly_Refreshable"] = "readonly:refreshable";
  LoginTokenScope2["All_Refreshable"] = "all:refreshable";
  LoginTokenScope2["Spa_Refreshable"] = "spa:refreshable";
  LoginTokenScope2["OrderSimple_Refreshable"] = "order-simple:refreshable";
  LoginTokenScope2["OrderPos_Refreshable"] = "order-pos:refreshable";
  LoginTokenScope2["OrderManagement_Refreshable"] = "order-mgmt:refreshable";
  LoginTokenScope2["OrderFull_Refreshable"] = "order-full:refreshable";
})(LoginTokenScope || (LoginTokenScope = {}));
var MerchantAuthMethod;
(function(MerchantAuthMethod2) {
  MerchantAuthMethod2["TOKEN"] = "token";
})(MerchantAuthMethod || (MerchantAuthMethod = {}));
var MerchantAccountKycStatus;
(function(MerchantAccountKycStatus2) {
  MerchantAccountKycStatus2["NO_EXCHANGE_KEY"] = "no-exchange-keys";
  MerchantAccountKycStatus2["KYC_WIRE_IMPOSSIBLE"] = "kyc-wire-impossible";
  MerchantAccountKycStatus2["KYC_WIRE_REQUIRED"] = "kyc-wire-required";
  MerchantAccountKycStatus2["KYC_REQUIRED"] = "kyc-required";
  MerchantAccountKycStatus2["AWAITING_AML_REVIEW"] = "awaiting-aml-review";
  MerchantAccountKycStatus2["READY"] = "ready";
  MerchantAccountKycStatus2["LOGIC_BUG"] = "logic-bug";
  MerchantAccountKycStatus2["EXCHANGE_INTERNAL_ERROR"] = "exchange-internal-error";
  MerchantAccountKycStatus2["EXCHANGE_GATEWAY_TIMEOUT"] = "exchange-gateway-timeout";
  MerchantAccountKycStatus2["EXCHANGE_UNREACHABLE"] = "exchange-unreachable";
  MerchantAccountKycStatus2["EXCHANGE_STATUS_INVALID"] = "exchange-status-invalid";
})(MerchantAccountKycStatus || (MerchantAccountKycStatus = {}));
var MerchantAccountKycStatusSimplified;
(function(MerchantAccountKycStatusSimplified2) {
  MerchantAccountKycStatusSimplified2[MerchantAccountKycStatusSimplified2["OK"] = 0] = "OK";
  MerchantAccountKycStatusSimplified2[MerchantAccountKycStatusSimplified2["ACTION_REQUIRED"] = 100] = "ACTION_REQUIRED";
  MerchantAccountKycStatusSimplified2[MerchantAccountKycStatusSimplified2["WARNING"] = 200] = "WARNING";
  MerchantAccountKycStatusSimplified2[MerchantAccountKycStatusSimplified2["ERROR"] = 300] = "ERROR";
})(MerchantAccountKycStatusSimplified || (MerchantAccountKycStatusSimplified = {}));
function getMerchantAccountKycStatusSimplified(st) {
  switch (st) {
    case MerchantAccountKycStatus.AWAITING_AML_REVIEW:
    case MerchantAccountKycStatus.READY:
      return MerchantAccountKycStatusSimplified.OK;
    case MerchantAccountKycStatus.KYC_WIRE_REQUIRED:
    case MerchantAccountKycStatus.KYC_REQUIRED:
      return MerchantAccountKycStatusSimplified.ACTION_REQUIRED;
    case MerchantAccountKycStatus.NO_EXCHANGE_KEY:
    case MerchantAccountKycStatus.EXCHANGE_INTERNAL_ERROR:
    case MerchantAccountKycStatus.EXCHANGE_GATEWAY_TIMEOUT:
    case MerchantAccountKycStatus.EXCHANGE_UNREACHABLE:
      return MerchantAccountKycStatusSimplified.WARNING;
    case MerchantAccountKycStatus.KYC_WIRE_IMPOSSIBLE:
    case MerchantAccountKycStatus.LOGIC_BUG:
    case MerchantAccountKycStatus.EXCHANGE_STATUS_INVALID:
      return MerchantAccountKycStatusSimplified.ERROR;
    default:
      assertUnreachable(st);
  }
}
var TokenFamilyKind;
(function(TokenFamilyKind2) {
  TokenFamilyKind2["Discount"] = "discount";
  TokenFamilyKind2["Subscription"] = "subscription";
})(TokenFamilyKind || (TokenFamilyKind = {}));
var StatisticBucketRange;
(function(StatisticBucketRange2) {
  StatisticBucketRange2["Hour"] = "hour";
  StatisticBucketRange2["Day"] = "day";
  StatisticBucketRange2["Week"] = "week";
  StatisticBucketRange2["Month"] = "month";
  StatisticBucketRange2["Quarter"] = "quarter";
  StatisticBucketRange2["Year"] = "year";
})(StatisticBucketRange || (StatisticBucketRange = {}));
var OrderInputType;
(function(OrderInputType2) {
  OrderInputType2["Token"] = "token";
})(OrderInputType || (OrderInputType = {}));
var OrderOutputType;
(function(OrderOutputType2) {
  OrderOutputType2["Token"] = "token";
  OrderOutputType2["TaxReceipt"] = "tax-receipt";
})(OrderOutputType || (OrderOutputType = {}));
var OrderVersion;
(function(OrderVersion2) {
  OrderVersion2[OrderVersion2["V0"] = 0] = "V0";
  OrderVersion2[OrderVersion2["V1"] = 1] = "V1";
})(OrderVersion || (OrderVersion = {}));
var codecForExchangeConfigInfo = () => buildCodecForObject().property("base_url", codecForString()).property("currency", codecForString()).property("master_pub", codecForEddsaPublicKey()).build("TalerMerchantApi.ExchangeConfigInfo");
var codecForTalerMerchantConfigResponse = () => buildCodecForObject().property("name", codecForConstString("taler-merchant")).property("currency", codecForString()).property("default_persona", codecOptionalDefault(codecForEither(codecForConstString("expert"), codecForConstString("offline-vending-machine"), codecForConstString("point-of-sale"), codecForConstString("digital-publishing"), codecForConstString("e-commerce")), "expert")).property("version", codecForString()).property("currencies", codecForMap(codecForCurrencySpecificiation())).property("exchanges", codecForList(codecForExchangeConfigInfo())).property("implementation", codecOptional(codecForString())).property("have_self_provisioning", codecOptionalDefault(codecForBoolean(), false)).property("have_donau", codecOptionalDefault(codecForBoolean(), false)).property("mandatory_tan_channels", codecOptionalDefault(codecForList(codecForEither(codecForConstString(TanChannel.SMS), codecForConstString(TanChannel.EMAIL))), [])).property("default_pay_delay", codecOptional(codecForDuration)).property("default_refund_delay", codecOptional(codecForDuration)).property("default_wire_transfer_delay", codecOptional(codecForDuration)).property("payment_target_regex", codecOptionalDefault(codecForString(), "*")).property("payment_target_types", codecOptionalDefault(codecForString(), "*")).property("default_wire_transfer_rounding_interval", codecOptional(codecForRoundingInterval)).build("TalerMerchantApi.VersionResponse");
var codecForRoundingInterval = codecForEither(codecForConstString(RoundingInterval.NONE), codecForConstString(RoundingInterval.SECOND), codecForConstString(RoundingInterval.MINUTE), codecForConstString(RoundingInterval.HOUR), codecForConstString(RoundingInterval.DAY), codecForConstString(RoundingInterval.WEEK), codecForConstString(RoundingInterval.MONTH), codecForConstString(RoundingInterval.QUARTER), codecForConstString(RoundingInterval.YEAR));
var codecForClaimResponse = () => buildCodecForObject().property("contract_terms", codecForAny()).property("sig", codecForEddsaSignature()).build("TalerMerchantApi.ClaimResponse");
var codecForPaymentResponse = () => buildCodecForObject().property("pos_confirmation", codecOptional(codecForString())).property("sig", codecForEddsaSignature()).build("TalerMerchantApi.PaymentResponse");
var codecForPaymentDeniedLegallyResponse = () => buildCodecForObject().property("exchange_base_urls", codecOptionalDefault(codecForList(codecForString()), [])).build("TalerMerchantApi.PaymentDeniedLegallyResponse");
var codecForStatusPaid = () => buildCodecForObject().property("refund_amount", codecForAmountString()).property("refund_pending", codecForBoolean()).property("refund_taken", codecForAmountString()).property("refunded", codecForBoolean()).property("type", codecForConstString("paid")).build("TalerMerchantApi.StatusPaid");
var codecForStatusGoto = () => buildCodecForObject().property("public_reorder_url", codecForURLString()).property("type", codecForConstString("goto")).build("TalerMerchantApi.StatusGotoResponse");
var codecForStatusStatusUnpaid = () => buildCodecForObject().property("type", codecForConstString("unpaid")).property("already_paid_order_id", codecOptional(codecForString())).property("fulfillment_url", codecOptional(codecForString())).property("taler_pay_uri", codecForTalerUriString()).build("TalerMerchantApi.PaymentResponse");
var codecForPaidRefundStatusResponse = () => buildCodecForObject().property("pos_confirmation", codecOptional(codecForString())).property("refunded", codecForBoolean()).build("TalerMerchantApi.PaidRefundStatusResponse");
var codecForMerchantAbortPayRefundSuccessStatus = () => buildCodecForObject().property("exchange_pub", codecForString()).property("exchange_sig", codecForString()).property("exchange_status", codecForConstNumber(200)).property("type", codecForConstString("success")).build("TalerMerchantApi.MerchantAbortPayRefundSuccessStatus");
var codecForMerchantAbortPayRefundFailureStatus = () => buildCodecForObject().property("exchange_code", codecForNumber()).property("exchange_reply", codecForAny()).property("exchange_status", codecForNumber()).property("type", codecForConstString("failure")).build("TalerMerchantApi.MerchantAbortPayRefundFailureStatus");
var codecForMerchantAbortPayRefundUndepositedStatus = () => buildCodecForObject().property("type", codecForConstString("undeposited")).build("TalerMerchantApi.MerchantAbortPayRefundUndepositedStatus");
var codecForMerchantAbortPayRefundStatus = () => buildCodecForUnion().discriminateOn("type").alternative("success", codecForMerchantAbortPayRefundSuccessStatus()).alternative("failure", codecForMerchantAbortPayRefundFailureStatus()).alternative("undeposited", codecForMerchantAbortPayRefundUndepositedStatus()).build("TalerMerchantApi.MerchantAbortPayRefundStatus");
var codecForAbortResponse = () => buildCodecForObject().property("refunds", codecForList(codecForMerchantAbortPayRefundStatus())).build("TalerMerchantApi.AbortResponse");
var codecForWalletRefundResponse = () => buildCodecForObject().property("merchant_pub", codecForEddsaPublicKey()).property("refund_amount", codecForAmountString()).property("refunds", codecForList(codecForMerchantCoinRefundStatus())).build("TalerMerchantApi.AbortResponse");
var codecForMerchantCoinRefundSuccessStatus = () => buildCodecForObject().property("type", codecForConstString("success")).property("coin_pub", codecForEddsaPublicKey()).property("exchange_status", codecForConstNumber(200)).property("exchange_sig", codecForEddsaSignature()).property("rtransaction_id", codecForNumber()).property("refund_amount", codecForAmountString()).property("exchange_pub", codecForEddsaPublicKey()).property("execution_time", codecForTimestamp).build("TalerMerchantApi.MerchantCoinRefundSuccessStatus");
var codecForMerchantCoinRefundFailureStatus = () => buildCodecForObject().property("type", codecForConstString("failure")).property("coin_pub", codecForEddsaPublicKey()).property("exchange_status", codecForNumber()).property("rtransaction_id", codecForNumber()).property("refund_amount", codecForAmountString()).property("exchange_code", codecOptional(codecForNumber())).property("exchange_reply", codecOptional(codecForAny())).property("execution_time", codecForTimestamp).build("TalerMerchantApi.MerchantCoinRefundFailureStatus");
var codecForMerchantCoinRefundStatus = () => buildCodecForUnion().discriminateOn("type").alternative("success", codecForMerchantCoinRefundSuccessStatus()).alternative("failure", codecForMerchantCoinRefundFailureStatus()).build("TalerMerchantApi.MerchantCoinRefundStatus");
var codecForMerchantAuthMethod = codecForEither(codecForConstString(MerchantAuthMethod.TOKEN));
var codecForQueryInstancesResponse = () => buildCodecForObject().property("name", codecForString()).property("email", codecOptional(codecForString())).property("phone_number", codecOptional(codecForString())).property("website", codecOptional(codecForString())).property("email_validated", codecOptional(codecForBoolean())).property("phone_validated", codecOptional(codecForBoolean())).property("logo", codecOptional(codecForString())).property("merchant_pub", codecForEddsaPublicKey()).property("address", codecForLocation()).property("jurisdiction", codecForLocation()).property("use_stefan", codecForBoolean()).property("default_wire_transfer_delay", codecForDuration).property("default_pay_delay", codecForDuration).property("default_refund_delay", codecForDuration).property("default_wire_transfer_rounding_interval", codecOptional(codecForRoundingInterval)).property("auth", buildCodecForObject().property("method", codecForMerchantAuthMethod).build("TalerMerchantApi.QueryInstancesResponse.auth")).build("TalerMerchantApi.QueryInstancesResponse");
var codecForAccountKycRedirects = () => buildCodecForObject().property("kyc_data", codecForList(codecForMerchantAccountKycRedirect())).build("TalerMerchantApi.MerchantAccountKycRedirectsResponse");
var codecForMerchantAccountKycStatus = codecForEither(codecForConstString(MerchantAccountKycStatus.AWAITING_AML_REVIEW), codecForConstString(MerchantAccountKycStatus.EXCHANGE_GATEWAY_TIMEOUT), codecForConstString(MerchantAccountKycStatus.EXCHANGE_INTERNAL_ERROR), codecForConstString(MerchantAccountKycStatus.EXCHANGE_STATUS_INVALID), codecForConstString(MerchantAccountKycStatus.EXCHANGE_UNREACHABLE), codecForConstString(MerchantAccountKycStatus.KYC_REQUIRED), codecForConstString(MerchantAccountKycStatus.KYC_WIRE_IMPOSSIBLE), codecForConstString(MerchantAccountKycStatus.KYC_WIRE_REQUIRED), codecForConstString(MerchantAccountKycStatus.LOGIC_BUG), codecForConstString(MerchantAccountKycStatus.NO_EXCHANGE_KEY), codecForConstString(MerchantAccountKycStatus.READY));
var codecForMerchantAccountKycRedirect = () => buildCodecForObject().property("status", codecForMerchantAccountKycStatus).property("h_wire", codecForString()).property("payto_uri", codecForPaytoString()).property("exchange_url", codecForURLString()).property("exchange_http_status", codecForNumber()).property("no_keys", codecForBoolean()).property("auth_conflict", codecForBoolean()).property("exchange_code", codecOptional(codecForNumber())).property("access_token", codecOptional(codecForAccessToken())).property("limits", codecOptional(codecForList(codecForAccountLimit()))).property("payto_kycauths", codecOptional(codecForList(codecForString()))).build("TalerMerchantApi.MerchantAccountKycRedirect");
var codecForTokenScope = codecForEither(codecForConstString(LoginTokenScope.All), codecForConstString(LoginTokenScope.Spa), codecForConstString(LoginTokenScope.OrderFull), codecForConstString(LoginTokenScope.OrderManagement), codecForConstString(LoginTokenScope.OrderPos), codecForConstString(LoginTokenScope.OrderSimple), codecForConstString(LoginTokenScope.ReadOnly), codecForConstString(LoginTokenScope.All_Refreshable), codecForConstString(LoginTokenScope.Spa_Refreshable), codecForConstString(LoginTokenScope.OrderFull_Refreshable), codecForConstString(LoginTokenScope.OrderManagement_Refreshable), codecForConstString(LoginTokenScope.OrderPos_Refreshable), codecForConstString(LoginTokenScope.OrderSimple_Refreshable), codecForConstString(LoginTokenScope.ReadOnly_Refreshable));
var codecForLoginTokenSuccessResponse = () => buildCodecForObject().property("scope", codecForTokenScope).property("access_token", codecForAccessToken()).property("expiration", codecForTimestamp).property("refreshable", codecForBoolean()).build("TalerMerchantApi.LoginTokenSuccessResponse");
var codecForExchangeKycTimeout = () => buildCodecForObject().property("exchange_url", codecForURLString()).property("exchange_code", codecForNumber()).property("exchange_http_status", codecForNumber()).build("TalerMerchantApi.ExchangeKycTimeout");
var codecForAccountAddResponse = () => buildCodecForObject().property("h_wire", codecForString()).property("salt", codecForString()).build("TalerMerchantApi.AccountAddResponse");
var codecForAccountsSummaryResponse = () => buildCodecForObject().property("accounts", codecForList(codecForBankAccountEntry())).build("TalerMerchantApi.AccountsSummaryResponse");
var codecForBankAccountEntry = () => buildCodecForObject().property("payto_uri", codecForPaytoString()).property("h_wire", codecForString()).property("active", codecOptional(codecForBoolean())).build("TalerMerchantApi.BankAccountEntry");
var codecForBankAccountDetail = () => buildCodecForObject().property("payto_uri", codecForPaytoString()).property("h_wire", codecForString()).property("salt", codecForString()).property("credit_facade_url", codecOptional(codecForURLString())).property("active", codecOptional(codecForBoolean())).build("TalerMerchantApi.BankAccountEntry");
var codecForCategoryListResponse = () => buildCodecForObject().property("categories", codecForList(codecForCategoryListEntry())).build("TalerMerchantApi.CategoryListResponse");
var codecForCategoryListEntry = () => buildCodecForObject().property("category_id", codecForNumber()).property("name", codecForString()).property("name_i18n", codecForInternationalizedString()).property("product_count", codecForNumber()).build("TalerMerchantApi.CategoryListEntry");
var codecForCategoryProductList = () => buildCodecForObject().property("name", codecForString()).property("name_i18n", codecForInternationalizedString()).property("products", codecForList(codecForProductSummary())).build("TalerMerchantApi.CategoryProductList");
var codecForProductSummary = () => buildCodecForObject().property("product_id", codecForString()).build("TalerMerchantApi.ProductSummary");
var codecForInventorySummaryResponse = () => buildCodecForObject().property("products", codecForList(codecForInventoryEntry())).build("TalerMerchantApi.InventorySummaryResponse");
var codecForInventoryEntry = () => buildCodecForObject().property("product_id", codecForString()).property("product_serial", codecForNumber()).build("TalerMerchantApi.InventoryEntry");
var codecForMerchantPosProductDetail = () => buildCodecForObject().property("product_serial", codecForNumber()).property("product_id", codecOptional(codecForString())).property("product_name", codecOptional(codecForString())).property("categories", codecForList(codecForNumber())).property("description", codecForString()).property("description_i18n", codecForInternationalizedString()).property("unit", codecForString()).property("price", codecForAmountString()).property("image", codecForString()).property("taxes", codecOptional(codecForList(codecForTax()))).property("total_stock", codecForNumber()).property("minimum_age", codecOptional(codecForNumber())).build("TalerMerchantApi.MerchantPosProductDetail");
var codecForMerchantCategory = () => buildCodecForObject().property("id", codecForNumber()).property("name", codecForString()).property("name_i18n", codecForInternationalizedString()).build("TalerMerchantApi.MerchantCategory");
var codecForFullInventoryDetailsResponse = () => buildCodecForObject().property("categories", codecForList(codecForMerchantCategory())).property("products", codecForList(codecForMerchantPosProductDetail())).build("TalerMerchantApi.FullInventoryDetailsResponse");
var codecForProductDetail = () => buildCodecForObject().property("description", codecForString()).property("description_i18n", codecForInternationalizedString()).property("unit", codecForString()).property("product_name", codecOptional(codecForString())).property("price", codecForAmountString()).property("image", codecForString()).property("categories", codecForList(codecForNumber())).property("taxes", codecOptional(codecForList(codecForTax()))).property("address", codecOptional(codecForLocation())).property("next_restock", codecOptional(codecForTimestamp)).property("total_stock", codecForNumber()).property("total_sold", codecForNumber()).property("total_lost", codecForNumber()).property("minimum_age", codecOptional(codecForNumber())).build("TalerMerchantApi.ProductDetail");
var codecForTax = () => buildCodecForObject().property("name", codecForString()).property("tax", codecForAmountString()).build("TalerMerchantApi.Tax");
var codecForPostOrderResponse = () => buildCodecForObject().property("order_id", codecForString()).property("pay_deadline", codecOptional(codecForTimestamp)).property("token", codecOptional(codecForString())).build("TalerMerchantApi.PostOrderResponse");
var codecForOutOfStockResponse = () => buildCodecForObject().property("product_id", codecForString()).property("available_quantity", codecForNumber()).property("requested_quantity", codecForNumber()).property("restock_expected", codecForTimestamp).build("TalerMerchantApi.OutOfStockResponse");
var codecForOrderHistory = () => buildCodecForObject().property("orders", codecForList(codecForOrderHistoryEntry())).build("TalerMerchantApi.OrderHistory");
var codecForOrderHistoryEntry = () => buildCodecForObject().property("order_id", codecForString()).property("row_id", codecForNumber()).property("timestamp", codecForTimestamp).property("amount", codecForAmountString()).property("refund_amount", codecOptional(codecForAmountString())).property("pending_refund_amount", codecOptional(codecForAmountString())).property("summary", codecForString()).property("refundable", codecForBoolean()).property("paid", codecForBoolean()).build("TalerMerchantApi.OrderHistoryEntry");
var codecForMerchant = () => buildCodecForObject().property("name", codecForString()).property("email", codecOptional(codecForString())).property("logo", codecOptional(codecForString())).property("website", codecOptional(codecForString())).property("address", codecOptional(codecForLocation())).property("jurisdiction", codecOptional(codecForLocation())).build("TalerMerchantApi.MerchantInfo");
var codecForExchange = () => buildCodecForObject().property("master_pub", codecForEddsaPublicKey()).property("priority", codecForNumber()).property("url", codecForString()).property("max_contribution", codecOptional(codecForAmountString())).build("TalerMerchantApi.Exchange");
var codecForOrderCommon = () => buildCodecForObject().property("order_id", codecOptional(codecForString())).property("public_reorder_url", codecOptional(codecForString())).property("fulfillment_url", codecOptional(codecForString())).property("fulfillment_message", codecOptional(codecForString())).property("fulfillment_message_i18n", codecOptional(codecForInternationalizedString())).property("merchant_base_url", codecOptional(codecForString())).property("auto_refund", codecOptional(codecForDuration)).property("summary", codecForString()).property("summary_i18n", codecOptional(codecForInternationalizedString())).property("pay_deadline", codecOptional(codecForTimestamp)).property("refund_deadline", codecOptional(codecForTimestamp)).property("wire_transfer_deadline", codecOptional(codecForTimestamp)).property("timestamp", codecOptional(codecForTimestamp)).property("delivery_location", codecOptional(codecForLocation())).property("delivery_date", codecOptional(codecForTimestamp)).property("products", codecOptional(codecForList(codecForProduct()))).property("extra", codecOptional(codecForAny())).build("TalerMerchantApi.Order");
var codecForOrderV0 = () => buildCodecForObject().property("version", codecOptional(codecForConstNumber(OrderVersion.V0))).property("amount", codecForAmountString()).property("max_fee", codecOptional(codecForAmountString())).mixin(codecForOrderCommon()).build("TalerMerchantApi.OrderV0");
var codecForOrderV1 = () => buildCodecForObject().property("version", codecForConstNumber(OrderVersion.V1)).property("choices", codecForList(codecForOrderChoice())).mixin(codecForOrderCommon()).build("TalerMerchantApi.OrderV1");
var codecForOrder = () => buildCodecForUnion().discriminateOn("version").alternative(void 0, codecForOrderV0()).alternative(OrderVersion.V0, codecForOrderV0()).alternative(OrderVersion.V1, codecForOrderV1()).build("TalerMerchantApi.Order");
var codecForOrderChoice = () => buildCodecForObject().property("amount", codecForAmountString()).property("description", codecOptional(codecForString())).property("description_i18n", codecOptional(codecForInternationalizedString())).property("max_fee", codecOptional(codecForAmountString())).property("inputs", codecOptional(codecForList(codecForOrderInput()))).property("outputs", codecOptional(codecForList(codecForOrderOutput()))).build("TalerMerchantApi.OrderChoice");
var codecForOrderInput = () => buildCodecForUnion().discriminateOn("type").alternative(OrderInputType.Token, codecForOrderInputToken()).build("TalerMerchantApi.OrderInput");
var codecForOrderInputToken = () => buildCodecForObject().property("type", codecForConstString(OrderInputType.Token)).property("token_family_slug", codecForString()).property("count", codecOptional(codecForNumber())).build("TalerMerchantApi.OrderInputToken");
var codecForOrderOutput = () => buildCodecForUnion().discriminateOn("type").alternative(OrderOutputType.Token, codecForOrderOutputToken()).alternative(OrderOutputType.TaxReceipt, codecForOrderOutputTaxReceipt()).build("TalerMerchantApi.OrderOutput");
var codecForOrderOutputToken = () => buildCodecForObject().property("type", codecForConstString(OrderOutputType.Token)).property("token_family_slug", codecForString()).property("count", codecOptional(codecForNumber())).property("valid_at", codecOptional(codecForPreciseTimestamp)).build("TalerMerchantApi.OrderOutputToken");
var codecForOrderOutputTaxReceipt = () => buildCodecForObject().property("type", codecForConstString(OrderOutputType.TaxReceipt)).property("amount", codecOptional(codecForAmountString())).property("donau_urls", codecForList(codecForStringURL())).build("TalerMerchantApi.OrderOutputTaxReceipt");
var codecForProduct = () => buildCodecForObject().property("product_id", codecOptional(codecForString())).property("product_name", codecOptional(codecForString())).property("description", codecForString()).property("description_i18n", codecOptional(codecForInternationalizedString())).property("quantity", codecOptional(codecForNumber())).property("unit", codecOptional(codecForString())).property("price", codecOptional(codecForAmountString())).property("image", codecOptional(codecForString())).property("taxes", codecOptional(codecForList(codecForTax()))).property("delivery_date", codecOptional(codecForTimestamp)).build("TalerMerchantApi.Product");
var codecForCheckPaymentPaidResponse = () => buildCodecForObject().property("order_status", codecForConstString("paid")).property("refunded", codecForBoolean()).property("refund_pending", codecForBoolean()).property("wired", codecForBoolean()).property("deposit_total", codecForAmountString()).property("exchange_code", codecForNumber()).property("exchange_http_status", codecForNumber()).property("refund_amount", codecForAmountString()).property("contract_terms", codecForMerchantContractTerms()).property("choice_index", codecOptional(codecForNumber())).property("last_payment", codecForTimestamp).property("wire_reports", codecForList(codecForTransactionWireReport())).property("wire_details", codecForList(codecForTransactionWireTransfer())).property("refund_details", codecForList(codecForRefundDetails())).property("order_status_url", codecForURLString()).build("TalerMerchantApi.CheckPaymentPaidResponse");
var codecForCheckPaymentUnpaidResponse = () => buildCodecForObject().property("order_status", codecForConstString("unpaid")).property("taler_pay_uri", codecForTalerUriString()).property("creation_time", codecForTimestamp).property("pay_deadline", codecOptional(codecForTimestamp)).property("summary", codecForString()).property("total_amount", codecOptional(codecForAmountString())).property("already_paid_order_id", codecOptional(codecForString())).property("already_paid_fulfillment_url", codecOptional(codecForString())).property("order_status_url", codecForString()).build("TalerMerchantApi.CheckPaymentUnpaidResponse");
var codecForCheckPaymentClaimedResponse = () => buildCodecForObject().property("order_status", codecForConstString("claimed")).property("contract_terms", codecForMerchantContractTerms()).property("order_status_url", codecForString()).build("TalerMerchantApi.CheckPaymentClaimedResponse");
var codecForMerchantOrderPrivateStatusResponse = () => buildCodecForUnion().discriminateOn("order_status").alternative("paid", codecForCheckPaymentPaidResponse()).alternative("unpaid", codecForCheckPaymentUnpaidResponse()).alternative("claimed", codecForCheckPaymentClaimedResponse()).build("TalerMerchantApi.MerchantOrderStatusResponse");
var codecForRefundDetails = () => buildCodecForObject().property("reason", codecForString()).property("pending", codecForBoolean()).property("timestamp", codecForTimestamp).property("amount", codecForAmountString()).build("TalerMerchantApi.RefundDetails");
var codecForTransactionWireTransfer = () => buildCodecForObject().property("exchange_url", codecForURLString()).property("wtid", codecForString()).property("execution_time", codecForTimestamp).property("amount", codecForAmountString()).property("confirmed", codecForBoolean()).build("TalerMerchantApi.TransactionWireTransfer");
var codecForTransactionWireReport = () => buildCodecForObject().property("code", codecForNumber()).property("hint", codecForString()).property("exchange_code", codecForNumber()).property("exchange_http_status", codecForNumber()).property("coin_pub", codecForEddsaPublicKey()).build("TalerMerchantApi.TransactionWireReport");
var codecForMerchantRefundResponse = () => buildCodecForObject().property("taler_refund_uri", codecForTalerUriString()).property("h_contract", codecForString()).build("TalerMerchantApi.MerchantRefundResponse");
var codecForTansferList = () => buildCodecForObject().property("transfers", codecForList(codecForTransferDetails())).build("TalerMerchantApi.TransferList");
var codecForIncomingTansferList = () => buildCodecForObject().property("incoming", codecForList(codecForIncomingTransferDetails())).build("TalerMerchantApi.IncomingTransferList");
var codecForTransferDetails = () => buildCodecForObject().property("credit_amount", codecForAmountString()).property("wtid", codecForString()).property("payto_uri", codecForPaytoString()).property("exchange_url", codecForURLString()).property("transfer_serial_id", codecForNumber()).property("execution_time", codecOptional(codecForTimestamp)).property("verified", codecOptional(codecForBoolean())).property("confirmed", codecOptional(codecForBoolean())).build("TalerMerchantApi.TransferDetails");
var codecForIncomingTransferDetails = () => buildCodecForObject().property("expected_credit_amount", codecOptional(codecForAmountString())).property("expected_transfer_serial_id", codecOptional(codecForNumber())).property("execution_time", codecOptional(codecForTimestamp)).property("wtid", codecForString()).property("payto_uri", codecForPaytoString()).property("exchange_url", codecForURLString()).property("validated", codecForBoolean()).property("confirmed", codecForBoolean()).property("last_http_status", codecForNumber()).property("last_ec", codecForNumber()).property("last_error_detail", codecOptional(codecForAny())).build("TalerMerchantApi.IncomingTransferDetails");
var codecForOtpDeviceSummaryResponse = () => buildCodecForObject().property("otp_devices", codecForList(codecForOtpDeviceEntry())).build("TalerMerchantApi.OtpDeviceSummaryResponse");
var codecForOtpDeviceEntry = () => buildCodecForObject().property("otp_device_id", codecForString()).property("device_description", codecForString()).build("TalerMerchantApi.OtpDeviceEntry");
var codecForOtpDeviceDetails = () => buildCodecForObject().property("device_description", codecForString()).property("otp_algorithm", codecForNumber()).property("otp_ctr", codecOptional(codecForNumber())).property("otp_timestamp", codecForNumber()).property("otp_code", codecOptional(codecForString())).build("TalerMerchantApi.OtpDeviceDetails");
var codecForTemplateSummaryResponse = () => buildCodecForObject().property("templates", codecForList(codecForTemplateEntry())).build("TalerMerchantApi.TemplateSummaryResponse");
var codecForTemplateEntry = () => buildCodecForObject().property("template_id", codecForString()).property("template_description", codecForString()).build("TalerMerchantApi.TemplateEntry");
var codecForTemplateDetails = () => buildCodecForObject().property("template_description", codecForString()).property("otp_id", codecOptional(codecForString())).property("template_contract", codecForTemplateContractDetails()).property("editable_defaults", codecOptional(codecForTemplateContractDetailsDefaults())).build("TalerMerchantApi.TemplateDetails");
var codecForTemplateContractDetails = () => buildCodecForObject().property("summary", codecOptional(codecForString())).property("currency", codecOptional(codecForString())).property("amount", codecOptional(codecForAmountString())).property("minimum_age", codecForNumber()).property("pay_duration", codecForDuration).build("TalerMerchantApi.TemplateContractDetails");
var codecForTemplateContractDetailsDefaults = () => buildCodecForObject().property("summary", codecOptional(codecForString())).property("currency", codecOptional(codecForString())).property("amount", codecOptional(codecForAmountString())).build("TalerMerchantApi.TemplateContractDetailsDefaults");
var codecForWalletTemplateDetails = () => buildCodecForObject().property("template_contract", codecForTemplateContractDetails()).property("editable_defaults", codecOptional(codecForTemplateContractDetailsDefaults())).build("TalerMerchantApi.WalletTemplateDetails");
var codecForWebhookSummaryResponse = () => buildCodecForObject().property("webhooks", codecForList(codecForWebhookEntry())).build("TalerMerchantApi.WebhookSummaryResponse");
var codecForWebhookEntry = () => buildCodecForObject().property("webhook_id", codecForString()).property("event_type", codecForString()).build("TalerMerchantApi.WebhookEntry");
var codecForWebhookDetails = () => buildCodecForObject().property("event_type", codecForString()).property("url", codecForString()).property("http_method", codecForString()).property("header_template", codecOptional(codecForString())).property("body_template", codecOptional(codecForString())).build("TalerMerchantApi.WebhookDetails");
var codecForTokenFamilyKind = codecForEither(codecForConstString(TokenFamilyKind.Discount), codecForConstString(TokenFamilyKind.Subscription));
var codecForTokenFamilyDetails = () => buildCodecForObject().property("slug", codecForString()).property("name", codecForString()).property("description", codecForString()).property("description_i18n", codecOptional(codecForInternationalizedString())).property("valid_after", codecForTimestamp).property("valid_before", codecForTimestamp).property("duration", codecForDuration).property("kind", codecForTokenFamilyKind).property("issued", codecForNumber()).property("used", codecForNumber()).build("TalerMerchantApi.TokenFamilyDetails");
var codecForTokenFamiliesList = () => buildCodecForObject().property("token_families", codecForList(codecForTokenFamilySummary())).build("TalerMerchantApi.TokenFamiliesList");
var codecForTokenFamilySummary = () => buildCodecForObject().property("slug", codecForString()).property("name", codecForString()).property("description", codecForString()).property("description_i18n", codecForInternationalizedString()).property("valid_after", codecForTimestamp).property("valid_before", codecForTimestamp).property("kind", codecForTokenFamilyKind).build("TalerMerchantApi.TokenFamilySummary");
var codecForStatisticBucketRange = codecForEither(codecForConstString(StatisticBucketRange.Day), codecForConstString(StatisticBucketRange.Hour), codecForConstString(StatisticBucketRange.Day), codecForConstString(StatisticBucketRange.Week), codecForConstString(StatisticBucketRange.Month), codecForConstString(StatisticBucketRange.Quarter), codecForConstString(StatisticBucketRange.Year));
var codecForStatisticsAmountBucket = () => buildCodecForObject().property("start_time", codecForTimestamp).property("end_time", codecForTimestamp).property("range", codecForStatisticBucketRange).property("cumulative_amounts", codecForList(codecForAmountString())).build("TalerMerchantApi.StatisticsAmountBucket");
var codecForStatisticsAmountInterval = () => buildCodecForObject().property("start_time", codecForTimestamp).property("cumulative_amounts", codecForList(codecForAmountString())).build("TalerMerchantApi.StatisticsAmountInterval");
var codecForStatisticsAmountResponse = () => buildCodecForObject().property("buckets", codecForList(codecForStatisticsAmountBucket())).property("buckets_description", codecOptional(codecForString())).property("intervals", codecForList(codecForStatisticsAmountInterval())).property("intervals_description", codecOptional(codecForString())).build("TalerMerchantApi.StatisticsAmountResponse");
var codecForStatisticsCounterBucket = () => buildCodecForObject().property("start_time", codecForTimestamp).property("end_time", codecForTimestamp).property("range", codecForString()).property("cumulative_counter", codecForNumber()).build("TalerMerchantApi.StatisticsCounterBucket");
var codecForStatisticsCounterInterval = () => buildCodecForObject().property("start_time", codecForTimestamp).property("cumulative_counter", codecForNumber()).build("TalerMerchantApi.StatisticsCounterInterval");
var codecForStatisticsCounterResponse = () => buildCodecForObject().property("buckets", codecForList(codecForStatisticsCounterBucket())).property("buckets_description", codecOptional(codecForString())).property("intervals", codecForList(codecForStatisticsCounterInterval())).property("intervals_description", codecOptional(codecForString())).build("TalerMerchantApi.StatisticsCounterResponse");
var codecForInstancesResponse = () => buildCodecForObject().property("instances", codecForList(codecForInstance())).build("TalerMerchantApi.InstancesResponse");
var codecForInstance = () => buildCodecForObject().property("name", codecForString()).property("website", codecOptional(codecForString())).property("logo", codecOptional(codecForString())).property("id", codecForString()).property("merchant_pub", codecForEddsaPublicKey()).property("payment_targets", codecForList(codecForString())).property("deleted", codecForBoolean()).build("TalerMerchantApi.Instance");
var codecForTemplateEditableDetails = () => buildCodecForObject().property("summary", codecOptional(codecForString())).property("currency", codecOptional(codecForString())).property("amount", codecOptional(codecForAmountString())).build("TemplateEditableDetails");
var codecForMerchantReserveCreateConfirmation = () => buildCodecForObject().property("accounts", codecForList(codecForExchangeWireAccount())).property("reserve_pub", codecForEddsaPublicKey()).build("MerchantReserveCreateConfirmation");
var TanChannel;
(function(TanChannel2) {
  TanChannel2["SMS"] = "sms";
  TanChannel2["EMAIL"] = "email";
})(TanChannel || (TanChannel = {}));
var codecForChallenge = () => buildCodecForObject().property("challenge_id", codecForString()).property("tan_channel", codecForEither(codecForConstString(TanChannel.SMS), codecForConstString(TanChannel.EMAIL))).property("tan_info", codecForString()).build("MFA.Challenge");
var codecForChallengeResponse = () => buildCodecForObject().property("challenges", codecForList(codecForChallenge())).property("combi_and", codecForBoolean()).build("MFA.ChallengeResponse");
var codecForChallengeRequestResponse = () => buildCodecForObject().property("solve_expiration", codecOptional(codecForTimestamp)).property("earliest_retransmission", codecOptional(codecForTimestamp)).build("MFA.ChallengeRequestResponse");

// ../taler-util/lib/contract-terms.js
var logger5 = new Logger("contractTerms.ts");
var ContractTermsUtil;
(function(ContractTermsUtil2) {
  function forgetAllImpl(anyJson, path, pred) {
    const dup = JSON.parse(JSON.stringify(anyJson));
    if (Array.isArray(dup)) {
      for (let i5 = 0; i5 < dup.length; i5++) {
        dup[i5] = forgetAllImpl(dup[i5], [...path, `${i5}`], pred);
      }
    } else if (typeof dup === "object" && dup != null) {
      if (typeof dup.$forgettable === "object") {
        for (const x6 of Object.keys(dup.$forgettable)) {
          if (!pred([...path, x6])) {
            continue;
          }
          if (!dup.$forgotten) {
            dup.$forgotten = {};
          }
          if (!dup.$forgotten[x6]) {
            const membValCanon = stringToBytes(canonicalJson(scrub(dup[x6])) + "\0");
            const membSalt = stringToBytes(dup.$forgettable[x6] + "\0");
            const h5 = kdf(64, membValCanon, membSalt, new Uint8Array([]));
            dup.$forgotten[x6] = encodeCrock(h5);
          }
          delete dup[x6];
          delete dup.$forgettable[x6];
        }
        if (Object.keys(dup.$forgettable).length === 0) {
          delete dup.$forgettable;
        }
      }
      for (const x6 of Object.keys(dup)) {
        if (x6.startsWith("$")) {
          continue;
        }
        dup[x6] = forgetAllImpl(dup[x6], [...path, x6], pred);
      }
    }
    return dup;
  }
  ContractTermsUtil2.forgetAllImpl = forgetAllImpl;
  function scrub(anyJson) {
    return forgetAllImpl(anyJson, [], () => true);
  }
  ContractTermsUtil2.scrub = scrub;
  function forgetAll(anyJson, pred) {
    return forgetAllImpl(anyJson, [], pred);
  }
  ContractTermsUtil2.forgetAll = forgetAll;
  function saltForgettable(anyJson) {
    const dup = JSON.parse(JSON.stringify(anyJson));
    if (Array.isArray(dup)) {
      for (let i5 = 0; i5 < dup.length; i5++) {
        dup[i5] = saltForgettable(dup[i5]);
      }
    } else if (typeof dup === "object" && dup !== null) {
      if (typeof dup.$forgettable === "object") {
        for (const k6 of Object.keys(dup.$forgettable)) {
          if (dup.$forgettable[k6] === true) {
            dup.$forgettable[k6] = encodeCrock(getRandomBytes(32));
          }
        }
      }
      for (const x6 of Object.keys(dup)) {
        if (x6.startsWith("$")) {
          continue;
        }
        dup[x6] = saltForgettable(dup[x6]);
      }
    }
    return dup;
  }
  ContractTermsUtil2.saltForgettable = saltForgettable;
  const nameRegex = /^[0-9A-Za-z_]+$/;
  function validateForgettable(anyJson) {
    if (anyJson === void 0) {
      return true;
    }
    if (typeof anyJson === "string") {
      return true;
    }
    if (typeof anyJson === "number") {
      return Number.isInteger(anyJson) && anyJson >= Number.MIN_SAFE_INTEGER && anyJson <= Number.MAX_SAFE_INTEGER;
    }
    if (typeof anyJson === "boolean") {
      return true;
    }
    if (anyJson === null) {
      return true;
    }
    if (Array.isArray(anyJson)) {
      return anyJson.every((x6) => validateForgettable(x6));
    }
    if (typeof anyJson === "object") {
      for (const k6 of Object.keys(anyJson)) {
        if (k6.match(nameRegex)) {
          if (validateForgettable(anyJson[k6])) {
            continue;
          } else {
            return false;
          }
        }
        if (k6 === "$forgettable") {
          const fga = anyJson.$forgettable;
          if (!fga || typeof fga !== "object") {
            return false;
          }
          for (const fk of Object.keys(fga)) {
            if (!fk.match(nameRegex)) {
              return false;
            }
            if (!(fk in anyJson)) {
              return false;
            }
            const fv = anyJson.$forgettable[fk];
            if (typeof fv !== "string") {
              return false;
            }
          }
        } else if (k6 === "$forgotten") {
          const fgo = anyJson.$forgotten;
          if (!fgo || typeof fgo !== "object") {
            return false;
          }
          for (const fk of Object.keys(fgo)) {
            if (!fk.match(nameRegex)) {
              return false;
            }
            if (fk in anyJson) {
              return false;
            }
            const fv = anyJson.$forgotten[fk];
            if (typeof fv !== "string") {
              return false;
            }
            try {
              const decFv = decodeCrock(fv);
              if (decFv.length != 64) {
                return false;
              }
            } catch (e5) {
              return false;
            }
            if (anyJson.$forgettable?.[k6] !== void 0) {
              return false;
            }
          }
        } else {
          return false;
        }
      }
      return true;
    }
    return false;
  }
  ContractTermsUtil2.validateForgettable = validateForgettable;
  function validateNothingForgotten(contractTerms) {
    throw Error("not implemented yet");
  }
  ContractTermsUtil2.validateNothingForgotten = validateNothingForgotten;
  function validateParsed(contractTerms) {
    if (contractTerms.version === MerchantContractVersion.V1) {
      const regex = new RegExp("^(\\*\\.)?([\\w\\d]+\\.)+[\\w\\d]+$");
      for (const slug in contractTerms.token_families) {
        const family = contractTerms.token_families[slug];
        var domains = [];
        switch (family.details.class) {
          case MerchantContractTokenKind.Subscription:
            domains.push(...family.details.trusted_domains);
            break;
          case MerchantContractTokenKind.Discount:
            domains.push(...family.details.expected_domains);
            break;
          default:
            assertUnreachable(family.details);
        }
        for (const domain in domains) {
          if (domain !== "*" && !regex.test(domain)) {
            return false;
          }
        }
      }
    }
    return true;
  }
  ContractTermsUtil2.validateParsed = validateParsed;
  function hashContractTerms(contractTerms) {
    const cleaned = scrub(contractTerms);
    const canon = canonicalJson(cleaned) + "\0";
    const bytes = stringToBytes(canon);
    return encodeCrock(hash2(bytes));
  }
  ContractTermsUtil2.hashContractTerms = hashContractTerms;
  function extractAmounts(contractTerms, choiceIndex) {
    let amountRaw;
    let maxFee;
    switch (contractTerms.version) {
      case void 0:
      case MerchantContractVersion.V0:
        amountRaw = contractTerms.amount;
        maxFee = contractTerms.max_fee;
        break;
      case MerchantContractVersion.V1:
        if (choiceIndex === void 0) {
          logger5.trace("choice index not specified for contract v1");
          return {
            available: false,
            amountRaw: void 0,
            maxFee: void 0
          };
        }
        if (contractTerms.choices[choiceIndex] === void 0)
          throw Error(`invalid choice index ${choiceIndex}`);
        amountRaw = contractTerms.choices[choiceIndex].amount;
        maxFee = contractTerms.choices[choiceIndex].max_fee;
        break;
      default:
        assertUnreachable(contractTerms);
    }
    return {
      available: true,
      amountRaw,
      maxFee
    };
  }
  ContractTermsUtil2.extractAmounts = extractAmounts;
  function getV0CompatChoiceIndex(terms) {
    let firstGood = void 0;
    for (let i5 = 0; i5 < terms.choices.length; i5++) {
      if (terms.choices[i5].inputs.length == 0) {
        firstGood = i5;
        break;
      }
    }
    if (firstGood != null) {
      return firstGood;
    }
    return void 0;
  }
  ContractTermsUtil2.getV0CompatChoiceIndex = getV0CompatChoiceIndex;
  function downgradeContractTerms(terms) {
    if (terms.version == MerchantContractVersion.V0) {
      return terms;
    }
    if (terms.version !== MerchantContractVersion.V1) {
      return void 0;
    }
    const firstGood = getV0CompatChoiceIndex(terms);
    if (firstGood == null) {
      return void 0;
    }
    return {
      amount: terms.choices[firstGood].amount,
      exchanges: terms.exchanges,
      h_wire: terms.h_wire,
      max_fee: terms.choices[firstGood].max_fee,
      merchant: terms.merchant,
      merchant_base_url: terms.merchant_base_url,
      merchant_pub: terms.merchant_pub,
      nonce: terms.nonce,
      order_id: terms.order_id,
      pay_deadline: terms.pay_deadline,
      refund_deadline: terms.refund_deadline,
      summary: terms.summary,
      timestamp: terms.timestamp,
      wire_method: terms.wire_method,
      wire_transfer_deadline: terms.wire_transfer_deadline,
      auto_refund: terms.auto_refund,
      delivery_date: terms.delivery_date,
      delivery_location: terms.delivery_location,
      extra: terms.extra,
      fulfillment_message: terms.fulfillment_message,
      fulfillment_message_i18n: terms.fulfillment_message_i18n,
      fulfillment_url: terms.fulfillment_url,
      minimum_age: terms.minimum_age,
      products: terms.products,
      public_reorder_url: terms.public_reorder_url,
      summary_i18n: terms.summary_i18n,
      version: MerchantContractVersion.V0
    };
  }
  ContractTermsUtil2.downgradeContractTerms = downgradeContractTerms;
})(ContractTermsUtil || (ContractTermsUtil = {}));

// ../taler-util/lib/fnutils.js
var fnutil;
(function(fnutil2) {
  function all(arr, f3) {
    for (const x6 of arr) {
      if (!f3(x6)) {
        return false;
      }
    }
    return true;
  }
  fnutil2.all = all;
  function any(arr, f3) {
    for (const x6 of arr) {
      if (f3(x6)) {
        return true;
      }
    }
    return false;
  }
  fnutil2.any = any;
})(fnutil || (fnutil = {}));

// ../taler-util/lib/http-status-codes.js
var HttpStatusCode;
(function(HttpStatusCode4) {
  HttpStatusCode4[HttpStatusCode4["Continue"] = 100] = "Continue";
  HttpStatusCode4[HttpStatusCode4["SwitchingProtocols"] = 101] = "SwitchingProtocols";
  HttpStatusCode4[HttpStatusCode4["Processing"] = 102] = "Processing";
  HttpStatusCode4[HttpStatusCode4["Ok"] = 200] = "Ok";
  HttpStatusCode4[HttpStatusCode4["Created"] = 201] = "Created";
  HttpStatusCode4[HttpStatusCode4["Accepted"] = 202] = "Accepted";
  HttpStatusCode4[HttpStatusCode4["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
  HttpStatusCode4[HttpStatusCode4["NoContent"] = 204] = "NoContent";
  HttpStatusCode4[HttpStatusCode4["ResetContent"] = 205] = "ResetContent";
  HttpStatusCode4[HttpStatusCode4["PartialContent"] = 206] = "PartialContent";
  HttpStatusCode4[HttpStatusCode4["MultiStatus"] = 207] = "MultiStatus";
  HttpStatusCode4[HttpStatusCode4["AlreadyReported"] = 208] = "AlreadyReported";
  HttpStatusCode4[HttpStatusCode4["ImUsed"] = 226] = "ImUsed";
  HttpStatusCode4[HttpStatusCode4["MultipleChoices"] = 300] = "MultipleChoices";
  HttpStatusCode4[HttpStatusCode4["MovedPermanently"] = 301] = "MovedPermanently";
  HttpStatusCode4[HttpStatusCode4["Found"] = 302] = "Found";
  HttpStatusCode4[HttpStatusCode4["SeeOther"] = 303] = "SeeOther";
  HttpStatusCode4[HttpStatusCode4["NotModified"] = 304] = "NotModified";
  HttpStatusCode4[HttpStatusCode4["UseProxy"] = 305] = "UseProxy";
  HttpStatusCode4[HttpStatusCode4["SwitchProxy"] = 306] = "SwitchProxy";
  HttpStatusCode4[HttpStatusCode4["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  HttpStatusCode4[HttpStatusCode4["PermanentRedirect"] = 308] = "PermanentRedirect";
  HttpStatusCode4[HttpStatusCode4["BadRequest"] = 400] = "BadRequest";
  HttpStatusCode4[HttpStatusCode4["Unauthorized"] = 401] = "Unauthorized";
  HttpStatusCode4[HttpStatusCode4["PaymentRequired"] = 402] = "PaymentRequired";
  HttpStatusCode4[HttpStatusCode4["Forbidden"] = 403] = "Forbidden";
  HttpStatusCode4[HttpStatusCode4["NotFound"] = 404] = "NotFound";
  HttpStatusCode4[HttpStatusCode4["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  HttpStatusCode4[HttpStatusCode4["NotAcceptable"] = 406] = "NotAcceptable";
  HttpStatusCode4[HttpStatusCode4["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  HttpStatusCode4[HttpStatusCode4["RequestTimeout"] = 408] = "RequestTimeout";
  HttpStatusCode4[HttpStatusCode4["Conflict"] = 409] = "Conflict";
  HttpStatusCode4[HttpStatusCode4["Gone"] = 410] = "Gone";
  HttpStatusCode4[HttpStatusCode4["LengthRequired"] = 411] = "LengthRequired";
  HttpStatusCode4[HttpStatusCode4["PreconditionFailed"] = 412] = "PreconditionFailed";
  HttpStatusCode4[HttpStatusCode4["PayloadTooLarge"] = 413] = "PayloadTooLarge";
  HttpStatusCode4[HttpStatusCode4["UriTooLong"] = 414] = "UriTooLong";
  HttpStatusCode4[HttpStatusCode4["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
  HttpStatusCode4[HttpStatusCode4["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
  HttpStatusCode4[HttpStatusCode4["ExpectationFailed"] = 417] = "ExpectationFailed";
  HttpStatusCode4[HttpStatusCode4["IAmATeapot"] = 418] = "IAmATeapot";
  HttpStatusCode4[HttpStatusCode4["MisdirectedRequest"] = 421] = "MisdirectedRequest";
  HttpStatusCode4[HttpStatusCode4["UnprocessableEntity"] = 422] = "UnprocessableEntity";
  HttpStatusCode4[HttpStatusCode4["Locked"] = 423] = "Locked";
  HttpStatusCode4[HttpStatusCode4["FailedDependency"] = 424] = "FailedDependency";
  HttpStatusCode4[HttpStatusCode4["TooEarly"] = 425] = "TooEarly";
  HttpStatusCode4[HttpStatusCode4["UpgradeRequired"] = 426] = "UpgradeRequired";
  HttpStatusCode4[HttpStatusCode4["PreconditionRequired"] = 428] = "PreconditionRequired";
  HttpStatusCode4[HttpStatusCode4["TooManyRequests"] = 429] = "TooManyRequests";
  HttpStatusCode4[HttpStatusCode4["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
  HttpStatusCode4[HttpStatusCode4["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
  HttpStatusCode4[HttpStatusCode4["InternalServerError"] = 500] = "InternalServerError";
  HttpStatusCode4[HttpStatusCode4["NotImplemented"] = 501] = "NotImplemented";
  HttpStatusCode4[HttpStatusCode4["BadGateway"] = 502] = "BadGateway";
  HttpStatusCode4[HttpStatusCode4["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  HttpStatusCode4[HttpStatusCode4["GatewayTimeout"] = 504] = "GatewayTimeout";
  HttpStatusCode4[HttpStatusCode4["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
  HttpStatusCode4[HttpStatusCode4["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
  HttpStatusCode4[HttpStatusCode4["InsufficientStorage"] = 507] = "InsufficientStorage";
  HttpStatusCode4[HttpStatusCode4["LoopDetected"] = 508] = "LoopDetected";
  HttpStatusCode4[HttpStatusCode4["NotExtended"] = 510] = "NotExtended";
  HttpStatusCode4[HttpStatusCode4["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
})(HttpStatusCode || (HttpStatusCode = {}));

// ../taler-util/lib/types-taler-bank-conversion.js
var codecForCashoutConversionResponse = () => buildCodecForObject().property("amount_credit", codecForAmountString()).property("amount_debit", codecForAmountString()).build("TalerCorebankApi.CashoutConversionResponse");
var codecForCashinConversionResponse = () => buildCodecForObject().property("amount_credit", codecForAmountString()).property("amount_debit", codecForAmountString()).build("TalerCorebankApi.CashinConversionResponse");
var codecForConversionRate = () => buildCodecForObject().property("cashin_fee", codecForAmountString()).property("cashin_min_amount", codecForAmountString()).property("cashin_ratio", codecForDecimalNumber()).property("cashin_rounding_mode", codecForEither(codecForConstString("zero"), codecForConstString("up"), codecForConstString("nearest"))).property("cashin_tiny_amount", codecForAmountString()).property("cashout_fee", codecForAmountString()).property("cashout_min_amount", codecForAmountString()).property("cashout_ratio", codecForDecimalNumber()).property("cashout_rounding_mode", codecForEither(codecForConstString("zero"), codecForConstString("up"), codecForConstString("nearest"))).property("cashout_tiny_amount", codecForAmountString()).build("ConversionBankConfig.ConversionInfo");
var codecForConversionBankConfig = () => buildCodecForObject().property("name", codecForConstString("taler-conversion-info")).property("version", codecForString()).property("regional_currency", codecForString()).property("regional_currency_specification", codecForCurrencySpecificiation()).property("fiat_currency", codecForString()).property("fiat_currency_specification", codecForCurrencySpecificiation()).property("conversion_rate", codecForConversionRate()).build("ConversionBankConfig.IntegrationConfig");

// ../taler-util/lib/types-taler-wallet.js
var ScopeType;
(function(ScopeType2) {
  ScopeType2["Global"] = "global";
  ScopeType2["Exchange"] = "exchange";
  ScopeType2["Auditor"] = "auditor";
})(ScopeType || (ScopeType = {}));
var TransactionAmountMode;
(function(TransactionAmountMode2) {
  TransactionAmountMode2["Effective"] = "effective";
  TransactionAmountMode2["Raw"] = "raw";
})(TransactionAmountMode || (TransactionAmountMode = {}));
var codecForConvertAmountRequest = buildCodecForObject().property("amount", codecForAmountString()).property("depositPaytoUri", codecForPaytoString()).property("type", codecForEither(codecForConstString(TransactionAmountMode.Raw), codecForConstString(TransactionAmountMode.Effective))).build("ConvertAmountRequest");
var BalanceFlag;
(function(BalanceFlag2) {
  BalanceFlag2["IncomingKyc"] = "incoming-kyc";
  BalanceFlag2["IncomingAml"] = "incoming-aml";
  BalanceFlag2["IncomingConfirmation"] = "incoming-confirmation";
  BalanceFlag2["OutgoingKyc"] = "outgoing-kyc";
})(BalanceFlag || (BalanceFlag = {}));
var CoinStatus;
(function(CoinStatus2) {
  CoinStatus2["Fresh"] = "fresh";
  CoinStatus2["DenomLoss"] = "denom-loss";
  CoinStatus2["FreshSuspended"] = "fresh-suspended";
  CoinStatus2["Dormant"] = "dormant";
})(CoinStatus || (CoinStatus = {}));
var ConfirmPayResultType;
(function(ConfirmPayResultType2) {
  ConfirmPayResultType2["Done"] = "done";
  ConfirmPayResultType2["Pending"] = "pending";
})(ConfirmPayResultType || (ConfirmPayResultType = {}));
var codecForTalerErrorDetail = () => buildCodecForObject().property("code", codecForNumber()).property("when", codecOptional(codecForAbsoluteTime)).property("hint", codecOptional(codecForString())).build("TalerErrorDetail");
var PreparePayResultType;
(function(PreparePayResultType2) {
  PreparePayResultType2["PaymentPossible"] = "payment-possible";
  PreparePayResultType2["InsufficientBalance"] = "insufficient-balance";
  PreparePayResultType2["AlreadyConfirmed"] = "already-confirmed";
  PreparePayResultType2["ChoiceSelection"] = "choice-selection";
})(PreparePayResultType || (PreparePayResultType = {}));
var InsufficientBalanceHint;
(function(InsufficientBalanceHint2) {
  InsufficientBalanceHint2["MerchantAcceptInsufficient"] = "merchant-accept-insufficient";
  InsufficientBalanceHint2["MerchantDepositInsufficient"] = "merchant-deposit-insufficient";
  InsufficientBalanceHint2["AgeRestricted"] = "age-restricted";
  InsufficientBalanceHint2["WalletBalanceMaterialInsufficient"] = "wallet-balance-material-insufficient";
  InsufficientBalanceHint2["WalletBalanceAvailableInsufficient"] = "wallet-balance-available-insufficient";
  InsufficientBalanceHint2["ExchangeMissingGlobalFees"] = "exchange-missing-global-fees";
  InsufficientBalanceHint2["FeesNotCovered"] = "fees-not-covered";
})(InsufficientBalanceHint || (InsufficientBalanceHint = {}));
var TokenAvailabilityHint;
(function(TokenAvailabilityHint2) {
  TokenAvailabilityHint2["WalletTokensAvailableInsufficient"] = "wallet-tokens-available-insufficient";
  TokenAvailabilityHint2["MerchantUnexpected"] = "merchant-unexpected";
  TokenAvailabilityHint2["MerchantUntrusted"] = "merchant-untrusted";
})(TokenAvailabilityHint || (TokenAvailabilityHint = {}));
var RefreshReason;
(function(RefreshReason2) {
  RefreshReason2["Manual"] = "manual";
  RefreshReason2["PayMerchant"] = "pay-merchant";
  RefreshReason2["PayDeposit"] = "pay-deposit";
  RefreshReason2["PayPeerPush"] = "pay-peer-push";
  RefreshReason2["PayPeerPull"] = "pay-peer-pull";
  RefreshReason2["Refund"] = "refund";
  RefreshReason2["AbortPay"] = "abort-pay";
  RefreshReason2["AbortDeposit"] = "abort-deposit";
  RefreshReason2["AbortPeerPushDebit"] = "abort-peer-push-debit";
  RefreshReason2["AbortPeerPullDebit"] = "abort-peer-pull-debit";
  RefreshReason2["Recoup"] = "recoup";
  RefreshReason2["BackupRestored"] = "backup-restored";
  RefreshReason2["Scheduled"] = "scheduled";
})(RefreshReason || (RefreshReason = {}));
var ExchangeTosStatus;
(function(ExchangeTosStatus2) {
  ExchangeTosStatus2["Pending"] = "pending";
  ExchangeTosStatus2["Proposed"] = "proposed";
  ExchangeTosStatus2["Accepted"] = "accepted";
  ExchangeTosStatus2["MissingTos"] = "missing-tos";
})(ExchangeTosStatus || (ExchangeTosStatus = {}));
var ExchangeEntryStatus;
(function(ExchangeEntryStatus2) {
  ExchangeEntryStatus2["Preset"] = "preset";
  ExchangeEntryStatus2["Ephemeral"] = "ephemeral";
  ExchangeEntryStatus2["Used"] = "used";
})(ExchangeEntryStatus || (ExchangeEntryStatus = {}));
var ExchangeUpdateStatus;
(function(ExchangeUpdateStatus2) {
  ExchangeUpdateStatus2["Initial"] = "initial";
  ExchangeUpdateStatus2["InitialUpdate"] = "initial-update";
  ExchangeUpdateStatus2["Suspended"] = "suspended";
  ExchangeUpdateStatus2["UnavailableUpdate"] = "unavailable-update";
  ExchangeUpdateStatus2["Ready"] = "ready";
  ExchangeUpdateStatus2["ReadyUpdate"] = "ready-update";
  ExchangeUpdateStatus2["OutdatedUpdate"] = "outdated-update";
})(ExchangeUpdateStatus || (ExchangeUpdateStatus = {}));
var ExchangeWalletKycStatus;
(function(ExchangeWalletKycStatus2) {
  ExchangeWalletKycStatus2["Done"] = "done";
  ExchangeWalletKycStatus2["LegiInit"] = "legi-init";
  ExchangeWalletKycStatus2["Legi"] = "legi";
})(ExchangeWalletKycStatus || (ExchangeWalletKycStatus = {}));
var ChoiceSelectionDetailType;
(function(ChoiceSelectionDetailType2) {
  ChoiceSelectionDetailType2["PaymentPossible"] = "payment-possible";
  ChoiceSelectionDetailType2["InsufficientBalance"] = "insufficient-balance";
})(ChoiceSelectionDetailType || (ChoiceSelectionDetailType = {}));
var RecoveryMergeStrategy;
(function(RecoveryMergeStrategy2) {
  RecoveryMergeStrategy2["Ours"] = "ours";
  RecoveryMergeStrategy2["Theirs"] = "theirs";
})(RecoveryMergeStrategy || (RecoveryMergeStrategy = {}));
var AttentionPriority;
(function(AttentionPriority2) {
  AttentionPriority2["High"] = "high";
  AttentionPriority2["Medium"] = "medium";
  AttentionPriority2["Low"] = "low";
})(AttentionPriority || (AttentionPriority = {}));
var AttentionType;
(function(AttentionType2) {
  AttentionType2["KycWithdrawal"] = "kyc-withdrawal";
  AttentionType2["BackupUnpaid"] = "backup-unpaid";
  AttentionType2["BackupExpiresSoon"] = "backup-expires-soon";
  AttentionType2["MerchantRefund"] = "merchant-refund";
  AttentionType2["ExchangeTosChanged"] = "exchange-tos-changed";
  AttentionType2["ExchangeKeyExpired"] = "exchange-key-expired";
  AttentionType2["ExchangeKeyExpiresSoon"] = "exchange-key-expires-soon";
  AttentionType2["ExchangeDenominationsExpired"] = "exchange-denominations-expired";
  AttentionType2["ExchangeDenominationsExpiresSoon"] = "exchange-denominations-expires-soon";
  AttentionType2["AuditorTosChanged"] = "auditor-tos-changed";
  AttentionType2["AuditorKeyExpires"] = "auditor-key-expires";
  AttentionType2["AuditorDenominationsExpires"] = "auditor-denominations-expires";
  AttentionType2["PullPaymentPaid"] = "pull-payment-paid";
  AttentionType2["PushPaymentReceived"] = "push-payment-withdrawn";
})(AttentionType || (AttentionType = {}));
var UserAttentionPriority = {
  "kyc-withdrawal": AttentionPriority.Medium,
  "backup-unpaid": AttentionPriority.High,
  "backup-expires-soon": AttentionPriority.Medium,
  "merchant-refund": AttentionPriority.Medium,
  "exchange-tos-changed": AttentionPriority.Medium,
  "exchange-key-expired": AttentionPriority.High,
  "exchange-key-expires-soon": AttentionPriority.Medium,
  "exchange-denominations-expired": AttentionPriority.High,
  "exchange-denominations-expires-soon": AttentionPriority.Medium,
  "auditor-tos-changed": AttentionPriority.Medium,
  "auditor-key-expires": AttentionPriority.Medium,
  "auditor-denominations-expires": AttentionPriority.Medium,
  "pull-payment-paid": AttentionPriority.High,
  "push-payment-withdrawn": AttentionPriority.High
};
var ProviderPaymentType;
(function(ProviderPaymentType2) {
  ProviderPaymentType2["Unpaid"] = "unpaid";
  ProviderPaymentType2["Pending"] = "pending";
  ProviderPaymentType2["InsufficientBalance"] = "insufficient-balance";
  ProviderPaymentType2["Paid"] = "paid";
  ProviderPaymentType2["TermsChanged"] = "terms-changed";
})(ProviderPaymentType || (ProviderPaymentType = {}));
var codecForEmptyObject = () => buildCodecForObject().build("EmptyObject");

// ../taler-util/lib/http-client/utils.js
function makeBasicAuthHeader2(username, password) {
  const auth = `${username}:${password}`;
  const authEncoded = base64FromArrayBuffer(stringToBytes(auth));
  return `Basic ${authEncoded}`;
}
function makeBearerTokenAuthHeader(token) {
  return `Bearer ${token}`;
}
function createAuthorizationHeader(auth) {
  if (!auth)
    return void 0;
  switch (auth.type) {
    case "basic": {
      return makeBasicAuthHeader2(auth.username, auth.password);
    }
    case "bearer": {
      return makeBearerTokenAuthHeader(auth.token);
    }
  }
  return void 0;
}
function addPaginationParams(url, pagination) {
  if (!pagination)
    return;
  if (pagination.offset) {
    url.searchParams.set("offset", pagination.offset);
  }
  const order = !pagination || pagination.order === "asc" ? 1 : -1;
  const limit = !pagination || !pagination.limit || pagination.limit === 0 ? 5 : Math.abs(pagination.limit);
  url.searchParams.set("limit", String(order * limit));
}
function addLongPollingParam(url, param) {
  if (!param)
    return;
  if (param.timeoutMs) {
    url.searchParams.set("timeout_ms", String(param.timeoutMs));
  }
}
var nullEvictor = {
  notifySuccess: () => Promise.resolve()
};

// ../taler-util/lib/http-client/bank-conversion.js
var TalerBankConversionCacheEviction;
(function(TalerBankConversionCacheEviction2) {
  TalerBankConversionCacheEviction2[TalerBankConversionCacheEviction2["UPDATE_RATE"] = 0] = "UPDATE_RATE";
})(TalerBankConversionCacheEviction || (TalerBankConversionCacheEviction = {}));
var TalerBankConversionHttpClient = class _TalerBankConversionHttpClient {
  constructor(baseUrl, httpClient, cacheEvictor) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
    this.cacheEvictor = cacheEvictor ?? nullEvictor;
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-bank-conversion-info.html#get--config
   *
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-conversion-info", _TalerBankConversionHttpClient.PROTOCOL_VERSION, resp, codecForConversionBankConfig());
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-conversion-info.html#get--rate
   *
   */
  async getRate(auth) {
    const url = new URL(`rate`, this.baseUrl);
    const headers = {};
    if (auth) {
      headers.Authorization = makeBearerTokenAuthHeader(auth);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForConversionRate());
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-conversion-info.html#get--cashin-rate
   *
   */
  async getCashinRate(auth, conversion) {
    const url = new URL(`cashin-rate`, this.baseUrl);
    if (conversion.debit) {
      url.searchParams.set("amount_debit", Amounts.stringify(conversion.debit));
    }
    if (conversion.credit) {
      url.searchParams.set("amount_credit", Amounts.stringify(conversion.credit));
    }
    const headers = {};
    if (auth) {
      headers.Authorization = makeBearerTokenAuthHeader(auth);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCashinConversionResponse());
      case HttpStatusCode.BadRequest: {
        const body = await resp.json();
        const details = codecForTalerErrorDetail().decode(body);
        switch (details.code) {
          case TalerErrorCode.GENERIC_PARAMETER_MISSING:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.GENERIC_PARAMETER_MALFORMED:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.GENERIC_CURRENCY_MISMATCH:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-conversion-info.html#get--cashout-rate
   *
   */
  async getCashoutRate(auth, conversion) {
    const url = new URL(`cashout-rate`, this.baseUrl);
    if (conversion.debit) {
      url.searchParams.set("amount_debit", Amounts.stringify(conversion.debit));
    }
    if (conversion.credit) {
      url.searchParams.set("amount_credit", Amounts.stringify(conversion.credit));
    }
    const headers = {};
    if (auth) {
      headers.Authorization = makeBearerTokenAuthHeader(auth);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCashoutConversionResponse());
      case HttpStatusCode.BadRequest: {
        const body = await resp.json();
        const details = codecForTalerErrorDetail().decode(body);
        switch (details.code) {
          case TalerErrorCode.GENERIC_PARAMETER_MISSING:
            return opKnownHttpFailure(resp.status, resp);
          case TalerErrorCode.GENERIC_PARAMETER_MALFORMED:
            return opKnownHttpFailure(resp.status, resp);
          case TalerErrorCode.GENERIC_CURRENCY_MISMATCH:
            return opKnownHttpFailure(resp.status, resp);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-conversion-info.html#post--conversion-rate
   *
   */
  async updateConversionRate(auth, body) {
    const url = new URL(`conversion-rate`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      },
      body
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerBankConversionCacheEviction.UPDATE_RATE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerBankConversionHttpClient.PROTOCOL_VERSION = "0:0:0";

// ../taler-util/lib/result.js
var Result = {
  of(value) {
    return { tag: "ok", value };
  },
  error(error2) {
    return { tag: "error", error: error2 };
  }
};

// ../taler-util/lib/taleruri.js
function codecForTalerUriString() {
  return {
    decode(x6, c5) {
      if (typeof x6 !== "string") {
        throw new DecodingError(`expected string at ${renderContext(c5)} but got ${typeof x6}`);
      }
      if (parseTalerUri(x6) === void 0) {
        throw new DecodingError(`invalid taler URI at ${renderContext(c5)} but got "${x6}"`);
      }
      return x6;
    }
  };
}
var TALER_PREFIX = "taler://";
var TALER_HTTP_PREFIX = "taler+http://";
var TalerUriParseError;
(function(TalerUriParseError2) {
  TalerUriParseError2[TalerUriParseError2["WRONG_PREFIX"] = 0] = "WRONG_PREFIX";
  TalerUriParseError2[TalerUriParseError2["INCOMPLETE"] = 1] = "INCOMPLETE";
  TalerUriParseError2[TalerUriParseError2["UNSUPPORTED"] = 2] = "UNSUPPORTED";
  TalerUriParseError2[TalerUriParseError2["COMPONENTS_LENGTH"] = 3] = "COMPONENTS_LENGTH";
  TalerUriParseError2[TalerUriParseError2["INVALID_TARGET_PATH"] = 4] = "INVALID_TARGET_PATH";
  TalerUriParseError2[TalerUriParseError2["INVALID_PARAMETER"] = 5] = "INVALID_PARAMETER";
})(TalerUriParseError || (TalerUriParseError = {}));
var TalerUris;
(function(TalerUris2) {
  const supported_targets = {
    "add-contact": true,
    "add-exchange": true,
    "dev-experiment": true,
    pay: true,
    "pay-pull": true,
    "pay-template": true,
    "pay-push": true,
    "withdraw-exchange": true,
    refund: true,
    restore: true,
    withdraw: true,
    "withdrawal-transfer-result": true
  };
  function createTalerPay(merchantBaseUrl, orderId, sessionId, opts = {}) {
    return {
      type: TalerUriAction.Pay,
      merchantBaseUrl,
      orderId,
      sessionId,
      ...opts
    };
  }
  TalerUris2.createTalerPay = createTalerPay;
  function createTalerWithdraw(bankIntegrationApiBaseUrl, withdrawalOperationId, opts = {}) {
    return {
      type: TalerUriAction.Withdraw,
      bankIntegrationApiBaseUrl,
      withdrawalOperationId,
      ...opts
    };
  }
  TalerUris2.createTalerWithdraw = createTalerWithdraw;
  function createTalerRefund(merchantBaseUrl, orderId) {
    return {
      type: TalerUriAction.Refund,
      merchantBaseUrl,
      orderId
    };
  }
  TalerUris2.createTalerRefund = createTalerRefund;
  function createTalerPayPull(exchangeBaseUrl, contractPriv) {
    return {
      type: TalerUriAction.PayPull,
      exchangeBaseUrl,
      contractPriv
    };
  }
  TalerUris2.createTalerPayPull = createTalerPayPull;
  function createTalerPayPush(exchangeBaseUrl, contractPriv) {
    return {
      type: TalerUriAction.PayPush,
      exchangeBaseUrl,
      contractPriv
    };
  }
  TalerUris2.createTalerPayPush = createTalerPayPush;
  function createTalerPayTemplate(merchantBaseUrl, templateId) {
    return {
      type: TalerUriAction.PayTemplate,
      merchantBaseUrl,
      templateId
    };
  }
  TalerUris2.createTalerPayTemplate = createTalerPayTemplate;
  function createTalerRestore(walletRootPriv, providers) {
    return {
      type: TalerUriAction.Restore,
      providers,
      walletRootPriv
    };
  }
  TalerUris2.createTalerRestore = createTalerRestore;
  function createTalerDevExperiment(devExperimentId, query) {
    return {
      type: TalerUriAction.DevExperiment,
      devExperimentId,
      query
    };
  }
  TalerUris2.createTalerDevExperiment = createTalerDevExperiment;
  function createTalerWithdrawExchange(exchangeBaseUrl, opts = {}) {
    return {
      type: TalerUriAction.WithdrawExchange,
      exchangeBaseUrl,
      ...opts
    };
  }
  TalerUris2.createTalerWithdrawExchange = createTalerWithdrawExchange;
  function createTalerAddExchange(exchangeBaseUrl) {
    return {
      type: TalerUriAction.AddExchange,
      exchangeBaseUrl
    };
  }
  TalerUris2.createTalerAddExchange = createTalerAddExchange;
  function createTalerAddContact(aliasType, alias, mailboxUri, mailboxIdentity, sourceBaseUrl) {
    return {
      type: TalerUriAction.AddContact,
      alias,
      aliasType,
      mailboxBaseUri: mailboxUri,
      mailboxIdentity,
      sourceBaseUrl
    };
  }
  TalerUris2.createTalerAddContact = createTalerAddContact;
  function createTalerWithdrawalTransferResult(ref, opts = {}) {
    return {
      type: TalerUriAction.WithdrawalTransferResult,
      ref,
      ...opts
    };
  }
  TalerUris2.createTalerWithdrawalTransferResult = createTalerWithdrawalTransferResult;
  function asHost(s6) {
    const b5 = new URL2(s6);
    return `${b5.host}${b5.pathname}`;
  }
  function getTalerParamList(p4) {
    const result = [];
    switch (p4.type) {
      case TalerUriAction.Withdraw: {
        if (p4.externalConfirmation)
          result.push(["external-confirmation", "1"]);
        return result;
      }
      case TalerUriAction.Pay: {
        if (p4.claimToken)
          result.push(["c", p4.claimToken]);
        if (p4.noncePriv)
          result.push(["n", p4.noncePriv]);
        return result;
      }
      case TalerUriAction.WithdrawExchange: {
        if (p4.amount)
          result.push(["a", p4.amount]);
        return result;
      }
      case TalerUriAction.WithdrawalTransferResult: {
        result.push(["ref", p4.ref]);
        if (p4.status)
          result.push(["status", p4.status]);
        return result;
      }
      case TalerUriAction.AddContact: {
        if (p4.sourceBaseUrl)
          result.push(["sourceBaseUrl", p4.sourceBaseUrl]);
        return result;
      }
      case TalerUriAction.Refund:
      case TalerUriAction.PayPush:
      case TalerUriAction.PayPull:
      case TalerUriAction.PayTemplate:
      case TalerUriAction.Restore:
      case TalerUriAction.DevExperiment:
      case TalerUriAction.AddExchange: {
        return result;
      }
      default: {
        assertUnreachable(p4);
      }
    }
  }
  function getTalerPrefix(p4) {
    switch (p4.type) {
      case TalerUriAction.Withdraw:
        return p4.bankIntegrationApiBaseUrl.startsWith("http://") ? TALER_HTTP_PREFIX : TALER_PREFIX;
      case TalerUriAction.Pay:
      case TalerUriAction.Refund:
      case TalerUriAction.PayTemplate:
        return p4.merchantBaseUrl.startsWith("http://") ? TALER_HTTP_PREFIX : TALER_PREFIX;
      case TalerUriAction.PayPush:
      case TalerUriAction.PayPull:
      case TalerUriAction.AddExchange:
      case TalerUriAction.WithdrawExchange:
        return p4.exchangeBaseUrl.startsWith("http://") ? TALER_HTTP_PREFIX : TALER_PREFIX;
      case TalerUriAction.Restore:
      case TalerUriAction.DevExperiment:
      case TalerUriAction.WithdrawalTransferResult:
      case TalerUriAction.AddContact:
        return TALER_PREFIX;
      default:
        assertUnreachable(p4);
    }
  }
  function getTalerPath(p4) {
    switch (p4.type) {
      case TalerUriAction.Withdraw:
        return `/${asHost(p4.bankIntegrationApiBaseUrl)}${p4.withdrawalOperationId}`;
      case TalerUriAction.Pay:
        return `/${asHost(p4.merchantBaseUrl)}${p4.orderId}/${p4.sessionId}`;
      case TalerUriAction.Refund:
        return `/${asHost(p4.merchantBaseUrl)}${p4.orderId}/`;
      case TalerUriAction.PayTemplate:
        return `/${asHost(p4.merchantBaseUrl)}${p4.templateId}`;
      case TalerUriAction.PayPush:
        return `/${asHost(p4.exchangeBaseUrl)}${p4.contractPriv}`;
      case TalerUriAction.PayPull:
        return `/${asHost(p4.exchangeBaseUrl)}${p4.contractPriv}`;
      case TalerUriAction.AddExchange:
        return `/${asHost(p4.exchangeBaseUrl)}`;
      case TalerUriAction.WithdrawExchange:
        return `/${asHost(p4.exchangeBaseUrl)}`;
      case TalerUriAction.Restore:
        return `/${p4.walletRootPriv}/${p4.providers.map((d6) => encodeURIComponent(d6)).join(",")}`;
      case TalerUriAction.DevExperiment:
        return `/${p4.devExperimentId}`;
      case TalerUriAction.WithdrawalTransferResult:
        return `/`;
      case TalerUriAction.AddContact:
        return `/${p4.aliasType}/${p4.alias}/${asHost(p4.mailboxBaseUri)}/${p4.mailboxIdentity}`;
      default:
        assertUnreachable(p4);
    }
  }
  function toString(p4) {
    const prefix2 = getTalerPrefix(p4);
    const path = getTalerPath(p4);
    const paramList = getTalerParamList(p4);
    const url = new URL2(`${prefix2}${p4.type}${path}`);
    url.search = createSearchParams2(paramList);
    return url.href;
  }
  TalerUris2.toString = toString;
  function fromString(s6, opts = {}) {
    let isHttp = false;
    if (!s6.startsWith(TALER_PREFIX) && !(isHttp = s6.startsWith(TALER_HTTP_PREFIX))) {
      return opKnownFailure(TalerUriParseError.WRONG_PREFIX);
    }
    const scheme = isHttp ? "http" : "https";
    const [path, search] = s6.slice((isHttp ? TALER_HTTP_PREFIX : TALER_PREFIX).length).split("?", 2);
    const firstSlashPos = path.indexOf("/");
    const uriType = firstSlashPos === -1 ? path : path.slice(0, firstSlashPos);
    if (!supported_targets[uriType]) {
      const d6 = opKnownFailureWithBody(TalerUriParseError.UNSUPPORTED, {
        uriType
      });
      return d6;
    }
    const targetPath = path.slice(firstSlashPos + 1);
    if (firstSlashPos === -1 || !targetPath) {
      return opKnownFailureWithBody(TalerUriParseError.INCOMPLETE, {
        uriType
      });
    }
    const params = {};
    if (search) {
      const searchParams = new URLSearchParams2(search);
      searchParams.forEach((v3, k6) => {
        params[k6] = v3;
      });
    }
    const cs = targetPath.split("/");
    switch (uriType) {
      case TalerUriAction.Pay: {
        if (cs.length < 3) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const merchant = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -2).join("/"), scheme);
        if (!opts.ignoreComponentError && !merchant) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: merchant
          });
        }
        const orderId = cs[cs.length - 2];
        const sessionId = cs[cs.length - 1];
        return opFixedSuccess(createTalerPay(merchant ?? cs[0], orderId, sessionId, {
          claimToken: params["c"],
          noncePriv: params["n"]
        }));
      }
      case TalerUriAction.Withdraw: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const bank = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), scheme);
        if (!opts.ignoreComponentError && !bank) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: bank
          });
        }
        const operationId = cs[cs.length - 1];
        const externalConfirmation = !params["external-confirmation"] ? void 0 : params["external-confirmation"] === "1";
        return opFixedSuccess(createTalerWithdraw(bank ?? cs[0], operationId, {
          externalConfirmation
        }));
      }
      case TalerUriAction.Refund: {
        if (cs.length < 3) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        if (cs[cs.length - 1]) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 1,
            uriType
          });
        }
        const merchant = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -2).join("/"), scheme);
        if (!opts.ignoreComponentError && !merchant) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: merchant
          });
        }
        const orderId = cs[cs.length - 2];
        return opFixedSuccess(createTalerRefund(merchant ?? cs[0], orderId));
      }
      case TalerUriAction.PayPull: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const exchange = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), scheme);
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: exchange
          });
        }
        const contractPriv = cs[cs.length - 1];
        return opFixedSuccess(createTalerPayPull(exchange ?? cs[0], contractPriv));
      }
      case TalerUriAction.PayPush: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const exchange = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), scheme);
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: exchange
          });
        }
        const contractPriv = cs[cs.length - 1];
        return opFixedSuccess(createTalerPayPush(exchange ?? cs[0], contractPriv));
      }
      case TalerUriAction.PayTemplate: {
        if (cs.length < 2) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const merchant = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), scheme);
        if (!opts.ignoreComponentError && !merchant) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: merchant
          });
        }
        const contractPriv = cs[cs.length - 1];
        return opFixedSuccess(createTalerPayTemplate(merchant ?? cs[0], contractPriv));
      }
      case TalerUriAction.Restore: {
        if (cs.length !== 2) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const walletPriv = cs[0];
        const providers = [];
        cs[1].split(",").map((name) => {
          const url = decodeURIComponent(name);
          let isHttp2 = false;
          const withoutScheme = url.startsWith("https://") ? url.substring(8) : (isHttp2 = url.startsWith("http://")) ? url.substring(7) : url;
          const thisScheme = url === withoutScheme ? scheme : isHttp2 ? "http" : "https";
          const [hostname, path2] = withoutScheme.split("/", 1);
          const host = Paytos.parseHostPortPath2(hostname, path2, thisScheme);
          providers.push(host);
        });
        return opFixedSuccess(createTalerRestore(walletPriv ?? cs[0], providers));
      }
      case TalerUriAction.DevExperiment: {
        if (cs.length !== 1) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const experimentId = cs[0];
        const query = new URLSearchParams2(search);
        return opFixedSuccess(createTalerDevExperiment(experimentId, query));
      }
      case TalerUriAction.WithdrawExchange: {
        if (cs.length < 1) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        if (cs.length > 1 && cs[cs.length - 1]) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 1,
            uriType
          });
        }
        const exchange = Paytos.parseHostPortPath2(cs[0], cs.slice(1, -1).join("/"), scheme);
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: exchange
          });
        }
        const amountRes = !params["a"] ? void 0 : Amounts.parseWithError(params["a"]);
        if (!opts.ignoreComponentError && amountRes && amountRes.type === "fail") {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_PARAMETER, {
            name: "a",
            uriType,
            error: amountRes
          });
        }
        const amount = amountRes && amountRes.type === "ok" ? Amounts.stringify(amountRes.body) : void 0;
        return opFixedSuccess(createTalerWithdrawExchange(exchange ?? cs[0], {
          amount
        }));
      }
      case TalerUriAction.AddExchange: {
        if (cs.length === 1) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const exchange = Paytos.parseHostPortPath2(cs[0], cs.slice(1).join("/"), scheme);
        if (!opts.ignoreComponentError && !exchange) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: exchange
          });
        }
        return opFixedSuccess(createTalerAddExchange(exchange ?? cs[0]));
      }
      case TalerUriAction.WithdrawalTransferResult: {
        if (cs.length === 0) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const ref = params["ref"];
        const status = params["status"] !== "aborted" && params["status"] !== "success" ? void 0 : params["status"];
        return opFixedSuccess(createTalerWithdrawalTransferResult(ref, {
          status
        }));
      }
      case TalerUriAction.AddContact: {
        if (cs.length < 4) {
          return opKnownFailureWithBody(TalerUriParseError.COMPONENTS_LENGTH, {
            uriType
          });
        }
        const mailboxBaseUri = Paytos.parseHostPortPath2(cs[2], cs.slice(2, cs.length - 2).join("/"), scheme);
        if (!mailboxBaseUri) {
          return opKnownFailureWithBody(TalerUriParseError.INVALID_TARGET_PATH, {
            pos: 0,
            uriType,
            error: mailboxBaseUri
          });
        }
        const mailboxIdentity = cs[cs.length - 1];
        return opFixedSuccess(createTalerAddContact(cs[0], cs[1], mailboxBaseUri, mailboxIdentity, params["sourceBaseUrl"]));
      }
      default: {
        assertUnreachable(uriType);
      }
    }
  }
  TalerUris2.fromString = fromString;
})(TalerUris || (TalerUris = {}));
function parseWithdrawUriWithError(s6) {
  const pi = parseProtoInfoWithError(s6, "withdraw");
  if (pi.tag === "error") {
    return pi;
  }
  const c5 = pi.value.rest.split("?", 2);
  const path = c5[0];
  const q6 = new URLSearchParams2(c5[1] ?? "");
  const parts = path.split("/");
  if (parts.length < 2) {
    return Result.error(TalerErrorCode.WALLET_TALER_URI_MALFORMED);
  }
  const host = parts[0].toLowerCase();
  const pathSegments = parts.slice(1, parts.length - 1);
  const withdrawId = parts[parts.length - 1];
  const result = {
    type: TalerUriAction.Withdraw,
    bankIntegrationApiBaseUrl: Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.value.innerProto),
    withdrawalOperationId: withdrawId,
    externalConfirmation: q6.get("external-confirmation") == "1"
  };
  return Result.of(result);
}
function parseWithdrawUri(s6) {
  const r3 = parseWithdrawUriWithError(s6);
  if (r3.tag === "error")
    return void 0;
  return r3.value;
}
function parseAddExchangeUriWithError(s6) {
  const pi = parseProtoInfoWithError(s6, "add-exchange");
  if (pi.tag === "error") {
    return pi;
  }
  const parts = pi.value.rest.split("/");
  if (parts.length < 2) {
    return Result.error(TalerErrorCode.WALLET_TALER_URI_MALFORMED);
  }
  const host = parts[0].toLowerCase();
  const pathSegments = parts.slice(1, parts.length - 1);
  const result = {
    type: TalerUriAction.AddExchange,
    exchangeBaseUrl: Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.value.innerProto)
  };
  return Result.of(result);
}
function parseAddContactUriWithError(s6) {
  const pi = parseProtoInfoWithError(s6, "add-contact");
  if (pi.tag === "error") {
    return pi;
  }
  const parts = pi.value.rest.split("/");
  if (parts.length < 4) {
    return Result.error(TalerErrorCode.WALLET_TALER_URI_MALFORMED);
  }
  const mailboxBaseUri = parts[2];
  const pathSegments = parts.slice(3, parts.length - 2);
  const lastPart = parts[parts.length - 1];
  const q6 = new URLSearchParams2(lastPart ?? "");
  const mailboxIdentity = lastPart.split("?")[0];
  const sourceBaseUrl = q6.get("sourceBaseUrl") ?? "";
  const mailboxHostPort = Paytos.parseHostPortPath2(mailboxBaseUri, pathSegments.join("/"), pi.value.innerProto);
  const result = {
    type: TalerUriAction.AddContact,
    aliasType: parts[0],
    alias: parts[1],
    mailboxBaseUri: mailboxHostPort,
    mailboxIdentity,
    sourceBaseUrl
  };
  return Result.of(result);
}
function parseAddExchangeUri(s6) {
  const r3 = parseAddExchangeUriWithError(s6);
  if (r3.tag === "error")
    return void 0;
  return r3.value;
}
function parseAddContactUri(s6) {
  const r3 = parseAddContactUriWithError(s6);
  if (r3.tag === "error")
    return void 0;
  return r3.value;
}
var TalerUriAction;
(function(TalerUriAction2) {
  TalerUriAction2["Withdraw"] = "withdraw";
  TalerUriAction2["Pay"] = "pay";
  TalerUriAction2["Refund"] = "refund";
  TalerUriAction2["PayPush"] = "pay-push";
  TalerUriAction2["PayPull"] = "pay-pull";
  TalerUriAction2["PayTemplate"] = "pay-template";
  TalerUriAction2["Restore"] = "restore";
  TalerUriAction2["DevExperiment"] = "dev-experiment";
  TalerUriAction2["AddExchange"] = "add-exchange";
  TalerUriAction2["WithdrawExchange"] = "withdraw-exchange";
  TalerUriAction2["WithdrawalTransferResult"] = "withdrawal-transfer-result";
  TalerUriAction2["AddContact"] = "add-contact";
})(TalerUriAction || (TalerUriAction = {}));
function parseProtoInfo(s6, action) {
  const pfxPlain = `taler://${action}/`;
  const pfxHttp = `taler+http://${action}/`;
  if (s6.toLowerCase().startsWith(pfxPlain)) {
    return {
      innerProto: "https",
      rest: s6.substring(pfxPlain.length)
    };
  } else if (s6.toLowerCase().startsWith(pfxHttp)) {
    return {
      innerProto: "http",
      rest: s6.substring(pfxHttp.length)
    };
  } else {
    return void 0;
  }
}
function parseProtoInfoWithError(s6, action) {
  if (!s6.toLowerCase().startsWith("taler://") && !s6.toLowerCase().startsWith("taler+http://")) {
    return Result.error(TalerErrorCode.WALLET_TALER_URI_MALFORMED);
  }
  const pfxPlain = `taler://${action}/`;
  const pfxHttp = `taler+http://${action}/`;
  if (s6.toLowerCase().startsWith(pfxPlain)) {
    return Result.of({
      innerProto: "https",
      rest: s6.substring(pfxPlain.length)
    });
  } else if (s6.toLowerCase().startsWith(pfxHttp)) {
    return Result.of({
      innerProto: "http",
      rest: s6.substring(pfxHttp.length)
    });
  } else {
    return Result.error(TalerErrorCode.WALLET_TALER_URI_MALFORMED);
  }
}
var parsers = {
  [TalerUriAction.Pay]: parsePayUri,
  [TalerUriAction.PayPull]: parsePayPullUri,
  [TalerUriAction.PayPush]: parsePayPushUri,
  [TalerUriAction.PayTemplate]: parsePayTemplateUri,
  [TalerUriAction.Restore]: parseRestoreUri,
  [TalerUriAction.Refund]: parseRefundUri,
  [TalerUriAction.Withdraw]: parseWithdrawUri,
  [TalerUriAction.DevExperiment]: parseDevExperimentUri,
  [TalerUriAction.WithdrawExchange]: parseWithdrawExchangeUri,
  [TalerUriAction.AddExchange]: parseAddExchangeUri,
  [TalerUriAction.AddContact]: parseAddContactUri,
  [TalerUriAction.WithdrawalTransferResult]: () => {
    throw new Error("not supported");
  }
};
function parseTalerUri(string) {
  const https = string.startsWith("taler://");
  const http = string.startsWith("taler+http://");
  if (!https && !http)
    return void 0;
  const actionStart = https ? 8 : 13;
  const actionEnd = string.indexOf("/", actionStart + 1);
  const action = string.substring(actionStart, actionEnd);
  const found = Object.values(TalerUriAction).find((x6) => x6 === action);
  if (!found)
    return void 0;
  return parsers[found](string);
}
function stringifyTalerUri(uri) {
  switch (uri.type) {
    case TalerUriAction.DevExperiment: {
      return stringifyDevExperimentUri(uri);
    }
    case TalerUriAction.Pay: {
      return stringifyPayUri(uri);
    }
    case TalerUriAction.PayPull: {
      return stringifyPayPullUri(uri);
    }
    case TalerUriAction.PayPush: {
      return stringifyPayPushUri(uri);
    }
    case TalerUriAction.PayTemplate: {
      return stringifyPayTemplateUri(uri);
    }
    case TalerUriAction.Restore: {
      return stringifyRestoreUri(uri);
    }
    case TalerUriAction.Refund: {
      return stringifyRefundUri(uri);
    }
    case TalerUriAction.Withdraw: {
      return stringifyWithdrawUri(uri);
    }
    case TalerUriAction.WithdrawExchange: {
      return stringifyWithdrawExchange(uri);
    }
    case TalerUriAction.AddExchange: {
      return stringifyAddExchange(uri);
    }
    case TalerUriAction.AddContact: {
      return stringifyAddContact(uri);
    }
    case TalerUriAction.WithdrawalTransferResult: {
      throw Error("not supported");
    }
  }
}
function parsePayUri(s6) {
  const pi = parseProtoInfo(s6, "pay");
  if (!pi) {
    return void 0;
  }
  const c5 = pi?.rest.split("?");
  const q6 = new URLSearchParams2(c5[1] ?? "");
  const claimToken = q6.get("c") ?? void 0;
  const noncePriv = q6.get("n") ?? void 0;
  const parts = c5[0].split("/");
  if (parts.length < 3) {
    return void 0;
  }
  const host = parts[0].toLowerCase();
  const sessionId = parts[parts.length - 1];
  const orderId = parts[parts.length - 2];
  const pathSegments = parts.slice(1, parts.length - 2);
  const merchantBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  return {
    type: TalerUriAction.Pay,
    merchantBaseUrl,
    orderId,
    sessionId,
    claimToken,
    noncePriv
  };
}
function parsePayTemplateUri(uriString) {
  const pi = parseProtoInfo(uriString, TalerUriAction.PayTemplate);
  if (!pi) {
    return void 0;
  }
  const c5 = pi.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 2) {
    return void 0;
  }
  const q6 = new URLSearchParams2(c5[1] ?? "");
  const params = {};
  q6.forEach((v3, k6) => {
    params[k6] = v3;
  });
  const host = parts[0].toLowerCase();
  const templateId = parts[parts.length - 1];
  const pathSegments = parts.slice(1, parts.length - 1);
  const hostAndSegments = [host, ...pathSegments].join("/");
  const merchantBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  return {
    type: TalerUriAction.PayTemplate,
    merchantBaseUrl,
    templateId
  };
}
function parsePayPushUri(s6) {
  const pi = parseProtoInfo(s6, TalerUriAction.PayPush);
  if (!pi) {
    return void 0;
  }
  const c5 = pi?.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 2) {
    return void 0;
  }
  const host = parts[0].toLowerCase();
  const contractPriv = parts[parts.length - 1];
  const pathSegments = parts.slice(1, parts.length - 1);
  const hostAndSegments = [host, ...pathSegments].join("/");
  const exchangeBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  return {
    type: TalerUriAction.PayPush,
    exchangeBaseUrl,
    contractPriv
  };
}
function parsePayPullUri(s6) {
  const pi = parseProtoInfo(s6, TalerUriAction.PayPull);
  if (!pi) {
    return void 0;
  }
  const c5 = pi?.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 2) {
    return void 0;
  }
  const host = parts[0].toLowerCase();
  const contractPriv = parts[parts.length - 1];
  const pathSegments = parts.slice(1, parts.length - 1);
  const hostAndSegments = [host, ...pathSegments].join("/");
  const exchangeBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  return {
    type: TalerUriAction.PayPull,
    exchangeBaseUrl,
    contractPriv
  };
}
function parseWithdrawExchangeUri(s6) {
  const pi = parseProtoInfo(s6, "withdraw-exchange");
  if (!pi) {
    return void 0;
  }
  const c5 = pi?.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 1) {
    return void 0;
  }
  const host = parts[0].toLowerCase();
  const lastPathComponent = parts.length > 1 ? parts[parts.length - 1] : void 0;
  if (lastPathComponent) {
    return void 0;
  }
  const pathSegments = parts.slice(1, parts.length - 1);
  const hostAndSegments = [host, ...pathSegments].join("/");
  const exchangeBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  const q6 = new URLSearchParams2(c5[1] ?? "");
  const amount = q6.get("a") ?? void 0;
  return {
    type: TalerUriAction.WithdrawExchange,
    exchangeBaseUrl,
    amount
  };
}
function parseRefundUri(s6) {
  const pi = parseProtoInfo(s6, "refund");
  if (!pi) {
    return void 0;
  }
  const c5 = pi?.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 3) {
    return void 0;
  }
  const host = parts[0].toLowerCase();
  const sessionId = parts[parts.length - 1];
  const orderId = parts[parts.length - 2];
  const pathSegments = parts.slice(1, parts.length - 2);
  const hostAndSegments = [host, ...pathSegments].join("/");
  const merchantBaseUrl = Paytos.parseHostPortPath2(host, pathSegments.join("/"), pi.innerProto);
  return {
    type: TalerUriAction.Refund,
    merchantBaseUrl,
    orderId
  };
}
function parseDevExperimentUri(s6) {
  const pi = parseProtoInfo(s6, "dev-experiment");
  const c5 = pi?.rest.split("?");
  if (!c5) {
    return void 0;
  }
  const parts = c5[0].split("/");
  return {
    type: TalerUriAction.DevExperiment,
    devExperimentId: parts[0],
    query: new URLSearchParams2(c5[1] ?? "")
  };
}
function parseRestoreUri(uri) {
  const pi = parseProtoInfo(uri, "restore");
  if (!pi) {
    return void 0;
  }
  const c5 = pi.rest.split("?");
  const parts = c5[0].split("/");
  if (parts.length < 2) {
    return void 0;
  }
  const walletRootPriv = parts[0];
  if (!walletRootPriv)
    return void 0;
  const providers = new Array();
  parts[1].split(",").map((name) => {
    const url = decodeURIComponent(name);
    let isHttp = false;
    const withoutScheme = url.startsWith("https://") ? url.substring(8) : (isHttp = url.startsWith("http://")) ? url.substring(7) : url;
    const scheme = url === withoutScheme ? pi.innerProto : isHttp ? "http" : "https";
    const [hostname, path] = withoutScheme.split("/", 1);
    const host = Paytos.parseHostPortPath2(hostname, path ?? "/", scheme);
    providers.push(host);
  });
  return {
    type: TalerUriAction.Restore,
    walletRootPriv,
    providers
  };
}
function stringifyPayUri({ merchantBaseUrl, orderId, sessionId, claimToken, noncePriv }) {
  const { proto, path, query } = getUrlInfo(merchantBaseUrl, {
    c: claimToken,
    n: noncePriv
  });
  return `${proto}://pay/${path}${orderId}/${sessionId}${query}`;
}
function stringifyPayPullUri({ contractPriv, exchangeBaseUrl }) {
  const { proto, path } = getUrlInfo(exchangeBaseUrl);
  return `${proto}://pay-pull/${path}${contractPriv}`;
}
function stringifyPayPushUri({ contractPriv, exchangeBaseUrl }) {
  const { proto, path } = getUrlInfo(exchangeBaseUrl);
  return `${proto}://pay-push/${path}${contractPriv}`;
}
function stringifyRestoreUri({ providers, walletRootPriv }) {
  const list = providers.map((url) => `${encodeURIComponent(new URL2(url).href)}`).join(",");
  return `taler://restore/${walletRootPriv}/${list}`;
}
function stringifyWithdrawExchange({ exchangeBaseUrl, amount }) {
  const { proto, path, query } = getUrlInfo(exchangeBaseUrl, {
    a: amount
  });
  return `${proto}://withdraw-exchange/${path}${query}`;
}
function stringifyAddExchange({ exchangeBaseUrl }) {
  const { proto, path } = getUrlInfo(exchangeBaseUrl);
  return `${proto}://add-exchange/${path}`;
}
function stringifyAddContact({ alias, aliasType, mailboxBaseUri, mailboxIdentity, sourceBaseUrl }) {
  const { proto, path } = getUrlInfo(mailboxBaseUri);
  const baseUri = `${proto}://add-contact/${aliasType}/${alias}/${path}${mailboxIdentity}`;
  if (sourceBaseUrl) {
    return baseUri + `?sourceBaseUrl=${encodeURIComponent(sourceBaseUrl)}`;
  } else {
    return baseUri;
  }
}
function stringifyDevExperimentUri({ devExperimentId }) {
  return `taler://dev-experiment/${devExperimentId}`;
}
function stringifyPayTemplateUri({ merchantBaseUrl, templateId }) {
  const { proto, path, query } = getUrlInfo(merchantBaseUrl);
  return `${proto}://pay-template/${path}${templateId}${query}`;
}
function stringifyRefundUri({ merchantBaseUrl, orderId }) {
  const { proto, path } = getUrlInfo(merchantBaseUrl);
  return `${proto}://refund/${path}${orderId}/`;
}
function stringifyWithdrawUri({ bankIntegrationApiBaseUrl, withdrawalOperationId }) {
  const { proto, path } = getUrlInfo(bankIntegrationApiBaseUrl);
  return `${proto}://withdraw/${path}${withdrawalOperationId}`;
}
function getUrlInfo(baseUrl, params = {}) {
  const url = new URL2(baseUrl);
  let proto;
  if (url.protocol === "https:") {
    proto = "taler";
  } else if (url.protocol === "http:") {
    proto = "taler+http";
  } else {
    throw Error(`Unsupported URL protocol in ${baseUrl}`);
  }
  let path = url.hostname;
  if (url.port) {
    path = path + ":" + url.port;
  }
  if (url.pathname) {
    path = path + url.pathname;
  }
  if (!path.endsWith("/")) {
    path = path + "/";
  }
  const qp = new URLSearchParams2();
  let withParams = false;
  Object.entries(params).forEach(([name, value]) => {
    if (value !== void 0) {
      withParams = true;
      qp.append(name, value);
    }
  });
  const query = withParams ? "?" + qp.toString() : "";
  return { proto, path, query };
}
function encodeRFC3986URIComponent2(str) {
  return encodeURIComponent(str).replace(/[!'()*]/g, (c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`);
}
var rfc39862 = encodeRFC3986URIComponent2;
function createSearchParams2(paramList) {
  return paramList.map(([key, value]) => `${rfc39862(key)}=${rfc39862(value)}`).join("&");
}

// ../taler-util/lib/types-taler-corebank.js
var MonitorTimeframeParam;
(function(MonitorTimeframeParam2) {
  MonitorTimeframeParam2[MonitorTimeframeParam2["hour"] = 0] = "hour";
  MonitorTimeframeParam2[MonitorTimeframeParam2["day"] = 1] = "day";
  MonitorTimeframeParam2[MonitorTimeframeParam2["month"] = 2] = "month";
  MonitorTimeframeParam2[MonitorTimeframeParam2["year"] = 3] = "year";
  MonitorTimeframeParam2[MonitorTimeframeParam2["decade"] = 4] = "decade";
})(MonitorTimeframeParam || (MonitorTimeframeParam = {}));
var codecForIntegrationBankConfig = () => buildCodecForObject().property("name", codecForConstString("taler-bank-integration")).property("version", codecForString()).property("currency", codecForString()).property("currency_specification", codecForCurrencySpecificiation()).property("implementation", codecOptional(codecForString())).build("TalerCorebankApi.IntegrationConfig");
var codecForCoreBankConfig = () => buildCodecForObject().property("name", codecForEither(codecForConstString("taler-corebank"), codecForConstString("libeufin-bank"))).property("version", codecForString()).property("bank_name", codecOptional(codecForString())).property("base_url", codecOptional(codecForString())).property("allow_conversion", codecOptional(codecForBoolean())).property("allow_registrations", codecOptional(codecForBoolean())).property("allow_deletions", codecOptional(codecForBoolean())).property("allow_edit_name", codecOptional(codecForBoolean())).property("allow_edit_cashout_payto_uri", codecOptional(codecForBoolean())).property("default_debit_threshold", codecOptional(codecForAmountString())).property("currency", codecForString()).property("currency_specification", codecForCurrencySpecificiation()).property("supported_tan_channels", codecOptional(codecForList(codecForEither(codecForConstString(TanChannel.SMS), codecForConstString(TanChannel.EMAIL))))).property("wire_type", codecOptionalDefault(codecForString(), "iban")).property("wire_transfer_fees", codecOptional(codecForAmountString())).property("min_wire_transfer_amount", codecOptional(codecForAmountString())).property("max_wire_transfer_amount", codecOptional(codecForAmountString())).build("TalerCorebankApi.Config");
var codecForBalance = () => buildCodecForObject().property("amount", codecForAmountString()).property("credit_debit_indicator", codecForEither(codecForConstString("credit"), codecForConstString("debit"))).build("TalerCorebankApi.Balance");
var codecForPublicAccount = () => buildCodecForObject().property("username", codecForString()).property("balance", codecForBalance()).property("payto_uri", codecForPaytoString()).property("is_taler_exchange", codecForBoolean()).property("row_id", codecOptional(codecForNumber())).build("TalerCorebankApi.PublicAccount");
var codecForPublicAccountsResponse = () => buildCodecForObject().property("public_accounts", codecForList(codecForPublicAccount())).build("TalerCorebankApi.PublicAccountsResponse");
var codecForAccountMinimalData = () => buildCodecForObject().property("username", codecForString()).property("name", codecForString()).property("payto_uri", codecForPaytoString()).property("balance", codecForBalance()).property("row_id", codecForNumber()).property("debit_threshold", codecForAmountString()).property("is_public", codecForBoolean()).property("is_taler_exchange", codecForBoolean()).property("status", codecOptional(codecForEither(codecForConstString("active"), codecForConstString("locked"), codecForConstString("deleted")))).property("conversion_rate_class_id", codecOptional(codecForNumber())).property("conversion_rate", codecOptional(codecForConversionRate())).build("TalerCorebankApi.AccountMinimalData");
var codecForListBankAccountsResponse = () => buildCodecForObject().property("accounts", codecForList(codecForAccountMinimalData())).build("TalerCorebankApi.ListBankAccountsResponse");
var codecForAccountData = () => buildCodecForObject().property("name", codecForString()).property("balance", codecForBalance()).property("payto_uri", codecForPaytoString()).property("debit_threshold", codecForAmountString()).property("contact_data", codecOptional(codecForChallengeContactData())).property("cashout_payto_uri", codecOptional(codecForPaytoString())).property("is_public", codecForBoolean()).property("is_taler_exchange", codecForBoolean()).property("conversion_rate_class_id", codecOptional(codecForNumber())).property("tan_channel", codecOptional(codecForEither(codecForConstString(TanChannel.SMS), codecForConstString(TanChannel.EMAIL)))).property("status", codecOptional(codecForEither(codecForConstString("active"), codecForConstString("locked"), codecForConstString("deleted")))).build("TalerCorebankApi.AccountData");
var codecForConversionRateClassResponse = () => buildCodecForObject().property("conversion_rate_class_id", codecForNumber()).build("TalerCorebankApi.ConversionRateClassResponse");
var codecForConversionRateClass = () => buildCodecForObject().property("cashin_fee", codecOptional(codecForAmountString())).property("cashin_min_amount", codecOptional(codecForAmountString())).property("cashin_ratio", codecOptional(codecForDecimalNumber())).property("cashin_rounding_mode", codecOptional(codecForEither(codecForConstString("zero"), codecForConstString("up"), codecForConstString("nearest")))).property("cashout_fee", codecOptional(codecForAmountString())).property("cashout_min_amount", codecOptional(codecForAmountString())).property("cashout_ratio", codecOptional(codecForDecimalNumber())).property("cashout_rounding_mode", codecOptional(codecForEither(codecForConstString("zero"), codecForConstString("up"), codecForConstString("nearest")))).property("conversion_rate_class_id", codecForNumber()).property("description", codecOptional(codecForString())).property("name", codecForString()).property("num_users", codecForNumber()).build("TalerCorebankApi.ConversionRateClass");
var codecForConversionRateClasses = () => buildCodecForObject().property("classes", codecForList(codecForConversionRateClass())).build("TalerCorebankApi.ConversionRateClasses");
var codecForChallengeContactData = () => buildCodecForObject().property("email", codecOptional(codecForString())).property("phone", codecOptional(codecForString())).build("TalerCorebankApi.ChallengeContactData");
var codecForWithdrawalPublicInfo = () => buildCodecForObject().property("status", codecForEither(codecForConstString("pending"), codecForConstString("selected"), codecForConstString("aborted"), codecForConstString("confirmed"))).property("amount", codecOptional(codecForAmountString())).property("suggested_amount", codecOptional(codecForAmountString())).property("username", codecForString()).property("selected_reserve_pub", codecOptional(codecForString())).property("selected_exchange_account", codecOptional(codecForPaytoString())).property("no_amount_to_wallet", codecOptional(codecForBoolean())).build("TalerCorebankApi.WithdrawalPublicInfo");
var codecForBankAccountTransactionsResponse = () => buildCodecForObject().property("transactions", codecForList(codecForBankAccountTransactionInfo())).build("TalerCorebankApi.BankAccountTransactionsResponse");
var codecForBankAccountTransactionInfo = () => buildCodecForObject().property("creditor_payto_uri", codecForPaytoString()).property("debtor_payto_uri", codecForPaytoString()).property("amount", codecForAmountString()).property("direction", codecForEither(codecForConstString("debit"), codecForConstString("credit"))).property("subject", codecForString()).property("row_id", codecForNumber()).property("date", codecForTimestamp).build("TalerCorebankApi.BankAccountTransactionInfo");
var codecForCreateTransactionResponse = () => buildCodecForObject().property("row_id", codecForNumber()).build("TalerCorebankApi.CreateTransactionResponse");
var codecForRegisterAccountResponse = () => buildCodecForObject().property("internal_payto_uri", codecForPaytoString()).build("TalerCorebankApi.RegisterAccountResponse");
var codecForBankAccountCreateWithdrawalResponse = () => buildCodecForObject().property("taler_withdraw_uri", codecForTalerUriString()).property("withdrawal_id", codecForString()).build("TalerCorebankApi.BankAccountCreateWithdrawalResponse");
var codecForCashoutPending = () => buildCodecForObject().property("cashout_id", codecForNumber()).build("TalerCorebankApi.CashoutPending");
var codecForCashouts = () => buildCodecForObject().property("cashouts", codecForList(codecForCashoutInfo())).build("TalerCorebankApi.Cashouts");
var codecForCashoutInfo = () => buildCodecForObject().property("cashout_id", codecForNumber()).build("TalerCorebankApi.CashoutInfo");
var codecForGlobalCashouts = () => buildCodecForObject().property("cashouts", codecForList(codecForGlobalCashoutInfo())).build("TalerCorebankApi.GlobalCashouts");
var codecForGlobalCashoutInfo = () => buildCodecForObject().property("cashout_id", codecForNumber()).property("username", codecForString()).build("TalerCorebankApi.GlobalCashoutInfo");
var codecForCashoutStatusResponse = () => buildCodecForObject().property("amount_debit", codecForAmountString()).property("amount_credit", codecForAmountString()).property("subject", codecForString()).property("creation_time", codecForTimestamp).build("TalerCorebankApi.CashoutStatusResponse");
var codecForMonitorResponse = () => buildCodecForUnion().discriminateOn("type").alternative("no-conversions", codecForMonitorNoConversion()).alternative("with-conversions", codecForMonitorWithCashout()).build("TalerWireGatewayApi.IncomingBankTransaction");
var codecForMonitorNoConversion = () => buildCodecForObject().property("type", codecForConstString("no-conversions")).property("talerInCount", codecForNumber()).property("talerInVolume", codecForAmountString()).property("talerOutCount", codecForNumber()).property("talerOutVolume", codecForAmountString()).build("TalerCorebankApi.MonitorJustPayouts");
var codecForMonitorWithCashout = () => buildCodecForObject().property("type", codecForConstString("with-conversions")).property("cashinCount", codecForNumber()).property("cashinFiatVolume", codecForAmountString()).property("cashinRegionalVolume", codecForAmountString()).property("cashoutCount", codecForNumber()).property("cashoutFiatVolume", codecForAmountString()).property("cashoutRegionalVolume", codecForAmountString()).property("talerInCount", codecForNumber()).property("talerInVolume", codecForAmountString()).property("talerOutCount", codecForNumber()).property("talerOutVolume", codecForAmountString()).build("TalerCorebankApi.MonitorWithCashout");

// ../taler-util/lib/http-client/bank-core.js
var TalerCoreBankCacheEviction;
(function(TalerCoreBankCacheEviction2) {
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["DELETE_ACCOUNT"] = 0] = "DELETE_ACCOUNT";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CREATE_ACCOUNT"] = 1] = "CREATE_ACCOUNT";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["UPDATE_ACCOUNT"] = 2] = "UPDATE_ACCOUNT";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["UPDATE_PASSWORD"] = 3] = "UPDATE_PASSWORD";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CREATE_TRANSACTION"] = 4] = "CREATE_TRANSACTION";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CONFIRM_WITHDRAWAL"] = 5] = "CONFIRM_WITHDRAWAL";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["ABORT_WITHDRAWAL"] = 6] = "ABORT_WITHDRAWAL";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CREATE_WITHDRAWAL"] = 7] = "CREATE_WITHDRAWAL";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CREATE_CASHOUT"] = 8] = "CREATE_CASHOUT";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["CREATE_CONVERSION_RATE_CLASS"] = 9] = "CREATE_CONVERSION_RATE_CLASS";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["UPDATE_CONVERSION_RATE_CLASS"] = 10] = "UPDATE_CONVERSION_RATE_CLASS";
  TalerCoreBankCacheEviction2[TalerCoreBankCacheEviction2["DELETE_CONVERSION_RATE_CLASS"] = 11] = "DELETE_CONVERSION_RATE_CLASS";
})(TalerCoreBankCacheEviction || (TalerCoreBankCacheEviction = {}));
var TalerCoreBankHttpClient = class _TalerCoreBankHttpClient {
  constructor(baseUrl, httpClient, cacheEvictor) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
    this.cacheEvictor = cacheEvictor ?? nullEvictor;
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   *
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-token
   */
  async createAccessToken(username, cred, body, params = {}) {
    const url = new URL(`accounts/${username}/token`, this.baseUrl);
    const headers = {};
    switch (cred.type) {
      case "basic": {
        headers.Authorization = makeBasicAuthHeader2(username, cred.password);
        break;
      }
      case "bearer": {
        headers.Authorization = makeBearerTokenAuthHeader(cred.accessToken);
        break;
      }
      default: {
        assertUnreachable(cred);
      }
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTokenSuccessResponse());
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.GENERIC_FORBIDDEN:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_ACCOUNT_LOCKED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * @deprecated use createAccessToken
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-token
   */
  async createAccessTokenBasic(username, password, body) {
    return this.createAccessToken(username, { type: "basic", password }, body);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#delete--accounts-$USERNAME-token
   */
  async deleteAccessToken(user, token) {
    const url = new URL(`accounts/${user}/token`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opEmptySuccess();
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-tokens
   *
   */
  async getAccessTokenList(user, pagination) {
    const url = new URL(`accounts/${user}/token`, this.baseUrl);
    addPaginationParams(url, pagination);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTokenInfoList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ public_accounts: [] });
      case HttpStatusCode.NotFound:
        return opFixedSuccess({ public_accounts: [] });
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#config
   *
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-corebank", _TalerCoreBankHttpClient.PROTOCOL_VERSION, resp, codecForCoreBankConfig());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // ACCOUNTS
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts
   *
   */
  async createAccount(auth, body) {
    const url = new URL(`accounts`, this.baseUrl);
    const headers = {};
    if (auth) {
      headers.Authorization = makeBearerTokenAuthHeader(auth);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CREATE_ACCOUNT);
        return opSuccessFromHttp(resp, codecForRegisterAccountResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_REGISTER_USERNAME_REUSE:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_REGISTER_PAYTO_URI_REUSE:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNALLOWED_DEBIT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_RESERVED_USERNAME_CONFLICT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_SET_CONVERSION_RATE_CLASS:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_SET_TAN_CHANNEL:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_TAN_CHANNEL_NOT_SUPPORTED:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_MISSING_TAN_INFO:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_SHORT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_LONG:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_CONVERSION_RATE_CLASS_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#delete--accounts-$USERNAME
   *
   */
  async deleteAccount(auth, params = {}) {
    const url = new URL(`accounts/${auth.username}`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.DELETE_ACCOUNT);
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_RESERVED_USERNAME_CONFLICT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_ACCOUNT_BALANCE_NOT_ZERO:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#patch--accounts-$USERNAME
   *
   */
  async updateAccount(auth, body, params = {}) {
    const url = new URL(`accounts/${auth.username}`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NoContent:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.UPDATE_ACCOUNT);
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_NON_ADMIN_PATCH_LEGAL_NAME:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_PATCH_CASHOUT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_NON_ADMIN_SET_CONVERSION_RATE_CLASS:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_TAN_CHANNEL_NOT_SUPPORTED:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_MISSING_TAN_INFO:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_SHORT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_LONG:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_CONVERSION_RATE_CLASS_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#patch--accounts-$USERNAME-auth
   *
   */
  async updatePassword(auth, body, params = {}) {
    const url = new URL(`accounts/${auth.username}/auth`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_NON_ADMIN_PATCH_MISSING_OLD_PASSWORD:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PATCH_BAD_OLD_PASSWORD:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_SHORT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_PASSWORD_TOO_LONG:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--public-accounts
   *
   */
  async getPublicAccounts(filter = {}, pagination) {
    const url = new URL(`public-accounts`, this.baseUrl);
    addPaginationParams(url, pagination);
    if (filter.account !== void 0) {
      url.searchParams.set("filter_name", filter.account);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForPublicAccountsResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ public_accounts: [] });
      case HttpStatusCode.NotFound:
        return opFixedSuccess({ public_accounts: [] });
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts
   *
   */
  async listAccounts(auth, params) {
    const url = new URL(`accounts`, this.baseUrl);
    addPaginationParams(url, params);
    if (params?.account !== void 0) {
      url.searchParams.set("filter_name", params.account);
    }
    if (params?.conversionRateId !== void 0) {
      url.searchParams.set("conversion_rate_class_id", String(params.conversionRateId));
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForListBankAccountsResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ accounts: [] });
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME
   *
   */
  async getAccount(auth) {
    const url = new URL(`accounts/${auth.username}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAccountData());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // TRANSACTIONS
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-transactions
   *
   */
  async getTransactions(auth, params) {
    const url = new URL(`accounts/${auth.username}/transactions`, this.baseUrl);
    addPaginationParams(url, params);
    addLongPollingParam(url, params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankAccountTransactionsResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ transactions: [] });
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-transactions-$TRANSACTION_ID
   *
   */
  async getTransactionById(auth, txid) {
    const url = new URL(`accounts/${auth.username}/transactions/${String(txid)}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankAccountTransactionInfo());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-transactions
   *
   */
  async createTransaction(auth, body, params = {}) {
    const url = new URL(`accounts/${auth.username}/transactions`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CREATE_TRANSACTION);
        return opSuccessFromHttp(resp, codecForCreateTransactionResponse());
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_ADMIN_CREDITOR:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_SAME_ACCOUNT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNKNOWN_CREDITOR:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNALLOWED_DEBIT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // WITHDRAWALS
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-withdrawals
   *
   */
  async createWithdrawal(auth, body) {
    const url = new URL(`accounts/${auth.username}/withdrawals`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      },
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CREATE_WITHDRAWAL);
        return opSuccessFromHttp(resp, codecForBankAccountCreateWithdrawalResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-withdrawals-$WITHDRAWAL_ID-confirm
   *
   */
  async confirmWithdrawalById(auth, body, wid, params = {}) {
    const url = new URL(`accounts/${auth.username}/withdrawals/${wid}/confirm`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NoContent:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CONFIRM_WITHDRAWAL);
        return opEmptySuccess();
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_CONFIRM_ABORT_CONFLICT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_CONFIRM_INCOMPLETE:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNALLOWED_DEBIT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_AMOUNT_DIFFERS:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_AMOUNT_REQUIRED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-withdrawals-$WITHDRAWAL_ID-abort
   *
   */
  async abortWithdrawalById(auth, wid) {
    const url = new URL(`accounts/${auth.username}/withdrawals/${wid}/abort`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.ABORT_WITHDRAWAL);
        return opEmptySuccess();
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--withdrawals-$WITHDRAWAL_ID
   *
   */
  async getWithdrawalById(wid, params) {
    const url = new URL(`withdrawals/${wid}`, this.baseUrl);
    addLongPollingParam(url, params);
    if (params) {
      url.searchParams.set("old_state", !params.old_state ? "pending" : params.old_state);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForWithdrawalPublicInfo());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // CASHOUTS
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-cashouts
   *
   */
  async createCashout(auth, body, params = {}) {
    const url = new URL(`accounts/${auth.username}/cashouts`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBearerTokenAuthHeader(auth.token);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CREATE_CASHOUT);
        return opSuccessFromHttp(resp, codecForCashoutPending());
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details2 = await readTalerErrorResponse(resp);
        switch (details2.code) {
          case TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED:
            return opKnownTalerFailure(details2.code, details2);
          case TalerErrorCode.BANK_BAD_CONVERSION:
            return opKnownTalerFailure(details2.code, details2);
          case TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL:
            return opKnownTalerFailure(details2.code, details2);
          case TalerErrorCode.BANK_UNALLOWED_DEBIT:
            return opKnownTalerFailure(details2.code, details2);
          case TalerErrorCode.BANK_CONFIRM_INCOMPLETE:
            return opKnownTalerFailure(details2.code, details2);
          default:
            return opUnknownHttpFailure(resp, details2);
        }
      }
      case HttpStatusCode.BadGateway: {
        const details2 = await readTalerErrorResponse(resp);
        switch (details2.code) {
          case TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED:
            return opKnownTalerFailure(details2.code, details2);
          default:
            return opUnknownHttpFailure(resp, details2);
        }
      }
      case HttpStatusCode.NotImplemented:
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_TAN_CHANNEL_NOT_SUPPORTED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opKnownHttpFailure(resp.status, resp);
        }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-cashouts-$CASHOUT_ID
   *
   */
  async getCashoutById(auth, cid) {
    const url = new URL(`accounts/${auth.username}/cashouts/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCashoutStatusResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-cashouts
   *
   */
  async getAccountCashouts(auth, pagination) {
    const url = new URL(`accounts/${auth.username}/cashouts`, this.baseUrl);
    addPaginationParams(url, pagination);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth.token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCashouts());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ cashouts: [] });
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--cashouts
   *
   */
  async getGlobalCashouts(auth, pagination) {
    const url = new URL(`cashouts`, this.baseUrl);
    addPaginationParams(url, pagination);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForGlobalCashouts());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ cashouts: [] });
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // CONVERSION RATE CLASS
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#post--conversion-rate-classes
   *
   */
  async createConversionRateClass(auth, body) {
    const url = new URL(`conversion-rate-classes`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      },
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.CREATE_CONVERSION_RATE_CLASS);
        return opSuccessFromHttp(resp, codecForConversionRateClassResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_NAME_REUSE:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#patch--conversion-rate-classes-CLASS_ID
   *
   */
  async updateConversionRateClass(auth, cid, body) {
    const url = new URL(`conversion-rate-classes/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      },
      body
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.UPDATE_CONVERSION_RATE_CLASS);
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_NAME_REUSE:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--accounts-$USERNAME-cashouts
   *
   */
  async deleteConversionRateClass(auth, cid) {
    const url = new URL(`conversion-rate-classes/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        await this.cacheEvictor.notifySuccess(TalerCoreBankCacheEviction.DELETE_CONVERSION_RATE_CLASS);
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--conversion-rate-classes-CLASS_ID
   *
   */
  async getConversionRateClass(auth, cid) {
    const url = new URL(`conversion-rate-classes/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForConversionRateClass());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#get--conversion-rate-classes
   *
   */
  async listConversionRateClasses(auth, params = {}) {
    const url = new URL(`conversion-rate-classes`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.className) {
      url.searchParams.set("filter_name", params.className);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForConversionRateClasses());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ classes: [], default: {} });
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotImplemented:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // 2FA
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#post--accounts-$USERNAME-challenge-$CHALLENGE_ID
   *
   */
  async sendChallenge(username, cid) {
    const url = new URL(`accounts/${username}/challenge/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengeRequestResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({});
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.TooManyRequests:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-challenge-$CHALLENGE_ID-confirm
   *
   */
  async confirmChallenge(username, cid, body) {
    const url = new URL(`accounts/${username}/challenge/${cid}/confirm`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_TAN_CHALLENGE_FAILED:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_TAN_CHALLENGE_EXPIRED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.NotFound: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.BANK_TRANSACTION_NOT_FOUND:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_TAN_CHALLENGE_EXPIRED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.TooManyRequests: {
        return opKnownHttpFailure(resp.status, resp);
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // MONITOR
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#get--monitor
   *
   */
  async getMonitor(auth, params = {}) {
    const url = new URL(`monitor`, this.baseUrl);
    if (params.timeframe) {
      url.searchParams.set("timeframe", MonitorTimeframeParam[params.timeframe]);
    }
    if (params.date) {
      const { t_s: seconds } = AbsoluteTime.toProtocolTimestamp(params.date);
      if (seconds !== "never") {
        url.searchParams.set("date_s", String(seconds));
      }
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForMonitorResponse());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Others API
  //
  /**
   * https://docs.taler.net/core/api-corebank.html#taler-bank-integration-api
   *
   */
  getIntegrationAPI() {
    return new URL(`taler-integration/`, this.baseUrl);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#taler-bank-integration-api
   *
   */
  getWireGatewayAPI(username) {
    return new URL(`accounts/${username}/taler-wire-gateway/`, this.baseUrl);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#taler-bank-integration-api
   *
   */
  getRevenueAPI(username) {
    return new URL(`accounts/${username}/taler-revenue/`, this.baseUrl);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#any--accounts-$USERNAME-conversion-info-*
   *
   */
  getConversionInfoAPIForUser(username) {
    return new URL(`accounts/${username}/conversion-info/`, this.baseUrl);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#any--conversion-rate-classes-$CLASS_ID-conversion-info-*
   *
   */
  getConversionInfoAPIForClass(classId) {
    return new URL(`conversion-rate-classes/${String(classId)}/conversion-info/`, this.baseUrl);
  }
  /**
   * https://docs.taler.net/core/api-corebank.html#any--conversion-info-*
   *
   */
  getConversionInfoAPI() {
    return new URL(`conversion-info/`, this.baseUrl);
  }
};
TalerCoreBankHttpClient.PROTOCOL_VERSION = "10:0:2";

// ../taler-util/lib/types-taler-bank-integration.js
var codecForBankWithdrawalOperationStatus = () => buildCodecForObject().property("status", codecForEither(codecForConstString("pending"), codecForConstString("selected"), codecForConstString("aborted"), codecForConstString("confirmed"))).property("currency", codecOptional(codecForCurrencyName())).property("amount", codecOptional(codecForAmountString())).property("suggested_amount", codecOptional(codecForAmountString())).property("min_amount", codecOptional(codecForAmountString())).property("max_amount", codecOptional(codecForAmountString())).property("card_fees", codecOptional(codecForAmountString())).property("sender_wire", codecOptional(codecForPaytoString())).property("suggested_exchange", codecOptional(codecForURLString())).property("required_exchange", codecOptional(codecForURLString())).property("confirm_transfer_url", codecOptional(codecForURLString())).property("wire_types", codecForList(codecForString())).property("selected_reserve_pub", codecOptional(codecForString())).property("selected_exchange_account", codecOptional(codecForString())).property("no_amount_to_wallet", codecOptional(codecForBoolean())).deprecatedProperty("aborted").deprecatedProperty("selection_done").deprecatedProperty("transfer_done").build("TalerBankIntegrationApi.BankWithdrawalOperationStatus");
var codecForBankWithdrawalOperationPostResponse = () => buildCodecForObject().property("status", codecForEither(codecForConstString("selected"), codecForConstString("aborted"), codecForConstString("confirmed"))).property("confirm_transfer_url", codecOptional(codecForURLString())).deprecatedProperty("transfer_done").build("TalerBankIntegrationApi.BankWithdrawalOperationPostResponse");

// ../taler-util/lib/http-client/bank-integration.js
var logger6 = new Logger("bank-integration.ts");
var TalerBankIntegrationHttpClient = class _TalerBankIntegrationHttpClient {
  constructor(baseUrl, httpClient) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-bank-integration.html#get--config
   *
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-bank-integration", _TalerBankIntegrationHttpClient.PROTOCOL_VERSION, resp, codecForIntegrationBankConfig());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-integration.html#get--withdrawal-operation-$WITHDRAWAL_ID
   *
   */
  async getWithdrawalOperationById(woid, params) {
    const url = new URL(`withdrawal-operation/${woid}`, this.baseUrl);
    addLongPollingParam(url, params);
    if (params) {
      url.searchParams.set("old_state", !params.old_state ? "pending" : params.old_state);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankWithdrawalOperationStatus());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * FIXME: This is a misnomer!
   *
   * https://docs.taler.net/core/api-bank-integration.html#post-$BANK_API_BASE_URL-withdrawal-operation-$wopid
   */
  async completeWithdrawalOperationById(woid, body) {
    const url = new URL(`withdrawal-operation/${woid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankWithdrawalOperationPostResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict: {
        const body2 = await readTalerErrorResponse(resp);
        const details = codecForTalerErrorDetail().decode(body2);
        switch (details.code) {
          case TalerErrorCode.BANK_UPDATE_ABORT_CONFLICT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_WITHDRAWAL_OPERATION_RESERVE_SELECTION_CONFLICT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_DUPLICATE_RESERVE_PUB_SUBJECT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNKNOWN_ACCOUNT:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_ACCOUNT_IS_NOT_EXCHANGE:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_AMOUNT_DIFFERS:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.BANK_UNALLOWED_DEBIT:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-integration.html#post-$BANK_API_BASE_URL-withdrawal-operation-$wopid
   *
   */
  async abortWithdrawalOperationById(woid) {
    const url = new URL(`withdrawal-operation/${woid}/abort`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST"
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerBankIntegrationHttpClient.PROTOCOL_VERSION = "5:0:0";

// ../taler-util/lib/types-taler-revenue.js
var codecForRevenueConfig = () => buildCodecForObject().property("name", codecForConstString("taler-revenue")).property("version", codecForString()).property("currency", codecForString()).property("implementation", codecOptional(codecForString())).build("TalerRevenueApi.RevenueConfig");
var codecForRevenueIncomingHistory = () => buildCodecForObject().property("credit_account", codecForPaytoString()).property("incoming_transactions", codecForList(codecForRevenueIncomingBankTransaction())).build("TalerRevenueApi.MerchantIncomingHistory");
var codecForRevenueIncomingBankTransaction = () => buildCodecForObject().property("row_id", codecForNumber()).property("date", codecForTimestamp).property("amount", codecForAmountString()).property("debit_account", codecForPaytoString()).property("subject", codecForString()).build("TalerRevenueApi.RevenueIncomingBankTransaction");

// ../taler-util/lib/http-client/bank-revenue.js
var TalerRevenueHttpClient = class _TalerRevenueHttpClient {
  constructor(baseUrl, httpClient) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-bank-revenue.html#get--config
   *
   */
  async getConfig(auth) {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: createAuthorizationHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-revenue", _TalerRevenueHttpClient.PROTOCOL_VERSION, resp, codecForRevenueConfig());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-revenue.html#get--history
   *
   * @returns
   */
  async getHistory(auth, params) {
    const url = new URL(`history`, this.baseUrl);
    addPaginationParams(url, params);
    addLongPollingParam(url, params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: createAuthorizationHeader(auth)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForRevenueIncomingHistory());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          incoming_transactions: [],
          credit_account: ""
        });
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerRevenueHttpClient.PROTOCOL_VERSION = "1:0:0";

// ../taler-util/lib/types-taler-wire-gateway.js
var codecForWireConfigResponse = () => buildCodecForObject().property("currency", codecForString()).property("implementation", codecForString()).property("name", codecForConstString("taler-wire-gateway")).property("support_account_check", codecForBoolean()).property("version", codecForString()).build("TalerWireGatewayApi.WireConfig");
var codecForTransferResponse = () => buildCodecForObject().property("row_id", codecForNumber()).property("timestamp", codecForTimestamp).build("TalerWireGatewayApi.TransferResponse");
var codecForIncomingHistory = () => buildCodecForObject().property("credit_account", codecForPaytoString()).property("incoming_transactions", codecForList(codecForIncomingBankTransaction())).build("TalerWireGatewayApi.IncomingHistory");
var codecForIncomingBankTransaction = () => buildCodecForUnion().discriminateOn("type").alternative("RESERVE", codecForIncomingReserveTransaction()).alternative("KYCAUTH", codecForIncomingKycAuthTransaction()).alternative("WAD", codecForIncomingWadTransaction()).build("TalerWireGatewayApi.IncomingBankTransaction");
var codecForIncomingReserveTransaction = () => buildCodecForObject().property("amount", codecForAmountString()).property("date", codecForTimestamp).property("debit_account", codecForPaytoString()).property("reserve_pub", codecForEddsaPublicKey()).property("row_id", codecForNumber()).property("type", codecForConstString("RESERVE")).build("TalerWireGatewayApi.IncomingReserveTransaction");
var codecForIncomingKycAuthTransaction = () => buildCodecForObject().property("amount", codecForAmountString()).property("date", codecForTimestamp).property("debit_account", codecForPaytoString()).property("account_pub", codecForEddsaPublicKey()).property("row_id", codecForNumber()).property("type", codecForConstString("KYCAUTH")).build("TalerWireGatewayApi.IncomingKycAuthTransaction");
var codecForIncomingWadTransaction = () => buildCodecForObject().property("amount", codecForAmountString()).property("date", codecForTimestamp).property("debit_account", codecForPaytoString()).property("origin_exchange_url", codecForString()).property("row_id", codecForNumber()).property("type", codecForConstString("WAD")).property("wad_id", codecForString()).build("TalerWireGatewayApi.IncomingWadTransaction");
var codecForOutgoingHistory = () => buildCodecForObject().property("debit_account", codecForPaytoString()).property("outgoing_transactions", codecForList(codecForOutgoingBankTransaction())).build("TalerWireGatewayApi.OutgoingHistory");
var codecForOutgoingBankTransaction = () => buildCodecForObject().property("row_id", codecForNumber()).property("date", codecForTimestamp).property("amount", codecForAmountString()).property("credit_account", codecForPaytoString()).property("wtid", codecForString()).property("exchange_base_url", codecForString()).build("TalerWireGatewayApi.OutgoingBankTransaction");
var codecForAddIncomingResponse = () => buildCodecForObject().property("row_id", codecForNumber()).property("timestamp", codecForTimestamp).build("TalerWireGatewayApi.AddIncomingResponse");
var codecForBankWireTransferList = () => buildCodecForObject().property("debit_account", codecForPaytoString()).property("transfers", codecForList(codecForBankWireTransferListStatus())).build("TalerWireGatewayApi.BankWireTransferList");
var codecForBankWireTransferListStatus = () => buildCodecForObject().property("row_id", codecForNumber()).property("status", codecForEither(codecForConstString("pending"), codecForConstString("transient_failure"), codecForConstString("permanent_failure"), codecForConstString("success"))).property("amount", codecForAmountString()).property("credit_account", codecForPaytoString()).property("timestamp", codecForTimestamp).build("TalerWireGatewayApi.BankWireTransferListStatus");

// ../taler-util/lib/http-client/bank-wire.js
var TalerWireGatewayHttpClient = class _TalerWireGatewayHttpClient {
  constructor(baseUrl, options = {}) {
    this.baseUrl = baseUrl;
    this.httpLib = options.httpClient ?? createPlatformHttpLib();
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#get--config
   *
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-wire-gateway", _TalerWireGatewayHttpClient.PROTOCOL_VERSION, resp, codecForWireConfigResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#post--transfer
   *
   */
  async makeWireTransfer(req) {
    const url = new URL(`transfer`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      },
      body: req.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTransferResponse());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#get--transfers
   *
   */
  async getTransfers(req) {
    const url = new URL(`transfers`, this.baseUrl);
    if (req.params) {
      if (req.params.status) {
        url.searchParams.set("status", req.params.status);
      }
    }
    addPaginationParams(url, req.params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankWireTransferList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          transfers: [],
          debit_account: void 0
        });
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#get--transfers-$ROW_ID
   *
   */
  async getTransferStatus(req) {
    const url = new URL(`transfers/${req.rowId}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankWireTransferList());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#get--history-incoming
   *
   */
  async getHistoryIncoming(req) {
    const url = new URL(`history/incoming`, this.baseUrl);
    addPaginationParams(url, req.params);
    addLongPollingParam(url, req.params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForIncomingHistory());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          incoming_transactions: [],
          credit_account: void 0
        });
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#get--history-outgoing
   *
   */
  async getHistoryOutgoing(req) {
    const url = new URL(`history/outgoing`, this.baseUrl);
    addPaginationParams(url, req.params);
    addLongPollingParam(url, req.params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForOutgoingHistory());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          outgoing_transactions: [],
          debit_account: void 0
        });
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#post--admin-add-incoming
   *
   */
  async addIncoming(req) {
    const url = new URL(`admin/add-incoming`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      },
      body: req.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAddIncomingResponse());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-bank-wire.html#post--admin-add-kycauth
   *
   */
  async addKycAuth(req) {
    const url = new URL(`admin/add-kycauth`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        Authorization: makeBasicAuthHeader(req.auth.username, req.auth.password)
      },
      body: req.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAddIncomingResponse());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerWireGatewayHttpClient.PROTOCOL_VERSION = "4:0:0";

// ../taler-util/lib/types-taler-challenger.js
var codecForChallengerTermsOfServiceResponse = () => buildCodecForObject().property("name", codecForConstString("challenger")).property("version", codecForString()).property("implementation", codecOptional(codecForString())).property("restrictions", codecOptional(codecForMap(codecForAny()))).property("address_type", codecForEither(codecForConstString("phone"), codecForConstString("email"), codecForConstString("postal"), codecForConstString("postal-ch"))).build("ChallengerApi.ChallengerTermsOfServiceResponse");
var codecForChallengeSetupResponse = () => buildCodecForObject().property("nonce", codecForString()).build("ChallengerApi.ChallengeSetupResponse");
var codecForChallengeStatus = () => buildCodecForObject().property("fix_address", codecForBoolean()).property("solved", codecForBoolean()).property("last_address", codecOptional(codecForMap(codecForAny()))).property("changes_left", codecForNumber()).property("retransmission_time", codecForTimestamp).property("pin_transmissions_left", codecForNumber()).property("auth_attempts_left", codecForNumber()).build("ChallengerApi.ChallengeStatus");
var codecForChallengeResponse2 = () => buildCodecForUnion().discriminateOn("type").alternative("completed", codecForChallengeRedirect()).alternative("created", codecForChallengeCreateResponse()).build("ChallengerApi.ChallengeResponse");
var codecForChallengeCreateResponse = () => buildCodecForObject().property("attempts_left", codecForNumber()).property("type", codecForConstString("created")).property("nonce", codecOptional(codecForString())).property("address", codecForAny()).property("transmitted", codecForBoolean()).property("retransmission_time", codecForTimestamp).build("ChallengerApi.ChallengeCreateResponse");
var codecForChallengeRedirect = () => buildCodecForObject().property("type", codecForConstString("completed")).property("redirect_url", codecForString()).build("ChallengerApi.ChallengeRedirect");
var codecForChallengeInvalidPinResponse = () => buildCodecForObject().property("ec", codecOptional(codecForNumber())).property("code", codecOptional(codecForNumber())).property("hint", codecForAny()).property("type", codecForConstString("pending")).property("addresses_left", codecForNumber()).property("pin_transmissions_left", codecForNumber()).property("auth_attempts_left", codecForNumber()).property("exhausted", codecForBoolean()).property("no_challenge", codecForBoolean()).build("ChallengerApi.InvalidPinResponse");
var codecForChallengeSolveResponse = () => buildCodecForUnion().discriminateOn("type").alternative("completed", codecForChallengeRedirect()).alternative("pending", codecForChallengeInvalidPinResponse()).build("ChallengerApi.ChallengeSolveResponse");
var codecForChallengerAuthResponse = () => buildCodecForObject().property("access_token", codecForString()).property("token_type", codecForAny()).property("expires_in", codecForNumber()).build("ChallengerApi.ChallengerAuthResponse");
var codecForChallengerInfoResponse = () => buildCodecForObject().property("id", codecForNumber()).property("address", codecForAny()).property("address_type", codecForString()).property("expires", codecForTimestamp).build("ChallengerApi.ChallengerInfoResponse");

// ../taler-util/lib/http-client/challenger.js
var ChallengerCacheEviction;
(function(ChallengerCacheEviction2) {
  ChallengerCacheEviction2[ChallengerCacheEviction2["CREATE_CHALLENGE"] = 0] = "CREATE_CHALLENGE";
  ChallengerCacheEviction2[ChallengerCacheEviction2["SOLVE_CHALLENGE"] = 1] = "SOLVE_CHALLENGE";
})(ChallengerCacheEviction || (ChallengerCacheEviction = {}));
var ChallengerHttpClient = class _ChallengerHttpClient {
  constructor(baseUrl, httpClient, cacheEvictor) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
    this.cacheEvictor = cacheEvictor ?? nullEvictor;
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(this.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-challenger.html#get--config
   *
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("challenger", _ChallengerHttpClient.PROTOCOL_VERSION, resp, codecForChallengerTermsOfServiceResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-challenger.html#post--setup-$CLIENT_ID
   *
   */
  async setup(clientId, token, body) {
    const url = new URL(`setup/${clientId}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengeSetupResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // LOGIN
  /**
   * https://docs.taler.net/core/api-challenger.html#post--authorize-$NONCE
   *
   */
  async login(nonce, clientId, redirectUri, state) {
    const url = new URL(`authorize/${nonce}`, this.baseUrl);
    url.searchParams.set("response_type", "code");
    url.searchParams.set("client_id", clientId);
    url.searchParams.set("redirect_uri", redirectUri);
    if (state) {
      url.searchParams.set("state", state);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengeStatus());
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotAcceptable:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.TooManyRequests:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.InternalServerError:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // CHALLENGE
  /**
   * https://docs.taler.net/core/api-challenger.html#post--challenge-$NONCE
   *
   */
  async challenge(nonce, body) {
    const url = new URL(`challenge/${nonce}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        await this.cacheEvictor.notifySuccess(ChallengerCacheEviction.CREATE_CHALLENGE);
        return opSuccessFromHttp(resp, codecForChallengeResponse2());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotAcceptable:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.TooManyRequests:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.InternalServerError:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // SOLVE
  /**
   * https://docs.taler.net/core/api-challenger.html#post--solve-$NONCE
   *
   */
  async solve(nonce, body) {
    const url = new URL(`solve/${nonce}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body: new URLSearchParams(Object.entries(body)).toString(),
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      redirect: "manual"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        await this.cacheEvictor.notifySuccess(ChallengerCacheEviction.SOLVE_CHALLENGE);
        return opSuccessFromHttp(resp, codecForChallengeSolveResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownAlternativeHttpFailure(resp, HttpStatusCode.Forbidden, codecForChallengeInvalidPinResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotAcceptable:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.TooManyRequests:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.InternalServerError:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // AUTH
  /**
   * https://docs.taler.net/core/api-challenger.html#post--token
   *
   */
  async token(client_id, redirect_uri, client_secret, code) {
    const url = new URL(`token`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      body: new URLSearchParams(Object.entries({
        client_id,
        redirect_uri,
        client_secret,
        code,
        grant_type: "authorization_code"
      })).toString()
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengerAuthResponse());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // INFO
  /**
   * https://docs.taler.net/core/api-challenger.html#get--info
   *
   */
  async info(token) {
    const url = new URL(`info`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengerInfoResponse());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
ChallengerHttpClient.PROTOCOL_VERSION = "2:0:0";

// ../taler-util/lib/types-donau.js
var codecForDonauVersionResponse = () => buildCodecForObject().property("version", codecForString()).property("name", codecForConstString("donau")).property("currency", codecForString()).property("legal_domain", codecForString()).build("DonauApi.DonauVersionResponse");
var codecForDonationUnitKeyGroup = codecForAny();
var codecForDonauKeysResponse = () => buildCodecForObject().property("version", codecForString()).property("base_url", codecForString()).property("currency", codecForString()).property("signkeys", codecForAny()).property("donation_units", codecForList(codecForDonationUnitKeyGroup)).build("DonauApi.DonauKeysResponse");
var codecForIssuePrepareResponse = () => buildCodecForUnion().discriminateOn("cipher").alternative("CS", codecForAny()).alternative("RSA", codecForAny()).build("DonauApi.IssuePrepareResponse");
var codecForDonauCharityResponse = () => buildCodecForObject().property("charity_id", codecForNumber()).build("DonauApi.DonauCharityResponse");
var codecForDonauDonationStatementResponse = () => buildCodecForObject().property("total", codecForAmountString()).property("donau_pub", codecForEddsaPublicKey()).property("donation_statement_sig", codecForEddsaSignature()).build("DonauApi.DonationStatementResponse");

// ../taler-util/lib/http-client/donau-client.js
var DonauHttpClient = class _DonauHttpClient {
  constructor(baseUrl, params = {}) {
    this.baseUrl = baseUrl;
    this.httpLib = params.httpClient ?? createPlatformHttpLib();
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(_DonauHttpClient.SUPPORTED_DONAU_PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--keys
   *
   * @returns
   */
  async getKeys() {
    const url = new URL(`keys`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForDonauKeysResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--seed
   *
   */
  async getSeed() {
    const url = new URL(`keys`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        const buffer = await resp.bytes();
        const uintar = new Uint8Array(buffer);
        return opFixedSuccess(uintar);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--config
   *
   * @returns
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("donau", _DonauHttpClient.SUPPORTED_DONAU_PROTOCOL_VERSION, resp, codecForDonauVersionResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#csr-issue
   *
   * @param args
   * @returns
   */
  async prepareIssueReceipt(body) {
    const url = new URL(`csr-issue`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForIssuePrepareResponse());
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      case HttpStatusCode.Gone:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#post--batch-issue-$CHARITY_ID
   *
   * @param args
   * @returns
   */
  async issueReceipts(charityId, body) {
    const url = new URL(`batch-issue/${charityId}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      case HttpStatusCode.Conflict:
        return opKnownFailure(resp.status);
      case HttpStatusCode.Gone:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#post--batch-submit
   *
   * @param args
   * @returns
   */
  async submitDonationReceipts(body) {
    const url = new URL(`batch-submit`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Created:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--donation-statement-$YEAR-$HASH_DONOR_ID
   *
   * @param args
   * @returns
   */
  async getDonationStatement(year, hash3) {
    const url = new URL(`donation-statement/${year}/${hash3}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForDonauDonationStatementResponse());
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--charities
   *
   * @param args
   * @returns
   */
  async getCharities(token) {
    const url = new URL(`charities`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          charities: []
        });
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#get--charities-$CHARITY_ID
   */
  async getCharitiesById(token, id) {
    const url = new URL(`charities/${id}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#post--charities
   *
   * @param args
   * @returns
   */
  async createCharity(token, body) {
    const url = new URL(`charities`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Created:
        return opSuccessFromHttp(resp, codecForDonauCharityResponse());
      case HttpStatusCode.NoContent:
        return opKnownFailure(resp.status);
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#patch--charities-id
   *
   * @returns
   */
  async updateCharity(token, id, body) {
    const url = new URL(`charities/${id}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-donau.html#patch--charities-id
   *
   * @returns
   */
  async deleteCharity(token, id) {
    const url = new URL(`charities/${id}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
        return opKnownFailure(resp.status);
      case HttpStatusCode.NotFound:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
DonauHttpClient.SUPPORTED_DONAU_PROTOCOL_VERSION = "0:0:0";

// ../taler-util/lib/http-client/exchange-client.js
var TalerExchangeCacheEviction;
(function(TalerExchangeCacheEviction2) {
  TalerExchangeCacheEviction2[TalerExchangeCacheEviction2["UPLOAD_KYC_FORM"] = 0] = "UPLOAD_KYC_FORM";
  TalerExchangeCacheEviction2[TalerExchangeCacheEviction2["MAKE_AML_DECISION"] = 1] = "MAKE_AML_DECISION";
})(TalerExchangeCacheEviction || (TalerExchangeCacheEviction = {}));
var TalerExchangeHttpClient = class _TalerExchangeHttpClient {
  constructor(baseUrl, params = {}) {
    this.baseUrl = baseUrl;
    this.httpLib = params.httpClient ?? createPlatformHttpLib();
    this.cacheEvictor = params.cacheEvictor ?? nullEvictor;
    this.preventCompression = !!params.preventCompression;
    this.cancelationToken = params.cancelationToken ?? CancellationToken.CONTINUE;
    this.longPollQueue = params.longPollQueue ?? new LongpollQueue();
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(_TalerExchangeHttpClient.SUPPORTED_EXCHANGE_PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  async fetch(url_or_path, opts = {}, longpoll = false) {
    const url = typeof url_or_path == "string" ? new URL(url_or_path, this.baseUrl) : url_or_path;
    if (longpoll || url.searchParams.has("timeout_ms")) {
      return this.longPollQueue.run(url, this.cancelationToken, async (timeoutMs) => {
        url.searchParams.set("timeout_ms", String(timeoutMs));
        return this.httpLib.fetch(url.href, {
          cancellationToken: this.cancelationToken,
          ...opts
        });
      });
    } else {
      return this.httpLib.fetch(url.href, {
        cancellationToken: this.cancelationToken,
        ...opts
      });
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--seed
   *
   */
  async getSeed() {
    const resp = await this.fetch("seed");
    switch (resp.status) {
      case HttpStatusCode.Ok:
        const buffer = await resp.bytes();
        const uintar = new Uint8Array(buffer);
        return opFixedSuccess(uintar);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--config
   *
   */
  async getConfig() {
    const resp = await this.fetch("config");
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-exchange", _TalerExchangeHttpClient.SUPPORTED_EXCHANGE_PROTOCOL_VERSION, resp, codecForExchangeConfig());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--config
   *
   * PARTIALLY IMPLEMENTED!!
   */
  async getKeys() {
    const resp = await this.fetch("keys");
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeKeysResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // WALLET TO WALLET
  /**
   * https://docs.taler.net/core/api-exchange.html#get--purses-$PURSE_PUB-merge
   *
   */
  async getPurseStatusAtMerge(pursePub, longpoll = false) {
    const resp = await this.fetch(`purses/${pursePub}/merge`, {}, longpoll);
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangePurseStatus());
      case HttpStatusCode.Gone:
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--purses-$PURSE_PUB-deposit
   *
   */
  async getPurseStatusAtDeposit(pursePub, longpoll = false) {
    const resp = await this.fetch(`purses/${pursePub}/deposit`, {}, longpoll);
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangePurseStatus());
      case HttpStatusCode.Gone:
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--purses-$PURSE_PUB-create
   *
   */
  async createPurseFromDeposit(pursePub, body) {
    const resp = await this.fetch(`purses/${pursePub}/create`, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.Conflict:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPurseConflict());
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.TooEarly:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#delete--purses-$PURSE_PUB
   *
   */
  async deletePurse(pursePub, purseSig) {
    const resp = await this.fetch(`purses/${pursePub}`, {
      method: "DELETE",
      headers: {
        "taler-purse-signature": purseSig
      }
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * POST /purses/$PURSE_PUB/merge
   *
   * https://docs.taler.net/core/api-exchange.html#post--purses-$PURSE_PUB-merge
   */
  async postPurseMerge(pursePub, body) {
    const resp = await this.fetch(`purses/${pursePub}/merge`, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeMergeSuccessResponse());
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForLegitimizationNeededResponse());
      case HttpStatusCode.Conflict:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForExchangeMergeConflictResponse());
      case HttpStatusCode.Gone:
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--reserves-$RESERVE_PUB-purse
   *
   */
  async createPurseFromReserve(pursePub, body) {
    const resp = await this.fetch(`reserves/${pursePub}/purse`, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.PaymentRequired:
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPurseConflictPartial());
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForLegitimizationNeededResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--contracts-$CONTRACT_PUB
   *
   */
  async getContract(pursePub) {
    const resp = await this.fetch(`contracts/${pursePub}`);
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeGetContractResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--purses-$PURSE_PUB-deposit
   *
   */
  async depositIntoPurse(pursePub, body) {
    const resp = await this.fetch(`purses/${pursePub}/deposit`, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAny());
      case HttpStatusCode.Conflict:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPurseConflict());
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Gone:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // WADS
  /**
   * https://docs.taler.net/core/api-exchange.html#get--wads-$WAD_ID
   *
   */
  async getWadInfo() {
    throw Error("not yet implemented");
  }
  //
  // KYC
  //
  /**
   * https://docs.taler.net/core/api-exchange.html#post--kyc-wallet
   *
   */
  async notifyKycBalanceLimit(body) {
    const url = new URL(`kyc-wallet`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAmlWalletKycCheckResponse());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForLegitimizationNeededResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--kyc-check-$H_NORMALIZED_PAYTO
   *
   */
  async checkKycStatus(args) {
    const { paytoHash, accountPub, accountSig, longpoll, awaitAuth } = args;
    const url = new URL(`kyc-check/${paytoHash}`, this.baseUrl);
    if (awaitAuth !== void 0) {
      url.searchParams.set("await_auth", awaitAuth ? "YES" : "NO");
    }
    const resp = await this.fetch(url, {
      headers: {
        "Account-Owner-Signature": accountSig,
        "Account-Owner-Pub": accountPub
      }
    }, longpoll);
    switch (resp.status) {
      case HttpStatusCode.Ok:
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForAccountKycStatus());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * Do a /kyc-check request, but don't specify
   * the account pub explicitly.
   *
   * Deprecated, but used in tests.
   */
  async testingCheckKycStatusNoPub(args) {
    const { paytoHash, accountSig, longpoll, awaitAuth } = args;
    const url = new URL(`kyc-check/${paytoHash}`, this.baseUrl);
    if (awaitAuth !== void 0) {
      url.searchParams.set("await_auth", awaitAuth ? "YES" : "NO");
    }
    const resp = await this.fetch(url, {
      headers: {
        "Account-Owner-Signature": accountSig
      }
    }, longpoll);
    switch (resp.status) {
      case HttpStatusCode.Ok:
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForAccountKycStatus());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--kyc-info-$ACCESS_TOKEN
   *
   */
  async checkKycInfo(token, known = [], longpoll = false) {
    const resp = await this.fetch(`kyc-info/${token}`, {
      method: "GET",
      headers: {
        "If-None-Match": known.length ? known.join(",") : void 0
      }
    }, longpoll);
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForKycProcessClientInformation());
      case HttpStatusCode.Accepted:
      case HttpStatusCode.NoContent:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForEmptyObject());
      case HttpStatusCode.NotModified:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * SPA-Specific version of checkKycInfo
   */
  async checkKycInfoSpa(token, etag, params = {}) {
    const url = new URL(`kyc-info/${token}`, this.baseUrl);
    addLongPollingParam(url, params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        "If-None-Match": etag
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        const etag2 = resp.headers.get("etag") ?? void 0;
        const body = await readSuccessResponseJsonOrThrow(resp, codecForKycProcessClientInformation());
        return opFixedSuccess({
          ...body,
          etag: etag2
        });
      }
      case HttpStatusCode.Accepted:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NoContent:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotModified:
        return opKnownFailure(resp.status);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--kyc-upload-$ID
   *
   */
  async uploadKycForm(requirement, body) {
    const resp = await this.fetch(`kyc-upload/${requirement}`, {
      method: "POST",
      body,
      compress: this.preventCompression ? void 0 : "deflate"
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerExchangeCacheEviction.UPLOAD_KYC_FORM);
        return opEmptySuccess();
      }
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
      case HttpStatusCode.PayloadTooLarge:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--kyc-start-$ID
   *
   */
  async startExternalKycProcess(requirement, body = {}) {
    const resp = await this.fetch(`kyc-start/${requirement}`, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForKycProcessStartInformation());
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
      case HttpStatusCode.PayloadTooLarge:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--kyc-proof-$PROVIDER_NAME?state=$H_PAYTO
   *
   */
  async completeExternalKycProcess(provider, state, code) {
    const resp = await this.fetch(`kyc-proof/${provider}?state=${state}&code=${code}`, {
      method: "GET",
      redirect: "manual"
    });
    switch (resp.status) {
      case HttpStatusCode.SeeOther:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // AML operations
  //
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-measures
   *
   */
  async getAmlMeasures(auth) {
    const resp = await this.fetch(`aml/${auth.id}/measures`, {
      method: "GET",
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAvailableMeasureSummary());
      case HttpStatusCode.Conflict:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-kyc-statistics-$NAMES
   *
   */
  async getAmlKycStatistics(auth, names3, filter = {}) {
    const url = new URL(`aml/${auth.id}/kyc-statistics/${names3.join(" ")}`, this.baseUrl);
    if (filter.since !== void 0 && filter.since.t_ms !== "never") {
      url.searchParams.set("start_date", String(filter.since.t_ms));
    }
    if (filter.until !== void 0 && filter.until.t_ms !== "never") {
      url.searchParams.set("end_date", String(filter.until.t_ms));
    }
    const resp = await this.fetch(url, {
      method: "GET",
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAmlStatisticsResponse());
      case HttpStatusCode.NoContent: {
        return opFixedSuccess({
          statistics: names3.map((name) => ({ counter: 0, name }))
        });
      }
      case HttpStatusCode.Conflict:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-decisions
   *
   */
  async getAmlAccounts(auth, params = {}) {
    const url = new URL(`aml/${auth.id}/accounts`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.investigation !== void 0) {
      url.searchParams.set("investigation", params.investigation ? "YES" : "NO");
    }
    if (params.open !== void 0 && params.open) {
      url.searchParams.set("open", "YES");
    }
    if (params.highRisk !== void 0 && params.highRisk) {
      url.searchParams.set("high_risk", "YES");
    }
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAmlDecisionsAccounts());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ accounts: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-decisions
   *
   */
  async getAmlDecisions(auth, params = {}) {
    const url = new URL(`aml/${auth.id}/decisions`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.account !== void 0) {
      url.searchParams.set("h_payto", params.account);
    }
    if (params.active !== void 0) {
      url.searchParams.set("active", params.active ? "YES" : "NO");
    }
    if (params.investigation !== void 0) {
      url.searchParams.set("investigation", params.investigation ? "YES" : "NO");
    }
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAmlDecisionsResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ records: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-legitimizations
   */
  async getAmlLegitimizations(officer, params = {}) {
    const url = new URL(`aml/${officer.id}/legitimizations`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.account !== void 0) {
      url.searchParams.set("h_payto", params.account);
    }
    if (params.active !== void 0) {
      url.searchParams.set("active", params.active ? "YES" : "NO");
    }
    const resp = await this.httpLib.fetch(url.href, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(officer.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForLegitimizationMeasuresList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({
          measures: []
        });
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-attributes-$H_PAYTO
   *
   */
  async getAmlAttributesForAccount(auth, account, params = {}) {
    const url = new URL(`aml/${auth.id}/attributes/${account}`, this.baseUrl);
    addPaginationParams(url, params);
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAmlKycAttributes());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ details: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  async getAmlAttributesForAccountAsPdf(auth, account, params = {}) {
    const url = new URL(`aml/${auth.id}/attributes/${account}`, this.baseUrl);
    addPaginationParams(url, params);
    const resp = await this.fetch(url, {
      headers: {
        Accept: "application/pdf",
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        return opFixedSuccess(await resp.bytes());
      }
      case HttpStatusCode.NoContent:
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  async getAmlAccountsAsOtherFormat(auth, mime) {
    const url = new URL(`aml/${auth.id}/accounts`, this.baseUrl);
    const resp = await this.fetch(url, {
      headers: {
        Accept: mime,
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        return opFixedSuccess(await resp.bytes());
      }
      case HttpStatusCode.NoContent:
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#post--aml-$OFFICER_PUB-decision
   *
   */
  async makeAmlDesicion(auth, decision) {
    const body = {
      officer_sig: encodeCrock(signAmlDecision(auth.signingKey, decision)),
      ...decision
    };
    const resp = await this.fetch(`aml/${auth.id}/decision`, {
      method: "POST",
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      },
      body,
      compress: this.preventCompression ? void 0 : "deflate"
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerExchangeCacheEviction.MAKE_AML_DECISION);
        return opEmptySuccess();
      }
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-transfers-credit
   *
   */
  async getTransfersCredit(auth, params = {}) {
    const url = new URL(`aml/${auth.id}/transfers-credit`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.threshold) {
      url.searchParams.set("threshold", Amounts.stringify(params.threshold));
    }
    if (params.account) {
      url.searchParams.set("h_payto", params.account);
    }
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeTransferList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ transfers: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-transfers-debit
   *
   */
  async getTransfersDebit(auth, params = {}) {
    const url = new URL(`aml/${auth.id}/transfers-debit`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.threshold) {
      url.searchParams.set("threshold", Amounts.stringify(params.threshold));
    }
    if (params.account) {
      url.searchParams.set("h_payto", params.account);
    }
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeTransferList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ transfers: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-exchange.html#get--aml-$OFFICER_PUB-transfers-kycauth
   *
   */
  async getTransfersKycAuth(auth, params = {}) {
    const url = new URL(`aml/${auth.id}/transfers-kycauth`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.threshold) {
      url.searchParams.set("threshold", Amounts.stringify(params.threshold));
    }
    if (params.account) {
      url.searchParams.set("h_payto", params.account);
    }
    const resp = await this.fetch(url, {
      headers: {
        "Taler-AML-Officer-Signature": encodeCrock(signAmlQuery(auth.signingKey))
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeTransferList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ transfers: [] });
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * Request: POST /withdraw
   *
   * https://docs.taler.net/core/api-exchange.html#withdrawal
   */
  async withdraw(args) {
    const url = new URL(`withdraw`, this.baseUrl);
    const resp = await this.fetch(url, {
      method: "POST",
      body: args.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeWithdrawResponse());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * Request: POST /melt
   *
   * https://docs.taler.net/core/api-exchange.html#post--melt
   */
  async postMelt(args) {
    const url = new URL(`melt`, this.baseUrl);
    const resp = await this.fetch(url, {
      method: "POST",
      body: args.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeMeltResponse());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  async postRevealMelt(args) {
    const url = new URL(`reveal-melt`, this.baseUrl);
    const resp = await this.fetch(url, {
      method: "POST",
      body: args.body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForExchangeWithdrawResponse());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerExchangeHttpClient.SUPPORTED_EXCHANGE_PROTOCOL_VERSION = "31:0:6";

// ../taler-util/lib/http-client/merchant.js
var TalerMerchantInstanceCacheEviction;
(function(TalerMerchantInstanceCacheEviction2) {
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_ORDER"] = 0] = "CREATE_ORDER";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_ORDER"] = 1] = "UPDATE_ORDER";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_ORDER"] = 2] = "DELETE_ORDER";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_CURRENT_INSTANCE"] = 3] = "UPDATE_CURRENT_INSTANCE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_CURRENT_INSTANCE"] = 4] = "DELETE_CURRENT_INSTANCE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_BANK_ACCOUNT"] = 5] = "CREATE_BANK_ACCOUNT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_BANK_ACCOUNT"] = 6] = "UPDATE_BANK_ACCOUNT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_BANK_ACCOUNT"] = 7] = "DELETE_BANK_ACCOUNT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_PRODUCT"] = 8] = "CREATE_PRODUCT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_PRODUCT"] = 9] = "UPDATE_PRODUCT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_PRODUCT"] = 10] = "DELETE_PRODUCT";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_CATEGORY"] = 11] = "CREATE_CATEGORY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_CATEGORY"] = 12] = "UPDATE_CATEGORY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_CATEGORY"] = 13] = "DELETE_CATEGORY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_TRANSFER"] = 14] = "CREATE_TRANSFER";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_TRANSFER"] = 15] = "DELETE_TRANSFER";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_DEVICE"] = 16] = "CREATE_DEVICE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_DEVICE"] = 17] = "UPDATE_DEVICE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_DEVICE"] = 18] = "DELETE_DEVICE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_TEMPLATE"] = 19] = "CREATE_TEMPLATE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_TEMPLATE"] = 20] = "UPDATE_TEMPLATE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_TEMPLATE"] = 21] = "DELETE_TEMPLATE";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_WEBHOOK"] = 22] = "CREATE_WEBHOOK";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_WEBHOOK"] = 23] = "UPDATE_WEBHOOK";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_WEBHOOK"] = 24] = "DELETE_WEBHOOK";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_TOKENFAMILY"] = 25] = "CREATE_TOKENFAMILY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["UPDATE_TOKENFAMILY"] = 26] = "UPDATE_TOKENFAMILY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_TOKENFAMILY"] = 27] = "DELETE_TOKENFAMILY";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["CREATE_ACCESSTOKEN"] = 28] = "CREATE_ACCESSTOKEN";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["DELETE_ACCESSTOKEN"] = 29] = "DELETE_ACCESSTOKEN";
  TalerMerchantInstanceCacheEviction2[TalerMerchantInstanceCacheEviction2["LAST"] = 30] = "LAST";
})(TalerMerchantInstanceCacheEviction || (TalerMerchantInstanceCacheEviction = {}));
var TalerMerchantManagementCacheEviction;
(function(TalerMerchantManagementCacheEviction2) {
  TalerMerchantManagementCacheEviction2[TalerMerchantManagementCacheEviction2["CREATE_INSTANCE"] = 31] = "CREATE_INSTANCE";
  TalerMerchantManagementCacheEviction2[TalerMerchantManagementCacheEviction2["UPDATE_INSTANCE"] = 32] = "UPDATE_INSTANCE";
  TalerMerchantManagementCacheEviction2[TalerMerchantManagementCacheEviction2["DELETE_INSTANCE"] = 33] = "DELETE_INSTANCE";
})(TalerMerchantManagementCacheEviction || (TalerMerchantManagementCacheEviction = {}));
var TalerMerchantInstanceHttpClient = class _TalerMerchantInstanceHttpClient {
  constructor(baseUrl, httpClient, cacheEvictor, cancellationToken) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
    this.cacheEvictor = cacheEvictor ?? nullEvictor;
    this.cancellationToken = cancellationToken;
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(_TalerMerchantInstanceHttpClient.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--config
   */
  async getConfig() {
    const url = new URL(`config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-merchant", _TalerMerchantInstanceHttpClient.PROTOCOL_VERSION, resp, codecForTalerMerchantConfigResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Auth
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-token
   *
   */
  async createAccessToken(instance, password, body, params = {}) {
    const url = new URL(`private/token`, this.baseUrl);
    const headers = {};
    headers.Authorization = makeBasicAuthHeader2(instance, password);
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_ACCESSTOKEN);
        return opSuccessFromHttp(resp, codecForLoginTokenSuccessResponse());
      }
      case HttpStatusCode.Accepted: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-tokens
   *
   */
  async listAccessTokens(token, params = {}) {
    const url = new URL(`private/tokens`, this.baseUrl);
    addPaginationParams(url, params);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers: {
        Authorization: makeBearerTokenAuthHeader(token)
      }
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTokenInfoList());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({ tokens: [] });
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-tokens-$SERIAL
   *
   */
  async deleteAccessToken(token, serial) {
    const url = new URL(`private/tokens/${String(serial)}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_ACCESSTOKEN);
        return opEmptySuccess();
      }
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Wallet API
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-orders-$ORDER_ID-claim
   */
  async claimOrder(args) {
    const { orderId, body } = args;
    const url = new URL(`orders/${orderId}/claim`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForClaimResponse());
      }
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound: {
        const body2 = await resp.json();
        const details = codecForTalerErrorDetail().decode(body2);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_POST_ORDERS_ID_CLAIM_NOT_FOUND:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-orders-$ORDER_ID-pay
   */
  async makePayment(orderId, body) {
    const url = new URL(`orders/${orderId}/pay`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForPaymentResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.PaymentRequired:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.RequestTimeout:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Gone:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.PreconditionFailed:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.GatewayTimeout:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPaymentDeniedLegallyResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-orders-$ORDER_ID
   */
  async getPaymentStatus(orderId, params = {}) {
    const url = new URL(`orders/${orderId}`, this.baseUrl);
    if (params.allowRefundedForRepurchase !== void 0) {
      url.searchParams.set("allow_refunded_for_repurchase", params.allowRefundedForRepurchase ? "YES" : "NO");
    }
    if (params.awaitRefundObtained !== void 0) {
      url.searchParams.set("await_refund_obtained", params.allowRefundedForRepurchase ? "YES" : "NO");
    }
    if (params.claimToken !== void 0) {
      url.searchParams.set("token", params.claimToken);
    }
    if (params.contractTermHash !== void 0) {
      url.searchParams.set("h_contract", params.contractTermHash);
    }
    if (params.refund !== void 0) {
      url.searchParams.set("refund", params.refund);
    }
    if (params.sessionId !== void 0) {
      url.searchParams.set("session_id", params.sessionId);
    }
    if (params.timeout !== void 0) {
      url.searchParams.set("timeout_ms", String(params.timeout));
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
      // body,
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForStatusPaid());
      case HttpStatusCode.Accepted:
        return opSuccessFromHttp(resp, codecForStatusGoto());
      case HttpStatusCode.PaymentRequired:
        return opSuccessFromHttp(resp, codecForStatusStatusUnpaid());
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotAcceptable:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#demonstrating-payment
   */
  async demostratePayment(orderId, body) {
    const url = new URL(`orders/${orderId}/paid`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForPaidRefundStatusResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#aborting-incomplete-payments
   */
  async abortIncompletePayment(orderId, body) {
    const url = new URL(`orders/${orderId}/abort`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForAbortResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#obtaining-refunds
   */
  async obtainRefund(orderId, body) {
    const url = new URL(`orders/${orderId}/refund`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForWalletRefundResponse());
      }
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPaymentDeniedLegallyResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Management
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-auth
   */
  async updateCurrentInstanceAuthentication(token, body, params = {}) {
    const url = new URL(`private/auth`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opEmptySuccess();
      case HttpStatusCode.Accepted: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      }
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCE]-private
   */
  async updateCurrentInstance(token, body, params = {}) {
    const url = new URL(`private`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_CURRENT_INSTANCE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Accepted: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private
   *
   */
  async getCurrentInstanceDetails(token) {
    const url = new URL(`private`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForQueryInstancesResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private
   */
  async deleteCurrentInstance(token, params = {}) {
    const url = new URL(`private`, this.baseUrl);
    if (params.purge !== void 0) {
      url.searchParams.set("purge", params.purge ? "YES" : "NO");
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_CURRENT_INSTANCE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--instances-$INSTANCE-private-kyc
   */
  async getCurrentInstanceKycStatus(token, params = {}) {
    const url = new URL(`private/kyc`, this.baseUrl);
    if (params.wireHash) {
      url.searchParams.set("h_wire", params.wireHash);
    }
    if (params.exchangeURL) {
      url.searchParams.set("exchange_url", params.exchangeURL);
    }
    if (params.timeout) {
      url.searchParams.set("timeout_ms", String(params.timeout));
    }
    if (params.reason) {
      url.searchParams.set("lpt", String(params.reason));
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAccountKycRedirects());
      case HttpStatusCode.Accepted:
        return opSuccessFromHttp(resp, codecForAccountKycRedirects());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForAccountKycRedirects());
      case HttpStatusCode.ServiceUnavailable:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.GatewayTimeout:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Bank Accounts
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-accounts
   */
  async addBankAccount(token, body, params = {}) {
    const url = new URL(`private/accounts`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_BANK_ACCOUNT);
        return opSuccessFromHttp(resp, codecForAccountAddResponse());
      }
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCE]-private-accounts-$H_WIRE
   */
  async updateBankAccount(token, wireAccount, body) {
    const url = new URL(`private/accounts/${wireAccount}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_BANK_ACCOUNT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-accounts
   */
  async listBankAccounts(token, params) {
    const url = new URL(`private/accounts`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForAccountsSummaryResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-accounts-$H_WIRE
   */
  async getBankAccountDetails(token, wireAccount) {
    const url = new URL(`private/accounts/${wireAccount}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForBankAccountDetail());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-accounts-$H_WIRE
   */
  async deleteBankAccount(token, wireAccount) {
    const url = new URL(`private/accounts/${wireAccount}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_BANK_ACCOUNT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Inventory Management
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-categories
   */
  async listCategories(token, params) {
    const url = new URL(`private/categories`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCategoryListResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-categories-$CATEGORY_ID
   */
  async getCategoryDetails(token, cId) {
    const url = new URL(`private/categories/${cId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForCategoryProductList());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-categories
   */
  async addCategory(token, body) {
    const url = new URL(`private/categories`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_CATEGORY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-categories
   */
  async updateCategory(token, cid, body) {
    const url = new URL(`private/categories/${cid}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_CATEGORY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-categories-$CATEGORY_ID
   */
  async deleteCategory(token, cId) {
    const url = new URL(`private/categories/${cId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_CATEGORY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-products
   */
  async addProduct(token, body) {
    const url = new URL(`private/products`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_PRODUCT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCE]-private-products-$PRODUCT_ID
   */
  async updateProduct(token, productId, body) {
    const url = new URL(`private/products/${productId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_PRODUCT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-products
   */
  async listProducts(token, params = {}) {
    const url = new URL(`private/products`, this.baseUrl);
    addPaginationParams(url, params);
    if (params.category) {
      url.searchParams.set("category_filter", params.category);
    }
    if (params.name) {
      url.searchParams.set("name_filter", params.name);
    }
    if (params.description) {
      url.searchParams.set("description_filter", params.description);
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForInventorySummaryResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-pos
   */
  async getPointOfSaleInventory(token) {
    const url = new URL(`private/pos`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForMerchantPosProductDetail());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-products-$PRODUCT_ID
   */
  async getProductDetails(token, productId) {
    const url = new URL(`private/products/${productId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForProductDetail());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-products-$PRODUCT_ID-lock
   */
  async lockProduct(token, productId, body) {
    const url = new URL(`private/products/${productId}/lock`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_PRODUCT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Gone:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-products-$PRODUCT_ID
   */
  async deleteProduct(token, productId) {
    const url = new URL(`private/products/${productId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_PRODUCT);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Payment processing
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-orders
   */
  async createOrder(token, body) {
    const url = new URL(`private/orders`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    return this.procesOrderCreationResponse(resp);
  }
  async procesOrderCreationResponse(resp) {
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_ORDER);
        return opSuccessFromHttp(resp, codecForPostOrderResponse());
      }
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPaymentDeniedLegallyResponse());
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Gone:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForOutOfStockResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#inspecting-orders
   */
  async listOrders(token, params = {}) {
    const url = new URL(`private/orders`, this.baseUrl);
    if (params.paid !== void 0) {
      url.searchParams.set("paid", params.paid ? "YES" : "NO");
    }
    if (params.refunded !== void 0) {
      url.searchParams.set("refunded", params.refunded ? "YES" : "NO");
    }
    if (params.wired !== void 0) {
      url.searchParams.set("wired", params.wired ? "YES" : "NO");
    }
    if (params.date && !AbsoluteTime.isNever(params.date)) {
      const time = AbsoluteTime.toProtocolTimestamp(params.date);
      url.searchParams.set("date_s", String(time.t_s));
    }
    if (params.timeout) {
      url.searchParams.set("timeout_ms", String(params.timeout));
    }
    if (params.sessionId) {
      url.searchParams.set("session_id", params.sessionId);
    }
    if (params.fulfillmentUrl) {
      url.searchParams.set("fulfillment_url", params.fulfillmentUrl);
    }
    if (params.summary) {
      url.searchParams.set("summary_filter", params.summary);
    }
    addPaginationParams(url, params);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForOrderHistory());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-orders-$ORDER_ID
   */
  async getOrderDetails(token, orderId, params = {}) {
    const url = new URL(`private/orders/${orderId}`, this.baseUrl);
    if (params.allowRefundedForRepurchase !== void 0) {
      url.searchParams.set("allow_refunded_for_repurchase", params.allowRefundedForRepurchase ? "YES" : "NO");
    }
    if (params.sessionId) {
      url.searchParams.set("session_id", params.sessionId);
    }
    if (params.timeout) {
      url.searchParams.set("timeout_ms", String(params.timeout));
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForMerchantOrderPrivateStatusResponse());
      case HttpStatusCode.NotFound: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_GENERIC_ORDER_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          case TalerErrorCode.MERCHANT_GENERIC_INSTANCE_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#private-order-data-cleanup
   */
  async forgetOrder(token, orderId, body) {
    const url = new URL(`private/orders/${orderId}/forget`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opEmptySuccess();
      }
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadRequest:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-orders-$ORDER_ID
   */
  async deleteOrder(token, orderId, force = false) {
    const url = new URL(`private/orders/${orderId}`, this.baseUrl);
    if (force) {
      url.searchParams.set("force", "yes");
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_ORDER);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Refunds
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-orders-$ORDER_ID-refund
   */
  async addRefund(token, orderId, body) {
    const url = new URL(`private/orders/${orderId}/refund`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_ORDER);
        return opSuccessFromHttp(resp, codecForMerchantRefundResponse());
      }
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Gone:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.UnavailableForLegalReasons:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForPaymentDeniedLegallyResponse());
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Wire Transfer
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-transfers
   */
  async informWireTransfer(token, body) {
    const url = new URL(`private/transfers`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_TRANSFER);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-transfers
   */
  async listConfirmedWireTransfers(token, params = {}) {
    const url = new URL(`private/transfers`, this.baseUrl);
    if (params.paytoURI) {
      url.searchParams.set("payto_uri", params.paytoURI);
    }
    if (params.before) {
      url.searchParams.set("before", String(params.before));
    }
    if (params.after) {
      url.searchParams.set("after", String(params.after));
    }
    if (params.expected !== void 0) {
      url.searchParams.set("expected", params.expected ? "YES" : "NO");
    }
    addPaginationParams(url, params);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTansferList());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-incoming
   */
  async listIncomingWireTransfers(token, params = {}) {
    const url = new URL(`private/incoming`, this.baseUrl);
    if (params.paytoURI) {
      url.searchParams.set("payto_uri", params.paytoURI);
    }
    if (params.before) {
      url.searchParams.set("before", String(params.before));
    }
    if (params.after) {
      url.searchParams.set("after", String(params.after));
    }
    if (params.verified !== void 0) {
      url.searchParams.set("verified", params.verified ? "YES" : "NO");
    }
    if (params.confirmed !== void 0) {
      url.searchParams.set("verified", params.confirmed ? "YES" : "NO");
    }
    addPaginationParams(url, params);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForIncomingTansferList());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  // /**
  //  * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-transfers-$TID
  //  * @deprecated
  //  */
  // async deleteWireTransfer(token: AccessToken | undefined, transferId: string) {
  //   const url = new URL(`private/transfers/${transferId}`, this.baseUrl);
  //   const headers: Record<string, string> = {};
  //   if (token) {
  //     headers.Authorization = makeBearerTokenAuthHeader(token);
  //   }
  //   const resp = await this.httpLib.fetch(url.href, {
  //     method: "DELETE",
  //     headers,
  //   });
  //   switch (resp.status) {
  //     case HttpStatusCode.NoContent: {
  //       this.cacheEvictor.notifySuccess(
  //         TalerMerchantInstanceCacheEviction.DELETE_TRANSFER,
  //       );
  //       return opEmptySuccess();
  //     }
  //     case HttpStatusCode.Unauthorized: // FIXME: missing in docs
  //       return opKnownHttpFailure(resp.status, resp);
  //     case HttpStatusCode.NotFound:
  //       return opKnownHttpFailure(resp.status, resp);
  //     case HttpStatusCode.Conflict:
  //       return opKnownHttpFailure(resp.status, resp);
  //     default:
  //       return opUnknownHttpFailure(resp);
  //   }
  // }
  //
  // OTP Devices
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-otp-devices
   */
  async addOtpDevice(token, body) {
    const url = new URL(`private/otp-devices`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_DEVICE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCE]-private-otp-devices-$DEVICE_ID
   */
  async updateOtpDevice(token, deviceId, body) {
    const url = new URL(`private/otp-devices/${deviceId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_DEVICE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-otp-devices
   */
  async listOtpDevices(token, params) {
    const url = new URL(`private/otp-devices`, this.baseUrl);
    addPaginationParams(url, params);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForOtpDeviceSummaryResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-otp-devices-$DEVICE_ID
   */
  async getOtpDeviceDetails(token, deviceId, params = {}) {
    const url = new URL(`private/otp-devices/${deviceId}`, this.baseUrl);
    if (params.faketime) {
      url.searchParams.set("faketime", String(params.faketime));
    }
    if (params.price) {
      url.searchParams.set("price", params.price);
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForOtpDeviceDetails());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-otp-devices-$DEVICE_ID
   */
  async deleteOtpDevice(token, deviceId) {
    const url = new URL(`private/otp-devices/${deviceId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_DEVICE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // Templates
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-templates
   */
  async addTemplate(token, body) {
    const url = new URL(`private/templates`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_TEMPLATE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCE]-private-templates-$TEMPLATE_ID
   */
  async updateTemplate(token, templateId, body) {
    const url = new URL(`private/templates/${templateId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_TEMPLATE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#inspecting-template
   */
  async listTemplates(token, params) {
    const url = new URL(`private/templates`, this.baseUrl);
    addPaginationParams(url, params);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTemplateSummaryResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-private-templates-$TEMPLATE_ID
   */
  async getTemplateDetails(token, templateId) {
    const url = new URL(`private/templates/${templateId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTemplateDetails());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-templates-$TEMPLATE_ID
   */
  async deleteTemplate(token, templateId) {
    const url = new URL(`private/templates/${templateId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_TEMPLATE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCE]-templates-$TEMPLATE_ID
   */
  async useTemplateGetInfo(templateId) {
    const url = new URL(`templates/${templateId}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForWalletTemplateDetails());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCES]-templates-$TEMPLATE_ID
   */
  async useTemplateCreateOrder(templateId, body) {
    const url = new URL(`templates/${templateId}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    return this.procesOrderCreationResponse(resp);
  }
  //
  // Webhooks
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCES]-private-webhooks
   */
  async addWebhook(token, body) {
    const url = new URL(`private/webhooks`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_WEBHOOK);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCES]-private-webhooks-$WEBHOOK_ID
   */
  async updateWebhook(token, webhookId, body) {
    const url = new URL(`private/webhooks/${webhookId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_WEBHOOK);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCES]-private-webhooks
   */
  async listWebhooks(token, params) {
    const url = new URL(`private/webhooks`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForWebhookSummaryResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCES]-private-webhooks-$WEBHOOK_ID
   */
  async getWebhookDetails(token, webhookId) {
    const url = new URL(`private/webhooks/${webhookId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForWebhookDetails());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCES]-private-webhooks-$WEBHOOK_ID
   */
  async deleteWebhook(token, webhookId) {
    const url = new URL(`private/webhooks/${webhookId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_WEBHOOK);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  //
  // token families
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCES]-private-tokenfamilies
   */
  async createTokenFamily(token, body) {
    const url = new URL(`private/tokenfamilies`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_TOKENFAMILY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch-[-instances-$INSTANCES]-private-tokenfamilies-$TOKEN_FAMILY_SLUG
   */
  async updateTokenFamily(token, tokenSlug, body) {
    const url = new URL(`private/tokenfamilies/${tokenSlug}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_TOKENFAMILY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Ok: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.UPDATE_TOKENFAMILY);
        return opSuccessFromHttp(resp, codecForTokenFamilyDetails());
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCES]-private-tokenfamilies
   */
  async listTokenFamilies(token, params) {
    const url = new URL(`private/tokenfamilies`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTokenFamiliesList());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get-[-instances-$INSTANCES]-private-tokenfamilies-$TOKEN_FAMILY_SLUG
   */
  async getTokenFamilyDetails(token, tokenSlug) {
    const url = new URL(`private/tokenfamilies/${tokenSlug}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForTokenFamilyDetails());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCES]-private-tokenfamilies-$TOKEN_FAMILY_SLUG
   */
  async deleteTokenFamily(token, tokenSlug) {
    const url = new URL(`private/tokenfamilies/${tokenSlug}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.DELETE_TOKENFAMILY);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-challenge-$CHALLENGE_ID
   *
   */
  async sendChallenge(cid) {
    const url = new URL(`challenge/${cid}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      // FIXME: this should be removed
      body: {}
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForChallengeRequestResponse());
      case HttpStatusCode.NoContent:
        return opFixedSuccess({});
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_CHALLENGE_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.Gone: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_CHALLENGE_SOLVED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.TooManyRequests: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_TOO_EARLY:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.BadGateway: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_MFA_HELPER_EXEC_FAILED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-challenge-$CHALLENGE_ID-confirm
   *
   */
  async confirmChallenge(cid, body) {
    const url = new URL(`challenge/${cid}/confirm`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_CHALLENGE_UNKNOWN:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.Conflict: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_CHALLENGE_FAILED:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      case HttpStatusCode.TooManyRequests: {
        const details = await readTalerErrorResponse(resp);
        switch (details.code) {
          case TalerErrorCode.MERCHANT_TAN_TOO_MANY_ATTEMPTS:
            return opKnownTalerFailure(details.code, details);
          default:
            return opUnknownHttpFailure(resp, details);
        }
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post--instances-$INSTANCE-forgot-password
   */
  async forgotPasswordSelfProvision(body, params = {}) {
    const url = new URL(`forgot-password`, this.baseUrl);
    const headers = {};
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        return opEmptySuccess();
      }
      case HttpStatusCode.Accepted: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      }
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Forbidden:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  async postDonau(args) {
    const headers = {};
    if (args.token) {
      headers.Authorization = makeBearerTokenAuthHeader(args.token);
    }
    const url = new URL(`private/donau`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      headers,
      body: args.body
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent:
      case HttpStatusCode.Created:
      case HttpStatusCode.Ok: {
        return opEmptySuccess();
      }
      case HttpStatusCode.BadGateway:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * Get the auth api against the current instance
   *
   * https://docs.taler.net/core/api-merchant.html#post-[-instances-$INSTANCE]-private-token
   * https://docs.taler.net/core/api-merchant.html#delete-[-instances-$INSTANCE]-private-token
   */
  getAuthenticationAPI() {
    return new URL(`private/`, this.baseUrl);
  }
};
TalerMerchantInstanceHttpClient.PROTOCOL_VERSION = "24:0:1";
var TalerMerchantManagementHttpClient = class extends TalerMerchantInstanceHttpClient {
  constructor(baseUrl, httpClient, cacheEvictor) {
    super(baseUrl, httpClient, cacheEvictor);
    this.baseUrl = baseUrl;
    this.cacheManagementEvictor = cacheEvictor ?? nullEvictor;
  }
  getSubInstanceAPI(instanceId) {
    return new URL(`instances/${instanceId}/`, this.baseUrl).href;
  }
  //
  // Instance Management
  //
  /**
   * https://docs.taler.net/core/api-merchant.html#post--instances
   */
  async createInstanceSelfProvision(body, params = {}) {
    const url = new URL(`instances`, this.baseUrl);
    const headers = {};
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    if (params.tokenValidity) {
      url.searchParams.append("token_validity_ms", String(params.tokenValidity.d_ms));
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        this.cacheManagementEvictor.notifySuccess(TalerMerchantManagementCacheEviction.CREATE_INSTANCE);
        this.cacheEvictor.notifySuccess(TalerMerchantInstanceCacheEviction.CREATE_ACCESSTOKEN);
        return opSuccessFromHttp(resp, codecForLoginTokenSuccessResponse());
      }
      case HttpStatusCode.NoContent: {
        this.cacheManagementEvictor.notifySuccess(TalerMerchantManagementCacheEviction.CREATE_INSTANCE);
        return opFixedSuccess(void 0);
      }
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post--management-instances
   */
  async createInstance(token, body, params = {}) {
    const url = new URL(`management/instances`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheManagementEvictor.notifySuccess(TalerMerchantManagementCacheEviction.CREATE_INSTANCE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#post--management-instances-$INSTANCE-auth
   */
  async updateInstanceAuthentication(token, instanceId, body, params = {}) {
    const url = new URL(`management/instances/${instanceId}/auth`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#patch--management-instances-$INSTANCE
   */
  async updateInstance(token, instanceId, body) {
    const url = new URL(`management/instances/${instanceId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "PATCH",
      body,
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheManagementEvictor.notifySuccess(TalerMerchantManagementCacheEviction.UPDATE_INSTANCE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--management-instances
   */
  async listInstances(token, params) {
    const url = new URL(`management/instances`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForInstancesResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--management-instances-$INSTANCE
   *
   */
  async getInstanceDetails(token, instanceId) {
    const url = new URL(`management/instances/${instanceId}`, this.baseUrl);
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForQueryInstancesResponse());
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#delete--management-instances-$INSTANCE
   */
  async deleteInstance(token, instanceId, params = {}) {
    const url = new URL(`management/instances/${instanceId}`, this.baseUrl);
    if (params.purge !== void 0) {
      url.searchParams.set("purge", params.purge ? "YES" : "NO");
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    if (params.challengeIds && params.challengeIds.length > 0) {
      headers["Taler-Challenge-Ids"] = params.challengeIds.join(", ");
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        this.cacheManagementEvictor.notifySuccess(TalerMerchantManagementCacheEviction.DELETE_INSTANCE);
        return opEmptySuccess();
      }
      case HttpStatusCode.Accepted: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForChallengeResponse());
      }
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--management-instances-$INSTANCE-kyc
   */
  async getIntanceKycStatus(token, instanceId, params) {
    const url = new URL(`management/instances/${instanceId}/kyc`, this.baseUrl);
    if (params.wireHash) {
      url.searchParams.set("h_wire", params.wireHash);
    }
    if (params.exchangeURL) {
      url.searchParams.set("exchange_url", params.exchangeURL);
    }
    if (params.timeout) {
      url.searchParams.set("timeout_ms", String(params.timeout));
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Accepted:
        return opSuccessFromHttp(resp, codecForAccountKycRedirects());
      case HttpStatusCode.NoContent:
        return opEmptySuccess();
      case HttpStatusCode.NotFound:
        return opEmptySuccess();
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.ServiceUnavailable:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Conflict:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--management-instances-$INSTANCE-statistics-counter-$SLUG
   */
  async getStatisticsCounter(token, statSlug, params = {}) {
    const url = new URL(`private/statistics-counter/${statSlug}`, this.baseUrl);
    if (params.by) {
      url.searchParams.set("by", params.by);
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForStatisticsCounterResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.ServiceUnavailable:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-merchant.html#get--management-instances-$INSTANCE-statistics-amount-$SLUG
   */
  async getStatisticsAmount(token, statSlug, params = {}) {
    const url = new URL(`private/statistics-amount/${statSlug}`, this.baseUrl);
    if (params.by) {
      url.searchParams.set("by", params.by);
    }
    const headers = {};
    if (token) {
      headers.Authorization = makeBearerTokenAuthHeader(token);
    }
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      headers
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return opSuccessFromHttp(resp, codecForStatisticsAmountResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.Unauthorized:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.BadGateway:
        return opKnownHttpFailure(resp.status, resp);
      case HttpStatusCode.ServiceUnavailable:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};

// ../taler-util/lib/http-client/mailbox.js
var TalerMailboxInstanceHttpClient = class _TalerMailboxInstanceHttpClient {
  constructor(baseUrl, httpClient, cancellationToken) {
    this.baseUrl = baseUrl;
    this.httpLib = httpClient ?? createPlatformHttpLib();
    this.cancellationToken = cancellationToken;
  }
  static isCompatible(version2) {
    const compare2 = LibtoolVersion.compare(_TalerMailboxInstanceHttpClient.PROTOCOL_VERSION, version2);
    return compare2?.compatible ?? false;
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#get--config
   */
  async getConfig() {
    const url = new URL(`/config`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET"
    });
    switch (resp.status) {
      case HttpStatusCode.Ok:
        return carefullyParseConfig("taler-mailbox", _TalerMailboxInstanceHttpClient.PROTOCOL_VERSION, resp, codecForTalerMailboxConfigResponse());
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#post--$H_MAILBOX
   */
  async sendMessage(args) {
    const { h_address: hAddress, body } = args;
    const url = new URL(`${hAddress.toUpperCase()}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body,
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        return opEmptySuccess();
      }
      case HttpStatusCode.PaymentRequired: {
        return opKnownHttpFailure(resp.status, resp);
      }
      case HttpStatusCode.Forbidden: {
        return opKnownHttpFailure(resp.status, resp);
      }
      case HttpStatusCode.TooManyRequests: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForTalerMailboxRateLimitedResponse());
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#get--$H_MAILBOX
   */
  async getMessages(args) {
    const { hMailbox } = args;
    const url = new URL(`${hMailbox.toUpperCase()}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        const uintar = await resp.bytes();
        const etag = resp.headers.get("etag");
        const index2 = etag ? etag : "0";
        return opFixedSuccess({ messages: uintar, etag: index2 });
      }
      case HttpStatusCode.NoContent: {
        return opEmptySuccess();
      }
      case HttpStatusCode.TooManyRequests: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForTalerMailboxRateLimitedResponse());
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#delete--$ADDRESS
   */
  async deleteMessages(args) {
    const { mailboxConf, matchIf: etag, count, signature } = args;
    const mailboxPubkeyString = encodeCrock(eddsaGetPublic(decodeCrock(mailboxConf.privateKey)));
    const url = new URL(`${mailboxPubkeyString.toUpperCase()}?count=${count}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "DELETE",
      headers: {
        "If-Match": etag,
        "Taler-Mailbox-Delete-Signature": signature
      },
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        return opEmptySuccess();
      }
      case HttpStatusCode.Forbidden:
      case HttpStatusCode.NotFound:
        return opKnownHttpFailure(resp.status, resp);
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#get--info-$H_MAILBOX
   */
  async getMailboxInfo(hMailbox) {
    const url = new URL(`info/${hMailbox.toUpperCase()}`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "GET",
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.Ok: {
        return opSuccessFromHttp(resp, codecForTalerMailboxMetadata());
      }
      case HttpStatusCode.NotFound: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForEmptyObject());
      }
      case HttpStatusCode.TooManyRequests: {
        return opKnownAlternativeHttpFailure(resp, resp.status, codecForTalerMailboxRateLimitedResponse());
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
  /**
   * https://docs.taler.net/core/api-mailbox.html#post--register
   */
  async registerMailbox(req) {
    const url = new URL(`register`, this.baseUrl);
    const resp = await this.httpLib.fetch(url.href, {
      method: "POST",
      body: req,
      cancellationToken: this.cancellationToken
    });
    switch (resp.status) {
      case HttpStatusCode.NoContent: {
        return opFixedSuccess({ status: "ok" });
      }
      case HttpStatusCode.Forbidden: {
        return opKnownHttpFailure(resp.status, resp);
      }
      case HttpStatusCode.PaymentRequired: {
        return { type: "fail", case: resp.status, body: { status: "payment-required", talerUri: resp.headers.get("Taler") } };
      }
      default:
        return opUnknownHttpFailure(resp);
    }
  }
};
TalerMailboxInstanceHttpClient.PROTOCOL_VERSION = "1:0:0";

// ../taler-util/lib/i18n.js
var jedLib = __toESM(require_jed(), 1);
var logger7 = new Logger("i18n/index.ts");
var jed = void 0;
function setupI18n(lang, strings2) {
  lang = lang.replace("_", "-");
  if (!strings2[lang]) {
    strings2[lang] = {};
  }
  jed = new jedLib.Jed(strings2[lang]);
}
function toI18nString(stringSeq) {
  let s6 = "";
  for (let i5 = 0; i5 < stringSeq.length; i5++) {
    s6 += stringSeq[i5];
    if (i5 < stringSeq.length - 1) {
      s6 += `%${i5 + 1}$s`;
    }
  }
  return s6;
}
function singular(stringSeq, ...values) {
  const s6 = toI18nString(stringSeq);
  if (!s6)
    return "";
  const tr = jed.translate(s6).ifPlural(1, s6).fetch(...values);
  return tr;
}
function withContext(ctx) {
  return function(t5, ...v3) {
    const s6 = toI18nString(t5);
    const tr = jed.translate(s6).withContext(ctx).ifPlural(1, s6).fetch(...v3);
    return tr;
  };
}
function translate(stringSeq, ...values) {
  const s6 = toI18nString(stringSeq);
  if (!s6)
    return [];
  const translation = jed.ngettext(s6, s6, 1);
  return replacePlaceholderWithValues(translation, values);
}
function Translate({ children, debug, context: ctx }) {
  const c5 = [].concat(children);
  const s6 = stringifyArray(c5);
  if (!s6)
    return [];
  const translation = ctx ? jed.npgettext(ctx, s6, s6, 1) : jed.ngettext(s6, s6, 1);
  if (debug) {
    console.log("looking for ", s6, "got", translation);
  }
  return replacePlaceholderWithValues(translation, c5);
}
function replacePlaceholderWithValues(translation, childArray) {
  const tr = translation.split(/%(\d+)\$s/);
  const placeholderChildren = [];
  for (let i5 = 0; i5 < childArray.length; i5++) {
    const x6 = childArray[i5];
    if (x6 === void 0) {
      continue;
    } else if (typeof x6 === "string") {
      continue;
    } else {
      placeholderChildren.push(x6);
    }
  }
  const result = [];
  for (let i5 = 0; i5 < tr.length; i5++) {
    if (i5 % 2 == 0) {
      result.push(tr[i5]);
    } else {
      const childIdx = Number.parseInt(tr[i5]) - 1;
      result.push(placeholderChildren[childIdx]);
    }
  }
  return result;
}
function stringifyArray(children) {
  let n2 = 1;
  const ss = children.map((c5) => {
    if (typeof c5 === "string") {
      return c5;
    }
    return `%${n2++}$s`;
  });
  const s6 = ss.join("").replace(/ +/g, " ").trim();
  return s6;
}
var i18n = {
  str: singular,
  ctx: withContext,
  singular,
  Translate,
  translate
};

// ../taler-util/lib/promises.js
function openPromise() {
  let resolve2 = null;
  let promiseReject = null;
  const promise = new Promise((res, rej) => {
    resolve2 = res;
    promiseReject = rej;
  });
  if (!(resolve2 && promiseReject)) {
    throw Error("JS implementation is broken");
  }
  const result = { resolve: resolve2, reject: promiseReject, promise };
  function saveLastError(reason) {
    result.lastError = reason;
    promiseReject(reason);
  }
  result.reject = saveLastError;
  return result;
}

// ../taler-util/lib/longpool-queue.js
var logger8 = new Logger("longpoll-queue.ts");
var PERMITS = 20;
var LongpollQueue = class {
  constructor() {
    this.idCounter = 0;
    this.queue = [];
    this.permits = PERMITS;
  }
  async run(url, cancellationToken, f3) {
    const hostname = url.hostname;
    const rid = this.idCounter++;
    const triggerNextLongpoll = () => {
      logger8.trace(`cleaning up after long-poll ${rid} to ${hostname}`);
      const next = this.queue.shift();
      if (next != null) {
        next();
      } else {
        this.permits++;
      }
    };
    const doRunLongpoll = async () => {
      const numWaiting = this.queue.length;
      const numConcurrent = PERMITS - this.permits;
      logger8.info(`running long-poll ${rid} to ${hostname} with ${numWaiting} waiting and ${numConcurrent} running`);
      try {
        const timeoutMs = Math.round(Math.max(1e4, 3e4 / (numWaiting + 1)));
        return await f3(timeoutMs);
      } finally {
        triggerNextLongpoll();
      }
    };
    if (this.permits > 0) {
      this.permits--;
      return doRunLongpoll();
    } else {
      logger8.info(`long-poll ${rid} to ${hostname} queued`);
      const promcap = openPromise();
      this.queue.push(promcap.resolve);
      try {
        await cancellationToken.racePromise(promcap.promise);
      } finally {
        logger8.info(`long-poll ${rid} to ${hostname} cancelled while queued`);
        triggerNextLongpoll();
      }
      return doRunLongpoll();
    }
  }
};

// ../taler-util/lib/notifications.js
var NotificationType;
(function(NotificationType2) {
  NotificationType2["BalanceChange"] = "balance-change";
  NotificationType2["BankAccountChange"] = "bank-account-change";
  NotificationType2["BackupOperationError"] = "backup-error";
  NotificationType2["ContactAdded"] = "contact-added";
  NotificationType2["ContactDeleted"] = "contact-deleted";
  NotificationType2["MailboxMessageAdded"] = "mailbox-message-added";
  NotificationType2["MailboxMessageDeleted"] = "mailbox-message-deleted";
  NotificationType2["TransactionStateTransition"] = "transaction-state-transition";
  NotificationType2["ExchangeStateTransition"] = "exchange-state-transition";
  NotificationType2["Idle"] = "idle";
  NotificationType2["TaskObservabilityEvent"] = "task-observability-event";
  NotificationType2["RequestObservabilityEvent"] = "request-observability-event";
})(NotificationType || (NotificationType = {}));
var ObservabilityEventType;
(function(ObservabilityEventType2) {
  ObservabilityEventType2["HttpFetchStart"] = "http-fetch-start";
  ObservabilityEventType2["HttpFetchFinishError"] = "http-fetch-finish-error";
  ObservabilityEventType2["HttpFetchFinishSuccess"] = "http-fetch-finish-success";
  ObservabilityEventType2["DbQueryStart"] = "db-query-start";
  ObservabilityEventType2["DbQueryFinishSuccess"] = "db-query-finish-success";
  ObservabilityEventType2["DbQueryFinishError"] = "db-query-finish-error";
  ObservabilityEventType2["RequestStart"] = "request-start";
  ObservabilityEventType2["RequestFinishSuccess"] = "request-finish-success";
  ObservabilityEventType2["RequestFinishError"] = "request-finish-error";
  ObservabilityEventType2["TaskStart"] = "task-start";
  ObservabilityEventType2["TaskStop"] = "task-stop";
  ObservabilityEventType2["TaskReset"] = "task-reset";
  ObservabilityEventType2["ShepherdTaskResult"] = "shepherd-task-result";
  ObservabilityEventType2["DeclareTaskDependency"] = "declare-task-dependency";
  ObservabilityEventType2["CryptoStart"] = "crypto-start";
  ObservabilityEventType2["CryptoFinishSuccess"] = "crypto-finish-success";
  ObservabilityEventType2["CryptoFinishError"] = "crypto-finish-error";
  ObservabilityEventType2["Message"] = "message";
  ObservabilityEventType2["DeclareConcernsTransaction"] = "declare-concerns-transaction";
})(ObservabilityEventType || (ObservabilityEventType = {}));

// ../taler-util/lib/observability.js
var seqId = 1e3;
var ObservableHttpClientLibrary = class {
  constructor(impl, oc) {
    this.impl = impl;
    this.oc = oc;
    this.cancelatorById = /* @__PURE__ */ new Map();
  }
  cancelRequest(id) {
    const cancelator = this.cancelatorById.get(id);
    if (!cancelator)
      return;
    cancelator.cancel();
  }
  async fetch(url, opt) {
    const id = `req-${seqId}`;
    seqId = seqId + 1;
    const cancelator = CancellationToken.create();
    if (opt?.cancellationToken) {
      opt.cancellationToken.onCancelled(cancelator.cancel);
    }
    this.cancelatorById.set(id, cancelator);
    this.oc.observe({
      id,
      when: AbsoluteTime.now(),
      type: ObservabilityEventType.HttpFetchStart,
      url
    });
    const optsWithCancel = opt ?? {};
    optsWithCancel.cancellationToken = cancelator.token;
    try {
      const res = await this.impl.fetch(url, optsWithCancel);
      this.oc.observe({
        id,
        when: AbsoluteTime.now(),
        type: ObservabilityEventType.HttpFetchFinishSuccess,
        url,
        status: res.status
      });
      return res;
    } catch (e5) {
      this.oc.observe({
        id,
        when: AbsoluteTime.now(),
        type: ObservabilityEventType.HttpFetchFinishError,
        url,
        error: getErrorDetailFromException(e5)
      });
      throw e5;
    } finally {
      this.cancelatorById.delete(id);
    }
  }
};

// ../taler-util/lib/qr.js
function encodePaytoAsSwissQrBill(paytoUri) {
  const parsedPayto = parsePaytoUri(paytoUri);
  if (!parsedPayto) {
    throw Error("invalid payto URI");
  }
  if (parsedPayto.targetType !== "iban") {
    return { type: "skip" };
  }
  const amountStr = parsedPayto.params["amount"];
  if (amountStr === void 0) {
    return { type: "skip" };
  }
  const targetPathParts = parsedPayto.targetPath.split("/");
  const beneficiaryIban = targetPathParts[targetPathParts.length - 1];
  const countryCode = beneficiaryIban.slice(0, 2).toUpperCase();
  if (countryCode !== "CH") {
    return { type: "skip" };
  }
  const lines = [
    "SPC",
    // QRType
    "0200",
    // Version
    "1",
    // Character set (1: UTF-8)
    beneficiaryIban,
    // Beneficiary IBAN
    // Group: Beneficiary
    "S",
    // Address type (S: structured)
    parsedPayto.params["receiver-name"],
    // Beneficiary name
    "",
    // street
    "",
    // apt. nr.
    parsedPayto.params["receiver-postal-code"],
    // town, // postal code
    parsedPayto.params["receiver-town"],
    // town
    countryCode,
    // Country
    // Group: Ultimate Debtor (not used in version 0200)
    "",
    // Ultimate Debtor Address type (S: structured)
    "",
    // Ultimate Debtor name
    "",
    // Ultimate Debtor street
    "",
    // Ultimate Debtor apt. nr
    "",
    // Ultimate Debtor postal code
    "",
    // Ultimate Debtor town
    "",
    // Ultimate Debtor country
    // Group: Amount
    Amounts.stringifyValue(amountStr, 2),
    // Amount
    Amounts.currencyOf(amountStr),
    // Currency
    // Group: Debtor
    "",
    // Address type (S: structured)
    "",
    // Debtor name
    "",
    // Debtor street
    "",
    // Debtor apt. nr
    "",
    // Debtor postal code
    "",
    // Debtor town
    "",
    // Debtor country
    // Group: Reference
    "NON",
    // reference type
    "",
    // Reference
    // Group: Additional Information
    parsedPayto.params["message"],
    // Unstructured data
    "EPD"
    // End of payment data
  ];
  return {
    type: "ok",
    qrContent: lines.join("\n")
  };
}
function encodePaytoAsEpcQr(paytoUri) {
  const parsedPayto = parsePaytoUri(paytoUri);
  if (!parsedPayto) {
    throw Error("invalid payto URI");
  }
  if (parsedPayto.targetType !== "iban") {
    return { type: "skip" };
  }
  const amountStr = parsedPayto.params["amount"];
  const targetPathParts = parsedPayto.targetPath.split("/");
  const beneficiaryIban = targetPathParts[targetPathParts.length - 1];
  const countryCode = beneficiaryIban.slice(0, 2).toUpperCase();
  switch (countryCode) {
    case "CH":
      return { type: "skip" };
  }
  const amt = amountStr !== void 0 ? `${Amounts.currencyOf(amountStr)}${Amounts.stringifyValue(amountStr, 2)}` : "";
  const lines = [
    "BCD",
    // service tag
    "002",
    // version
    "1",
    // character set (1: UTF-8)
    "SCT",
    // Identification
    "",
    // optional BIC
    parsedPayto.params["receiver-name"],
    // Beneficiary name
    beneficiaryIban,
    // Beneficiary IBAN
    amt,
    // Amount (optional)
    "",
    // AT-44 Purpose
    parsedPayto.params["message"]
    // AT-05 Unstructured remittance information
  ];
  return {
    type: "ok",
    qrContent: lines.join("\n")
  };
}
function getQrCodesForPayto(paytoUri) {
  const res = [];
  {
    const qr = encodePaytoAsEpcQr(paytoUri);
    if (qr.type == "ok") {
      res.push({
        type: "epc-qr",
        qrContent: qr.qrContent
      });
    }
  }
  {
    const qr = encodePaytoAsSwissQrBill(paytoUri);
    if (qr.type == "ok") {
      res.push({
        type: "spc",
        qrContent: qr.qrContent
      });
    }
  }
  return res;
}

// ../taler-util/lib/RequestThrottler.js
var logger9 = new Logger("RequestThrottler.ts");
var MAX_PER_SECOND = 100;
var MAX_PER_MINUTE = 500;
var MAX_PER_HOUR = 2e3;
var OriginState = class {
  constructor() {
    this.tokensSecond = MAX_PER_SECOND;
    this.tokensMinute = MAX_PER_MINUTE;
    this.tokensHour = MAX_PER_HOUR;
    this.lastUpdate = AbsoluteTime.now();
  }
  refill() {
    const now2 = AbsoluteTime.now();
    if (AbsoluteTime.cmp(now2, this.lastUpdate) < 0) {
      this.lastUpdate = now2;
      return;
    }
    const d6 = AbsoluteTime.difference(now2, this.lastUpdate);
    if (d6.d_ms === "forever") {
      throw Error("assertion failed");
    }
    if (d6.d_ms < 1e3 / MAX_PER_SECOND) {
      return;
    }
    this.tokensSecond = Math.min(MAX_PER_SECOND, this.tokensSecond + d6.d_ms / 1e3 * MAX_PER_SECOND);
    this.tokensMinute = Math.min(MAX_PER_MINUTE, this.tokensMinute + d6.d_ms / 1e3 / 60 * MAX_PER_MINUTE);
    this.tokensHour = Math.min(MAX_PER_HOUR, this.tokensHour + d6.d_ms / 1e3 / 60 / 60 * MAX_PER_HOUR);
    this.lastUpdate = now2;
  }
  /**
   * Return true if the request for this origin should be throttled.
   * Otherwise, take a token out of the respective buckets.
   */
  applyThrottle() {
    this.refill();
    if (this.tokensSecond < 1) {
      logger9.warn("request throttled (per second limit exceeded)");
      return true;
    }
    if (this.tokensMinute < 1) {
      logger9.warn("request throttled (per minute limit exceeded)");
      return true;
    }
    if (this.tokensHour < 1) {
      logger9.warn("request throttled (per hour limit exceeded)");
      return true;
    }
    this.tokensSecond--;
    this.tokensMinute--;
    this.tokensHour--;
    return false;
  }
};
var RequestThrottler = class {
  constructor() {
    this.perOriginInfo = {};
  }
  /**
   * Get the throttling state for an origin, or
   * initialize if no state is associated with the
   * origin yet.
   */
  getState(origin) {
    const s6 = this.perOriginInfo[origin];
    if (s6) {
      return s6;
    }
    const ns = this.perOriginInfo[origin] = new OriginState();
    return ns;
  }
  /**
   * Apply throttling to a request.
   *
   * @returns whether the request should be throttled.
   */
  applyThrottle(requestUrl) {
    const origin = new URL(requestUrl).origin;
    return this.getState(origin).applyThrottle();
  }
  /**
   * Get the throttle statistics for a particular URL.
   */
  getThrottleStats(requestUrl) {
    const origin = new URL(requestUrl).origin;
    const state = this.getState(origin);
    return {
      tokensHour: state.tokensHour,
      tokensMinute: state.tokensMinute,
      tokensSecond: state.tokensSecond,
      maxTokensHour: MAX_PER_HOUR,
      maxTokensMinute: MAX_PER_MINUTE,
      maxTokensSecond: MAX_PER_SECOND
    };
  }
};

// ../taler-util/lib/ReserveTransaction.js
var ReserveTransactionType;
(function(ReserveTransactionType2) {
  ReserveTransactionType2["Withdraw"] = "WITHDRAW";
  ReserveTransactionType2["Credit"] = "CREDIT";
  ReserveTransactionType2["Recoup"] = "RECOUP";
  ReserveTransactionType2["Closing"] = "CLOSING";
})(ReserveTransactionType || (ReserveTransactionType = {}));

// ../taler-util/lib/rfc3548.js
var encTable2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
function encodeRfc3548Base32(data) {
  const dataBytes = new Uint8Array(data);
  let sb = "";
  const size = data.byteLength;
  let bitBuf = 0;
  let numBits = 0;
  let pos = 0;
  while (pos < size || numBits > 0) {
    if (pos < size && numBits < 5) {
      const d6 = dataBytes[pos++];
      bitBuf = bitBuf << 8 | d6;
      numBits += 8;
    }
    if (numBits < 5) {
      bitBuf = bitBuf << 5 - numBits;
      numBits = 5;
    }
    const v3 = bitBuf >>> numBits - 5 & 31;
    sb += encTable2[v3];
    numBits -= 5;
  }
  return sb;
}
function isRfc3548Base32Charset(s6) {
  for (let idx = 0; idx < s6.length; idx++) {
    const c5 = s6.charAt(idx);
    if (encTable2.indexOf(c5) === -1)
      return false;
  }
  return true;
}
function randomRfc3548Base32Key() {
  const buf = getRandomBytes(20);
  return encodeRfc3548Base32(buf);
}

// ../taler-util/lib/TaskThrottler.js
var logger10 = new Logger("OperationThrottler.ts");

// ../taler-util/lib/timer.js
var logger11 = new Logger("timer.ts");
var IntervalHandle = class {
  constructor(h5) {
    this.h = h5;
  }
  clear() {
    clearInterval(this.h);
  }
  /**
   * Make sure the event loop exits when the timer is the
   * only event left.  Has no effect in the browser.
   */
  unref() {
    if (typeof this.h === "object" && "unref" in this.h) {
      this.h.unref();
    }
  }
};
var TimeoutHandle = class {
  constructor(h5) {
    this.h = h5;
  }
  clear() {
    clearTimeout(this.h);
  }
  /**
   * Make sure the event loop exits when the timer is the
   * only event left.  Has no effect in the browser.
   */
  unref() {
    if (typeof this.h === "object" && "unref" in this.h) {
      this.h.unref();
    }
  }
};
var performanceNow = (() => {
  if (typeof process !== "undefined" && process.hrtime) {
    return () => {
      return process.hrtime.bigint();
    };
  }
  if (typeof performance !== "undefined") {
    return () => BigInt(Math.floor(performance.now() * 1e3)) * BigInt(1e3);
  }
  return () => BigInt((/* @__PURE__ */ new Date()).getTime()) * BigInt(1e3) * BigInt(1e3);
})();
var SetTimeoutTimerAPI = class {
  /**
   * Call a function every time the delay given in milliseconds passes.
   */
  every(delayMs2, callback2) {
    return new IntervalHandle(setInterval(callback2, delayMs2));
  }
  /**
   * Call a function after the delay given in milliseconds passes.
   */
  after(delayMs2, callback2) {
    return new TimeoutHandle(setTimeout(callback2, delayMs2));
  }
};
var timer = new SetTimeoutTimerAPI();

// ../taler-util/lib/types-taler-wallet-transactions.js
var TransactionMajorState;
(function(TransactionMajorState2) {
  TransactionMajorState2["None"] = "none";
  TransactionMajorState2["Pending"] = "pending";
  TransactionMajorState2["Done"] = "done";
  TransactionMajorState2["Aborting"] = "aborting";
  TransactionMajorState2["Aborted"] = "aborted";
  TransactionMajorState2["Dialog"] = "dialog";
  TransactionMajorState2["Finalizing"] = "finalizing";
  TransactionMajorState2["Suspended"] = "suspended";
  TransactionMajorState2["SuspendedFinalizing"] = "suspended-finalizing";
  TransactionMajorState2["SuspendedAborting"] = "suspended-aborting";
  TransactionMajorState2["Failed"] = "failed";
  TransactionMajorState2["Expired"] = "expired";
  TransactionMajorState2["Deleted"] = "deleted";
})(TransactionMajorState || (TransactionMajorState = {}));
var TransactionMinorState;
(function(TransactionMinorState2) {
  TransactionMinorState2["Unknown"] = "unknown";
  TransactionMinorState2["Deposit"] = "deposit";
  TransactionMinorState2["KycRequired"] = "kyc";
  TransactionMinorState2["KycInit"] = "kyc-init";
  TransactionMinorState2["MergeKycRequired"] = "merge-kyc";
  TransactionMinorState2["BalanceKycRequired"] = "balance-kyc";
  TransactionMinorState2["BalanceKycInit"] = "balance-kyc-init";
  TransactionMinorState2["KycAuthRequired"] = "kyc-auth";
  TransactionMinorState2["Track"] = "track";
  TransactionMinorState2["SubmitPayment"] = "submit-payment";
  TransactionMinorState2["RebindSession"] = "rebind-session";
  TransactionMinorState2["Refresh"] = "refresh";
  TransactionMinorState2["Pickup"] = "pickup";
  TransactionMinorState2["AutoRefund"] = "auto-refund";
  TransactionMinorState2["User"] = "user";
  TransactionMinorState2["Bank"] = "bank";
  TransactionMinorState2["Exchange"] = "exchange";
  TransactionMinorState2["ClaimProposal"] = "claim-proposal";
  TransactionMinorState2["CheckRefund"] = "check-refund";
  TransactionMinorState2["CreatePurse"] = "create-purse";
  TransactionMinorState2["DeletePurse"] = "delete-purse";
  TransactionMinorState2["RefreshExpired"] = "refresh-expired";
  TransactionMinorState2["Ready"] = "ready";
  TransactionMinorState2["Merge"] = "merge";
  TransactionMinorState2["Repurchase"] = "repurchase";
  TransactionMinorState2["BankRegisterReserve"] = "bank-register-reserve";
  TransactionMinorState2["BankConfirmTransfer"] = "bank-confirm-transfer";
  TransactionMinorState2["WithdrawCoins"] = "withdraw-coins";
  TransactionMinorState2["ExchangeWaitReserve"] = "exchange-wait-reserve";
  TransactionMinorState2["AbortingBank"] = "aborting-bank";
  TransactionMinorState2["Aborting"] = "aborting";
  TransactionMinorState2["Refused"] = "refused";
  TransactionMinorState2["Withdraw"] = "withdraw";
  TransactionMinorState2["MerchantOrderProposed"] = "merchant-order-proposed";
  TransactionMinorState2["Proposed"] = "proposed";
  TransactionMinorState2["RefundAvailable"] = "refund-available";
  TransactionMinorState2["AcceptRefund"] = "accept-refund";
  TransactionMinorState2["PaidByOther"] = "paid-by-other";
  TransactionMinorState2["CompletedByOtherWallet"] = "completed-by-other-wallet";
})(TransactionMinorState || (TransactionMinorState = {}));
var TransactionAction;
(function(TransactionAction2) {
  TransactionAction2["Delete"] = "delete";
  TransactionAction2["Suspend"] = "suspend";
  TransactionAction2["Resume"] = "resume";
  TransactionAction2["Abort"] = "abort";
  TransactionAction2["Fail"] = "fail";
  TransactionAction2["Retry"] = "retry";
})(TransactionAction || (TransactionAction = {}));
var TransactionType;
(function(TransactionType2) {
  TransactionType2["Withdrawal"] = "withdrawal";
  TransactionType2["InternalWithdrawal"] = "internal-withdrawal";
  TransactionType2["Payment"] = "payment";
  TransactionType2["Refund"] = "refund";
  TransactionType2["Refresh"] = "refresh";
  TransactionType2["Deposit"] = "deposit";
  TransactionType2["PeerPushDebit"] = "peer-push-debit";
  TransactionType2["PeerPushCredit"] = "peer-push-credit";
  TransactionType2["PeerPullDebit"] = "peer-pull-debit";
  TransactionType2["PeerPullCredit"] = "peer-pull-credit";
  TransactionType2["Recoup"] = "recoup";
  TransactionType2["DenomLoss"] = "denom-loss";
})(TransactionType || (TransactionType = {}));
var WithdrawalType;
(function(WithdrawalType2) {
  WithdrawalType2["TalerBankIntegrationApi"] = "taler-bank-integration-api";
  WithdrawalType2["ManualTransfer"] = "manual-transfer";
})(WithdrawalType || (WithdrawalType = {}));
var DenomLossEventType;
(function(DenomLossEventType2) {
  DenomLossEventType2["DenomExpired"] = "denom-expired";
  DenomLossEventType2["DenomVanished"] = "denom-vanished";
  DenomLossEventType2["DenomUnoffered"] = "denom-unoffered";
})(DenomLossEventType || (DenomLossEventType = {}));
var PaymentStatus;
(function(PaymentStatus2) {
  PaymentStatus2["Aborted"] = "aborted";
  PaymentStatus2["Failed"] = "failed";
  PaymentStatus2["Paid"] = "paid";
  PaymentStatus2["Accepted"] = "accepted";
})(PaymentStatus || (PaymentStatus = {}));

// ../taler-util/lib/transaction-test-data.js
var sampleWalletCoreTransactions = [
  {
    type: TransactionType.Payment,
    txState: {
      major: TransactionMajorState.Done
    },
    amountRaw: "KUDOS:10",
    amountEffective: "KUDOS:10",
    totalRefundRaw: "KUDOS:0",
    totalRefundEffective: "KUDOS:0",
    status: PaymentStatus.Paid,
    refundPending: void 0,
    posConfirmation: void 0,
    pending: false,
    refunds: [],
    timestamp: {
      t_s: 1677166045
    },
    transactionId: "txn:payment:NRRD9KJ8970P5HDAGPW1MBA6HZHB1XMFKF5M3CNR6WA0GT98DHY0",
    proposalId: "NRRD9KJ8970P5HDAGPW1MBA6HZHB1XMFKF5M3CNR6WA0GT98DHY0",
    info: {
      merchant: {
        name: "woocommerce",
        website: "woocommerce.demo.taler.net",
        email: "foo@example.com",
        address: {},
        jurisdiction: {}
      },
      orderId: "wc_order_KQCRldghIgDRB-100",
      products: [
        {
          description: "Using GCC",
          quantity: 1,
          price: "KUDOS:10",
          product_id: "28"
        }
      ],
      summary: "WooTalerShop #100",
      contractTermsHash: "A02E1M6ARWKBJ87K2TV4S6WQ4X5YH7BRVR6MYCHCTVAED8MBXTFD6PZ5Q50Y7Z5K18PYBTDA14NQ56XPC1VCQW1EVRWTSB7ZYT65B5G",
      fulfillmentUrl: "https://woocommerce.demo.taler.net/?wc-api=wc_gnutaler_gateway&order_id=wc_order_KQCRldghIgDRB-100"
    },
    refundQueryActive: false,
    frozen: false
  },
  {
    type: TransactionType.Refresh,
    txState: {
      major: TransactionMajorState.Pending
    },
    refreshReason: RefreshReason.PayMerchant,
    amountEffective: "KUDOS:0",
    amountRaw: "KUDOS:0",
    refreshInputAmount: "KUDOS:1.5",
    refreshOutputAmount: "KUDOS:1.4",
    originatingTransactionId: "txn:proposal:ZCGBZFE8KZ1CBYYGSC3ZC8E40KVJWV16VYCTHGC8FFSVZ5HD24BG",
    pending: true,
    timestamp: {
      t_s: 1681376214
    },
    transactionId: "txn:refresh:QQSWHHXCRQ269G0E3RW14JMC6F7NFDYDW26NSFHRTXSKDS6CMCZ0",
    frozen: false,
    error: {
      code: 7029,
      when: {
        t_ms: 1681376473665
      },
      hint: "Error (WALLET_REFRESH_GROUP_INCOMPLETE)",
      numErrors: 1,
      errors: [
        {
          code: 7001,
          when: {
            t_ms: 1681376473189
          },
          hint: "unexpected exception (message: exchange wire fee signature invalid)",
          stack: "    at validateWireInfo (../taler-wallet-core-qjs.mjs:23166)\n"
        }
      ]
    }
  }
];

// ../taler-util/lib/types-taler-mailbox.js
var codecForTalerMailboxConfigResponse = () => buildCodecForObject().property("version", codecForString()).property("name", codecForConstString("taler-mailbox")).property("monthly_fee", codecForAmountString()).property("registration_update_fee", codecForAmountString()).property("message_body_bytes", codecForNumber()).property("message_response_limit", codecForNumber()).property("delivery_period", codecForDuration).build("TalerMailboxApi.VersionResponse");
var codecForTalerMailboxMetadata = () => buildCodecForObject().property("signing_key", codecForEddsaPublicKey()).property("signing_key_type", codecForConstString("EdDSA")).property("encryption_key", codecForString()).property("encryption_key_type", codecForConstString("X25519")).property("expiration", codecForTimestamp).build("TalerMailboxApi.MailboxMessageKeys");
var codecForTalerMailboxRateLimitedResponse = () => buildCodecForObject().property("code", codecForNumber()).property("retry_delay", codecForDuration).property("hint", codecForString()).build("TalerMailboxApi.MailboxRateLimitedResponse");

// ../taler-util/lib/taler-signatures.js
function signAmlDecision(priv, decision) {
  const builder = buildSigPS(TalerSignaturePurpose.AML_DECISION);
  const flags = decision.keep_investigating ? 1 : 0;
  builder.put(timestampRoundedToBuffer(decision.decision_time));
  builder.put(timestampRoundedToBuffer(decision.attributes_expiration ?? TalerProtocolTimestamp.fromSeconds(0)));
  builder.put(decodeCrock(decision.h_payto));
  builder.put(hash2(stringToBytes(decision.justification)));
  builder.put(hash2(stringToBytes(canonicalJson(decision.properties) + "\0")));
  builder.put(hash2(stringToBytes(canonicalJson(decision.new_rules) + "\0")));
  if (decision.new_measures != null) {
    builder.put(hash2(stringToBytes(decision.new_measures)));
  } else {
    builder.put(new Uint8Array(64));
  }
  if (decision.attributes != null) {
    builder.put(hash2(stringToBytes(canonicalJson(decision.attributes) + "\0")));
  } else {
    builder.put(new Uint8Array(64));
  }
  builder.put(bufferForUint64(flags));
  const sigBlob = builder.build();
  return eddsaSign(sigBlob, priv);
}
function signAmlQuery(key) {
  const sigBlob = buildSigPS(TalerSignaturePurpose.AML_QUERY).build();
  return eddsaSign(sigBlob, key);
}

// ../taler-util/lib/taler-account-properties.js
var TalerAmlProperties = {
  /**
   * Description: Current note on the GWG file.
   *
   * GANA Type: String
   * Deployment: TOPS
   */
  FILE_NOTE: "FILE_NOTE",
  /**
   * Description: Customer name or internal alias.
   *
   * GANA Type: String
   * Deployment: TOPS
   */
  CUSTOMER_LABEL: "CUSTOMER_LABEL",
  /**
   * Description: Boolean flag indicating whether the account has been opened. The definition of opening an account is deployment-specific.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  ACCOUNT_OPEN: "ACCOUNT_OPEN",
  /**
   * Description: True if the customer is a domestic PEP.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  PEP_DOMESTIC: "PEP_DOMESTIC",
  /**
   * Description: True if the customer is a foreign PEP.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  PEP_FOREIGN: "PEP_FOREIGN",
  /**
   * Description: True if the customer is a international organization PEP.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  PEP_INTERNATIONAL_ORGANIZATION: "PEP_INTERNATIONAL_ORGANIZATION",
  /**
   * Description: True if the customer is a  high-risk business.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  HIGH_RISK_CUSTOMER: "HIGH_RISK_CUSTOMER",
  /**
   * Description: True if the customer is associated with a high-risk country.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  HIGH_RISK_COUNTRY: "HIGH_RISK_COUNTRY",
  /**
   * Description: The account has been marked as idle.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  ACCOUNT_IDLE: "ACCOUNT_IDLE",
  /**
   * Description: The MROS reporting state for the account.
   *
   * GANA Type: 'NONE' | 'INVESTIGATION_PENDING' | 'INVESTIGATION_COMPLETED_WITHOUT_SUSPICION' | 'REPORTED_SUSPICION_SIMPLE' | 'REPORTED_SUSPICION_SUBSTANTIATED'
   * Deployment: TOPS
   */
  INVESTIGATION_STATE: "INVESTIGATION_STATE",
  /**
   * Description: Informal reason why the AML investigation was triggered. Examples include suspicious transaction or (automated) sanction list match
   *
   * GANA Type: String
   * Deployment: TOPS
   */
  INVESTIGATION_TRIGGER: "INVESTIGATION_TRIGGER",
  /**
   * Description: Identifies the sanction list entry that the account matched against (best match, does not mean it was a good match)
   *
   * GANA Type: String
   * Deployment: TOPS
   */
  SANCTION_LIST_BEST_MATCH: "SANCTION_LIST_BEST_MATCH",
  /**
   * Description: Score for how good the sanction list match was (0: none, 10**9: perfect match)
   *
   * GANA Type: Integer
   * Deployment: TOPS
   */
  SANCTION_LIST_RATING: "SANCTION_LIST_RATING",
  /**
   * Description: Score for how much supporting data we had for the sanction list match (0: none, 10**9: all fields available)
   *
   * GANA Type: Integer
   * Deployment: TOPS
   */
  SANCTION_LIST_CONFIDENCE: "SANCTION_LIST_CONFIDENCE",
  /**
   * Description: Suppress flagging this account when it creates a hit on a sanctions list, this is a false-positive.
   *
   * GANA Type: Boolean
   * Deployment: TOPS
   */
  SANCTION_LIST_SUPPRESS: "SANCTION_LIST_SUPPRESS"
};

// ../taler-util/lib/aml/properties.js
var TOPS_AccountProperties = [
  TalerAmlProperties.FILE_NOTE,
  TalerAmlProperties.CUSTOMER_LABEL,
  TalerAmlProperties.ACCOUNT_OPEN,
  TalerAmlProperties.PEP_DOMESTIC,
  TalerAmlProperties.PEP_FOREIGN,
  TalerAmlProperties.PEP_INTERNATIONAL_ORGANIZATION,
  TalerAmlProperties.HIGH_RISK_CUSTOMER,
  TalerAmlProperties.HIGH_RISK_COUNTRY,
  TalerAmlProperties.ACCOUNT_IDLE,
  TalerAmlProperties.INVESTIGATION_TRIGGER,
  TalerAmlProperties.INVESTIGATION_STATE,
  TalerAmlProperties.SANCTION_LIST_BEST_MATCH,
  TalerAmlProperties.SANCTION_LIST_RATING,
  TalerAmlProperties.SANCTION_LIST_CONFIDENCE,
  TalerAmlProperties.SANCTION_LIST_SUPPRESS
];
var GLS_AccountProperties = [TalerAmlProperties.FILE_NOTE];
var KnownForms;
(function(KnownForms3) {
  KnownForms3[KnownForms3["vqf_902_1_customer"] = 0] = "vqf_902_1_customer";
  KnownForms3[KnownForms3["vqf_902_1_officer"] = 1] = "vqf_902_1_officer";
  KnownForms3[KnownForms3["vqf_902_4"] = 2] = "vqf_902_4";
  KnownForms3[KnownForms3["vqf_902_5"] = 3] = "vqf_902_5";
  KnownForms3[KnownForms3["vqf_902_9_customer"] = 4] = "vqf_902_9_customer";
  KnownForms3[KnownForms3["vqf_902_9_officer"] = 5] = "vqf_902_9_officer";
  KnownForms3[KnownForms3["vqf_902_11_customer"] = 6] = "vqf_902_11_customer";
  KnownForms3[KnownForms3["vqf_902_11_officer"] = 7] = "vqf_902_11_officer";
  KnownForms3[KnownForms3["vqf_902_12"] = 8] = "vqf_902_12";
  KnownForms3[KnownForms3["vqf_902_13"] = 9] = "vqf_902_13";
  KnownForms3[KnownForms3["vqf_902_14"] = 10] = "vqf_902_14";
  KnownForms3[KnownForms3["vqf_902_15"] = 11] = "vqf_902_15";
})(KnownForms || (KnownForms = {}));

// ../taler-util/lib/aml/events.js
var TOPS_AmlEventsName;
(function(TOPS_AmlEventsName2) {
  TOPS_AmlEventsName2["INCR_ACCOUNT_OPEN"] = "INCR_ACCOUNT_OPEN";
  TOPS_AmlEventsName2["DECR_ACCOUNT_OPEN"] = "DECR_ACCOUNT_OPEN";
  TOPS_AmlEventsName2["INCR_HIGH_RISK_CUSTOMER"] = "INCR_HIGH_RISK_CUSTOMER";
  TOPS_AmlEventsName2["DECR_HIGH_RISK_CUSTOMER"] = "DECR_HIGH_RISK_CUSTOMER";
  TOPS_AmlEventsName2["INCR_HIGH_RISK_COUNTRY"] = "INCR_HIGH_RISK_COUNTRY";
  TOPS_AmlEventsName2["DECR_HIGH_RISK_COUNTRY"] = "DECR_HIGH_RISK_COUNTRY";
  TOPS_AmlEventsName2["INCR_PEP"] = "INCR_PEP";
  TOPS_AmlEventsName2["DECR_PEP"] = "DECR_PEP";
  TOPS_AmlEventsName2["INCR_PEP_FOREIGN"] = "INCR_PEP_FOREIGN";
  TOPS_AmlEventsName2["DECR_PEP_FOREIGN"] = "DECR_PEP_FOREIGN";
  TOPS_AmlEventsName2["INCR_PEP_DOMESTIC"] = "INCR_PEP_DOMESTIC";
  TOPS_AmlEventsName2["DECR_PEP_DOMESTIC"] = "DECR_PEP_DOMESTIC";
  TOPS_AmlEventsName2["INCR_PEP_INTERNATIONAL_ORGANIZATION"] = "INCR_PEP_INTERNATIONAL_ORGANIZATION";
  TOPS_AmlEventsName2["DECR_PEP_INTERNATIONAL_ORGANIZATION"] = "DECR_PEP_INTERNATIONAL_ORGANIZATION";
  TOPS_AmlEventsName2["MROS_REPORTED_SUSPICION_SIMPLE"] = "MROS_REPORTED_SUSPICION_SIMPLE";
  TOPS_AmlEventsName2["MROS_REPORTED_SUSPICION_SUBSTANTIATED"] = "MROS_REPORTED_SUSPICION_SUBSTANTIATED";
  TOPS_AmlEventsName2["INCR_INVESTIGATION_CONCLUDED"] = "INCR_INVESTIGATION_CONCLUDED";
  TOPS_AmlEventsName2["DECR_INVESTIGATION_CONCLUDED"] = "DECR_INVESTIGATION_CONCLUDED";
})(TOPS_AmlEventsName || (TOPS_AmlEventsName = {}));
var GLS_AmlEventsName;
(function(GLS_AmlEventsName2) {
  GLS_AmlEventsName2["ACCOUNT_OPENED"] = "ACCOUNT_OPENED";
  GLS_AmlEventsName2["ACCOUNT_CLOSED"] = "ACCOUNT_CLOSED";
})(GLS_AmlEventsName || (GLS_AmlEventsName = {}));
var KnownForms2;
(function(KnownForms3) {
  KnownForms3[KnownForms3["vqf_902_1_customer"] = 0] = "vqf_902_1_customer";
  KnownForms3[KnownForms3["vqf_902_1_officer"] = 1] = "vqf_902_1_officer";
  KnownForms3[KnownForms3["vqf_902_4"] = 2] = "vqf_902_4";
  KnownForms3[KnownForms3["vqf_902_5"] = 3] = "vqf_902_5";
  KnownForms3[KnownForms3["vqf_902_9_customer"] = 4] = "vqf_902_9_customer";
  KnownForms3[KnownForms3["vqf_902_9_officer"] = 5] = "vqf_902_9_officer";
  KnownForms3[KnownForms3["vqf_902_11_customer"] = 6] = "vqf_902_11_customer";
  KnownForms3[KnownForms3["vqf_902_11_officer"] = 7] = "vqf_902_11_officer";
  KnownForms3[KnownForms3["vqf_902_12"] = 8] = "vqf_902_12";
  KnownForms3[KnownForms3["vqf_902_13"] = 9] = "vqf_902_13";
  KnownForms3[KnownForms3["vqf_902_14"] = 10] = "vqf_902_14";
  KnownForms3[KnownForms3["vqf_902_15"] = 11] = "vqf_902_15";
})(KnownForms2 || (KnownForms2 = {}));

// ../taler-util/lib/aml/reporting.js
var EventReporting_TOPS_queries = {
  // Number of accounts that are opened
  accounts_open_incr: {
    event: TOPS_AmlEventsName.INCR_ACCOUNT_OPEN,
    start: void 0,
    end: void 0
  },
  accounts_open_decr: {
    event: TOPS_AmlEventsName.DECR_ACCOUNT_OPEN,
    start: void 0,
    end: void 0
  },
  // Number of new GwG files in the last year
  gwg_files_new_last_year: {
    event: TOPS_AmlEventsName.INCR_ACCOUNT_OPEN,
    start: AbsoluteTime.addDuration(AbsoluteTime.now(), Duration.fromSpec({ years: -1 })),
    end: AbsoluteTime.now()
  },
  // Number of GwG files closed in the last year
  gwg_files_closed_last_year: {
    event: TOPS_AmlEventsName.DECR_ACCOUNT_OPEN,
    start: AbsoluteTime.addDuration(AbsoluteTime.now(), Duration.fromSpec({ years: -1 })),
    end: AbsoluteTime.now()
  },
  // Number of GwG files of high-risk customers
  gwg_files_high_risk_incr: {
    event: TOPS_AmlEventsName.INCR_HIGH_RISK_CUSTOMER,
    //FIXME: spec refers to INCR_HIGH_RISK
    start: void 0,
    end: void 0
  },
  gwg_files_high_risk_decr: {
    event: TOPS_AmlEventsName.DECR_HIGH_RISK_CUSTOMER,
    start: void 0,
    end: void 0
  },
  // Number of GwG files managed with “increased risk” due to PEP status
  gwg_files_pep_incr: {
    event: TOPS_AmlEventsName.INCR_PEP,
    start: void 0,
    end: void 0
  },
  gwg_files_pep_decr: {
    event: TOPS_AmlEventsName.DECR_PEP,
    start: void 0,
    end: void 0
  },
  // Number of MROS reports based on Art 9 Abs. 1 GwG (per year)
  mros_reports_art9_last_year: {
    event: TOPS_AmlEventsName.MROS_REPORTED_SUSPICION_SUBSTANTIATED,
    start: AbsoluteTime.addDuration(AbsoluteTime.now(), Duration.fromSpec({ years: -1 })),
    end: AbsoluteTime.now()
  },
  // Number of MROS reports based on Art 305ter Abs. 2 StGB (per year)
  mros_reports_art305_last_year: {
    event: TOPS_AmlEventsName.MROS_REPORTED_SUSPICION_SIMPLE,
    start: AbsoluteTime.addDuration(AbsoluteTime.now(), Duration.fromSpec({ years: -1 })),
    end: AbsoluteTime.now()
  },
  // Number of customers involved in proceedings for which Art 6 GwG did apply
  accounts_involed_in_proceedings_last_year: {
    event: TOPS_AmlEventsName.INCR_INVESTIGATION_CONCLUDED,
    //FIXME: spec refers to INCR_INVESTIGATION
    start: AbsoluteTime.addDuration(AbsoluteTime.now(), Duration.fromSpec({ years: -1 })),
    end: AbsoluteTime.now()
  }
};

// ../taler-util/lib/index.browser.js
loadBrowserPrng();

// ../web-util/lib/index.browser.mjs
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_compat_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_hooks_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_preact_module();
init_hooks_module();
var __defProp2 = Object.defineProperty;
var __export2 = (target, all) => {
  for (var name in all)
    __defProp2(target, name, { get: all[name], enumerable: true });
};
var utils_exports = {};
__export2(utils_exports, {
  compose: () => compose,
  composeRef: () => composeRef,
  doAutoFocus: () => doAutoFocus,
  doAutoFocusWithScroll: () => doAutoFocusWithScroll,
  onComponentUnload: () => onComponentUnload,
  preconnectAs: () => preconnectAs,
  recursive: () => recursive,
  saveRef: () => saveRef,
  saveVNodeForInspection: () => saveVNodeForInspection
});
function compose(hook, viewMap) {
  function withHook(stateHook) {
    function ComposedComponent() {
      const state = stateHook();
      if (typeof state === "function") {
        const subComponent = withHook(state);
        return h(subComponent, {});
      }
      const statusName = state.status;
      const viewComponent = viewMap[statusName];
      return h(viewComponent, state);
    }
    return ComposedComponent;
  }
  return (p4) => {
    const h54 = withHook(() => hook(p4));
    return h54();
  };
}
function recursive(hook) {
  function withHook(stateHook) {
    function ComposedComponent() {
      const state = stateHook();
      if (typeof state === "function") {
        const subComponent = withHook(state);
        return h(subComponent, {});
      }
      return state;
    }
    return ComposedComponent;
  }
  return (p4) => {
    const h54 = withHook(() => hook(p4));
    return h54();
  };
}
function onComponentUnload(callback2) {
  const ref = _2();
  ref.current = callback2;
  h2(() => {
    return () => {
      ref.current();
    };
  }, []);
}
var ownerDocument = typeof document === "undefined" ? null : document;
var preconnectsSet = /* @__PURE__ */ new Set();
function preconnectAs(pre) {
  if (ownerDocument) {
    pre.forEach(({ rel, href, crossOrigin }) => {
      const key = `${rel}${href}${crossOrigin}`;
      if (preconnectsSet.has(key))
        return;
      preconnectsSet.add(key);
      const instance = ownerDocument.createElement("link");
      instance.setAttribute("rel", rel);
      instance.setAttribute("crossOrigin", crossOrigin);
      instance.setAttribute("href", href);
      ownerDocument.head.appendChild(instance);
    });
  }
}
function composeRef(...fn2) {
  return (element) => {
    fn2.forEach((handler) => {
      handler(element);
    });
  };
}
function saveRef(ref) {
  return (element) => {
    if (element) {
      ref.current = element;
    }
  };
}
function doAutoFocus(element) {
  if (element) {
    setTimeout(() => {
      element.focus({ preventScroll: true });
    }, 100);
  }
}
function doAutoFocusWithScroll(element) {
  if (element) {
    setTimeout(() => {
      element.focus({ preventScroll: true });
      element.scrollIntoView({
        behavior: "smooth",
        block: "center",
        inline: "center"
      });
    }, 100);
  }
}
function saveVNodeForInspection(obj) {
  window["showVNodeInfo"] = function showVNodeInfo() {
    inspect(obj);
  };
  return obj;
}
function inspect(obj) {
  if (!obj)
    return;
  if (obj.__c && obj.__c.__H) {
    const componentName = obj.__c.constructor.name;
    const hookState = obj.__c.__H;
    const stateList = hookState.__;
    console.log("==============", componentName);
    stateList.forEach((hook) => {
      const { __: value, c: context, __h: factory, __H: args } = hook;
      if (typeof context !== "undefined") {
        const { __c: contextId } = context;
        console.log("context:", contextId, hook);
      } else if (typeof factory === "function") {
        console.log("memo:", value, "deps:", args);
      } else if (typeof value === "function") {
        const effectName = value.name;
        console.log("effect:", effectName, "deps:", args);
      } else if (typeof value.current !== "undefined") {
        const ref = value.current;
        console.log("ref:", ref instanceof Element ? ref.outerHTML : ref);
      } else if (value instanceof Array) {
        console.log("state:", value[0]);
      } else {
        console.log(hook);
      }
    });
  }
  const children = obj.__k;
  if (children instanceof Array) {
    children.forEach((e22) => inspect(e22));
  } else {
    inspect(children);
  }
}
function Attention({ type = "info", title, children, onClose, timeout = Duration.getForever() }) {
  return /* @__PURE__ */ h("div", { class: `group attention-${type} mt-2 shadow-lg` }, /* @__PURE__ */ h("div", { "data-timed": timeout.d_ms !== "forever", class: "rounded-md data-[timed=true]:rounded-b-none group-[.attention-info]:bg-blue-50 group-[.attention-low]:bg-gray-100 group-[.attention-warning]:bg-yellow-50 group-[.attention-danger]:bg-red-50 group-[.attention-success]:bg-green-50 p-4 shadow" }, /* @__PURE__ */ h("div", { class: "flex" }, /* @__PURE__ */ h("div", null, type === "low" ? void 0 : /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", stroke: "none", viewBox: "0 0 24 24", fill: "currentColor", class: "w-8 h-8 group-[.attention-info]:text-blue-400 group-[.attention-warning]:text-yellow-400 group-[.attention-danger]:text-red-400 group-[.attention-success]:text-green-400" }, (() => {
    switch (type) {
      case "info":
        return /* @__PURE__ */ h("path", { "fill-rule": "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" });
      case "warning":
        return /* @__PURE__ */ h("path", { "fill-rule": "evenodd", d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" });
      case "danger":
        return /* @__PURE__ */ h("path", { "fill-rule": "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" });
      case "success":
        return /* @__PURE__ */ h("path", { "fill-rule": "evenodd", d: "M7.493 18.75c-.425 0-.82-.236-.975-.632A7.48 7.48 0 016 15.375c0-1.75.599-3.358 1.602-4.634.151-.192.373-.309.6-.397.473-.183.89-.514 1.212-.924a9.042 9.042 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75 2.25 2.25 0 012.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H14.23c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23h-.777zM2.331 10.977a11.969 11.969 0 00-.831 4.398 12 12 0 00.52 3.507c.26.85 1.084 1.368 1.973 1.368H4.9c.445 0 .72-.498.523-.898a8.963 8.963 0 01-.924-3.977c0-1.708.476-3.305 1.302-4.666.245-.403-.028-.959-.5-.959H4.25c-.832 0-1.612.453-1.918 1.227z" });
      default:
        assertUnreachable(type);
    }
  })())), /* @__PURE__ */ h("div", { class: "ml-3 w-full" }, /* @__PURE__ */ h("h3", { class: "text-sm font-bold group-[.attention-info]:text-blue-800 group-[.attention-success]:text-green-800 group-[.attention-warning]:text-yellow-800 group-[.attention-danger]:text-red-800" }, title), /* @__PURE__ */ h("div", { class: "mt-2 text-sm group-[.attention-info]:text-blue-700 group-[.attention-warning]:text-yellow-700 group-[.attention-danger]:text-red-700 group-[.attention-success]:text-green-700" }, children)), onClose && /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "font-semibold items-center rounded bg-transparent px-2 py-1 text-xs text-gray-900  hover:bg-gray-50",
      onClick: (e22) => {
        e22.preventDefault();
        onClose();
      }
    },
    /* @__PURE__ */ h("svg", { class: "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, /* @__PURE__ */ h("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }))
  )))), timeout.d_ms === "forever" ? void 0 : /* @__PURE__ */ h("div", { class: "meter group-[.attention-info]:bg-blue-50 group-[.attention-low]:bg-gray-100 group-[.attention-warning]:bg-yellow-50 group-[.attention-danger]:bg-red-50 group-[.attention-success]:bg-green-50 h-1 relative overflow-hidden -mt-1" }, /* @__PURE__ */ h("span", { class: "w-full h-full block" }, /* @__PURE__ */ h("span", { class: "h-full block progress group-[.attention-info]:bg-blue-600 group-[.attention-low]:bg-gray-600 group-[.attention-warning]:bg-yellow-600 group-[.attention-danger]:bg-red-600 group-[.attention-success]:bg-green-600" }))));
}
function DebugInfo({ error: error2 }) {
  const { i18n: i18n4 } = useTranslationContext();
  const [{ showDebugInfo }, update] = useCommonPreferences();
  return /* @__PURE__ */ h("div", { class: "text-[grey]" }, /* @__PURE__ */ h("button", { onClick: () => update("showDebugInfo", !showDebugInfo) }, !showDebugInfo ? /* @__PURE__ */ h(i18n4.Translate, null, "Show more information") : /* @__PURE__ */ h(i18n4.Translate, null, "Hide debug info")), showDebugInfo && /* @__PURE__ */ h("pre", { class: "whitespace-break-spaces text-black" }, JSON.stringify(error2, void 0, 2)));
}
function Loading() {
  return /* @__PURE__ */ h(
    "div",
    {
      class: "columns is-centered is-vcentered",
      style: {
        width: "100%",
        height: "200px",
        display: "flex",
        margin: "auto",
        justifyContent: "center"
      }
    },
    /* @__PURE__ */ h(Spinner, null)
  );
}
function Spinner() {
  return /* @__PURE__ */ h("div", { class: "lds-ring m-auto" }, /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null));
}
function ButtonBetterBulma({
  children,
  onClick,
  ...rest
}) {
  const [running, setRunning] = p3(false);
  return /* @__PURE__ */ h(
    "button",
    {
      class: "button is-success",
      type: "button",
      ...rest,
      disabled: running || !onClick || !onClick.args,
      onClick: (e22) => {
        e22.preventDefault();
        if (!onClick || !onClick.args) {
          return;
        }
        setRunning(true);
        onClick.call().finally(() => {
          setRunning(false);
        });
      }
    },
    running ? /* @__PURE__ */ h(Wait, null) : children
  );
}
function Wait() {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { id: "l1" }));
}
function LocalNotificationBanner({
  notification
}) {
  if (!notification)
    return /* @__PURE__ */ h(p2, null);
  switch (notification.message.type) {
    case "error":
      return /* @__PURE__ */ h("div", { class: "relative" }, /* @__PURE__ */ h("div", { class: "fixed top-0 left-0 right-0 z-20 w-full p-4" }, /* @__PURE__ */ h(
        Attention,
        {
          type: "danger",
          title: notification.message.title,
          onClose: () => {
            notification.acknowledge();
          }
        },
        notification.message.description && /* @__PURE__ */ h("div", { class: "mt-2 text-sm text-red-700" }, notification.message.description),
        /* @__PURE__ */ h(DebugInfo, { error: notification.message.debug })
      )));
    case "info":
      return /* @__PURE__ */ h("div", { class: "relative" }, /* @__PURE__ */ h("div", { class: "fixed top-0 left-0 right-0 z-20 w-full p-4" }, /* @__PURE__ */ h(
        Attention,
        {
          type: "success",
          title: notification.message.title,
          onClose: () => {
            notification.acknowledge();
          }
        }
      )));
  }
}
function LocalNotificationBannerBulma({
  notification
}) {
  if (!notification)
    return /* @__PURE__ */ h(p2, null);
  const msg = notification.message;
  const [{ showDebugInfo }] = useCommonPreferences();
  switch (msg.type) {
    case "error":
      return /* @__PURE__ */ h("div", { style: { position: "relative" } }, /* @__PURE__ */ h(
        "div",
        {
          style: {
            position: "fixed",
            zIndex: 99,
            top: 0,
            left: 0,
            right: 0,
            width: "100%"
          }
        },
        /* @__PURE__ */ h("div", { class: "notification" }, /* @__PURE__ */ h("div", { class: "columns is-vcentered" }, /* @__PURE__ */ h("div", { class: "column is-12" }, /* @__PURE__ */ h("article", { class: "message is-danger" }, /* @__PURE__ */ h("div", { class: "message-header" }, /* @__PURE__ */ h("p", null, msg.title), /* @__PURE__ */ h(
          "button",
          {
            class: "delete ",
            "aria-label": "close",
            onClick: () => notification.acknowledge()
          }
        )), msg.description && /* @__PURE__ */ h("div", { class: "message-body" }, /* @__PURE__ */ h("div", null, msg.description), showDebugInfo && msg.debug && /* @__PURE__ */ h("pre", null, " ", JSON.stringify(msg.debug, void 0, 2)))))))
      ));
    case "info":
      return /* @__PURE__ */ h("div", { style: { position: "relative" } }, /* @__PURE__ */ h(
        "div",
        {
          style: {
            position: "fixed",
            zIndex: 99,
            top: 0,
            left: 0,
            right: 0,
            width: "100%"
          }
        },
        /* @__PURE__ */ h("div", { class: "notification" }, /* @__PURE__ */ h("div", { class: "columns is-vcentered" }, /* @__PURE__ */ h("div", { class: "column is-12" }, /* @__PURE__ */ h("article", { class: "message is-info" }, /* @__PURE__ */ h("div", { class: "message-header" }, /* @__PURE__ */ h("p", null, msg.title))))))
      ));
  }
}
function toInteger(dirtyNumber) {
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
    return NaN;
  }
  var number = Number(dirtyNumber);
  if (isNaN(number)) {
    return number;
  }
  return number < 0 ? Math.ceil(number) : Math.floor(number);
}
function requiredArgs(required, args) {
  if (args.length < required) {
    throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
  }
}
function _typeof(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof(obj);
}
function toDate(argument) {
  requiredArgs(1, arguments);
  var argStr = Object.prototype.toString.call(argument);
  if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
    return new Date(argument.getTime());
  } else if (typeof argument === "number" || argStr === "[object Number]") {
    return new Date(argument);
  } else {
    if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
      console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
      console.warn(new Error().stack);
    }
    return /* @__PURE__ */ new Date(NaN);
  }
}
function addDays(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var date = toDate(dirtyDate);
  var amount = toInteger(dirtyAmount);
  if (isNaN(amount)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  if (!amount) {
    return date;
  }
  date.setDate(date.getDate() + amount);
  return date;
}
function addMonths(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var date = toDate(dirtyDate);
  var amount = toInteger(dirtyAmount);
  if (isNaN(amount)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  if (!amount) {
    return date;
  }
  var dayOfMonth = date.getDate();
  var endOfDesiredMonth = new Date(date.getTime());
  endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
  var daysInMonth = endOfDesiredMonth.getDate();
  if (dayOfMonth >= daysInMonth) {
    return endOfDesiredMonth;
  } else {
    date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
    return date;
  }
}
function _typeof2(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof2 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof2 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof2(obj);
}
function add2(dirtyDate, duration) {
  requiredArgs(2, arguments);
  if (!duration || _typeof2(duration) !== "object")
    return /* @__PURE__ */ new Date(NaN);
  var years = duration.years ? toInteger(duration.years) : 0;
  var months = duration.months ? toInteger(duration.months) : 0;
  var weeks = duration.weeks ? toInteger(duration.weeks) : 0;
  var days = duration.days ? toInteger(duration.days) : 0;
  var hours = duration.hours ? toInteger(duration.hours) : 0;
  var minutes = duration.minutes ? toInteger(duration.minutes) : 0;
  var seconds = duration.seconds ? toInteger(duration.seconds) : 0;
  var date = toDate(dirtyDate);
  var dateWithMonths = months || years ? addMonths(date, months + years * 12) : date;
  var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
  var minutesToAdd = minutes + hours * 60;
  var secondsToAdd = seconds + minutesToAdd * 60;
  var msToAdd = secondsToAdd * 1e3;
  var finalDate = new Date(dateWithDays.getTime() + msToAdd);
  return finalDate;
}
function addMilliseconds(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var timestamp = toDate(dirtyDate).getTime();
  var amount = toInteger(dirtyAmount);
  return new Date(timestamp + amount);
}
var defaultOptions = {};
function getDefaultOptions() {
  return defaultOptions;
}
function getTimezoneOffsetInMilliseconds(date) {
  var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
  utcDate.setUTCFullYear(date.getFullYear());
  return date.getTime() - utcDate.getTime();
}
function startOfDay(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  date.setHours(0, 0, 0, 0);
  return date;
}
var MILLISECONDS_IN_DAY = 864e5;
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var startOfDayLeft = startOfDay(dirtyDateLeft);
  var startOfDayRight = startOfDay(dirtyDateRight);
  var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
  var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
  return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
}
function compareAsc(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var diff = dateLeft.getTime() - dateRight.getTime();
  if (diff < 0) {
    return -1;
  } else if (diff > 0) {
    return 1;
  } else {
    return diff;
  }
}
var daysInYear = 365.2425;
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
var millisecondsInMinute = 6e4;
var millisecondsInHour = 36e5;
var millisecondsInSecond = 1e3;
var minTime = -maxTime;
var secondsInHour = 3600;
var secondsInDay = secondsInHour * 24;
var secondsInWeek = secondsInDay * 7;
var secondsInYear = secondsInDay * daysInYear;
var secondsInMonth = secondsInYear / 12;
var secondsInQuarter = secondsInMonth * 3;
function _typeof3(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof3 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof3 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof3(obj);
}
function isDate(value) {
  requiredArgs(1, arguments);
  return value instanceof Date || _typeof3(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
}
function isValid(dirtyDate) {
  requiredArgs(1, arguments);
  if (!isDate(dirtyDate) && typeof dirtyDate !== "number") {
    return false;
  }
  var date = toDate(dirtyDate);
  return !isNaN(Number(date));
}
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
  var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
  return yearDiff * 12 + monthDiff;
}
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  return dateLeft.getFullYear() - dateRight.getFullYear();
}
function compareLocalAsc(dateLeft, dateRight) {
  var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
  if (diff < 0) {
    return -1;
  } else if (diff > 0) {
    return 1;
  } else {
    return diff;
  }
}
function differenceInDays(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var sign3 = compareLocalAsc(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
  dateLeft.setDate(dateLeft.getDate() - sign3 * difference2);
  var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign3);
  var result = sign3 * (difference2 - isLastDayNotFull);
  return result === 0 ? 0 : result;
}
function differenceInMilliseconds(dateLeft, dateRight) {
  requiredArgs(2, arguments);
  return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
}
var roundingMap = {
  ceil: Math.ceil,
  round: Math.round,
  floor: Math.floor,
  trunc: function trunc(value) {
    return value < 0 ? Math.ceil(value) : Math.floor(value);
  }
  // Math.trunc is not supported by IE
};
var defaultRoundingMethod = "trunc";
function getRoundingMethod(method) {
  return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}
function differenceInHours(dateLeft, dateRight, options) {
  requiredArgs(2, arguments);
  var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
  return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
function differenceInMinutes(dateLeft, dateRight, options) {
  requiredArgs(2, arguments);
  var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
  return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
function endOfDay(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  date.setHours(23, 59, 59, 999);
  return date;
}
function endOfMonth(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var month = date.getMonth();
  date.setFullYear(date.getFullYear(), month + 1, 0);
  date.setHours(23, 59, 59, 999);
  return date;
}
function isLastDayOfMonth(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  return endOfDay(date).getTime() === endOfMonth(date).getTime();
}
function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var sign3 = compareAsc(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
  var result;
  if (difference2 < 1) {
    result = 0;
  } else {
    if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
      dateLeft.setDate(30);
    }
    dateLeft.setMonth(dateLeft.getMonth() - sign3 * difference2);
    var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign3;
    if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference2 === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
      isLastMonthNotFull = false;
    }
    result = sign3 * (difference2 - Number(isLastMonthNotFull));
  }
  return result === 0 ? 0 : result;
}
function differenceInSeconds(dateLeft, dateRight, options) {
  requiredArgs(2, arguments);
  var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3;
  return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
function differenceInYears(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var sign3 = compareAsc(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarYears(dateLeft, dateRight));
  dateLeft.setFullYear(1584);
  dateRight.setFullYear(1584);
  var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign3;
  var result = sign3 * (difference2 - Number(isLastYearNotFull));
  return result === 0 ? 0 : result;
}
function subMilliseconds(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var amount = toInteger(dirtyAmount);
  return addMilliseconds(dirtyDate, -amount);
}
var MILLISECONDS_IN_DAY2 = 864e5;
function getUTCDayOfYear(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var timestamp = date.getTime();
  date.setUTCMonth(0, 1);
  date.setUTCHours(0, 0, 0, 0);
  var startOfYearTimestamp = date.getTime();
  var difference2 = timestamp - startOfYearTimestamp;
  return Math.floor(difference2 / MILLISECONDS_IN_DAY2) + 1;
}
function startOfUTCISOWeek(dirtyDate) {
  requiredArgs(1, arguments);
  var weekStartsOn = 1;
  var date = toDate(dirtyDate);
  var day = date.getUTCDay();
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  date.setUTCDate(date.getUTCDate() - diff);
  date.setUTCHours(0, 0, 0, 0);
  return date;
}
function getUTCISOWeekYear(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var year = date.getUTCFullYear();
  var fourthOfJanuaryOfNextYear = /* @__PURE__ */ new Date(0);
  fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
  fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
  var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
  var fourthOfJanuaryOfThisYear = /* @__PURE__ */ new Date(0);
  fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
  fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
  var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
  if (date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}
function startOfUTCISOWeekYear(dirtyDate) {
  requiredArgs(1, arguments);
  var year = getUTCISOWeekYear(dirtyDate);
  var fourthOfJanuary = /* @__PURE__ */ new Date(0);
  fourthOfJanuary.setUTCFullYear(year, 0, 4);
  fourthOfJanuary.setUTCHours(0, 0, 0, 0);
  var date = startOfUTCISOWeek(fourthOfJanuary);
  return date;
}
var MILLISECONDS_IN_WEEK = 6048e5;
function getUTCISOWeek(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
  return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
}
function startOfUTCWeek(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs(1, arguments);
  var defaultOptions22 = getDefaultOptions();
  var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions22.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions22.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate(dirtyDate);
  var day = date.getUTCDay();
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  date.setUTCDate(date.getUTCDate() - diff);
  date.setUTCHours(0, 0, 0, 0);
  return date;
}
function getUTCWeekYear(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var year = date.getUTCFullYear();
  var defaultOptions22 = getDefaultOptions();
  var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions22.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions22.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  }
  var firstWeekOfNextYear = /* @__PURE__ */ new Date(0);
  firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
  firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
  var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
  var firstWeekOfThisYear = /* @__PURE__ */ new Date(0);
  firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
  firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
  var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
  if (date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}
function startOfUTCWeekYear(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs(1, arguments);
  var defaultOptions22 = getDefaultOptions();
  var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions22.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions22.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
  var year = getUTCWeekYear(dirtyDate, options);
  var firstWeek = /* @__PURE__ */ new Date(0);
  firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
  firstWeek.setUTCHours(0, 0, 0, 0);
  var date = startOfUTCWeek(firstWeek, options);
  return date;
}
var MILLISECONDS_IN_WEEK2 = 6048e5;
function getUTCWeek(dirtyDate, options) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
  return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1;
}
function addLeadingZeros(number, targetLength) {
  var sign3 = number < 0 ? "-" : "";
  var output = Math.abs(number).toString();
  while (output.length < targetLength) {
    output = "0" + output;
  }
  return sign3 + output;
}
var formatters = {
  // Year
  y: function y3(date, token) {
    var signedYear = date.getUTCFullYear();
    var year = signedYear > 0 ? signedYear : 1 - signedYear;
    return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
  },
  // Month
  M: function M4(date, token) {
    var month = date.getUTCMonth();
    return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
  },
  // Day of the month
  d: function d3(date, token) {
    return addLeadingZeros(date.getUTCDate(), token.length);
  },
  // AM or PM
  a: function a3(date, token) {
    var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return dayPeriodEnumValue.toUpperCase();
      case "aaa":
        return dayPeriodEnumValue;
      case "aaaaa":
        return dayPeriodEnumValue[0];
      case "aaaa":
      default:
        return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h: function h12(date, token) {
    return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
  },
  // Hour [0-23]
  H: function H3(date, token) {
    return addLeadingZeros(date.getUTCHours(), token.length);
  },
  // Minute
  m: function m3(date, token) {
    return addLeadingZeros(date.getUTCMinutes(), token.length);
  },
  // Second
  s: function s3(date, token) {
    return addLeadingZeros(date.getUTCSeconds(), token.length);
  },
  // Fraction of second
  S: function S3(date, token) {
    var numberOfDigits = token.length;
    var milliseconds = date.getUTCMilliseconds();
    var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
    return addLeadingZeros(fractionalSeconds, token.length);
  }
};
var lightFormatters_default = formatters;
var dayPeriodEnum = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
};
var formatters2 = {
  // Era
  G: function G2(date, token, localize52) {
    var era = date.getUTCFullYear() > 0 ? 1 : 0;
    switch (token) {
      case "G":
      case "GG":
      case "GGG":
        return localize52.era(era, {
          width: "abbreviated"
        });
      case "GGGGG":
        return localize52.era(era, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return localize52.era(era, {
          width: "wide"
        });
    }
  },
  // Year
  y: function y22(date, token, localize52) {
    if (token === "yo") {
      var signedYear = date.getUTCFullYear();
      var year = signedYear > 0 ? signedYear : 1 - signedYear;
      return localize52.ordinalNumber(year, {
        unit: "year"
      });
    }
    return lightFormatters_default.y(date, token);
  },
  // Local week-numbering year
  Y: function Y3(date, token, localize52, options) {
    var signedWeekYear = getUTCWeekYear(date, options);
    var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
    if (token === "YY") {
      var twoDigitYear = weekYear % 100;
      return addLeadingZeros(twoDigitYear, 2);
    }
    if (token === "Yo") {
      return localize52.ordinalNumber(weekYear, {
        unit: "year"
      });
    }
    return addLeadingZeros(weekYear, token.length);
  },
  // ISO week-numbering year
  R: function R2(date, token) {
    var isoWeekYear = getUTCISOWeekYear(date);
    return addLeadingZeros(isoWeekYear, token.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function u3(date, token) {
    var year = date.getUTCFullYear();
    return addLeadingZeros(year, token.length);
  },
  // Quarter
  Q: function Q2(date, token, localize52) {
    var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
    switch (token) {
      case "Q":
        return String(quarter);
      case "QQ":
        return addLeadingZeros(quarter, 2);
      case "Qo":
        return localize52.ordinalNumber(quarter, {
          unit: "quarter"
        });
      case "QQQ":
        return localize52.quarter(quarter, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return localize52.quarter(quarter, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return localize52.quarter(quarter, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function q4(date, token, localize52) {
    var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
    switch (token) {
      case "q":
        return String(quarter);
      case "qq":
        return addLeadingZeros(quarter, 2);
      case "qo":
        return localize52.ordinalNumber(quarter, {
          unit: "quarter"
        });
      case "qqq":
        return localize52.quarter(quarter, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return localize52.quarter(quarter, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return localize52.quarter(quarter, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function M22(date, token, localize52) {
    var month = date.getUTCMonth();
    switch (token) {
      case "M":
      case "MM":
        return lightFormatters_default.M(date, token);
      case "Mo":
        return localize52.ordinalNumber(month + 1, {
          unit: "month"
        });
      case "MMM":
        return localize52.month(month, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return localize52.month(month, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return localize52.month(month, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function L4(date, token, localize52) {
    var month = date.getUTCMonth();
    switch (token) {
      case "L":
        return String(month + 1);
      case "LL":
        return addLeadingZeros(month + 1, 2);
      case "Lo":
        return localize52.ordinalNumber(month + 1, {
          unit: "month"
        });
      case "LLL":
        return localize52.month(month, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return localize52.month(month, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return localize52.month(month, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function w4(date, token, localize52, options) {
    var week = getUTCWeek(date, options);
    if (token === "wo") {
      return localize52.ordinalNumber(week, {
        unit: "week"
      });
    }
    return addLeadingZeros(week, token.length);
  },
  // ISO week of year
  I: function I4(date, token, localize52) {
    var isoWeek = getUTCISOWeek(date);
    if (token === "Io") {
      return localize52.ordinalNumber(isoWeek, {
        unit: "week"
      });
    }
    return addLeadingZeros(isoWeek, token.length);
  },
  // Day of the month
  d: function d22(date, token, localize52) {
    if (token === "do") {
      return localize52.ordinalNumber(date.getUTCDate(), {
        unit: "date"
      });
    }
    return lightFormatters_default.d(date, token);
  },
  // Day of year
  D: function D4(date, token, localize52) {
    var dayOfYear = getUTCDayOfYear(date);
    if (token === "Do") {
      return localize52.ordinalNumber(dayOfYear, {
        unit: "dayOfYear"
      });
    }
    return addLeadingZeros(dayOfYear, token.length);
  },
  // Day of week
  E: function E2(date, token, localize52) {
    var dayOfWeek = date.getUTCDay();
    switch (token) {
      case "E":
      case "EE":
      case "EEE":
        return localize52.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return localize52.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return localize52.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return localize52.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function e3(date, token, localize52, options) {
    var dayOfWeek = date.getUTCDay();
    var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      case "e":
        return String(localDayOfWeek);
      case "ee":
        return addLeadingZeros(localDayOfWeek, 2);
      case "eo":
        return localize52.ordinalNumber(localDayOfWeek, {
          unit: "day"
        });
      case "eee":
        return localize52.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return localize52.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return localize52.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return localize52.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function c3(date, token, localize52, options) {
    var dayOfWeek = date.getUTCDay();
    var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      case "c":
        return String(localDayOfWeek);
      case "cc":
        return addLeadingZeros(localDayOfWeek, token.length);
      case "co":
        return localize52.ordinalNumber(localDayOfWeek, {
          unit: "day"
        });
      case "ccc":
        return localize52.day(dayOfWeek, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return localize52.day(dayOfWeek, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return localize52.day(dayOfWeek, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return localize52.day(dayOfWeek, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function i3(date, token, localize52) {
    var dayOfWeek = date.getUTCDay();
    var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
    switch (token) {
      case "i":
        return String(isoDayOfWeek);
      case "ii":
        return addLeadingZeros(isoDayOfWeek, token.length);
      case "io":
        return localize52.ordinalNumber(isoDayOfWeek, {
          unit: "day"
        });
      case "iii":
        return localize52.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return localize52.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return localize52.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return localize52.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function a22(date, token, localize52) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function b3(date, token, localize52) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue;
    if (hours === 12) {
      dayPeriodEnumValue = dayPeriodEnum.noon;
    } else if (hours === 0) {
      dayPeriodEnumValue = dayPeriodEnum.midnight;
    } else {
      dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    }
    switch (token) {
      case "b":
      case "bb":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function B4(date, token, localize52) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue;
    if (hours >= 17) {
      dayPeriodEnumValue = dayPeriodEnum.evening;
    } else if (hours >= 12) {
      dayPeriodEnumValue = dayPeriodEnum.afternoon;
    } else if (hours >= 4) {
      dayPeriodEnumValue = dayPeriodEnum.morning;
    } else {
      dayPeriodEnumValue = dayPeriodEnum.night;
    }
    switch (token) {
      case "B":
      case "BB":
      case "BBB":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return localize52.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function h13(date, token, localize52) {
    if (token === "ho") {
      var hours = date.getUTCHours() % 12;
      if (hours === 0)
        hours = 12;
      return localize52.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return lightFormatters_default.h(date, token);
  },
  // Hour [0-23]
  H: function H22(date, token, localize52) {
    if (token === "Ho") {
      return localize52.ordinalNumber(date.getUTCHours(), {
        unit: "hour"
      });
    }
    return lightFormatters_default.H(date, token);
  },
  // Hour [0-11]
  K: function K4(date, token, localize52) {
    var hours = date.getUTCHours() % 12;
    if (token === "Ko") {
      return localize52.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Hour [1-24]
  k: function k4(date, token, localize52) {
    var hours = date.getUTCHours();
    if (hours === 0)
      hours = 24;
    if (token === "ko") {
      return localize52.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Minute
  m: function m22(date, token, localize52) {
    if (token === "mo") {
      return localize52.ordinalNumber(date.getUTCMinutes(), {
        unit: "minute"
      });
    }
    return lightFormatters_default.m(date, token);
  },
  // Second
  s: function s22(date, token, localize52) {
    if (token === "so") {
      return localize52.ordinalNumber(date.getUTCSeconds(), {
        unit: "second"
      });
    }
    return lightFormatters_default.s(date, token);
  },
  // Fraction of second
  S: function S22(date, token) {
    return lightFormatters_default.S(date, token);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function X3(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    if (timezoneOffset === 0) {
      return "Z";
    }
    switch (token) {
      case "X":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      case "XXXX":
      case "XX":
        return formatTimezone(timezoneOffset);
      case "XXXXX":
      case "XXX":
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function x4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "x":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      case "xxxx":
      case "xx":
        return formatTimezone(timezoneOffset);
      case "xxxxx":
      case "xxx":
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (GMT)
  O: function O3(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      case "OOOO":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (specific non-location)
  z: function z4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      case "zzzz":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Seconds timestamp
  t: function t3(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timestamp = Math.floor(originalDate.getTime() / 1e3);
    return addLeadingZeros(timestamp, token.length);
  },
  // Milliseconds timestamp
  T: function T4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timestamp = originalDate.getTime();
    return addLeadingZeros(timestamp, token.length);
  }
};
function formatTimezoneShort(offset, dirtyDelimiter) {
  var sign3 = offset > 0 ? "-" : "+";
  var absOffset = Math.abs(offset);
  var hours = Math.floor(absOffset / 60);
  var minutes = absOffset % 60;
  if (minutes === 0) {
    return sign3 + String(hours);
  }
  var delimiter2 = dirtyDelimiter || "";
  return sign3 + String(hours) + delimiter2 + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
  if (offset % 60 === 0) {
    var sign3 = offset > 0 ? "-" : "+";
    return sign3 + addLeadingZeros(Math.abs(offset) / 60, 2);
  }
  return formatTimezone(offset, dirtyDelimiter);
}
function formatTimezone(offset, dirtyDelimiter) {
  var delimiter2 = dirtyDelimiter || "";
  var sign3 = offset > 0 ? "-" : "+";
  var absOffset = Math.abs(offset);
  var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
  var minutes = addLeadingZeros(absOffset % 60, 2);
  return sign3 + hours + delimiter2 + minutes;
}
var formatters_default = formatters2;
var dateLongFormatter = function dateLongFormatter2(pattern, formatLong62) {
  switch (pattern) {
    case "P":
      return formatLong62.date({
        width: "short"
      });
    case "PP":
      return formatLong62.date({
        width: "medium"
      });
    case "PPP":
      return formatLong62.date({
        width: "long"
      });
    case "PPPP":
    default:
      return formatLong62.date({
        width: "full"
      });
  }
};
var timeLongFormatter = function timeLongFormatter2(pattern, formatLong62) {
  switch (pattern) {
    case "p":
      return formatLong62.time({
        width: "short"
      });
    case "pp":
      return formatLong62.time({
        width: "medium"
      });
    case "ppp":
      return formatLong62.time({
        width: "long"
      });
    case "pppp":
    default:
      return formatLong62.time({
        width: "full"
      });
  }
};
var dateTimeLongFormatter = function dateTimeLongFormatter2(pattern, formatLong62) {
  var matchResult = pattern.match(/(P+)(p+)?/) || [];
  var datePattern = matchResult[1];
  var timePattern = matchResult[2];
  if (!timePattern) {
    return dateLongFormatter(pattern, formatLong62);
  }
  var dateTimeFormat;
  switch (datePattern) {
    case "P":
      dateTimeFormat = formatLong62.dateTime({
        width: "short"
      });
      break;
    case "PP":
      dateTimeFormat = formatLong62.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      dateTimeFormat = formatLong62.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      dateTimeFormat = formatLong62.dateTime({
        width: "full"
      });
      break;
  }
  return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong62)).replace("{{time}}", timeLongFormatter(timePattern, formatLong62));
};
var longFormatters = {
  p: timeLongFormatter,
  P: dateTimeLongFormatter
};
var longFormatters_default = longFormatters;
var protectedDayOfYearTokens = ["D", "DD"];
var protectedWeekYearTokens = ["YY", "YYYY"];
function isProtectedDayOfYearToken(token) {
  return protectedDayOfYearTokens.indexOf(token) !== -1;
}
function isProtectedWeekYearToken(token) {
  return protectedWeekYearTokens.indexOf(token) !== -1;
}
function throwProtectedError(token, format22, input) {
  if (token === "YYYY") {
    throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format22, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "YY") {
    throw new RangeError("Use `yy` instead of `YY` (in `".concat(format22, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "D") {
    throw new RangeError("Use `d` instead of `D` (in `".concat(format22, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "DD") {
    throw new RangeError("Use `dd` instead of `DD` (in `".concat(format22, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  }
}
var formatDistanceLocale = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
};
var formatDistance = function formatDistance2(token, count, options) {
  var result;
  var tokenValue = formatDistanceLocale[token];
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", count.toString());
  }
  if (options !== null && options !== void 0 && options.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "in " + result;
    } else {
      return result + " ago";
    }
  }
  return result;
};
var formatDistance_default = formatDistance;
function buildFormatLongFn(args) {
  return function() {
    var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var width = options.width ? String(options.width) : args.defaultWidth;
    var format22 = args.formats[width] || args.formats[args.defaultWidth];
    return format22;
  };
}
var dateFormats = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
};
var timeFormats = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
};
var dateTimeFormats = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong = {
  date: buildFormatLongFn({
    formats: dateFormats,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats,
    defaultWidth: "full"
  })
};
var formatLong_default = formatLong;
var formatRelativeLocale = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
};
var formatRelative = function formatRelative2(token, _date, _baseDate, _options) {
  return formatRelativeLocale[token];
};
var formatRelative_default = formatRelative;
function buildLocalizeFn(args) {
  return function(dirtyIndex, options) {
    var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
    var valuesArray;
    if (context === "formatting" && args.formattingValues) {
      var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
      var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
    } else {
      var _defaultWidth = args.defaultWidth;
      var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
      valuesArray = args.values[_width] || args.values[_defaultWidth];
    }
    var index2 = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
    return valuesArray[index2];
  };
}
var eraValues = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
};
var dayValues = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
};
var dayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
};
var formattingDayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
};
var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) {
  var number = Number(dirtyNumber);
  var rem100 = number % 100;
  if (rem100 > 20 || rem100 < 10) {
    switch (rem100 % 10) {
      case 1:
        return number + "st";
      case 2:
        return number + "nd";
      case 3:
        return number + "rd";
    }
  }
  return number + "th";
};
var localize = {
  ordinalNumber,
  era: buildLocalizeFn({
    values: eraValues,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues,
    defaultWidth: "wide",
    argumentCallback: function argumentCallback(quarter) {
      return quarter - 1;
    }
  }),
  month: buildLocalizeFn({
    values: monthValues,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues,
    defaultFormattingWidth: "wide"
  })
};
var localize_default = localize;
function buildMatchFn(args) {
  return function(string) {
    var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var width = options.width;
    var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
    var matchResult = string.match(matchPattern);
    if (!matchResult) {
      return null;
    }
    var matchedString = matchResult[0];
    var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
    var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
      return pattern.test(matchedString);
    }) : findKey(parsePatterns, function(pattern) {
      return pattern.test(matchedString);
    });
    var value;
    value = args.valueCallback ? args.valueCallback(key) : key;
    value = options.valueCallback ? options.valueCallback(value) : value;
    var rest = string.slice(matchedString.length);
    return {
      value,
      rest
    };
  };
}
function findKey(object, predicate) {
  for (var key in object) {
    if (object.hasOwnProperty(key) && predicate(object[key])) {
      return key;
    }
  }
  return void 0;
}
function findIndex(array, predicate) {
  for (var key = 0; key < array.length; key++) {
    if (predicate(array[key])) {
      return key;
    }
  }
  return void 0;
}
function buildMatchPatternFn(args) {
  return function(string) {
    var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var matchResult = string.match(args.matchPattern);
    if (!matchResult)
      return null;
    var matchedString = matchResult[0];
    var parseResult = string.match(args.parsePattern);
    if (!parseResult)
      return null;
    var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    var rest = string.slice(matchedString.length);
    return {
      value,
      rest
    };
  };
}
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
  any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
var matchDayPatterns = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
};
var match = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern,
    parsePattern: parseOrdinalNumberPattern,
    valueCallback: function valueCallback(value) {
      return parseInt(value, 10);
    }
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns,
    defaultParseWidth: "any",
    valueCallback: function valueCallback2(index2) {
      return index2 + 1;
    }
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns,
    defaultParseWidth: "any"
  })
};
var match_default = match;
var locale = {
  code: "en-US",
  formatDistance: formatDistance_default,
  formatLong: formatLong_default,
  formatRelative: formatRelative_default,
  localize: localize_default,
  match: match_default,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
var en_US_default = locale;
var defaultLocale_default = en_US_default;
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp = /^'([^]*?)'?$/;
var doubleQuoteRegExp = /''/g;
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
function format(dirtyDate, dirtyFormatStr, options) {
  var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
  requiredArgs(2, arguments);
  var formatStr = String(dirtyFormatStr);
  var defaultOptions22 = getDefaultOptions();
  var locale62 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions22.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default;
  var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions22.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions22.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  }
  var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions22.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions22.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  if (!locale62.localize) {
    throw new RangeError("locale must contain localize property");
  }
  if (!locale62.formatLong) {
    throw new RangeError("locale must contain formatLong property");
  }
  var originalDate = toDate(dirtyDate);
  if (!isValid(originalDate)) {
    throw new RangeError("Invalid time value");
  }
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
  var formatterOptions = {
    firstWeekContainsDate,
    weekStartsOn,
    locale: locale62,
    _originalDate: originalDate
  };
  var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
    var firstCharacter = substring[0];
    if (firstCharacter === "p" || firstCharacter === "P") {
      var longFormatter = longFormatters_default[firstCharacter];
      return longFormatter(substring, locale62.formatLong);
    }
    return substring;
  }).join("").match(formattingTokensRegExp).map(function(substring) {
    if (substring === "''") {
      return "'";
    }
    var firstCharacter = substring[0];
    if (firstCharacter === "'") {
      return cleanEscapedString(substring);
    }
    var formatter = formatters_default[firstCharacter];
    if (formatter) {
      if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
        throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
      }
      if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
        throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
      }
      return formatter(utcDate, substring, locale62.localize, formatterOptions);
    }
    if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
    }
    return substring;
  }).join("");
  return result;
}
function cleanEscapedString(input) {
  var matched = input.match(escapedStringRegExp);
  if (!matched) {
    return input;
  }
  return matched[1].replace(doubleQuoteRegExp, "'");
}
var defaultFormat = ["years", "months", "weeks", "days", "hours", "minutes", "seconds"];
function formatDuration(duration, options) {
  var _ref, _options$locale, _options$format, _options$zero, _options$delimiter;
  if (arguments.length < 1) {
    throw new TypeError("1 argument required, but only ".concat(arguments.length, " present"));
  }
  var defaultOptions22 = getDefaultOptions();
  var locale62 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions22.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default;
  var format22 = (_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : defaultFormat;
  var zero = (_options$zero = options === null || options === void 0 ? void 0 : options.zero) !== null && _options$zero !== void 0 ? _options$zero : false;
  var delimiter2 = (_options$delimiter = options === null || options === void 0 ? void 0 : options.delimiter) !== null && _options$delimiter !== void 0 ? _options$delimiter : " ";
  if (!locale62.formatDistance) {
    return "";
  }
  var result = format22.reduce(function(acc, unit) {
    var token = "x".concat(unit.replace(/(^.)/, function(m32) {
      return m32.toUpperCase();
    }));
    var value = duration[unit];
    if (typeof value === "number" && (zero || duration[unit])) {
      return acc.concat(locale62.formatDistance(token, value));
    }
    return acc;
  }, []).join(delimiter2);
  return result;
}
function formatISO(date, options) {
  var _options$format, _options$representati;
  requiredArgs(1, arguments);
  var originalDate = toDate(date);
  if (isNaN(originalDate.getTime())) {
    throw new RangeError("Invalid time value");
  }
  var format22 = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : "extended");
  var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : "complete");
  if (format22 !== "extended" && format22 !== "basic") {
    throw new RangeError("format must be 'extended' or 'basic'");
  }
  if (representation !== "date" && representation !== "time" && representation !== "complete") {
    throw new RangeError("representation must be 'date', 'time', or 'complete'");
  }
  var result = "";
  var tzOffset = "";
  var dateDelimiter = format22 === "extended" ? "-" : "";
  var timeDelimiter = format22 === "extended" ? ":" : "";
  if (representation !== "time") {
    var day = addLeadingZeros(originalDate.getDate(), 2);
    var month = addLeadingZeros(originalDate.getMonth() + 1, 2);
    var year = addLeadingZeros(originalDate.getFullYear(), 4);
    result = "".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);
  }
  if (representation !== "date") {
    var offset = originalDate.getTimezoneOffset();
    if (offset !== 0) {
      var absoluteOffset = Math.abs(offset);
      var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);
      var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
      var sign3 = offset < 0 ? "+" : "-";
      tzOffset = "".concat(sign3).concat(hourOffset, ":").concat(minuteOffset);
    } else {
      tzOffset = "Z";
    }
    var hour = addLeadingZeros(originalDate.getHours(), 2);
    var minute = addLeadingZeros(originalDate.getMinutes(), 2);
    var second = addLeadingZeros(originalDate.getSeconds(), 2);
    var separator = result === "" ? "" : "T";
    var time = [hour, minute, second].join(timeDelimiter);
    result = "".concat(result).concat(separator).concat(time).concat(tzOffset);
  }
  return result;
}
function getMonth(dirtyDate) {
  requiredArgs(1, arguments);
  var date = toDate(dirtyDate);
  var month = date.getMonth();
  return month;
}
function getYear(dirtyDate) {
  requiredArgs(1, arguments);
  return toDate(dirtyDate).getFullYear();
}
function intervalToDuration(interval) {
  requiredArgs(1, arguments);
  var start = toDate(interval.start);
  var end = toDate(interval.end);
  if (isNaN(start.getTime()))
    throw new RangeError("Start Date is invalid");
  if (isNaN(end.getTime()))
    throw new RangeError("End Date is invalid");
  var duration = {};
  duration.years = Math.abs(differenceInYears(end, start));
  var sign3 = compareAsc(end, start);
  var remainingMonths = add2(start, {
    years: sign3 * duration.years
  });
  duration.months = Math.abs(differenceInMonths(end, remainingMonths));
  var remainingDays = add2(remainingMonths, {
    months: sign3 * duration.months
  });
  duration.days = Math.abs(differenceInDays(end, remainingDays));
  var remainingHours = add2(remainingDays, {
    days: sign3 * duration.days
  });
  duration.hours = Math.abs(differenceInHours(end, remainingHours));
  var remainingMinutes = add2(remainingHours, {
    hours: sign3 * duration.hours
  });
  duration.minutes = Math.abs(differenceInMinutes(end, remainingMinutes));
  var remainingSeconds = add2(remainingMinutes, {
    minutes: sign3 * duration.minutes
  });
  duration.seconds = Math.abs(differenceInSeconds(end, remainingSeconds));
  return duration;
}
function _typeof4(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof4 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof4 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof4(obj);
}
function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o3, p4) {
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf(o3, p4);
}
function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn(this, result);
  };
}
function _possibleConstructorReturn(self2, call) {
  if (call && (_typeof4(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized(self2);
}
function _assertThisInitialized(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf(o3) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf(o3);
}
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties(Constructor, staticProps);
  return Constructor;
}
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Setter = /* @__PURE__ */ function() {
  function Setter22() {
    _classCallCheck(this, Setter22);
    _defineProperty(this, "subPriority", 0);
  }
  _createClass(Setter22, [{
    key: "validate",
    value: function validate(_utcDate, _options) {
      return true;
    }
  }]);
  return Setter22;
}();
var ValueSetter = /* @__PURE__ */ function(_Setter) {
  _inherits(ValueSetter22, _Setter);
  var _super = _createSuper(ValueSetter22);
  function ValueSetter22(value, validateValue, setValue, priority, subPriority) {
    var _this;
    _classCallCheck(this, ValueSetter22);
    _this = _super.call(this);
    _this.value = value;
    _this.validateValue = validateValue;
    _this.setValue = setValue;
    _this.priority = priority;
    if (subPriority) {
      _this.subPriority = subPriority;
    }
    return _this;
  }
  _createClass(ValueSetter22, [{
    key: "validate",
    value: function validate(utcDate, options) {
      return this.validateValue(utcDate, this.value, options);
    }
  }, {
    key: "set",
    value: function set2(utcDate, flags, options) {
      return this.setValue(utcDate, flags, this.value, options);
    }
  }]);
  return ValueSetter22;
}(Setter);
function _classCallCheck2(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties2(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass2(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties2(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties2(Constructor, staticProps);
  return Constructor;
}
var Parser = /* @__PURE__ */ function() {
  function Parser22() {
    _classCallCheck2(this, Parser22);
  }
  _createClass2(Parser22, [{
    key: "run",
    value: function run(dateString, token, match52, options) {
      var result = this.parse(dateString, token, match52, options);
      if (!result) {
        return null;
      }
      return {
        setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
        rest: result.rest
      };
    }
  }, {
    key: "validate",
    value: function validate(_utcDate, _value, _options) {
      return true;
    }
  }]);
  return Parser22;
}();
function _typeof5(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof5 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof5 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof5(obj);
}
function _classCallCheck3(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties3(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass3(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties3(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties3(Constructor, staticProps);
  return Constructor;
}
function _inherits2(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o3, p4) {
  _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf2(o3, p4);
}
function _createSuper2(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct2();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf2(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf2(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn2(this, result);
  };
}
function _possibleConstructorReturn2(self2, call) {
  if (call && (_typeof5(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized2(self2);
}
function _assertThisInitialized2(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct2() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf2(o3) {
  _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf2(o3);
}
function _defineProperty2(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var EraParser = /* @__PURE__ */ function(_Parser) {
  _inherits2(EraParser22, _Parser);
  var _super = _createSuper2(EraParser22);
  function EraParser22() {
    var _this;
    _classCallCheck3(this, EraParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty2(_assertThisInitialized2(_this), "priority", 140);
    _defineProperty2(_assertThisInitialized2(_this), "incompatibleTokens", ["R", "u", "t", "T"]);
    return _this;
  }
  _createClass3(EraParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "G":
        case "GG":
        case "GGG":
          return match52.era(dateString, {
            width: "abbreviated"
          }) || match52.era(dateString, {
            width: "narrow"
          });
        case "GGGGG":
          return match52.era(dateString, {
            width: "narrow"
          });
        case "GGGG":
        default:
          return match52.era(dateString, {
            width: "wide"
          }) || match52.era(dateString, {
            width: "abbreviated"
          }) || match52.era(dateString, {
            width: "narrow"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      flags.era = value;
      date.setUTCFullYear(value, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return EraParser22;
}(Parser);
var numericPatterns = {
  month: /^(1[0-2]|0?\d)/,
  // 0 to 12
  date: /^(3[0-1]|[0-2]?\d)/,
  // 0 to 31
  dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
  // 0 to 366
  week: /^(5[0-3]|[0-4]?\d)/,
  // 0 to 53
  hour23h: /^(2[0-3]|[0-1]?\d)/,
  // 0 to 23
  hour24h: /^(2[0-4]|[0-1]?\d)/,
  // 0 to 24
  hour11h: /^(1[0-1]|0?\d)/,
  // 0 to 11
  hour12h: /^(1[0-2]|0?\d)/,
  // 0 to 12
  minute: /^[0-5]?\d/,
  // 0 to 59
  second: /^[0-5]?\d/,
  // 0 to 59
  singleDigit: /^\d/,
  // 0 to 9
  twoDigits: /^\d{1,2}/,
  // 0 to 99
  threeDigits: /^\d{1,3}/,
  // 0 to 999
  fourDigits: /^\d{1,4}/,
  // 0 to 9999
  anyDigitsSigned: /^-?\d+/,
  singleDigitSigned: /^-?\d/,
  // 0 to 9, -0 to -9
  twoDigitsSigned: /^-?\d{1,2}/,
  // 0 to 99, -0 to -99
  threeDigitsSigned: /^-?\d{1,3}/,
  // 0 to 999, -0 to -999
  fourDigitsSigned: /^-?\d{1,4}/
  // 0 to 9999, -0 to -9999
};
var timezonePatterns = {
  basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
  basic: /^([+-])(\d{2})(\d{2})|Z/,
  basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
  extended: /^([+-])(\d{2}):(\d{2})|Z/,
  extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
function mapValue(parseFnResult, mapFn) {
  if (!parseFnResult) {
    return parseFnResult;
  }
  return {
    value: mapFn(parseFnResult.value),
    rest: parseFnResult.rest
  };
}
function parseNumericPattern(pattern, dateString) {
  var matchResult = dateString.match(pattern);
  if (!matchResult) {
    return null;
  }
  return {
    value: parseInt(matchResult[0], 10),
    rest: dateString.slice(matchResult[0].length)
  };
}
function parseTimezonePattern(pattern, dateString) {
  var matchResult = dateString.match(pattern);
  if (!matchResult) {
    return null;
  }
  if (matchResult[0] === "Z") {
    return {
      value: 0,
      rest: dateString.slice(1)
    };
  }
  var sign3 = matchResult[1] === "+" ? 1 : -1;
  var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
  var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
  var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
  return {
    value: sign3 * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
    rest: dateString.slice(matchResult[0].length)
  };
}
function parseAnyDigitsSigned(dateString) {
  return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
}
function parseNDigits(n2, dateString) {
  switch (n2) {
    case 1:
      return parseNumericPattern(numericPatterns.singleDigit, dateString);
    case 2:
      return parseNumericPattern(numericPatterns.twoDigits, dateString);
    case 3:
      return parseNumericPattern(numericPatterns.threeDigits, dateString);
    case 4:
      return parseNumericPattern(numericPatterns.fourDigits, dateString);
    default:
      return parseNumericPattern(new RegExp("^\\d{1," + n2 + "}"), dateString);
  }
}
function parseNDigitsSigned(n2, dateString) {
  switch (n2) {
    case 1:
      return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
    case 2:
      return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
    case 3:
      return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
    case 4:
      return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
    default:
      return parseNumericPattern(new RegExp("^-?\\d{1," + n2 + "}"), dateString);
  }
}
function dayPeriodEnumToHours(dayPeriod) {
  switch (dayPeriod) {
    case "morning":
      return 4;
    case "evening":
      return 17;
    case "pm":
    case "noon":
    case "afternoon":
      return 12;
    case "am":
    case "midnight":
    case "night":
    default:
      return 0;
  }
}
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
  var isCommonEra = currentYear > 0;
  var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
  var result;
  if (absCurrentYear <= 50) {
    result = twoDigitYear || 100;
  } else {
    var rangeEnd = absCurrentYear + 50;
    var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
    var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
    result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
  }
  return isCommonEra ? result : 1 - result;
}
function isLeapYearIndex(year) {
  return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
function _typeof6(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof6 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof6 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof6(obj);
}
function _classCallCheck4(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties4(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass4(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties4(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties4(Constructor, staticProps);
  return Constructor;
}
function _inherits3(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf3(subClass, superClass);
}
function _setPrototypeOf3(o3, p4) {
  _setPrototypeOf3 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf3(o3, p4);
}
function _createSuper3(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct3();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf3(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf3(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn3(this, result);
  };
}
function _possibleConstructorReturn3(self2, call) {
  if (call && (_typeof6(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized3(self2);
}
function _assertThisInitialized3(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct3() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf3(o3) {
  _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf3(o3);
}
function _defineProperty3(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var YearParser = /* @__PURE__ */ function(_Parser) {
  _inherits3(YearParser22, _Parser);
  var _super = _createSuper3(YearParser22);
  function YearParser22() {
    var _this;
    _classCallCheck4(this, YearParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty3(_assertThisInitialized3(_this), "priority", 130);
    _defineProperty3(_assertThisInitialized3(_this), "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass4(YearParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      var valueCallback92 = function valueCallback102(year) {
        return {
          year,
          isTwoDigitYear: token === "yy"
        };
      };
      switch (token) {
        case "y":
          return mapValue(parseNDigits(4, dateString), valueCallback92);
        case "yo":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "year"
          }), valueCallback92);
        default:
          return mapValue(parseNDigits(token.length, dateString), valueCallback92);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      var currentYear = date.getUTCFullYear();
      if (value.isTwoDigitYear) {
        var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
        date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
        date.setUTCHours(0, 0, 0, 0);
        return date;
      }
      var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setUTCFullYear(year, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return YearParser22;
}(Parser);
function _typeof7(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof7 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof7 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof7(obj);
}
function _classCallCheck5(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties5(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass5(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties5(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties5(Constructor, staticProps);
  return Constructor;
}
function _inherits4(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf4(subClass, superClass);
}
function _setPrototypeOf4(o3, p4) {
  _setPrototypeOf4 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf4(o3, p4);
}
function _createSuper4(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct4();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf4(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf4(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn4(this, result);
  };
}
function _possibleConstructorReturn4(self2, call) {
  if (call && (_typeof7(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized4(self2);
}
function _assertThisInitialized4(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct4() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf4(o3) {
  _getPrototypeOf4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf4(o3);
}
function _defineProperty4(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalWeekYearParser = /* @__PURE__ */ function(_Parser) {
  _inherits4(LocalWeekYearParser22, _Parser);
  var _super = _createSuper4(LocalWeekYearParser22);
  function LocalWeekYearParser22() {
    var _this;
    _classCallCheck5(this, LocalWeekYearParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty4(_assertThisInitialized4(_this), "priority", 130);
    _defineProperty4(_assertThisInitialized4(_this), "incompatibleTokens", ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]);
    return _this;
  }
  _createClass5(LocalWeekYearParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      var valueCallback92 = function valueCallback102(year) {
        return {
          year,
          isTwoDigitYear: token === "YY"
        };
      };
      switch (token) {
        case "Y":
          return mapValue(parseNDigits(4, dateString), valueCallback92);
        case "Yo":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "year"
          }), valueCallback92);
        default:
          return mapValue(parseNDigits(token.length, dateString), valueCallback92);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
  }, {
    key: "set",
    value: function set2(date, flags, value, options) {
      var currentYear = getUTCWeekYear(date, options);
      if (value.isTwoDigitYear) {
        var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
        date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
        date.setUTCHours(0, 0, 0, 0);
        return startOfUTCWeek(date, options);
      }
      var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
      date.setUTCHours(0, 0, 0, 0);
      return startOfUTCWeek(date, options);
    }
  }]);
  return LocalWeekYearParser22;
}(Parser);
function _typeof8(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof8 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof8 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof8(obj);
}
function _classCallCheck6(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties6(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass6(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties6(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties6(Constructor, staticProps);
  return Constructor;
}
function _inherits5(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf5(subClass, superClass);
}
function _setPrototypeOf5(o3, p4) {
  _setPrototypeOf5 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf5(o3, p4);
}
function _createSuper5(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct5();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf5(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf5(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn5(this, result);
  };
}
function _possibleConstructorReturn5(self2, call) {
  if (call && (_typeof8(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized5(self2);
}
function _assertThisInitialized5(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct5() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf5(o3) {
  _getPrototypeOf5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf5(o3);
}
function _defineProperty5(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOWeekYearParser = /* @__PURE__ */ function(_Parser) {
  _inherits5(ISOWeekYearParser22, _Parser);
  var _super = _createSuper5(ISOWeekYearParser22);
  function ISOWeekYearParser22() {
    var _this;
    _classCallCheck6(this, ISOWeekYearParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty5(_assertThisInitialized5(_this), "priority", 130);
    _defineProperty5(_assertThisInitialized5(_this), "incompatibleTokens", ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass6(ISOWeekYearParser22, [{
    key: "parse",
    value: function parse22(dateString, token) {
      if (token === "R") {
        return parseNDigitsSigned(4, dateString);
      }
      return parseNDigitsSigned(token.length, dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      var firstWeekOfYear = /* @__PURE__ */ new Date(0);
      firstWeekOfYear.setUTCFullYear(value, 0, 4);
      firstWeekOfYear.setUTCHours(0, 0, 0, 0);
      return startOfUTCISOWeek(firstWeekOfYear);
    }
  }]);
  return ISOWeekYearParser22;
}(Parser);
function _typeof9(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof9 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof9 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof9(obj);
}
function _classCallCheck7(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties7(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass7(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties7(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties7(Constructor, staticProps);
  return Constructor;
}
function _inherits6(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf6(subClass, superClass);
}
function _setPrototypeOf6(o3, p4) {
  _setPrototypeOf6 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf6(o3, p4);
}
function _createSuper6(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct6();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf6(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf6(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn6(this, result);
  };
}
function _possibleConstructorReturn6(self2, call) {
  if (call && (_typeof9(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized6(self2);
}
function _assertThisInitialized6(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct6() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf6(o3) {
  _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf6(o3);
}
function _defineProperty6(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ExtendedYearParser = /* @__PURE__ */ function(_Parser) {
  _inherits6(ExtendedYearParser22, _Parser);
  var _super = _createSuper6(ExtendedYearParser22);
  function ExtendedYearParser22() {
    var _this;
    _classCallCheck7(this, ExtendedYearParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty6(_assertThisInitialized6(_this), "priority", 130);
    _defineProperty6(_assertThisInitialized6(_this), "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass7(ExtendedYearParser22, [{
    key: "parse",
    value: function parse22(dateString, token) {
      if (token === "u") {
        return parseNDigitsSigned(4, dateString);
      }
      return parseNDigitsSigned(token.length, dateString);
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCFullYear(value, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return ExtendedYearParser22;
}(Parser);
function _typeof10(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof10 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof10 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof10(obj);
}
function _classCallCheck8(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties8(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass8(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties8(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties8(Constructor, staticProps);
  return Constructor;
}
function _inherits7(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf7(subClass, superClass);
}
function _setPrototypeOf7(o3, p4) {
  _setPrototypeOf7 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf7(o3, p4);
}
function _createSuper7(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct7();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf7(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf7(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn7(this, result);
  };
}
function _possibleConstructorReturn7(self2, call) {
  if (call && (_typeof10(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized7(self2);
}
function _assertThisInitialized7(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct7() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf7(o3) {
  _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf7(o3);
}
function _defineProperty7(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var QuarterParser = /* @__PURE__ */ function(_Parser) {
  _inherits7(QuarterParser22, _Parser);
  var _super = _createSuper7(QuarterParser22);
  function QuarterParser22() {
    var _this;
    _classCallCheck8(this, QuarterParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty7(_assertThisInitialized7(_this), "priority", 120);
    _defineProperty7(_assertThisInitialized7(_this), "incompatibleTokens", ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass8(QuarterParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "Q":
        case "QQ":
          return parseNDigits(token.length, dateString);
        case "Qo":
          return match52.ordinalNumber(dateString, {
            unit: "quarter"
          });
        case "QQQ":
          return match52.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "QQQQQ":
          return match52.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "QQQQ":
        default:
          return match52.quarter(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 4;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth((value - 1) * 3, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return QuarterParser22;
}(Parser);
function _typeof11(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof11 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof11 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof11(obj);
}
function _classCallCheck9(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties9(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass9(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties9(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties9(Constructor, staticProps);
  return Constructor;
}
function _inherits8(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf8(subClass, superClass);
}
function _setPrototypeOf8(o3, p4) {
  _setPrototypeOf8 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf8(o3, p4);
}
function _createSuper8(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct8();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf8(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf8(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn8(this, result);
  };
}
function _possibleConstructorReturn8(self2, call) {
  if (call && (_typeof11(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized8(self2);
}
function _assertThisInitialized8(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct8() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf8(o3) {
  _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf8(o3);
}
function _defineProperty8(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneQuarterParser = /* @__PURE__ */ function(_Parser) {
  _inherits8(StandAloneQuarterParser22, _Parser);
  var _super = _createSuper8(StandAloneQuarterParser22);
  function StandAloneQuarterParser22() {
    var _this;
    _classCallCheck9(this, StandAloneQuarterParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty8(_assertThisInitialized8(_this), "priority", 120);
    _defineProperty8(_assertThisInitialized8(_this), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass9(StandAloneQuarterParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "q":
        case "qq":
          return parseNDigits(token.length, dateString);
        case "qo":
          return match52.ordinalNumber(dateString, {
            unit: "quarter"
          });
        case "qqq":
          return match52.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "qqqqq":
          return match52.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "qqqq":
        default:
          return match52.quarter(dateString, {
            width: "wide",
            context: "standalone"
          }) || match52.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 4;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth((value - 1) * 3, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneQuarterParser22;
}(Parser);
function _typeof12(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof12 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof12 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof12(obj);
}
function _classCallCheck10(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties10(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass10(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties10(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties10(Constructor, staticProps);
  return Constructor;
}
function _inherits9(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf9(subClass, superClass);
}
function _setPrototypeOf9(o3, p4) {
  _setPrototypeOf9 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf9(o3, p4);
}
function _createSuper9(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct9();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf9(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf9(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn9(this, result);
  };
}
function _possibleConstructorReturn9(self2, call) {
  if (call && (_typeof12(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized9(self2);
}
function _assertThisInitialized9(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct9() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf9(o3) {
  _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf9(o3);
}
function _defineProperty9(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var MonthParser = /* @__PURE__ */ function(_Parser) {
  _inherits9(MonthParser22, _Parser);
  var _super = _createSuper9(MonthParser22);
  function MonthParser22() {
    var _this;
    _classCallCheck10(this, MonthParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty9(_assertThisInitialized9(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]);
    _defineProperty9(_assertThisInitialized9(_this), "priority", 110);
    return _this;
  }
  _createClass10(MonthParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      var valueCallback92 = function valueCallback102(value) {
        return value - 1;
      };
      switch (token) {
        case "M":
          return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback92);
        case "MM":
          return mapValue(parseNDigits(2, dateString), valueCallback92);
        case "Mo":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "month"
          }), valueCallback92);
        case "MMM":
          return match52.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "MMMMM":
          return match52.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "MMMM":
        default:
          return match52.month(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(value, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return MonthParser22;
}(Parser);
function _typeof13(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof13 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof13 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof13(obj);
}
function _classCallCheck11(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties11(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass11(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties11(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties11(Constructor, staticProps);
  return Constructor;
}
function _inherits10(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf10(subClass, superClass);
}
function _setPrototypeOf10(o3, p4) {
  _setPrototypeOf10 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf10(o3, p4);
}
function _createSuper10(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct10();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf10(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf10(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn10(this, result);
  };
}
function _possibleConstructorReturn10(self2, call) {
  if (call && (_typeof13(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized10(self2);
}
function _assertThisInitialized10(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct10() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf10(o3) {
  _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf10(o3);
}
function _defineProperty10(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneMonthParser = /* @__PURE__ */ function(_Parser) {
  _inherits10(StandAloneMonthParser22, _Parser);
  var _super = _createSuper10(StandAloneMonthParser22);
  function StandAloneMonthParser22() {
    var _this;
    _classCallCheck11(this, StandAloneMonthParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty10(_assertThisInitialized10(_this), "priority", 110);
    _defineProperty10(_assertThisInitialized10(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass11(StandAloneMonthParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      var valueCallback92 = function valueCallback102(value) {
        return value - 1;
      };
      switch (token) {
        case "L":
          return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback92);
        case "LL":
          return mapValue(parseNDigits(2, dateString), valueCallback92);
        case "Lo":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "month"
          }), valueCallback92);
        case "LLL":
          return match52.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "LLLLL":
          return match52.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "LLLL":
        default:
          return match52.month(dateString, {
            width: "wide",
            context: "standalone"
          }) || match52.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(value, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneMonthParser22;
}(Parser);
function setUTCWeek(dirtyDate, dirtyWeek, options) {
  requiredArgs(2, arguments);
  var date = toDate(dirtyDate);
  var week = toInteger(dirtyWeek);
  var diff = getUTCWeek(date, options) - week;
  date.setUTCDate(date.getUTCDate() - diff * 7);
  return date;
}
function _typeof14(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof14 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof14 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof14(obj);
}
function _classCallCheck12(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties12(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass12(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties12(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties12(Constructor, staticProps);
  return Constructor;
}
function _inherits11(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf11(subClass, superClass);
}
function _setPrototypeOf11(o3, p4) {
  _setPrototypeOf11 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf11(o3, p4);
}
function _createSuper11(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct11();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf11(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf11(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn11(this, result);
  };
}
function _possibleConstructorReturn11(self2, call) {
  if (call && (_typeof14(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized11(self2);
}
function _assertThisInitialized11(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct11() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf11(o3) {
  _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf11(o3);
}
function _defineProperty11(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalWeekParser = /* @__PURE__ */ function(_Parser) {
  _inherits11(LocalWeekParser22, _Parser);
  var _super = _createSuper11(LocalWeekParser22);
  function LocalWeekParser22() {
    var _this;
    _classCallCheck12(this, LocalWeekParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty11(_assertThisInitialized11(_this), "priority", 100);
    _defineProperty11(_assertThisInitialized11(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]);
    return _this;
  }
  _createClass12(LocalWeekParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "w":
          return parseNumericPattern(numericPatterns.week, dateString);
        case "wo":
          return match52.ordinalNumber(dateString, {
            unit: "week"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 53;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      return startOfUTCWeek(setUTCWeek(date, value, options), options);
    }
  }]);
  return LocalWeekParser22;
}(Parser);
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
  requiredArgs(2, arguments);
  var date = toDate(dirtyDate);
  var isoWeek = toInteger(dirtyISOWeek);
  var diff = getUTCISOWeek(date) - isoWeek;
  date.setUTCDate(date.getUTCDate() - diff * 7);
  return date;
}
function _typeof15(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof15 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof15 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof15(obj);
}
function _classCallCheck13(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties13(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass13(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties13(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties13(Constructor, staticProps);
  return Constructor;
}
function _inherits12(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf12(subClass, superClass);
}
function _setPrototypeOf12(o3, p4) {
  _setPrototypeOf12 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf12(o3, p4);
}
function _createSuper12(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct12();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf12(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf12(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn12(this, result);
  };
}
function _possibleConstructorReturn12(self2, call) {
  if (call && (_typeof15(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized12(self2);
}
function _assertThisInitialized12(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct12() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf12(o3) {
  _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf12(o3);
}
function _defineProperty12(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOWeekParser = /* @__PURE__ */ function(_Parser) {
  _inherits12(ISOWeekParser22, _Parser);
  var _super = _createSuper12(ISOWeekParser22);
  function ISOWeekParser22() {
    var _this;
    _classCallCheck13(this, ISOWeekParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty12(_assertThisInitialized12(_this), "priority", 100);
    _defineProperty12(_assertThisInitialized12(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass13(ISOWeekParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "I":
          return parseNumericPattern(numericPatterns.week, dateString);
        case "Io":
          return match52.ordinalNumber(dateString, {
            unit: "week"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 53;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      return startOfUTCISOWeek(setUTCISOWeek(date, value));
    }
  }]);
  return ISOWeekParser22;
}(Parser);
function _typeof16(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof16 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof16 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof16(obj);
}
function _classCallCheck14(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties14(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass14(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties14(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties14(Constructor, staticProps);
  return Constructor;
}
function _inherits13(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf13(subClass, superClass);
}
function _setPrototypeOf13(o3, p4) {
  _setPrototypeOf13 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf13(o3, p4);
}
function _createSuper13(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct13();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf13(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf13(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn13(this, result);
  };
}
function _possibleConstructorReturn13(self2, call) {
  if (call && (_typeof16(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized13(self2);
}
function _assertThisInitialized13(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct13() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf13(o3) {
  _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf13(o3);
}
function _defineProperty13(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var DateParser = /* @__PURE__ */ function(_Parser) {
  _inherits13(DateParser22, _Parser);
  var _super = _createSuper13(DateParser22);
  function DateParser22() {
    var _this;
    _classCallCheck14(this, DateParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty13(_assertThisInitialized13(_this), "priority", 90);
    _defineProperty13(_assertThisInitialized13(_this), "subPriority", 1);
    _defineProperty13(_assertThisInitialized13(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass14(DateParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "d":
          return parseNumericPattern(numericPatterns.date, dateString);
        case "do":
          return match52.ordinalNumber(dateString, {
            unit: "date"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(date, value) {
      var year = date.getUTCFullYear();
      var isLeapYear = isLeapYearIndex(year);
      var month = date.getUTCMonth();
      if (isLeapYear) {
        return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
      } else {
        return value >= 1 && value <= DAYS_IN_MONTH[month];
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCDate(value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DateParser22;
}(Parser);
function _typeof17(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof17 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof17 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof17(obj);
}
function _classCallCheck15(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties15(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass15(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties15(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties15(Constructor, staticProps);
  return Constructor;
}
function _inherits14(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf14(subClass, superClass);
}
function _setPrototypeOf14(o3, p4) {
  _setPrototypeOf14 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf14(o3, p4);
}
function _createSuper14(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct14();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf14(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf14(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn14(this, result);
  };
}
function _possibleConstructorReturn14(self2, call) {
  if (call && (_typeof17(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized14(self2);
}
function _assertThisInitialized14(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct14() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf14(o3) {
  _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf14(o3);
}
function _defineProperty14(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayOfYearParser = /* @__PURE__ */ function(_Parser) {
  _inherits14(DayOfYearParser22, _Parser);
  var _super = _createSuper14(DayOfYearParser22);
  function DayOfYearParser22() {
    var _this;
    _classCallCheck15(this, DayOfYearParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty14(_assertThisInitialized14(_this), "priority", 90);
    _defineProperty14(_assertThisInitialized14(_this), "subpriority", 1);
    _defineProperty14(_assertThisInitialized14(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass15(DayOfYearParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "D":
        case "DD":
          return parseNumericPattern(numericPatterns.dayOfYear, dateString);
        case "Do":
          return match52.ordinalNumber(dateString, {
            unit: "date"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(date, value) {
      var year = date.getUTCFullYear();
      var isLeapYear = isLeapYearIndex(year);
      if (isLeapYear) {
        return value >= 1 && value <= 366;
      } else {
        return value >= 1 && value <= 365;
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(0, value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DayOfYearParser22;
}(Parser);
function setUTCDay(dirtyDate, dirtyDay, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs(2, arguments);
  var defaultOptions22 = getDefaultOptions();
  var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions22.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions22.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate(dirtyDate);
  var day = toInteger(dirtyDay);
  var currentDay = date.getUTCDay();
  var remainder = day % 7;
  var dayIndex = (remainder + 7) % 7;
  var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
  date.setUTCDate(date.getUTCDate() + diff);
  return date;
}
function _typeof18(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof18 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof18 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof18(obj);
}
function _classCallCheck16(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties16(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass16(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties16(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties16(Constructor, staticProps);
  return Constructor;
}
function _inherits15(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf15(subClass, superClass);
}
function _setPrototypeOf15(o3, p4) {
  _setPrototypeOf15 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf15(o3, p4);
}
function _createSuper15(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct15();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf15(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf15(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn15(this, result);
  };
}
function _possibleConstructorReturn15(self2, call) {
  if (call && (_typeof18(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized15(self2);
}
function _assertThisInitialized15(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct15() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf15(o3) {
  _getPrototypeOf15 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf15(o3);
}
function _defineProperty15(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayParser = /* @__PURE__ */ function(_Parser) {
  _inherits15(DayParser22, _Parser);
  var _super = _createSuper15(DayParser22);
  function DayParser22() {
    var _this;
    _classCallCheck16(this, DayParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty15(_assertThisInitialized15(_this), "priority", 90);
    _defineProperty15(_assertThisInitialized15(_this), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass16(DayParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "E":
        case "EE":
        case "EEE":
          return match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEEE":
          return match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEEEE":
          return match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEE":
        default:
          return match52.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DayParser22;
}(Parser);
function _typeof19(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof19 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof19 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof19(obj);
}
function _classCallCheck17(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties17(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass17(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties17(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties17(Constructor, staticProps);
  return Constructor;
}
function _inherits16(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf16(subClass, superClass);
}
function _setPrototypeOf16(o3, p4) {
  _setPrototypeOf16 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf16(o3, p4);
}
function _createSuper16(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct16();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf16(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf16(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn16(this, result);
  };
}
function _possibleConstructorReturn16(self2, call) {
  if (call && (_typeof19(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized16(self2);
}
function _assertThisInitialized16(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct16() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf16(o3) {
  _getPrototypeOf16 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf16(o3);
}
function _defineProperty16(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalDayParser = /* @__PURE__ */ function(_Parser) {
  _inherits16(LocalDayParser22, _Parser);
  var _super = _createSuper16(LocalDayParser22);
  function LocalDayParser22() {
    var _this;
    _classCallCheck17(this, LocalDayParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty16(_assertThisInitialized16(_this), "priority", 90);
    _defineProperty16(_assertThisInitialized16(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]);
    return _this;
  }
  _createClass17(LocalDayParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52, options) {
      var valueCallback92 = function valueCallback102(value) {
        var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        case "e":
        case "ee":
          return mapValue(parseNDigits(token.length, dateString), valueCallback92);
        case "eo":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "day"
          }), valueCallback92);
        case "eee":
          return match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeeee":
          return match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeeeee":
          return match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeee":
        default:
          return match52.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return LocalDayParser22;
}(Parser);
function _typeof20(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof20 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof20 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof20(obj);
}
function _classCallCheck18(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties18(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass18(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties18(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties18(Constructor, staticProps);
  return Constructor;
}
function _inherits17(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf17(subClass, superClass);
}
function _setPrototypeOf17(o3, p4) {
  _setPrototypeOf17 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf17(o3, p4);
}
function _createSuper17(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct17();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf17(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf17(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn17(this, result);
  };
}
function _possibleConstructorReturn17(self2, call) {
  if (call && (_typeof20(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized17(self2);
}
function _assertThisInitialized17(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct17() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf17(o3) {
  _getPrototypeOf17 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf17(o3);
}
function _defineProperty17(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneLocalDayParser = /* @__PURE__ */ function(_Parser) {
  _inherits17(StandAloneLocalDayParser22, _Parser);
  var _super = _createSuper17(StandAloneLocalDayParser22);
  function StandAloneLocalDayParser22() {
    var _this;
    _classCallCheck18(this, StandAloneLocalDayParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty17(_assertThisInitialized17(_this), "priority", 90);
    _defineProperty17(_assertThisInitialized17(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]);
    return _this;
  }
  _createClass18(StandAloneLocalDayParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52, options) {
      var valueCallback92 = function valueCallback102(value) {
        var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        case "c":
        case "cc":
          return mapValue(parseNDigits(token.length, dateString), valueCallback92);
        case "co":
          return mapValue(match52.ordinalNumber(dateString, {
            unit: "day"
          }), valueCallback92);
        case "ccc":
          return match52.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "ccccc":
          return match52.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "cccccc":
          return match52.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "cccc":
        default:
          return match52.day(dateString, {
            width: "wide",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneLocalDayParser22;
}(Parser);
function setUTCISODay(dirtyDate, dirtyDay) {
  requiredArgs(2, arguments);
  var day = toInteger(dirtyDay);
  if (day % 7 === 0) {
    day = day - 7;
  }
  var weekStartsOn = 1;
  var date = toDate(dirtyDate);
  var currentDay = date.getUTCDay();
  var remainder = day % 7;
  var dayIndex = (remainder + 7) % 7;
  var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
  date.setUTCDate(date.getUTCDate() + diff);
  return date;
}
function _typeof21(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof21 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof21 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof21(obj);
}
function _classCallCheck19(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties19(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass19(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties19(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties19(Constructor, staticProps);
  return Constructor;
}
function _inherits18(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf18(subClass, superClass);
}
function _setPrototypeOf18(o3, p4) {
  _setPrototypeOf18 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf18(o3, p4);
}
function _createSuper18(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct18();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf18(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf18(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn18(this, result);
  };
}
function _possibleConstructorReturn18(self2, call) {
  if (call && (_typeof21(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized18(self2);
}
function _assertThisInitialized18(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct18() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf18(o3) {
  _getPrototypeOf18 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf18(o3);
}
function _defineProperty18(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISODayParser = /* @__PURE__ */ function(_Parser) {
  _inherits18(ISODayParser22, _Parser);
  var _super = _createSuper18(ISODayParser22);
  function ISODayParser22() {
    var _this;
    _classCallCheck19(this, ISODayParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty18(_assertThisInitialized18(_this), "priority", 90);
    _defineProperty18(_assertThisInitialized18(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass19(ISODayParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      var valueCallback92 = function valueCallback102(value) {
        if (value === 0) {
          return 7;
        }
        return value;
      };
      switch (token) {
        case "i":
        case "ii":
          return parseNDigits(token.length, dateString);
        case "io":
          return match52.ordinalNumber(dateString, {
            unit: "day"
          });
        case "iii":
          return mapValue(match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback92);
        case "iiiii":
          return mapValue(match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback92);
        case "iiiiii":
          return mapValue(match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback92);
        case "iiii":
        default:
          return mapValue(match52.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match52.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback92);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 7;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date = setUTCISODay(date, value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return ISODayParser22;
}(Parser);
function _typeof22(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof22 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof22 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof22(obj);
}
function _classCallCheck20(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties20(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass20(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties20(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties20(Constructor, staticProps);
  return Constructor;
}
function _inherits19(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf19(subClass, superClass);
}
function _setPrototypeOf19(o3, p4) {
  _setPrototypeOf19 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf19(o3, p4);
}
function _createSuper19(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct19();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf19(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf19(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn19(this, result);
  };
}
function _possibleConstructorReturn19(self2, call) {
  if (call && (_typeof22(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized19(self2);
}
function _assertThisInitialized19(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct19() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf19(o3) {
  _getPrototypeOf19 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf19(o3);
}
function _defineProperty19(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var AMPMParser = /* @__PURE__ */ function(_Parser) {
  _inherits19(AMPMParser22, _Parser);
  var _super = _createSuper19(AMPMParser22);
  function AMPMParser22() {
    var _this;
    _classCallCheck20(this, AMPMParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty19(_assertThisInitialized19(_this), "priority", 80);
    _defineProperty19(_assertThisInitialized19(_this), "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass20(AMPMParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "a":
        case "aa":
        case "aaa":
          return match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaaa":
          return match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaa":
        default:
          return match52.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
  }]);
  return AMPMParser22;
}(Parser);
function _typeof23(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof23 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof23 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof23(obj);
}
function _classCallCheck21(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties21(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass21(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties21(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties21(Constructor, staticProps);
  return Constructor;
}
function _inherits20(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf20(subClass, superClass);
}
function _setPrototypeOf20(o3, p4) {
  _setPrototypeOf20 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf20(o3, p4);
}
function _createSuper20(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct20();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf20(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf20(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn20(this, result);
  };
}
function _possibleConstructorReturn20(self2, call) {
  if (call && (_typeof23(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized20(self2);
}
function _assertThisInitialized20(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct20() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf20(o3) {
  _getPrototypeOf20 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf20(o3);
}
function _defineProperty20(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var AMPMMidnightParser = /* @__PURE__ */ function(_Parser) {
  _inherits20(AMPMMidnightParser22, _Parser);
  var _super = _createSuper20(AMPMMidnightParser22);
  function AMPMMidnightParser22() {
    var _this;
    _classCallCheck21(this, AMPMMidnightParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty20(_assertThisInitialized20(_this), "priority", 80);
    _defineProperty20(_assertThisInitialized20(_this), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass21(AMPMMidnightParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "b":
        case "bb":
        case "bbb":
          return match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbbb":
          return match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbb":
        default:
          return match52.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
  }]);
  return AMPMMidnightParser22;
}(Parser);
function _typeof24(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof24 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof24 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof24(obj);
}
function _classCallCheck22(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties22(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass22(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties22(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties22(Constructor, staticProps);
  return Constructor;
}
function _inherits21(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf21(subClass, superClass);
}
function _setPrototypeOf21(o3, p4) {
  _setPrototypeOf21 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf21(o3, p4);
}
function _createSuper21(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct21();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf21(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf21(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn21(this, result);
  };
}
function _possibleConstructorReturn21(self2, call) {
  if (call && (_typeof24(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized21(self2);
}
function _assertThisInitialized21(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct21() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf21(o3) {
  _getPrototypeOf21 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf21(o3);
}
function _defineProperty21(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayPeriodParser = /* @__PURE__ */ function(_Parser) {
  _inherits21(DayPeriodParser22, _Parser);
  var _super = _createSuper21(DayPeriodParser22);
  function DayPeriodParser22() {
    var _this;
    _classCallCheck22(this, DayPeriodParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty21(_assertThisInitialized21(_this), "priority", 80);
    _defineProperty21(_assertThisInitialized21(_this), "incompatibleTokens", ["a", "b", "t", "T"]);
    return _this;
  }
  _createClass22(DayPeriodParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "B":
        case "BB":
        case "BBB":
          return match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBBB":
          return match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBB":
        default:
          return match52.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match52.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
      return date;
    }
  }]);
  return DayPeriodParser22;
}(Parser);
function _typeof25(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof25 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof25 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof25(obj);
}
function _classCallCheck23(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties23(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass23(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties23(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties23(Constructor, staticProps);
  return Constructor;
}
function _inherits22(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf22(subClass, superClass);
}
function _setPrototypeOf22(o3, p4) {
  _setPrototypeOf22 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf22(o3, p4);
}
function _createSuper22(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct22();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf22(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf22(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn22(this, result);
  };
}
function _possibleConstructorReturn22(self2, call) {
  if (call && (_typeof25(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized22(self2);
}
function _assertThisInitialized22(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct22() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf22(o3) {
  _getPrototypeOf22 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf22(o3);
}
function _defineProperty22(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour1to12Parser = /* @__PURE__ */ function(_Parser) {
  _inherits22(Hour1to12Parser22, _Parser);
  var _super = _createSuper22(Hour1to12Parser22);
  function Hour1to12Parser22() {
    var _this;
    _classCallCheck23(this, Hour1to12Parser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty22(_assertThisInitialized22(_this), "priority", 70);
    _defineProperty22(_assertThisInitialized22(_this), "incompatibleTokens", ["H", "K", "k", "t", "T"]);
    return _this;
  }
  _createClass23(Hour1to12Parser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "h":
          return parseNumericPattern(numericPatterns.hour12h, dateString);
        case "ho":
          return match52.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 12;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var isPM = date.getUTCHours() >= 12;
      if (isPM && value < 12) {
        date.setUTCHours(value + 12, 0, 0, 0);
      } else if (!isPM && value === 12) {
        date.setUTCHours(0, 0, 0, 0);
      } else {
        date.setUTCHours(value, 0, 0, 0);
      }
      return date;
    }
  }]);
  return Hour1to12Parser22;
}(Parser);
function _typeof26(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof26 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof26 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof26(obj);
}
function _classCallCheck24(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties24(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass24(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties24(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties24(Constructor, staticProps);
  return Constructor;
}
function _inherits23(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf23(subClass, superClass);
}
function _setPrototypeOf23(o3, p4) {
  _setPrototypeOf23 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf23(o3, p4);
}
function _createSuper23(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct23();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf23(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf23(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn23(this, result);
  };
}
function _possibleConstructorReturn23(self2, call) {
  if (call && (_typeof26(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized23(self2);
}
function _assertThisInitialized23(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct23() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf23(o3) {
  _getPrototypeOf23 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf23(o3);
}
function _defineProperty23(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour0to23Parser = /* @__PURE__ */ function(_Parser) {
  _inherits23(Hour0to23Parser22, _Parser);
  var _super = _createSuper23(Hour0to23Parser22);
  function Hour0to23Parser22() {
    var _this;
    _classCallCheck24(this, Hour0to23Parser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty23(_assertThisInitialized23(_this), "priority", 70);
    _defineProperty23(_assertThisInitialized23(_this), "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
    return _this;
  }
  _createClass24(Hour0to23Parser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "H":
          return parseNumericPattern(numericPatterns.hour23h, dateString);
        case "Ho":
          return match52.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 23;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(value, 0, 0, 0);
      return date;
    }
  }]);
  return Hour0to23Parser22;
}(Parser);
function _typeof27(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof27 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof27 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof27(obj);
}
function _classCallCheck25(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties25(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass25(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties25(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties25(Constructor, staticProps);
  return Constructor;
}
function _inherits24(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf24(subClass, superClass);
}
function _setPrototypeOf24(o3, p4) {
  _setPrototypeOf24 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf24(o3, p4);
}
function _createSuper24(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct24();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf24(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf24(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn24(this, result);
  };
}
function _possibleConstructorReturn24(self2, call) {
  if (call && (_typeof27(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized24(self2);
}
function _assertThisInitialized24(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct24() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf24(o3) {
  _getPrototypeOf24 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf24(o3);
}
function _defineProperty24(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour0To11Parser = /* @__PURE__ */ function(_Parser) {
  _inherits24(Hour0To11Parser22, _Parser);
  var _super = _createSuper24(Hour0To11Parser22);
  function Hour0To11Parser22() {
    var _this;
    _classCallCheck25(this, Hour0To11Parser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty24(_assertThisInitialized24(_this), "priority", 70);
    _defineProperty24(_assertThisInitialized24(_this), "incompatibleTokens", ["h", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass25(Hour0To11Parser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "K":
          return parseNumericPattern(numericPatterns.hour11h, dateString);
        case "Ko":
          return match52.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var isPM = date.getUTCHours() >= 12;
      if (isPM && value < 12) {
        date.setUTCHours(value + 12, 0, 0, 0);
      } else {
        date.setUTCHours(value, 0, 0, 0);
      }
      return date;
    }
  }]);
  return Hour0To11Parser22;
}(Parser);
function _typeof28(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof28 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof28 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof28(obj);
}
function _classCallCheck26(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties26(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass26(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties26(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties26(Constructor, staticProps);
  return Constructor;
}
function _inherits25(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf25(subClass, superClass);
}
function _setPrototypeOf25(o3, p4) {
  _setPrototypeOf25 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf25(o3, p4);
}
function _createSuper25(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct25();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf25(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf25(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn25(this, result);
  };
}
function _possibleConstructorReturn25(self2, call) {
  if (call && (_typeof28(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized25(self2);
}
function _assertThisInitialized25(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct25() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf25(o3) {
  _getPrototypeOf25 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf25(o3);
}
function _defineProperty25(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour1To24Parser = /* @__PURE__ */ function(_Parser) {
  _inherits25(Hour1To24Parser22, _Parser);
  var _super = _createSuper25(Hour1To24Parser22);
  function Hour1To24Parser22() {
    var _this;
    _classCallCheck26(this, Hour1To24Parser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty25(_assertThisInitialized25(_this), "priority", 70);
    _defineProperty25(_assertThisInitialized25(_this), "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
    return _this;
  }
  _createClass26(Hour1To24Parser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "k":
          return parseNumericPattern(numericPatterns.hour24h, dateString);
        case "ko":
          return match52.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 24;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var hours = value <= 24 ? value % 24 : value;
      date.setUTCHours(hours, 0, 0, 0);
      return date;
    }
  }]);
  return Hour1To24Parser22;
}(Parser);
function _typeof29(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof29 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof29 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof29(obj);
}
function _classCallCheck27(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties27(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass27(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties27(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties27(Constructor, staticProps);
  return Constructor;
}
function _inherits26(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf26(subClass, superClass);
}
function _setPrototypeOf26(o3, p4) {
  _setPrototypeOf26 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf26(o3, p4);
}
function _createSuper26(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct26();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf26(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf26(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn26(this, result);
  };
}
function _possibleConstructorReturn26(self2, call) {
  if (call && (_typeof29(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized26(self2);
}
function _assertThisInitialized26(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct26() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf26(o3) {
  _getPrototypeOf26 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf26(o3);
}
function _defineProperty26(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var MinuteParser = /* @__PURE__ */ function(_Parser) {
  _inherits26(MinuteParser22, _Parser);
  var _super = _createSuper26(MinuteParser22);
  function MinuteParser22() {
    var _this;
    _classCallCheck27(this, MinuteParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty26(_assertThisInitialized26(_this), "priority", 60);
    _defineProperty26(_assertThisInitialized26(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass27(MinuteParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "m":
          return parseNumericPattern(numericPatterns.minute, dateString);
        case "mo":
          return match52.ordinalNumber(dateString, {
            unit: "minute"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 59;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMinutes(value, 0, 0);
      return date;
    }
  }]);
  return MinuteParser22;
}(Parser);
function _typeof30(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof30 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof30 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof30(obj);
}
function _classCallCheck28(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties28(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass28(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties28(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties28(Constructor, staticProps);
  return Constructor;
}
function _inherits27(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf27(subClass, superClass);
}
function _setPrototypeOf27(o3, p4) {
  _setPrototypeOf27 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf27(o3, p4);
}
function _createSuper27(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct27();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf27(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf27(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn27(this, result);
  };
}
function _possibleConstructorReturn27(self2, call) {
  if (call && (_typeof30(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized27(self2);
}
function _assertThisInitialized27(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct27() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf27(o3) {
  _getPrototypeOf27 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf27(o3);
}
function _defineProperty27(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var SecondParser = /* @__PURE__ */ function(_Parser) {
  _inherits27(SecondParser22, _Parser);
  var _super = _createSuper27(SecondParser22);
  function SecondParser22() {
    var _this;
    _classCallCheck28(this, SecondParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty27(_assertThisInitialized27(_this), "priority", 50);
    _defineProperty27(_assertThisInitialized27(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass28(SecondParser22, [{
    key: "parse",
    value: function parse22(dateString, token, match52) {
      switch (token) {
        case "s":
          return parseNumericPattern(numericPatterns.second, dateString);
        case "so":
          return match52.ordinalNumber(dateString, {
            unit: "second"
          });
        default:
          return parseNDigits(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 59;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCSeconds(value, 0);
      return date;
    }
  }]);
  return SecondParser22;
}(Parser);
function _typeof31(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof31 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof31 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof31(obj);
}
function _classCallCheck29(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties29(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass29(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties29(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties29(Constructor, staticProps);
  return Constructor;
}
function _inherits28(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf28(subClass, superClass);
}
function _setPrototypeOf28(o3, p4) {
  _setPrototypeOf28 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf28(o3, p4);
}
function _createSuper28(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct28();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf28(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf28(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn28(this, result);
  };
}
function _possibleConstructorReturn28(self2, call) {
  if (call && (_typeof31(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized28(self2);
}
function _assertThisInitialized28(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct28() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf28(o3) {
  _getPrototypeOf28 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf28(o3);
}
function _defineProperty28(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var FractionOfSecondParser = /* @__PURE__ */ function(_Parser) {
  _inherits28(FractionOfSecondParser22, _Parser);
  var _super = _createSuper28(FractionOfSecondParser22);
  function FractionOfSecondParser22() {
    var _this;
    _classCallCheck29(this, FractionOfSecondParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty28(_assertThisInitialized28(_this), "priority", 30);
    _defineProperty28(_assertThisInitialized28(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass29(FractionOfSecondParser22, [{
    key: "parse",
    value: function parse22(dateString, token) {
      var valueCallback92 = function valueCallback102(value) {
        return Math.floor(value * Math.pow(10, -token.length + 3));
      };
      return mapValue(parseNDigits(token.length, dateString), valueCallback92);
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMilliseconds(value);
      return date;
    }
  }]);
  return FractionOfSecondParser22;
}(Parser);
function _typeof32(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof32 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof32 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof32(obj);
}
function _classCallCheck30(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties30(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass30(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties30(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties30(Constructor, staticProps);
  return Constructor;
}
function _inherits29(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf29(subClass, superClass);
}
function _setPrototypeOf29(o3, p4) {
  _setPrototypeOf29 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf29(o3, p4);
}
function _createSuper29(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct29();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf29(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf29(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn29(this, result);
  };
}
function _possibleConstructorReturn29(self2, call) {
  if (call && (_typeof32(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized29(self2);
}
function _assertThisInitialized29(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct29() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf29(o3) {
  _getPrototypeOf29 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf29(o3);
}
function _defineProperty29(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOTimezoneWithZParser = /* @__PURE__ */ function(_Parser) {
  _inherits29(ISOTimezoneWithZParser22, _Parser);
  var _super = _createSuper29(ISOTimezoneWithZParser22);
  function ISOTimezoneWithZParser22() {
    var _this;
    _classCallCheck30(this, ISOTimezoneWithZParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty29(_assertThisInitialized29(_this), "priority", 10);
    _defineProperty29(_assertThisInitialized29(_this), "incompatibleTokens", ["t", "T", "x"]);
    return _this;
  }
  _createClass30(ISOTimezoneWithZParser22, [{
    key: "parse",
    value: function parse22(dateString, token) {
      switch (token) {
        case "X":
          return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
        case "XX":
          return parseTimezonePattern(timezonePatterns.basic, dateString);
        case "XXXX":
          return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
        case "XXXXX":
          return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
        case "XXX":
        default:
          return parseTimezonePattern(timezonePatterns.extended, dateString);
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      if (flags.timestampIsSet) {
        return date;
      }
      return new Date(date.getTime() - value);
    }
  }]);
  return ISOTimezoneWithZParser22;
}(Parser);
function _typeof33(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof33 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof33 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof33(obj);
}
function _classCallCheck31(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties31(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass31(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties31(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties31(Constructor, staticProps);
  return Constructor;
}
function _inherits30(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf30(subClass, superClass);
}
function _setPrototypeOf30(o3, p4) {
  _setPrototypeOf30 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf30(o3, p4);
}
function _createSuper30(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct30();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf30(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf30(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn30(this, result);
  };
}
function _possibleConstructorReturn30(self2, call) {
  if (call && (_typeof33(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized30(self2);
}
function _assertThisInitialized30(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct30() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf30(o3) {
  _getPrototypeOf30 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf30(o3);
}
function _defineProperty30(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOTimezoneParser = /* @__PURE__ */ function(_Parser) {
  _inherits30(ISOTimezoneParser22, _Parser);
  var _super = _createSuper30(ISOTimezoneParser22);
  function ISOTimezoneParser22() {
    var _this;
    _classCallCheck31(this, ISOTimezoneParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty30(_assertThisInitialized30(_this), "priority", 10);
    _defineProperty30(_assertThisInitialized30(_this), "incompatibleTokens", ["t", "T", "X"]);
    return _this;
  }
  _createClass31(ISOTimezoneParser22, [{
    key: "parse",
    value: function parse22(dateString, token) {
      switch (token) {
        case "x":
          return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
        case "xx":
          return parseTimezonePattern(timezonePatterns.basic, dateString);
        case "xxxx":
          return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
        case "xxxxx":
          return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
        case "xxx":
        default:
          return parseTimezonePattern(timezonePatterns.extended, dateString);
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      if (flags.timestampIsSet) {
        return date;
      }
      return new Date(date.getTime() - value);
    }
  }]);
  return ISOTimezoneParser22;
}(Parser);
function _typeof34(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof34 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof34 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof34(obj);
}
function _classCallCheck32(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties32(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass32(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties32(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties32(Constructor, staticProps);
  return Constructor;
}
function _inherits31(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf31(subClass, superClass);
}
function _setPrototypeOf31(o3, p4) {
  _setPrototypeOf31 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf31(o3, p4);
}
function _createSuper31(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct31();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf31(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf31(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn31(this, result);
  };
}
function _possibleConstructorReturn31(self2, call) {
  if (call && (_typeof34(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized31(self2);
}
function _assertThisInitialized31(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct31() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf31(o3) {
  _getPrototypeOf31 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf31(o3);
}
function _defineProperty31(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var TimestampSecondsParser = /* @__PURE__ */ function(_Parser) {
  _inherits31(TimestampSecondsParser22, _Parser);
  var _super = _createSuper31(TimestampSecondsParser22);
  function TimestampSecondsParser22() {
    var _this;
    _classCallCheck32(this, TimestampSecondsParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty31(_assertThisInitialized31(_this), "priority", 40);
    _defineProperty31(_assertThisInitialized31(_this), "incompatibleTokens", "*");
    return _this;
  }
  _createClass32(TimestampSecondsParser22, [{
    key: "parse",
    value: function parse22(dateString) {
      return parseAnyDigitsSigned(dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      return [new Date(value * 1e3), {
        timestampIsSet: true
      }];
    }
  }]);
  return TimestampSecondsParser22;
}(Parser);
function _typeof35(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof35 = function _typeof382(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof35 = function _typeof382(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof35(obj);
}
function _classCallCheck33(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties33(target, props) {
  for (var i22 = 0; i22 < props.length; i22++) {
    var descriptor = props[i22];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass33(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties33(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties33(Constructor, staticProps);
  return Constructor;
}
function _inherits32(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf32(subClass, superClass);
}
function _setPrototypeOf32(o3, p4) {
  _setPrototypeOf32 = Object.setPrototypeOf || function _setPrototypeOf332(o22, p22) {
    o22.__proto__ = p22;
    return o22;
  };
  return _setPrototypeOf32(o3, p4);
}
function _createSuper32(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct32();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf32(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf32(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn32(this, result);
  };
}
function _possibleConstructorReturn32(self2, call) {
  if (call && (_typeof35(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized32(self2);
}
function _assertThisInitialized32(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct32() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e22) {
    return false;
  }
}
function _getPrototypeOf32(o3) {
  _getPrototypeOf32 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf332(o22) {
    return o22.__proto__ || Object.getPrototypeOf(o22);
  };
  return _getPrototypeOf32(o3);
}
function _defineProperty32(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var TimestampMillisecondsParser = /* @__PURE__ */ function(_Parser) {
  _inherits32(TimestampMillisecondsParser22, _Parser);
  var _super = _createSuper32(TimestampMillisecondsParser22);
  function TimestampMillisecondsParser22() {
    var _this;
    _classCallCheck33(this, TimestampMillisecondsParser22);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty32(_assertThisInitialized32(_this), "priority", 20);
    _defineProperty32(_assertThisInitialized32(_this), "incompatibleTokens", "*");
    return _this;
  }
  _createClass33(TimestampMillisecondsParser22, [{
    key: "parse",
    value: function parse22(dateString) {
      return parseAnyDigitsSigned(dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      return [new Date(value), {
        timestampIsSet: true
      }];
    }
  }]);
  return TimestampMillisecondsParser22;
}(Parser);
var parsers2 = {
  G: new EraParser(),
  y: new YearParser(),
  Y: new LocalWeekYearParser(),
  R: new ISOWeekYearParser(),
  u: new ExtendedYearParser(),
  Q: new QuarterParser(),
  q: new StandAloneQuarterParser(),
  M: new MonthParser(),
  L: new StandAloneMonthParser(),
  w: new LocalWeekParser(),
  I: new ISOWeekParser(),
  d: new DateParser(),
  D: new DayOfYearParser(),
  E: new DayParser(),
  e: new LocalDayParser(),
  c: new StandAloneLocalDayParser(),
  i: new ISODayParser(),
  a: new AMPMParser(),
  b: new AMPMMidnightParser(),
  B: new DayPeriodParser(),
  h: new Hour1to12Parser(),
  H: new Hour0to23Parser(),
  K: new Hour0To11Parser(),
  k: new Hour1To24Parser(),
  m: new MinuteParser(),
  s: new SecondParser(),
  S: new FractionOfSecondParser(),
  X: new ISOTimezoneWithZParser(),
  x: new ISOTimezoneParser(),
  t: new TimestampSecondsParser(),
  T: new TimestampMillisecondsParser()
};
function Time({
  timestamp,
  relative,
  format: formatString
}) {
  const { i18n: i18n4, dateLocale } = useTranslationContext();
  if (!timestamp)
    return /* @__PURE__ */ h(p2, null);
  if (timestamp.t_ms === "never") {
    return /* @__PURE__ */ h("time", null, i18n4.str`never`);
  }
  const now2 = AbsoluteTime.now();
  const diff = AbsoluteTime.difference(now2, timestamp);
  if (relative && now2.t_ms !== "never" && Duration.cmp(diff, relative) === -1) {
    const d32 = intervalToDuration({
      start: now2.t_ms,
      end: timestamp.t_ms
    });
    d32.seconds = 0;
    const duration = formatDuration(d32, { locale: dateLocale });
    const isFuture2 = AbsoluteTime.cmp(now2, timestamp) < 0;
    if (isFuture2) {
      return /* @__PURE__ */ h("time", { dateTime: formatISO(timestamp.t_ms) }, /* @__PURE__ */ h(i18n4.Translate, null, "in ", duration));
    } else {
      return /* @__PURE__ */ h("time", { dateTime: formatISO(timestamp.t_ms) }, /* @__PURE__ */ h(i18n4.Translate, null, duration, " ago"));
    }
  }
  return /* @__PURE__ */ h("time", { dateTime: formatISO(timestamp.t_ms) }, format(timestamp.t_ms, formatString, { locale: dateLocale }));
}
var utf8Encoder2 = new TextEncoder();
var utf8Decoder2 = new TextDecoder("utf-8", { ignoreBOM: true });
function base64encode(str) {
  return base64EncArr(strToUTF8Arr(str));
}
function uint6ToB64(nUint6) {
  return nUint6 < 26 ? nUint6 + 65 : nUint6 < 52 ? nUint6 + 71 : nUint6 < 62 ? nUint6 - 4 : nUint6 === 62 ? 43 : nUint6 === 63 ? 47 : 65;
}
function base64EncArr(aBytes) {
  let nMod3 = 2;
  let sB64Enc = "";
  const nLen = aBytes.length;
  let nUint24 = 0;
  for (let nIdx = 0; nIdx < nLen; nIdx++) {
    nMod3 = nIdx % 3;
    nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);
    if (nMod3 === 2 || aBytes.length - nIdx === 1) {
      sB64Enc += String.fromCodePoint(
        uint6ToB64(nUint24 >>> 18 & 63),
        uint6ToB64(nUint24 >>> 12 & 63),
        uint6ToB64(nUint24 >>> 6 & 63),
        uint6ToB64(nUint24 & 63)
      );
      nUint24 = 0;
    }
  }
  return sB64Enc.substring(0, sB64Enc.length - 2 + nMod3) + (nMod3 === 2 ? "" : nMod3 === 1 ? "=" : "==");
}
function strToUTF8Arr(sDOMStr) {
  let nChr;
  const nStrLen = sDOMStr.length;
  let nArrLen = 0;
  for (let nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {
    nChr = sDOMStr.codePointAt(nMapIdx);
    if (nChr === void 0) {
      throw Error(
        `No char at ${nMapIdx} on string with length: ${sDOMStr.length}`
      );
    }
    if (nChr >= 65536) {
      nMapIdx++;
    }
    nArrLen += nChr < 128 ? 1 : nChr < 2048 ? 2 : nChr < 65536 ? 3 : nChr < 2097152 ? 4 : nChr < 67108864 ? 5 : 6;
  }
  const aBytes = new Uint8Array(nArrLen);
  let nIdx = 0;
  let nChrIdx = 0;
  while (nIdx < nArrLen) {
    nChr = sDOMStr.codePointAt(nChrIdx);
    if (nChr === void 0) {
      throw Error(
        `No char at ${nChrIdx} on string with length: ${sDOMStr.length}`
      );
    }
    if (nChr < 128) {
      aBytes[nIdx++] = nChr;
    } else if (nChr < 2048) {
      aBytes[nIdx++] = 192 + (nChr >>> 6);
      aBytes[nIdx++] = 128 + (nChr & 63);
    } else if (nChr < 65536) {
      aBytes[nIdx++] = 224 + (nChr >>> 12);
      aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
      aBytes[nIdx++] = 128 + (nChr & 63);
    } else if (nChr < 2097152) {
      aBytes[nIdx++] = 240 + (nChr >>> 18);
      aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
      aBytes[nIdx++] = 128 + (nChr & 63);
      nChrIdx++;
    } else if (nChr < 67108864) {
      aBytes[nIdx++] = 248 + (nChr >>> 24);
      aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
      aBytes[nIdx++] = 128 + (nChr & 63);
      nChrIdx++;
    } else {
      aBytes[nIdx++] = 252 + (nChr >>> 30);
      aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);
      aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);
      aBytes[nIdx++] = 128 + (nChr & 63);
      nChrIdx++;
    }
    nChrIdx++;
  }
  return aBytes;
}
async function defaultRequestHandler(baseUrl, endpoint, options = {}) {
  const requestHeaders = {};
  if (options.token) {
    requestHeaders.Authorization = `Bearer secret-token:${options.token}`;
  } else if (options.basicAuth) {
    requestHeaders.Authorization = `Basic ${base64encode(
      `${options.basicAuth.username}:${options.basicAuth.password}`
    )}`;
  }
  requestHeaders["Content-Type"] = !options.contentType || options.contentType === "json" ? "application/json" : "text/plain";
  if (options.talerAmlOfficerSignature) {
    requestHeaders["Taler-AML-Officer-Signature"] = options.talerAmlOfficerSignature;
  }
  const requestMethod = options?.method ?? "GET";
  const requestBody = options?.data;
  const requestTimeout = options?.timeout ?? 5 * 1e3;
  const requestParams = options.params ?? {};
  const requestPreventCache = options.preventCache ?? false;
  const requestPreventCors = options.preventCors ?? false;
  const validURL = validateURL(baseUrl, endpoint);
  if (!validURL) {
    const error2 = {
      info: {
        url: `${baseUrl}${endpoint}`,
        payload: {},
        hasToken: !!options.token,
        status: 0,
        options
      },
      type: 4,
      exception: void 0,
      loading: false,
      message: `invalid URL: "${baseUrl}${endpoint}"`
    };
    throw new RequestError(error2);
  }
  Object.entries(requestParams).forEach(([key, value]) => {
    validURL.searchParams.set(key, String(value));
  });
  let payload = void 0;
  if (requestBody != null) {
    if (typeof requestBody === "string") {
      payload = requestBody;
    } else if (requestBody instanceof ArrayBuffer) {
      payload = requestBody;
    } else if (ArrayBuffer.isView(requestBody)) {
      payload = requestBody;
    } else if (typeof requestBody === "object") {
      payload = JSON.stringify(requestBody);
    } else {
      const error2 = {
        info: {
          url: validURL.href,
          payload: {},
          hasToken: !!options.token,
          status: 0,
          options
        },
        type: 4,
        exception: void 0,
        loading: false,
        message: `unsupported request body type: "${typeof requestBody}"`
      };
      throw new RequestError(error2);
    }
  }
  const controller = new AbortController();
  const timeoutId = setTimeout(() => {
    controller.abort("HTTP_REQUEST_TIMEOUT");
  }, requestTimeout);
  let response;
  try {
    response = await fetch(validURL.href, {
      headers: requestHeaders,
      method: requestMethod,
      credentials: "omit",
      mode: requestPreventCors ? "no-cors" : "cors",
      cache: requestPreventCache ? "no-cache" : "default",
      body: payload,
      signal: controller.signal
    });
  } catch (ex) {
    const info = {
      payload,
      url: validURL.href,
      hasToken: !!options.token,
      status: 0,
      options
    };
    if (ex instanceof Error) {
      if (ex.message === "HTTP_REQUEST_TIMEOUT") {
        const error22 = {
          info,
          type: 3,
          message: "request timeout"
        };
        throw new RequestError(error22);
      }
    }
    const error2 = {
      info,
      type: 4,
      exception: ex,
      loading: false,
      message: ex instanceof Error ? ex.message : ""
    };
    throw new RequestError(error2);
  }
  if (timeoutId) {
    clearTimeout(timeoutId);
  }
  const headerMap = new Headers();
  response.headers.forEach((value, key) => {
    headerMap.set(key, value);
  });
  if (response.ok) {
    const result = await buildRequestOk(
      response,
      validURL.href,
      payload,
      !!options.token,
      options
    );
    return result;
  } else {
    const dataTxt = await response.text();
    const error2 = buildRequestFailed(
      validURL.href,
      dataTxt,
      response.status,
      payload,
      options
    );
    throw new RequestError(error2);
  }
}
var RequestError = class extends Error {
  constructor(d32) {
    super(d32.message);
    this.info = d32;
    this.cause = d32;
  }
};
async function buildRequestOk(response, url, payload, hasToken, options) {
  const dataTxt = await response.text();
  const data = dataTxt ? JSON.parse(dataTxt) : void 0;
  return {
    ok: true,
    data,
    info: {
      payload,
      url,
      hasToken,
      options,
      status: response.status
    }
  };
}
function buildRequestFailed(url, dataTxt, status, payload, maybeOptions) {
  const options = maybeOptions ?? {};
  const info = {
    payload,
    url,
    hasToken: !!options.token,
    options,
    status: status || 0
  };
  try {
    const data = dataTxt ? JSON.parse(dataTxt) : void 0;
    const errorCode = !data || !data.code ? "" : `(code: ${data.code})`;
    const errorHint = !data || !data.hint ? "Not hint." : `${data.hint} ${errorCode}`;
    if (status && status >= 400 && status < 500) {
      const message = data === void 0 ? `Client error (${status}) without data.` : errorHint;
      const error2 = {
        type: 0,
        status,
        info,
        message,
        payload: data
      };
      return error2;
    }
    if (status && status >= 500 && status < 600) {
      const message = data === void 0 ? `Server error (${status}) without data.` : errorHint;
      const error2 = {
        type: 1,
        status,
        info,
        message,
        payload: data
      };
      return error2;
    }
    return {
      info,
      loading: false,
      type: 4,
      status,
      exception: void 0,
      message: `http status code not handled: ${status}`
    };
  } catch (ex) {
    const error2 = {
      info,
      loading: false,
      status,
      type: 2,
      exception: ex,
      body: dataTxt,
      message: "Could not parse body as json"
    };
    return error2;
  }
}
function validateURL(baseUrl, endpoint) {
  try {
    return new URL(`${baseUrl}${endpoint}`);
  } catch (ex) {
    return void 0;
  }
}
var Context = B({ request: defaultRequestHandler });
async function delayMs(ms) {
  return new Promise((resolve2, reject) => {
    setTimeout(() => resolve2(), ms);
  });
}
function undefinedIfEmpty(obj) {
  if (obj === void 0)
    return void 0;
  return Object.keys(obj).some(
    (k22) => obj[k22] !== void 0
  ) ? obj : void 0;
}
function memoryMap(backend = /* @__PURE__ */ new Map()) {
  const obs = new EventTarget();
  const theMemoryMap = {
    onAnyUpdate: (handler) => {
      obs.addEventListener(`update`, handler);
      obs.addEventListener(`clear`, handler);
      return () => {
        obs.removeEventListener(`update`, handler);
        obs.removeEventListener(`clear`, handler);
      };
    },
    onUpdate: (key, handler) => {
      obs.addEventListener(`update-${key}`, handler);
      obs.addEventListener(`clear`, handler);
      return () => {
        obs.removeEventListener(`update-${key}`, handler);
        obs.removeEventListener(`clear`, handler);
      };
    },
    delete: (key) => {
      const result = backend.delete(key);
      theMemoryMap.size = backend.length;
      obs.dispatchEvent(new Event(`update-${key}`));
      obs.dispatchEvent(new Event(`update`));
      return result;
    },
    set: (key, value) => {
      backend.set(key, value);
      theMemoryMap.size = backend.length;
      obs.dispatchEvent(new Event(`update-${key}`));
      obs.dispatchEvent(new Event(`update`));
      return theMemoryMap;
    },
    clear: () => {
      backend.clear();
      obs.dispatchEvent(new Event(`clear`));
    },
    entries: backend.entries.bind(backend),
    forEach: backend.forEach.bind(backend),
    get: backend.get.bind(backend),
    has: backend.has.bind(backend),
    keys: backend.keys.bind(backend),
    size: backend.size,
    values: backend.values.bind(backend),
    [Symbol.iterator]: backend[Symbol.iterator],
    [Symbol.toStringTag]: "theMemoryMap"
  };
  return theMemoryMap;
}
function localStorageMap() {
  const obs = new EventTarget();
  const theLocalStorageMap = {
    onAnyUpdate: (handler) => {
      obs.addEventListener(`update`, handler);
      obs.addEventListener(`clear`, handler);
      window.addEventListener("storage", handler);
      return () => {
        window.removeEventListener("storage", handler);
        obs.removeEventListener(`update`, handler);
        obs.removeEventListener(`clear`, handler);
      };
    },
    onUpdate: (key, handler) => {
      obs.addEventListener(`update-${key}`, handler);
      obs.addEventListener(`clear`, handler);
      function handleStorageEvent(ev) {
        if (ev.key === null || ev.key === key) {
          handler();
        }
      }
      window.addEventListener("storage", handleStorageEvent);
      return () => {
        window.removeEventListener("storage", handleStorageEvent);
        obs.removeEventListener(`update-${key}`, handler);
        obs.removeEventListener(`clear`, handler);
      };
    },
    delete: (key) => {
      const exists = localStorage.getItem(key) !== null;
      localStorage.removeItem(key);
      theLocalStorageMap.size = localStorage.length;
      obs.dispatchEvent(new Event(`update-${key}`));
      obs.dispatchEvent(new Event(`update`));
      return exists;
    },
    set: (key, v3) => {
      localStorage.setItem(key, v3);
      theLocalStorageMap.size = localStorage.length;
      obs.dispatchEvent(new Event(`update-${key}`));
      obs.dispatchEvent(new Event(`update`));
      return theLocalStorageMap;
    },
    clear: () => {
      localStorage.clear();
      obs.dispatchEvent(new Event(`clear`));
    },
    entries: () => {
      let index2 = 0;
      const total = localStorage.length;
      return {
        next() {
          if (index2 === total)
            return { done: true, value: void 0 };
          const key = localStorage.key(index2);
          if (key === null) {
            throw Error("key cant be null");
          }
          const item = localStorage.getItem(key);
          if (item === null) {
            throw Error("value cant be null");
          }
          index2 = index2 + 1;
          return { done: false, value: [key, item] };
        },
        [Symbol.iterator]() {
          return this;
        }
      };
    },
    forEach: (cb) => {
      for (let index2 = 0; index2 < localStorage.length; index2++) {
        const key = localStorage.key(index2);
        if (key === null) {
          throw Error("key cant be null");
        }
        const item = localStorage.getItem(key);
        if (item === null) {
          throw Error("value cant be null");
        }
        cb(key, item, theLocalStorageMap);
      }
    },
    get: (key) => {
      const item = localStorage.getItem(key);
      if (item === null)
        return void 0;
      return item;
    },
    has: (key) => {
      return localStorage.getItem(key) === null;
    },
    keys: () => {
      let index2 = 0;
      const total = localStorage.length;
      return {
        next() {
          if (index2 === total)
            return { done: true, value: void 0 };
          const key = localStorage.key(index2);
          if (key === null) {
            throw Error("key cant be null");
          }
          index2 = index2 + 1;
          return { done: false, value: key };
        },
        [Symbol.iterator]() {
          return this;
        }
      };
    },
    size: localStorage.length,
    values: () => {
      let index2 = 0;
      const total = localStorage.length;
      return {
        next() {
          if (index2 === total)
            return { done: true, value: void 0 };
          const key = localStorage.key(index2);
          if (key === null) {
            throw Error("key cant be null");
          }
          const item = localStorage.getItem(key);
          if (item === null) {
            throw Error("value cant be null");
          }
          index2 = index2 + 1;
          return { done: false, value: item };
        },
        [Symbol.iterator]() {
          return this;
        }
      };
    },
    [Symbol.iterator]: function() {
      return theLocalStorageMap.entries();
    },
    [Symbol.toStringTag]: "theLocalStorageMap"
  };
  return theLocalStorageMap;
}
var isFirefox = typeof window !== "undefined" && typeof window["InstallTrigger"] !== "undefined";
async function getAllContent() {
  if (isFirefox) {
    return browser.storage.local.get();
  } else {
    return chrome.storage.local.get();
  }
}
async function updateContent(obj) {
  if (isFirefox) {
    return browser.storage.local.set(obj);
  } else {
    return chrome.storage.local.set(obj);
  }
}
function onBrowserStorageUpdate(cb) {
  if (isFirefox) {
    browser.storage.local.onChanged.addListener(cb);
  } else {
    chrome.storage.local.onChanged.addListener(cb);
  }
}
function browserStorageMap(backend) {
  getAllContent().then((content) => {
    Object.entries(content ?? {}).forEach(([k22, v3]) => {
      backend.set(k22, v3);
    });
  });
  backend.onAnyUpdate(async () => {
    const result = {};
    for (const [key, value] of backend.entries()) {
      result[key] = value;
    }
    await updateContent(result);
  });
  onBrowserStorageUpdate((changes) => {
    const changedItems = Object.keys(changes);
    if (changedItems.length === 0) {
      backend.clear();
    } else {
      for (const key of changedItems) {
        if (!changes[key].newValue) {
          backend.delete(key);
        } else {
          if (changes[key].newValue !== changes[key].oldValue) {
            backend.set(key, changes[key].newValue);
          }
        }
      }
    }
  });
  return backend;
}
function buildStorageKey(name, codec) {
  return {
    id: name,
    codec: codec ?? codecForString()
  };
}
var supportLocalStorage = typeof window !== "undefined";
var supportBrowserStorage = typeof chrome !== "undefined" && typeof chrome.storage !== "undefined";
var storage = function buildStorage() {
  if (supportBrowserStorage) {
    if (supportLocalStorage) {
      return browserStorageMap(localStorageMap());
    } else {
      return browserStorageMap(memoryMap());
    }
  } else if (supportLocalStorage) {
    return localStorageMap();
  } else {
    return memoryMap();
  }
}();
function useLocalStorage(key, defaultValue) {
  const current = convert(storage.get(key.id), key, defaultValue);
  const [_3, setStoredValue] = p3(AbsoluteTime.now().t_ms);
  h2(() => {
    return storage.onUpdate(key.id, () => {
      setStoredValue(AbsoluteTime.now().t_ms);
    });
  }, [key.id]);
  const setValue = (value) => {
    if (value === void 0) {
      storage.delete(key.id);
    } else {
      storage.set(
        key.id,
        key.codec ? JSON.stringify(value) : value
      );
    }
  };
  return {
    value: current,
    update: setValue,
    reset: () => {
      setValue(defaultValue);
    }
  };
}
function convert(updated, key, defaultValue) {
  if (updated === void 0)
    return defaultValue;
  try {
    return key.codec.decode(JSON.parse(updated));
  } catch (e22) {
    console.error("Decoding error", e22);
    return defaultValue;
  }
}
var MIN_LANG_COVERAGE_THRESHOLD = 90;
function getBrowserLang(completeness) {
  if (typeof window === "undefined")
    return void 0;
  if (window.navigator.language) {
    if (completeness[window.navigator.language] >= MIN_LANG_COVERAGE_THRESHOLD) {
      return window.navigator.language;
    }
  }
  if (window.navigator.languages) {
    const match52 = Object.entries(completeness).filter(([code, value]) => {
      if (value < MIN_LANG_COVERAGE_THRESHOLD)
        return false;
      return window.navigator.languages.findIndex((l3) => l3.startsWith(code)) !== -1;
    }).map(([code, value]) => ({ code, value }));
    if (match52.length > 0) {
      let max = match52[0];
      match52.forEach((v3) => {
        if (v3.value > max.value) {
          max = v3;
        }
      });
      return max.code;
    }
  }
  ;
  return void 0;
}
var langPreferenceKey = buildStorageKey("lang-preference");
function useLang(initial32, completeness) {
  const defaultValue = (getBrowserLang(completeness) || initial32 || "en").substring(0, 2);
  return useLocalStorage(langPreferenceKey, defaultValue);
}
function useChallengeHandler() {
  const [state, setState] = p3();
  function reset() {
    setState(void 0);
  }
  function onChallengeRequired(challenge, repeat) {
    setState({ challenge, repeat });
  }
  return {
    doCancelChallenge: reset,
    onChallengeRequired,
    pendingChallenge: state?.challenge,
    repeatCall: state?.repeat
  };
}
var storage2 = memoryMap();
var storage3 = memoryMap();
var GLOBAL_NOTIFICATION_TIMEOUT = Duration.fromSpec({
  seconds: 5
});
function translateTalerError(cause, i18n4) {
  switch (cause.errorDetail.code) {
    case TalerErrorCode.GENERIC_TIMEOUT: {
      return i18n4.str`Request timeout`;
    }
    case TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR: {
      return i18n4.str`Request cancelled`;
    }
    case TalerErrorCode.WALLET_HTTP_REQUEST_GENERIC_TIMEOUT: {
      return i18n4.str`Request timeout`;
    }
    case TalerErrorCode.WALLET_HTTP_REQUEST_THROTTLED: {
      return i18n4.str`Request throttled`;
    }
    case TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE: {
      return i18n4.str`Malformed response`;
    }
    case TalerErrorCode.WALLET_NETWORK_ERROR: {
      return i18n4.str`Network error`;
    }
    case TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR: {
      return i18n4.str`Unexpected request error`;
    }
    default: {
      return i18n4.str`Unexpected error`;
    }
  }
}
function useLocalNotificationBetter() {
  const [value, save] = p3();
  const notif = !value ? void 0 : {
    message: value,
    acknowledge: () => {
      save(void 0);
    }
  };
  const { i18n: i18n4 } = useTranslationContext();
  function safeFunctionHandler(doAction, args) {
    function buildSafeHandler(a32, doAction2) {
      const thiz = {
        args: a32,
        withArgs: (...newArgs) => {
          const r3 = buildSafeHandler(newArgs, doAction2);
          r3.onSuccess = thiz.onSuccess;
          r3.onFail = thiz.onFail;
          return r3;
        },
        lambda: (converter, init) => {
          const r3 = buildSafeHandler(
            init ? converter(...init) : void 0,
            doAction2
          );
          r3.withArgs = (...args2) => {
            const d32 = converter(...args2);
            if (!d32)
              return thiz;
            const e22 = thiz.withArgs(...d32);
            return e22;
          };
          r3.onSuccess = thiz.onSuccess;
          r3.onFail = thiz.onFail;
          return r3;
        },
        call: async () => {
          if (!thiz.args)
            return;
          try {
            const resp = await doAction2(...thiz.args);
            switch (resp.type) {
              case "ok": {
                const msg = thiz.onSuccess(resp.body, ...thiz.args);
                if (msg) {
                  save(successWithTitle(msg));
                }
                return;
              }
              case "fail": {
                const error2 = thiz.onFail(resp, ...thiz.args);
                if (error2) {
                  save(failWithTitle(i18n4, resp, error2, thiz.args));
                }
                return;
              }
              default: {
                assertUnreachable(resp);
              }
            }
          } catch (error2) {
            logBugForDevelopers(error2);
            onUnexpected(i18n4, save)(error2, thiz.args);
            return;
          }
        },
        onFail: (fail, ...rest) => i18n4.str`Unhandled failure, please report. Code ${fail.case}`,
        onSuccess: () => void 0
      };
      return thiz;
    }
    return buildSafeHandler(args, doAction);
  }
  return [notif, safeFunctionHandler];
}
function logBugForDevelopers(error2) {
  console.error(
    `Internal error, this is mostly a bug in the application. Please report: `,
    error2
  );
}
function onUnexpected(i18n4, save) {
  return (error2, args) => {
    if (error2 instanceof TalerError) {
      save({
        title: translateTalerError(error2, i18n4),
        type: "error",
        description: error2 && error2.errorDetail.hint ? error2.errorDetail.hint : void 0,
        debug: {
          error: error2,
          stack: error2 instanceof Error ? error2.stack : void 0,
          // args: sanitizeFunctionArguments(args),
          when: AbsoluteTime.now()
        },
        when: AbsoluteTime.now()
      });
    } else {
      const description = error2 instanceof Error ? error2.message : String(error2);
      save({
        title: i18n4.str`Operation failed.`,
        type: "error",
        description: i18n4.str`Unexpected error, this is likely a bug. Please report `,
        debug: {
          error: String(error2),
          stack: error2 instanceof Error ? error2.stack : void 0,
          // args: sanitizeFunctionArguments(args),
          when: AbsoluteTime.now()
        },
        when: AbsoluteTime.now()
      });
    }
  };
}
function successWithTitle(title) {
  return {
    title,
    type: "info",
    when: AbsoluteTime.now()
  };
}
function failWithTitle(i18n4, fail, description, args) {
  return {
    title: i18n4.str`The operation failed.`,
    type: "error",
    description,
    debug: {
      detail: fail.detail,
      case: fail.case,
      when: AbsoluteTime.now()
      // args: sanitizeFunctionArguments(args),
    },
    when: AbsoluteTime.now()
  };
}
var formatDistanceLocale2 = {
  lessThanXSeconds: {
    standalone: {
      one: "weniger als 1 Sekunde",
      other: "weniger als {{count}} Sekunden"
    },
    withPreposition: {
      one: "weniger als 1 Sekunde",
      other: "weniger als {{count}} Sekunden"
    }
  },
  xSeconds: {
    standalone: {
      one: "1 Sekunde",
      other: "{{count}} Sekunden"
    },
    withPreposition: {
      one: "1 Sekunde",
      other: "{{count}} Sekunden"
    }
  },
  halfAMinute: {
    standalone: "halbe Minute",
    withPreposition: "halben Minute"
  },
  lessThanXMinutes: {
    standalone: {
      one: "weniger als 1 Minute",
      other: "weniger als {{count}} Minuten"
    },
    withPreposition: {
      one: "weniger als 1 Minute",
      other: "weniger als {{count}} Minuten"
    }
  },
  xMinutes: {
    standalone: {
      one: "1 Minute",
      other: "{{count}} Minuten"
    },
    withPreposition: {
      one: "1 Minute",
      other: "{{count}} Minuten"
    }
  },
  aboutXHours: {
    standalone: {
      one: "etwa 1 Stunde",
      other: "etwa {{count}} Stunden"
    },
    withPreposition: {
      one: "etwa 1 Stunde",
      other: "etwa {{count}} Stunden"
    }
  },
  xHours: {
    standalone: {
      one: "1 Stunde",
      other: "{{count}} Stunden"
    },
    withPreposition: {
      one: "1 Stunde",
      other: "{{count}} Stunden"
    }
  },
  xDays: {
    standalone: {
      one: "1 Tag",
      other: "{{count}} Tage"
    },
    withPreposition: {
      one: "1 Tag",
      other: "{{count}} Tagen"
    }
  },
  aboutXWeeks: {
    standalone: {
      one: "etwa 1 Woche",
      other: "etwa {{count}} Wochen"
    },
    withPreposition: {
      one: "etwa 1 Woche",
      other: "etwa {{count}} Wochen"
    }
  },
  xWeeks: {
    standalone: {
      one: "1 Woche",
      other: "{{count}} Wochen"
    },
    withPreposition: {
      one: "1 Woche",
      other: "{{count}} Wochen"
    }
  },
  aboutXMonths: {
    standalone: {
      one: "etwa 1 Monat",
      other: "etwa {{count}} Monate"
    },
    withPreposition: {
      one: "etwa 1 Monat",
      other: "etwa {{count}} Monaten"
    }
  },
  xMonths: {
    standalone: {
      one: "1 Monat",
      other: "{{count}} Monate"
    },
    withPreposition: {
      one: "1 Monat",
      other: "{{count}} Monaten"
    }
  },
  aboutXYears: {
    standalone: {
      one: "etwa 1 Jahr",
      other: "etwa {{count}} Jahre"
    },
    withPreposition: {
      one: "etwa 1 Jahr",
      other: "etwa {{count}} Jahren"
    }
  },
  xYears: {
    standalone: {
      one: "1 Jahr",
      other: "{{count}} Jahre"
    },
    withPreposition: {
      one: "1 Jahr",
      other: "{{count}} Jahren"
    }
  },
  overXYears: {
    standalone: {
      one: "mehr als 1 Jahr",
      other: "mehr als {{count}} Jahre"
    },
    withPreposition: {
      one: "mehr als 1 Jahr",
      other: "mehr als {{count}} Jahren"
    }
  },
  almostXYears: {
    standalone: {
      one: "fast 1 Jahr",
      other: "fast {{count}} Jahre"
    },
    withPreposition: {
      one: "fast 1 Jahr",
      other: "fast {{count}} Jahren"
    }
  }
};
var formatDistance3 = function formatDistance4(token, count, options) {
  var result;
  var tokenValue = options !== null && options !== void 0 && options.addSuffix ? formatDistanceLocale2[token].withPreposition : formatDistanceLocale2[token].standalone;
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", String(count));
  }
  if (options !== null && options !== void 0 && options.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "in " + result;
    } else {
      return "vor " + result;
    }
  }
  return result;
};
var formatDistance_default2 = formatDistance3;
var dateFormats2 = {
  full: "EEEE, do MMMM y",
  // Montag, 7. Januar 2018
  long: "do MMMM y",
  // 7. Januar 2018
  medium: "do MMM y",
  // 7. Jan. 2018
  short: "dd.MM.y"
  // 07.01.2018
};
var timeFormats2 = {
  full: "HH:mm:ss zzzz",
  long: "HH:mm:ss z",
  medium: "HH:mm:ss",
  short: "HH:mm"
};
var dateTimeFormats2 = {
  full: "{{date}} 'um' {{time}}",
  long: "{{date}} 'um' {{time}}",
  medium: "{{date}} {{time}}",
  short: "{{date}} {{time}}"
};
var formatLong2 = {
  date: buildFormatLongFn({
    formats: dateFormats2,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats2,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats2,
    defaultWidth: "full"
  })
};
var formatLong_default2 = formatLong2;
var formatRelativeLocale2 = {
  lastWeek: "'letzten' eeee 'um' p",
  yesterday: "'gestern um' p",
  today: "'heute um' p",
  tomorrow: "'morgen um' p",
  nextWeek: "eeee 'um' p",
  other: "P"
};
var formatRelative3 = function formatRelative4(token, _date, _baseDate, _options) {
  return formatRelativeLocale2[token];
};
var formatRelative_default2 = formatRelative3;
var eraValues2 = {
  narrow: ["v.Chr.", "n.Chr."],
  abbreviated: ["v.Chr.", "n.Chr."],
  wide: ["vor Christus", "nach Christus"]
};
var quarterValues2 = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"]
};
var monthValues2 = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "M\xE4r", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
  wide: ["Januar", "Februar", "M\xE4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
};
var formattingMonthValues = {
  narrow: monthValues2.narrow,
  abbreviated: ["Jan.", "Feb.", "M\xE4rz", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."],
  wide: monthValues2.wide
};
var dayValues2 = {
  narrow: ["S", "M", "D", "M", "D", "F", "S"],
  short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
  abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
  wide: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
};
var dayPeriodValues2 = {
  narrow: {
    am: "vm.",
    pm: "nm.",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "Morgen",
    afternoon: "Nachm.",
    evening: "Abend",
    night: "Nacht"
  },
  abbreviated: {
    am: "vorm.",
    pm: "nachm.",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "Morgen",
    afternoon: "Nachmittag",
    evening: "Abend",
    night: "Nacht"
  },
  wide: {
    am: "vormittags",
    pm: "nachmittags",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "Morgen",
    afternoon: "Nachmittag",
    evening: "Abend",
    night: "Nacht"
  }
};
var formattingDayPeriodValues2 = {
  narrow: {
    am: "vm.",
    pm: "nm.",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "morgens",
    afternoon: "nachm.",
    evening: "abends",
    night: "nachts"
  },
  abbreviated: {
    am: "vorm.",
    pm: "nachm.",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "morgens",
    afternoon: "nachmittags",
    evening: "abends",
    night: "nachts"
  },
  wide: {
    am: "vormittags",
    pm: "nachmittags",
    midnight: "Mitternacht",
    noon: "Mittag",
    morning: "morgens",
    afternoon: "nachmittags",
    evening: "abends",
    night: "nachts"
  }
};
var ordinalNumber3 = function ordinalNumber4(dirtyNumber) {
  var number = Number(dirtyNumber);
  return number + ".";
};
var localize2 = {
  ordinalNumber: ordinalNumber3,
  era: buildLocalizeFn({
    values: eraValues2,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues2,
    defaultWidth: "wide",
    argumentCallback: function argumentCallback2(quarter) {
      return quarter - 1;
    }
  }),
  month: buildLocalizeFn({
    values: monthValues2,
    formattingValues: formattingMonthValues,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues2,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues2,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues2,
    defaultFormattingWidth: "wide"
  })
};
var localize_default2 = localize2;
var matchOrdinalNumberPattern2 = /^(\d+)(\.)?/i;
var parseOrdinalNumberPattern2 = /\d+/i;
var matchEraPatterns2 = {
  narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
  abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
  wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
};
var parseEraPatterns2 = {
  any: [/^v/i, /^n/i]
};
var matchQuarterPatterns2 = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](\.)? Quartal/i
};
var parseQuarterPatterns2 = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns2 = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
  wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
};
var parseMonthPatterns2 = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^j[aä]/i, /^f/i, /^mär/i, /^ap/i, /^mai/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
var matchDayPatterns2 = {
  narrow: /^[smdmf]/i,
  short: /^(so|mo|di|mi|do|fr|sa)/i,
  abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
  wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
};
var parseDayPatterns2 = {
  any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns2 = {
  narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
  abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
  wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
};
var parseDayPeriodPatterns2 = {
  any: {
    am: /^v/i,
    pm: /^n/i,
    midnight: /^Mitte/i,
    noon: /^Mitta/i,
    morning: /morgens/i,
    afternoon: /nachmittags/i,
    // will never be matched. Afternoon is matched by `pm`
    evening: /abends/i,
    night: /nachts/i
    // will never be matched. Night is matched by `pm`
  }
};
var match2 = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern2,
    parsePattern: parseOrdinalNumberPattern2,
    valueCallback: function valueCallback3(value) {
      return parseInt(value);
    }
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns2,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns2,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns2,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns2,
    defaultParseWidth: "any",
    valueCallback: function valueCallback4(index2) {
      return index2 + 1;
    }
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns2,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns2,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns2,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns2,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns2,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPeriodPatterns2,
    defaultParseWidth: "any"
  })
};
var match_default2 = match2;
var locale2 = {
  code: "de",
  formatDistance: formatDistance_default2,
  formatLong: formatLong_default2,
  formatRelative: formatRelative_default2,
  localize: localize_default2,
  match: match_default2,
  options: {
    weekStartsOn: 1,
    firstWeekContainsDate: 4
  }
};
var de_default = locale2;
var dateFormats3 = {
  full: "EEEE, d MMMM yyyy",
  long: "d MMMM yyyy",
  medium: "d MMM yyyy",
  short: "dd/MM/yyyy"
};
var timeFormats3 = {
  full: "HH:mm:ss zzzz",
  long: "HH:mm:ss z",
  medium: "HH:mm:ss",
  short: "HH:mm"
};
var dateTimeFormats3 = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong3 = {
  date: buildFormatLongFn({
    formats: dateFormats3,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats3,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats3,
    defaultWidth: "full"
  })
};
var formatLong_default3 = formatLong3;
var locale3 = {
  code: "en-GB",
  formatDistance: formatDistance_default,
  formatLong: formatLong_default3,
  formatRelative: formatRelative_default,
  localize: localize_default,
  match: match_default,
  options: {
    weekStartsOn: 1,
    firstWeekContainsDate: 4
  }
};
var en_GB_default = locale3;
var formatDistanceLocale3 = {
  lessThanXSeconds: {
    one: "menos de un segundo",
    other: "menos de {{count}} segundos"
  },
  xSeconds: {
    one: "1 segundo",
    other: "{{count}} segundos"
  },
  halfAMinute: "medio minuto",
  lessThanXMinutes: {
    one: "menos de un minuto",
    other: "menos de {{count}} minutos"
  },
  xMinutes: {
    one: "1 minuto",
    other: "{{count}} minutos"
  },
  aboutXHours: {
    one: "alrededor de 1 hora",
    other: "alrededor de {{count}} horas"
  },
  xHours: {
    one: "1 hora",
    other: "{{count}} horas"
  },
  xDays: {
    one: "1 d\xEDa",
    other: "{{count}} d\xEDas"
  },
  aboutXWeeks: {
    one: "alrededor de 1 semana",
    other: "alrededor de {{count}} semanas"
  },
  xWeeks: {
    one: "1 semana",
    other: "{{count}} semanas"
  },
  aboutXMonths: {
    one: "alrededor de 1 mes",
    other: "alrededor de {{count}} meses"
  },
  xMonths: {
    one: "1 mes",
    other: "{{count}} meses"
  },
  aboutXYears: {
    one: "alrededor de 1 a\xF1o",
    other: "alrededor de {{count}} a\xF1os"
  },
  xYears: {
    one: "1 a\xF1o",
    other: "{{count}} a\xF1os"
  },
  overXYears: {
    one: "m\xE1s de 1 a\xF1o",
    other: "m\xE1s de {{count}} a\xF1os"
  },
  almostXYears: {
    one: "casi 1 a\xF1o",
    other: "casi {{count}} a\xF1os"
  }
};
var formatDistance5 = function formatDistance6(token, count, options) {
  var result;
  var tokenValue = formatDistanceLocale3[token];
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", count.toString());
  }
  if (options !== null && options !== void 0 && options.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "en " + result;
    } else {
      return "hace " + result;
    }
  }
  return result;
};
var formatDistance_default3 = formatDistance5;
var dateFormats4 = {
  full: "EEEE, d 'de' MMMM 'de' y",
  long: "d 'de' MMMM 'de' y",
  medium: "d MMM y",
  short: "dd/MM/y"
};
var timeFormats4 = {
  full: "HH:mm:ss zzzz",
  long: "HH:mm:ss z",
  medium: "HH:mm:ss",
  short: "HH:mm"
};
var dateTimeFormats4 = {
  full: "{{date}} 'a las' {{time}}",
  long: "{{date}} 'a las' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong4 = {
  date: buildFormatLongFn({
    formats: dateFormats4,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats4,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats4,
    defaultWidth: "full"
  })
};
var formatLong_default4 = formatLong4;
var formatRelativeLocale3 = {
  lastWeek: "'el' eeee 'pasado a la' p",
  yesterday: "'ayer a la' p",
  today: "'hoy a la' p",
  tomorrow: "'ma\xF1ana a la' p",
  nextWeek: "eeee 'a la' p",
  other: "P"
};
var formatRelativeLocalePlural = {
  lastWeek: "'el' eeee 'pasado a las' p",
  yesterday: "'ayer a las' p",
  today: "'hoy a las' p",
  tomorrow: "'ma\xF1ana a las' p",
  nextWeek: "eeee 'a las' p",
  other: "P"
};
var formatRelative5 = function formatRelative6(token, date, _baseDate, _options) {
  if (date.getUTCHours() !== 1) {
    return formatRelativeLocalePlural[token];
  } else {
    return formatRelativeLocale3[token];
  }
};
var formatRelative_default3 = formatRelative5;
var eraValues3 = {
  narrow: ["AC", "DC"],
  abbreviated: ["AC", "DC"],
  wide: ["antes de cristo", "despu\xE9s de cristo"]
};
var quarterValues3 = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["T1", "T2", "T3", "T4"],
  wide: ["1\xBA trimestre", "2\xBA trimestre", "3\xBA trimestre", "4\xBA trimestre"]
};
var monthValues3 = {
  narrow: ["e", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
  abbreviated: ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"],
  wide: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"]
};
var dayValues3 = {
  narrow: ["d", "l", "m", "m", "j", "v", "s"],
  short: ["do", "lu", "ma", "mi", "ju", "vi", "s\xE1"],
  abbreviated: ["dom", "lun", "mar", "mi\xE9", "jue", "vie", "s\xE1b"],
  wide: ["domingo", "lunes", "martes", "mi\xE9rcoles", "jueves", "viernes", "s\xE1bado"]
};
var dayPeriodValues3 = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mn",
    noon: "md",
    morning: "ma\xF1ana",
    afternoon: "tarde",
    evening: "tarde",
    night: "noche"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "medianoche",
    noon: "mediodia",
    morning: "ma\xF1ana",
    afternoon: "tarde",
    evening: "tarde",
    night: "noche"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "medianoche",
    noon: "mediodia",
    morning: "ma\xF1ana",
    afternoon: "tarde",
    evening: "tarde",
    night: "noche"
  }
};
var formattingDayPeriodValues3 = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mn",
    noon: "md",
    morning: "de la ma\xF1ana",
    afternoon: "de la tarde",
    evening: "de la tarde",
    night: "de la noche"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "medianoche",
    noon: "mediodia",
    morning: "de la ma\xF1ana",
    afternoon: "de la tarde",
    evening: "de la tarde",
    night: "de la noche"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "medianoche",
    noon: "mediodia",
    morning: "de la ma\xF1ana",
    afternoon: "de la tarde",
    evening: "de la tarde",
    night: "de la noche"
  }
};
var ordinalNumber5 = function ordinalNumber6(dirtyNumber, _options) {
  var number = Number(dirtyNumber);
  return number + "\xBA";
};
var localize3 = {
  ordinalNumber: ordinalNumber5,
  era: buildLocalizeFn({
    values: eraValues3,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues3,
    defaultWidth: "wide",
    argumentCallback: function argumentCallback3(quarter) {
      return Number(quarter) - 1;
    }
  }),
  month: buildLocalizeFn({
    values: monthValues3,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues3,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues3,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues3,
    defaultFormattingWidth: "wide"
  })
};
var localize_default3 = localize3;
var matchOrdinalNumberPattern3 = /^(\d+)(º)?/i;
var parseOrdinalNumberPattern3 = /\d+/i;
var matchEraPatterns3 = {
  narrow: /^(ac|dc|a|d)/i,
  abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
  wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
};
var parseEraPatterns3 = {
  any: [/^ac/i, /^dc/i],
  wide: [/^(antes de cristo|antes de la era com[uú]n)/i, /^(despu[eé]s de cristo|era com[uú]n)/i]
};
var matchQuarterPatterns3 = {
  narrow: /^[1234]/i,
  abbreviated: /^T[1234]/i,
  wide: /^[1234](º)? trimestre/i
};
var parseQuarterPatterns3 = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns3 = {
  narrow: /^[efmajsond]/i,
  abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
  wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
};
var parseMonthPatterns3 = {
  narrow: [/^e/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^en/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]
};
var matchDayPatterns3 = {
  narrow: /^[dlmjvs]/i,
  short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
  abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
  wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
};
var parseDayPatterns3 = {
  narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
  any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
};
var matchDayPeriodPatterns3 = {
  narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
  any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
};
var parseDayPeriodPatterns3 = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mn/i,
    noon: /^md/i,
    morning: /mañana/i,
    afternoon: /tarde/i,
    evening: /tarde/i,
    night: /noche/i
  }
};
var match3 = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern3,
    parsePattern: parseOrdinalNumberPattern3,
    valueCallback: function valueCallback5(value) {
      return parseInt(value, 10);
    }
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns3,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns3,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns3,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns3,
    defaultParseWidth: "any",
    valueCallback: function valueCallback6(index2) {
      return index2 + 1;
    }
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns3,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns3,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns3,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns3,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns3,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns3,
    defaultParseWidth: "any"
  })
};
var match_default3 = match3;
var locale4 = {
  code: "es",
  formatDistance: formatDistance_default3,
  formatLong: formatLong_default4,
  formatRelative: formatRelative_default3,
  localize: localize_default3,
  match: match_default3,
  options: {
    weekStartsOn: 1,
    firstWeekContainsDate: 1
  }
};
var es_default = locale4;
var formatDistanceLocale4 = {
  lessThanXSeconds: {
    one: "moins d\u2019une seconde",
    other: "moins de {{count}} secondes"
  },
  xSeconds: {
    one: "1 seconde",
    other: "{{count}} secondes"
  },
  halfAMinute: "30 secondes",
  lessThanXMinutes: {
    one: "moins d\u2019une minute",
    other: "moins de {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "environ 1 heure",
    other: "environ {{count}} heures"
  },
  xHours: {
    one: "1 heure",
    other: "{{count}} heures"
  },
  xDays: {
    one: "1 jour",
    other: "{{count}} jours"
  },
  aboutXWeeks: {
    one: "environ 1 semaine",
    other: "environ {{count}} semaines"
  },
  xWeeks: {
    one: "1 semaine",
    other: "{{count}} semaines"
  },
  aboutXMonths: {
    one: "environ 1 mois",
    other: "environ {{count}} mois"
  },
  xMonths: {
    one: "1 mois",
    other: "{{count}} mois"
  },
  aboutXYears: {
    one: "environ 1 an",
    other: "environ {{count}} ans"
  },
  xYears: {
    one: "1 an",
    other: "{{count}} ans"
  },
  overXYears: {
    one: "plus d\u2019un an",
    other: "plus de {{count}} ans"
  },
  almostXYears: {
    one: "presqu\u2019un an",
    other: "presque {{count}} ans"
  }
};
var formatDistance7 = function formatDistance8(token, count, options) {
  var result;
  var form = formatDistanceLocale4[token];
  if (typeof form === "string") {
    result = form;
  } else if (count === 1) {
    result = form.one;
  } else {
    result = form.other.replace("{{count}}", String(count));
  }
  if (options !== null && options !== void 0 && options.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "dans " + result;
    } else {
      return "il y a " + result;
    }
  }
  return result;
};
var formatDistance_default4 = formatDistance7;
var dateFormats5 = {
  full: "EEEE d MMMM y",
  long: "d MMMM y",
  medium: "d MMM y",
  short: "dd/MM/y"
};
var timeFormats5 = {
  full: "HH:mm:ss zzzz",
  long: "HH:mm:ss z",
  medium: "HH:mm:ss",
  short: "HH:mm"
};
var dateTimeFormats5 = {
  full: "{{date}} '\xE0' {{time}}",
  long: "{{date}} '\xE0' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong5 = {
  date: buildFormatLongFn({
    formats: dateFormats5,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats5,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats5,
    defaultWidth: "full"
  })
};
var formatLong_default5 = formatLong5;
var formatRelativeLocale4 = {
  lastWeek: "eeee 'dernier \xE0' p",
  yesterday: "'hier \xE0' p",
  today: "'aujourd\u2019hui \xE0' p",
  tomorrow: "'demain \xE0' p'",
  nextWeek: "eeee 'prochain \xE0' p",
  other: "P"
};
var formatRelative7 = function formatRelative8(token, _date, _baseDate, _options) {
  return formatRelativeLocale4[token];
};
var formatRelative_default4 = formatRelative7;
var eraValues4 = {
  narrow: ["av. J.-C", "ap. J.-C"],
  abbreviated: ["av. J.-C", "ap. J.-C"],
  wide: ["avant J\xE9sus-Christ", "apr\xE8s J\xE9sus-Christ"]
};
var quarterValues4 = {
  narrow: ["T1", "T2", "T3", "T4"],
  abbreviated: ["1er trim.", "2\xE8me trim.", "3\xE8me trim.", "4\xE8me trim."],
  wide: ["1er trimestre", "2\xE8me trimestre", "3\xE8me trimestre", "4\xE8me trimestre"]
};
var monthValues4 = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["janv.", "f\xE9vr.", "mars", "avr.", "mai", "juin", "juil.", "ao\xFBt", "sept.", "oct.", "nov.", "d\xE9c."],
  wide: ["janvier", "f\xE9vrier", "mars", "avril", "mai", "juin", "juillet", "ao\xFBt", "septembre", "octobre", "novembre", "d\xE9cembre"]
};
var dayValues4 = {
  narrow: ["D", "L", "M", "M", "J", "V", "S"],
  short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
  abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
  wide: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
};
var dayPeriodValues4 = {
  narrow: {
    am: "AM",
    pm: "PM",
    midnight: "minuit",
    noon: "midi",
    morning: "mat.",
    afternoon: "ap.m.",
    evening: "soir",
    night: "mat."
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "minuit",
    noon: "midi",
    morning: "matin",
    afternoon: "apr\xE8s-midi",
    evening: "soir",
    night: "matin"
  },
  wide: {
    am: "AM",
    pm: "PM",
    midnight: "minuit",
    noon: "midi",
    morning: "du matin",
    afternoon: "de l\u2019apr\xE8s-midi",
    evening: "du soir",
    night: "du matin"
  }
};
var ordinalNumber7 = function ordinalNumber8(dirtyNumber, options) {
  var number = Number(dirtyNumber);
  var unit = options === null || options === void 0 ? void 0 : options.unit;
  if (number === 0)
    return "0";
  var feminineUnits = ["year", "week", "hour", "minute", "second"];
  var suffix;
  if (number === 1) {
    suffix = unit && feminineUnits.includes(unit) ? "\xE8re" : "er";
  } else {
    suffix = "\xE8me";
  }
  return number + suffix;
};
var localize4 = {
  ordinalNumber: ordinalNumber7,
  era: buildLocalizeFn({
    values: eraValues4,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues4,
    defaultWidth: "wide",
    argumentCallback: function argumentCallback4(quarter) {
      return quarter - 1;
    }
  }),
  month: buildLocalizeFn({
    values: monthValues4,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues4,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues4,
    defaultWidth: "wide"
  })
};
var localize_default4 = localize4;
var matchOrdinalNumberPattern4 = /^(\d+)(ième|ère|ème|er|e)?/i;
var parseOrdinalNumberPattern4 = /\d+/i;
var matchEraPatterns4 = {
  narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
  abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
  wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
};
var parseEraPatterns4 = {
  any: [/^av/i, /^ap/i]
};
var matchQuarterPatterns4 = {
  narrow: /^T?[1234]/i,
  abbreviated: /^[1234](er|ème|e)? trim\.?/i,
  wide: /^[1234](er|ème|e)? trimestre/i
};
var parseQuarterPatterns4 = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns4 = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
  wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
};
var parseMonthPatterns4 = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^av/i, /^ma/i, /^juin/i, /^juil/i, /^ao/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
var matchDayPatterns4 = {
  narrow: /^[lmjvsd]/i,
  short: /^(di|lu|ma|me|je|ve|sa)/i,
  abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
  wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
};
var parseDayPatterns4 = {
  narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
  any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
};
var matchDayPeriodPatterns4 = {
  narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
  any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
};
var parseDayPeriodPatterns4 = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^min/i,
    noon: /^mid/i,
    morning: /mat/i,
    afternoon: /ap/i,
    evening: /soir/i,
    night: /nuit/i
  }
};
var match4 = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern4,
    parsePattern: parseOrdinalNumberPattern4,
    valueCallback: function valueCallback7(value) {
      return parseInt(value);
    }
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns4,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns4,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns4,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns4,
    defaultParseWidth: "any",
    valueCallback: function valueCallback8(index2) {
      return index2 + 1;
    }
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns4,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns4,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns4,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns4,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns4,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns4,
    defaultParseWidth: "any"
  })
};
var match_default4 = match4;
var locale5 = {
  code: "fr",
  formatDistance: formatDistance_default4,
  formatLong: formatLong_default5,
  formatRelative: formatRelative_default4,
  localize: localize_default4,
  match: match_default4,
  options: {
    weekStartsOn: 1,
    firstWeekContainsDate: 4
  }
};
var fr_default = locale5;
var supportedLang = {
  es: "Espanol [es]",
  en: "English [en]",
  fr: "Francais [fr]",
  de: "Deutsch [de]",
  sv: "Svenska [sv]",
  it: "Italiane [it]"
};
var initial = {
  lang: "en",
  supportedLang,
  changeLanguage: () => {
  },
  i18n,
  dateLocale: en_GB_default,
  completeness: {
    de: 0,
    en: 0,
    es: 0,
    fr: 0,
    it: 0,
    sv: 0
  }
};
var Context2 = B(initial);
var TranslationProvider = ({
  initial: initial32,
  children,
  forceLang__testing: forceLang,
  source,
  completeness: completenessProp
}) => {
  const completeness = {
    en: 100,
    de: !completenessProp || !completenessProp["de"] ? 0 : completenessProp["de"],
    es: !completenessProp || !completenessProp["es"] ? 0 : completenessProp["es"],
    fr: !completenessProp || !completenessProp["fr"] ? 0 : completenessProp["fr"],
    it: !completenessProp || !completenessProp["it"] ? 0 : completenessProp["it"],
    sv: !completenessProp || !completenessProp["sv"] ? 0 : completenessProp["sv"]
  };
  const { value: lang, update: changeLanguage } = useLang(
    initial32,
    completeness
  );
  h2(() => {
    if (forceLang) {
      changeLanguage(forceLang);
    }
  }, [forceLang]);
  h2(() => {
    setupI18n(lang, source);
  }, [lang]);
  if (forceLang) {
    setupI18n(forceLang, source);
  } else {
    setupI18n(lang, source);
  }
  const dateLocale = lang === "es" ? es_default : lang === "fr" ? fr_default : lang === "de" ? de_default : en_GB_default;
  return h(Context2.Provider, {
    value: {
      lang,
      changeLanguage,
      supportedLang,
      i18n,
      dateLocale,
      completeness
    },
    children
  });
};
var useTranslationContext = () => q2(Context2);
var ActiviyTracker = class {
  constructor() {
    this.observers = new Array();
    this.notify = this.notify.bind(this);
    this.subscribe = this.subscribe.bind(this);
  }
  notify(data) {
    this.observers.forEach((observer) => observer(data));
  }
  subscribe(func) {
    this.observers.push(func);
    return () => {
      this.observers.forEach((observer, index2) => {
        if (observer === func) {
          this.observers.splice(index2, 1);
        }
      });
    };
  }
};
var BankContext = B(void 0);
var ChallengerContext = B(void 0);
var MerchantContext = B(void 0);
var useMerchantApiContext = () => q2(MerchantContext);
var CONFIG_FAIL_TRY_AGAIN_MS3 = 5e3;
var MerchantApiProvider = ({
  baseUrl,
  children,
  evictors = {},
  frameOnError
}) => {
  const [checked, setChecked] = p3();
  const [merchantEndpoint, changeMerchantEndpoint] = p3(baseUrl);
  const { getRemoteConfig, VERSION: VERSION3, lib, cancelRequest, onActivity } = buildMerchantApiClient(merchantEndpoint, evictors);
  h2(() => {
    let keepRetrying = true;
    async function testConfig() {
      try {
        const config = await getRemoteConfig();
        if (LibtoolVersion.compare(VERSION3, config.version)) {
          setChecked({ type: "ok", config, hints: [] });
        } else {
          setChecked({
            type: "incompatible",
            result: config,
            supported: VERSION3
          });
        }
      } catch (error2) {
        if (error2 instanceof TalerError) {
          if (keepRetrying) {
            setTimeout(() => {
              testConfig();
            }, CONFIG_FAIL_TRY_AGAIN_MS3);
          }
          setChecked({ type: "error", error: error2 });
        } else {
          setChecked({ type: "error", error: TalerError.fromException(error2) });
        }
      }
    }
    testConfig();
    return () => {
      keepRetrying = false;
    };
  }, []);
  if (!checked || checked.type !== "ok") {
    return h(frameOnError, { state: checked }, []);
  }
  const value = {
    url: merchantEndpoint,
    config: checked.config,
    onActivity,
    lib,
    cancelRequest,
    changeBackend: changeMerchantEndpoint,
    hints: checked.hints
  };
  return h(MerchantContext.Provider, {
    value,
    children
  });
};
function buildMerchantApiClient(url, evictors) {
  const httpFetch = new BrowserFetchHttpLib({
    enableThrottling: true,
    requireTls: false
  });
  const tracker = new ActiviyTracker();
  const httpLib = new ObservableHttpClientLibrary(httpFetch, {
    observe(ev) {
      tracker.notify(ev);
    }
  });
  const instance = new TalerMerchantManagementHttpClient(
    url.href,
    httpLib,
    evictors.management
  );
  function getSubInstanceAPI(instanceId) {
    const api = buildMerchantApiClient(
      new URL(instance.getSubInstanceAPI(instanceId)),
      evictors
    );
    return api.lib;
  }
  async function getRemoteConfig() {
    const resp = await instance.getConfig();
    if (resp.type === "fail") {
      if (resp.detail) {
        throw TalerError.fromUncheckedDetail(resp.detail);
      } else {
        throw TalerError.fromException(new Error("failed to get merchant remote config"));
      }
    }
    return resp.body;
  }
  return {
    getRemoteConfig,
    VERSION: TalerMerchantManagementHttpClient.PROTOCOL_VERSION,
    lib: {
      instance,
      subInstanceApi: getSubInstanceAPI
    },
    onActivity: tracker.subscribe,
    cancelRequest: httpLib.cancelRequest
  };
}
var ExchangeContext = B(void 0);
function urlPattern(pattern, reverse) {
  const url = reverse;
  return {
    pattern: new RegExp(pattern),
    url
  };
}
var nullRountDef = {
  pattern: new RegExp(/.*/),
  url: () => ""
};
var Context3 = B(void 0);
var useNavigationContext = () => q2(Context3);
function getPathAndParamsFromWindow() {
  const path = typeof window !== "undefined" ? window.location.hash.substring(1) : "/";
  const params = {};
  if (typeof window !== "undefined") {
    for (const [key, value] of new URLSearchParams(window.location.search)) {
      if (!params[key]) {
        params[key] = [];
      }
      params[key].push(value);
    }
  }
  return { path, params };
}
var { path: initialPath, params: initialParams } = getPathAndParamsFromWindow();
var PopStateEventType = "popstate";
var BrowserHashNavigationProvider = ({
  children
}) => {
  const [{ path, params }, setState] = p3({
    path: initialPath,
    params: initialParams
  });
  if (typeof window === "undefined") {
    throw Error(
      "Can't use BrowserHashNavigationProvider if there is no window object"
    );
  }
  function navigateTo(path2) {
    const { params: params2 } = getPathAndParamsFromWindow();
    setState({ path: path2, params: params2 });
    window.location.href = path2;
  }
  h2(() => {
    function eventListener() {
      setState(getPathAndParamsFromWindow());
    }
    window.addEventListener(PopStateEventType, eventListener);
    return () => {
      window.removeEventListener(PopStateEventType, eventListener);
    };
  }, []);
  return h(Context3.Provider, {
    value: { path, params, navigateTo },
    children
  });
};
var codecForPreferences = () => buildCodecForObject().allowExtra().property("showDebugInfo", codecForBoolean()).build("CommonPreferences");
var COMMON_PREFERENCES_KEY = buildStorageKey(
  "common-preferences",
  codecForPreferences()
);
var initial2 = {
  showDebugInfo: true,
  toggleShowDebugInfo() {
  }
};
function useCommonPreferences() {
  const { value, update } = useLocalStorage(COMMON_PREFERENCES_KEY, initial2);
  function updateField(k22, v3) {
    const newValue = { ...value, [k22]: v3 };
    update(newValue);
  }
  return [value, updateField];
}
function createHeadMetaTag(uri, onNotFound) {
  const meta = document.createElement("meta");
  meta.setAttribute("name", "taler-uri");
  meta.setAttribute("content", stringifyTalerUri(uri));
  document.head.appendChild(meta);
  let walletFound = false;
  window.addEventListener("beforeunload", () => {
    walletFound = true;
  });
  setTimeout(() => {
    if (!walletFound && onNotFound) {
      onNotFound();
    }
  }, 10);
}
var Context4 = B(void 0);
var TalerWalletIntegrationBrowserProvider = ({
  children
}) => {
  const value = {
    publishTalerAction: createHeadMetaTag
  };
  return h(Context4.Provider, {
    value,
    children
  });
};
var THIS_MONTH = getMonth(/* @__PURE__ */ new Date());
var THIS_YEAR = getYear(/* @__PURE__ */ new Date());
var TODAY = startOfDay(/* @__PURE__ */ new Date());
var logger12 = new Logger("browserHttpLib");
async function compress(alg, buf) {
  if (!alg)
    return buf;
  const cs = new CompressionStream(alg);
  const writer = cs.writable.getWriter();
  writer.write(buf);
  writer.close();
  return new Response(cs.readable).arrayBuffer();
}
var BrowserFetchHttpLib = class {
  constructor(args) {
    this.throttle = new RequestThrottler();
    this.throttlingEnabled = true;
    this.requireTls = false;
    this.throttlingEnabled = args?.enableThrottling ?? true;
    this.requireTls = args?.requireTls ?? false;
  }
  async fetch(requestUrl, options) {
    const requestMethod = options?.method ?? "GET";
    const requestBody = options?.body;
    const requestHeader = options?.headers;
    const requestTimeout = options?.timeout ?? Duration.fromMilliseconds(DEFAULT_REQUEST_TIMEOUT_MS);
    const requestCancel = options?.cancellationToken;
    const requestRedirect = options?.redirect;
    const parsedUrl = new URL(requestUrl);
    if (this.throttlingEnabled && this.throttle.applyThrottle(requestUrl)) {
      throw TalerError.fromDetail(
        TalerErrorCode.WALLET_HTTP_REQUEST_THROTTLED,
        {
          requestMethod,
          requestUrl,
          throttleStats: this.throttle.getThrottleStats(requestUrl)
        },
        `request to origin ${parsedUrl.origin} was throttled`
      );
    }
    if (this.requireTls && parsedUrl.protocol !== "https:") {
      throw TalerError.fromDetail(
        TalerErrorCode.WALLET_NETWORK_ERROR,
        {
          requestMethod,
          requestUrl
        },
        `request to ${parsedUrl.origin} is not possible with protocol ${parsedUrl.protocol}`
      );
    }
    const encodedBody = requestMethod === "POST" || requestMethod === "PUT" || requestMethod === "PATCH" ? encodeBody(requestBody) : void 0;
    const myBody = !options?.compress || !encodedBody ? encodedBody : await compress(options.compress, encodedBody);
    const requestHeadersMap = getDefaultHeaders(requestMethod);
    if (requestHeader) {
      Object.entries(requestHeader).forEach(([key, value]) => {
        if (value === void 0)
          return;
        requestHeadersMap[key] = value;
      });
    }
    if (options?.compress) {
      requestHeadersMap["Content-Encoding"] = options.compress;
    }
    if (requestBody instanceof FormData) {
      delete requestHeadersMap["Content-Type"];
    } else if (requestBody instanceof URLSearchParams) {
      requestHeadersMap["Content-Type"] = "application/x-www-form-urlencoded";
    }
    const controller = new AbortController();
    let timeoutId;
    if (requestTimeout.d_ms !== "forever") {
      timeoutId = setTimeout(() => {
        controller.abort(TalerErrorCode.GENERIC_TIMEOUT);
      }, requestTimeout.d_ms);
    }
    if (requestCancel) {
      requestCancel.onCancelled(() => {
        controller.abort(TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR);
      });
    }
    try {
      const response = await fetch(requestUrl, {
        headers: requestHeadersMap,
        body: myBody,
        method: requestMethod,
        signal: controller.signal,
        redirect: requestRedirect
      });
      if (timeoutId) {
        clearTimeout(timeoutId);
      }
      const headerMap = new HeadersImpl();
      response.headers.forEach((value, key) => {
        headerMap.set(key, value);
      });
      const text = makeTextHandler(response, requestUrl, requestMethod);
      const json = makeJsonHandler(response, requestUrl, requestMethod, text);
      return {
        headers: headerMap,
        status: response.status,
        requestMethod,
        requestUrl,
        json,
        text,
        bytes: async () => (await response.blob()).arrayBuffer()
      };
    } catch (e22) {
      if (controller.signal) {
        throw TalerError.fromDetail(
          controller.signal.reason,
          {
            requestUrl,
            requestMethod,
            timeoutMs: requestTimeout.d_ms === "forever" ? 0 : requestTimeout.d_ms
          },
          `HTTP request failed.`
        );
      }
      throw e22;
    }
  }
};
function makeTextHandler(response, requestUrl, requestMethod) {
  let firstTime = true;
  let respText;
  let error2;
  return async function getTextFromResponse() {
    if (firstTime) {
      firstTime = false;
      try {
        respText = await response.text();
      } catch (e22) {
        error2 = TalerError.fromDetail(
          TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
          {
            requestUrl,
            requestMethod,
            httpStatusCode: response.status,
            validationError: e22 instanceof Error ? e22.message : String(e22)
          },
          "Invalid text from HTTP response"
        );
      }
    }
    if (error2 !== void 0) {
      throw error2;
    }
    return respText;
  };
}
function makeJsonHandler(response, requestUrl, requestMethod, readTextHandler) {
  let firstTime = true;
  let responseJson = void 0;
  let error2;
  return async function getJsonFromResponse() {
    if (firstTime) {
      let responseText;
      try {
        responseText = await readTextHandler();
      } catch (e22) {
        const message = e22 instanceof Error ? `Couldn't read HTTP response: ${e22.message}` : "Couldn't read HTTP response";
        error2 = TalerError.fromDetail(
          TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
          {
            requestUrl,
            requestMethod,
            httpStatusCode: response.status,
            validationError: e22 instanceof Error ? e22.message : String(e22)
          },
          message
        );
      }
      if (!error2) {
        try {
          responseJson = JSON.parse(responseText);
        } catch (e22) {
          const message = e22 instanceof Error ? `Invalid JSON from HTTP response: ${e22.message}` : "Invalid JSON from HTTP response";
          error2 = TalerError.fromDetail(
            TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
            {
              requestUrl,
              requestMethod,
              // @ts-expect-error no error then text is initialized
              response: responseText,
              httpStatusCode: response.status,
              validationError: e22 instanceof Error ? e22.message : String(e22)
            },
            message
          );
        }
        if (responseJson === null || typeof responseJson !== "object") {
          error2 = TalerError.fromDetail(
            TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
            {
              requestUrl,
              requestMethod,
              response: JSON.stringify(responseJson),
              httpStatusCode: response.status
            },
            "Invalid JSON from HTTP response: null or not object"
          );
        }
      }
    }
    if (error2 !== void 0) {
      throw error2;
    }
    return responseJson;
  };
}
function buildPaginatedResult(data, offset, setOffset, getId, PAGINATED_LIST_REQUEST2) {
  const isLastPage = data.length < PAGINATED_LIST_REQUEST2;
  const isFirstPage = offset === void 0;
  const result = structuredClone(data);
  if (result.length == PAGINATED_LIST_REQUEST2) {
    result.pop();
  }
  return {
    type: "ok",
    case: "ok",
    body: result,
    loadNext: isLastPage ? void 0 : () => {
      if (!result.length)
        return;
      const id = getId(result[result.length - 1]);
      setOffset(id);
    },
    loadFirst: isFirstPage ? void 0 : () => {
      setOffset(void 0);
    }
  };
}

// src/Application.tsx
init_preact_module();
init_hooks_module();

// ../../node_modules/.pnpm/swr@2.2.2_react@18.3.1/node_modules/swr/core/dist/index.mjs
init_compat_module();
var import_shim = __toESM(require_shim(), 1);

// ../../node_modules/.pnpm/swr@2.2.2_react@18.3.1/node_modules/swr/_internal/dist/index.mjs
init_compat_module();
var noop = () => {
};
var UNDEFINED = (
  /*#__NOINLINE__*/
  noop()
);
var OBJECT = Object;
var isUndefined = (v3) => v3 === UNDEFINED;
var isFunction = (v3) => typeof v3 == "function";
var mergeObjects = (a6, b5) => ({
  ...a6,
  ...b5
});
var isPromiseLike = (x6) => isFunction(x6.then);
var table = /* @__PURE__ */ new WeakMap();
var counter = 0;
var stableHash = (arg) => {
  const type = typeof arg;
  const constructor = arg && arg.constructor;
  const isDate3 = constructor == Date;
  let result;
  let index2;
  if (OBJECT(arg) === arg && !isDate3 && constructor != RegExp) {
    result = table.get(arg);
    if (result)
      return result;
    result = ++counter + "~";
    table.set(arg, result);
    if (constructor == Array) {
      result = "@";
      for (index2 = 0; index2 < arg.length; index2++) {
        result += stableHash(arg[index2]) + ",";
      }
      table.set(arg, result);
    }
    if (constructor == OBJECT) {
      result = "#";
      const keys = OBJECT.keys(arg).sort();
      while (!isUndefined(index2 = keys.pop())) {
        if (!isUndefined(arg[index2])) {
          result += index2 + ":" + stableHash(arg[index2]) + ",";
        }
      }
      table.set(arg, result);
    }
  } else {
    result = isDate3 ? arg.toJSON() : type == "symbol" ? arg.toString() : type == "string" ? JSON.stringify(arg) : "" + arg;
  }
  return result;
};
var SWRGlobalState = /* @__PURE__ */ new WeakMap();
var EMPTY_CACHE = {};
var INITIAL_CACHE = {};
var STR_UNDEFINED = "undefined";
var isWindowDefined = typeof window != STR_UNDEFINED;
var isDocumentDefined = typeof document != STR_UNDEFINED;
var hasRequestAnimationFrame = () => isWindowDefined && typeof window["requestAnimationFrame"] != STR_UNDEFINED;
var createCacheHelper = (cache2, key) => {
  const state = SWRGlobalState.get(cache2);
  return [
    // Getter
    () => !isUndefined(key) && cache2.get(key) || EMPTY_CACHE,
    // Setter
    (info) => {
      if (!isUndefined(key)) {
        const prev = cache2.get(key);
        if (!(key in INITIAL_CACHE)) {
          INITIAL_CACHE[key] = prev;
        }
        state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);
      }
    },
    // Subscriber
    state[6],
    // Get server cache snapshot
    () => {
      if (!isUndefined(key)) {
        if (key in INITIAL_CACHE)
          return INITIAL_CACHE[key];
      }
      return !isUndefined(key) && cache2.get(key) || EMPTY_CACHE;
    }
  ];
};
var online = true;
var isOnline = () => online;
var [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [
  window.addEventListener.bind(window),
  window.removeEventListener.bind(window)
] : [
  noop,
  noop
];
var isVisible = () => {
  const visibilityState = isDocumentDefined && document.visibilityState;
  return isUndefined(visibilityState) || visibilityState !== "hidden";
};
var initFocus = (callback2) => {
  if (isDocumentDefined) {
    document.addEventListener("visibilitychange", callback2);
  }
  onWindowEvent("focus", callback2);
  return () => {
    if (isDocumentDefined) {
      document.removeEventListener("visibilitychange", callback2);
    }
    offWindowEvent("focus", callback2);
  };
};
var initReconnect = (callback2) => {
  const onOnline = () => {
    online = true;
    callback2();
  };
  const onOffline = () => {
    online = false;
  };
  onWindowEvent("online", onOnline);
  onWindowEvent("offline", onOffline);
  return () => {
    offWindowEvent("online", onOnline);
    offWindowEvent("offline", onOffline);
  };
};
var preset = {
  isOnline,
  isVisible
};
var defaultConfigOptions = {
  initFocus,
  initReconnect
};
var IS_REACT_LEGACY = !bn.useId;
var IS_SERVER = !isWindowDefined || "Deno" in window;
var rAF = (f3) => hasRequestAnimationFrame() ? window["requestAnimationFrame"](f3) : setTimeout(f3, 1);
var useIsomorphicLayoutEffect = IS_SERVER ? h2 : s2;
var navigatorConnection = typeof navigator !== "undefined" && navigator.connection;
var slowConnection = !IS_SERVER && navigatorConnection && ([
  "slow-2g",
  "2g"
].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);
var serialize = (key) => {
  if (isFunction(key)) {
    try {
      key = key();
    } catch (err) {
      key = "";
    }
  }
  const args = key;
  key = typeof key == "string" ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : "";
  return [
    key,
    args
  ];
};
var __timestamp = 0;
var getTimestamp = () => ++__timestamp;
var FOCUS_EVENT = 0;
var RECONNECT_EVENT = 1;
var MUTATE_EVENT = 2;
var ERROR_REVALIDATE_EVENT = 3;
var events = {
  __proto__: null,
  ERROR_REVALIDATE_EVENT,
  FOCUS_EVENT,
  MUTATE_EVENT,
  RECONNECT_EVENT
};
async function internalMutate(...args) {
  const [cache2, _key, _data, _opts] = args;
  const options = mergeObjects({
    populateCache: true,
    throwOnError: true
  }, typeof _opts === "boolean" ? {
    revalidate: _opts
  } : _opts || {});
  let populateCache = options.populateCache;
  const rollbackOnErrorOption = options.rollbackOnError;
  let optimisticData = options.optimisticData;
  const revalidate = options.revalidate !== false;
  const rollbackOnError = (error2) => {
    return typeof rollbackOnErrorOption === "function" ? rollbackOnErrorOption(error2) : rollbackOnErrorOption !== false;
  };
  const throwOnError = options.throwOnError;
  if (isFunction(_key)) {
    const keyFilter = _key;
    const matchedKeys = [];
    const it = cache2.keys();
    for (const key of it) {
      if (
        // Skip the special useSWRInfinite and useSWRSubscription keys.
        !/^\$(inf|sub)\$/.test(key) && keyFilter(cache2.get(key)._k)
      ) {
        matchedKeys.push(key);
      }
    }
    return Promise.all(matchedKeys.map(mutateByKey));
  }
  return mutateByKey(_key);
  async function mutateByKey(_k) {
    const [key] = serialize(_k);
    if (!key)
      return;
    const [get, set2] = createCacheHelper(cache2, key);
    const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache2);
    const startRevalidate = () => {
      const revalidators = EVENT_REVALIDATORS[key];
      if (revalidate) {
        delete FETCH[key];
        delete PRELOAD[key];
        if (revalidators && revalidators[0]) {
          return revalidators[0](MUTATE_EVENT).then(() => get().data);
        }
      }
      return get().data;
    };
    if (args.length < 3) {
      return startRevalidate();
    }
    let data = _data;
    let error2;
    const beforeMutationTs = getTimestamp();
    MUTATION[key] = [
      beforeMutationTs,
      0
    ];
    const hasOptimisticData = !isUndefined(optimisticData);
    const state = get();
    const displayedData = state.data;
    const currentData = state._c;
    const committedData = isUndefined(currentData) ? displayedData : currentData;
    if (hasOptimisticData) {
      optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;
      set2({
        data: optimisticData,
        _c: committedData
      });
    }
    if (isFunction(data)) {
      try {
        data = data(committedData);
      } catch (err) {
        error2 = err;
      }
    }
    if (data && isPromiseLike(data)) {
      data = await data.catch((err) => {
        error2 = err;
      });
      if (beforeMutationTs !== MUTATION[key][0]) {
        if (error2)
          throw error2;
        return data;
      } else if (error2 && hasOptimisticData && rollbackOnError(error2)) {
        populateCache = true;
        set2({
          data: committedData,
          _c: UNDEFINED
        });
      }
    }
    if (populateCache) {
      if (!error2) {
        if (isFunction(populateCache)) {
          const populateCachedData = populateCache(data, committedData);
          set2({
            data: populateCachedData,
            error: UNDEFINED,
            _c: UNDEFINED
          });
        } else {
          set2({
            data,
            error: UNDEFINED,
            _c: UNDEFINED
          });
        }
      }
    }
    MUTATION[key][1] = getTimestamp();
    Promise.resolve(startRevalidate()).then(() => {
      set2({
        _c: UNDEFINED
      });
    });
    if (error2) {
      if (throwOnError)
        throw error2;
      return;
    }
    return data;
  }
}
var revalidateAllKeys = (revalidators, type) => {
  for (const key in revalidators) {
    if (revalidators[key][0])
      revalidators[key][0](type);
  }
};
var initCache = (provider, options) => {
  if (!SWRGlobalState.has(provider)) {
    const opts = mergeObjects(defaultConfigOptions, options);
    const EVENT_REVALIDATORS = {};
    const mutate2 = internalMutate.bind(UNDEFINED, provider);
    let unmount = noop;
    const subscriptions = {};
    const subscribe = (key, callback2) => {
      const subs = subscriptions[key] || [];
      subscriptions[key] = subs;
      subs.push(callback2);
      return () => subs.splice(subs.indexOf(callback2), 1);
    };
    const setter = (key, value, prev) => {
      provider.set(key, value);
      const subs = subscriptions[key];
      if (subs) {
        for (const fn2 of subs) {
          fn2(value, prev);
        }
      }
    };
    const initProvider = () => {
      if (!SWRGlobalState.has(provider)) {
        SWRGlobalState.set(provider, [
          EVENT_REVALIDATORS,
          {},
          {},
          {},
          mutate2,
          setter,
          subscribe
        ]);
        if (!IS_SERVER) {
          const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));
          const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));
          unmount = () => {
            releaseFocus && releaseFocus();
            releaseReconnect && releaseReconnect();
            SWRGlobalState.delete(provider);
          };
        }
      }
    };
    initProvider();
    return [
      provider,
      mutate2,
      initProvider,
      unmount
    ];
  }
  return [
    provider,
    SWRGlobalState.get(provider)[4]
  ];
};
var onErrorRetry = (_3, __, config, revalidate, opts) => {
  const maxRetryCount = config.errorRetryCount;
  const currentRetryCount = opts.retryCount;
  const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
  if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {
    return;
  }
  setTimeout(revalidate, timeout, opts);
};
var compare = (currentData, newData) => stableHash(currentData) == stableHash(newData);
var [cache, mutate] = initCache(/* @__PURE__ */ new Map());
var defaultConfig = mergeObjects(
  {
    // events
    onLoadingSlow: noop,
    onSuccess: noop,
    onError: noop,
    onErrorRetry,
    onDiscarded: noop,
    // switches
    revalidateOnFocus: true,
    revalidateOnReconnect: true,
    revalidateIfStale: true,
    shouldRetryOnError: true,
    // timeouts
    errorRetryInterval: slowConnection ? 1e4 : 5e3,
    focusThrottleInterval: 5 * 1e3,
    dedupingInterval: 2 * 1e3,
    loadingTimeout: slowConnection ? 5e3 : 3e3,
    // providers
    compare,
    isPaused: () => false,
    cache,
    mutate,
    fallback: {}
  },
  // use web preset by default
  preset
);
var mergeConfigs = (a6, b5) => {
  const v3 = mergeObjects(a6, b5);
  if (b5) {
    const { use: u1, fallback: f1 } = a6;
    const { use: u22, fallback: f22 } = b5;
    if (u1 && u22) {
      v3.use = u1.concat(u22);
    }
    if (f1 && f22) {
      v3.fallback = mergeObjects(f1, f22);
    }
  }
  return v3;
};
var SWRConfigContext = B({});
var SWRConfig = (props) => {
  const { value } = props;
  const parentConfig = q2(SWRConfigContext);
  const isFunctionalConfig = isFunction(value);
  const config = F(() => isFunctionalConfig ? value(parentConfig) : value, [
    isFunctionalConfig,
    parentConfig,
    value
  ]);
  const extendedConfig = F(() => isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [
    isFunctionalConfig,
    parentConfig,
    config
  ]);
  const provider = config && config.provider;
  const cacheContextRef = _2(UNDEFINED);
  if (provider && !cacheContextRef.current) {
    cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);
  }
  const cacheContext = cacheContextRef.current;
  if (cacheContext) {
    extendedConfig.cache = cacheContext[0];
    extendedConfig.mutate = cacheContext[1];
  }
  useIsomorphicLayoutEffect(() => {
    if (cacheContext) {
      cacheContext[2] && cacheContext[2]();
      return cacheContext[3];
    }
  }, []);
  return h(SWRConfigContext.Provider, mergeObjects(props, {
    value: extendedConfig
  }));
};
var INFINITE_PREFIX = "$inf$";
var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
var use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
var setupDevTools = () => {
  if (enableDevtools) {
    window.__SWR_DEVTOOLS_REACT__ = bn;
  }
};
var normalize = (args) => {
  return isFunction(args[1]) ? [
    args[0],
    args[1],
    args[2] || {}
  ] : [
    args[0],
    null,
    (args[1] === null ? args[2] : args[1]) || {}
  ];
};
var useSWRConfig = () => {
  return mergeObjects(defaultConfig, q2(SWRConfigContext));
};
var middleware = (useSWRNext) => (key_, fetcher_, config) => {
  const fetcher = fetcher_ && ((...args) => {
    const [key] = serialize(key_);
    const [, , , PRELOAD] = SWRGlobalState.get(cache);
    if (key.startsWith(INFINITE_PREFIX)) {
      return fetcher_(...args);
    }
    const req = PRELOAD[key];
    if (isUndefined(req))
      return fetcher_(...args);
    delete PRELOAD[key];
    return req;
  });
  return useSWRNext(key_, fetcher, config);
};
var BUILT_IN_MIDDLEWARE = use.concat(middleware);
var withArgs = (hook) => {
  return function useSWRArgs(...args) {
    const fallbackConfig = useSWRConfig();
    const [key, fn2, _config] = normalize(args);
    const config = mergeConfigs(fallbackConfig, _config);
    let next = hook;
    const { use: use3 } = config;
    const middleware2 = (use3 || []).concat(BUILT_IN_MIDDLEWARE);
    for (let i5 = middleware2.length; i5--; ) {
      next = middleware2[i5](next);
    }
    return next(key, fn2 || config.fetcher || null, config);
  };
};
var subscribeCallback = (key, callbacks, callback2) => {
  const keyedRevalidators = callbacks[key] || (callbacks[key] = []);
  keyedRevalidators.push(callback2);
  return () => {
    const index2 = keyedRevalidators.indexOf(callback2);
    if (index2 >= 0) {
      keyedRevalidators[index2] = keyedRevalidators[keyedRevalidators.length - 1];
      keyedRevalidators.pop();
    }
  };
};
setupDevTools();

// ../../node_modules/.pnpm/swr@2.2.2_react@18.3.1/node_modules/swr/core/dist/index.mjs
var use2 = bn.use || ((promise) => {
  if (promise.status === "pending") {
    throw promise;
  } else if (promise.status === "fulfilled") {
    return promise.value;
  } else if (promise.status === "rejected") {
    throw promise.reason;
  } else {
    promise.status = "pending";
    promise.then((v3) => {
      promise.status = "fulfilled";
      promise.value = v3;
    }, (e5) => {
      promise.status = "rejected";
      promise.reason = e5;
    });
    throw promise;
  }
});
var WITH_DEDUPE = {
  dedupe: true
};
var useSWRHandler = (_key, fetcher, config) => {
  const { cache: cache2, compare: compare2, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData } = config;
  const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache2);
  const [key, fnArg] = serialize(_key);
  const initialMountedRef = _2(false);
  const unmountedRef = _2(false);
  const keyRef = _2(key);
  const fetcherRef = _2(fetcher);
  const configRef = _2(config);
  const getConfig = () => configRef.current;
  const isActive = () => getConfig().isVisible() && getConfig().isOnline();
  const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache2, key);
  const stateDependencies = _2({}).current;
  const fallback = isUndefined(fallbackData) ? config.fallback[key] : fallbackData;
  const isEqual = (prev, current) => {
    for (const _3 in stateDependencies) {
      const t5 = _3;
      if (t5 === "data") {
        if (!compare2(prev[t5], current[t5])) {
          if (!isUndefined(prev[t5])) {
            return false;
          }
          if (!compare2(returnedData, current[t5])) {
            return false;
          }
        }
      } else {
        if (current[t5] !== prev[t5]) {
          return false;
        }
      }
    }
    return true;
  };
  const getSnapshot = F(() => {
    const shouldStartRequest = (() => {
      if (!key)
        return false;
      if (!fetcher)
        return false;
      if (!isUndefined(revalidateOnMount))
        return revalidateOnMount;
      if (getConfig().isPaused())
        return false;
      if (suspense)
        return false;
      if (!isUndefined(revalidateIfStale))
        return revalidateIfStale;
      return true;
    })();
    const getSelectedCache = (state) => {
      const snapshot = mergeObjects(state);
      delete snapshot._k;
      if (!shouldStartRequest) {
        return snapshot;
      }
      return {
        isValidating: true,
        isLoading: true,
        ...snapshot
      };
    };
    const cachedData2 = getCache();
    const initialData = getInitialCache();
    const clientSnapshot = getSelectedCache(cachedData2);
    const serverSnapshot = cachedData2 === initialData ? clientSnapshot : getSelectedCache(initialData);
    let memorizedSnapshot = clientSnapshot;
    return [
      () => {
        const newSnapshot = getSelectedCache(getCache());
        const compareResult = isEqual(newSnapshot, memorizedSnapshot);
        if (compareResult) {
          memorizedSnapshot.data = newSnapshot.data;
          memorizedSnapshot.isLoading = newSnapshot.isLoading;
          memorizedSnapshot.isValidating = newSnapshot.isValidating;
          memorizedSnapshot.error = newSnapshot.error;
          return memorizedSnapshot;
        } else {
          memorizedSnapshot = newSnapshot;
          return newSnapshot;
        }
      },
      () => serverSnapshot
    ];
  }, [
    cache2,
    key
  ]);
  const cached = (0, import_shim.useSyncExternalStore)(T2(
    (callback2) => subscribeCache(key, (current, prev) => {
      if (!isEqual(prev, current))
        callback2();
    }),
    // eslint-disable-next-line react-hooks/exhaustive-deps
    [
      cache2,
      key
    ]
  ), getSnapshot[0], getSnapshot[1]);
  const isInitialMount = !initialMountedRef.current;
  const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;
  const cachedData = cached.data;
  const data = isUndefined(cachedData) ? fallback : cachedData;
  const error2 = cached.error;
  const laggyDataRef = _2(data);
  const returnedData = keepPreviousData ? isUndefined(cachedData) ? laggyDataRef.current : cachedData : data;
  const shouldDoInitialRevalidation = (() => {
    if (hasRevalidator && !isUndefined(error2))
      return false;
    if (isInitialMount && !isUndefined(revalidateOnMount))
      return revalidateOnMount;
    if (getConfig().isPaused())
      return false;
    if (suspense)
      return isUndefined(data) ? false : revalidateIfStale;
    return isUndefined(data) || revalidateIfStale;
  })();
  const defaultValidatingState = !!(key && fetcher && isInitialMount && shouldDoInitialRevalidation);
  const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;
  const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;
  const revalidate = T2(
    async (revalidateOpts) => {
      const currentFetcher = fetcherRef.current;
      if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {
        return false;
      }
      let newData;
      let startAt;
      let loading = true;
      const opts = revalidateOpts || {};
      const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;
      const callbackSafeguard = () => {
        if (IS_REACT_LEGACY) {
          return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;
        }
        return key === keyRef.current;
      };
      const finalState = {
        isValidating: false,
        isLoading: false
      };
      const finishRequestAndUpdateState = () => {
        setCache(finalState);
      };
      const cleanupState = () => {
        const requestInfo = FETCH[key];
        if (requestInfo && requestInfo[1] === startAt) {
          delete FETCH[key];
        }
      };
      const initialState = {
        isValidating: true
      };
      if (isUndefined(getCache().data)) {
        initialState.isLoading = true;
      }
      try {
        if (shouldStartNewRequest) {
          setCache(initialState);
          if (config.loadingTimeout && isUndefined(getCache().data)) {
            setTimeout(() => {
              if (loading && callbackSafeguard()) {
                getConfig().onLoadingSlow(key, config);
              }
            }, config.loadingTimeout);
          }
          FETCH[key] = [
            currentFetcher(fnArg),
            getTimestamp()
          ];
        }
        [newData, startAt] = FETCH[key];
        newData = await newData;
        if (shouldStartNewRequest) {
          setTimeout(cleanupState, config.dedupingInterval);
        }
        if (!FETCH[key] || FETCH[key][1] !== startAt) {
          if (shouldStartNewRequest) {
            if (callbackSafeguard()) {
              getConfig().onDiscarded(key);
            }
          }
          return false;
        }
        finalState.error = UNDEFINED;
        const mutationInfo = MUTATION[key];
        if (!isUndefined(mutationInfo) && // case 1
        (startAt <= mutationInfo[0] || // case 2
        startAt <= mutationInfo[1] || // case 3
        mutationInfo[1] === 0)) {
          finishRequestAndUpdateState();
          if (shouldStartNewRequest) {
            if (callbackSafeguard()) {
              getConfig().onDiscarded(key);
            }
          }
          return false;
        }
        const cacheData = getCache().data;
        finalState.data = compare2(cacheData, newData) ? cacheData : newData;
        if (shouldStartNewRequest) {
          if (callbackSafeguard()) {
            getConfig().onSuccess(newData, key, config);
          }
        }
      } catch (err) {
        cleanupState();
        const currentConfig = getConfig();
        const { shouldRetryOnError } = currentConfig;
        if (!currentConfig.isPaused()) {
          finalState.error = err;
          if (shouldStartNewRequest && callbackSafeguard()) {
            currentConfig.onError(err, key, currentConfig);
            if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {
              if (isActive()) {
                currentConfig.onErrorRetry(err, key, currentConfig, (_opts) => {
                  const revalidators = EVENT_REVALIDATORS[key];
                  if (revalidators && revalidators[0]) {
                    revalidators[0](events.ERROR_REVALIDATE_EVENT, _opts);
                  }
                }, {
                  retryCount: (opts.retryCount || 0) + 1,
                  dedupe: true
                });
              }
            }
          }
        }
      }
      loading = false;
      finishRequestAndUpdateState();
      return true;
    },
    // `setState` is immutable, and `eventsCallback`, `fnArg`, and
    // `keyValidating` are depending on `key`, so we can exclude them from
    // the deps array.
    //
    // FIXME:
    // `fn` and `config` might be changed during the lifecycle,
    // but they might be changed every render like this.
    // `useSWR('key', () => fetch('/api/'), { suspense: true })`
    // So we omit the values from the deps array
    // even though it might cause unexpected behaviors.
    // eslint-disable-next-line react-hooks/exhaustive-deps
    [
      key,
      cache2
    ]
  );
  const boundMutate = T2(
    // Use callback to make sure `keyRef.current` returns latest result every time
    (...args) => {
      return internalMutate(cache2, keyRef.current, ...args);
    },
    // eslint-disable-next-line react-hooks/exhaustive-deps
    []
  );
  useIsomorphicLayoutEffect(() => {
    fetcherRef.current = fetcher;
    configRef.current = config;
    if (!isUndefined(cachedData)) {
      laggyDataRef.current = cachedData;
    }
  });
  useIsomorphicLayoutEffect(() => {
    if (!key)
      return;
    const softRevalidate = revalidate.bind(UNDEFINED, WITH_DEDUPE);
    let nextFocusRevalidatedAt = 0;
    const onRevalidate = (type, opts = {}) => {
      if (type == events.FOCUS_EVENT) {
        const now2 = Date.now();
        if (getConfig().revalidateOnFocus && now2 > nextFocusRevalidatedAt && isActive()) {
          nextFocusRevalidatedAt = now2 + getConfig().focusThrottleInterval;
          softRevalidate();
        }
      } else if (type == events.RECONNECT_EVENT) {
        if (getConfig().revalidateOnReconnect && isActive()) {
          softRevalidate();
        }
      } else if (type == events.MUTATE_EVENT) {
        return revalidate();
      } else if (type == events.ERROR_REVALIDATE_EVENT) {
        return revalidate(opts);
      }
      return;
    };
    const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);
    unmountedRef.current = false;
    keyRef.current = key;
    initialMountedRef.current = true;
    setCache({
      _k: fnArg
    });
    if (shouldDoInitialRevalidation) {
      if (isUndefined(data) || IS_SERVER) {
        softRevalidate();
      } else {
        rAF(softRevalidate);
      }
    }
    return () => {
      unmountedRef.current = true;
      unsubEvents();
    };
  }, [
    key
  ]);
  useIsomorphicLayoutEffect(() => {
    let timer2;
    function next() {
      const interval = isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;
      if (interval && timer2 !== -1) {
        timer2 = setTimeout(execute, interval);
      }
    }
    function execute() {
      if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {
        revalidate(WITH_DEDUPE).then(next);
      } else {
        next();
      }
    }
    next();
    return () => {
      if (timer2) {
        clearTimeout(timer2);
        timer2 = -1;
      }
    };
  }, [
    refreshInterval,
    refreshWhenHidden,
    refreshWhenOffline,
    key
  ]);
  x2(returnedData);
  if (suspense && isUndefined(data) && key) {
    if (!IS_REACT_LEGACY && IS_SERVER) {
      throw new Error("Fallback data is required when using suspense in SSR.");
    }
    fetcherRef.current = fetcher;
    configRef.current = config;
    unmountedRef.current = false;
    const req = PRELOAD[key];
    if (!isUndefined(req)) {
      const promise = boundMutate(req);
      use2(promise);
    }
    if (isUndefined(error2)) {
      const promise = revalidate(WITH_DEDUPE);
      if (!isUndefined(returnedData)) {
        promise.status = "fulfilled";
        promise.value = true;
      }
      use2(promise);
    } else {
      throw error2;
    }
  }
  return {
    mutate: boundMutate,
    get data() {
      stateDependencies.data = true;
      return returnedData;
    },
    get error() {
      stateDependencies.error = true;
      return error2;
    },
    get isValidating() {
      stateDependencies.isValidating = true;
      return isValidating;
    },
    get isLoading() {
      stateDependencies.isLoading = true;
      return isLoading;
    }
  };
};
var SWRConfig2 = OBJECT.defineProperty(SWRConfig, "defaultValue", {
  value: defaultConfig
});
var useSWR = withArgs(useSWRHandler);

// ../../node_modules/.pnpm/@babel+runtime@7.19.4/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function(target) {
    for (var i5 = 1; i5 < arguments.length; i5++) {
      var source = arguments[i5];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}

// ../../node_modules/.pnpm/resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js
function isAbsolute(pathname) {
  return pathname.charAt(0) === "/";
}
function spliceOne(list, index2) {
  for (var i5 = index2, k6 = i5 + 1, n2 = list.length; k6 < n2; i5 += 1, k6 += 1) {
    list[i5] = list[k6];
  }
  list.pop();
}
function resolvePathname(to2, from2) {
  if (from2 === void 0)
    from2 = "";
  var toParts = to2 && to2.split("/") || [];
  var fromParts = from2 && from2.split("/") || [];
  var isToAbs = to2 && isAbsolute(to2);
  var isFromAbs = from2 && isAbsolute(from2);
  var mustEndAbs = isToAbs || isFromAbs;
  if (to2 && isAbsolute(to2)) {
    fromParts = toParts;
  } else if (toParts.length) {
    fromParts.pop();
    fromParts = fromParts.concat(toParts);
  }
  if (!fromParts.length)
    return "/";
  var hasTrailingSlash;
  if (fromParts.length) {
    var last = fromParts[fromParts.length - 1];
    hasTrailingSlash = last === "." || last === ".." || last === "";
  } else {
    hasTrailingSlash = false;
  }
  var up = 0;
  for (var i5 = fromParts.length; i5 >= 0; i5--) {
    var part = fromParts[i5];
    if (part === ".") {
      spliceOne(fromParts, i5);
    } else if (part === "..") {
      spliceOne(fromParts, i5);
      up++;
    } else if (up) {
      spliceOne(fromParts, i5);
      up--;
    }
  }
  if (!mustEndAbs)
    for (; up--; up)
      fromParts.unshift("..");
  if (mustEndAbs && fromParts[0] !== "" && (!fromParts[0] || !isAbsolute(fromParts[0])))
    fromParts.unshift("");
  var result = fromParts.join("/");
  if (hasTrailingSlash && result.substr(-1) !== "/")
    result += "/";
  return result;
}
var resolve_pathname_default = resolvePathname;

// ../../node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
var isProduction = true;
var prefix = "Invariant failed";
function invariant2(condition, message) {
  if (condition) {
    return;
  }
  if (isProduction) {
    throw new Error(prefix);
  }
  var provided = typeof message === "function" ? message() : message;
  var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
  throw new Error(value);
}

// ../../node_modules/.pnpm/history@4.10.1/node_modules/history/esm/history.js
function addLeadingSlash(path) {
  return path.charAt(0) === "/" ? path : "/" + path;
}
function stripLeadingSlash(path) {
  return path.charAt(0) === "/" ? path.substr(1) : path;
}
function hasBasename(path, prefix2) {
  return path.toLowerCase().indexOf(prefix2.toLowerCase()) === 0 && "/?#".indexOf(path.charAt(prefix2.length)) !== -1;
}
function stripBasename(path, prefix2) {
  return hasBasename(path, prefix2) ? path.substr(prefix2.length) : path;
}
function stripTrailingSlash(path) {
  return path.charAt(path.length - 1) === "/" ? path.slice(0, -1) : path;
}
function parsePath(path) {
  var pathname = path || "/";
  var search = "";
  var hash3 = "";
  var hashIndex = pathname.indexOf("#");
  if (hashIndex !== -1) {
    hash3 = pathname.substr(hashIndex);
    pathname = pathname.substr(0, hashIndex);
  }
  var searchIndex = pathname.indexOf("?");
  if (searchIndex !== -1) {
    search = pathname.substr(searchIndex);
    pathname = pathname.substr(0, searchIndex);
  }
  return {
    pathname,
    search: search === "?" ? "" : search,
    hash: hash3 === "#" ? "" : hash3
  };
}
function createPath(location2) {
  var pathname = location2.pathname, search = location2.search, hash3 = location2.hash;
  var path = pathname || "/";
  if (search && search !== "?")
    path += search.charAt(0) === "?" ? search : "?" + search;
  if (hash3 && hash3 !== "#")
    path += hash3.charAt(0) === "#" ? hash3 : "#" + hash3;
  return path;
}
function createLocation(path, state, key, currentLocation) {
  var location2;
  if (typeof path === "string") {
    location2 = parsePath(path);
    location2.state = state;
  } else {
    location2 = _extends({}, path);
    if (location2.pathname === void 0)
      location2.pathname = "";
    if (location2.search) {
      if (location2.search.charAt(0) !== "?")
        location2.search = "?" + location2.search;
    } else {
      location2.search = "";
    }
    if (location2.hash) {
      if (location2.hash.charAt(0) !== "#")
        location2.hash = "#" + location2.hash;
    } else {
      location2.hash = "";
    }
    if (state !== void 0 && location2.state === void 0)
      location2.state = state;
  }
  try {
    location2.pathname = decodeURI(location2.pathname);
  } catch (e5) {
    if (e5 instanceof URIError) {
      throw new URIError('Pathname "' + location2.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.');
    } else {
      throw e5;
    }
  }
  if (key)
    location2.key = key;
  if (currentLocation) {
    if (!location2.pathname) {
      location2.pathname = currentLocation.pathname;
    } else if (location2.pathname.charAt(0) !== "/") {
      location2.pathname = resolve_pathname_default(location2.pathname, currentLocation.pathname);
    }
  } else {
    if (!location2.pathname) {
      location2.pathname = "/";
    }
  }
  return location2;
}
function createTransitionManager() {
  var prompt2 = null;
  function setPrompt(nextPrompt) {
    false ? tiny_warning_esm_default(prompt2 == null, "A history supports only one prompt at a time") : void 0;
    prompt2 = nextPrompt;
    return function() {
      if (prompt2 === nextPrompt)
        prompt2 = null;
    };
  }
  function confirmTransitionTo(location2, action, getUserConfirmation, callback2) {
    if (prompt2 != null) {
      var result = typeof prompt2 === "function" ? prompt2(location2, action) : prompt2;
      if (typeof result === "string") {
        if (typeof getUserConfirmation === "function") {
          getUserConfirmation(result, callback2);
        } else {
          false ? tiny_warning_esm_default(false, "A history needs a getUserConfirmation function in order to use a prompt message") : void 0;
          callback2(true);
        }
      } else {
        callback2(result !== false);
      }
    } else {
      callback2(true);
    }
  }
  var listeners = [];
  function appendListener(fn2) {
    var isActive = true;
    function listener() {
      if (isActive)
        fn2.apply(void 0, arguments);
    }
    listeners.push(listener);
    return function() {
      isActive = false;
      listeners = listeners.filter(function(item) {
        return item !== listener;
      });
    };
  }
  function notifyListeners() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    listeners.forEach(function(listener) {
      return listener.apply(void 0, args);
    });
  }
  return {
    setPrompt,
    confirmTransitionTo,
    appendListener,
    notifyListeners
  };
}
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
function getConfirmation(message, callback2) {
  callback2(window.confirm(message));
}
function supportsGoWithoutReloadUsingHash() {
  return window.navigator.userAgent.indexOf("Firefox") === -1;
}
var HashChangeEvent$1 = "hashchange";
var HashPathCoders = {
  hashbang: {
    encodePath: function encodePath(path) {
      return path.charAt(0) === "!" ? path : "!/" + stripLeadingSlash(path);
    },
    decodePath: function decodePath(path) {
      return path.charAt(0) === "!" ? path.substr(1) : path;
    }
  },
  noslash: {
    encodePath: stripLeadingSlash,
    decodePath: addLeadingSlash
  },
  slash: {
    encodePath: addLeadingSlash,
    decodePath: addLeadingSlash
  }
};
function stripHash(url) {
  var hashIndex = url.indexOf("#");
  return hashIndex === -1 ? url : url.slice(0, hashIndex);
}
function getHashPath() {
  var href = window.location.href;
  var hashIndex = href.indexOf("#");
  return hashIndex === -1 ? "" : href.substring(hashIndex + 1);
}
function pushHashPath(path) {
  window.location.hash = path;
}
function replaceHashPath(path) {
  window.location.replace(stripHash(window.location.href) + "#" + path);
}
function createHashHistory(props) {
  if (props === void 0) {
    props = {};
  }
  !canUseDOM ? false ? invariant2(false, "Hash history needs a DOM") : invariant2(false) : void 0;
  var globalHistory = window.history;
  var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
  var _props = props, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$hashType = _props.hashType, hashType = _props$hashType === void 0 ? "slash" : _props$hashType;
  var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "";
  var _HashPathCoders$hashT = HashPathCoders[hashType], encodePath2 = _HashPathCoders$hashT.encodePath, decodePath2 = _HashPathCoders$hashT.decodePath;
  function getDOMLocation() {
    var path2 = decodePath2(getHashPath());
    false ? tiny_warning_esm_default(!basename || hasBasename(path2, basename), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + path2 + '" to begin with "' + basename + '".') : void 0;
    if (basename)
      path2 = stripBasename(path2, basename);
    return createLocation(path2);
  }
  var transitionManager = createTransitionManager();
  function setState(nextState) {
    _extends(history3, nextState);
    history3.length = globalHistory.length;
    transitionManager.notifyListeners(history3.location, history3.action);
  }
  var forceNextPop = false;
  var ignorePath = null;
  function locationsAreEqual$$1(a6, b5) {
    return a6.pathname === b5.pathname && a6.search === b5.search && a6.hash === b5.hash;
  }
  function handleHashChange() {
    var path2 = getHashPath();
    var encodedPath2 = encodePath2(path2);
    if (path2 !== encodedPath2) {
      replaceHashPath(encodedPath2);
    } else {
      var location2 = getDOMLocation();
      var prevLocation = history3.location;
      if (!forceNextPop && locationsAreEqual$$1(prevLocation, location2))
        return;
      if (ignorePath === createPath(location2))
        return;
      ignorePath = null;
      handlePop(location2);
    }
  }
  function handlePop(location2) {
    if (forceNextPop) {
      forceNextPop = false;
      setState();
    } else {
      var action = "POP";
      transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
        if (ok) {
          setState({
            action,
            location: location2
          });
        } else {
          revertPop(location2);
        }
      });
    }
  }
  function revertPop(fromLocation) {
    var toLocation = history3.location;
    var toIndex = allPaths.lastIndexOf(createPath(toLocation));
    if (toIndex === -1)
      toIndex = 0;
    var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
    if (fromIndex === -1)
      fromIndex = 0;
    var delta = toIndex - fromIndex;
    if (delta) {
      forceNextPop = true;
      go(delta);
    }
  }
  var path = getHashPath();
  var encodedPath = encodePath2(path);
  if (path !== encodedPath)
    replaceHashPath(encodedPath);
  var initialLocation = getDOMLocation();
  var allPaths = [createPath(initialLocation)];
  function createHref(location2) {
    var baseTag = document.querySelector("base");
    var href = "";
    if (baseTag && baseTag.getAttribute("href")) {
      href = stripHash(window.location.href);
    }
    return href + "#" + encodePath2(basename + createPath(location2));
  }
  function push(path2, state) {
    false ? tiny_warning_esm_default(state === void 0, "Hash history cannot push state; it is ignored") : void 0;
    var action = "PUSH";
    var location2 = createLocation(path2, void 0, void 0, history3.location);
    transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
      if (!ok)
        return;
      var path3 = createPath(location2);
      var encodedPath2 = encodePath2(basename + path3);
      var hashChanged = getHashPath() !== encodedPath2;
      if (hashChanged) {
        ignorePath = path3;
        pushHashPath(encodedPath2);
        var prevIndex = allPaths.lastIndexOf(createPath(history3.location));
        var nextPaths = allPaths.slice(0, prevIndex + 1);
        nextPaths.push(path3);
        allPaths = nextPaths;
        setState({
          action,
          location: location2
        });
      } else {
        false ? tiny_warning_esm_default(false, "Hash history cannot PUSH the same path; a new entry will not be added to the history stack") : void 0;
        setState();
      }
    });
  }
  function replace(path2, state) {
    false ? tiny_warning_esm_default(state === void 0, "Hash history cannot replace state; it is ignored") : void 0;
    var action = "REPLACE";
    var location2 = createLocation(path2, void 0, void 0, history3.location);
    transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
      if (!ok)
        return;
      var path3 = createPath(location2);
      var encodedPath2 = encodePath2(basename + path3);
      var hashChanged = getHashPath() !== encodedPath2;
      if (hashChanged) {
        ignorePath = path3;
        replaceHashPath(encodedPath2);
      }
      var prevIndex = allPaths.indexOf(createPath(history3.location));
      if (prevIndex !== -1)
        allPaths[prevIndex] = path3;
      setState({
        action,
        location: location2
      });
    });
  }
  function go(n2) {
    false ? tiny_warning_esm_default(canGoWithoutReload, "Hash history go(n) causes a full page reload in this browser") : void 0;
    globalHistory.go(n2);
  }
  function goBack() {
    go(-1);
  }
  function goForward() {
    go(1);
  }
  var listenerCount = 0;
  function checkDOMListeners(delta) {
    listenerCount += delta;
    if (listenerCount === 1 && delta === 1) {
      window.addEventListener(HashChangeEvent$1, handleHashChange);
    } else if (listenerCount === 0) {
      window.removeEventListener(HashChangeEvent$1, handleHashChange);
    }
  }
  var isBlocked = false;
  function block(prompt2) {
    if (prompt2 === void 0) {
      prompt2 = false;
    }
    var unblock = transitionManager.setPrompt(prompt2);
    if (!isBlocked) {
      checkDOMListeners(1);
      isBlocked = true;
    }
    return function() {
      if (isBlocked) {
        isBlocked = false;
        checkDOMListeners(-1);
      }
      return unblock();
    };
  }
  function listen(listener) {
    var unlisten = transitionManager.appendListener(listener);
    checkDOMListeners(1);
    return function() {
      checkDOMListeners(-1);
      unlisten();
    };
  }
  var history3 = {
    length: globalHistory.length,
    action: "POP",
    location: initialLocation,
    createHref,
    push,
    replace,
    go,
    goBack,
    goForward,
    block,
    listen
  };
  return history3;
}

// src/Routing.tsx
init_preact_module();

// ../../node_modules/.pnpm/preact-router@3.2.1_preact@10.11.3/node_modules/preact-router/dist/preact-router.es.js
init_preact_module();
var EMPTY$1 = {};
function assign(obj, props) {
  for (var i5 in props) {
    obj[i5] = props[i5];
  }
  return obj;
}
function exec(url, route2, opts) {
  var reg = /(?:\?([^#]*))?(#.*)?$/, c5 = url.match(reg), matches = {}, ret;
  if (c5 && c5[1]) {
    var p4 = c5[1].split("&");
    for (var i5 = 0; i5 < p4.length; i5++) {
      var r3 = p4[i5].split("=");
      matches[decodeURIComponent(r3[0])] = decodeURIComponent(r3.slice(1).join("="));
    }
  }
  url = segmentize(url.replace(reg, ""));
  route2 = segmentize(route2 || "");
  var max = Math.max(url.length, route2.length);
  for (var i$1 = 0; i$1 < max; i$1++) {
    if (route2[i$1] && route2[i$1].charAt(0) === ":") {
      var param = route2[i$1].replace(/(^:|[+*?]+$)/g, ""), flags = (route2[i$1].match(/[+*?]+$/) || EMPTY$1)[0] || "", plus = ~flags.indexOf("+"), star = ~flags.indexOf("*"), val = url[i$1] || "";
      if (!val && !star && (flags.indexOf("?") < 0 || plus)) {
        ret = false;
        break;
      }
      matches[param] = decodeURIComponent(val);
      if (plus || star) {
        matches[param] = url.slice(i$1).map(decodeURIComponent).join("/");
        break;
      }
    } else if (route2[i$1] !== url[i$1]) {
      ret = false;
      break;
    }
  }
  if (opts.default !== true && ret === false) {
    return false;
  }
  return matches;
}
function pathRankSort(a6, b5) {
  return a6.rank < b5.rank ? 1 : a6.rank > b5.rank ? -1 : a6.index - b5.index;
}
function prepareVNodeForRanking(vnode, index2) {
  vnode.index = index2;
  vnode.rank = rankChild(vnode);
  return vnode.props;
}
function segmentize(url) {
  return url.replace(/(^\/+|\/+$)/g, "").split("/");
}
function rankSegment(segment) {
  return segment.charAt(0) == ":" ? 1 + "*+?".indexOf(segment.charAt(segment.length - 1)) || 4 : 5;
}
function rank(path) {
  return segmentize(path).map(rankSegment).join("");
}
function rankChild(vnode) {
  return vnode.props.default ? 0 : rank(vnode.props.path);
}
var customHistory = null;
var ROUTERS = [];
var subscribers = [];
var EMPTY = {};
function setUrl(url, type) {
  if (type === void 0)
    type = "push";
  if (customHistory && customHistory[type]) {
    customHistory[type](url);
  } else if (typeof history !== "undefined" && history[type + "State"]) {
    history[type + "State"](null, null, url);
  }
}
function getCurrentUrl() {
  var url;
  if (customHistory && customHistory.location) {
    url = customHistory.location;
  } else if (customHistory && customHistory.getCurrentLocation) {
    url = customHistory.getCurrentLocation();
  } else {
    url = typeof location !== "undefined" ? location : EMPTY;
  }
  return "" + (url.pathname || "") + (url.search || "");
}
function route(url, replace) {
  if (replace === void 0)
    replace = false;
  if (typeof url !== "string" && url.url) {
    replace = url.replace;
    url = url.url;
  }
  if (canRoute(url)) {
    setUrl(url, replace ? "replace" : "push");
  }
  return routeTo(url);
}
function canRoute(url) {
  for (var i5 = ROUTERS.length; i5--; ) {
    if (ROUTERS[i5].canRoute(url)) {
      return true;
    }
  }
  return false;
}
function routeTo(url) {
  var didRoute = false;
  for (var i5 = 0; i5 < ROUTERS.length; i5++) {
    if (ROUTERS[i5].routeTo(url) === true) {
      didRoute = true;
    }
  }
  for (var i$1 = subscribers.length; i$1--; ) {
    subscribers[i$1](url);
  }
  return didRoute;
}
function routeFromLink(node) {
  if (!node || !node.getAttribute) {
    return;
  }
  var href = node.getAttribute("href"), target = node.getAttribute("target");
  if (!href || !href.match(/^\//g) || target && !target.match(/^_?self$/i)) {
    return;
  }
  return route(href);
}
function handleLinkClick(e5) {
  if (e5.ctrlKey || e5.metaKey || e5.altKey || e5.shiftKey || e5.button !== 0) {
    return;
  }
  routeFromLink(e5.currentTarget || e5.target || this);
  return prevent(e5);
}
function prevent(e5) {
  if (e5) {
    if (e5.stopImmediatePropagation) {
      e5.stopImmediatePropagation();
    }
    if (e5.stopPropagation) {
      e5.stopPropagation();
    }
    e5.preventDefault();
  }
  return false;
}
function delegateLinkHandler(e5) {
  if (e5.ctrlKey || e5.metaKey || e5.altKey || e5.shiftKey || e5.button !== 0) {
    return;
  }
  var t5 = e5.target;
  do {
    if (String(t5.nodeName).toUpperCase() === "A" && t5.getAttribute("href")) {
      if (t5.hasAttribute("native")) {
        return;
      }
      if (routeFromLink(t5)) {
        return prevent(e5);
      }
    }
  } while (t5 = t5.parentNode);
}
var eventListenersInitialized = false;
function initEventListeners() {
  if (eventListenersInitialized) {
    return;
  }
  if (typeof addEventListener === "function") {
    if (!customHistory) {
      addEventListener("popstate", function() {
        routeTo(getCurrentUrl());
      });
    }
    addEventListener("click", delegateLinkHandler);
  }
  eventListenersInitialized = true;
}
var Router = function(Component$$1) {
  function Router2(props) {
    Component$$1.call(this, props);
    if (props.history) {
      customHistory = props.history;
    }
    this.state = {
      url: props.url || getCurrentUrl()
    };
    initEventListeners();
  }
  if (Component$$1)
    Router2.__proto__ = Component$$1;
  Router2.prototype = Object.create(Component$$1 && Component$$1.prototype);
  Router2.prototype.constructor = Router2;
  Router2.prototype.shouldComponentUpdate = function shouldComponentUpdate(props) {
    if (props.static !== true) {
      return true;
    }
    return props.url !== this.props.url || props.onChange !== this.props.onChange;
  };
  Router2.prototype.canRoute = function canRoute2(url) {
    var children = x(this.props.children);
    return this.getMatchingChildren(children, url, false).length > 0;
  };
  Router2.prototype.routeTo = function routeTo2(url) {
    this.setState({ url });
    var didRoute = this.canRoute(url);
    if (!this.updating) {
      this.forceUpdate();
    }
    return didRoute;
  };
  Router2.prototype.componentWillMount = function componentWillMount() {
    ROUTERS.push(this);
    this.updating = true;
  };
  Router2.prototype.componentDidMount = function componentDidMount() {
    var this$1 = this;
    if (customHistory) {
      this.unlisten = customHistory.listen(function(location2) {
        this$1.routeTo("" + (location2.pathname || "") + (location2.search || ""));
      });
    }
    this.updating = false;
  };
  Router2.prototype.componentWillUnmount = function componentWillUnmount() {
    if (typeof this.unlisten === "function") {
      this.unlisten();
    }
    ROUTERS.splice(ROUTERS.indexOf(this), 1);
  };
  Router2.prototype.componentWillUpdate = function componentWillUpdate() {
    this.updating = true;
  };
  Router2.prototype.componentDidUpdate = function componentDidUpdate() {
    this.updating = false;
  };
  Router2.prototype.getMatchingChildren = function getMatchingChildren(children, url, invoke) {
    return children.filter(prepareVNodeForRanking).sort(pathRankSort).map(function(vnode) {
      var matches = exec(url, vnode.props.path, vnode.props);
      if (matches) {
        if (invoke !== false) {
          var newProps = { url, matches };
          assign(newProps, matches);
          delete newProps.ref;
          delete newProps.key;
          return q(vnode, newProps);
        }
        return vnode;
      }
    }).filter(Boolean);
  };
  Router2.prototype.render = function render(ref, ref$1) {
    var children = ref.children;
    var onChange = ref.onChange;
    var url = ref$1.url;
    var active = this.getMatchingChildren(x(children), url, true);
    var current = active[0] || null;
    var previous = this.previousUrl;
    if (url !== previous) {
      this.previousUrl = url;
      if (typeof onChange === "function") {
        onChange({
          router: this,
          url,
          previous,
          active,
          current
        });
      }
    }
    return current;
  };
  return Router2;
}(d);
var Link = function(props) {
  return h("a", assign({ onClick: handleLinkClick }, props));
};
var Route = function(props) {
  return h(props.component, props);
};
Router.subscribers = subscribers;
Router.getCurrentUrl = getCurrentUrl;
Router.route = route;
Router.Router = Router;
Router.Route = Route;
Router.Link = Link;
Router.exec = exec;

// src/Routing.tsx
init_hooks_module();

// src/components/exception/loading.tsx
init_preact_module();
function Loading2() {
  return /* @__PURE__ */ h(
    "div",
    {
      class: "columns is-centered is-vcentered",
      style: {
        height: "calc(100% - 3rem)",
        position: "absolute",
        width: "100%"
      }
    },
    /* @__PURE__ */ h(Spinner2, null)
  );
}
function Spinner2() {
  return /* @__PURE__ */ h("div", { class: "lds-ring" }, /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null), /* @__PURE__ */ h("div", null));
}

// src/components/menu/index.tsx
init_preact_module();
init_hooks_module();

// src/AdminRoutes.tsx
init_preact_module();

// src/paths/admin/create/index.tsx
init_preact_module();

// src/paths/admin/create/CreatePage.tsx
init_preact_module();
init_hooks_module();

// src/components/form/FormProvider.tsx
init_preact_module();
init_hooks_module();
var noUpdater = () => (s6) => s6;
function FormProvider({
  object = {},
  errors: errors2 = {},
  name = "",
  valueHandler,
  children
}) {
  const initialObject = F(() => object, []);
  const value = F(
    () => ({
      errors: errors2,
      object,
      initialObject,
      valueHandler: valueHandler ? valueHandler : noUpdater,
      name,
      toStr: {},
      fromStr: {}
    }),
    [errors2, object, valueHandler]
  );
  return /* @__PURE__ */ h(FormContext.Provider, { value }, /* @__PURE__ */ h(
    "form",
    null,
    children
  ));
}
var FormContext = B(null);
function useFormContext() {
  return q2(FormContext);
}

// src/components/form/Input.tsx
init_preact_module();

// src/components/form/useField.tsx
init_hooks_module();
function useField(name) {
  const { errors: errors2, object, initialObject, toStr, fromStr, valueHandler } = useFormContext();
  const [isDirty, setDirty] = p3(false);
  const updateField = (field) => (value2) => {
    setDirty(true);
    return valueHandler((prev) => {
      return setValueDeeper(prev, String(field).split("."), value2);
    });
  };
  const defaultToString5 = (f3) => String(!f3 ? "" : f3);
  const defaultFromString5 = (v3) => v3;
  const value = readField(object, String(name));
  const initial4 = readField(initialObject, String(name));
  const hasError = readField(errors2, String(name));
  return {
    error: isDirty ? hasError : void 0,
    required: !isDirty && hasError,
    value,
    initial: initial4,
    onChange: updateField(name),
    toStr: toStr[name] ? toStr[name] : defaultToString5,
    fromStr: fromStr[name] ? fromStr[name] : defaultFromString5
  };
}
var readField = (object, name) => {
  return name.split(".").reduce((prev, current) => prev && prev[current], object);
};
var setValueDeeper = (object, names3, value) => {
  if (names3.length === 0)
    return value;
  const [head, ...rest] = names3;
  return { ...object, [head]: setValueDeeper(object[head] || {}, rest, value) };
};

// src/components/form/Input.tsx
var defaultToString = (f3) => f3 || "";
var defaultFromString = (v3) => v3;
var TextInput = ({ inputType, error: error2, ...rest }) => inputType === "multiline" ? /* @__PURE__ */ h(
  "textarea",
  {
    ...rest,
    class: error2 ? "textarea is-danger" : "textarea",
    rows: "3"
  }
) : /* @__PURE__ */ h(
  "input",
  {
    ...rest,
    class: error2 ? "input is-danger" : "input",
    type: inputType
  }
);
function Input({
  name,
  readonly,
  placeholder,
  tooltip,
  label,
  expand,
  help,
  children,
  inputType,
  inputExtra,
  side,
  fromStr = defaultFromString,
  toStr = defaultToString
}) {
  const { error: error2, value, onChange, required } = useField(name);
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h(
    "p",
    {
      class: expand ? "control is-expanded has-icons-right" : "control has-icons-right"
    },
    /* @__PURE__ */ h(
      TextInput,
      {
        error: error2,
        ...inputExtra,
        inputType,
        placeholder,
        readonly,
        disabled: readonly,
        name: String(name),
        value: toStr(value),
        onChange: (e5) => onChange(fromStr(e5.currentTarget.value))
      }
    ),
    help,
    children
  ), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2)), side));
}

// src/components/instance/DefaultInstanceFormFields.tsx
init_preact_module();

// src/context/session.ts
init_preact_module();
init_hooks_module();
var codecForSessionState = () => buildCodecForObject().property("backendUrl", codecForURL()).property("token", codecOptional(codecForString())).property(
  "prevToken",
  codecOptional(codecForString())
).build("SavedSession");
function inferInstanceName(url) {
  const match6 = INSTANCE_ID_LOOKUP.exec(url.href);
  return !match6 || !match6[1] ? DEFAULT_ADMIN_USERNAME : match6[1];
}
var defaultState = (url) => {
  return {
    backendUrl: url,
    token: void 0,
    prevToken: void 0
  };
};
var DEFAULT_ADMIN_USERNAME = "admin";
var INSTANCE_ID_LOOKUP = /\/instances\/([^/]*)\/?$/;
function cleanAllCache() {
  mutate(() => true, void 0, { revalidate: false });
}
var Context5 = B(void 0);
var useSessionContext = () => q2(Context5);
var SessionContextProvider = ({
  children
  // value,
}) => {
  const {
    lib: rootLib,
    config: rootConfig,
    url: merchantUrl
  } = useMerchantApiContext();
  const [status, setStatus] = p3("loggedIn");
  const [currentConfig, setCurrentConfig] = p3();
  const SESSION_STATE_KEY = buildStorageKey(
    `merchant-session-${merchantUrl.pathname}`,
    codecForSessionState()
  );
  const { value: state, update } = useLocalStorage(
    SESSION_STATE_KEY,
    defaultState(merchantUrl)
  );
  const currentInstance = inferInstanceName(state.backendUrl);
  let lib;
  let config;
  const doingImpersonation = state.backendUrl.href !== merchantUrl.href;
  if (doingImpersonation) {
    lib = rootLib.subInstanceApi(inferInstanceName(state.backendUrl));
    config = currentConfig ?? rootConfig;
  } else {
    lib = rootLib;
    config = rootConfig;
  }
  h2(() => {
    if (!doingImpersonation)
      return;
    lib.instance.getConfig().then((resp) => {
      if (resp.type === "ok") {
        setCurrentConfig(resp.body);
      }
    });
  }, [state.backendUrl.href]);
  const value = {
    state: {
      backendUrl: state.backendUrl,
      token: state.token,
      impersonated: false,
      // doingImpersonation, FIXME: removing impersonation feature for 1.2
      instance: currentInstance,
      isAdmin: currentInstance === DEFAULT_ADMIN_USERNAME,
      status
    },
    lib,
    config,
    logOut() {
      setStatus("loggedOut");
      update({
        backendUrl: merchantUrl,
        token: void 0,
        prevToken: void 0
      });
      cleanAllCache();
    },
    deImpersonate() {
      cleanAllCache();
      update({
        backendUrl: merchantUrl,
        token: state.prevToken,
        prevToken: void 0
      });
      setStatus("loggedIn");
    },
    impersonate(baseUrl) {
      update({
        backendUrl: baseUrl,
        token: void 0,
        prevToken: state.token
      });
      setStatus("loggedIn");
      cleanAllCache();
    },
    logIn(username, token) {
      cleanAllCache();
      setStatus("loggedIn");
      let backendUrl;
      if (currentInstance !== username) {
        backendUrl = new URL(rootLib.subInstanceApi(username).instance.baseUrl);
      } else {
        backendUrl = state.backendUrl;
      }
      update({
        backendUrl,
        token,
        prevToken: state.prevToken
      });
    },
    getInstanceForUsername(username) {
      return username !== currentInstance ? rootLib.subInstanceApi(username).instance : lib.instance;
    }
  };
  return h(Context5.Provider, {
    value,
    children
  });
};

// src/hooks/preference.ts
var UIElement = /* @__PURE__ */ ((UIElement2) => {
  UIElement2[UIElement2["sidebar_orders"] = 0] = "sidebar_orders";
  UIElement2[UIElement2["sidebar_inventory"] = 1] = "sidebar_inventory";
  UIElement2[UIElement2["sidebar_categories"] = 2] = "sidebar_categories";
  UIElement2[UIElement2["sidebar_wireTransfers"] = 3] = "sidebar_wireTransfers";
  UIElement2[UIElement2["sidebar_templates"] = 4] = "sidebar_templates";
  UIElement2[UIElement2["sidebar_kycStatus"] = 5] = "sidebar_kycStatus";
  UIElement2[UIElement2["sidebar_bankAccounts"] = 6] = "sidebar_bankAccounts";
  UIElement2[UIElement2["sidebar_otpDevices"] = 7] = "sidebar_otpDevices";
  UIElement2[UIElement2["sidebar_webhooks"] = 8] = "sidebar_webhooks";
  UIElement2[UIElement2["sidebar_tokenFamilies"] = 9] = "sidebar_tokenFamilies";
  UIElement2[UIElement2["sidebar_subscriptions"] = 10] = "sidebar_subscriptions";
  UIElement2[UIElement2["sidebar_statistics"] = 11] = "sidebar_statistics";
  UIElement2[UIElement2["sidebar_discounts"] = 12] = "sidebar_discounts";
  UIElement2[UIElement2["sidebar_settings"] = 13] = "sidebar_settings";
  UIElement2[UIElement2["sidebar_password"] = 14] = "sidebar_password";
  UIElement2[UIElement2["sidebar_accessTokens"] = 15] = "sidebar_accessTokens";
  UIElement2[UIElement2["action_createOrderManually"] = 16] = "action_createOrderManually";
  UIElement2[UIElement2["option_otpDevicesOnTemplate"] = 17] = "option_otpDevicesOnTemplate";
  UIElement2[UIElement2["option_advanceOrderCreation"] = 18] = "option_advanceOrderCreation";
  UIElement2[UIElement2["option_advanceInstanceSettings"] = 19] = "option_advanceInstanceSettings";
  UIElement2[UIElement2["action_useRevenueApi"] = 20] = "action_useRevenueApi";
  UIElement2[UIElement2["option_paymentTimeoutOnTemplate"] = 21] = "option_paymentTimeoutOnTemplate";
  UIElement2[UIElement2["option_ageRestriction"] = 22] = "option_ageRestriction";
  UIElement2[UIElement2["option_inventoryTaxes"] = 23] = "option_inventoryTaxes";
  UIElement2[UIElement2["option_refreshableScopes"] = 24] = "option_refreshableScopes";
  return UIElement2;
})(UIElement || {});
var defaultSettings = {
  hideKycUntil: AbsoluteTime.never(),
  hideMissingAccountUntil: AbsoluteTime.never(),
  dateFormat: "ymd",
  persona: void 0
};
var codecForPreferences2 = () => buildCodecForObject().property("hideKycUntil", codecForAbsoluteTime).property("hideMissingAccountUntil", codecForAbsoluteTime).property(
  "dateFormat",
  codecForEither(
    codecForConstString("ymd"),
    codecForConstString("dmy"),
    codecForConstString("mdy")
  )
).property(
  "persona",
  codecOptional(
    codecForEither(
      codecForConstString("developer"),
      codecForConstString("expert"),
      codecForConstString("offline-vending-machine"),
      codecForConstString("point-of-sale"),
      codecForConstString("digital-publishing"),
      codecForConstString("e-commerce")
    )
  )
).build("Preferences");
var PREFERENCES_KEY = buildStorageKey(
  "merchant-preferences",
  codecForPreferences2()
);
function usePreference() {
  const { value, update } = useLocalStorage(PREFERENCES_KEY, defaultSettings);
  function updateField(k6, v3) {
    const newValue = { ...value, [k6]: v3 };
    update(newValue);
  }
  return [value, updateField, update];
}
function dateFormatForSettings(s6) {
  switch (s6.dateFormat) {
    case "ymd":
      return "yyyy/MM/dd";
    case "dmy":
      return "dd/MM/yyyy";
    case "mdy":
      return "MM/dd/yyyy";
  }
}
function datetimeFormatForSettings(s6) {
  return dateFormatForSettings(s6) + " HH:mm:ss";
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/toInteger/index.js
function toInteger2(dirtyNumber) {
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
    return NaN;
  }
  var number = Number(dirtyNumber);
  if (isNaN(number)) {
    return number;
  }
  return number < 0 ? Math.ceil(number) : Math.floor(number);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/requiredArgs/index.js
function requiredArgs2(required, args) {
  if (args.length < required) {
    throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/toDate/index.js
function _typeof36(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof36 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof36 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof36(obj);
}
function toDate2(argument) {
  requiredArgs2(1, arguments);
  var argStr = Object.prototype.toString.call(argument);
  if (argument instanceof Date || _typeof36(argument) === "object" && argStr === "[object Date]") {
    return new Date(argument.getTime());
  } else if (typeof argument === "number" || argStr === "[object Number]") {
    return new Date(argument);
  } else {
    if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
      console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
      console.warn(new Error().stack);
    }
    return /* @__PURE__ */ new Date(NaN);
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addDays/index.js
function addDays2(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var date = toDate2(dirtyDate);
  var amount = toInteger2(dirtyAmount);
  if (isNaN(amount)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  if (!amount) {
    return date;
  }
  date.setDate(date.getDate() + amount);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addMonths/index.js
function addMonths2(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var date = toDate2(dirtyDate);
  var amount = toInteger2(dirtyAmount);
  if (isNaN(amount)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  if (!amount) {
    return date;
  }
  var dayOfMonth = date.getDate();
  var endOfDesiredMonth = new Date(date.getTime());
  endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
  var daysInMonth = endOfDesiredMonth.getDate();
  if (dayOfMonth >= daysInMonth) {
    return endOfDesiredMonth;
  } else {
    date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
    return date;
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/add/index.js
function _typeof37(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof37 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof37 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof37(obj);
}
function add3(dirtyDate, duration) {
  requiredArgs2(2, arguments);
  if (!duration || _typeof37(duration) !== "object")
    return /* @__PURE__ */ new Date(NaN);
  var years = duration.years ? toInteger2(duration.years) : 0;
  var months = duration.months ? toInteger2(duration.months) : 0;
  var weeks = duration.weeks ? toInteger2(duration.weeks) : 0;
  var days = duration.days ? toInteger2(duration.days) : 0;
  var hours = duration.hours ? toInteger2(duration.hours) : 0;
  var minutes = duration.minutes ? toInteger2(duration.minutes) : 0;
  var seconds = duration.seconds ? toInteger2(duration.seconds) : 0;
  var date = toDate2(dirtyDate);
  var dateWithMonths = months || years ? addMonths2(date, months + years * 12) : date;
  var dateWithDays = days || weeks ? addDays2(dateWithMonths, days + weeks * 7) : dateWithMonths;
  var minutesToAdd = minutes + hours * 60;
  var secondsToAdd = seconds + minutesToAdd * 60;
  var msToAdd = secondsToAdd * 1e3;
  var finalDate = new Date(dateWithDays.getTime() + msToAdd);
  return finalDate;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addMilliseconds/index.js
function addMilliseconds2(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var timestamp = toDate2(dirtyDate).getTime();
  var amount = toInteger2(dirtyAmount);
  return new Date(timestamp + amount);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addHours/index.js
var MILLISECONDS_IN_HOUR = 36e5;
function addHours(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  return addMilliseconds2(dirtyDate, amount * MILLISECONDS_IN_HOUR);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/defaultOptions/index.js
var defaultOptions2 = {};
function getDefaultOptions2() {
  return defaultOptions2;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfWeek/index.js
function startOfWeek(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(1, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var weekStartsOn = toInteger2((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate2(dirtyDate);
  var day = date.getDay();
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  date.setDate(date.getDate() - diff);
  date.setHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
function getTimezoneOffsetInMilliseconds2(date) {
  var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
  utcDate.setUTCFullYear(date.getFullYear());
  return date.getTime() - utcDate.getTime();
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfDay/index.js
function startOfDay2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInCalendarDays/index.js
var MILLISECONDS_IN_DAY3 = 864e5;
function differenceInCalendarDays2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var startOfDayLeft = startOfDay2(dirtyDateLeft);
  var startOfDayRight = startOfDay2(dirtyDateRight);
  var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds2(startOfDayLeft);
  var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds2(startOfDayRight);
  return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY3);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addMinutes/index.js
var MILLISECONDS_IN_MINUTE = 6e4;
function addMinutes(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  return addMilliseconds2(dirtyDate, amount * MILLISECONDS_IN_MINUTE);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addQuarters/index.js
function addQuarters(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  var months = amount * 3;
  return addMonths2(dirtyDate, months);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addSeconds/index.js
function addSeconds(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  return addMilliseconds2(dirtyDate, amount * 1e3);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addWeeks/index.js
function addWeeks(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  var days = amount * 7;
  return addDays2(dirtyDate, days);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/addYears/index.js
function addYears(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  return addMonths2(dirtyDate, amount * 12);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/compareAsc/index.js
function compareAsc2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  var diff = dateLeft.getTime() - dateRight.getTime();
  if (diff < 0) {
    return -1;
  } else if (diff > 0) {
    return 1;
  } else {
    return diff;
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/constants/index.js
var daysInYear2 = 365.2425;
var maxTime2 = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
var millisecondsInMinute2 = 6e4;
var millisecondsInHour2 = 36e5;
var millisecondsInSecond2 = 1e3;
var minTime2 = -maxTime2;
var secondsInHour2 = 3600;
var secondsInDay2 = secondsInHour2 * 24;
var secondsInWeek2 = secondsInDay2 * 7;
var secondsInYear2 = secondsInDay2 * daysInYear2;
var secondsInMonth2 = secondsInYear2 / 12;
var secondsInQuarter2 = secondsInMonth2 * 3;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isDate/index.js
function _typeof38(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof38 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof38 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof38(obj);
}
function isDate2(value) {
  requiredArgs2(1, arguments);
  return value instanceof Date || _typeof38(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isValid/index.js
function isValid2(dirtyDate) {
  requiredArgs2(1, arguments);
  if (!isDate2(dirtyDate) && typeof dirtyDate !== "number") {
    return false;
  }
  var date = toDate2(dirtyDate);
  return !isNaN(Number(date));
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInCalendarMonths/index.js
function differenceInCalendarMonths2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
  var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
  return yearDiff * 12 + monthDiff;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInCalendarYears/index.js
function differenceInCalendarYears2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  return dateLeft.getFullYear() - dateRight.getFullYear();
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInDays/index.js
function compareLocalAsc2(dateLeft, dateRight) {
  var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
  if (diff < 0) {
    return -1;
  } else if (diff > 0) {
    return 1;
  } else {
    return diff;
  }
}
function differenceInDays2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  var sign3 = compareLocalAsc2(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarDays2(dateLeft, dateRight));
  dateLeft.setDate(dateLeft.getDate() - sign3 * difference2);
  var isLastDayNotFull = Number(compareLocalAsc2(dateLeft, dateRight) === -sign3);
  var result = sign3 * (difference2 - isLastDayNotFull);
  return result === 0 ? 0 : result;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInMilliseconds/index.js
function differenceInMilliseconds2(dateLeft, dateRight) {
  requiredArgs2(2, arguments);
  return toDate2(dateLeft).getTime() - toDate2(dateRight).getTime();
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/roundingMethods/index.js
var roundingMap2 = {
  ceil: Math.ceil,
  round: Math.round,
  floor: Math.floor,
  trunc: function trunc2(value) {
    return value < 0 ? Math.ceil(value) : Math.floor(value);
  }
  // Math.trunc is not supported by IE
};
var defaultRoundingMethod2 = "trunc";
function getRoundingMethod2(method) {
  return method ? roundingMap2[method] : roundingMap2[defaultRoundingMethod2];
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInHours/index.js
function differenceInHours2(dateLeft, dateRight, options) {
  requiredArgs2(2, arguments);
  var diff = differenceInMilliseconds2(dateLeft, dateRight) / millisecondsInHour2;
  return getRoundingMethod2(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInMinutes/index.js
function differenceInMinutes2(dateLeft, dateRight, options) {
  requiredArgs2(2, arguments);
  var diff = differenceInMilliseconds2(dateLeft, dateRight) / millisecondsInMinute2;
  return getRoundingMethod2(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfDay/index.js
function endOfDay2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setHours(23, 59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfMonth/index.js
function endOfMonth2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var month = date.getMonth();
  date.setFullYear(date.getFullYear(), month + 1, 0);
  date.setHours(23, 59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isLastDayOfMonth/index.js
function isLastDayOfMonth2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  return endOfDay2(date).getTime() === endOfMonth2(date).getTime();
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInMonths/index.js
function differenceInMonths2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  var sign3 = compareAsc2(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarMonths2(dateLeft, dateRight));
  var result;
  if (difference2 < 1) {
    result = 0;
  } else {
    if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
      dateLeft.setDate(30);
    }
    dateLeft.setMonth(dateLeft.getMonth() - sign3 * difference2);
    var isLastMonthNotFull = compareAsc2(dateLeft, dateRight) === -sign3;
    if (isLastDayOfMonth2(toDate2(dirtyDateLeft)) && difference2 === 1 && compareAsc2(dirtyDateLeft, dateRight) === 1) {
      isLastMonthNotFull = false;
    }
    result = sign3 * (difference2 - Number(isLastMonthNotFull));
  }
  return result === 0 ? 0 : result;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInQuarters/index.js
function differenceInQuarters(dateLeft, dateRight, options) {
  requiredArgs2(2, arguments);
  var diff = differenceInMonths2(dateLeft, dateRight) / 3;
  return getRoundingMethod2(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInSeconds/index.js
function differenceInSeconds2(dateLeft, dateRight, options) {
  requiredArgs2(2, arguments);
  var diff = differenceInMilliseconds2(dateLeft, dateRight) / 1e3;
  return getRoundingMethod2(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInWeeks/index.js
function differenceInWeeks(dateLeft, dateRight, options) {
  requiredArgs2(2, arguments);
  var diff = differenceInDays2(dateLeft, dateRight) / 7;
  return getRoundingMethod2(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/differenceInYears/index.js
function differenceInYears2(dirtyDateLeft, dirtyDateRight) {
  requiredArgs2(2, arguments);
  var dateLeft = toDate2(dirtyDateLeft);
  var dateRight = toDate2(dirtyDateRight);
  var sign3 = compareAsc2(dateLeft, dateRight);
  var difference2 = Math.abs(differenceInCalendarYears2(dateLeft, dateRight));
  dateLeft.setFullYear(1584);
  dateRight.setFullYear(1584);
  var isLastYearNotFull = compareAsc2(dateLeft, dateRight) === -sign3;
  var result = sign3 * (difference2 - Number(isLastYearNotFull));
  return result === 0 ? 0 : result;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfMinute/index.js
function startOfMinute(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setSeconds(0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfQuarter/index.js
function startOfQuarter(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var currentMonth = date.getMonth();
  var month = currentMonth - currentMonth % 3;
  date.setMonth(month, 1);
  date.setHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfMonth/index.js
function startOfMonth(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setDate(1);
  date.setHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfYear/index.js
function endOfYear(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var year = date.getFullYear();
  date.setFullYear(year + 1, 0, 0);
  date.setHours(23, 59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfYear/index.js
function startOfYear(dirtyDate) {
  requiredArgs2(1, arguments);
  var cleanDate = toDate2(dirtyDate);
  var date = /* @__PURE__ */ new Date(0);
  date.setFullYear(cleanDate.getFullYear(), 0, 1);
  date.setHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfHour/index.js
function endOfHour(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setMinutes(59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfWeek/index.js
function endOfWeek(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(1, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var weekStartsOn = toInteger2((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate2(dirtyDate);
  var day = date.getDay();
  var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
  date.setDate(date.getDate() + diff);
  date.setHours(23, 59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfMinute/index.js
function endOfMinute(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setSeconds(59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfQuarter/index.js
function endOfQuarter(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var currentMonth = date.getMonth();
  var month = currentMonth - currentMonth % 3 + 3;
  date.setMonth(month, 0);
  date.setHours(23, 59, 59, 999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/endOfSecond/index.js
function endOfSecond(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setMilliseconds(999);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/subMilliseconds/index.js
function subMilliseconds2(dirtyDate, dirtyAmount) {
  requiredArgs2(2, arguments);
  var amount = toInteger2(dirtyAmount);
  return addMilliseconds2(dirtyDate, -amount);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
var MILLISECONDS_IN_DAY4 = 864e5;
function getUTCDayOfYear2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var timestamp = date.getTime();
  date.setUTCMonth(0, 1);
  date.setUTCHours(0, 0, 0, 0);
  var startOfYearTimestamp = date.getTime();
  var difference2 = timestamp - startOfYearTimestamp;
  return Math.floor(difference2 / MILLISECONDS_IN_DAY4) + 1;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
function startOfUTCISOWeek2(dirtyDate) {
  requiredArgs2(1, arguments);
  var weekStartsOn = 1;
  var date = toDate2(dirtyDate);
  var day = date.getUTCDay();
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  date.setUTCDate(date.getUTCDate() - diff);
  date.setUTCHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
function getUTCISOWeekYear2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var year = date.getUTCFullYear();
  var fourthOfJanuaryOfNextYear = /* @__PURE__ */ new Date(0);
  fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
  fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
  var startOfNextYear = startOfUTCISOWeek2(fourthOfJanuaryOfNextYear);
  var fourthOfJanuaryOfThisYear = /* @__PURE__ */ new Date(0);
  fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
  fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
  var startOfThisYear = startOfUTCISOWeek2(fourthOfJanuaryOfThisYear);
  if (date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
function startOfUTCISOWeekYear2(dirtyDate) {
  requiredArgs2(1, arguments);
  var year = getUTCISOWeekYear2(dirtyDate);
  var fourthOfJanuary = /* @__PURE__ */ new Date(0);
  fourthOfJanuary.setUTCFullYear(year, 0, 4);
  fourthOfJanuary.setUTCHours(0, 0, 0, 0);
  var date = startOfUTCISOWeek2(fourthOfJanuary);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
var MILLISECONDS_IN_WEEK3 = 6048e5;
function getUTCISOWeek2(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var diff = startOfUTCISOWeek2(date).getTime() - startOfUTCISOWeekYear2(date).getTime();
  return Math.round(diff / MILLISECONDS_IN_WEEK3) + 1;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
function startOfUTCWeek2(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(1, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var weekStartsOn = toInteger2((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate2(dirtyDate);
  var day = date.getUTCDay();
  var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  date.setUTCDate(date.getUTCDate() - diff);
  date.setUTCHours(0, 0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
function getUTCWeekYear2(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var year = date.getUTCFullYear();
  var defaultOptions3 = getDefaultOptions2();
  var firstWeekContainsDate = toInteger2((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  }
  var firstWeekOfNextYear = /* @__PURE__ */ new Date(0);
  firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
  firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
  var startOfNextYear = startOfUTCWeek2(firstWeekOfNextYear, options);
  var firstWeekOfThisYear = /* @__PURE__ */ new Date(0);
  firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
  firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
  var startOfThisYear = startOfUTCWeek2(firstWeekOfThisYear, options);
  if (date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
function startOfUTCWeekYear2(dirtyDate, options) {
  var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(1, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var firstWeekContainsDate = toInteger2((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
  var year = getUTCWeekYear2(dirtyDate, options);
  var firstWeek = /* @__PURE__ */ new Date(0);
  firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
  firstWeek.setUTCHours(0, 0, 0, 0);
  var date = startOfUTCWeek2(firstWeek, options);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/getUTCWeek/index.js
var MILLISECONDS_IN_WEEK4 = 6048e5;
function getUTCWeek2(dirtyDate, options) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  var diff = startOfUTCWeek2(date, options).getTime() - startOfUTCWeekYear2(date, options).getTime();
  return Math.round(diff / MILLISECONDS_IN_WEEK4) + 1;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
function addLeadingZeros2(number, targetLength) {
  var sign3 = number < 0 ? "-" : "";
  var output = Math.abs(number).toString();
  while (output.length < targetLength) {
    output = "0" + output;
  }
  return sign3 + output;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
var formatters3 = {
  // Year
  y: function y4(date, token) {
    var signedYear = date.getUTCFullYear();
    var year = signedYear > 0 ? signedYear : 1 - signedYear;
    return addLeadingZeros2(token === "yy" ? year % 100 : year, token.length);
  },
  // Month
  M: function M5(date, token) {
    var month = date.getUTCMonth();
    return token === "M" ? String(month + 1) : addLeadingZeros2(month + 1, 2);
  },
  // Day of the month
  d: function d4(date, token) {
    return addLeadingZeros2(date.getUTCDate(), token.length);
  },
  // AM or PM
  a: function a4(date, token) {
    var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return dayPeriodEnumValue.toUpperCase();
      case "aaa":
        return dayPeriodEnumValue;
      case "aaaaa":
        return dayPeriodEnumValue[0];
      case "aaaa":
      default:
        return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h: function h3(date, token) {
    return addLeadingZeros2(date.getUTCHours() % 12 || 12, token.length);
  },
  // Hour [0-23]
  H: function H4(date, token) {
    return addLeadingZeros2(date.getUTCHours(), token.length);
  },
  // Minute
  m: function m4(date, token) {
    return addLeadingZeros2(date.getUTCMinutes(), token.length);
  },
  // Second
  s: function s4(date, token) {
    return addLeadingZeros2(date.getUTCSeconds(), token.length);
  },
  // Fraction of second
  S: function S4(date, token) {
    var numberOfDigits = token.length;
    var milliseconds = date.getUTCMilliseconds();
    var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
    return addLeadingZeros2(fractionalSeconds, token.length);
  }
};
var lightFormatters_default2 = formatters3;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/formatters/index.js
var dayPeriodEnum2 = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
};
var formatters4 = {
  // Era
  G: function G3(date, token, localize6) {
    var era = date.getUTCFullYear() > 0 ? 1 : 0;
    switch (token) {
      case "G":
      case "GG":
      case "GGG":
        return localize6.era(era, {
          width: "abbreviated"
        });
      case "GGGGG":
        return localize6.era(era, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return localize6.era(era, {
          width: "wide"
        });
    }
  },
  // Year
  y: function y5(date, token, localize6) {
    if (token === "yo") {
      var signedYear = date.getUTCFullYear();
      var year = signedYear > 0 ? signedYear : 1 - signedYear;
      return localize6.ordinalNumber(year, {
        unit: "year"
      });
    }
    return lightFormatters_default2.y(date, token);
  },
  // Local week-numbering year
  Y: function Y4(date, token, localize6, options) {
    var signedWeekYear = getUTCWeekYear2(date, options);
    var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
    if (token === "YY") {
      var twoDigitYear = weekYear % 100;
      return addLeadingZeros2(twoDigitYear, 2);
    }
    if (token === "Yo") {
      return localize6.ordinalNumber(weekYear, {
        unit: "year"
      });
    }
    return addLeadingZeros2(weekYear, token.length);
  },
  // ISO week-numbering year
  R: function R3(date, token) {
    var isoWeekYear = getUTCISOWeekYear2(date);
    return addLeadingZeros2(isoWeekYear, token.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function u4(date, token) {
    var year = date.getUTCFullYear();
    return addLeadingZeros2(year, token.length);
  },
  // Quarter
  Q: function Q3(date, token, localize6) {
    var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
    switch (token) {
      case "Q":
        return String(quarter);
      case "QQ":
        return addLeadingZeros2(quarter, 2);
      case "Qo":
        return localize6.ordinalNumber(quarter, {
          unit: "quarter"
        });
      case "QQQ":
        return localize6.quarter(quarter, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return localize6.quarter(quarter, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return localize6.quarter(quarter, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function q5(date, token, localize6) {
    var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
    switch (token) {
      case "q":
        return String(quarter);
      case "qq":
        return addLeadingZeros2(quarter, 2);
      case "qo":
        return localize6.ordinalNumber(quarter, {
          unit: "quarter"
        });
      case "qqq":
        return localize6.quarter(quarter, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return localize6.quarter(quarter, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return localize6.quarter(quarter, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function M6(date, token, localize6) {
    var month = date.getUTCMonth();
    switch (token) {
      case "M":
      case "MM":
        return lightFormatters_default2.M(date, token);
      case "Mo":
        return localize6.ordinalNumber(month + 1, {
          unit: "month"
        });
      case "MMM":
        return localize6.month(month, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return localize6.month(month, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return localize6.month(month, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function L5(date, token, localize6) {
    var month = date.getUTCMonth();
    switch (token) {
      case "L":
        return String(month + 1);
      case "LL":
        return addLeadingZeros2(month + 1, 2);
      case "Lo":
        return localize6.ordinalNumber(month + 1, {
          unit: "month"
        });
      case "LLL":
        return localize6.month(month, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return localize6.month(month, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return localize6.month(month, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function w5(date, token, localize6, options) {
    var week = getUTCWeek2(date, options);
    if (token === "wo") {
      return localize6.ordinalNumber(week, {
        unit: "week"
      });
    }
    return addLeadingZeros2(week, token.length);
  },
  // ISO week of year
  I: function I5(date, token, localize6) {
    var isoWeek = getUTCISOWeek2(date);
    if (token === "Io") {
      return localize6.ordinalNumber(isoWeek, {
        unit: "week"
      });
    }
    return addLeadingZeros2(isoWeek, token.length);
  },
  // Day of the month
  d: function d5(date, token, localize6) {
    if (token === "do") {
      return localize6.ordinalNumber(date.getUTCDate(), {
        unit: "date"
      });
    }
    return lightFormatters_default2.d(date, token);
  },
  // Day of year
  D: function D5(date, token, localize6) {
    var dayOfYear = getUTCDayOfYear2(date);
    if (token === "Do") {
      return localize6.ordinalNumber(dayOfYear, {
        unit: "dayOfYear"
      });
    }
    return addLeadingZeros2(dayOfYear, token.length);
  },
  // Day of week
  E: function E3(date, token, localize6) {
    var dayOfWeek = date.getUTCDay();
    switch (token) {
      case "E":
      case "EE":
      case "EEE":
        return localize6.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return localize6.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return localize6.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return localize6.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function e4(date, token, localize6, options) {
    var dayOfWeek = date.getUTCDay();
    var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      case "e":
        return String(localDayOfWeek);
      case "ee":
        return addLeadingZeros2(localDayOfWeek, 2);
      case "eo":
        return localize6.ordinalNumber(localDayOfWeek, {
          unit: "day"
        });
      case "eee":
        return localize6.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return localize6.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return localize6.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return localize6.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function c4(date, token, localize6, options) {
    var dayOfWeek = date.getUTCDay();
    var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      case "c":
        return String(localDayOfWeek);
      case "cc":
        return addLeadingZeros2(localDayOfWeek, token.length);
      case "co":
        return localize6.ordinalNumber(localDayOfWeek, {
          unit: "day"
        });
      case "ccc":
        return localize6.day(dayOfWeek, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return localize6.day(dayOfWeek, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return localize6.day(dayOfWeek, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return localize6.day(dayOfWeek, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function i4(date, token, localize6) {
    var dayOfWeek = date.getUTCDay();
    var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
    switch (token) {
      case "i":
        return String(isoDayOfWeek);
      case "ii":
        return addLeadingZeros2(isoDayOfWeek, token.length);
      case "io":
        return localize6.ordinalNumber(isoDayOfWeek, {
          unit: "day"
        });
      case "iii":
        return localize6.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return localize6.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return localize6.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return localize6.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function a5(date, token, localize6) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function b4(date, token, localize6) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue;
    if (hours === 12) {
      dayPeriodEnumValue = dayPeriodEnum2.noon;
    } else if (hours === 0) {
      dayPeriodEnumValue = dayPeriodEnum2.midnight;
    } else {
      dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    }
    switch (token) {
      case "b":
      case "bb":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function B5(date, token, localize6) {
    var hours = date.getUTCHours();
    var dayPeriodEnumValue;
    if (hours >= 17) {
      dayPeriodEnumValue = dayPeriodEnum2.evening;
    } else if (hours >= 12) {
      dayPeriodEnumValue = dayPeriodEnum2.afternoon;
    } else if (hours >= 4) {
      dayPeriodEnumValue = dayPeriodEnum2.morning;
    } else {
      dayPeriodEnumValue = dayPeriodEnum2.night;
    }
    switch (token) {
      case "B":
      case "BB":
      case "BBB":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return localize6.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function h4(date, token, localize6) {
    if (token === "ho") {
      var hours = date.getUTCHours() % 12;
      if (hours === 0)
        hours = 12;
      return localize6.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return lightFormatters_default2.h(date, token);
  },
  // Hour [0-23]
  H: function H5(date, token, localize6) {
    if (token === "Ho") {
      return localize6.ordinalNumber(date.getUTCHours(), {
        unit: "hour"
      });
    }
    return lightFormatters_default2.H(date, token);
  },
  // Hour [0-11]
  K: function K5(date, token, localize6) {
    var hours = date.getUTCHours() % 12;
    if (token === "Ko") {
      return localize6.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return addLeadingZeros2(hours, token.length);
  },
  // Hour [1-24]
  k: function k5(date, token, localize6) {
    var hours = date.getUTCHours();
    if (hours === 0)
      hours = 24;
    if (token === "ko") {
      return localize6.ordinalNumber(hours, {
        unit: "hour"
      });
    }
    return addLeadingZeros2(hours, token.length);
  },
  // Minute
  m: function m5(date, token, localize6) {
    if (token === "mo") {
      return localize6.ordinalNumber(date.getUTCMinutes(), {
        unit: "minute"
      });
    }
    return lightFormatters_default2.m(date, token);
  },
  // Second
  s: function s5(date, token, localize6) {
    if (token === "so") {
      return localize6.ordinalNumber(date.getUTCSeconds(), {
        unit: "second"
      });
    }
    return lightFormatters_default2.s(date, token);
  },
  // Fraction of second
  S: function S5(date, token) {
    return lightFormatters_default2.S(date, token);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function X4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    if (timezoneOffset === 0) {
      return "Z";
    }
    switch (token) {
      case "X":
        return formatTimezoneWithOptionalMinutes2(timezoneOffset);
      case "XXXX":
      case "XX":
        return formatTimezone2(timezoneOffset);
      case "XXXXX":
      case "XXX":
      default:
        return formatTimezone2(timezoneOffset, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function x5(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "x":
        return formatTimezoneWithOptionalMinutes2(timezoneOffset);
      case "xxxx":
      case "xx":
        return formatTimezone2(timezoneOffset);
      case "xxxxx":
      case "xxx":
      default:
        return formatTimezone2(timezoneOffset, ":");
    }
  },
  // Timezone (GMT)
  O: function O4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + formatTimezoneShort2(timezoneOffset, ":");
      case "OOOO":
      default:
        return "GMT" + formatTimezone2(timezoneOffset, ":");
    }
  },
  // Timezone (specific non-location)
  z: function z5(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timezoneOffset = originalDate.getTimezoneOffset();
    switch (token) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + formatTimezoneShort2(timezoneOffset, ":");
      case "zzzz":
      default:
        return "GMT" + formatTimezone2(timezoneOffset, ":");
    }
  },
  // Seconds timestamp
  t: function t4(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timestamp = Math.floor(originalDate.getTime() / 1e3);
    return addLeadingZeros2(timestamp, token.length);
  },
  // Milliseconds timestamp
  T: function T5(date, token, _localize, options) {
    var originalDate = options._originalDate || date;
    var timestamp = originalDate.getTime();
    return addLeadingZeros2(timestamp, token.length);
  }
};
function formatTimezoneShort2(offset, dirtyDelimiter) {
  var sign3 = offset > 0 ? "-" : "+";
  var absOffset = Math.abs(offset);
  var hours = Math.floor(absOffset / 60);
  var minutes = absOffset % 60;
  if (minutes === 0) {
    return sign3 + String(hours);
  }
  var delimiter2 = dirtyDelimiter || "";
  return sign3 + String(hours) + delimiter2 + addLeadingZeros2(minutes, 2);
}
function formatTimezoneWithOptionalMinutes2(offset, dirtyDelimiter) {
  if (offset % 60 === 0) {
    var sign3 = offset > 0 ? "-" : "+";
    return sign3 + addLeadingZeros2(Math.abs(offset) / 60, 2);
  }
  return formatTimezone2(offset, dirtyDelimiter);
}
function formatTimezone2(offset, dirtyDelimiter) {
  var delimiter2 = dirtyDelimiter || "";
  var sign3 = offset > 0 ? "-" : "+";
  var absOffset = Math.abs(offset);
  var hours = addLeadingZeros2(Math.floor(absOffset / 60), 2);
  var minutes = addLeadingZeros2(absOffset % 60, 2);
  return sign3 + hours + delimiter2 + minutes;
}
var formatters_default2 = formatters4;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/format/longFormatters/index.js
var dateLongFormatter3 = function dateLongFormatter4(pattern, formatLong7) {
  switch (pattern) {
    case "P":
      return formatLong7.date({
        width: "short"
      });
    case "PP":
      return formatLong7.date({
        width: "medium"
      });
    case "PPP":
      return formatLong7.date({
        width: "long"
      });
    case "PPPP":
    default:
      return formatLong7.date({
        width: "full"
      });
  }
};
var timeLongFormatter3 = function timeLongFormatter4(pattern, formatLong7) {
  switch (pattern) {
    case "p":
      return formatLong7.time({
        width: "short"
      });
    case "pp":
      return formatLong7.time({
        width: "medium"
      });
    case "ppp":
      return formatLong7.time({
        width: "long"
      });
    case "pppp":
    default:
      return formatLong7.time({
        width: "full"
      });
  }
};
var dateTimeLongFormatter3 = function dateTimeLongFormatter4(pattern, formatLong7) {
  var matchResult = pattern.match(/(P+)(p+)?/) || [];
  var datePattern = matchResult[1];
  var timePattern = matchResult[2];
  if (!timePattern) {
    return dateLongFormatter3(pattern, formatLong7);
  }
  var dateTimeFormat;
  switch (datePattern) {
    case "P":
      dateTimeFormat = formatLong7.dateTime({
        width: "short"
      });
      break;
    case "PP":
      dateTimeFormat = formatLong7.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      dateTimeFormat = formatLong7.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      dateTimeFormat = formatLong7.dateTime({
        width: "full"
      });
      break;
  }
  return dateTimeFormat.replace("{{date}}", dateLongFormatter3(datePattern, formatLong7)).replace("{{time}}", timeLongFormatter3(timePattern, formatLong7));
};
var longFormatters2 = {
  p: timeLongFormatter3,
  P: dateTimeLongFormatter3
};
var longFormatters_default2 = longFormatters2;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/protectedTokens/index.js
var protectedDayOfYearTokens2 = ["D", "DD"];
var protectedWeekYearTokens2 = ["YY", "YYYY"];
function isProtectedDayOfYearToken2(token) {
  return protectedDayOfYearTokens2.indexOf(token) !== -1;
}
function isProtectedWeekYearToken2(token) {
  return protectedWeekYearTokens2.indexOf(token) !== -1;
}
function throwProtectedError2(token, format3, input) {
  if (token === "YYYY") {
    throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format3, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "YY") {
    throw new RangeError("Use `yy` instead of `YY` (in `".concat(format3, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "D") {
    throw new RangeError("Use `d` instead of `D` (in `".concat(format3, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  } else if (token === "DD") {
    throw new RangeError("Use `dd` instead of `DD` (in `".concat(format3, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
var formatDistanceLocale5 = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
};
var formatDistance9 = function formatDistance10(token, count, options) {
  var result;
  var tokenValue = formatDistanceLocale5[token];
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", count.toString());
  }
  if (options !== null && options !== void 0 && options.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "in " + result;
    } else {
      return result + " ago";
    }
  }
  return result;
};
var formatDistance_default5 = formatDistance9;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
function buildFormatLongFn2(args) {
  return function() {
    var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var width = options.width ? String(options.width) : args.defaultWidth;
    var format3 = args.formats[width] || args.formats[args.defaultWidth];
    return format3;
  };
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
var dateFormats6 = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
};
var timeFormats6 = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
};
var dateTimeFormats6 = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong6 = {
  date: buildFormatLongFn2({
    formats: dateFormats6,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn2({
    formats: timeFormats6,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn2({
    formats: dateTimeFormats6,
    defaultWidth: "full"
  })
};
var formatLong_default6 = formatLong6;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
var formatRelativeLocale5 = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
};
var formatRelative9 = function formatRelative10(token, _date, _baseDate, _options) {
  return formatRelativeLocale5[token];
};
var formatRelative_default5 = formatRelative9;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
function buildLocalizeFn2(args) {
  return function(dirtyIndex, options) {
    var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
    var valuesArray;
    if (context === "formatting" && args.formattingValues) {
      var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
      var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
    } else {
      var _defaultWidth = args.defaultWidth;
      var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
      valuesArray = args.values[_width] || args.values[_defaultWidth];
    }
    var index2 = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
    return valuesArray[index2];
  };
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
var eraValues5 = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
};
var quarterValues5 = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues5 = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
};
var dayValues5 = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
};
var dayPeriodValues5 = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
};
var formattingDayPeriodValues4 = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
};
var ordinalNumber9 = function ordinalNumber10(dirtyNumber, _options) {
  var number = Number(dirtyNumber);
  var rem100 = number % 100;
  if (rem100 > 20 || rem100 < 10) {
    switch (rem100 % 10) {
      case 1:
        return number + "st";
      case 2:
        return number + "nd";
      case 3:
        return number + "rd";
    }
  }
  return number + "th";
};
var localize5 = {
  ordinalNumber: ordinalNumber9,
  era: buildLocalizeFn2({
    values: eraValues5,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn2({
    values: quarterValues5,
    defaultWidth: "wide",
    argumentCallback: function argumentCallback5(quarter) {
      return quarter - 1;
    }
  }),
  month: buildLocalizeFn2({
    values: monthValues5,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn2({
    values: dayValues5,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn2({
    values: dayPeriodValues5,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues4,
    defaultFormattingWidth: "wide"
  })
};
var localize_default5 = localize5;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
function buildMatchFn2(args) {
  return function(string) {
    var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var width = options.width;
    var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
    var matchResult = string.match(matchPattern);
    if (!matchResult) {
      return null;
    }
    var matchedString = matchResult[0];
    var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
    var key = Array.isArray(parsePatterns) ? findIndex2(parsePatterns, function(pattern) {
      return pattern.test(matchedString);
    }) : findKey2(parsePatterns, function(pattern) {
      return pattern.test(matchedString);
    });
    var value;
    value = args.valueCallback ? args.valueCallback(key) : key;
    value = options.valueCallback ? options.valueCallback(value) : value;
    var rest = string.slice(matchedString.length);
    return {
      value,
      rest
    };
  };
}
function findKey2(object, predicate) {
  for (var key in object) {
    if (object.hasOwnProperty(key) && predicate(object[key])) {
      return key;
    }
  }
  return void 0;
}
function findIndex2(array, predicate) {
  for (var key = 0; key < array.length; key++) {
    if (predicate(array[key])) {
      return key;
    }
  }
  return void 0;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
function buildMatchPatternFn2(args) {
  return function(string) {
    var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var matchResult = string.match(args.matchPattern);
    if (!matchResult)
      return null;
    var matchedString = matchResult[0];
    var parseResult = string.match(args.parsePattern);
    if (!parseResult)
      return null;
    var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    var rest = string.slice(matchedString.length);
    return {
      value,
      rest
    };
  };
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
var matchOrdinalNumberPattern5 = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern5 = /\d+/i;
var matchEraPatterns5 = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns5 = {
  any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns5 = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns5 = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns5 = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns5 = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
var matchDayPatterns5 = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns5 = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns5 = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns5 = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
};
var match5 = {
  ordinalNumber: buildMatchPatternFn2({
    matchPattern: matchOrdinalNumberPattern5,
    parsePattern: parseOrdinalNumberPattern5,
    valueCallback: function valueCallback9(value) {
      return parseInt(value, 10);
    }
  }),
  era: buildMatchFn2({
    matchPatterns: matchEraPatterns5,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns5,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn2({
    matchPatterns: matchQuarterPatterns5,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns5,
    defaultParseWidth: "any",
    valueCallback: function valueCallback10(index2) {
      return index2 + 1;
    }
  }),
  month: buildMatchFn2({
    matchPatterns: matchMonthPatterns5,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns5,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn2({
    matchPatterns: matchDayPatterns5,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns5,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn2({
    matchPatterns: matchDayPeriodPatterns5,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns5,
    defaultParseWidth: "any"
  })
};
var match_default5 = match5;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/locale/en-US/index.js
var locale6 = {
  code: "en-US",
  formatDistance: formatDistance_default5,
  formatLong: formatLong_default6,
  formatRelative: formatRelative_default5,
  localize: localize_default5,
  match: match_default5,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
var en_US_default2 = locale6;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/defaultLocale/index.js
var defaultLocale_default2 = en_US_default2;

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/format/index.js
var formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
var longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp2 = /^'([^]*?)'?$/;
var doubleQuoteRegExp2 = /''/g;
var unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
function format2(dirtyDate, dirtyFormatStr, options) {
  var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
  requiredArgs2(2, arguments);
  var formatStr = String(dirtyFormatStr);
  var defaultOptions3 = getDefaultOptions2();
  var locale7 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions3.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default2;
  var firstWeekContainsDate = toInteger2((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions3.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  }
  var weekStartsOn = toInteger2((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions3.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions3.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  if (!locale7.localize) {
    throw new RangeError("locale must contain localize property");
  }
  if (!locale7.formatLong) {
    throw new RangeError("locale must contain formatLong property");
  }
  var originalDate = toDate2(dirtyDate);
  if (!isValid2(originalDate)) {
    throw new RangeError("Invalid time value");
  }
  var timezoneOffset = getTimezoneOffsetInMilliseconds2(originalDate);
  var utcDate = subMilliseconds2(originalDate, timezoneOffset);
  var formatterOptions = {
    firstWeekContainsDate,
    weekStartsOn,
    locale: locale7,
    _originalDate: originalDate
  };
  var result = formatStr.match(longFormattingTokensRegExp2).map(function(substring) {
    var firstCharacter = substring[0];
    if (firstCharacter === "p" || firstCharacter === "P") {
      var longFormatter = longFormatters_default2[firstCharacter];
      return longFormatter(substring, locale7.formatLong);
    }
    return substring;
  }).join("").match(formattingTokensRegExp2).map(function(substring) {
    if (substring === "''") {
      return "'";
    }
    var firstCharacter = substring[0];
    if (firstCharacter === "'") {
      return cleanEscapedString2(substring);
    }
    var formatter = formatters_default2[firstCharacter];
    if (formatter) {
      if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken2(substring)) {
        throwProtectedError2(substring, dirtyFormatStr, String(dirtyDate));
      }
      if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken2(substring)) {
        throwProtectedError2(substring, dirtyFormatStr, String(dirtyDate));
      }
      return formatter(utcDate, substring, locale7.localize, formatterOptions);
    }
    if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
    }
    return substring;
  }).join("");
  return result;
}
function cleanEscapedString2(input) {
  var matched = input.match(escapedStringRegExp2);
  if (!matched) {
    return input;
  }
  return matched[1].replace(doubleQuoteRegExp2, "'");
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/assign/index.js
function assign2(target, object) {
  if (target == null) {
    throw new TypeError("assign requires that input parameter not be null or undefined");
  }
  for (var property in object) {
    if (Object.prototype.hasOwnProperty.call(object, property)) {
      ;
      target[property] = object[property];
    }
  }
  return target;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/cloneObject/index.js
function cloneObject(object) {
  return assign2({}, object);
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/formatDistance/index.js
var MINUTES_IN_DAY = 1440;
var MINUTES_IN_ALMOST_TWO_DAYS = 2520;
var MINUTES_IN_MONTH = 43200;
var MINUTES_IN_TWO_MONTHS = 86400;
function formatDistance11(dirtyDate, dirtyBaseDate, options) {
  var _ref, _options$locale;
  requiredArgs2(2, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var locale7 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions3.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default2;
  if (!locale7.formatDistance) {
    throw new RangeError("locale must contain formatDistance property");
  }
  var comparison = compareAsc2(dirtyDate, dirtyBaseDate);
  if (isNaN(comparison)) {
    throw new RangeError("Invalid time value");
  }
  var localizeOptions = assign2(cloneObject(options), {
    addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
    comparison
  });
  var dateLeft;
  var dateRight;
  if (comparison > 0) {
    dateLeft = toDate2(dirtyBaseDate);
    dateRight = toDate2(dirtyDate);
  } else {
    dateLeft = toDate2(dirtyDate);
    dateRight = toDate2(dirtyBaseDate);
  }
  var seconds = differenceInSeconds2(dateRight, dateLeft);
  var offsetInSeconds = (getTimezoneOffsetInMilliseconds2(dateRight) - getTimezoneOffsetInMilliseconds2(dateLeft)) / 1e3;
  var minutes = Math.round((seconds - offsetInSeconds) / 60);
  var months;
  if (minutes < 2) {
    if (options !== null && options !== void 0 && options.includeSeconds) {
      if (seconds < 5) {
        return locale7.formatDistance("lessThanXSeconds", 5, localizeOptions);
      } else if (seconds < 10) {
        return locale7.formatDistance("lessThanXSeconds", 10, localizeOptions);
      } else if (seconds < 20) {
        return locale7.formatDistance("lessThanXSeconds", 20, localizeOptions);
      } else if (seconds < 40) {
        return locale7.formatDistance("halfAMinute", 0, localizeOptions);
      } else if (seconds < 60) {
        return locale7.formatDistance("lessThanXMinutes", 1, localizeOptions);
      } else {
        return locale7.formatDistance("xMinutes", 1, localizeOptions);
      }
    } else {
      if (minutes === 0) {
        return locale7.formatDistance("lessThanXMinutes", 1, localizeOptions);
      } else {
        return locale7.formatDistance("xMinutes", minutes, localizeOptions);
      }
    }
  } else if (minutes < 45) {
    return locale7.formatDistance("xMinutes", minutes, localizeOptions);
  } else if (minutes < 90) {
    return locale7.formatDistance("aboutXHours", 1, localizeOptions);
  } else if (minutes < MINUTES_IN_DAY) {
    var hours = Math.round(minutes / 60);
    return locale7.formatDistance("aboutXHours", hours, localizeOptions);
  } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {
    return locale7.formatDistance("xDays", 1, localizeOptions);
  } else if (minutes < MINUTES_IN_MONTH) {
    var days = Math.round(minutes / MINUTES_IN_DAY);
    return locale7.formatDistance("xDays", days, localizeOptions);
  } else if (minutes < MINUTES_IN_TWO_MONTHS) {
    months = Math.round(minutes / MINUTES_IN_MONTH);
    return locale7.formatDistance("aboutXMonths", months, localizeOptions);
  }
  months = differenceInMonths2(dateRight, dateLeft);
  if (months < 12) {
    var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);
    return locale7.formatDistance("xMonths", nearestMonth, localizeOptions);
  } else {
    var monthsSinceStartOfYear = months % 12;
    var years = Math.floor(months / 12);
    if (monthsSinceStartOfYear < 3) {
      return locale7.formatDistance("aboutXYears", years, localizeOptions);
    } else if (monthsSinceStartOfYear < 9) {
      return locale7.formatDistance("overXYears", years, localizeOptions);
    } else {
      return locale7.formatDistance("almostXYears", years + 1, localizeOptions);
    }
  }
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/formatDuration/index.js
var defaultFormat2 = ["years", "months", "weeks", "days", "hours", "minutes", "seconds"];
function formatDuration2(duration, options) {
  var _ref, _options$locale, _options$format, _options$zero, _options$delimiter;
  if (arguments.length < 1) {
    throw new TypeError("1 argument required, but only ".concat(arguments.length, " present"));
  }
  var defaultOptions3 = getDefaultOptions2();
  var locale7 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions3.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default2;
  var format3 = (_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : defaultFormat2;
  var zero = (_options$zero = options === null || options === void 0 ? void 0 : options.zero) !== null && _options$zero !== void 0 ? _options$zero : false;
  var delimiter2 = (_options$delimiter = options === null || options === void 0 ? void 0 : options.delimiter) !== null && _options$delimiter !== void 0 ? _options$delimiter : " ";
  if (!locale7.formatDistance) {
    return "";
  }
  var result = format3.reduce(function(acc, unit) {
    var token = "x".concat(unit.replace(/(^.)/, function(m6) {
      return m6.toUpperCase();
    }));
    var value = duration[unit];
    if (typeof value === "number" && (zero || duration[unit])) {
      return acc.concat(locale7.formatDistance(token, value));
    }
    return acc;
  }, []).join(delimiter2);
  return result;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/intervalToDuration/index.js
function intervalToDuration2(interval) {
  requiredArgs2(1, arguments);
  var start = toDate2(interval.start);
  var end = toDate2(interval.end);
  if (isNaN(start.getTime()))
    throw new RangeError("Start Date is invalid");
  if (isNaN(end.getTime()))
    throw new RangeError("End Date is invalid");
  var duration = {};
  duration.years = Math.abs(differenceInYears2(end, start));
  var sign3 = compareAsc2(end, start);
  var remainingMonths = add3(start, {
    years: sign3 * duration.years
  });
  duration.months = Math.abs(differenceInMonths2(end, remainingMonths));
  var remainingDays = add3(remainingMonths, {
    months: sign3 * duration.months
  });
  duration.days = Math.abs(differenceInDays2(end, remainingDays));
  var remainingHours = add3(remainingDays, {
    days: sign3 * duration.days
  });
  duration.hours = Math.abs(differenceInHours2(end, remainingHours));
  var remainingMinutes = add3(remainingHours, {
    hours: sign3 * duration.hours
  });
  duration.minutes = Math.abs(differenceInMinutes2(end, remainingMinutes));
  var remainingSeconds = add3(remainingMinutes, {
    minutes: sign3 * duration.minutes
  });
  duration.seconds = Math.abs(differenceInSeconds2(end, remainingSeconds));
  return duration;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/isFuture/index.js
function isFuture(dirtyDate) {
  requiredArgs2(1, arguments);
  return toDate2(dirtyDate).getTime() > Date.now();
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/Setter.js
function _typeof39(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof39 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof39 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof39(obj);
}
function _inherits33(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf33(subClass, superClass);
}
function _setPrototypeOf33(o3, p4) {
  _setPrototypeOf33 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf33(o3, p4);
}
function _createSuper33(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct33();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf33(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf33(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn33(this, result);
  };
}
function _possibleConstructorReturn33(self2, call) {
  if (call && (_typeof39(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized33(self2);
}
function _assertThisInitialized33(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct33() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf33(o3) {
  _getPrototypeOf33 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf33(o3);
}
function _classCallCheck34(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties34(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass34(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties34(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties34(Constructor, staticProps);
  return Constructor;
}
function _defineProperty33(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var TIMEZONE_UNIT_PRIORITY = 10;
var Setter2 = /* @__PURE__ */ function() {
  function Setter3() {
    _classCallCheck34(this, Setter3);
    _defineProperty33(this, "subPriority", 0);
  }
  _createClass34(Setter3, [{
    key: "validate",
    value: function validate(_utcDate, _options) {
      return true;
    }
  }]);
  return Setter3;
}();
var ValueSetter2 = /* @__PURE__ */ function(_Setter) {
  _inherits33(ValueSetter3, _Setter);
  var _super = _createSuper33(ValueSetter3);
  function ValueSetter3(value, validateValue, setValue, priority, subPriority) {
    var _this;
    _classCallCheck34(this, ValueSetter3);
    _this = _super.call(this);
    _this.value = value;
    _this.validateValue = validateValue;
    _this.setValue = setValue;
    _this.priority = priority;
    if (subPriority) {
      _this.subPriority = subPriority;
    }
    return _this;
  }
  _createClass34(ValueSetter3, [{
    key: "validate",
    value: function validate(utcDate, options) {
      return this.validateValue(utcDate, this.value, options);
    }
  }, {
    key: "set",
    value: function set2(utcDate, flags, options) {
      return this.setValue(utcDate, flags, this.value, options);
    }
  }]);
  return ValueSetter3;
}(Setter2);
var DateToSystemTimezoneSetter = /* @__PURE__ */ function(_Setter2) {
  _inherits33(DateToSystemTimezoneSetter2, _Setter2);
  var _super2 = _createSuper33(DateToSystemTimezoneSetter2);
  function DateToSystemTimezoneSetter2() {
    var _this2;
    _classCallCheck34(this, DateToSystemTimezoneSetter2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this2 = _super2.call.apply(_super2, [this].concat(args));
    _defineProperty33(_assertThisInitialized33(_this2), "priority", TIMEZONE_UNIT_PRIORITY);
    _defineProperty33(_assertThisInitialized33(_this2), "subPriority", -1);
    return _this2;
  }
  _createClass34(DateToSystemTimezoneSetter2, [{
    key: "set",
    value: function set2(date, flags) {
      if (flags.timestampIsSet) {
        return date;
      }
      var convertedDate = /* @__PURE__ */ new Date(0);
      convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
      convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
      return convertedDate;
    }
  }]);
  return DateToSystemTimezoneSetter2;
}(Setter2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/Parser.js
function _classCallCheck35(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties35(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass35(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties35(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties35(Constructor, staticProps);
  return Constructor;
}
var Parser2 = /* @__PURE__ */ function() {
  function Parser3() {
    _classCallCheck35(this, Parser3);
  }
  _createClass35(Parser3, [{
    key: "run",
    value: function run(dateString, token, match6, options) {
      var result = this.parse(dateString, token, match6, options);
      if (!result) {
        return null;
      }
      return {
        setter: new ValueSetter2(result.value, this.validate, this.set, this.priority, this.subPriority),
        rest: result.rest
      };
    }
  }, {
    key: "validate",
    value: function validate(_utcDate, _value, _options) {
      return true;
    }
  }]);
  return Parser3;
}();

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js
function _typeof40(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof40 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof40 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof40(obj);
}
function _classCallCheck36(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties36(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass36(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties36(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties36(Constructor, staticProps);
  return Constructor;
}
function _inherits34(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf34(subClass, superClass);
}
function _setPrototypeOf34(o3, p4) {
  _setPrototypeOf34 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf34(o3, p4);
}
function _createSuper34(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct34();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf34(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf34(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn34(this, result);
  };
}
function _possibleConstructorReturn34(self2, call) {
  if (call && (_typeof40(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized34(self2);
}
function _assertThisInitialized34(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct34() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf34(o3) {
  _getPrototypeOf34 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf34(o3);
}
function _defineProperty34(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var EraParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits34(EraParser3, _Parser);
  var _super = _createSuper34(EraParser3);
  function EraParser3() {
    var _this;
    _classCallCheck36(this, EraParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty34(_assertThisInitialized34(_this), "priority", 140);
    _defineProperty34(_assertThisInitialized34(_this), "incompatibleTokens", ["R", "u", "t", "T"]);
    return _this;
  }
  _createClass36(EraParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "G":
        case "GG":
        case "GGG":
          return match6.era(dateString, {
            width: "abbreviated"
          }) || match6.era(dateString, {
            width: "narrow"
          });
        case "GGGGG":
          return match6.era(dateString, {
            width: "narrow"
          });
        case "GGGG":
        default:
          return match6.era(dateString, {
            width: "wide"
          }) || match6.era(dateString, {
            width: "abbreviated"
          }) || match6.era(dateString, {
            width: "narrow"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      flags.era = value;
      date.setUTCFullYear(value, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return EraParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/constants.js
var numericPatterns2 = {
  month: /^(1[0-2]|0?\d)/,
  // 0 to 12
  date: /^(3[0-1]|[0-2]?\d)/,
  // 0 to 31
  dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
  // 0 to 366
  week: /^(5[0-3]|[0-4]?\d)/,
  // 0 to 53
  hour23h: /^(2[0-3]|[0-1]?\d)/,
  // 0 to 23
  hour24h: /^(2[0-4]|[0-1]?\d)/,
  // 0 to 24
  hour11h: /^(1[0-1]|0?\d)/,
  // 0 to 11
  hour12h: /^(1[0-2]|0?\d)/,
  // 0 to 12
  minute: /^[0-5]?\d/,
  // 0 to 59
  second: /^[0-5]?\d/,
  // 0 to 59
  singleDigit: /^\d/,
  // 0 to 9
  twoDigits: /^\d{1,2}/,
  // 0 to 99
  threeDigits: /^\d{1,3}/,
  // 0 to 999
  fourDigits: /^\d{1,4}/,
  // 0 to 9999
  anyDigitsSigned: /^-?\d+/,
  singleDigitSigned: /^-?\d/,
  // 0 to 9, -0 to -9
  twoDigitsSigned: /^-?\d{1,2}/,
  // 0 to 99, -0 to -99
  threeDigitsSigned: /^-?\d{1,3}/,
  // 0 to 999, -0 to -999
  fourDigitsSigned: /^-?\d{1,4}/
  // 0 to 9999, -0 to -9999
};
var timezonePatterns2 = {
  basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
  basic: /^([+-])(\d{2})(\d{2})|Z/,
  basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
  extended: /^([+-])(\d{2}):(\d{2})|Z/,
  extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/utils.js
function mapValue2(parseFnResult, mapFn) {
  if (!parseFnResult) {
    return parseFnResult;
  }
  return {
    value: mapFn(parseFnResult.value),
    rest: parseFnResult.rest
  };
}
function parseNumericPattern2(pattern, dateString) {
  var matchResult = dateString.match(pattern);
  if (!matchResult) {
    return null;
  }
  return {
    value: parseInt(matchResult[0], 10),
    rest: dateString.slice(matchResult[0].length)
  };
}
function parseTimezonePattern2(pattern, dateString) {
  var matchResult = dateString.match(pattern);
  if (!matchResult) {
    return null;
  }
  if (matchResult[0] === "Z") {
    return {
      value: 0,
      rest: dateString.slice(1)
    };
  }
  var sign3 = matchResult[1] === "+" ? 1 : -1;
  var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
  var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
  var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
  return {
    value: sign3 * (hours * millisecondsInHour2 + minutes * millisecondsInMinute2 + seconds * millisecondsInSecond2),
    rest: dateString.slice(matchResult[0].length)
  };
}
function parseAnyDigitsSigned2(dateString) {
  return parseNumericPattern2(numericPatterns2.anyDigitsSigned, dateString);
}
function parseNDigits2(n2, dateString) {
  switch (n2) {
    case 1:
      return parseNumericPattern2(numericPatterns2.singleDigit, dateString);
    case 2:
      return parseNumericPattern2(numericPatterns2.twoDigits, dateString);
    case 3:
      return parseNumericPattern2(numericPatterns2.threeDigits, dateString);
    case 4:
      return parseNumericPattern2(numericPatterns2.fourDigits, dateString);
    default:
      return parseNumericPattern2(new RegExp("^\\d{1," + n2 + "}"), dateString);
  }
}
function parseNDigitsSigned2(n2, dateString) {
  switch (n2) {
    case 1:
      return parseNumericPattern2(numericPatterns2.singleDigitSigned, dateString);
    case 2:
      return parseNumericPattern2(numericPatterns2.twoDigitsSigned, dateString);
    case 3:
      return parseNumericPattern2(numericPatterns2.threeDigitsSigned, dateString);
    case 4:
      return parseNumericPattern2(numericPatterns2.fourDigitsSigned, dateString);
    default:
      return parseNumericPattern2(new RegExp("^-?\\d{1," + n2 + "}"), dateString);
  }
}
function dayPeriodEnumToHours2(dayPeriod) {
  switch (dayPeriod) {
    case "morning":
      return 4;
    case "evening":
      return 17;
    case "pm":
    case "noon":
    case "afternoon":
      return 12;
    case "am":
    case "midnight":
    case "night":
    default:
      return 0;
  }
}
function normalizeTwoDigitYear2(twoDigitYear, currentYear) {
  var isCommonEra = currentYear > 0;
  var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
  var result;
  if (absCurrentYear <= 50) {
    result = twoDigitYear || 100;
  } else {
    var rangeEnd = absCurrentYear + 50;
    var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
    var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
    result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
  }
  return isCommonEra ? result : 1 - result;
}
function isLeapYearIndex2(year) {
  return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js
function _typeof41(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof41 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof41 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof41(obj);
}
function _classCallCheck37(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties37(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass37(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties37(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties37(Constructor, staticProps);
  return Constructor;
}
function _inherits35(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf35(subClass, superClass);
}
function _setPrototypeOf35(o3, p4) {
  _setPrototypeOf35 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf35(o3, p4);
}
function _createSuper35(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct35();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf35(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf35(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn35(this, result);
  };
}
function _possibleConstructorReturn35(self2, call) {
  if (call && (_typeof41(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized35(self2);
}
function _assertThisInitialized35(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct35() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf35(o3) {
  _getPrototypeOf35 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf35(o3);
}
function _defineProperty35(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var YearParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits35(YearParser3, _Parser);
  var _super = _createSuper35(YearParser3);
  function YearParser3() {
    var _this;
    _classCallCheck37(this, YearParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty35(_assertThisInitialized35(_this), "priority", 130);
    _defineProperty35(_assertThisInitialized35(_this), "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass37(YearParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      var valueCallback11 = function valueCallback12(year) {
        return {
          year,
          isTwoDigitYear: token === "yy"
        };
      };
      switch (token) {
        case "y":
          return mapValue2(parseNDigits2(4, dateString), valueCallback11);
        case "yo":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "year"
          }), valueCallback11);
        default:
          return mapValue2(parseNDigits2(token.length, dateString), valueCallback11);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      var currentYear = date.getUTCFullYear();
      if (value.isTwoDigitYear) {
        var normalizedTwoDigitYear = normalizeTwoDigitYear2(value.year, currentYear);
        date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
        date.setUTCHours(0, 0, 0, 0);
        return date;
      }
      var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setUTCFullYear(year, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return YearParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js
function _typeof42(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof42 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof42 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof42(obj);
}
function _classCallCheck38(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties38(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass38(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties38(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties38(Constructor, staticProps);
  return Constructor;
}
function _inherits36(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf36(subClass, superClass);
}
function _setPrototypeOf36(o3, p4) {
  _setPrototypeOf36 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf36(o3, p4);
}
function _createSuper36(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct36();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf36(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf36(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn36(this, result);
  };
}
function _possibleConstructorReturn36(self2, call) {
  if (call && (_typeof42(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized36(self2);
}
function _assertThisInitialized36(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct36() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf36(o3) {
  _getPrototypeOf36 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf36(o3);
}
function _defineProperty36(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalWeekYearParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits36(LocalWeekYearParser3, _Parser);
  var _super = _createSuper36(LocalWeekYearParser3);
  function LocalWeekYearParser3() {
    var _this;
    _classCallCheck38(this, LocalWeekYearParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty36(_assertThisInitialized36(_this), "priority", 130);
    _defineProperty36(_assertThisInitialized36(_this), "incompatibleTokens", ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]);
    return _this;
  }
  _createClass38(LocalWeekYearParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      var valueCallback11 = function valueCallback12(year) {
        return {
          year,
          isTwoDigitYear: token === "YY"
        };
      };
      switch (token) {
        case "Y":
          return mapValue2(parseNDigits2(4, dateString), valueCallback11);
        case "Yo":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "year"
          }), valueCallback11);
        default:
          return mapValue2(parseNDigits2(token.length, dateString), valueCallback11);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value.isTwoDigitYear || value.year > 0;
    }
  }, {
    key: "set",
    value: function set2(date, flags, value, options) {
      var currentYear = getUTCWeekYear2(date, options);
      if (value.isTwoDigitYear) {
        var normalizedTwoDigitYear = normalizeTwoDigitYear2(value.year, currentYear);
        date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
        date.setUTCHours(0, 0, 0, 0);
        return startOfUTCWeek2(date, options);
      }
      var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
      date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
      date.setUTCHours(0, 0, 0, 0);
      return startOfUTCWeek2(date, options);
    }
  }]);
  return LocalWeekYearParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js
function _typeof43(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof43 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof43 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof43(obj);
}
function _classCallCheck39(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties39(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass39(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties39(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties39(Constructor, staticProps);
  return Constructor;
}
function _inherits37(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf37(subClass, superClass);
}
function _setPrototypeOf37(o3, p4) {
  _setPrototypeOf37 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf37(o3, p4);
}
function _createSuper37(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct37();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf37(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf37(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn37(this, result);
  };
}
function _possibleConstructorReturn37(self2, call) {
  if (call && (_typeof43(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized37(self2);
}
function _assertThisInitialized37(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct37() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf37(o3) {
  _getPrototypeOf37 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf37(o3);
}
function _defineProperty37(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOWeekYearParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits37(ISOWeekYearParser3, _Parser);
  var _super = _createSuper37(ISOWeekYearParser3);
  function ISOWeekYearParser3() {
    var _this;
    _classCallCheck39(this, ISOWeekYearParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty37(_assertThisInitialized37(_this), "priority", 130);
    _defineProperty37(_assertThisInitialized37(_this), "incompatibleTokens", ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass39(ISOWeekYearParser3, [{
    key: "parse",
    value: function parse3(dateString, token) {
      if (token === "R") {
        return parseNDigitsSigned2(4, dateString);
      }
      return parseNDigitsSigned2(token.length, dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      var firstWeekOfYear = /* @__PURE__ */ new Date(0);
      firstWeekOfYear.setUTCFullYear(value, 0, 4);
      firstWeekOfYear.setUTCHours(0, 0, 0, 0);
      return startOfUTCISOWeek2(firstWeekOfYear);
    }
  }]);
  return ISOWeekYearParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js
function _typeof44(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof44 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof44 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof44(obj);
}
function _classCallCheck40(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties40(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass40(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties40(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties40(Constructor, staticProps);
  return Constructor;
}
function _inherits38(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf38(subClass, superClass);
}
function _setPrototypeOf38(o3, p4) {
  _setPrototypeOf38 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf38(o3, p4);
}
function _createSuper38(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct38();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf38(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf38(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn38(this, result);
  };
}
function _possibleConstructorReturn38(self2, call) {
  if (call && (_typeof44(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized38(self2);
}
function _assertThisInitialized38(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct38() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf38(o3) {
  _getPrototypeOf38 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf38(o3);
}
function _defineProperty38(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ExtendedYearParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits38(ExtendedYearParser3, _Parser);
  var _super = _createSuper38(ExtendedYearParser3);
  function ExtendedYearParser3() {
    var _this;
    _classCallCheck40(this, ExtendedYearParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty38(_assertThisInitialized38(_this), "priority", 130);
    _defineProperty38(_assertThisInitialized38(_this), "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass40(ExtendedYearParser3, [{
    key: "parse",
    value: function parse3(dateString, token) {
      if (token === "u") {
        return parseNDigitsSigned2(4, dateString);
      }
      return parseNDigitsSigned2(token.length, dateString);
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCFullYear(value, 0, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return ExtendedYearParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js
function _typeof45(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof45 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof45 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof45(obj);
}
function _classCallCheck41(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties41(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass41(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties41(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties41(Constructor, staticProps);
  return Constructor;
}
function _inherits39(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf39(subClass, superClass);
}
function _setPrototypeOf39(o3, p4) {
  _setPrototypeOf39 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf39(o3, p4);
}
function _createSuper39(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct39();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf39(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf39(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn39(this, result);
  };
}
function _possibleConstructorReturn39(self2, call) {
  if (call && (_typeof45(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized39(self2);
}
function _assertThisInitialized39(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct39() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf39(o3) {
  _getPrototypeOf39 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf39(o3);
}
function _defineProperty39(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var QuarterParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits39(QuarterParser3, _Parser);
  var _super = _createSuper39(QuarterParser3);
  function QuarterParser3() {
    var _this;
    _classCallCheck41(this, QuarterParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty39(_assertThisInitialized39(_this), "priority", 120);
    _defineProperty39(_assertThisInitialized39(_this), "incompatibleTokens", ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass41(QuarterParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "Q":
        case "QQ":
          return parseNDigits2(token.length, dateString);
        case "Qo":
          return match6.ordinalNumber(dateString, {
            unit: "quarter"
          });
        case "QQQ":
          return match6.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "QQQQQ":
          return match6.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "QQQQ":
        default:
          return match6.quarter(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.quarter(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.quarter(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 4;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth((value - 1) * 3, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return QuarterParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js
function _typeof46(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof46 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof46 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof46(obj);
}
function _classCallCheck42(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties42(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass42(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties42(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties42(Constructor, staticProps);
  return Constructor;
}
function _inherits40(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf40(subClass, superClass);
}
function _setPrototypeOf40(o3, p4) {
  _setPrototypeOf40 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf40(o3, p4);
}
function _createSuper40(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct40();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf40(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf40(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn40(this, result);
  };
}
function _possibleConstructorReturn40(self2, call) {
  if (call && (_typeof46(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized40(self2);
}
function _assertThisInitialized40(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct40() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf40(o3) {
  _getPrototypeOf40 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf40(o3);
}
function _defineProperty40(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneQuarterParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits40(StandAloneQuarterParser3, _Parser);
  var _super = _createSuper40(StandAloneQuarterParser3);
  function StandAloneQuarterParser3() {
    var _this;
    _classCallCheck42(this, StandAloneQuarterParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty40(_assertThisInitialized40(_this), "priority", 120);
    _defineProperty40(_assertThisInitialized40(_this), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass42(StandAloneQuarterParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "q":
        case "qq":
          return parseNDigits2(token.length, dateString);
        case "qo":
          return match6.ordinalNumber(dateString, {
            unit: "quarter"
          });
        case "qqq":
          return match6.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "qqqqq":
          return match6.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "qqqq":
        default:
          return match6.quarter(dateString, {
            width: "wide",
            context: "standalone"
          }) || match6.quarter(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.quarter(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 4;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth((value - 1) * 3, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneQuarterParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js
function _typeof47(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof47 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof47 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof47(obj);
}
function _classCallCheck43(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties43(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass43(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties43(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties43(Constructor, staticProps);
  return Constructor;
}
function _inherits41(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf41(subClass, superClass);
}
function _setPrototypeOf41(o3, p4) {
  _setPrototypeOf41 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf41(o3, p4);
}
function _createSuper41(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct41();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf41(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf41(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn41(this, result);
  };
}
function _possibleConstructorReturn41(self2, call) {
  if (call && (_typeof47(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized41(self2);
}
function _assertThisInitialized41(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct41() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf41(o3) {
  _getPrototypeOf41 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf41(o3);
}
function _defineProperty41(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var MonthParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits41(MonthParser3, _Parser);
  var _super = _createSuper41(MonthParser3);
  function MonthParser3() {
    var _this;
    _classCallCheck43(this, MonthParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty41(_assertThisInitialized41(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]);
    _defineProperty41(_assertThisInitialized41(_this), "priority", 110);
    return _this;
  }
  _createClass43(MonthParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      var valueCallback11 = function valueCallback12(value) {
        return value - 1;
      };
      switch (token) {
        case "M":
          return mapValue2(parseNumericPattern2(numericPatterns2.month, dateString), valueCallback11);
        case "MM":
          return mapValue2(parseNDigits2(2, dateString), valueCallback11);
        case "Mo":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "month"
          }), valueCallback11);
        case "MMM":
          return match6.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "MMMMM":
          return match6.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "MMMM":
        default:
          return match6.month(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.month(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.month(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(value, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return MonthParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js
function _typeof48(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof48 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof48 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof48(obj);
}
function _classCallCheck44(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties44(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass44(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties44(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties44(Constructor, staticProps);
  return Constructor;
}
function _inherits42(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf42(subClass, superClass);
}
function _setPrototypeOf42(o3, p4) {
  _setPrototypeOf42 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf42(o3, p4);
}
function _createSuper42(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct42();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf42(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf42(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn42(this, result);
  };
}
function _possibleConstructorReturn42(self2, call) {
  if (call && (_typeof48(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized42(self2);
}
function _assertThisInitialized42(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct42() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf42(o3) {
  _getPrototypeOf42 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf42(o3);
}
function _defineProperty42(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneMonthParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits42(StandAloneMonthParser3, _Parser);
  var _super = _createSuper42(StandAloneMonthParser3);
  function StandAloneMonthParser3() {
    var _this;
    _classCallCheck44(this, StandAloneMonthParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty42(_assertThisInitialized42(_this), "priority", 110);
    _defineProperty42(_assertThisInitialized42(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass44(StandAloneMonthParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      var valueCallback11 = function valueCallback12(value) {
        return value - 1;
      };
      switch (token) {
        case "L":
          return mapValue2(parseNumericPattern2(numericPatterns2.month, dateString), valueCallback11);
        case "LL":
          return mapValue2(parseNDigits2(2, dateString), valueCallback11);
        case "Lo":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "month"
          }), valueCallback11);
        case "LLL":
          return match6.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "LLLLL":
          return match6.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "LLLL":
        default:
          return match6.month(dateString, {
            width: "wide",
            context: "standalone"
          }) || match6.month(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.month(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(value, 1);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneMonthParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/setUTCWeek/index.js
function setUTCWeek2(dirtyDate, dirtyWeek, options) {
  requiredArgs2(2, arguments);
  var date = toDate2(dirtyDate);
  var week = toInteger2(dirtyWeek);
  var diff = getUTCWeek2(date, options) - week;
  date.setUTCDate(date.getUTCDate() - diff * 7);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js
function _typeof49(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof49 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof49 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof49(obj);
}
function _classCallCheck45(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties45(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass45(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties45(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties45(Constructor, staticProps);
  return Constructor;
}
function _inherits43(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf43(subClass, superClass);
}
function _setPrototypeOf43(o3, p4) {
  _setPrototypeOf43 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf43(o3, p4);
}
function _createSuper43(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct43();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf43(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf43(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn43(this, result);
  };
}
function _possibleConstructorReturn43(self2, call) {
  if (call && (_typeof49(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized43(self2);
}
function _assertThisInitialized43(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct43() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf43(o3) {
  _getPrototypeOf43 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf43(o3);
}
function _defineProperty43(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalWeekParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits43(LocalWeekParser3, _Parser);
  var _super = _createSuper43(LocalWeekParser3);
  function LocalWeekParser3() {
    var _this;
    _classCallCheck45(this, LocalWeekParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty43(_assertThisInitialized43(_this), "priority", 100);
    _defineProperty43(_assertThisInitialized43(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]);
    return _this;
  }
  _createClass45(LocalWeekParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "w":
          return parseNumericPattern2(numericPatterns2.week, dateString);
        case "wo":
          return match6.ordinalNumber(dateString, {
            unit: "week"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 53;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      return startOfUTCWeek2(setUTCWeek2(date, value, options), options);
    }
  }]);
  return LocalWeekParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js
function setUTCISOWeek2(dirtyDate, dirtyISOWeek) {
  requiredArgs2(2, arguments);
  var date = toDate2(dirtyDate);
  var isoWeek = toInteger2(dirtyISOWeek);
  var diff = getUTCISOWeek2(date) - isoWeek;
  date.setUTCDate(date.getUTCDate() - diff * 7);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js
function _typeof50(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof50 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof50 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof50(obj);
}
function _classCallCheck46(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties46(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass46(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties46(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties46(Constructor, staticProps);
  return Constructor;
}
function _inherits44(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf44(subClass, superClass);
}
function _setPrototypeOf44(o3, p4) {
  _setPrototypeOf44 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf44(o3, p4);
}
function _createSuper44(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct44();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf44(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf44(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn44(this, result);
  };
}
function _possibleConstructorReturn44(self2, call) {
  if (call && (_typeof50(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized44(self2);
}
function _assertThisInitialized44(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct44() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf44(o3) {
  _getPrototypeOf44 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf44(o3);
}
function _defineProperty44(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOWeekParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits44(ISOWeekParser3, _Parser);
  var _super = _createSuper44(ISOWeekParser3);
  function ISOWeekParser3() {
    var _this;
    _classCallCheck46(this, ISOWeekParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty44(_assertThisInitialized44(_this), "priority", 100);
    _defineProperty44(_assertThisInitialized44(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass46(ISOWeekParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "I":
          return parseNumericPattern2(numericPatterns2.week, dateString);
        case "Io":
          return match6.ordinalNumber(dateString, {
            unit: "week"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 53;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      return startOfUTCISOWeek2(setUTCISOWeek2(date, value));
    }
  }]);
  return ISOWeekParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js
function _typeof51(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof51 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof51 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof51(obj);
}
function _classCallCheck47(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties47(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass47(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties47(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties47(Constructor, staticProps);
  return Constructor;
}
function _inherits45(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf45(subClass, superClass);
}
function _setPrototypeOf45(o3, p4) {
  _setPrototypeOf45 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf45(o3, p4);
}
function _createSuper45(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct45();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf45(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf45(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn45(this, result);
  };
}
function _possibleConstructorReturn45(self2, call) {
  if (call && (_typeof51(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized45(self2);
}
function _assertThisInitialized45(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct45() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf45(o3) {
  _getPrototypeOf45 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf45(o3);
}
function _defineProperty45(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DAYS_IN_MONTH2 = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var DAYS_IN_MONTH_LEAP_YEAR2 = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var DateParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits45(DateParser3, _Parser);
  var _super = _createSuper45(DateParser3);
  function DateParser3() {
    var _this;
    _classCallCheck47(this, DateParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty45(_assertThisInitialized45(_this), "priority", 90);
    _defineProperty45(_assertThisInitialized45(_this), "subPriority", 1);
    _defineProperty45(_assertThisInitialized45(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass47(DateParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "d":
          return parseNumericPattern2(numericPatterns2.date, dateString);
        case "do":
          return match6.ordinalNumber(dateString, {
            unit: "date"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(date, value) {
      var year = date.getUTCFullYear();
      var isLeapYear = isLeapYearIndex2(year);
      var month = date.getUTCMonth();
      if (isLeapYear) {
        return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR2[month];
      } else {
        return value >= 1 && value <= DAYS_IN_MONTH2[month];
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCDate(value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DateParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js
function _typeof52(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof52 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof52 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof52(obj);
}
function _classCallCheck48(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties48(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass48(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties48(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties48(Constructor, staticProps);
  return Constructor;
}
function _inherits46(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf46(subClass, superClass);
}
function _setPrototypeOf46(o3, p4) {
  _setPrototypeOf46 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf46(o3, p4);
}
function _createSuper46(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct46();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf46(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf46(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn46(this, result);
  };
}
function _possibleConstructorReturn46(self2, call) {
  if (call && (_typeof52(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized46(self2);
}
function _assertThisInitialized46(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct46() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf46(o3) {
  _getPrototypeOf46 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf46(o3);
}
function _defineProperty46(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayOfYearParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits46(DayOfYearParser3, _Parser);
  var _super = _createSuper46(DayOfYearParser3);
  function DayOfYearParser3() {
    var _this;
    _classCallCheck48(this, DayOfYearParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty46(_assertThisInitialized46(_this), "priority", 90);
    _defineProperty46(_assertThisInitialized46(_this), "subpriority", 1);
    _defineProperty46(_assertThisInitialized46(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass48(DayOfYearParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "D":
        case "DD":
          return parseNumericPattern2(numericPatterns2.dayOfYear, dateString);
        case "Do":
          return match6.ordinalNumber(dateString, {
            unit: "date"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(date, value) {
      var year = date.getUTCFullYear();
      var isLeapYear = isLeapYearIndex2(year);
      if (isLeapYear) {
        return value >= 1 && value <= 366;
      } else {
        return value >= 1 && value <= 365;
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMonth(0, value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DayOfYearParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/setUTCDay/index.js
function setUTCDay2(dirtyDate, dirtyDay, options) {
  var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
  requiredArgs2(2, arguments);
  var defaultOptions3 = getDefaultOptions2();
  var weekStartsOn = toInteger2((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions3.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  var date = toDate2(dirtyDate);
  var day = toInteger2(dirtyDay);
  var currentDay = date.getUTCDay();
  var remainder = day % 7;
  var dayIndex = (remainder + 7) % 7;
  var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
  date.setUTCDate(date.getUTCDate() + diff);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js
function _typeof53(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof53 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof53 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof53(obj);
}
function _classCallCheck49(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties49(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass49(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties49(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties49(Constructor, staticProps);
  return Constructor;
}
function _inherits47(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf47(subClass, superClass);
}
function _setPrototypeOf47(o3, p4) {
  _setPrototypeOf47 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf47(o3, p4);
}
function _createSuper47(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct47();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf47(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf47(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn47(this, result);
  };
}
function _possibleConstructorReturn47(self2, call) {
  if (call && (_typeof53(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized47(self2);
}
function _assertThisInitialized47(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct47() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf47(o3) {
  _getPrototypeOf47 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf47(o3);
}
function _defineProperty47(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits47(DayParser3, _Parser);
  var _super = _createSuper47(DayParser3);
  function DayParser3() {
    var _this;
    _classCallCheck49(this, DayParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty47(_assertThisInitialized47(_this), "priority", 90);
    _defineProperty47(_assertThisInitialized47(_this), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass49(DayParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "E":
        case "EE":
        case "EEE":
          return match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEEE":
          return match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEEEE":
          return match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "EEEE":
        default:
          return match6.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay2(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return DayParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js
function _typeof54(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof54 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof54 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof54(obj);
}
function _classCallCheck50(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties50(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass50(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties50(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties50(Constructor, staticProps);
  return Constructor;
}
function _inherits48(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf48(subClass, superClass);
}
function _setPrototypeOf48(o3, p4) {
  _setPrototypeOf48 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf48(o3, p4);
}
function _createSuper48(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct48();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf48(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf48(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn48(this, result);
  };
}
function _possibleConstructorReturn48(self2, call) {
  if (call && (_typeof54(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized48(self2);
}
function _assertThisInitialized48(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct48() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf48(o3) {
  _getPrototypeOf48 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf48(o3);
}
function _defineProperty48(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var LocalDayParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits48(LocalDayParser3, _Parser);
  var _super = _createSuper48(LocalDayParser3);
  function LocalDayParser3() {
    var _this;
    _classCallCheck50(this, LocalDayParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty48(_assertThisInitialized48(_this), "priority", 90);
    _defineProperty48(_assertThisInitialized48(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]);
    return _this;
  }
  _createClass50(LocalDayParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6, options) {
      var valueCallback11 = function valueCallback12(value) {
        var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        case "e":
        case "ee":
          return mapValue2(parseNDigits2(token.length, dateString), valueCallback11);
        case "eo":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "day"
          }), valueCallback11);
        case "eee":
          return match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeeee":
          return match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeeeee":
          return match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "eeee":
        default:
          return match6.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay2(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return LocalDayParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js
function _typeof55(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof55 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof55 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof55(obj);
}
function _classCallCheck51(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties51(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass51(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties51(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties51(Constructor, staticProps);
  return Constructor;
}
function _inherits49(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf49(subClass, superClass);
}
function _setPrototypeOf49(o3, p4) {
  _setPrototypeOf49 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf49(o3, p4);
}
function _createSuper49(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct49();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf49(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf49(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn49(this, result);
  };
}
function _possibleConstructorReturn49(self2, call) {
  if (call && (_typeof55(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized49(self2);
}
function _assertThisInitialized49(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct49() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf49(o3) {
  _getPrototypeOf49 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf49(o3);
}
function _defineProperty49(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var StandAloneLocalDayParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits49(StandAloneLocalDayParser3, _Parser);
  var _super = _createSuper49(StandAloneLocalDayParser3);
  function StandAloneLocalDayParser3() {
    var _this;
    _classCallCheck51(this, StandAloneLocalDayParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty49(_assertThisInitialized49(_this), "priority", 90);
    _defineProperty49(_assertThisInitialized49(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]);
    return _this;
  }
  _createClass51(StandAloneLocalDayParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6, options) {
      var valueCallback11 = function valueCallback12(value) {
        var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
        return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
      };
      switch (token) {
        case "c":
        case "cc":
          return mapValue2(parseNDigits2(token.length, dateString), valueCallback11);
        case "co":
          return mapValue2(match6.ordinalNumber(dateString, {
            unit: "day"
          }), valueCallback11);
        case "ccc":
          return match6.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "ccccc":
          return match6.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "cccccc":
          return match6.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
        case "cccc":
        default:
          return match6.day(dateString, {
            width: "wide",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "abbreviated",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "short",
            context: "standalone"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "standalone"
          });
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 6;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value, options) {
      date = setUTCDay2(date, value, options);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return StandAloneLocalDayParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/_lib/setUTCISODay/index.js
function setUTCISODay2(dirtyDate, dirtyDay) {
  requiredArgs2(2, arguments);
  var day = toInteger2(dirtyDay);
  if (day % 7 === 0) {
    day = day - 7;
  }
  var weekStartsOn = 1;
  var date = toDate2(dirtyDate);
  var currentDay = date.getUTCDay();
  var remainder = day % 7;
  var dayIndex = (remainder + 7) % 7;
  var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
  date.setUTCDate(date.getUTCDate() + diff);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js
function _typeof56(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof56 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof56 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof56(obj);
}
function _classCallCheck52(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties52(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass52(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties52(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties52(Constructor, staticProps);
  return Constructor;
}
function _inherits50(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf50(subClass, superClass);
}
function _setPrototypeOf50(o3, p4) {
  _setPrototypeOf50 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf50(o3, p4);
}
function _createSuper50(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct50();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf50(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf50(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn50(this, result);
  };
}
function _possibleConstructorReturn50(self2, call) {
  if (call && (_typeof56(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized50(self2);
}
function _assertThisInitialized50(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct50() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf50(o3) {
  _getPrototypeOf50 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf50(o3);
}
function _defineProperty50(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISODayParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits50(ISODayParser3, _Parser);
  var _super = _createSuper50(ISODayParser3);
  function ISODayParser3() {
    var _this;
    _classCallCheck52(this, ISODayParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty50(_assertThisInitialized50(_this), "priority", 90);
    _defineProperty50(_assertThisInitialized50(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]);
    return _this;
  }
  _createClass52(ISODayParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      var valueCallback11 = function valueCallback12(value) {
        if (value === 0) {
          return 7;
        }
        return value;
      };
      switch (token) {
        case "i":
        case "ii":
          return parseNDigits2(token.length, dateString);
        case "io":
          return match6.ordinalNumber(dateString, {
            unit: "day"
          });
        case "iii":
          return mapValue2(match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback11);
        case "iiiii":
          return mapValue2(match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback11);
        case "iiiiii":
          return mapValue2(match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback11);
        case "iiii":
        default:
          return mapValue2(match6.day(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "short",
            context: "formatting"
          }) || match6.day(dateString, {
            width: "narrow",
            context: "formatting"
          }), valueCallback11);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 7;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date = setUTCISODay2(date, value);
      date.setUTCHours(0, 0, 0, 0);
      return date;
    }
  }]);
  return ISODayParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js
function _typeof57(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof57 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof57 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof57(obj);
}
function _classCallCheck53(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties53(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass53(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties53(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties53(Constructor, staticProps);
  return Constructor;
}
function _inherits51(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf51(subClass, superClass);
}
function _setPrototypeOf51(o3, p4) {
  _setPrototypeOf51 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf51(o3, p4);
}
function _createSuper51(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct51();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf51(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf51(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn51(this, result);
  };
}
function _possibleConstructorReturn51(self2, call) {
  if (call && (_typeof57(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized51(self2);
}
function _assertThisInitialized51(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct51() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf51(o3) {
  _getPrototypeOf51 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf51(o3);
}
function _defineProperty51(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var AMPMParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits51(AMPMParser3, _Parser);
  var _super = _createSuper51(AMPMParser3);
  function AMPMParser3() {
    var _this;
    _classCallCheck53(this, AMPMParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty51(_assertThisInitialized51(_this), "priority", 80);
    _defineProperty51(_assertThisInitialized51(_this), "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass53(AMPMParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "a":
        case "aa":
        case "aaa":
          return match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaaa":
          return match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "aaaa":
        default:
          return match6.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours2(value), 0, 0, 0);
      return date;
    }
  }]);
  return AMPMParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js
function _typeof58(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof58 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof58 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof58(obj);
}
function _classCallCheck54(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties54(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass54(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties54(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties54(Constructor, staticProps);
  return Constructor;
}
function _inherits52(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf52(subClass, superClass);
}
function _setPrototypeOf52(o3, p4) {
  _setPrototypeOf52 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf52(o3, p4);
}
function _createSuper52(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct52();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf52(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf52(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn52(this, result);
  };
}
function _possibleConstructorReturn52(self2, call) {
  if (call && (_typeof58(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized52(self2);
}
function _assertThisInitialized52(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct52() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf52(o3) {
  _getPrototypeOf52 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf52(o3);
}
function _defineProperty52(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var AMPMMidnightParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits52(AMPMMidnightParser3, _Parser);
  var _super = _createSuper52(AMPMMidnightParser3);
  function AMPMMidnightParser3() {
    var _this;
    _classCallCheck54(this, AMPMMidnightParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty52(_assertThisInitialized52(_this), "priority", 80);
    _defineProperty52(_assertThisInitialized52(_this), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass54(AMPMMidnightParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "b":
        case "bb":
        case "bbb":
          return match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbbb":
          return match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbb":
        default:
          return match6.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours2(value), 0, 0, 0);
      return date;
    }
  }]);
  return AMPMMidnightParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js
function _typeof59(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof59 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof59 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof59(obj);
}
function _classCallCheck55(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties55(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass55(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties55(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties55(Constructor, staticProps);
  return Constructor;
}
function _inherits53(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf53(subClass, superClass);
}
function _setPrototypeOf53(o3, p4) {
  _setPrototypeOf53 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf53(o3, p4);
}
function _createSuper53(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct53();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf53(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf53(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn53(this, result);
  };
}
function _possibleConstructorReturn53(self2, call) {
  if (call && (_typeof59(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized53(self2);
}
function _assertThisInitialized53(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct53() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf53(o3) {
  _getPrototypeOf53 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf53(o3);
}
function _defineProperty53(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var DayPeriodParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits53(DayPeriodParser3, _Parser);
  var _super = _createSuper53(DayPeriodParser3);
  function DayPeriodParser3() {
    var _this;
    _classCallCheck55(this, DayPeriodParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty53(_assertThisInitialized53(_this), "priority", 80);
    _defineProperty53(_assertThisInitialized53(_this), "incompatibleTokens", ["a", "b", "t", "T"]);
    return _this;
  }
  _createClass55(DayPeriodParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "B":
        case "BB":
        case "BBB":
          return match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBBB":
          return match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
        case "BBBB":
        default:
          return match6.dayPeriod(dateString, {
            width: "wide",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "abbreviated",
            context: "formatting"
          }) || match6.dayPeriod(dateString, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(dayPeriodEnumToHours2(value), 0, 0, 0);
      return date;
    }
  }]);
  return DayPeriodParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js
function _typeof60(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof60 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof60 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof60(obj);
}
function _classCallCheck56(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties56(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass56(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties56(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties56(Constructor, staticProps);
  return Constructor;
}
function _inherits54(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf54(subClass, superClass);
}
function _setPrototypeOf54(o3, p4) {
  _setPrototypeOf54 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf54(o3, p4);
}
function _createSuper54(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct54();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf54(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf54(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn54(this, result);
  };
}
function _possibleConstructorReturn54(self2, call) {
  if (call && (_typeof60(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized54(self2);
}
function _assertThisInitialized54(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct54() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf54(o3) {
  _getPrototypeOf54 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf54(o3);
}
function _defineProperty54(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour1to12Parser2 = /* @__PURE__ */ function(_Parser) {
  _inherits54(Hour1to12Parser3, _Parser);
  var _super = _createSuper54(Hour1to12Parser3);
  function Hour1to12Parser3() {
    var _this;
    _classCallCheck56(this, Hour1to12Parser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty54(_assertThisInitialized54(_this), "priority", 70);
    _defineProperty54(_assertThisInitialized54(_this), "incompatibleTokens", ["H", "K", "k", "t", "T"]);
    return _this;
  }
  _createClass56(Hour1to12Parser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "h":
          return parseNumericPattern2(numericPatterns2.hour12h, dateString);
        case "ho":
          return match6.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 12;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var isPM = date.getUTCHours() >= 12;
      if (isPM && value < 12) {
        date.setUTCHours(value + 12, 0, 0, 0);
      } else if (!isPM && value === 12) {
        date.setUTCHours(0, 0, 0, 0);
      } else {
        date.setUTCHours(value, 0, 0, 0);
      }
      return date;
    }
  }]);
  return Hour1to12Parser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js
function _typeof61(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof61 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof61 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof61(obj);
}
function _classCallCheck57(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties57(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass57(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties57(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties57(Constructor, staticProps);
  return Constructor;
}
function _inherits55(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf55(subClass, superClass);
}
function _setPrototypeOf55(o3, p4) {
  _setPrototypeOf55 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf55(o3, p4);
}
function _createSuper55(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct55();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf55(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf55(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn55(this, result);
  };
}
function _possibleConstructorReturn55(self2, call) {
  if (call && (_typeof61(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized55(self2);
}
function _assertThisInitialized55(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct55() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf55(o3) {
  _getPrototypeOf55 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf55(o3);
}
function _defineProperty55(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour0to23Parser2 = /* @__PURE__ */ function(_Parser) {
  _inherits55(Hour0to23Parser3, _Parser);
  var _super = _createSuper55(Hour0to23Parser3);
  function Hour0to23Parser3() {
    var _this;
    _classCallCheck57(this, Hour0to23Parser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty55(_assertThisInitialized55(_this), "priority", 70);
    _defineProperty55(_assertThisInitialized55(_this), "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
    return _this;
  }
  _createClass57(Hour0to23Parser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "H":
          return parseNumericPattern2(numericPatterns2.hour23h, dateString);
        case "Ho":
          return match6.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 23;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCHours(value, 0, 0, 0);
      return date;
    }
  }]);
  return Hour0to23Parser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js
function _typeof62(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof62 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof62 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof62(obj);
}
function _classCallCheck58(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties58(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass58(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties58(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties58(Constructor, staticProps);
  return Constructor;
}
function _inherits56(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf56(subClass, superClass);
}
function _setPrototypeOf56(o3, p4) {
  _setPrototypeOf56 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf56(o3, p4);
}
function _createSuper56(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct56();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf56(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf56(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn56(this, result);
  };
}
function _possibleConstructorReturn56(self2, call) {
  if (call && (_typeof62(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized56(self2);
}
function _assertThisInitialized56(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct56() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf56(o3) {
  _getPrototypeOf56 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf56(o3);
}
function _defineProperty56(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour0To11Parser2 = /* @__PURE__ */ function(_Parser) {
  _inherits56(Hour0To11Parser3, _Parser);
  var _super = _createSuper56(Hour0To11Parser3);
  function Hour0To11Parser3() {
    var _this;
    _classCallCheck58(this, Hour0To11Parser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty56(_assertThisInitialized56(_this), "priority", 70);
    _defineProperty56(_assertThisInitialized56(_this), "incompatibleTokens", ["h", "H", "k", "t", "T"]);
    return _this;
  }
  _createClass58(Hour0To11Parser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "K":
          return parseNumericPattern2(numericPatterns2.hour11h, dateString);
        case "Ko":
          return match6.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 11;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var isPM = date.getUTCHours() >= 12;
      if (isPM && value < 12) {
        date.setUTCHours(value + 12, 0, 0, 0);
      } else {
        date.setUTCHours(value, 0, 0, 0);
      }
      return date;
    }
  }]);
  return Hour0To11Parser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js
function _typeof63(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof63 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof63 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof63(obj);
}
function _classCallCheck59(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties59(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass59(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties59(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties59(Constructor, staticProps);
  return Constructor;
}
function _inherits57(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf57(subClass, superClass);
}
function _setPrototypeOf57(o3, p4) {
  _setPrototypeOf57 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf57(o3, p4);
}
function _createSuper57(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct57();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf57(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf57(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn57(this, result);
  };
}
function _possibleConstructorReturn57(self2, call) {
  if (call && (_typeof63(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized57(self2);
}
function _assertThisInitialized57(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct57() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf57(o3) {
  _getPrototypeOf57 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf57(o3);
}
function _defineProperty57(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var Hour1To24Parser2 = /* @__PURE__ */ function(_Parser) {
  _inherits57(Hour1To24Parser3, _Parser);
  var _super = _createSuper57(Hour1To24Parser3);
  function Hour1To24Parser3() {
    var _this;
    _classCallCheck59(this, Hour1To24Parser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty57(_assertThisInitialized57(_this), "priority", 70);
    _defineProperty57(_assertThisInitialized57(_this), "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
    return _this;
  }
  _createClass59(Hour1To24Parser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "k":
          return parseNumericPattern2(numericPatterns2.hour24h, dateString);
        case "ko":
          return match6.ordinalNumber(dateString, {
            unit: "hour"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 1 && value <= 24;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      var hours = value <= 24 ? value % 24 : value;
      date.setUTCHours(hours, 0, 0, 0);
      return date;
    }
  }]);
  return Hour1To24Parser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js
function _typeof64(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof64 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof64 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof64(obj);
}
function _classCallCheck60(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties60(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass60(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties60(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties60(Constructor, staticProps);
  return Constructor;
}
function _inherits58(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf58(subClass, superClass);
}
function _setPrototypeOf58(o3, p4) {
  _setPrototypeOf58 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf58(o3, p4);
}
function _createSuper58(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct58();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf58(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf58(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn58(this, result);
  };
}
function _possibleConstructorReturn58(self2, call) {
  if (call && (_typeof64(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized58(self2);
}
function _assertThisInitialized58(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct58() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf58(o3) {
  _getPrototypeOf58 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf58(o3);
}
function _defineProperty58(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var MinuteParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits58(MinuteParser3, _Parser);
  var _super = _createSuper58(MinuteParser3);
  function MinuteParser3() {
    var _this;
    _classCallCheck60(this, MinuteParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty58(_assertThisInitialized58(_this), "priority", 60);
    _defineProperty58(_assertThisInitialized58(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass60(MinuteParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "m":
          return parseNumericPattern2(numericPatterns2.minute, dateString);
        case "mo":
          return match6.ordinalNumber(dateString, {
            unit: "minute"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 59;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMinutes(value, 0, 0);
      return date;
    }
  }]);
  return MinuteParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js
function _typeof65(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof65 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof65 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof65(obj);
}
function _classCallCheck61(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties61(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass61(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties61(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties61(Constructor, staticProps);
  return Constructor;
}
function _inherits59(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf59(subClass, superClass);
}
function _setPrototypeOf59(o3, p4) {
  _setPrototypeOf59 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf59(o3, p4);
}
function _createSuper59(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct59();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf59(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf59(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn59(this, result);
  };
}
function _possibleConstructorReturn59(self2, call) {
  if (call && (_typeof65(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized59(self2);
}
function _assertThisInitialized59(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct59() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf59(o3) {
  _getPrototypeOf59 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf59(o3);
}
function _defineProperty59(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var SecondParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits59(SecondParser3, _Parser);
  var _super = _createSuper59(SecondParser3);
  function SecondParser3() {
    var _this;
    _classCallCheck61(this, SecondParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty59(_assertThisInitialized59(_this), "priority", 50);
    _defineProperty59(_assertThisInitialized59(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass61(SecondParser3, [{
    key: "parse",
    value: function parse3(dateString, token, match6) {
      switch (token) {
        case "s":
          return parseNumericPattern2(numericPatterns2.second, dateString);
        case "so":
          return match6.ordinalNumber(dateString, {
            unit: "second"
          });
        default:
          return parseNDigits2(token.length, dateString);
      }
    }
  }, {
    key: "validate",
    value: function validate(_date, value) {
      return value >= 0 && value <= 59;
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCSeconds(value, 0);
      return date;
    }
  }]);
  return SecondParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js
function _typeof66(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof66 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof66 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof66(obj);
}
function _classCallCheck62(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties62(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass62(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties62(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties62(Constructor, staticProps);
  return Constructor;
}
function _inherits60(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf60(subClass, superClass);
}
function _setPrototypeOf60(o3, p4) {
  _setPrototypeOf60 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf60(o3, p4);
}
function _createSuper60(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct60();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf60(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf60(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn60(this, result);
  };
}
function _possibleConstructorReturn60(self2, call) {
  if (call && (_typeof66(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized60(self2);
}
function _assertThisInitialized60(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct60() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf60(o3) {
  _getPrototypeOf60 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf60(o3);
}
function _defineProperty60(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var FractionOfSecondParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits60(FractionOfSecondParser3, _Parser);
  var _super = _createSuper60(FractionOfSecondParser3);
  function FractionOfSecondParser3() {
    var _this;
    _classCallCheck62(this, FractionOfSecondParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty60(_assertThisInitialized60(_this), "priority", 30);
    _defineProperty60(_assertThisInitialized60(_this), "incompatibleTokens", ["t", "T"]);
    return _this;
  }
  _createClass62(FractionOfSecondParser3, [{
    key: "parse",
    value: function parse3(dateString, token) {
      var valueCallback11 = function valueCallback12(value) {
        return Math.floor(value * Math.pow(10, -token.length + 3));
      };
      return mapValue2(parseNDigits2(token.length, dateString), valueCallback11);
    }
  }, {
    key: "set",
    value: function set2(date, _flags, value) {
      date.setUTCMilliseconds(value);
      return date;
    }
  }]);
  return FractionOfSecondParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js
function _typeof67(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof67 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof67 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof67(obj);
}
function _classCallCheck63(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties63(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass63(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties63(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties63(Constructor, staticProps);
  return Constructor;
}
function _inherits61(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf61(subClass, superClass);
}
function _setPrototypeOf61(o3, p4) {
  _setPrototypeOf61 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf61(o3, p4);
}
function _createSuper61(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct61();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf61(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf61(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn61(this, result);
  };
}
function _possibleConstructorReturn61(self2, call) {
  if (call && (_typeof67(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized61(self2);
}
function _assertThisInitialized61(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct61() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf61(o3) {
  _getPrototypeOf61 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf61(o3);
}
function _defineProperty61(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOTimezoneWithZParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits61(ISOTimezoneWithZParser3, _Parser);
  var _super = _createSuper61(ISOTimezoneWithZParser3);
  function ISOTimezoneWithZParser3() {
    var _this;
    _classCallCheck63(this, ISOTimezoneWithZParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty61(_assertThisInitialized61(_this), "priority", 10);
    _defineProperty61(_assertThisInitialized61(_this), "incompatibleTokens", ["t", "T", "x"]);
    return _this;
  }
  _createClass63(ISOTimezoneWithZParser3, [{
    key: "parse",
    value: function parse3(dateString, token) {
      switch (token) {
        case "X":
          return parseTimezonePattern2(timezonePatterns2.basicOptionalMinutes, dateString);
        case "XX":
          return parseTimezonePattern2(timezonePatterns2.basic, dateString);
        case "XXXX":
          return parseTimezonePattern2(timezonePatterns2.basicOptionalSeconds, dateString);
        case "XXXXX":
          return parseTimezonePattern2(timezonePatterns2.extendedOptionalSeconds, dateString);
        case "XXX":
        default:
          return parseTimezonePattern2(timezonePatterns2.extended, dateString);
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      if (flags.timestampIsSet) {
        return date;
      }
      return new Date(date.getTime() - value);
    }
  }]);
  return ISOTimezoneWithZParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js
function _typeof68(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof68 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof68 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof68(obj);
}
function _classCallCheck64(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties64(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass64(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties64(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties64(Constructor, staticProps);
  return Constructor;
}
function _inherits62(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf62(subClass, superClass);
}
function _setPrototypeOf62(o3, p4) {
  _setPrototypeOf62 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf62(o3, p4);
}
function _createSuper62(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct62();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf62(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf62(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn62(this, result);
  };
}
function _possibleConstructorReturn62(self2, call) {
  if (call && (_typeof68(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized62(self2);
}
function _assertThisInitialized62(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct62() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf62(o3) {
  _getPrototypeOf62 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf62(o3);
}
function _defineProperty62(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var ISOTimezoneParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits62(ISOTimezoneParser3, _Parser);
  var _super = _createSuper62(ISOTimezoneParser3);
  function ISOTimezoneParser3() {
    var _this;
    _classCallCheck64(this, ISOTimezoneParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty62(_assertThisInitialized62(_this), "priority", 10);
    _defineProperty62(_assertThisInitialized62(_this), "incompatibleTokens", ["t", "T", "X"]);
    return _this;
  }
  _createClass64(ISOTimezoneParser3, [{
    key: "parse",
    value: function parse3(dateString, token) {
      switch (token) {
        case "x":
          return parseTimezonePattern2(timezonePatterns2.basicOptionalMinutes, dateString);
        case "xx":
          return parseTimezonePattern2(timezonePatterns2.basic, dateString);
        case "xxxx":
          return parseTimezonePattern2(timezonePatterns2.basicOptionalSeconds, dateString);
        case "xxxxx":
          return parseTimezonePattern2(timezonePatterns2.extendedOptionalSeconds, dateString);
        case "xxx":
        default:
          return parseTimezonePattern2(timezonePatterns2.extended, dateString);
      }
    }
  }, {
    key: "set",
    value: function set2(date, flags, value) {
      if (flags.timestampIsSet) {
        return date;
      }
      return new Date(date.getTime() - value);
    }
  }]);
  return ISOTimezoneParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js
function _typeof69(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof69 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof69 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof69(obj);
}
function _classCallCheck65(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties65(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass65(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties65(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties65(Constructor, staticProps);
  return Constructor;
}
function _inherits63(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf63(subClass, superClass);
}
function _setPrototypeOf63(o3, p4) {
  _setPrototypeOf63 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf63(o3, p4);
}
function _createSuper63(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct63();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf63(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf63(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn63(this, result);
  };
}
function _possibleConstructorReturn63(self2, call) {
  if (call && (_typeof69(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized63(self2);
}
function _assertThisInitialized63(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct63() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf63(o3) {
  _getPrototypeOf63 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf63(o3);
}
function _defineProperty63(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var TimestampSecondsParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits63(TimestampSecondsParser3, _Parser);
  var _super = _createSuper63(TimestampSecondsParser3);
  function TimestampSecondsParser3() {
    var _this;
    _classCallCheck65(this, TimestampSecondsParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty63(_assertThisInitialized63(_this), "priority", 40);
    _defineProperty63(_assertThisInitialized63(_this), "incompatibleTokens", "*");
    return _this;
  }
  _createClass65(TimestampSecondsParser3, [{
    key: "parse",
    value: function parse3(dateString) {
      return parseAnyDigitsSigned2(dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      return [new Date(value * 1e3), {
        timestampIsSet: true
      }];
    }
  }]);
  return TimestampSecondsParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js
function _typeof70(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof70 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof70 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof70(obj);
}
function _classCallCheck66(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties66(target, props) {
  for (var i5 = 0; i5 < props.length; i5++) {
    var descriptor = props[i5];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass66(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties66(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties66(Constructor, staticProps);
  return Constructor;
}
function _inherits64(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  if (superClass)
    _setPrototypeOf64(subClass, superClass);
}
function _setPrototypeOf64(o3, p4) {
  _setPrototypeOf64 = Object.setPrototypeOf || function _setPrototypeOf65(o4, p5) {
    o4.__proto__ = p5;
    return o4;
  };
  return _setPrototypeOf64(o3, p4);
}
function _createSuper64(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct64();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf64(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf64(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn64(this, result);
  };
}
function _possibleConstructorReturn64(self2, call) {
  if (call && (_typeof70(call) === "object" || typeof call === "function")) {
    return call;
  }
  return _assertThisInitialized64(self2);
}
function _assertThisInitialized64(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct64() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e5) {
    return false;
  }
}
function _getPrototypeOf64(o3) {
  _getPrototypeOf64 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf65(o4) {
    return o4.__proto__ || Object.getPrototypeOf(o4);
  };
  return _getPrototypeOf64(o3);
}
function _defineProperty64(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var TimestampMillisecondsParser2 = /* @__PURE__ */ function(_Parser) {
  _inherits64(TimestampMillisecondsParser3, _Parser);
  var _super = _createSuper64(TimestampMillisecondsParser3);
  function TimestampMillisecondsParser3() {
    var _this;
    _classCallCheck66(this, TimestampMillisecondsParser3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty64(_assertThisInitialized64(_this), "priority", 20);
    _defineProperty64(_assertThisInitialized64(_this), "incompatibleTokens", "*");
    return _this;
  }
  _createClass66(TimestampMillisecondsParser3, [{
    key: "parse",
    value: function parse3(dateString) {
      return parseAnyDigitsSigned2(dateString);
    }
  }, {
    key: "set",
    value: function set2(_date, _flags, value) {
      return [new Date(value), {
        timestampIsSet: true
      }];
    }
  }]);
  return TimestampMillisecondsParser3;
}(Parser2);

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/_lib/parsers/index.js
var parsers3 = {
  G: new EraParser2(),
  y: new YearParser2(),
  Y: new LocalWeekYearParser2(),
  R: new ISOWeekYearParser2(),
  u: new ExtendedYearParser2(),
  Q: new QuarterParser2(),
  q: new StandAloneQuarterParser2(),
  M: new MonthParser2(),
  L: new StandAloneMonthParser2(),
  w: new LocalWeekParser2(),
  I: new ISOWeekParser2(),
  d: new DateParser2(),
  D: new DayOfYearParser2(),
  E: new DayParser2(),
  e: new LocalDayParser2(),
  c: new StandAloneLocalDayParser2(),
  i: new ISODayParser2(),
  a: new AMPMParser2(),
  b: new AMPMMidnightParser2(),
  B: new DayPeriodParser2(),
  h: new Hour1to12Parser2(),
  H: new Hour0to23Parser2(),
  K: new Hour0To11Parser2(),
  k: new Hour1To24Parser2(),
  m: new MinuteParser2(),
  s: new SecondParser2(),
  S: new FractionOfSecondParser2(),
  X: new ISOTimezoneWithZParser2(),
  x: new ISOTimezoneParser2(),
  t: new TimestampSecondsParser2(),
  T: new TimestampMillisecondsParser2()
};

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parse/index.js
function _typeof71(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof71 = function _typeof72(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof71 = function _typeof72(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof71(obj);
}
function _createForOfIteratorHelper(o3, allowArrayLike) {
  var it;
  if (typeof Symbol === "undefined" || o3[Symbol.iterator] == null) {
    if (Array.isArray(o3) || (it = _unsupportedIterableToArray(o3)) || allowArrayLike && o3 && typeof o3.length === "number") {
      if (it)
        o3 = it;
      var i5 = 0;
      var F3 = function F4() {
      };
      return { s: F3, n: function n2() {
        if (i5 >= o3.length)
          return { done: true };
        return { done: false, value: o3[i5++] };
      }, e: function e5(_e) {
        throw _e;
      }, f: F3 };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var normalCompletion = true, didErr = false, err;
  return { s: function s6() {
    it = o3[Symbol.iterator]();
  }, n: function n2() {
    var step = it.next();
    normalCompletion = step.done;
    return step;
  }, e: function e5(_e2) {
    didErr = true;
    err = _e2;
  }, f: function f3() {
    try {
      if (!normalCompletion && it.return != null)
        it.return();
    } finally {
      if (didErr)
        throw err;
    }
  } };
}
function _unsupportedIterableToArray(o3, minLen) {
  if (!o3)
    return;
  if (typeof o3 === "string")
    return _arrayLikeToArray(o3, minLen);
  var n2 = Object.prototype.toString.call(o3).slice(8, -1);
  if (n2 === "Object" && o3.constructor)
    n2 = o3.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o3);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray(o3, minLen);
}
function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++) {
    arr2[i5] = arr[i5];
  }
  return arr2;
}
var formattingTokensRegExp3 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
var longFormattingTokensRegExp3 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp3 = /^'([^]*?)'?$/;
var doubleQuoteRegExp3 = /''/g;
var notWhitespaceRegExp = /\S/;
var unescapedLatinCharacterRegExp3 = /[a-zA-Z]/;
function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, options) {
  var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
  requiredArgs2(3, arguments);
  var dateString = String(dirtyDateString);
  var formatString = String(dirtyFormatString);
  var defaultOptions3 = getDefaultOptions2();
  var locale7 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions3.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default2;
  if (!locale7.match) {
    throw new RangeError("locale must contain match property");
  }
  var firstWeekContainsDate = toInteger2((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions3.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions3.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  }
  var weekStartsOn = toInteger2((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions3.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions3.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  }
  if (formatString === "") {
    if (dateString === "") {
      return toDate2(dirtyReferenceDate);
    } else {
      return /* @__PURE__ */ new Date(NaN);
    }
  }
  var subFnOptions = {
    firstWeekContainsDate,
    weekStartsOn,
    locale: locale7
  };
  var setters = [new DateToSystemTimezoneSetter()];
  var tokens = formatString.match(longFormattingTokensRegExp3).map(function(substring) {
    var firstCharacter = substring[0];
    if (firstCharacter in longFormatters_default2) {
      var longFormatter = longFormatters_default2[firstCharacter];
      return longFormatter(substring, locale7.formatLong);
    }
    return substring;
  }).join("").match(formattingTokensRegExp3);
  var usedTokens = [];
  var _iterator = _createForOfIteratorHelper(tokens), _step;
  try {
    var _loop = function _loop2() {
      var token = _step.value;
      if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken2(token)) {
        throwProtectedError2(token, formatString, dirtyDateString);
      }
      if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken2(token)) {
        throwProtectedError2(token, formatString, dirtyDateString);
      }
      var firstCharacter = token[0];
      var parser = parsers3[firstCharacter];
      if (parser) {
        var incompatibleTokens = parser.incompatibleTokens;
        if (Array.isArray(incompatibleTokens)) {
          var incompatibleToken = usedTokens.find(function(usedToken) {
            return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter;
          });
          if (incompatibleToken) {
            throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
          }
        } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
          throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
        }
        usedTokens.push({
          token: firstCharacter,
          fullToken: token
        });
        var parseResult = parser.run(dateString, token, locale7.match, subFnOptions);
        if (!parseResult) {
          return {
            v: /* @__PURE__ */ new Date(NaN)
          };
        }
        setters.push(parseResult.setter);
        dateString = parseResult.rest;
      } else {
        if (firstCharacter.match(unescapedLatinCharacterRegExp3)) {
          throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
        }
        if (token === "''") {
          token = "'";
        } else if (firstCharacter === "'") {
          token = cleanEscapedString3(token);
        }
        if (dateString.indexOf(token) === 0) {
          dateString = dateString.slice(token.length);
        } else {
          return {
            v: /* @__PURE__ */ new Date(NaN)
          };
        }
      }
    };
    for (_iterator.s(); !(_step = _iterator.n()).done; ) {
      var _ret = _loop();
      if (_typeof71(_ret) === "object")
        return _ret.v;
    }
  } catch (err) {
    _iterator.e(err);
  } finally {
    _iterator.f();
  }
  if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  var uniquePrioritySetters = setters.map(function(setter2) {
    return setter2.priority;
  }).sort(function(a6, b5) {
    return b5 - a6;
  }).filter(function(priority, index2, array) {
    return array.indexOf(priority) === index2;
  }).map(function(priority) {
    return setters.filter(function(setter2) {
      return setter2.priority === priority;
    }).sort(function(a6, b5) {
      return b5.subPriority - a6.subPriority;
    });
  }).map(function(setterArray) {
    return setterArray[0];
  });
  var date = toDate2(dirtyReferenceDate);
  if (isNaN(date.getTime())) {
    return /* @__PURE__ */ new Date(NaN);
  }
  var utcDate = subMilliseconds2(date, getTimezoneOffsetInMilliseconds2(date));
  var flags = {};
  var _iterator2 = _createForOfIteratorHelper(uniquePrioritySetters), _step2;
  try {
    for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
      var setter = _step2.value;
      if (!setter.validate(utcDate, subFnOptions)) {
        return /* @__PURE__ */ new Date(NaN);
      }
      var result = setter.set(utcDate, flags, subFnOptions);
      if (Array.isArray(result)) {
        utcDate = result[0];
        assign2(flags, result[1]);
      } else {
        utcDate = result;
      }
    }
  } catch (err) {
    _iterator2.e(err);
  } finally {
    _iterator2.f();
  }
  return utcDate;
}
function cleanEscapedString3(input) {
  return input.match(escapedStringRegExp3)[1].replace(doubleQuoteRegExp3, "'");
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfHour/index.js
function startOfHour(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setMinutes(0, 0, 0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/startOfSecond/index.js
function startOfSecond(dirtyDate) {
  requiredArgs2(1, arguments);
  var date = toDate2(dirtyDate);
  date.setMilliseconds(0);
  return date;
}

// ../../node_modules/.pnpm/date-fns@2.29.3/node_modules/date-fns/esm/parseISO/index.js
function parseISO(argument, options) {
  var _options$additionalDi;
  requiredArgs2(1, arguments);
  var additionalDigits = toInteger2((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
  if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
    throw new RangeError("additionalDigits must be 0, 1 or 2");
  }
  if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
    return /* @__PURE__ */ new Date(NaN);
  }
  var dateStrings = splitDateString(argument);
  var date;
  if (dateStrings.date) {
    var parseYearResult = parseYear(dateStrings.date, additionalDigits);
    date = parseDate(parseYearResult.restDateString, parseYearResult.year);
  }
  if (!date || isNaN(date.getTime())) {
    return /* @__PURE__ */ new Date(NaN);
  }
  var timestamp = date.getTime();
  var time = 0;
  var offset;
  if (dateStrings.time) {
    time = parseTime(dateStrings.time);
    if (isNaN(time)) {
      return /* @__PURE__ */ new Date(NaN);
    }
  }
  if (dateStrings.timezone) {
    offset = parseTimezone(dateStrings.timezone);
    if (isNaN(offset)) {
      return /* @__PURE__ */ new Date(NaN);
    }
  } else {
    var dirtyDate = new Date(timestamp + time);
    var result = /* @__PURE__ */ new Date(0);
    result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
    result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
    return result;
  }
  return new Date(timestamp + time + offset);
}
var patterns = {
  dateTimeDelimiter: /[T ]/,
  timeZoneDelimiter: /[Z ]/i,
  timezone: /([Z+-].*)$/
};
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function splitDateString(dateString) {
  var dateStrings = {};
  var array = dateString.split(patterns.dateTimeDelimiter);
  var timeString;
  if (array.length > 2) {
    return dateStrings;
  }
  if (/:/.test(array[0])) {
    timeString = array[0];
  } else {
    dateStrings.date = array[0];
    timeString = array[1];
    if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
      dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
      timeString = dateString.substr(dateStrings.date.length, dateString.length);
    }
  }
  if (timeString) {
    var token = patterns.timezone.exec(timeString);
    if (token) {
      dateStrings.time = timeString.replace(token[1], "");
      dateStrings.timezone = token[1];
    } else {
      dateStrings.time = timeString;
    }
  }
  return dateStrings;
}
function parseYear(dateString, additionalDigits) {
  var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
  var captures = dateString.match(regex);
  if (!captures)
    return {
      year: NaN,
      restDateString: ""
    };
  var year = captures[1] ? parseInt(captures[1]) : null;
  var century = captures[2] ? parseInt(captures[2]) : null;
  return {
    year: century === null ? year : century * 100,
    restDateString: dateString.slice((captures[1] || captures[2]).length)
  };
}
function parseDate(dateString, year) {
  if (year === null)
    return /* @__PURE__ */ new Date(NaN);
  var captures = dateString.match(dateRegex);
  if (!captures)
    return /* @__PURE__ */ new Date(NaN);
  var isWeekDate = !!captures[4];
  var dayOfYear = parseDateUnit(captures[1]);
  var month = parseDateUnit(captures[2]) - 1;
  var day = parseDateUnit(captures[3]);
  var week = parseDateUnit(captures[4]);
  var dayOfWeek = parseDateUnit(captures[5]) - 1;
  if (isWeekDate) {
    if (!validateWeekDate(year, week, dayOfWeek)) {
      return /* @__PURE__ */ new Date(NaN);
    }
    return dayOfISOWeekYear(year, week, dayOfWeek);
  } else {
    var date = /* @__PURE__ */ new Date(0);
    if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
      return /* @__PURE__ */ new Date(NaN);
    }
    date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
    return date;
  }
}
function parseDateUnit(value) {
  return value ? parseInt(value) : 1;
}
function parseTime(timeString) {
  var captures = timeString.match(timeRegex);
  if (!captures)
    return NaN;
  var hours = parseTimeUnit(captures[1]);
  var minutes = parseTimeUnit(captures[2]);
  var seconds = parseTimeUnit(captures[3]);
  if (!validateTime(hours, minutes, seconds)) {
    return NaN;
  }
  return hours * millisecondsInHour2 + minutes * millisecondsInMinute2 + seconds * 1e3;
}
function parseTimeUnit(value) {
  return value && parseFloat(value.replace(",", ".")) || 0;
}
function parseTimezone(timezoneString) {
  if (timezoneString === "Z")
    return 0;
  var captures = timezoneString.match(timezoneRegex);
  if (!captures)
    return 0;
  var sign3 = captures[1] === "+" ? -1 : 1;
  var hours = parseInt(captures[2]);
  var minutes = captures[3] && parseInt(captures[3]) || 0;
  if (!validateTimezone(hours, minutes)) {
    return NaN;
  }
  return sign3 * (hours * millisecondsInHour2 + minutes * millisecondsInMinute2);
}
function dayOfISOWeekYear(isoWeekYear, week, day) {
  var date = /* @__PURE__ */ new Date(0);
  date.setUTCFullYear(isoWeekYear, 0, 4);
  var fourthOfJanuaryDay = date.getUTCDay() || 7;
  var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
  date.setUTCDate(date.getUTCDate() + diff);
  return date;
}
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function isLeapYearIndex3(year) {
  return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
function validateDate(year, month, date) {
  return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex3(year) ? 29 : 28));
}
function validateDayOfYearDate(year, dayOfYear) {
  return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex3(year) ? 366 : 365);
}
function validateWeekDate(_year, week, day) {
  return week >= 1 && week <= 53 && day >= 0 && day <= 6;
}
function validateTime(hours, minutes, seconds) {
  if (hours === 24) {
    return minutes === 0 && seconds === 0;
  }
  return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
}
function validateTimezone(_hours, minutes) {
  return minutes >= 0 && minutes <= 59;
}

// src/components/form/InputDuration.tsx
init_preact_module();
init_hooks_module();

// src/components/modal/index.tsx
init_preact_module();
init_hooks_module();

// ../web-util/src/components/utils.ts
init_preact_module();
init_hooks_module();
function doAutoFocus2(element) {
  if (element) {
    setTimeout(() => {
      element.focus({ preventScroll: true });
    }, 100);
  }
}

// src/utils/constants.ts
var PAGINATED_LIST_SIZE = 5;
var PAGINATED_LIST_REQUEST = PAGINATED_LIST_SIZE + 1;
var MAX_IMAGE_SIZE = 1024 * 1024;
var INSTANCE_ID_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9_.@-]+$/;
var EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var PHONE_JUST_NUMBERS_REGEX = /^\+[0-9 ]*$/;
var COUNTRY_TABLE = {
  AE: "U.A.E.",
  AF: "Afghanistan",
  AL: "Albania",
  AM: "Armenia",
  AN: "Netherlands Antilles",
  AR: "Argentina",
  AT: "Austria",
  AU: "Australia",
  AZ: "Azerbaijan",
  BA: "Bosnia and Herzegovina",
  BD: "Bangladesh",
  BE: "Belgium",
  BG: "Bulgaria",
  BH: "Bahrain",
  BN: "Brunei Darussalam",
  BO: "Bolivia",
  BR: "Brazil",
  BT: "Bhutan",
  BY: "Belarus",
  BZ: "Belize",
  CA: "Canada",
  CG: "Congo",
  CH: "Switzerland",
  CI: "Cote d'Ivoire",
  CL: "Chile",
  CM: "Cameroon",
  CN: "People's Republic of China",
  CO: "Colombia",
  CR: "Costa Rica",
  CS: "Serbia and Montenegro",
  CZ: "Czech Republic",
  DE: "Germany",
  DK: "Denmark",
  DO: "Dominican Republic",
  DZ: "Algeria",
  EC: "Ecuador",
  EE: "Estonia",
  EG: "Egypt",
  ER: "Eritrea",
  ES: "Spain",
  ET: "Ethiopia",
  FI: "Finland",
  FO: "Faroe Islands",
  FR: "France",
  GB: "United Kingdom",
  GD: "Caribbean",
  GE: "Georgia",
  GL: "Greenland",
  GR: "Greece",
  GT: "Guatemala",
  HK: "Hong Kong",
  // HK: "Hong Kong S.A.R.",
  HN: "Honduras",
  HR: "Croatia",
  HT: "Haiti",
  HU: "Hungary",
  ID: "Indonesia",
  IE: "Ireland",
  IL: "Israel",
  IN: "India",
  IQ: "Iraq",
  IR: "Iran",
  IS: "Iceland",
  IT: "Italy",
  JM: "Jamaica",
  JO: "Jordan",
  JP: "Japan",
  KE: "Kenya",
  KG: "Kyrgyzstan",
  KH: "Cambodia",
  KR: "South Korea",
  KW: "Kuwait",
  KZ: "Kazakhstan",
  LA: "Laos",
  LB: "Lebanon",
  LI: "Liechtenstein",
  LK: "Sri Lanka",
  LT: "Lithuania",
  LU: "Luxembourg",
  LV: "Latvia",
  LY: "Libya",
  MA: "Morocco",
  MC: "Principality of Monaco",
  MD: "Moldava",
  // MD: "Moldova",
  ME: "Montenegro",
  MK: "Former Yugoslav Republic of Macedonia",
  ML: "Mali",
  MM: "Myanmar",
  MN: "Mongolia",
  MO: "Macau S.A.R.",
  MT: "Malta",
  MV: "Maldives",
  MX: "Mexico",
  MY: "Malaysia",
  NG: "Nigeria",
  NI: "Nicaragua",
  NL: "Netherlands",
  NO: "Norway",
  NP: "Nepal",
  NZ: "New Zealand",
  OM: "Oman",
  PA: "Panama",
  PE: "Peru",
  PH: "Philippines",
  PK: "Islamic Republic of Pakistan",
  PL: "Poland",
  PR: "Puerto Rico",
  PT: "Portugal",
  PY: "Paraguay",
  QA: "Qatar",
  RE: "Reunion",
  RO: "Romania",
  RS: "Serbia",
  RU: "Russia",
  RW: "Rwanda",
  SA: "Saudi Arabia",
  SE: "Sweden",
  SG: "Singapore",
  SI: "Slovenia",
  SK: "Slovak",
  SN: "Senegal",
  SO: "Somalia",
  SR: "Suriname",
  SV: "El Salvador",
  SY: "Syria",
  TH: "Thailand",
  TJ: "Tajikistan",
  TM: "Turkmenistan",
  TN: "Tunisia",
  TR: "Turkey",
  TT: "Trinidad and Tobago",
  TW: "Taiwan",
  TZ: "Tanzania",
  UA: "Ukraine",
  US: "United States",
  UY: "Uruguay",
  VA: "Vatican",
  VE: "Venezuela",
  VN: "Viet Nam",
  YE: "Yemen",
  ZA: "South Africa",
  ZW: "Zimbabwe"
};

// src/components/exception/QR.tsx
init_preact_module();
init_hooks_module();
var import_qrcode_generator = __toESM(require_qrcode(), 1);
function QR({ text }) {
  const divRef = _2(null);
  h2(() => {
    const qr = (0, import_qrcode_generator.default)(0, "L");
    qr.addData(text);
    qr.make();
    if (divRef.current) {
      const image = qr.createSvgTag({
        scalable: true
      });
      const imageURL = `data:image/svg+xml,${encodeURIComponent(image)}`;
      divRef.current.innerHTML = `<img src=${JSON.stringify(
        imageURL
      )} alt=${JSON.stringify(
        `QR Code containing the data ${text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;")}`
      )} />`;
    }
  });
  return /* @__PURE__ */ h(
    "div",
    {
      style: {
        width: "100%",
        display: "flex",
        flexDirection: "column",
        alignItems: "center"
      }
    },
    /* @__PURE__ */ h(
      "div",
      {
        style: { width: "50%", minWidth: 200, maxWidth: 300 },
        ref: divRef
      }
    )
  );
}

// src/components/modal/index.tsx
function ConfirmModal({
  active,
  description,
  onCancel,
  confirm,
  children,
  danger,
  label,
  noCancelButton
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: active ? "modal is-active" : "modal" }, /* @__PURE__ */ h("div", { class: "modal-background ", onClick: onCancel }), /* @__PURE__ */ h("div", { class: "modal-card", style: { maxWidth: 700 } }, /* @__PURE__ */ h("header", { class: "modal-card-head" }, !description ? null : /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h("b", null, description)), /* @__PURE__ */ h(
    "button",
    {
      class: "delete ",
      type: "button",
      "aria-label": "close",
      onClick: onCancel
    }
  )), /* @__PURE__ */ h("section", { class: "modal-card-body" }, children), /* @__PURE__ */ h("footer", { class: "modal-card-foot" }, /* @__PURE__ */ h("div", { class: "buttons is-right", style: { width: "100%" } }, confirm ? /* @__PURE__ */ h(p2, null, onCancel && !noCancelButton ? /* @__PURE__ */ h("button", { class: "button ", type: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")) : void 0, /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      type: "submit",
      class: danger ? "button is-danger " : "button is-info ",
      onClick: confirm
    },
    /* @__PURE__ */ h(i18n2.Translate, null, label)
  )) : noCancelButton ? void 0 : /* @__PURE__ */ h("button", { class: "button ", ref: doAutoFocus2, onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Close"))))), noCancelButton ? void 0 : /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "modal-close is-large ",
      "aria-label": "close",
      onClick: onCancel
    }
  ));
}
function SimpleModal({
  onCancel,
  children
}) {
  return /* @__PURE__ */ h("div", { class: "modal is-active" }, /* @__PURE__ */ h("div", { class: "modal-background ", onClick: onCancel }), /* @__PURE__ */ h("div", { class: "modal-card" }, /* @__PURE__ */ h("section", { class: "modal-card-body is-main-section" }, children)), /* @__PURE__ */ h(
    "button",
    {
      class: "modal-close is-large ",
      "aria-label": "close",
      onClick: onCancel,
      type: "submit",
      ref: doAutoFocus2
    }
  ));
}
function getHostFromHostPath(s6) {
  if (!s6)
    return void 0;
  try {
    const u5 = new URL(`https://${s6}`);
    const endpath = u5.pathname.lastIndexOf("/");
    return u5.origin + u5.pathname.substring(0, endpath);
  } catch (e5) {
    return void 0;
  }
}
function getAccountIdFromHostPath(s6) {
  if (!s6)
    return void 0;
  try {
    const u5 = new URL(`https://${s6}`);
    const endpath = u5.pathname.lastIndexOf("/");
    return u5.pathname.substring(endpath + 1);
  } catch (e5) {
    return void 0;
  }
}
function CompareAccountsModal({
  onCancel,
  confirm,
  formPayto,
  testPayto
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Correct form`,
      description: i18n2.str`Comparing account details`,
      active: true,
      onCancel,
      confirm
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "The connection to the account info URL was successful, but the reported account information does not match the details in the form.")),
    /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Field")), /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "In the form")), /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Reported")))), /* @__PURE__ */ h("tbody", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Type")), /* @__PURE__ */ h("td", null, formPayto?.targetType ?? "--"), /* @__PURE__ */ h("td", null, testPayto.targetType)), testPayto.targetType === "iban" && /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "IBAN")), /* @__PURE__ */ h("td", null, formPayto?.displayName ?? "--"), /* @__PURE__ */ h("td", null, testPayto.iban)), testPayto.targetType === "bitcoin" && /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Address")), /* @__PURE__ */ h("td", null, formPayto?.displayName ?? "--"), /* @__PURE__ */ h("td", null, testPayto.address)), testPayto.targetType === "x-taler-bank" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Host")), /* @__PURE__ */ h("td", null, getHostFromHostPath(formPayto?.fullPath) ?? "--"), /* @__PURE__ */ h("td", null, getHostFromHostPath(testPayto.fullPath))), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Account ID")), /* @__PURE__ */ h("td", null, getAccountIdFromHostPath(formPayto?.fullPath) ?? "--"), /* @__PURE__ */ h("td", null, getAccountIdFromHostPath(testPayto.fullPath)))), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "The account owner's legal name")), /* @__PURE__ */ h("td", null, formPayto?.params["receiver-name"] ?? "--"), /* @__PURE__ */ h("td", null, testPayto.params["receiver-name"])), !!testPayto.params["receiver-postal-code"] && /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "The postal code of the account owner's address")), /* @__PURE__ */ h("td", null, formPayto?.params["receiver-postal-code"] ?? "--"), /* @__PURE__ */ h("td", null, testPayto.params["receiver-postal-code"])), !!testPayto.params["receiver-town"] && /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(i18n2.Translate, null, "Town")), /* @__PURE__ */ h("td", null, formPayto?.params["receiver-town"] ?? "--"), /* @__PURE__ */ h("td", null, testPayto.params["receiver-town"])))))
  );
}
function ValidBankAccount({
  onCancel,
  origin,
  targets
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const payto = targets[0];
  const subject = payto.params["message"];
  const accountPart = payto.targetType === PaytoType.TalerBank ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(Row, { name: i18n2.str`Bank host`, value: payto.host }), /* @__PURE__ */ h(Row, { name: i18n2.str`Bank account`, value: payto.account })) : payto.targetType === PaytoType.IBAN ? /* @__PURE__ */ h(p2, null, payto.bic !== void 0 ? /* @__PURE__ */ h(Row, { name: i18n2.str`BIC`, value: payto.bic }) : void 0, /* @__PURE__ */ h(Row, { name: i18n2.str`IBAN`, value: payto.iban })) : void 0;
  const receiverName = payto.params["receiver-name"] || payto.params["receiver"] || void 0;
  const receiverPostalCode = payto.params["receiver-postal-code"] || void 0;
  const receiverTown = payto.params["receiver-town"] || void 0;
  const from2 = origin.targetType === PaytoType.IBAN ? origin.iban : origin.targetType === PaytoType.TalerReserve || origin.targetType === PaytoType.TalerReserveHttp ? origin.reservePub : origin.targetType === PaytoType.Bitcoin ? `${origin.address.substring(0, 8)}...` : origin.targetType === PaytoType.Ethereum ? `${origin.address.substring(0, 8)}...` : origin.displayName;
  const qrs = getQrCodesForPayto(Paytos.toFullString(payto));
  return /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`OK`,
      description: i18n2.str`Validate bank account: ${from2}`,
      active: true,
      onCancel
    },
    /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.")),
    /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", null, /* @__PURE__ */ h("tbody", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, /* @__PURE__ */ h(i18n2.Translate, null, "Step 1:"), "\xA0", /* @__PURE__ */ h(i18n2.Translate, null, "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website."))), accountPart, receiverName ? /* @__PURE__ */ h(Row, { name: i18n2.str`Beneficiary`, value: receiverName }) : void 0, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, /* @__PURE__ */ h(i18n2.Translate, null, "Step 2:"), "\xA0", /* @__PURE__ */ h(i18n2.Translate, null, "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website."))), /* @__PURE__ */ h(Row, { name: i18n2.str`Subject`, value: subject, literal: true }), receiverPostalCode ? /* @__PURE__ */ h(
      Row,
      {
        name: i18n2.str`Receiver postal code`,
        value: receiverPostalCode
      }
    ) : void 0, receiverTown ? /* @__PURE__ */ h(Row, { name: i18n2.str`Receiver town`, value: receiverTown }) : void 0, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, /* @__PURE__ */ h(i18n2.Translate, null, "Step 3:"), "\xA0", /* @__PURE__ */ h(i18n2.Translate, null, "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website."))), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (", /* @__PURE__ */ h(CopyIcon, null), ') to avoid typos or make use of the "payto://" URI below to copy just one value.')))), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, !qrs.length ? void 0 : /* @__PURE__ */ h("div", { style: { overflowY: "auto", height: "95%", padding: 5 } }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:")), /* @__PURE__ */ h("table", { style: { width: "100%" } }, qrs.map((q6, idx) => {
      return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
        "td",
        {
          style: {
            padding: 5,
            borderSpacing: 0,
            borderRadius: 4,
            border: "1px solid black"
          }
        },
        /* @__PURE__ */ h(Accordion, { name: q6.type }, /* @__PURE__ */ h(QR, { text: q6.qrContent }))
      ));
    }))))), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 2, width: "100%" }, /* @__PURE__ */ h(i18n2.Translate, null, "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this", " ", /* @__PURE__ */ h(
      "a",
      {
        target: "_blank",
        rel: "noreferrer",
        title: "RFC 8905 for designating targets for payments",
        href: "https://tools.ietf.org/html/rfc8905"
      },
      "PayTo URI"
    ), " ", "link instead")), /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(CopyButton, { getContent: () => Paytos.toFullString(payto) }))))))
  );
}
function Accordion({
  openedByDefault,
  children,
  name
}) {
  const [opened, setOpened] = p3(!!openedByDefault);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    "button",
    {
      style: {
        color: "#444",
        padding: 8,
        fontSize: "large",
        width: "100%",
        cursor: "pointer",
        textAlign: "left",
        border: "none"
      },
      class: opened ? "accordion active" : "accordion",
      onClick: () => {
        setOpened(!opened);
      }
    },
    name
  ), /* @__PURE__ */ h(
    "div",
    {
      onClick: () => {
        setOpened(!opened);
      },
      class: "dpanel",
      style: {
        display: opened ? "block" : "none",
        padding: "0 18px",
        cursor: "pointer"
      }
    },
    children
  ));
}
function Row({
  name,
  value,
  literal,
  lineBreak
}) {
  const preRef = _2(null);
  const tdRef = _2(null);
  function getContent() {
    return preRef.current?.textContent || tdRef.current?.textContent || "";
  }
  return /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { style: { padding: 4, width: "1%", whiteSpace: "nowrap" } }, /* @__PURE__ */ h("b", null, name)), literal ? /* @__PURE__ */ h("td", { style: { padding: 4 } }, /* @__PURE__ */ h(
    "pre",
    {
      ref: preRef,
      style: {
        whiteSpace: "pre-wrap",
        wordBreak: "break-word",
        lineBreak: lineBreak ? "anywhere" : void 0,
        padding: 4
      }
    },
    value
  )) : /* @__PURE__ */ h("td", { ref: tdRef, style: { padding: 4 } }, value), /* @__PURE__ */ h("td", { style: { padding: 4 } }, /* @__PURE__ */ h(CopyButton, { getContent })));
}
function CopyButton({ getContent }) {
  const [copied, setCopied] = p3(false);
  function copyText() {
    navigator.clipboard.writeText(getContent() || "");
    setCopied(true);
  }
  h2(() => {
    if (copied) {
      setTimeout(() => {
        setCopied(false);
      }, 1e3);
    }
  }, [copied]);
  if (!copied) {
    return /* @__PURE__ */ h("button", { onClick: copyText }, /* @__PURE__ */ h(CopyIcon, null));
  }
  return (
    // <TooltipLeft content="Copied">
    /* @__PURE__ */ h("button", { disabled: true }, /* @__PURE__ */ h(CopiedIcon, null))
  );
}
var CopyIcon = () => /* @__PURE__ */ h("svg", { height: "16", viewBox: "0 0 16 16", width: "16" }, /* @__PURE__ */ h(
  "path",
  {
    "fill-rule": "evenodd",
    d: "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"
  }
), /* @__PURE__ */ h(
  "path",
  {
    "fill-rule": "evenodd",
    d: "M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"
  }
));
var CopiedIcon = () => /* @__PURE__ */ h("svg", { height: "16", viewBox: "0 0 16 16", width: "16" }, /* @__PURE__ */ h(
  "path",
  {
    "fill-rule": "evenodd",
    d: "M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"
  }
));

// src/components/picker/DurationPicker.tsx
init_preact_module();
init_hooks_module();
function DurationPicker({
  days,
  hours,
  minutes,
  seconds,
  onChange,
  value
}) {
  const ss = 1e3;
  const ms = ss * 60;
  const hs = ms * 60;
  const ds = hs * 24;
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "rdp-picker" }, days && /* @__PURE__ */ h(
    DurationColumn,
    {
      unit: i18n2.str`days`,
      max: 99,
      value: Math.floor(value / ds),
      onDecrease: value >= ds ? () => onChange(value - ds) : void 0,
      onIncrease: value < 99 * ds ? () => onChange(value + ds) : void 0,
      onChange: (diff) => onChange(value + diff * ds)
    }
  ), hours && /* @__PURE__ */ h(
    DurationColumn,
    {
      unit: i18n2.str`hours`,
      max: 23,
      min: 1,
      value: Math.floor(value / hs) % 24,
      onDecrease: value >= hs ? () => onChange(value - hs) : void 0,
      onIncrease: value < 99 * ds ? () => onChange(value + hs) : void 0,
      onChange: (diff) => onChange(value + diff * hs)
    }
  ), minutes && /* @__PURE__ */ h(
    DurationColumn,
    {
      unit: i18n2.str`minutes`,
      max: 59,
      min: 1,
      value: Math.floor(value / ms) % 60,
      onDecrease: value >= ms ? () => onChange(value - ms) : void 0,
      onIncrease: value < 99 * ds ? () => onChange(value + ms) : void 0,
      onChange: (diff) => onChange(value + diff * ms)
    }
  ), seconds && /* @__PURE__ */ h(
    DurationColumn,
    {
      unit: i18n2.str`seconds`,
      max: 59,
      value: Math.floor(value / ss) % 60,
      onDecrease: value >= ss ? () => onChange(value - ss) : void 0,
      onIncrease: value < 99 * ds ? () => onChange(value + ss) : void 0,
      onChange: (diff) => onChange(value + diff * ss)
    }
  ));
}
function InputNumber({
  initial: initial4,
  onChange
}) {
  const [value, handler] = p3({
    v: toTwoDigitString(initial4)
  });
  return /* @__PURE__ */ h(
    "input",
    {
      value: value.v,
      onBlur: (e5) => onChange(parseInt(value.v, 10)),
      onInput: (e5) => {
        e5.preventDefault();
        const n2 = Number.parseInt(e5.currentTarget.value, 10);
        if (isNaN(n2))
          return handler({ v: toTwoDigitString(initial4) });
        return handler({ v: toTwoDigitString(n2) });
      },
      style: {
        width: 50,
        border: "none",
        fontSize: "inherit",
        background: "inherit"
      }
    }
  );
}
function DurationColumn({
  unit,
  min = 0,
  max,
  value,
  onIncrease,
  onDecrease,
  onChange
}) {
  const cellHeight = 35;
  return /* @__PURE__ */ h("div", { class: "rdp-column-container" }, /* @__PURE__ */ h("div", { class: "rdp-masked-div" }, /* @__PURE__ */ h("hr", { class: "rdp-reticule", style: { top: cellHeight * 2 - 1 } }), /* @__PURE__ */ h("hr", { class: "rdp-reticule", style: { top: cellHeight * 3 - 1 } }), /* @__PURE__ */ h("div", { class: "rdp-column", style: { top: 0 } }, /* @__PURE__ */ h("div", { class: "rdp-cell", key: value - 2 }, onDecrease && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      style: { width: "100%", textAlign: "center", margin: 5 },
      onClick: onDecrease
    },
    /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-chevron-up" }))
  )), /* @__PURE__ */ h("div", { class: "rdp-cell", key: value - 1 }, value > min ? toTwoDigitString(value - 1) : ""), /* @__PURE__ */ h("div", { class: "rdp-cell rdp-center", key: value }, onChange ? /* @__PURE__ */ h(
    InputNumber,
    {
      initial: value,
      onChange: (n2) => onChange(n2 - value)
    }
  ) : toTwoDigitString(value), /* @__PURE__ */ h("div", null, unit)), /* @__PURE__ */ h("div", { class: "rdp-cell", key: value + 1 }, value < max ? toTwoDigitString(value + 1) : ""), /* @__PURE__ */ h("div", { class: "rdp-cell", key: value + 2 }, onIncrease && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      style: { width: "100%", textAlign: "center", margin: 5 },
      onClick: onIncrease
    },
    /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-chevron-down" }))
  )))));
}
function toTwoDigitString(n2) {
  if (n2 < 10) {
    return `0${n2}`;
  }
  return `${n2}`;
}

// src/components/form/InputDuration.tsx
function InputDuration({
  name,
  expand,
  placeholder,
  tooltip,
  label,
  help,
  readonly,
  withForever,
  withoutClear,
  side,
  useProtocolDuration
}) {
  const [opened, setOpened] = p3(false);
  const { i18n: i18n2 } = useTranslationContext();
  const { error: error2, required, value: anyValue, onChange } = useField(name);
  let strValue = "";
  const value = anyValue && anyValue.d_us !== void 0 ? Duration.fromTalerProtocolDuration(anyValue) : anyValue;
  if (!value) {
    strValue = "";
  } else if (value.d_ms === "forever") {
    strValue = i18n2.str`Forever`;
  } else {
    if (value.d_ms === void 0) {
      throw Error(
        `assertion error: duration should have a d_ms but got '${JSON.stringify(
          value
        )}'`
      );
    }
    strValue = formatDuration2(
      intervalToDuration2({ start: 0, end: value.d_ms }),
      {
        locale: {
          formatDistance: (name2, value2) => {
            switch (name2) {
              case "xMonths":
                return i18n2.str`${value2}M`;
              case "xYears":
                return i18n2.str`${value2}Y`;
              case "xDays":
                return i18n2.str`${value2}d`;
              case "xHours":
                return i18n2.str`${value2}h`;
              case "xMinutes":
                return i18n2.str`${value2}min`;
              case "xSeconds":
                return i18n2.str`${value2}sec`;
              default:
                throw Error("not reached");
            }
          },
          localize: {
            day: () => "s",
            month: () => "m",
            ordinalNumber: () => "th",
            dayPeriod: () => "p",
            quarter: () => "w",
            era: () => "e"
          }
        }
      }
    );
  }
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, /* @__PURE__ */ h("p", { class: expand ? "control is-expanded " : "control " }, /* @__PURE__ */ h(
    "input",
    {
      class: "input",
      type: "text",
      readonly: true,
      value: strValue,
      placeholder,
      onClick: () => {
        if (!readonly)
          setOpened(true);
      }
    }
  )), /* @__PURE__ */ h(
    "div",
    {
      class: "control",
      onClick: () => {
        if (!readonly)
          setOpened(true);
      }
    },
    /* @__PURE__ */ h("a", { class: "button is-static" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-clock" })))
  )), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2), /* @__PURE__ */ h("span", { class: "has-text-grey" }, help)), withForever && /* @__PURE__ */ h("span", { "data-tooltip": i18n2.str`Change value to never` }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info mr-3",
      onClick: () => onChange({ d_ms: "forever" })
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Forever")
  )), !readonly && !withoutClear && /* @__PURE__ */ h("span", { "data-tooltip": i18n2.str`Change value to empty` }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info mr-3",
      onClick: () => onChange(void 0)
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Clear")
  )), side), opened && /* @__PURE__ */ h(SimpleModal, { onCancel: () => setOpened(false) }, /* @__PURE__ */ h(
    DurationPicker,
    {
      days: true,
      hours: true,
      minutes: true,
      value: !value || value.d_ms === "forever" ? 0 : value.d_ms,
      onChange: (v3) => {
        let duration = { d_ms: v3 };
        if (useProtocolDuration === true) {
          onChange(Duration.toTalerProtocolDuration(duration));
        } else {
          onChange(duration);
        }
      }
    }
  )));
}

// src/components/form/InputGroup.tsx
init_preact_module();
init_hooks_module();

// src/components/form/useGroupField.tsx
function useGroupField(name) {
  const f3 = useFormContext();
  if (!f3)
    return {};
  return {
    hasError: readField2(f3.errors, String(name))
  };
}
var readField2 = (object, name) => {
  return name.split(".").reduce((prev, current) => prev && prev[current], object);
};

// src/components/form/InputGroup.tsx
function InputGroup({
  name,
  label,
  children,
  tooltip,
  alternative,
  fixed,
  initialActive
}) {
  const [active, setActive] = p3(initialActive || fixed);
  const group = useGroupField(name);
  return /* @__PURE__ */ h("div", { class: "card" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, label, tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })), group?.hasError && /* @__PURE__ */ h("span", { class: "has-text-danger", "data-tooltip": tooltip, style: { marginLeft: 5 } }, "*")), !fixed && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "card-header-icon",
      "aria-label": "more options",
      onClick: () => setActive(!active)
    },
    /* @__PURE__ */ h("span", { class: "icon" }, active ? /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-up" }) : /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-down" }))
  )), active ? /* @__PURE__ */ h("div", { class: "card-content" }, children) : alternative ? /* @__PURE__ */ h("div", { class: "card-content" }, alternative) : void 0);
}

// src/components/form/InputImage.tsx
init_preact_module();
init_hooks_module();
function InputImage({
  name,
  readonly,
  placeholder,
  tooltip,
  label,
  help,
  children,
  expand
}) {
  const { error: error2, value, onChange } = useField(name);
  const image = _2(null);
  const { i18n: i18n2 } = useTranslationContext();
  const [sizeError, setSizeError] = p3(false);
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: expand ? "control is-expanded" : "control" }, value && /* @__PURE__ */ h(
    "img",
    {
      src: value,
      style: { width: 200, height: 200 },
      onClick: () => image.current?.click()
    }
  ), /* @__PURE__ */ h(
    "input",
    {
      ref: image,
      style: { display: "none" },
      type: "file",
      name: String(name),
      placeholder,
      readonly,
      onChange: (e5) => {
        const f3 = e5.currentTarget.files;
        console.log("on change", e5, f3);
        if (!f3 || f3.length != 1) {
          return onChange(void 0);
        }
        if (f3[0].size > MAX_IMAGE_SIZE) {
          setSizeError(true);
          return onChange(void 0);
        }
        setSizeError(false);
        return f3[0].arrayBuffer().then((b5) => {
          const b64 = window.btoa(
            new Uint8Array(b5).reduce(
              (data, byte) => data + String.fromCharCode(byte),
              ""
            )
          );
          return onChange(
            `data:${f3[0].type};base64,${b64}`
          );
        });
      }
    }
  ), help, children), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2), sizeError && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Image must be smaller than 1 MB")), !value && /* @__PURE__ */ h("button", { class: "button", onClick: () => image.current?.click() }, /* @__PURE__ */ h(i18n2.Translate, null, "Add")), value && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button",
      onClick: () => {
        if (image.current) {
          image.current.value = "";
        }
        onChange(void 0);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Remove")
  ))));
}

// src/components/form/InputLocation.tsx
init_preact_module();
function InputLocation({ name }) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(Input, { name: `${name}.country`, label: i18n2.str`Country` }), /* @__PURE__ */ h(
    Input,
    {
      name: `${name}.building_number`,
      label: i18n2.str`Building number`
    }
  ), /* @__PURE__ */ h(Input, { name: `${name}.building_name`, label: i18n2.str`Building name` }), /* @__PURE__ */ h(Input, { name: `${name}.street`, label: i18n2.str`Street` }), /* @__PURE__ */ h(Input, { name: `${name}.post_code`, label: i18n2.str`Post code` }), /* @__PURE__ */ h(Input, { name: `${name}.town_location`, label: i18n2.str`Town location` }), /* @__PURE__ */ h(Input, { name: `${name}.town`, label: i18n2.str`Town` }), /* @__PURE__ */ h(Input, { name: `${name}.district`, label: i18n2.str`District` }), /* @__PURE__ */ h(
    Input,
    {
      name: `${name}.country_subdivision`,
      label: i18n2.str`Country subdivision`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: `${name}.address_lines`,
      inputType: "multiline",
      label: i18n2.str`Additional address lines`,
      toStr: (v3) => !v3 ? "" : v3.join("\n"),
      fromStr: (v3) => v3.split("\n")
    }
  ));
}

// src/components/form/InputToggle.tsx
init_preact_module();
var defaultToBoolean = (f3) => f3;
var defaultFromBoolean = (v3) => v3;
function InputToggle({
  name,
  readonly,
  placeholder,
  tooltip,
  label,
  help,
  threeState,
  side,
  expand,
  fromBoolean = defaultFromBoolean,
  toBoolean = defaultToBoolean
}) {
  const { error: error2, value, onChange, required } = useField(name);
  const onCheckboxClick = () => {
    const c5 = toBoolean(value);
    if (c5 === false && threeState)
      return onChange(void 0);
    return onChange(fromBoolean(!c5));
  };
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: expand ? "control is-expanded" : "control" }, /* @__PURE__ */ h("label", { class: "toggle", style: { marginLeft: 4, marginTop: 0 } }, /* @__PURE__ */ h(
    "input",
    {
      type: "checkbox",
      class: "toggle-checkbox",
      checked: toBoolean(value),
      placeholder,
      ref: (d6) => {
        if (d6) {
          d6.indeterminate = !!threeState && toBoolean(value) === void 0;
        }
      },
      readonly,
      name: String(name),
      disabled: readonly,
      onChange: onCheckboxClick
    }
  ), /* @__PURE__ */ h(
    "div",
    {
      class: `toggle-switch ${readonly ? "disabled" : ""} ${toBoolean(value) === void 0 ? "no-dot" : ""}`,
      style: { cursor: readonly ? "default" : void 0 }
    }
  )), /* @__PURE__ */ h("p", null, help)), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2)), side));
}

// src/components/form/InputWithAddon.tsx
init_preact_module();
var defaultToString2 = (f3) => f3 || "";
var defaultFromString2 = (v3) => v3;
function InputWithAddon({
  name,
  readonly,
  addonBefore,
  children,
  expand,
  label,
  addonBeforeLarge,
  placeholder,
  help,
  tooltip,
  inputType,
  inputExtra,
  side,
  addonAfter,
  addonAfterAction,
  toStr = defaultToString2,
  fromStr = defaultFromString2
}) {
  const { error: error2, value, onChange, required } = useField(name);
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, addonBefore && addonBeforeLarge && /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("a", { class: "button is-static" }, addonBefore)), /* @__PURE__ */ h("div", { class: "field has-addons" }, addonBefore && !addonBeforeLarge && /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("a", { class: "button is-static" }, addonBefore)), /* @__PURE__ */ h(
    "p",
    {
      class: `control${expand ? " is-expanded" : ""}${required ? " has-icons-right" : ""}`
    },
    /* @__PURE__ */ h(
      "input",
      {
        ...inputExtra || {},
        class: error2 ? "input is-danger" : "input",
        type: inputType,
        placeholder,
        readonly,
        disabled: readonly,
        name: String(name),
        value: toStr(value),
        onChange: (e5) => onChange(fromStr(e5.currentTarget.value))
      }
    ),
    children
  ), addonAfter && /* @__PURE__ */ h(
    "div",
    {
      class: "control",
      onClick: addonAfterAction,
      style: { cursor: addonAfterAction ? "pointer" : void 0 }
    },
    /* @__PURE__ */ h("a", { class: "button is-static" }, addonAfter)
  )), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2), /* @__PURE__ */ h("span", { class: "has-text-grey" }, help)), expand ? /* @__PURE__ */ h("div", null, side) : side));
}

// src/components/menu/SideBar.tsx
init_preact_module();

// src/hooks/instance.ts
init_hooks_module();
init_compat_module();
var useSWR2 = useSWR;
function revalidateInstanceDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getCurrentInstanceDetails",
    void 0,
    { revalidate: true }
  );
}
function useInstanceDetails() {
  const { state, lib } = useSessionContext();
  async function fetcher([token]) {
    return await lib.instance.getCurrentInstanceDetails(token);
  }
  const { data, error: error2 } = useSWR2([state.token, "getCurrentInstanceDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}
function useAsyncWithRetry(fetcher, retry) {
  const [result, setResult] = p3();
  const [error2, setError] = p3();
  const [retryCounter, setRetryCounter] = p3(0);
  let unloaded = false;
  h2(() => {
    if (fetcher) {
      fetcher().then((resp) => {
        if (unloaded)
          return;
        setResult(resp);
      }).catch((error3) => {
        if (unloaded)
          return;
        setError(error3);
      });
    }
    return () => {
      unloaded = true;
    };
  }, [fetcher, retryCounter]);
  h2(() => {
    if (retry && retry(result, error2)) {
      setRetryCounter((c5) => c5 + 1);
    }
    return () => {
      unloaded = true;
    };
  }, [result, error2]);
  return { result, error: error2 };
}
var latestRequestTime = 0;
function useInstanceKYCDetailsLongPolling() {
  const { state, lib } = useSessionContext();
  const [latestReason, setLatestReason] = p3();
  const token = state.token;
  const fetcher = F(() => {
    return async () => {
      const DEFAULT_WAIT = 5e3;
      const now2 = (/* @__PURE__ */ new Date()).getTime();
      if (latestReason) {
        const diff = now2 - latestRequestTime;
        if (diff < DEFAULT_WAIT) {
          console.log("PREVENT REQUEST BURST");
          await delayMs(DEFAULT_WAIT);
        }
      }
      latestRequestTime = (/* @__PURE__ */ new Date()).getTime();
      return lib.instance.getCurrentInstanceKycStatus(token, {
        timeout: DEFAULT_WAIT,
        reason: latestReason
      });
    };
  }, [token, latestReason]);
  const { result: data, error: error2 } = useAsyncWithRetry(fetcher, (r3, err) => {
    if (err !== void 0)
      return false;
    if (r3 == void 0)
      return false;
    if (r3.type === "fail") {
      return false;
    }
    if (!r3.body) {
      return false;
    }
    const acc = getLongPollingReasonSet(r3.body.kyc_data);
    return acc !== void 0;
  });
  const currentStatus = data !== void 0 && data.type === "ok" && data.body ? getLongPollingReasonSet(data.body.kyc_data) : void 0;
  h2(() => {
    if (currentStatus !== void 0 && currentStatus !== latestReason) {
      setLatestReason(currentStatus);
    }
  }, [currentStatus]);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}
function getLongPollingReasonSet(data) {
  const acc = data.find((k6) => getLongPollingReason(k6));
  if (!acc)
    return void 0;
  return getLongPollingReason(acc);
}
function getLongPollingReason(acc) {
  switch (acc.status) {
    case MerchantAccountKycStatus.READY:
    case MerchantAccountKycStatus.KYC_WIRE_IMPOSSIBLE:
    case MerchantAccountKycStatus.LOGIC_BUG:
    case MerchantAccountKycStatus.NO_EXCHANGE_KEY:
    case MerchantAccountKycStatus.EXCHANGE_INTERNAL_ERROR:
    case MerchantAccountKycStatus.EXCHANGE_GATEWAY_TIMEOUT:
    case MerchantAccountKycStatus.EXCHANGE_UNREACHABLE:
    case MerchantAccountKycStatus.EXCHANGE_STATUS_INVALID:
      return void 0;
    case MerchantAccountKycStatus.KYC_WIRE_REQUIRED:
      return KycStatusLongPollingReason.AUTH_TRANSFER;
    case MerchantAccountKycStatus.KYC_REQUIRED:
      return KycStatusLongPollingReason.TO_BE_OK;
    case MerchantAccountKycStatus.AWAITING_AML_REVIEW:
      return KycStatusLongPollingReason.AML_INVESTIGATION;
    default: {
      assertUnreachable(acc.status);
    }
  }
}
function revalidateManagedInstanceDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getInstanceDetails",
    void 0,
    { revalidate: true }
  );
}
function useManagedInstanceDetails(instanceId) {
  const { state, lib } = useSessionContext();
  async function fetcher([token, instanceId2]) {
    return await lib.instance.getInstanceDetails(token, instanceId2);
  }
  const { data, error: error2 } = useSWR2([state.token, instanceId, "getInstanceDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}
function revalidateBackendInstances() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listInstances",
    void 0,
    { revalidate: true }
  );
}
function useBackendInstances() {
  const { state, lib } = useSessionContext();
  async function fetcher([token]) {
    return await lib.instance.listInstances(token);
  }
  const { data, error: error2 } = useSWR2([state.token, "listInstances"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/components/menu/LangSelector.tsx
init_preact_module();
init_hooks_module();

// src/assets/icons/languageicon.svg
var languageicon_default = "./languageicon-LWKRUH5D.svg";

// src/components/menu/LangSelector.tsx
var names = {
  uk: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430 [uk]",
  tr: "T\xFCrk\xE7e [tr]",
  sv: "Svenska [sv]",
  it: "Italiano [it]",
  fr: "Fran\xE7ais [fr]",
  es: "Espa\xF1ol [es]",
  de: "Deutsch [de]",
  en: "English [en]"
};
function getLangName(s6) {
  if (names[s6])
    return names[s6];
  return s6;
}
function LangSelector() {
  const [updatingLang, setUpdatingLang] = p3(false);
  const { lang, changeLanguage } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "dropdown is-active " }, /* @__PURE__ */ h("div", { class: "dropdown-trigger" }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button has-tooltip-left",
      "data-tooltip": "change language selection",
      "aria-haspopup": "true",
      "aria-controls": "dropdown-menu",
      onClick: () => setUpdatingLang(!updatingLang)
    },
    /* @__PURE__ */ h("div", { class: "icon is-small is-left" }, /* @__PURE__ */ h("img", { src: languageicon_default })),
    /* @__PURE__ */ h("span", null, getLangName(lang)),
    /* @__PURE__ */ h("div", { class: "icon is-right" }, /* @__PURE__ */ h("i", { class: "mdi mdi-chevron-down" }))
  )), updatingLang && /* @__PURE__ */ h("div", { class: "dropdown-menu", id: "dropdown-menu", role: "menu" }, /* @__PURE__ */ h("div", { class: "dropdown-content" }, Object.keys(names).filter((l3) => l3 !== lang).map((l3) => /* @__PURE__ */ h(
    "a",
    {
      key: l3,
      class: "dropdown-item",
      value: l3,
      onClick: () => {
        changeLanguage(l3);
        setUpdatingLang(false);
      }
    },
    getLangName(l3)
  )))));
}

// src/components/menu/SideBar.tsx
var VERSION = true ? "1.3.0" : void 0;
function Sidebar({ mobile }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state, logOut, config } = useSessionContext();
  const kycStatus = useInstanceKYCDetailsLongPolling();
  const allKycData = kycStatus !== void 0 && !(kycStatus instanceof TalerError) && kycStatus.type === "ok" && !!kycStatus.body ? kycStatus.body.kyc_data : [];
  const simplifiedKycStatus = allKycData.reduce((prev, cur) => {
    const st = getMerchantAccountKycStatusSimplified(cur.status);
    if (st > prev)
      return st;
    return prev;
  }, MerchantAccountKycStatusSimplified.OK);
  const [{ persona }] = usePreference();
  const hideKycMenuItem = simplifiedKycStatus === MerchantAccountKycStatusSimplified.OK && persona !== "expert";
  const isLoggedIn = state.status === "loggedIn";
  const hasToken = isLoggedIn && state.token !== void 0;
  return /* @__PURE__ */ h(
    "aside",
    {
      class: "aside is-placed-left is-expanded",
      style: { overflowY: "scroll" }
    },
    mobile && /* @__PURE__ */ h(
      "div",
      {
        class: "footer",
        onClick: (e5) => {
          return e5.stopImmediatePropagation();
        }
      },
      /* @__PURE__ */ h(LangSelector, null)
    ),
    /* @__PURE__ */ h("div", { class: "aside-tools" }, /* @__PURE__ */ h("div", { class: "aside-tools-label" }, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("b", null, "Taler"), " Backoffice"), /* @__PURE__ */ h(
      "div",
      {
        class: "is-size-7 has-text-right",
        style: { lineHeight: 0, marginTop: -10 }
      },
      VERSION,
      " (",
      config.version,
      ")"
    ))),
    /* @__PURE__ */ h("div", { class: "menu is-menu-main" }, isLoggedIn ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("ul", { class: "menu-list" }, /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 0 /* sidebar_orders */
      },
      /* @__PURE__ */ h("a", { href: "#/orders", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash-register" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Orders")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 1 /* sidebar_inventory */
      },
      /* @__PURE__ */ h("a", { href: "#/inventory", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-shopping" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Inventory")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 2 /* sidebar_categories */
      },
      /* @__PURE__ */ h("a", { href: "#/category", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-label-outline" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Categories")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 3 /* sidebar_wireTransfers */
      },
      /* @__PURE__ */ h("a", { href: "#/transfers", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-left-right" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Wire transfers")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 4 /* sidebar_templates */
      },
      /* @__PURE__ */ h("a", { href: "#/templates", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-qrcode" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Templates")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 11 /* sidebar_statistics */
      },
      /* @__PURE__ */ h("a", { href: "#/statistics", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-counter" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Statistics")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 9 /* sidebar_tokenFamilies */
      },
      /* @__PURE__ */ h("a", { href: "#/tokenfamilies", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-clock" })), /* @__PURE__ */ h(i18n2.Translate, null, "Subscriptions and Discounts")))
    )), /* @__PURE__ */ h("p", { class: "menu-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Configuration")), /* @__PURE__ */ h("ul", { class: "menu-list" }, /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 6 /* sidebar_bankAccounts */
      },
      /* @__PURE__ */ h("a", { href: "#/bank", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-bank" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Bank account")))
    ), hideKycMenuItem ? void 0 : /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 5 /* sidebar_kycStatus */,
        class: simplifiedKycStatus === MerchantAccountKycStatusSimplified.WARNING ? "is-warning" : simplifiedKycStatus === MerchantAccountKycStatusSimplified.ERROR ? "is-error" : simplifiedKycStatus === MerchantAccountKycStatusSimplified.ACTION_REQUIRED ? "is-warning" : void 0
      },
      /* @__PURE__ */ h(
        "a",
        {
          href: "#/kyc",
          class: "has-icon",
          style: simplifiedKycStatus === MerchantAccountKycStatusSimplified.WARNING ? {
            backgroundColor: "darkorange",
            color: "black"
          } : simplifiedKycStatus === MerchantAccountKycStatusSimplified.ERROR ? {
            backgroundColor: "darkred",
            color: "black"
          } : simplifiedKycStatus === MerchantAccountKycStatusSimplified.ACTION_REQUIRED ? {
            backgroundColor: "darkorange",
            color: "black"
          } : void 0
        },
        /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-account-check" })),
        /* @__PURE__ */ h("span", { class: "menu-item-label" }, "KYC Status")
      )
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 7 /* sidebar_otpDevices */
      },
      /* @__PURE__ */ h("a", { href: "#/otp-devices", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-lock" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "OTP Devices")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 8 /* sidebar_webhooks */
      },
      /* @__PURE__ */ h("a", { href: "#/webhooks", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-webhook" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Webhooks")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 13 /* sidebar_settings */
      },
      /* @__PURE__ */ h("a", { href: "#/settings", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-square-edit-outline" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Settings")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 14 /* sidebar_password */
      },
      /* @__PURE__ */ h("a", { href: "#/password", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-security" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Password")))
    ), /* @__PURE__ */ h(
      HtmlPersonaFlag,
      {
        htmlElement: "li",
        point: 15 /* sidebar_accessTokens */
      },
      /* @__PURE__ */ h("a", { href: "#/access-token", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-key" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Access tokens")))
    ))) : void 0, /* @__PURE__ */ h("p", { class: "menu-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Connection")), /* @__PURE__ */ h("ul", { class: "menu-list" }, /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("a", { class: "has-icon is-state-info is-hoverable", href: "#/interface" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-newspaper" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Personalization")))), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("span", { style: { width: "3rem" }, class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-web" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, state.backendUrl.hostname))), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("span", { style: { width: "3rem" }, class: "icon" }, "ID"), /* @__PURE__ */ h("span", { class: "menu-item-label" }, state.instance))), state.isAdmin && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("p", { class: "menu-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Instances")), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("a", { href: "#/instance/new", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "New")))), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("a", { href: "#/instances", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-format-list-bulleted" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "List"))))), hasToken ? /* @__PURE__ */ h("li", null, /* @__PURE__ */ h(
      "a",
      {
        class: "has-icon is-state-info is-hoverable",
        onClick: (e5) => {
          logOut();
          e5.preventDefault();
        }
      },
      /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-logout default" })),
      /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Log out"))
    )) : void 0))
  );
}
var ALL_ELEMENTS = Object.values(UIElement).reduce((prev, ui) => {
  prev[ui] = true;
  return prev;
}, {});
function getAvailableForPersona(p4) {
  switch (p4) {
    case "developer":
      return ALL_ELEMENTS;
    case "expert":
      return {
        [0 /* sidebar_orders */]: true,
        [4 /* sidebar_templates */]: true,
        [5 /* sidebar_kycStatus */]: true,
        [6 /* sidebar_bankAccounts */]: true,
        [13 /* sidebar_settings */]: true,
        [14 /* sidebar_password */]: true,
        [15 /* sidebar_accessTokens */]: true,
        [2 /* sidebar_categories */]: true,
        [8 /* sidebar_webhooks */]: true,
        [3 /* sidebar_wireTransfers */]: true,
        [1 /* sidebar_inventory */]: true,
        [7 /* sidebar_otpDevices */]: true,
        [16 /* action_createOrderManually */]: true,
        [19 /* option_advanceInstanceSettings */]: true,
        [18 /* option_advanceOrderCreation */]: true,
        [17 /* option_otpDevicesOnTemplate */]: true,
        [21 /* option_paymentTimeoutOnTemplate */]: true,
        [20 /* action_useRevenueApi */]: true,
        [23 /* option_inventoryTaxes */]: true,
        [11 /* sidebar_statistics */]: false,
        [12 /* sidebar_discounts */]: false,
        [10 /* sidebar_subscriptions */]: false,
        [9 /* sidebar_tokenFamilies */]: false,
        [22 /* option_ageRestriction */]: false,
        [24 /* option_refreshableScopes */]: false
      };
    case "offline-vending-machine":
      return {
        [0 /* sidebar_orders */]: true,
        [4 /* sidebar_templates */]: true,
        [5 /* sidebar_kycStatus */]: true,
        [6 /* sidebar_bankAccounts */]: true,
        [13 /* sidebar_settings */]: true,
        [14 /* sidebar_password */]: true,
        [15 /* sidebar_accessTokens */]: false,
        [2 /* sidebar_categories */]: false,
        [12 /* sidebar_discounts */]: false,
        [10 /* sidebar_subscriptions */]: false,
        [9 /* sidebar_tokenFamilies */]: false,
        [8 /* sidebar_webhooks */]: false,
        [3 /* sidebar_wireTransfers */]: false,
        [1 /* sidebar_inventory */]: false,
        [7 /* sidebar_otpDevices */]: false,
        [16 /* action_createOrderManually */]: false,
        [19 /* option_advanceInstanceSettings */]: false,
        [18 /* option_advanceOrderCreation */]: false,
        [17 /* option_otpDevicesOnTemplate */]: false,
        [21 /* option_paymentTimeoutOnTemplate */]: false,
        [22 /* option_ageRestriction */]: false,
        [20 /* action_useRevenueApi */]: false,
        [23 /* option_inventoryTaxes */]: false,
        [11 /* sidebar_statistics */]: false,
        [24 /* option_refreshableScopes */]: false
      };
    case "point-of-sale":
      return {
        [0 /* sidebar_orders */]: true,
        [4 /* sidebar_templates */]: true,
        [1 /* sidebar_inventory */]: true,
        [2 /* sidebar_categories */]: true,
        [15 /* sidebar_accessTokens */]: false,
        [5 /* sidebar_kycStatus */]: true,
        [6 /* sidebar_bankAccounts */]: true,
        [13 /* sidebar_settings */]: true,
        [14 /* sidebar_password */]: true,
        [12 /* sidebar_discounts */]: false,
        [10 /* sidebar_subscriptions */]: false,
        [9 /* sidebar_tokenFamilies */]: false,
        [8 /* sidebar_webhooks */]: false,
        [3 /* sidebar_wireTransfers */]: false,
        [7 /* sidebar_otpDevices */]: false,
        [16 /* action_createOrderManually */]: false,
        [19 /* option_advanceInstanceSettings */]: false,
        [18 /* option_advanceOrderCreation */]: false,
        [17 /* option_otpDevicesOnTemplate */]: false,
        [21 /* option_paymentTimeoutOnTemplate */]: false,
        [22 /* option_ageRestriction */]: false,
        [20 /* action_useRevenueApi */]: false,
        [23 /* option_inventoryTaxes */]: false,
        [11 /* sidebar_statistics */]: false,
        [24 /* option_refreshableScopes */]: false
      };
    case "digital-publishing":
      return {
        [0 /* sidebar_orders */]: true,
        [15 /* sidebar_accessTokens */]: false,
        [5 /* sidebar_kycStatus */]: true,
        [6 /* sidebar_bankAccounts */]: true,
        [13 /* sidebar_settings */]: true,
        [14 /* sidebar_password */]: true,
        [11 /* sidebar_statistics */]: false,
        [4 /* sidebar_templates */]: false,
        [2 /* sidebar_categories */]: false,
        [12 /* sidebar_discounts */]: false,
        [10 /* sidebar_subscriptions */]: false,
        [9 /* sidebar_tokenFamilies */]: false,
        [8 /* sidebar_webhooks */]: false,
        [3 /* sidebar_wireTransfers */]: false,
        [1 /* sidebar_inventory */]: false,
        [7 /* sidebar_otpDevices */]: false,
        [16 /* action_createOrderManually */]: false,
        [19 /* option_advanceInstanceSettings */]: false,
        [18 /* option_advanceOrderCreation */]: false,
        [17 /* option_otpDevicesOnTemplate */]: false,
        [21 /* option_paymentTimeoutOnTemplate */]: false,
        [22 /* option_ageRestriction */]: false,
        [20 /* action_useRevenueApi */]: false,
        [23 /* option_inventoryTaxes */]: false,
        [24 /* option_refreshableScopes */]: false
      };
    case "e-commerce":
      return {
        [0 /* sidebar_orders */]: true,
        [8 /* sidebar_webhooks */]: true,
        [15 /* sidebar_accessTokens */]: false,
        [5 /* sidebar_kycStatus */]: true,
        [6 /* sidebar_bankAccounts */]: true,
        [13 /* sidebar_settings */]: true,
        [14 /* sidebar_password */]: true,
        [11 /* sidebar_statistics */]: false,
        [4 /* sidebar_templates */]: false,
        [2 /* sidebar_categories */]: false,
        [12 /* sidebar_discounts */]: false,
        [10 /* sidebar_subscriptions */]: false,
        [9 /* sidebar_tokenFamilies */]: false,
        [3 /* sidebar_wireTransfers */]: false,
        [1 /* sidebar_inventory */]: false,
        [7 /* sidebar_otpDevices */]: false,
        [16 /* action_createOrderManually */]: false,
        [19 /* option_advanceInstanceSettings */]: false,
        [18 /* option_advanceOrderCreation */]: false,
        [17 /* option_otpDevicesOnTemplate */]: false,
        [21 /* option_paymentTimeoutOnTemplate */]: false,
        [22 /* option_ageRestriction */]: false,
        [20 /* action_useRevenueApi */]: false,
        [23 /* option_inventoryTaxes */]: false,
        [24 /* option_refreshableScopes */]: false
      };
  }
}
function HtmlPersonaFlag(props) {
  const { htmlElement: el, children, point, ...rest } = props;
  const [{ persona }] = usePreference();
  const { config } = useSessionContext();
  const isEnabled = getAvailableForPersona(persona ?? config.default_persona)[point];
  if (isEnabled)
    return h(el, rest, children);
  return null;
}
function ComponentPersonaFlag(props) {
  const { children, point, Comp, ...rest } = props;
  const [{ persona }] = usePreference();
  const { config } = useSessionContext();
  const isEnabled = getAvailableForPersona(persona ?? config.default_persona)[point];
  const d6 = rest;
  if (isEnabled)
    return /* @__PURE__ */ h(Comp, { ...d6 }, children);
  return null;
}
function FragmentPersonaFlag(props) {
  const { children, point } = props;
  const [{ persona }] = usePreference();
  const { config } = useSessionContext();
  const isEnabled = getAvailableForPersona(persona ?? config.default_persona)[point];
  if (props.showAnywayIf === true || isEnabled)
    return /* @__PURE__ */ h(p2, null, children);
  return null;
}

// src/components/form/InputSelector.tsx
init_preact_module();
var defaultToString3 = (f3) => f3 || "";
var defaultFromString3 = (v3) => v3;
function InputSelector({
  name,
  readonly,
  expand,
  placeholder,
  tooltip,
  label,
  help,
  values,
  fromStr = defaultFromString3,
  toStr = defaultToString3
}) {
  const { error: error2, value, onChange, required } = useField(name);
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field has-icons-right" }, /* @__PURE__ */ h("p", { class: expand ? "control is-expanded select" : "control select " }, /* @__PURE__ */ h(
    "select",
    {
      class: error2 ? "select is-danger" : "select",
      name: String(name),
      disabled: readonly,
      readonly,
      onChange: (e5) => {
        onChange(fromStr(e5.currentTarget.value));
      }
    },
    placeholder && /* @__PURE__ */ h("option", null, placeholder),
    values.map((v3, i5) => {
      return /* @__PURE__ */ h("option", { key: i5, value: v3, selected: value === v3 }, toStr(v3));
    })
  )), /* @__PURE__ */ h("p", { class: "help" }, help), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2))));
}

// src/components/instance/DefaultInstanceFormFields.tsx
function DefaultInstanceFormFields({
  readonlyId,
  showId
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state } = useSessionContext();
  return /* @__PURE__ */ h(p2, null, showId && /* @__PURE__ */ h(
    InputWithAddon,
    {
      name: "id",
      addonBefore: new URL("instances/", state.backendUrl.href).href,
      readonly: readonlyId,
      label: i18n2.str`Username`,
      tooltip: i18n2.str`Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "name",
      label: i18n2.str`Business name`,
      tooltip: i18n2.str`Legal name of the business represented by this instance.`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "email",
      label: i18n2.str`Email`,
      tooltip: i18n2.str`Contact email`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "phone_number",
      label: i18n2.str`Phone number`,
      tooltip: i18n2.str`Contact phone`
    }
  ), /* @__PURE__ */ h(FragmentPersonaFlag, { point: 19 /* option_advanceInstanceSettings */ }, /* @__PURE__ */ h(
    Input,
    {
      name: "website",
      label: i18n2.str`Website URL`,
      tooltip: i18n2.str`URL.`
    }
  ), /* @__PURE__ */ h(
    InputImage,
    {
      name: "logo",
      label: i18n2.str`Logo`,
      tooltip: i18n2.str`Logo image.`
    }
  ), /* @__PURE__ */ h(
    InputGroup,
    {
      name: "address",
      label: i18n2.str`Address`,
      tooltip: i18n2.str`Physical location of the merchant.`
    },
    /* @__PURE__ */ h(InputLocation, { name: "address" })
  ), /* @__PURE__ */ h(
    InputGroup,
    {
      name: "jurisdiction",
      label: i18n2.str`Jurisdiction`,
      tooltip: i18n2.str`Jurisdiction for legal disputes with the merchant.`
    },
    /* @__PURE__ */ h(InputLocation, { name: "jurisdiction" })
  ), /* @__PURE__ */ h(
    InputToggle,
    {
      name: "use_stefan",
      label: i18n2.str`Pay transaction fee`,
      tooltip: i18n2.str`Cover the transaction cost or pass it on to the user.`
    }
  ), /* @__PURE__ */ h(
    InputDuration,
    {
      name: "default_pay_delay",
      label: i18n2.str`Default payment delay`,
      tooltip: i18n2.str`Time customers have to pay an order before the offer expires by default.`
    }
  ), /* @__PURE__ */ h(
    InputDuration,
    {
      name: "default_refund_delay",
      label: i18n2.str`Default refund delay`,
      tooltip: i18n2.str`Time merchants have to refund an order.`
    }
  ), /* @__PURE__ */ h(
    InputDuration,
    {
      name: "default_wire_transfer_delay",
      label: i18n2.str`Default wire transfer delay`,
      tooltip: i18n2.str`Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.`
    }
  ), /* @__PURE__ */ h(
    InputSelector,
    {
      name: "default_wire_transfer_rounding_interval",
      label: i18n2.str`Default wire transfer rounding interval`,
      tooltip: i18n2.str`Interval to which wire deadlines should be rounded up to.`,
      help: i18n2.str`As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.`,
      values: [
        RoundingInterval.DAY,
        RoundingInterval.WEEK,
        RoundingInterval.SECOND,
        RoundingInterval.HOUR,
        RoundingInterval.MINUTE,
        RoundingInterval.MONTH,
        RoundingInterval.QUARTER,
        RoundingInterval.YEAR,
        RoundingInterval.NONE
      ],
      toStr: (v3) => {
        switch (v3) {
          case RoundingInterval.NONE:
            return i18n2.str`No rounding`;
          case RoundingInterval.SECOND:
            return i18n2.str`To second`;
          case RoundingInterval.MINUTE:
            return i18n2.str`To minute`;
          case RoundingInterval.HOUR:
            return i18n2.str`To hour`;
          case RoundingInterval.DAY:
            return i18n2.str`To day`;
          case RoundingInterval.WEEK:
            return i18n2.str`To week`;
          case RoundingInterval.MONTH:
            return i18n2.str`To month`;
          case RoundingInterval.QUARTER:
            return i18n2.str`To quarter`;
          case RoundingInterval.YEAR:
            return i18n2.str`To year`;
        }
      }
    }
  )));
}

// src/components/SolveMFA.tsx
init_preact_module();
init_hooks_module();
function SolveChallenge({
  challenge,
  expiration,
  onCancel,
  onSolved
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn } = useSessionContext();
  const [value, setValue] = p3({});
  const [showExpired, setExpired] = p3(
    expiration !== void 0 && AbsoluteTime.isExpired(expiration)
  );
  const [settings] = usePreference();
  h2(() => {
    if (showExpired)
      return;
    const remain = AbsoluteTime.remaining(expiration).d_ms;
    if (remain === "forever")
      return;
    const handler = setTimeout(() => {
      setExpired(true);
    }, remain);
    return () => {
      clearTimeout(handler);
    };
  }, []);
  const errors2 = undefinedIfEmpty({
    code: showExpired ? i18n2.str`Expired` : !value.code ? i18n2.str`Required` : void 0
  });
  function valueHandler(s6) {
    const next = s6(value);
    const v3 = {
      code: next.code ?? ""
    };
    setValue(v3);
  }
  const data = !value.code || !!errors2 ? void 0 : { tan: value.code };
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const verify2 = safeFunctionHandler(
    lib.instance.confirmChallenge.bind(lib.instance),
    !data ? void 0 : [challenge.challenge_id, data]
  );
  verify2.onSuccess = onSolved;
  verify2.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case TalerErrorCode.MERCHANT_TAN_CHALLENGE_FAILED:
        return i18n2.str`Sending the code failed`;
      case TalerErrorCode.MERCHANT_TAN_CHALLENGE_UNKNOWN:
        return i18n2.str`Challenge expired`;
      case TalerErrorCode.MERCHANT_TAN_TOO_MANY_ATTEMPTS:
        return i18n2.str`Too many attempts`;
    }
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "columns is-centered", style: { margin: "auto" } }, /* @__PURE__ */ h("div", { class: "column is-two-thirds " }, /* @__PURE__ */ h("div", { class: "modal-card", style: { width: "100%", margin: 0 } }, /* @__PURE__ */ h(
    "header",
    {
      class: "modal-card-head",
      style: { border: "1px solid", borderBottom: 0 }
    },
    /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Validation code sent."))
  ), /* @__PURE__ */ h(
    "section",
    {
      class: "modal-card-body",
      style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
    },
    function() {
      switch (challenge.tan_channel) {
        case TanChannel.SMS:
          return /* @__PURE__ */ h(i18n2.Translate, null, 'The verification code sent to the phone number starting with "', /* @__PURE__ */ h("b", null, challenge.tan_info), '"');
        case TanChannel.EMAIL:
          return /* @__PURE__ */ h(i18n2.Translate, null, 'The verification code sent to the email address starting with "', /* @__PURE__ */ h("b", null, challenge.tan_info), '"');
      }
    }(),
    /* @__PURE__ */ h(
      FormProvider,
      {
        name: "settings",
        errors: errors2,
        object: value,
        valueHandler
      },
      /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Verification code`,
          name: "code",
          readonly: showExpired
        }
      )
    ),
    expiration.t_ms === "never" ? void 0 : /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "It will expire at", " ", format2(
      expiration.t_ms,
      datetimeFormatForSettings(settings)
    ))),
    showExpired ? /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "The challenge is expired and can't be solved but you can go back and create a new challenge.")) : void 0
  ), /* @__PURE__ */ h(
    "footer",
    {
      class: "modal-card-foot ",
      style: {
        justifyContent: "space-between",
        border: "1px solid",
        borderTop: 0
      }
    },
    /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Back")),
    /* @__PURE__ */ h(ButtonBetterBulma, { type: "submit", onClick: verify2 }, /* @__PURE__ */ h(i18n2.Translate, null, "Verify"))
  )))));
}
function SolveMFAChallenges({
  currentChallenge,
  onCompleted,
  onCancel
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn } = useSessionContext();
  const [solved, setSolved] = p3([]);
  const [retransmission, setRetransmission] = p3({
    email: AbsoluteTime.now(),
    sms: AbsoluteTime.now()
  });
  const [selected, setSelected] = p3();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const [settings] = usePreference();
  if (selected) {
    return /* @__PURE__ */ h(
      SolveChallenge,
      {
        onCancel: () => setSelected(void 0),
        challenge: selected.ch,
        expiration: selected.expiration,
        onSolved: () => {
          setSelected(void 0);
          const total = [...solved, selected.ch.challenge_id];
          const enough = currentChallenge.combi_and ? total.length === currentChallenge.challenges.length : total.length > 0;
          if (enough) {
            onCompleted.withArgs(total).call();
          } else {
            setSolved(total);
          }
        }
      }
    );
  }
  const hasSolvedEnough = currentChallenge.combi_and ? solved.length === currentChallenge.challenges.length : solved.length > 0;
  const sendMessage = safeFunctionHandler(
    (ch) => lib.instance.sendChallenge(ch.challenge_id)
  );
  sendMessage.onSuccess = (success, ch) => {
    if (success.earliest_retransmission) {
      setRetransmission({
        ...retransmission,
        [ch.tan_channel]: AbsoluteTime.fromProtocolTimestamp(
          success.earliest_retransmission
        )
      });
    }
    setSelected({
      ch,
      expiration: !success.solve_expiration ? AbsoluteTime.never() : AbsoluteTime.fromProtocolTimestamp(success.solve_expiration)
    });
  };
  sendMessage.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Failed to send the verification code.`;
      case HttpStatusCode.Forbidden:
        return i18n2.str`The request was valid, but the server is refusing action.`;
      case TalerErrorCode.MERCHANT_TAN_CHALLENGE_UNKNOWN:
        return i18n2.str`The backend is not aware of the specified MFA challenge.`;
      case TalerErrorCode.MERCHANT_TAN_MFA_HELPER_EXEC_FAILED:
        return i18n2.str`Code transmission failed.`;
      case TalerErrorCode.MERCHANT_TAN_CHALLENGE_SOLVED:
        return i18n2.str`Already solved.`;
      case TalerErrorCode.MERCHANT_TAN_TOO_EARLY:
        return i18n2.str`It is too early to request another transmission of the challenge.`;
    }
  };
  const doComplete = onCompleted.withArgs(solved);
  const selectChallenge = safeFunctionHandler(async (ch) => {
    setSelected({
      ch,
      expiration: AbsoluteTime.never()
    });
    return opEmptySuccess();
  });
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "columns is-centered", style: { margin: "auto" } }, /* @__PURE__ */ h("div", { class: "column is-two-thirds " }, /* @__PURE__ */ h("div", { class: "modal-card", style: { width: "100%", margin: 0 } }, /* @__PURE__ */ h(
    "header",
    {
      class: "modal-card-head",
      style: { border: "1px solid", borderBottom: 0 }
    },
    /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Multi-factor authentication required."))
  ), /* @__PURE__ */ h(
    "section",
    {
      class: "modal-card-body",
      style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
    },
    currentChallenge.combi_and ? /* @__PURE__ */ h(i18n2.Translate, null, "You need to complete all of this requirements.") : /* @__PURE__ */ h(i18n2.Translate, null, "You need to complete at least one of this requirements.")
  ), currentChallenge.challenges.map((challenge) => {
    const time = retransmission[challenge.tan_channel];
    const alreadySent = !AbsoluteTime.isExpired(time);
    const noNeedToComplete = hasSolvedEnough || solved.indexOf(challenge.challenge_id) !== -1;
    const doSelect = noNeedToComplete ? selectChallenge : selectChallenge.withArgs(challenge);
    const doSend = alreadySent || noNeedToComplete ? sendMessage : sendMessage.withArgs(challenge);
    return /* @__PURE__ */ h(
      "section",
      {
        class: "modal-card-body",
        style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
      },
      function(ch) {
        switch (ch) {
          case TanChannel.SMS:
            return /* @__PURE__ */ h(i18n2.Translate, null, "An SMS to the phone number starting with", " ", challenge.tan_info);
          case TanChannel.EMAIL:
            return /* @__PURE__ */ h(i18n2.Translate, null, "An email to the address starting with", " ", challenge.tan_info);
        }
      }(challenge.tan_channel),
      alreadySent && time.t_ms !== "never" ? /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "You have to wait until", " ", format2(time.t_ms, datetimeFormatForSettings(settings)), "to send a new code.")) : void 0,
      /* @__PURE__ */ h(
        "div",
        {
          style: {
            justifyContent: "space-between",
            display: "flex"
          }
        },
        /* @__PURE__ */ h(
          ButtonBetterBulma,
          {
            class: "button",
            onClick: doSelect
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "I have a code")
        ),
        /* @__PURE__ */ h(
          ButtonBetterBulma,
          {
            onClick: doSend
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Send me a message")
        )
      )
    );
  }), /* @__PURE__ */ h(
    "footer",
    {
      class: "modal-card-foot ",
      style: {
        justifyContent: "space-between",
        border: "1px solid",
        borderTop: 0
      }
    },
    /* @__PURE__ */ h("button", { class: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")),
    /* @__PURE__ */ h("div", null)
  )))));
}

// src/utils/table.ts
function undefinedIfEmpty2(obj) {
  if (obj === void 0)
    return void 0;
  return Object.values(obj).some((v3) => v3 !== void 0) ? obj : void 0;
}

// src/paths/login/index.tsx
init_preact_module();
init_hooks_module();
var TEMP_TEST_TOKEN = (description) => ({
  scope: LoginTokenScope.All,
  duration: Duration.toTalerProtocolDuration(Duration.fromMilliseconds(100)),
  description
});
var FOREVER_REFRESHABLE_TOKEN = (description) => ({
  scope: LoginTokenScope.All_Refreshable,
  duration: Duration.toTalerProtocolDuration(Duration.getForever()),
  description
});
var VERSION2 = true ? "1.3.0" : void 0;
function LoginPage({ showCreateAccount }) {
  const [password, setPassword] = p3("");
  const { state, logIn, getInstanceForUsername, config } = useSessionContext();
  const [username, setUsername] = p3(
    showCreateAccount ? "" : state.instance
  );
  const { i18n: i18n2 } = useTranslationContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const login = safeFunctionHandler(
    (usr, pwd, challengeIds) => {
      const api = getInstanceForUsername(usr);
      return api.createAccessToken(
        usr,
        pwd,
        FOREVER_REFRESHABLE_TOKEN(i18n2.str`Logged in`),
        { challengeIds }
      );
    },
    !username || !password ? void 0 : [username, password, []]
  );
  login.onSuccess = (success, usr) => {
    logIn(usr, success.access_token);
  };
  login.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  const retry = login.lambda((ids) => [
    login.args[0],
    login.args[1],
    ids
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "columns is-centered", style: { margin: "auto" } }, /* @__PURE__ */ h("div", { class: "column is-two-thirds " }, /* @__PURE__ */ h("div", { class: "modal-card", style: { width: "100%", margin: 0 } }, /* @__PURE__ */ h(
    "header",
    {
      class: "modal-card-head",
      style: { border: "1px solid", borderBottom: 0 }
    },
    /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Login required"))
  ), /* @__PURE__ */ h(
    "section",
    {
      class: "modal-card-body",
      style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
    },
    /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Username"))), /* @__PURE__ */ h("div", { class: "field-body" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: "control is-expanded" }, /* @__PURE__ */ h(
      "input",
      {
        class: "input",
        type: "text",
        placeholder: i18n2.str`instance name`,
        name: "username",
        onKeyPress: (e5) => e5.keyCode === 13 ? login.call() : null,
        value: username,
        onInput: (e5) => setUsername(e5?.currentTarget.value)
      }
    ))))),
    /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Password"))), /* @__PURE__ */ h("div", { class: "field-body" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: "control is-expanded" }, /* @__PURE__ */ h(
      "input",
      {
        class: "input",
        type: "password",
        placeholder: i18n2.str`current password`,
        name: "token",
        onKeyPress: (e5) => e5.keyCode === 13 ? login.call() : null,
        value: password,
        onInput: (e5) => setPassword(e5?.currentTarget.value)
      }
    )))))
  ), /* @__PURE__ */ h(
    "footer",
    {
      class: "modal-card-foot ",
      style: {
        justifyContent: "space-between",
        border: "1px solid",
        borderTop: 0
      }
    },
    !config.have_self_provisioning ? /* @__PURE__ */ h("div", null) : /* @__PURE__ */ h(
      "a",
      {
        href: !username || username === "admin" ? void 0 : `#/account/reset/${username}`,
        class: "button ",
        disabled: !username || username === "admin"
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Forgot password")
    ),
    /* @__PURE__ */ h(ButtonBetterBulma, { onClick: login, type: "submit" }, /* @__PURE__ */ h(i18n2.Translate, null, "Confirm"))
  )), !showCreateAccount ? void 0 : /* @__PURE__ */ h("div", { style: { marginTop: 8 } }, /* @__PURE__ */ h("a", { href: "#/account/new", class: "has-icon" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-account-plus" })), /* @__PURE__ */ h("span", { class: "menu-item-label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Create new account")))))), /* @__PURE__ */ h(
    "div",
    {
      style: {
        position: "absolute",
        bottom: 0,
        height: "2rem"
      }
    },
    "Version ",
    VERSION2
  ));
}

// src/paths/admin/create/CreatePage.tsx
var twoHours = Duration.fromSpec({ hours: 2 });
var oneDay = Duration.fromSpec({ days: 1 });
var twoDays = Duration.fromSpec({ days: 2 });
function with_defaults(id, config) {
  return {
    id,
    use_stefan: true,
    default_pay_delay: config.default_pay_delay ?? Duration.toTalerProtocolDuration(twoHours),
    default_refund_delay: config.default_refund_delay ?? Duration.toTalerProtocolDuration(oneDay),
    default_wire_transfer_delay: config.default_wire_transfer_delay ?? Duration.toTalerProtocolDuration(twoDays)
  };
}
function CreatePage({ onConfirm, onBack, forceId }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn, config } = useSessionContext();
  const [value, valueHandler] = p3(with_defaults(forceId, config));
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const errors2 = undefinedIfEmpty2({
    id: !value.id ? i18n2.str`Required` : !INSTANCE_ID_REGEX.test(value.id) ? i18n2.str`Invalid` : void 0,
    name: !value.name ? i18n2.str`Required` : void 0,
    email: !value.email ? void 0 : !EMAIL_REGEX.test(value.email) ? i18n2.str`Doesn't have the pattern of an email` : void 0,
    phone_number: !value.phone_number ? void 0 : !value.phone_number.startsWith("+") ? i18n2.str`Should start with +` : !PHONE_JUST_NUMBERS_REGEX.test(value.phone_number) ? i18n2.str`A phone number consists of numbers only` : void 0,
    default_pay_delay: !value.default_pay_delay ? i18n2.str`Required` : value.default_pay_delay.d_us === "forever" ? i18n2.str`Invalid value` : void 0,
    default_refund_delay: !value.default_refund_delay ? i18n2.str`Required` : value.default_refund_delay.d_us === "forever" ? i18n2.str`Invalid value` : void 0,
    default_wire_transfer_delay: !value.default_wire_transfer_delay ? i18n2.str`Required` : value.default_wire_transfer_delay.d_us === "forever" ? i18n2.str`Invalid value` : void 0,
    address: undefinedIfEmpty2({
      address_lines: value.address?.address_lines && value.address?.address_lines.length > 7 ? i18n2.str`Max 7 lines` : void 0
    }),
    jurisdiction: undefinedIfEmpty2({
      address_lines: value.address?.address_lines && value.address?.address_lines.length > 7 ? i18n2.str`Max 7 lines` : void 0
    }),
    password: !value.password ? i18n2.str`Required` : void 0,
    repeat: !value.repeat ? i18n2.str`Required` : value.repeat !== value.password ? i18n2.str`Doesn't match` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const data = {
    ...value,
    auth: {
      method: MerchantAuthMethod.TOKEN,
      password: value.password
    }
  };
  const create = safeFunctionHandler(
    async (token, data2, challengeIds) => {
      if (!data2.address)
        data2.address = {};
      if (!data2.jurisdiction)
        data2.jurisdiction = {};
      const instanceResp = await lib.instance.createInstance(token, data2, {
        challengeIds
      });
      if (instanceResp.type === "fail")
        return instanceResp;
      if (data2.auth.password) {
        const api = data2.id === "admin" ? lib.instance : lib.subInstanceApi(data2.id).instance;
        const tokenResp = await api.createAccessToken(
          data2.id,
          data2.auth.password,
          FOREVER_REFRESHABLE_TOKEN(i18n2.str`Instance created`)
        );
        if (tokenResp.type === "fail")
          return tokenResp;
        return opFixedSuccess(tokenResp.body);
      }
      return opEmptySuccess();
    },
    hasErrors ? void 0 : [session.token, data, []]
  );
  create.onSuccess = (success, oldtoken, data2) => {
    if (success) {
      logIn(data2.id, success.access_token);
    }
    onConfirm();
  };
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
    }
  };
  const retry = create.lambda((ids) => [
    create.args[0],
    create.args[1],
    ids
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      DefaultInstanceFormFields,
      {
        readonlyId: !!forceId,
        showId: !forceId
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "password",
        label: i18n2.str`New password`,
        tooltip: i18n2.str`Next password to be used`,
        inputType: "password"
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "repeat",
        label: i18n2.str`Repeat password`,
        tooltip: i18n2.str`Confirm the same password`,
        inputType: "password"
      }
    ),
    /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        onClick: create,
        type: "submit",
        "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields and choose authorization method` : i18n2.str`Confirm operation`
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
    ))
  )), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/admin/create/index.tsx
function Create({ onBack, onConfirm, forceId }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(CreatePage, { onBack, forceId, onConfirm }));
}

// src/paths/admin/list/index.tsx
init_preact_module();

// src/components/ErrorLoadingMerchant.tsx
init_preact_module();
function ErrorLoadingMerchant({
  error: error2
}) {
  const { i18n: i18n2 } = useTranslationContext();
  switch (error2.errorDetail.code) {
    case TalerErrorCode.GENERIC_TIMEOUT: {
      if (error2.hasErrorCode(TalerErrorCode.GENERIC_TIMEOUT)) {
        const { requestMethod, requestUrl, timeoutMs } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`The request reached a timeout, check your connection.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, timeoutMs },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR: {
      if (error2.hasErrorCode(TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR)) {
        const { requestMethod, requestUrl, timeoutMs } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`The request was cancelled.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, timeoutMs },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.WALLET_HTTP_REQUEST_GENERIC_TIMEOUT: {
      if (error2.hasErrorCode(TalerErrorCode.WALLET_HTTP_REQUEST_GENERIC_TIMEOUT)) {
        const { requestMethod, requestUrl, timeoutMs } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`The request reached a timeout, check your connection.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, timeoutMs },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.WALLET_HTTP_REQUEST_THROTTLED: {
      if (error2.hasErrorCode(TalerErrorCode.WALLET_HTTP_REQUEST_THROTTLED)) {
        const { requestMethod, requestUrl, throttleStats } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`Too many requests were made to the server, and this action was throttled.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, throttleStats },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE: {
      if (error2.hasErrorCode(TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE)) {
        const { requestMethod, requestUrl, httpStatusCode, validationError } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`The server's response was malformed.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, httpStatusCode, validationError },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.WALLET_NETWORK_ERROR: {
      if (error2.hasErrorCode(TalerErrorCode.WALLET_NETWORK_ERROR)) {
        const { requestMethod, requestUrl } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`Could not complete the request due to a network problem.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    case TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR: {
      if (error2.hasErrorCode(TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR)) {
        const { requestMethod, requestUrl, httpStatusCode, errorResponse } = error2.errorDetail;
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              type: "ERROR",
              message: i18n2.str`Unexpected request error.`,
              description: error2.message,
              details: JSON.stringify(
                { requestMethod, requestUrl, httpStatusCode, errorResponse },
                void 0,
                2
              )
            }
          }
        );
      }
      break;
    }
    default: {
      return /* @__PURE__ */ h(
        NotificationCard,
        {
          notification: {
            type: "ERROR",
            message: i18n2.str`Unexpected error.`,
            description: error2.message,
            details: JSON.stringify(error2.errorDetail, void 0, 2)
          }
        }
      );
    }
  }
  return /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        type: "ERROR",
        message: i18n2.str`Unexpected error.`,
        description: error2.message,
        details: JSON.stringify(error2.errorDetail, void 0, 2)
      }
    }
  );
}

// src/paths/admin/list/View.tsx
init_preact_module();
init_hooks_module();

// src/paths/admin/list/TableActive.tsx
init_preact_module();
init_hooks_module();
function CardTable({
  instances: instances2,
  onCreate,
  onUpdate,
  onPurge,
  onDelete,
  onChangePassword,
  selected
}) {
  const [actionQueue, actionQueueHandler] = p3([]);
  const [rowSelection, rowSelectionHandler] = p3([]);
  h2(() => {
    if (actionQueue.length > 0 && !selected && actionQueue[0].type == "DELETE") {
      onDelete(actionQueue[0].element);
      actionQueueHandler(actionQueue.slice(1));
    }
  }, [actionQueue, selected, onDelete]);
  h2(() => {
    if (actionQueue.length > 0 && !selected && actionQueue[0].type == "UPDATE") {
      onUpdate(actionQueue[0].element.id);
      actionQueueHandler(actionQueue.slice(1));
    }
  }, [actionQueue, selected, onUpdate]);
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-desktop-mac" })), /* @__PURE__ */ h(i18n2.Translate, null, "Instances")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "button",
    {
      class: rowSelection.length > 0 ? "button is-danger" : "is-hidden",
      type: "button",
      onClick: () => actionQueueHandler(
        buildActions(instances2, rowSelection, "DELETE")
      )
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
  )), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new instance`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        accessKey: "+",
        onClick: onCreate
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, instances2.length > 0 ? /* @__PURE__ */ h(
    Table,
    {
      instances: instances2,
      onPurge,
      onUpdate,
      onDelete,
      onChangePassword,
      rowSelection,
      rowSelectionHandler
    }
  ) : /* @__PURE__ */ h(EmptyTable, null)))));
}
function toggleSelected(id) {
  return (prev) => prev.indexOf(id) == -1 ? [...prev, id] : prev.filter((e5) => e5 != id);
}
var HIDE_EDIT_INSTANCE = true;
function Table({
  rowSelection,
  rowSelectionHandler,
  instances: instances2,
  onUpdate,
  onChangePassword,
  onDelete,
  onPurge
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { lib, impersonate } = useSessionContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", { class: "is-checkbox-cell" }, /* @__PURE__ */ h("label", { class: "b-checkbox checkbox" }, /* @__PURE__ */ h(
    "input",
    {
      type: "checkbox",
      checked: rowSelection.length === instances2.length,
      onClick: () => rowSelectionHandler(
        rowSelection.length === instances2.length ? [] : instances2.map((i5) => i5.id)
      )
    }
  ), /* @__PURE__ */ h("span", { class: "check" }))), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.id }, /* @__PURE__ */ h("td", { class: "is-checkbox-cell" }, /* @__PURE__ */ h("label", { class: "b-checkbox checkbox" }, /* @__PURE__ */ h(
      "input",
      {
        type: "checkbox",
        checked: rowSelection.indexOf(i5.id) != -1,
        onClick: () => rowSelectionHandler(toggleSelected(i5.id))
      }
    ), /* @__PURE__ */ h("span", { class: "check" }))), /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(
      "a",
      {
        href: `#/orders`,
        onClick: async (_e) => {
          const newInstanceApi = lib.subInstanceApi(i5.id);
          impersonate(new URL(newInstanceApi.instance.baseUrl));
        }
      },
      i5.id
    )), /* @__PURE__ */ h("td", null, i5.name), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, HIDE_EDIT_INSTANCE ? void 0 : /* @__PURE__ */ h(
      "button",
      {
        class: "button is-small is-success jb-modal",
        type: "button",
        onClick: () => onUpdate(i5.id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Edit")
    ), /* @__PURE__ */ h(
      "button",
      {
        class: "button is-small is-success jb-modal",
        type: "button",
        onClick: () => onChangePassword(i5.id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Change password")
    ), !i5.deleted && /* @__PURE__ */ h(
      "button",
      {
        class: "button is-small is-danger jb-modal is-outlined",
        type: "button",
        onClick: () => onDelete(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ), i5.deleted && /* @__PURE__ */ h(
      "button",
      {
        class: "button is-small is-danger jb-modal",
        type: "button",
        onClick: () => onPurge(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Purge")
    ))));
  }))));
}
function EmptyTable() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no instances yet. Add one by pressing the '+' sign.")));
}
function notEmpty(value) {
  return value !== null && value !== void 0;
}
function buildActions(instances2, selected, action) {
  return selected.map((id) => instances2.find((i5) => i5.id === id)).filter(notEmpty).map((id) => ({ element: id, type: action }));
}

// src/paths/admin/list/View.tsx
init_preact_module();
function View({
  instances: instances2,
  onCreate,
  onUpdate,
  onChangePassword,
  selected
}) {
  const [show, setShow] = p3("active");
  const showIsActive = show === "active" ? "is-active" : "";
  const showIsDeleted = show === "deleted" ? "is-active" : "";
  const showAll = show === null ? "is-active" : "";
  const { i18n: i18n2 } = useTranslationContext();
  const showingInstances = showIsDeleted ? instances2.filter((i5) => i5.deleted) : showIsActive ? instances2.filter((i5) => !i5.deleted) : instances2;
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const deleteAction = safeFunctionHandler(
    (token, instance, purge2, challengeIds) => lib.instance.deleteInstance(token, instance.id, { challengeIds, purge: purge2 })
  );
  const [deleting, setDeleting] = p3();
  const [purging, setPurging] = p3();
  deleteAction.onSuccess = (_3, t5, instance) => {
    setDeleting(void 0);
    return i18n2.str`Instance "${instance.name}" (ID: ${instance.id}) has been deleted.`;
  };
  deleteAction.onFail = (fail, t5, i5, p4) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(
          fail.body,
          deleteAction.lambda((ids) => [t5, i5, p4, ids])
        );
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  const remove = !session.token || !deleting ? deleteAction : deleteAction.withArgs(session.token, deleting, false, []);
  const purge = !session.token || !deleting ? deleteAction : deleteAction.withArgs(session.token, deleting, true, []);
  if (mfa.pendingChallenge && mfa.repeatCall) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: mfa.repeatCall,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), deleting && (purging ? /* @__PURE__ */ h(
    PurgeModal,
    {
      element: deleting,
      onCancel: () => setDeleting(void 0),
      confirm: purge
    }
  ) : /* @__PURE__ */ h(
    DeleteModal,
    {
      element: deleting,
      onCancel: () => setDeleting(void 0),
      confirm: remove
    }
  )), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-two-thirds" }, /* @__PURE__ */ h("div", { class: "tabs", style: { overflow: "inherit" } }, /* @__PURE__ */ h("ul", null, /* @__PURE__ */ h("li", { class: showIsActive }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Only show active instances`
    },
    /* @__PURE__ */ h("a", { onClick: () => setShow("active") }, /* @__PURE__ */ h(i18n2.Translate, null, "Active"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
  )), /* @__PURE__ */ h("li", { class: showIsDeleted }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Only show deleted instances`
    },
    /* @__PURE__ */ h("a", { onClick: () => setShow("deleted") }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleted"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
  )), /* @__PURE__ */ h("li", { class: showAll }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Show all instances`
    },
    /* @__PURE__ */ h("a", { onClick: () => setShow(null) }, /* @__PURE__ */ h(i18n2.Translate, null, "All"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
  )))))), /* @__PURE__ */ h(
    CardTable,
    {
      instances: showingInstances,
      onDelete: (d6) => {
        setDeleting(d6);
        setPurging(false);
      },
      onPurge: (d6) => {
        setDeleting(d6);
        setPurging(true);
      },
      onChangePassword,
      onUpdate,
      selected,
      onCreate
    }
  )));
}
function DeleteModal({
  element,
  onCancel,
  confirm
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Delete instance`,
      description: i18n2.str`Delete the instance "${element.name}"`,
      danger: true,
      active: true,
      onCancel,
      confirm
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If you delete the instance named ", /* @__PURE__ */ h("b", null, '"', element.name, '"'), " ", "(ID: ", /* @__PURE__ */ h("b", null, element.id), "), the merchant will no longer be able to process orders and refunds")),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.")),
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleting an instance", " ", /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "This cannot be undone!"))))
  );
}
function PurgeModal({ element, onCancel, confirm }) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Purge the instance`,
      description: i18n2.str`Purge the instance "${element.name}"`,
      danger: true,
      active: true,
      onCancel,
      confirm
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If you purge the instance named ", /* @__PURE__ */ h("b", null, '"', element.name, '"'), " (ID:", " ", /* @__PURE__ */ h("b", null, element.id), "), you will also delete all of its transaction data!")),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "The instance will disappear from your list and you will no longer be able to access its data.")),
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Purging an instance", " ", /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "This cannot be undone!"))))
  );
}

// src/paths/admin/list/index.tsx
function Instances({
  onCreate,
  onUpdate,
  onChangePassword
}) {
  const result = useBackendInstances();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    View,
    {
      instances: result.body.instances,
      onUpdate,
      onChangePassword,
      onCreate
    }
  ));
}

// src/components/menu/NavigationBar.tsx
init_preact_module();

// src/assets/logo-2021.svg
var logo_2021_default = "./logo-2021-VSZSJ4QZ.svg";

// src/assets/question.svg
var question_default = "./question-RJEDR5FJ.svg";

// src/components/menu/NavigationBar.tsx
function NavigationBar({ onMobileMenu, title }) {
  return /* @__PURE__ */ h(
    "nav",
    {
      class: "navbar is-fixed-top",
      role: "navigation",
      "aria-label": "main navigation"
    },
    /* @__PURE__ */ h("div", { class: "navbar-brand" }, /* @__PURE__ */ h("span", { class: "navbar-item", style: { fontSize: 24, fontWeight: 900 } }, title), /* @__PURE__ */ h(
      "a",
      {
        role: "button",
        class: "navbar-burger",
        "aria-label": "menu",
        "aria-expanded": "false",
        onClick: (e5) => {
          onMobileMenu();
          e5.stopPropagation();
        }
      },
      /* @__PURE__ */ h("span", { "aria-hidden": "true" }),
      /* @__PURE__ */ h("span", { "aria-hidden": "true" }),
      /* @__PURE__ */ h("span", { "aria-hidden": "true" })
    )),
    /* @__PURE__ */ h("div", { class: "navbar-menu " }, /* @__PURE__ */ h(
      "a",
      {
        class: "navbar-start is-justify-content-center is-flex-grow-1",
        href: "https://tutorials.taler.net/merchant/merchant-backoffice",
        target: "_blank",
        rel: "noreferrer"
      },
      /* @__PURE__ */ h("img", { src: logo_2021_default, style: { height: 35, margin: 10 } }),
      /* @__PURE__ */ h(
        "img",
        {
          src: question_default,
          style: { height: 20, marginTop: "auto", marginBottom: "auto" }
        }
      )
    ))
  );
}

// src/components/menu/index.tsx
function getInstanceTitle(path, id, i18n2) {
  switch (path) {
    case "/settings" /* settings */:
      return i18n2.ctx("title")`${id}: Settings`;
    case "/bank/new" /* bank_new */:
      return i18n2.ctx("title")`${id}: New bank account`;
    case "/bank" /* bank_list */:
      return i18n2.ctx("title")`${id}: Bank accounts`;
    case "/bank/:bid/update" /* bank_update */:
      return i18n2.ctx("title")`${id}: Update bank Account`;
    case "/orders" /* order_list */:
      return i18n2.ctx("title")`${id}: Orders`;
    case "/orders/:section" /* order_list_section */:
      return i18n2.ctx("title")`${id}: Orders`;
    case "/order/new" /* order_new */:
      return i18n2.ctx("title")`${id}: New order`;
    case "/inventory" /* inventory_list */:
      return i18n2.ctx("title")`${id}: Inventory`;
    case "/inventory/new" /* inventory_new */:
      return i18n2.ctx("title")`${id}: New product`;
    case "/inventory/:pid/update" /* inventory_update */:
      return i18n2.ctx("title")`${id}: Update product`;
    case "/category" /* category_list */:
      return i18n2.ctx("title")`${id}: Category`;
    case "/category/new" /* category_new */:
      return i18n2.ctx("title")`${id}: New category`;
    case "/category/:cid/update" /* category_update */:
      return i18n2.ctx("title")`${id}: Update category`;
    case "/transfers" /* transfers_list */:
      return i18n2.ctx("title")`${id}: Wire transfers`;
    case "/webhooks" /* webhooks_list */:
      return i18n2.ctx("title")`${id}: Webhooks`;
    case "/webhooks/new" /* webhooks_new */:
      return i18n2.ctx("title")`${id}: New webhook`;
    case "/webhooks/:tid/update" /* webhooks_update */:
      return i18n2.ctx("title")`${id}: Update webhook`;
    case "/otp-devices" /* otp_devices_list */:
      return i18n2.ctx("title")`${id}: OTP devices`;
    case "/otp-devices/new" /* otp_devices_new */:
      return i18n2.ctx("title")`${id}: New OTP device`;
    case "/otp-devices/:vid/update" /* otp_devices_update */:
      return i18n2.ctx("title")`${id}: Update OTP device`;
    case "/templates/new" /* templates_new */:
      return i18n2.ctx("title")`${id}: New template`;
    case "/templates/:tid/update" /* templates_update */:
      return i18n2.ctx("title")`${id}: Update template`;
    case "/templates" /* templates_list */:
      return i18n2.ctx("title")`${id}: Templates`;
    case "/templates/:tid/use" /* templates_use */:
      return i18n2.ctx("title")`${id}: Use template`;
    case "/interface" /* interface */:
      return i18n2.ctx("title")`${id}: Personalization`;
    case "/tokenfamilies" /* token_family_list */:
      return i18n2.ctx("title")`${id}: Token families`;
    case "/tokenfamilies/new" /* token_family_new */:
      return i18n2.ctx("title")`${id}: New token family`;
    case "/tokenfamilies/:slug/update" /* token_family_update */:
      return i18n2.ctx("title")`${id}: Update token family`;
    case "/access-token" /* access_token_list */:
      return i18n2.ctx("title")`${id}: Access tokens`;
    case "/access-token/new" /* access_token_new */:
      return i18n2.ctx("title")`${id}: New access token`;
    default: {
      return "";
    }
  }
}
function getAdminTitle(path, instance, i18n2) {
  if (path === "/instance/new" /* new_instance */)
    return i18n2.ctx("title")`New instance`;
  if (path === "/instances" /* list_instances */)
    return i18n2.ctx("title")`Instances`;
  return getInstanceTitle(path, instance, i18n2);
}
function WithTitle({
  title,
  children
}) {
  h2(() => {
    document.title = `Taler Backoffice: ${title}`;
  }, [title]);
  return /* @__PURE__ */ h(p2, null, children);
}
function Menu(_p) {
  const [mobileOpen, setMobileOpen] = p3(false);
  const { i18n: i18n2 } = useTranslationContext();
  const { state, deImpersonate } = useSessionContext();
  const { path } = useNavigationContext();
  const titleWithSubtitle = !state.isAdmin ? getInstanceTitle(path, state.instance, i18n2) : getAdminTitle(path, state.instance, i18n2);
  const isLoggedIn = state.status === "loggedIn";
  return /* @__PURE__ */ h(WithTitle, { title: titleWithSubtitle }, /* @__PURE__ */ h(
    "div",
    {
      class: mobileOpen ? "has-aside-mobile-expanded" : "",
      onClick: () => setMobileOpen(false)
    },
    /* @__PURE__ */ h(
      NavigationBar,
      {
        onMobileMenu: () => setMobileOpen(!mobileOpen),
        title: titleWithSubtitle
      }
    ),
    isLoggedIn && /* @__PURE__ */ h(Sidebar, { mobile: mobileOpen }),
    state.status !== "loggedOut" && state.impersonated && /* @__PURE__ */ h(
      "nav",
      {
        class: "level",
        style: {
          zIndex: 100,
          position: "fixed",
          width: "50%",
          marginLeft: "20%"
        }
      },
      /* @__PURE__ */ h("div", { class: "level-item has-text-centered has-background-warning" }, /* @__PURE__ */ h("p", { class: "is-size-5" }, "You are viewing the instance ", /* @__PURE__ */ h("b", null, '"', state.instance, '"'), ".", " ", /* @__PURE__ */ h(
        "a",
        {
          href: "#/instances",
          onClick: () => {
            deImpersonate();
          }
        },
        "go back"
      )))
    )
  ));
}
function NotificationCard({
  notification: n2
}) {
  if (!n2)
    return null;
  return /* @__PURE__ */ h("div", { class: "notification" }, /* @__PURE__ */ h("div", { class: "columns is-vcentered" }, /* @__PURE__ */ h("div", { class: "column is-12" }, /* @__PURE__ */ h(
    "article",
    {
      class: n2.type === "ERROR" ? "message is-danger" : n2.type === "WARN" ? "message is-warning" : "message is-info"
    },
    /* @__PURE__ */ h("div", { class: "message-header" }, /* @__PURE__ */ h("p", null, n2.message)),
    n2.description && /* @__PURE__ */ h("div", { class: "message-body" }, /* @__PURE__ */ h("div", null, n2.description), n2.details && /* @__PURE__ */ h("pre", null, n2.details))
  ))));
}
function NotConnectedAppMenu({
  title
}) {
  const [mobileOpen, setMobileOpen] = p3(false);
  h2(() => {
    document.title = `Taler Backoffice: ${title}`;
  }, [title]);
  return /* @__PURE__ */ h(
    "div",
    {
      class: mobileOpen ? "has-aside-mobile-expanded" : "",
      onClick: () => setMobileOpen(false)
    },
    /* @__PURE__ */ h(
      NavigationBar,
      {
        onMobileMenu: () => setMobileOpen(!mobileOpen),
        title
      }
    ),
    /* @__PURE__ */ h(
      "div",
      {
        style: {
          width: "100%",
          display: "flex",
          justifyContent: "space-between",
          paddingTop: 8,
          paddingRight: 8
        }
      },
      /* @__PURE__ */ h("div", null),
      /* @__PURE__ */ h(LangSelector, null)
    )
  );
}

// src/hooks/bank.ts
var useSWR3 = useSWR;
function revalidateInstanceBankAccounts() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listBankAccounts",
    void 0,
    { revalidate: true }
  );
}
function useInstanceBankAccounts() {
  const { state, lib } = useSessionContext();
  async function fetcher([token, _bid]) {
    return await lib.instance.listBankAccounts(token, {
      // limit: PAGINATED_LIST_REQUEST,
      // offset: bid,
      // order: "dec",
    });
  }
  const { data, error: error2 } = useSWR3([state.token, "offset", "listBankAccounts"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  const filtered = data.body.accounts.filter((a6) => a6.active);
  data.body.accounts = filtered;
  return data;
}
function revalidateBankAccountDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getBankAccountDetails",
    void 0,
    { revalidate: true }
  );
}
function useBankAccountDetails(h_wire) {
  const { state, lib } = useSessionContext();
  async function fetcher([token, wireId]) {
    return await lib.instance.getBankAccountDetails(token, wireId);
  }
  const { data, error: error2 } = useSWR3([state.token, h_wire, "getBankAccountDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/accessTokens/create/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/accessTokens/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
var ALL_VALID_TOKEN_SCOPE = [
  "",
  LoginTokenScope.ReadOnly,
  LoginTokenScope.OrderSimple,
  LoginTokenScope.OrderPos,
  LoginTokenScope.OrderManagement,
  LoginTokenScope.OrderFull,
  // LoginTokenScope.All_Refreshable,
  LoginTokenScope.ReadOnly_Refreshable,
  LoginTokenScope.OrderSimple_Refreshable,
  LoginTokenScope.OrderPos_Refreshable,
  LoginTokenScope.OrderManagement_Refreshable,
  LoginTokenScope.OrderFull_Refreshable,
  LoginTokenScope.All
];
var SANE_VALID_TOKEN_SCOPE = [
  "",
  LoginTokenScope.ReadOnly,
  LoginTokenScope.OrderSimple,
  LoginTokenScope.OrderPos,
  LoginTokenScope.OrderManagement,
  LoginTokenScope.OrderFull,
  LoginTokenScope.All
];
function CreatePage2({ onCreated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [state, setState] = p3({});
  const { state: session, lib } = useSessionContext();
  const errors2 = undefinedIfEmpty2({
    password: !state.password ? i18n2.str`Required` : void 0,
    duration: !state.duration ? i18n2.str`Required` : void 0,
    description: !state.description ? i18n2.str`Required` : void 0,
    scope: !state.scope ? i18n2.str`Required` : void 0
  });
  const [{ persona }] = usePreference();
  const scopeList = getAvailableForPersona(persona ?? "developer")[24 /* option_refreshableScopes */] ? ALL_VALID_TOKEN_SCOPE : SANE_VALID_TOKEN_SCOPE;
  const hasErrors = errors2 !== void 0;
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const data = {
    scope: state.scope,
    description: state.description,
    duration: !state.duration ? void 0 : Duration.toTalerProtocolDuration(state.duration)
  };
  const create = safeFunctionHandler(
    (pwd, request, challengeIds) => lib.instance.createAccessToken(session.instance, pwd, request, {
      challengeIds
    }),
    !!errors2 || !state.password ? void 0 : [state.password, data, []]
  );
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Check the password.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Instance not found.`;
    }
  };
  create.onSuccess = onCreated;
  const retry = create.lambda((ids) => [
    create.args[0],
    create.args[1],
    ids
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        label: i18n2.str`Description`,
        help: i18n2.str`Helps you remember where this token is being used before deleting it.`
      }
    ),
    /* @__PURE__ */ h(
      InputDuration,
      {
        name: "duration",
        label: i18n2.str`Duration`,
        withForever: true,
        tooltip: i18n2.str`Time the access token will be valid.`
      }
    ),
    state.scope?.endsWith(":refreshable") && /* @__PURE__ */ h(
      NotificationCard,
      {
        notification: {
          type: "WARN",
          message: i18n2.str`Refreshable tokens can pose a security risk!`,
          description: i18n2.str`Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.`
        }
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "scope",
        label: i18n2.str`Scope`,
        tooltip: i18n2.str`The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.`,
        values: scopeList,
        help: ((s6) => {
          if (!s6)
            return "";
          switch (s6) {
            case LoginTokenScope.All:
              return i18n2.str`Allows all operations without limit.`;
            case LoginTokenScope.ReadOnly:
              return i18n2.str`Allows all operations to read information.`;
            case LoginTokenScope.OrderSimple:
              return i18n2.str`Allows the creation of orders and checking of payment status.`;
            case LoginTokenScope.OrderPos:
              return i18n2.str`Allows the creation of orders, checking of payment status and inventory locking.`;
            case LoginTokenScope.OrderManagement:
              return i18n2.str`Allows the creation of orders, checking of payment status and refunds.`;
            case LoginTokenScope.OrderFull:
              return i18n2.str`Allows the creation of orders, checking of payment status, inventory locking and refunds.`;
            case LoginTokenScope.ReadOnly_Refreshable:
              return i18n2.str`Allows all operations to read information with extendable expiration time.`;
            case LoginTokenScope.OrderSimple_Refreshable:
              return i18n2.str`Allows the creation of orders and checking of payment status with extendable expiration time.`;
            case LoginTokenScope.OrderPos_Refreshable:
              return i18n2.str`Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.`;
            case LoginTokenScope.OrderManagement_Refreshable:
              return i18n2.str`Allows the creation of orders, checking of payment status and refunds with extendable expiration time.`;
            case LoginTokenScope.OrderFull_Refreshable:
              return i18n2.str`Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.`;
            case LoginTokenScope.All_Refreshable:
              return i18n2.str`All (refreshable)`;
            case LoginTokenScope.Spa:
              return i18n2.str`Spa`;
            case LoginTokenScope.Spa_Refreshable:
              return i18n2.str`Spa (refreshable)`;
            default: {
              assertUnreachable(s6);
            }
          }
        })(state.scope),
        toStr: (str) => {
          if (!str) {
            return i18n2.str`Choose one`;
          }
          const s6 = str;
          switch (s6) {
            case LoginTokenScope.ReadOnly:
              return i18n2.str`Read only`;
            case LoginTokenScope.All:
              return i18n2.str`All`;
            case LoginTokenScope.OrderSimple:
              return i18n2.str`Order simple`;
            case LoginTokenScope.OrderPos:
              return i18n2.str`Order Point-of-Sale`;
            case LoginTokenScope.OrderManagement:
              return i18n2.str`Order management`;
            case LoginTokenScope.OrderFull:
              return i18n2.str`Order full`;
            case LoginTokenScope.ReadOnly_Refreshable:
              return i18n2.str`Read only (refreshable)`;
            case LoginTokenScope.OrderSimple_Refreshable:
              return i18n2.str`Order simple (refreshable)`;
            case LoginTokenScope.OrderPos_Refreshable:
              return i18n2.str`Order Point-of-Sale (refreshable)`;
            case LoginTokenScope.OrderManagement_Refreshable:
              return i18n2.str`Order management (refreshable)`;
            case LoginTokenScope.OrderFull_Refreshable:
              return i18n2.str`Order full (refreshable)`;
            case LoginTokenScope.All_Refreshable:
              return i18n2.str`All (refreshable)`;
            case LoginTokenScope.Spa:
              return i18n2.str`Spa`;
            case LoginTokenScope.Spa_Refreshable:
              return i18n2.str`Spa (refreshable)`;
            default: {
              assertUnreachable(s6);
            }
          }
        }
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "password",
        inputType: "password",
        label: i18n2.str`Current password`
      }
    ),
    /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        type: "submit",
        "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
        onClick: create
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
    ))
  )), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/accessTokens/create/index.tsx
function AccessTokenCreatePage({
  onConfirm,
  onBack
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [ok, setOk] = p3();
  return /* @__PURE__ */ h(p2, null, !ok ? void 0 : /* @__PURE__ */ h(
    ConfirmModal,
    {
      active: true,
      onCancel: onConfirm,
      description: i18n2.str`Access token created`,
      label: i18n2.str`Confirm`
    },
    /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", null, /* @__PURE__ */ h("tbody", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, /* @__PURE__ */ h(i18n2.Translate, null, "Copy the value of the access token and save it, as you cannot retrieve it again."))), /* @__PURE__ */ h(Row, { name: i18n2.str`Token`, value: ok.token, literal: true }), /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("td", { colSpan: 3 }, AbsoluteTime.isNever(ok.expiration) ? /* @__PURE__ */ h(i18n2.Translate, null, "This token will never expire") : /* @__PURE__ */ h(i18n2.Translate, null, "This token will be available until", " ", /* @__PURE__ */ h(
      Time,
      {
        format: "dd/MM/yyyy HH:mm:ss",
        timestamp: ok.expiration
      }
    )))))))
  ), /* @__PURE__ */ h(
    CreatePage2,
    {
      onBack,
      onCreated: (c5) => {
        setOk({
          expiration: AbsoluteTime.fromProtocolTimestamp(c5.expiration),
          token: c5.access_token
        });
      }
    }
  ));
}

// src/paths/instance/accessTokens/list/index.tsx
init_preact_module();
init_hooks_module();

// src/hooks/access-tokens.ts
init_hooks_module();
var useSWR4 = useSWR;
function revalidateInstanceAccessTokens() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "useInstanceAccessTokens",
    void 0,
    { revalidate: true }
  );
}
function useInstanceAccessTokens() {
  const { state, lib } = useSessionContext();
  const [offset, setOffset] = p3();
  async function fetcher([token, tid]) {
    return await lib.instance.listAccessTokens(token, {
      limit: PAGINATED_LIST_REQUEST,
      offset: !tid ? void 0 : String(tid),
      order: "dec"
    });
  }
  const { data, error: error2 } = useSWR4([state.token, offset, "useInstanceAccessTokens"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.tokens,
    offset,
    setOffset,
    (d6) => d6.serial,
    PAGINATED_LIST_REQUEST
  );
}

// src/paths/notfound/index.tsx
init_preact_module();
function NotFoundPage() {
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("p", null, "That page doesn't exist."), /* @__PURE__ */ h(Link, { href: "/" }, /* @__PURE__ */ h("h4", null, "Back to Home")));
}
function NotFoundPageOrAdminCreate() {
  const { state } = useSessionContext();
  const { i18n: i18n2 } = useTranslationContext();
  if (state.isAdmin && state.instance === DEFAULT_ADMIN_USERNAME) {
    return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      NotificationCard,
      {
        notification: {
          message: i18n2.str`No 'admin' instance configured yet.`,
          description: i18n2.str`Create an 'admin' instance to begin using the merchant backoffice.`,
          type: "INFO"
        }
      }
    ), /* @__PURE__ */ h(
      Create,
      {
        forceId: DEFAULT_ADMIN_USERNAME,
        onConfirm: () => {
          cleanAllCache();
          route("/bank" /* bank_list */);
        }
      }
    ));
  }
  return /* @__PURE__ */ h(NotFoundPage, null);
}

// src/paths/instance/accessTokens/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable2({
  tokens,
  onCreate,
  onDelete,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-key" })), /* @__PURE__ */ h(i18n2.Translate, null, "Access tokens")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Create access token`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        accessKey: "+",
        onClick: onCreate
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, tokens.length > 0 ? /* @__PURE__ */ h(
    Table2,
    {
      tokens,
      onDelete,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable2, null)))));
}
function Table2({
  tokens,
  onDelete,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices before the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Scope")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Created at")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Expires at")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, tokens.map((t5, idx) => {
    return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
      "td",
      null,
      t5.scope
    ), /* @__PURE__ */ h(
      "td",
      null,
      t5.creation_time.t_s === "never" ? i18n2.str`Never` : format2(
        new Date(t5.creation_time.t_s * 1e3),
        datetimeFormatForSettings(settings)
      )
    ), /* @__PURE__ */ h(
      "td",
      null,
      t5.expiration.t_s === "never" ? i18n2.str`Never` : format2(
        new Date(t5.expiration.t_s * 1e3),
        datetimeFormatForSettings(settings)
      )
    ), /* @__PURE__ */ h(
      "td",
      null,
      t5.description
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      "span",
      {
        class: "has-tooltip-left",
        "data-tooltip": i18n2.str`Remove this access token`
      },
      /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-danger",
          type: "button",
          onClick: () => onDelete(t5)
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
      )
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  )));
}
function EmptyTable2() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no active sessions yet, add one by pressing the + sign")));
}

// src/paths/instance/accessTokens/list/index.tsx
function AccessTokenListPage({ onCreate }) {
  const result = useInstanceAccessTokens();
  const { state: session, lib } = useSessionContext();
  const [deleting, setDeleting] = p3(null);
  const { i18n: i18n2 } = useTranslationContext();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.Forbidden: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const deleteToken = safeFunctionHandler(
    lib.instance.deleteAccessToken.bind(lib.instance),
    !session.token || !deleting ? void 0 : [session.token, deleting.serial]
  );
  deleteToken.onSuccess = () => {
    setDeleting(null);
  };
  deleteToken.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.Forbidden:
        return i18n2.str`Forbidden.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
    }
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    CardTable2,
    {
      tokens: result.body.map((o3) => ({
        ...o3,
        id: String(o3.serial)
      })),
      onLoadMoreBefore: result.loadFirst,
      onLoadMoreAfter: result.loadNext,
      onCreate,
      onDelete: (d6) => {
        setDeleting(d6);
      }
    }
  ), deleting && /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Delete access token`,
      description: deleting.description,
      danger: true,
      active: true,
      onCancel: () => setDeleting(null),
      confirm: deleteToken
    },
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleting an access token cannot be undone."))
  )));
}

// src/paths/instance/accounts/create/index.tsx
init_preact_module();

// src/paths/instance/accounts/create/CreatePage.tsx
init_preact_module();
init_hooks_module();

// src/components/form/InputPaytoForm.tsx
init_preact_module();
init_hooks_module();
function isEthereumAddress(address) {
  if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {
    return false;
  } else if (/^(0x|0X)?[0-9a-f]{40}$/.test(address) || /^(0x|0X)?[0-9A-F]{40}$/.test(address)) {
    return true;
  }
  return checkAddressChecksum(address);
}
function checkAddressChecksum(_address) {
  return true;
}
function validateBitcoin_path1(addr, i18n2) {
  try {
    const valid = /^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/.test(addr);
    if (valid)
      return void 0;
  } catch (e5) {
    console.log(e5);
  }
  return i18n2.str`This is not a valid Bitcoin address.`;
}
function validateEthereum_path1(addr, i18n2) {
  try {
    const valid = isEthereumAddress(addr);
    if (valid)
      return void 0;
  } catch (e5) {
    console.log(e5);
  }
  return i18n2.str`This is not a valid Ethereum address.`;
}
var DOMAIN_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9-_](?:\.[a-zA-Z0-9-_]{2,})*(:[0-9]+)?(\/[a-zA-Z0-9-.]+)*\/?$/;
function validateTalerBank_path1(addr, i18n2) {
  try {
    const valid = DOMAIN_REGEX.test(addr);
    if (valid)
      return void 0;
  } catch (e5) {
    console.log(e5);
  }
  return i18n2.str`This is not a valid host.`;
}
function validateIBAN_path1(iban, i18n2) {
  if (iban.length < 4)
    return i18n2.str`IBANs usually have more than 4 digits.`;
  if (iban.length > 34)
    return i18n2.str`IBANs usually have fewer than 34 digits.`;
  const A_code = "A".charCodeAt(0);
  const Z_code = "Z".charCodeAt(0);
  const IBAN = iban.toUpperCase();
  const code = IBAN.substr(0, 2);
  const found = code in COUNTRY_TABLE;
  if (!found)
    return i18n2.str`The IBAN's country code could not be retrieved.`;
  const step2 = IBAN.substr(4) + iban.substr(0, 4);
  const step3 = Array.from(step2).map((letter) => {
    const code2 = letter.charCodeAt(0);
    if (code2 < A_code || code2 > Z_code)
      return letter;
    return `${letter.charCodeAt(0) - "A".charCodeAt(0) + 10}`;
  }).join("");
  function calculate_iban_checksum(str) {
    const numberStr = str.substr(0, 5);
    const rest = str.substr(5);
    const number = parseInt(numberStr, 10);
    const result = number % 97;
    if (rest.length > 0) {
      return calculate_iban_checksum(`${result}${rest}`);
    }
    return result;
  }
  const checksum = calculate_iban_checksum(step3);
  if (checksum !== 1)
    return i18n2.str`The IBAN is invalid because the checksum is wrong.`;
  return void 0;
}
var allTargets = ["iban", "bitcoin", "ethereum", "x-taler-bank"];
function checkServerRegex(i18n2, payto, serverReg) {
  if (!payto || !serverReg)
    return void 0;
  try {
    const validator = new RegExp(serverReg);
    if (!validator.test(payto)) {
      return i18n2.str`This account is not allowed.`;
    } else {
      return void 0;
    }
  } catch (e5) {
    return void 0;
  }
}
function InputPaytoForm({
  name,
  readonly,
  label,
  tooltip
}) {
  const { value: initialValueStr, onChange } = useField(name);
  const { config } = useSessionContext();
  const initialPayto = parsePaytoUri(initialValueStr ?? "");
  const { i18n: i18n2 } = useTranslationContext();
  const supportedWireMethods = config.payment_target_types === "*" ? void 0 : config.payment_target_types.trim().split(" ");
  const targets = !supportedWireMethods || !supportedWireMethods.length ? allTargets : allTargets.filter((t5) => supportedWireMethods.indexOf(t5) !== -1);
  const defaultTarget = {
    target: targets.length ? targets[0] : "",
    params: {}
  };
  const paths = !initialPayto ? [] : initialPayto.targetPath.split("/");
  const initialPath1 = paths.length >= 1 ? paths[0] : void 0;
  const initialPath2 = paths.length >= 2 ? paths[1] : void 0;
  const initial4 = initialPayto === void 0 ? defaultTarget : {
    target: initialPayto.targetType,
    params: initialPayto.params,
    path1: initialPath1,
    path2: initialPath2
  };
  const [value, setValue] = p3(initial4);
  const errors2 = undefinedIfEmpty2({
    target: value.target === void 0 ? i18n2.str`Required` : void 0,
    path1: !value.path1 ? i18n2.str`Required` : value.target === "iban" ? validateIBAN_path1(cleanupPath1(value.path1, value.target), i18n2) : value.target === "bitcoin" ? validateBitcoin_path1(cleanupPath1(value.path1, value.target), i18n2) : value.target === "ethereum" ? validateEthereum_path1(
      cleanupPath1(value.path1, value.target),
      i18n2
    ) : value.target === "x-taler-bank" ? validateTalerBank_path1(
      cleanupPath1(value.path1, value.target),
      i18n2
    ) : void 0,
    path2: value.target === "x-taler-bank" ? !value.path2 ? i18n2.str`Required` : void 0 : void 0,
    params: undefinedIfEmpty2({
      "receiver-name": !value.params?.["receiver-name"] ? i18n2.str`Required` : void 0
    })
  });
  const hasErrors = errors2 !== void 0;
  const path1WithSlash = !value.path1 ? void 0 : cleanupPath1(value.path1, value.target);
  const pto = hasErrors || !value.target ? void 0 : {
    targetType: value.target,
    targetPath: value.path2 ? `${path1WithSlash}${value.path2}` : path1WithSlash ?? "",
    params: value.params ?? {},
    isKnown: false
  };
  const str = !pto ? void 0 : stringifyPaytoUri(pto);
  const regexError = checkServerRegex(i18n2, str, config.payment_target_regex);
  h2(() => {
    onChange(str);
  }, [str]);
  if (!targets.length) {
    return /* @__PURE__ */ h(i18n2.Translate, null, "None of the supported wire method of the server are currently supported by this app. Server settings: ", supportedWireMethods?.join(",") ?? "-");
  }
  return /* @__PURE__ */ h(InputGroup, { name: "payto", label, fixed: true, tooltip }, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "tax",
      errors: regexError ? { path1: regexError } : errors2,
      object: value,
      valueHandler: setValue
    },
    targets.length === 1 ? void 0 : /* @__PURE__ */ h(
      InputSelector,
      {
        name: "target",
        label: i18n2.str`Wire method`,
        tooltip: i18n2.str`Select the method you want to use to transfer your earnings to your business account.`,
        values: targets,
        readonly,
        toStr: (v3) => v3 === void 0 ? i18n2.str`Select a wire method...` : v3
      }
    ),
    value.target === "ach" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        label: i18n2.str`Routing`,
        readonly,
        tooltip: i18n2.str`Routing number`
      }
    ), /* @__PURE__ */ h(
      Input,
      {
        name: "path2",
        label: i18n2.str`Account`,
        readonly,
        tooltip: i18n2.str`Account number`
      }
    )),
    value.target === "bic" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        label: i18n2.str`Code`,
        readonly,
        tooltip: i18n2.str`Business Identifier Code`
      }
    )),
    value.target === "iban" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        label: i18n2.str`IBAN`,
        tooltip: i18n2.str`International Bank Account Number`,
        readonly,
        placeholder: i18n2.str`your bank account number, e.g. DE12 0000 1111 2222 3333 00`
      }
    )),
    value.target === "upi" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        readonly,
        label: i18n2.str`Account`,
        tooltip: i18n2.str`Unified Payment Interface`
      }
    )),
    value.target === "bitcoin" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        readonly,
        label: i18n2.str`Address`,
        tooltip: i18n2.str`Bitcoin protocol`
      }
    )),
    value.target === "ethereum" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        readonly,
        label: i18n2.str`Address`,
        tooltip: i18n2.str`Ethereum protocol`
      }
    )),
    value.target === "ilp" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        readonly,
        label: i18n2.str`Address`,
        tooltip: i18n2.str`Interledger protocol`
      }
    )),
    value.target === "void" && /* @__PURE__ */ h(p2, null),
    value.target === "x-taler-bank" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "path1",
        readonly,
        label: i18n2.str`Host`,
        fromStr: (v3) => {
          if (v3.startsWith("http")) {
            try {
              const url = new URL(v3);
              return url.host + url.pathname;
            } catch {
              return v3;
            }
          }
          return v3;
        },
        tooltip: i18n2.str`Bank host`,
        help: /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(i18n2.Translate, null, "Enter the data without a scheme. A subpath may be included:")), /* @__PURE__ */ h("div", null, "bank.com/"), /* @__PURE__ */ h("div", null, "bank.com/path/subpath/"))
      }
    ), /* @__PURE__ */ h(
      Input,
      {
        name: "path2",
        readonly,
        label: i18n2.str`Account`,
        tooltip: i18n2.str`Bank account`
      }
    )),
    value.target !== void 0 && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "params.receiver-name",
        readonly,
        label: i18n2.str`Name of the account holder`,
        placeholder: i18n2.str`John Doe`,
        tooltip: i18n2.str`Legal name of the person holding the account.`
      }
    ))
  ));
}
function cleanupPath1(str, type) {
  if (type === "iban") {
    return str.replace(/\s/g, "").toUpperCase();
  }
  if (type === "x-taler-bank") {
    return !str.endsWith("/") ? str + "/" : str;
  }
  return str;
}

// src/paths/instance/accounts/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
function UpdatePage({ account, onUpdated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [{ persona }] = usePreference();
  const accountAuthType = persona === "developer" ? ["unedit", "none", "basic", "bearer"] : ["unedit", "none", "basic"];
  const [state, setState] = p3({
    payto_uri: account.payto_uri,
    credit_facade_url: account.credit_facade_url,
    credit_facade_credentials: {
      // @ts-expect-error unofficial unedited value
      type: "unedit"
    }
  });
  const [revenuePayto, setRevenuePayto] = p3(
    // parsePaytoUri("payto://x-taler-bank/asd.com:1010/asd/pepe"),
    void 0
  );
  const parsed = !state.payto_uri ? void 0 : Paytos.fromString(state.payto_uri);
  const safeParsed = parsed?.type === "fail" ? void 0 : parsed?.body;
  const replacingAccountId = state.payto_uri !== account.payto_uri;
  const facadeURL = safeConvertURL(state.credit_facade_url);
  const errors2 = undefinedIfEmpty2({
    payto_uri: !state.payto_uri ? i18n2.str`Required` : void 0,
    credit_facade_url: !state.credit_facade_url ? void 0 : !facadeURL ? i18n2.str`Invalid url` : !facadeURL.href.endsWith("/") ? i18n2.str`URL must end with a '/'` : facadeURL.searchParams.size > 0 ? i18n2.str`URL must not contain params` : facadeURL.hash ? i18n2.str`URL must not hash param` : void 0,
    credit_facade_credentials: !state.credit_facade_credentials || !state.credit_facade_url ? void 0 : undefinedIfEmpty2({
      type: replacingAccountId && // @ts-expect-error unedit is not in facade creds
      state.credit_facade_credentials?.type === "unedit" ? i18n2.str`Required` : void 0,
      username: state.credit_facade_credentials?.type !== "basic" ? void 0 : !state.credit_facade_credentials.username ? i18n2.str`Required` : void 0,
      token: state.credit_facade_credentials?.type !== "bearer" ? void 0 : !state.credit_facade_credentials.token ? i18n2.str`Required` : void 0,
      password: state.credit_facade_credentials?.type !== "basic" ? void 0 : !state.credit_facade_credentials.password ? i18n2.str`Required` : void 0
    })
  });
  const hasErrors = errors2 !== void 0;
  const credit_facade_url = !state.credit_facade_url ? void 0 : facadeURL?.href;
  const credit_facade_credentials = credit_facade_url == void 0 || state.credit_facade_credentials === void 0 ? void 0 : (
    // @ts-expect-error unedit is not in facade creds
    state.credit_facade_credentials.type === "unedit" ? void 0 : state.credit_facade_credentials.type === "basic" ? {
      type: "basic",
      password: state.credit_facade_credentials.password,
      username: state.credit_facade_credentials.username
    } : state.credit_facade_credentials.type === "bearer" ? {
      type: "bearer",
      token: state.credit_facade_credentials.token
    } : {
      type: "none"
    }
  );
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  async function changeBankAccount(token, newPayto, id, data, challengeIds) {
    if (newPayto) {
      const details = {
        ...data,
        payto_uri: newPayto
      };
      const created = await lib.instance.addBankAccount(token, details, {
        challengeIds
      });
      if (created.type === "fail")
        return created;
      const deleted = await lib.instance.deleteBankAccount(token, id);
      if (deleted.type === "fail")
        return deleted;
    } else {
      const resp = await lib.instance.updateBankAccount(token, id, data);
      if (resp.type === "fail")
        return resp;
    }
    return opEmptySuccess();
  }
  const mfa = useChallengeHandler();
  const update = safeFunctionHandler(
    changeBankAccount,
    !session.token ? void 0 : [
      session.token,
      replacingAccountId ? state.payto_uri : void 0,
      account.h_wire,
      {
        credit_facade_credentials,
        credit_facade_url
      },
      []
    ]
  );
  update.onSuccess = onUpdated;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict`;
    }
  };
  const repeat = update.lambda((ids) => [
    update.args[0],
    update.args[1],
    update.args[2],
    update.args[3],
    ids
  ]);
  const revenueAPI = !state.credit_facade_url ? void 0 : new URL("./", state.credit_facade_url);
  const test = safeFunctionHandler(
    testRevenueAPI,
    !revenueAPI || !state.credit_facade_url ? void 0 : [revenueAPI, state.credit_facade_credentials]
  );
  test.onSuccess = (success) => {
    const match6 = state.payto_uri === Paytos.toFullString(success);
    setState({
      ...state,
      verified: match6
    });
    if (!match6) {
      setRevenuePayto(success);
    }
  };
  test.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.BadRequest:
        return i18n2.str`Server replied with "bad request".`;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized, check credentials.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`The endpoint does not seem to be a Taler Revenue API.`;
      case 0 /* CANT_VALIDATE */:
        return i18n2.str`The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.`;
      case PaytoParseError.UNSUPPORTED:
      case PaytoParseError.COMPONENTS_LENGTH:
      case PaytoParseError.INVALID_TARGET_PATH:
      case PaytoParseError.WRONG_PREFIX:
      case PaytoParseError.INCOMPLETE:
        return i18n2.str`Unsupported type of account`;
    }
  };
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: repeat,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBanner, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Account:"), " ", /* @__PURE__ */ h("b", null, succeedOrThrow(Paytos.fromString(account.payto_uri)).displayName))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      InputPaytoForm,
      {
        name: "payto_uri",
        label: i18n2.str`Account`
      }
    ),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 20 /* action_useRevenueApi */ }, /* @__PURE__ */ h("div", { class: "message-body", style: { marginBottom: 10 } }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync."))), /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_url",
        label: i18n2.str`Endpoint URL`,
        help: "https://bank.demo.taler.net/accounts/${USERNAME}/taler-revenue/",
        expand: true,
        tooltip: i18n2.str`From where the merchant can download information about incoming wire transfers to this account`
      }
    ), /* @__PURE__ */ h(
      InputSelector,
      {
        name: "credit_facade_credentials.type",
        label: i18n2.str`Auth type`,
        tooltip: i18n2.str`Choose the authentication type for the account info URL`,
        values: accountAuthType,
        toStr: (str) => {
          if (str === "none")
            return i18n2.str`Without authentication`;
          if (str === "basic")
            return i18n2.str`With username and password`;
          if (str === "bearer")
            return i18n2.str`With token`;
          return i18n2.str`Do not change`;
        }
      }
    ), state.credit_facade_credentials?.type === "basic" ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.username",
        label: i18n2.str`Username`,
        tooltip: i18n2.str`Username to access the account information.`
      }
    ), /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.password",
        inputType: "password",
        label: i18n2.str`Password`,
        tooltip: i18n2.str`Password to access the account information.`
      }
    )) : void 0, state.credit_facade_credentials?.type === "bearer" ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.token",
        label: i18n2.str`Token`,
        inputType: "password",
        tooltip: i18n2.str`Access token to access the account information.`
      }
    )) : void 0, /* @__PURE__ */ h(
      InputToggle,
      {
        label: i18n2.str`Match`,
        tooltip: i18n2.str`Check where the information match against the server info.`,
        name: "verified",
        readonly: true,
        threeState: true,
        side: /* @__PURE__ */ h(
          ButtonBetterBulma,
          {
            class: "button is-info",
            "data-tooltip": i18n2.str`Compare info from server with account form`,
            onClick: test
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Test")
        )
      }
    ))
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      onClick: update,
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))))), !revenuePayto ? void 0 : /* @__PURE__ */ h(
    CompareAccountsModal,
    {
      onCancel: () => {
        setRevenuePayto(void 0);
      },
      confirm: safeFunctionHandler(async () => {
        setState({
          ...state,
          payto_uri: Paytos.toFullString(revenuePayto)
        });
        setRevenuePayto(void 0);
        return opEmptySuccess();
      }, []),
      formPayto: safeParsed,
      testPayto: revenuePayto
    }
  ));
}
function safeConvertURL(s6) {
  if (!s6)
    return void 0;
  try {
    return new URL(s6);
  } catch (e5) {
    return void 0;
  }
}

// src/paths/instance/accounts/create/CreatePage.tsx
function CreatePage3({ onCreated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [{ persona }] = usePreference();
  const accountAuthType = persona === "developer" ? ["none", "basic", "bearer"] : ["none", "basic"];
  const [state, setState] = p3({
    credit_facade_credentials: {
      type: "basic",
      password: "",
      username: ""
    }
  });
  const facadeURL = safeConvertURL(state.credit_facade_url);
  const [revenuePayto, setRevenuePayto] = p3(
    void 0
  );
  const parsed = !state.payto_uri ? void 0 : Paytos.fromString(state.payto_uri);
  const safeParsed = parsed?.type === "fail" ? void 0 : parsed?.body;
  const errors2 = undefinedIfEmpty2({
    payto_uri: !state.payto_uri ? i18n2.str`Required` : void 0,
    credit_facade_credentials: undefinedIfEmpty2(
      !state.credit_facade_credentials || !state.credit_facade_url ? void 0 : {
        username: state.credit_facade_credentials.type === "basic" && !state.credit_facade_credentials.username ? i18n2.str`Required` : void 0,
        password: state.credit_facade_credentials.type === "basic" && !state.credit_facade_credentials.password ? i18n2.str`Required` : void 0
      }
    ),
    credit_facade_url: !state.credit_facade_url ? void 0 : !facadeURL ? i18n2.str`Invalid url` : !facadeURL.href.endsWith("/") ? i18n2.str`URL must end with a '/'` : facadeURL.searchParams.size > 0 ? i18n2.str`URL must not contain params` : facadeURL.hash ? i18n2.str`URL must not hash param` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const credit_facade_url = !state.credit_facade_url ? void 0 : facadeURL?.href;
  const credit_facade_credentials = credit_facade_url == void 0 ? void 0 : state.credit_facade_credentials?.type === "basic" ? {
    type: "basic",
    password: state.credit_facade_credentials.password,
    username: state.credit_facade_credentials.username
  } : {
    type: "none"
  };
  const { state: session, lib } = useSessionContext();
  const request = {
    payto_uri: state.payto_uri,
    credit_facade_credentials,
    credit_facade_url
  };
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const add4 = safeFunctionHandler(
    (token, request2, challengeIds) => lib.instance.addBankAccount(token, request2, { challengeIds }),
    !session.token ? void 0 : [session.token, request, []]
  );
  add4.onSuccess = onCreated;
  add4.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  const repeat = add4.lambda((ids) => [
    add4.args[0],
    add4.args[1],
    ids
  ]);
  const revenueAPI = !state.credit_facade_url ? void 0 : new URL("./", state.credit_facade_url);
  const test = safeFunctionHandler(
    testRevenueAPI,
    !state.credit_facade_credentials || !revenueAPI ? void 0 : [revenueAPI, state.credit_facade_credentials]
  );
  test.onSuccess = (success) => {
    const match6 = state.payto_uri === Paytos.toFullString(success);
    setState({
      ...state,
      verified: match6
    });
    if (!match6) {
      setRevenuePayto(success);
    }
  };
  test.onFail = (fail) => {
    switch (fail.case) {
      case 0 /* CANT_VALIDATE */:
        return i18n2.str`The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.`;
      case HttpStatusCode.BadRequest:
        return i18n2.str`Server didn't like the request we made.`;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized, check credentials.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`The endpoint does not seem to be a Taler Revenue API.`;
      case PaytoParseError.UNSUPPORTED:
      case PaytoParseError.COMPONENTS_LENGTH:
      case PaytoParseError.INVALID_TARGET_PATH:
      case PaytoParseError.WRONG_PREFIX:
      case PaytoParseError.INCOMPLETE:
        return i18n2.str`Unsupported type of account`;
    }
  };
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: repeat,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      InputPaytoForm,
      {
        name: "payto_uri",
        label: i18n2.str`Account details`
      }
    ),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 20 /* action_useRevenueApi */ }, /* @__PURE__ */ h("div", { class: "message-body", style: { marginBottom: 10 } }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync."))), /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_url",
        label: i18n2.str`Endpoint URL`,
        help: "https://bank.demo.taler.net/accounts/${USERNAME}/taler-revenue/",
        expand: true,
        tooltip: i18n2.str`From where the merchant can download information about incoming wire transfers to this account`
      }
    ), /* @__PURE__ */ h(
      InputSelector,
      {
        name: "credit_facade_credentials.type",
        label: i18n2.str`Auth type`,
        tooltip: i18n2.str`Choose the authentication type for the account info URL`,
        values: accountAuthType,
        toStr: (str) => {
          if (str === "none")
            return i18n2.str`Without authentication`;
          if (str === "bearer")
            return i18n2.str`With token`;
          return "With username and password";
        }
      }
    ), state.credit_facade_credentials?.type === "basic" ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.username",
        label: i18n2.str`Username`,
        tooltip: i18n2.str`Username to access the account information.`
      }
    ), /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.password",
        inputType: "password",
        label: i18n2.str`Password`,
        tooltip: i18n2.str`Password to access the account information.`
      }
    )) : void 0, state.credit_facade_credentials?.type === "bearer" ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      Input,
      {
        name: "credit_facade_credentials.token",
        label: i18n2.str`Token`,
        inputType: "password",
        tooltip: i18n2.str`Access token to access the account information.`
      }
    )) : void 0, /* @__PURE__ */ h(
      InputToggle,
      {
        label: i18n2.str`Match`,
        tooltip: i18n2.str`Check if the information matches the server info.`,
        name: "verified",
        readonly: true,
        threeState: true,
        side: /* @__PURE__ */ h(
          ButtonBetterBulma,
          {
            class: "button is-info",
            "data-tooltip": i18n2.str`Compare info from server with account form`,
            onClick: test
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Test")
        )
      }
    ))
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      onClick: add4,
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))), !revenuePayto ? void 0 : /* @__PURE__ */ h(
    CompareAccountsModal,
    {
      onCancel: () => {
        setRevenuePayto(void 0);
      },
      confirm: safeFunctionHandler(async () => {
        setState({
          ...state,
          payto_uri: Paytos.toFullString(revenuePayto)
        });
        setRevenuePayto(void 0);
        return opEmptySuccess();
      }, []),
      formPayto: safeParsed,
      testPayto: revenuePayto
    }
  ));
}

// src/paths/instance/accounts/create/index.tsx
function CreateValidator({ onConfirm, onBack }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(CreatePage3, { onBack, onCreated: onConfirm }));
}
async function testRevenueAPI(revenueAPI, creds) {
  const httpLib = new BrowserFetchHttpLib();
  const api = new TalerRevenueHttpClient(revenueAPI.href, httpLib);
  const auth = creds === void 0 ? void 0 : creds.type === "none" ? void 0 : creds.type === "basic" ? {
    type: "basic",
    username: creds.username,
    password: creds.password
  } : creds.type === "bearer" ? {
    type: "bearer",
    token: creds.token
  } : void 0;
  try {
    const config = await api.getConfig(auth);
    if (config.type === "fail") {
      return config;
    }
    const resp = await api.getHistory(auth);
    if (resp.type === "fail") {
      return resp;
    }
    if (!resp.body.credit_account) {
      return {
        type: "fail",
        case: 0 /* CANT_VALIDATE */,
        detail: void 0
      };
    }
    const str = resp.body.credit_account;
    const uri = Paytos.fromString(str);
    if (uri.type === "fail")
      return uri;
    return opFixedSuccess(uri.body);
  } catch (err) {
    throw err;
  }
}

// src/paths/instance/accounts/list/index.tsx
init_preact_module();

// src/paths/instance/accounts/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable3({ accounts, onCreate, onSelect }) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const remove = safeFunctionHandler(
    lib.instance.deleteBankAccount.bind(lib.instance)
  ).lambda((id) => !session.token ? void 0 : [session.token, id]);
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  remove.onSuccess = () => i18n2.str`The bank account has been deleted.`;
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-bank" })), /* @__PURE__ */ h(i18n2.Translate, null, "Bank accounts")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new account`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        accessKey: "+",
        onClick: onCreate
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, accounts.length > 0 ? /* @__PURE__ */ h(
    Table3,
    {
      accounts,
      onDelete: remove,
      onSelect,
      rowSelection,
      rowSelectionHandler
    }
  ) : /* @__PURE__ */ h(EmptyTable3, null))))));
}
function Table3({ accounts, onDelete, onSelect }) {
  const { i18n: i18n2 } = useTranslationContext();
  const emptyList = {
    bitcoin: [],
    "x-taler-bank": [],
    iban: [],
    "taler-reserve": [],
    "taler-reserve-http": [],
    unknown: [],
    ethereum: []
  };
  const accountsByType = accounts.reduce((prev, acc) => {
    const parsed = parsePaytoUri(acc.payto_uri);
    if (!parsed)
      return prev;
    if (parsed.targetType !== "bitcoin" && parsed.targetType !== "taler-reserve" && parsed.targetType !== "taler-reserve-http" && parsed.targetType !== "x-taler-bank" && parsed.targetType !== "iban") {
      prev["unknown"].push({ parsed, acc });
    } else {
      prev[parsed.targetType].push({ parsed, acc });
    }
    return prev;
  }, emptyList);
  const bitcoinAccounts = accountsByType["bitcoin"];
  const talerbankAccounts = accountsByType["x-taler-bank"];
  const ibanAccounts = accountsByType["iban"];
  const unknownAccounts = accountsByType["unknown"];
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Wire method")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Account")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Owner's name")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, bitcoinAccounts.map(({ parsed, acc }, idx) => {
    return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      "Bitcoin"
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      succeedOrThrow(Paytos.fromString(acc.payto_uri)).displayName
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      parsed.params["receiver-name"]
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected accounts from the database`,
        onClick: onDelete.withArgs(acc.h_wire)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }), talerbankAccounts.map(({ parsed, acc }, idx) => {
    return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      "x-taler-bank"
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      succeedOrThrow(Paytos.fromString(acc.payto_uri)).displayName
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      parsed.params["receiver-name"]
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected accounts from the database`,
        onClick: onDelete.withArgs(acc.h_wire)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }), ibanAccounts.map(({ parsed, acc }, idx) => {
    return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      "IBAN"
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      succeedOrThrow(Paytos.fromString(acc.payto_uri)).displayName
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      parsed.params["receiver-name"]
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected accounts from the database`,
        onClick: onDelete.withArgs(acc.h_wire)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }), unknownAccounts.map(({ parsed, acc }, idx) => {
    return /* @__PURE__ */ h("tr", { key: idx }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      parsed.targetType
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      succeedOrThrow(Paytos.fromString(acc.payto_uri)).displayName
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(acc),
        style: { cursor: "pointer" }
      },
      parsed.params["receiver-name"]
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected accounts from the database`,
        onClick: onDelete.withArgs(acc.h_wire)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  })))));
}
function EmptyTable3() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no accounts yet, add more pressing the + sign")));
}

// src/paths/instance/accounts/list/index.tsx
function ListOtpDevices({ onCreate, onSelect }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state, lib } = useSessionContext();
  const result = useInstanceBankAccounts();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, result.body.accounts.length < 1 && /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        type: "WARN",
        message: i18n2.str`You must provide a bank account to receive payments.`,
        description: i18n2.str`Without this information, you cannot create new payment orders that are transferred to a bank account.`
      }
    }
  ), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(
    CardTable3,
    {
      accounts: result.body.accounts.map((o3) => ({
        ...o3,
        id: String(o3.h_wire)
      })),
      onCreate,
      onSelect: (e5) => {
        onSelect(e5.h_wire);
      }
    }
  )));
}

// src/paths/instance/accounts/update/index.tsx
init_preact_module();
function UpdateValidator({
  bid,
  onConfirm,
  onBack
}) {
  const { state, lib } = useSessionContext();
  const result = useBankAccountDetails(bid);
  const { i18n: i18n2 } = useTranslationContext();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage,
    {
      account: { ...result.body, id: bid },
      onBack,
      onUpdated: onConfirm
    }
  ));
}

// src/paths/instance/categories/create/index.tsx
init_preact_module();

// src/paths/instance/categories/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
function CreatePage4({ onCreated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [state, setState] = p3({ name_i18n: {} });
  const errors2 = undefinedIfEmpty2({
    name: !state.name ? i18n2.str`Required` : !/[a-zA-Z0-9]*/.test(state.name) ? i18n2.str`Invalid. Please use only letters and numbers.` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const data = !!errors2 ? void 0 : state;
  const create = safeFunctionHandler(
    lib.instance.addCategory.bind(lib.instance),
    !session.token || !data ? void 0 : [session.token, data]
  );
  create.onSuccess = onCreated;
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "name",
        label: i18n2.str`Name`,
        tooltip: i18n2.str`Category name`
      }
    ),
    " ",
    /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
        type: "submit",
        onClick: create
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
    ))
  )), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/categories/create/index.tsx
function CreateCategory({ onConfirm, onBack }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage4,
    {
      onBack,
      onCreated: onConfirm
    }
  ));
}

// src/paths/instance/categories/list/index.tsx
init_preact_module();

// src/hooks/category.ts
var useSWR5 = useSWR;
function revalidateInstanceCategories() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listCategories",
    void 0,
    { revalidate: true }
  );
}
function useInstanceCategories() {
  const { state, lib } = useSessionContext();
  async function fetcher([token, _bid]) {
    return await lib.instance.listCategories(token, {
      // limit: PAGINATED_LIST_REQUEST,
      // offset: bid,
      // order: "dec",
    });
  }
  const { data, error: error2 } = useSWR5([state.token, "offset", "listCategories"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function useCategoryDetails(deviceId) {
  const { state, lib } = useSessionContext();
  async function fetcher([dId, token]) {
    return await lib.instance.getCategoryDetails(token, dId);
  }
  const { data, error: error2 } = useSWR5([deviceId, state.token, "getCategoryDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/categories/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable4({
  devices,
  onCreate,
  onSelect,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const remove = safeFunctionHandler(
    lib.instance.deleteCategory.bind(lib.instance)
  ).lambda((id) => !session.token ? void 0 : [session.token, id]);
  remove.onSuccess = () => i18n2.str`Category deleted`;
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-label" })), /* @__PURE__ */ h(i18n2.Translate, null, "Categories")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new devices`
    },
    /* @__PURE__ */ h("button", { class: "button is-info", accessKey: "+", type: "button", onClick: onCreate }, /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" })))
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, devices.length > 0 ? /* @__PURE__ */ h(
    Table4,
    {
      instances: devices,
      onDelete: remove,
      onSelect,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable4, null))))));
}
function Table4({
  instances: instances2,
  onLoadMoreAfter,
  onDelete,
  onSelect,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices before the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Total products")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.category_id }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.category_id
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.name
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.product_count
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected category from the database`,
        onClick: onDelete.withArgs(String(i5.category_id))
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function EmptyTable4() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no categories yet, add more pressing the + sign")));
}

// src/paths/instance/categories/list/index.tsx
function ListCategories({ onCreate, onSelect }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state, lib } = useSessionContext();
  const result = useInstanceCategories();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(
    CardTable4,
    {
      devices: result.body.categories,
      onLoadMoreBefore: void 0,
      onLoadMoreAfter: void 0,
      onCreate,
      onSelect: (e5) => {
        onSelect(String(e5.category_id));
      }
    }
  )));
}

// src/paths/instance/categories/update/index.tsx
init_preact_module();

// src/paths/instance/categories/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();

// src/assets/empty.png
var empty_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAAA3NCSVQICAjb4U/gAAAAEHRFWHRTb2Z0d2FyZQBTaHV0dGVyY4LQCQAACn1JREFUeNrtnVtz2sgWRmkhkMDBgME4tuOML6mZ//9v5kwGAZJwwDZCdyHr0ueBc6acxBMk0J1vPaZcEmmt2r1771aLLBWtBkDSMBgCALEAxAIQCwCIBSAWgFgAQCwAsQDEAgBiAYgFIBYAEAtALACxAIBYAGIBiAUAxAIQC0AsACAWgFgAYgEAsQDEAhALAIgFigWb4LUopWEQBGGIYS0jhJB6vU4IIYQURSzf99frta7rvueFYUjxlMo4eRFSr9f5Vqvb7XY6nQP1Ioecj0UpdRxHWa1WqxUeTJXgOO58NOp2uyzLZi0WpXTx7dvLy0uIua+iNJvNz7/9dnJykp1YnudJomgYBka/4vMjw1xdXZ0NBnFnxn0CXRgEwni82Www7pUnDENZlsMwHJ6fx3KL2eNOs9kMVh0Vy+XSNM14oS5uXrVWFF3XMdZHRRAEwnj8+vqalliu6z4+PmKgj5On5TItsVarFdaAR4uqqkEQpCKWgUnwuCfE6EErhlgbx3FdF+N7zDw/P0ecsmKUGxRFifJnHMd1TjuEoL1dJnzP0zRtpzSUUtd1W61WkmJFWXAOh8Or6+tEupggY2zbngiC7/u//jPP86KIFWcq3FW7Yhjm4uNHWFVSWq3Wp5ub3ZnWLvPiiUUppXTHroVGo7F3zxLkDiGk0+lEMSH5VeHOX4bHU2oYJjEfkGKDdBzFEACIBSAWgFgAQCwAscARU6x6JqU0DMNX191sNpZtu67re15IKUNInWU5jmu32zzP8xzH1Osom0GsSIRhqCjKy/Oz53nvdkMt01RWK0IIy7Jng8FoNEqwoAcqKFYQBLqmPT09RdlKTyn1PG+5WCir1flo1O/30UeCWO+LMptO93iTzPO8x/lcUZSHhwe4heT9Ozabzde//jrk/cSN4xx4BVApsSilvu8L47HjOAde6vX1dTadvrpuxMY7qLJYvu9PBMHzvKSytK9fvx7uKCi3WJTSxWJh23aypn57fETQOmqxNFVVUjigxjTN56cnPNQjFSsMw6fn55QuvlguY72wC6ojlm3bTqKT4HeTbBhqqornenRiUUqXi0Wqt1DWa2RaRyeW53lxzy2JC16sPUaxbMvK4C4qZsNjE8vZZFFqMstQiP+3XjvE2ifB8j0/gxv5vh9GPhcleyilqqr+588/RVH0fR9iJUCQyfOmlIZFzd8ppbZtS6IYBIGmquJsVsm4lcOqsGI3ivurNE0TxuN/ZDIMYzadVi9uZS1WZts+C7i/lFJqmqYkST+EKF3XZUkKCjx3l0Cser2ejVUF3Fyqadp0Mnk3+dM0rWJxK9PRJ4Q0m80MbtRsNgslFqXUMAz5p1j1FsMwZFmuTNzKevT5CEcrHc6HCKemZImu69PJZKc0mqpGOaEKYr1Du93OIPvp9XqFqixIohhx6WdZllSJfCtrsViW7Xa7qd7i5OSk0WgUZHwNw9hWFmKEN02bCELZ3cphVXg+GqUatPpnZ0VYEm4rC/uVqSzLKvs6MYcMl+f5drud1v+HYdKOiBGxbVuczfaWQ1XVSYS0DGJ99+w/Xl6mFFRuPn/O/VUwSul6vRYE4cCSumWa4mxW0lw+nzX5hw8fRhcXaeTsuaft246NLEmJNCt1XS9pzye3Ys9wOOycniZ4wWaz+fHyMvcB/aFjk0j6X8baaW5isSx7e3vb3uvrnT/Dcdzvf/zBcVy+sWpbLEg8wJSx55NneZphmNvb287BxcxWq3V7d5dNs+jX6bYwHqe0XUfTtHLVTnPuezQajbv7++H5cL8ODCGk1+8/fPnC83y+scowjLksp5oMWZZVop5P/mdpEEKurq4Hg+FclmNth+c47tPNTbvdzr0tmFmKramq73l39/e5h+cSiLV1i+f5+4cHwzDWimLb9i/eDWw0Gu12u9vt9vr93AuhlFJd16N3bJKJW5L06eam4G4V6PSf7Sc3Op3O9gQs0zAsy/I8LwhDhpCtT51Op/H/nQtFKK/nUg5QVdV13YcvX4rsVrGOldq6QgjhOI7juMFwWNiByz5WvcVxnILHLRy1uCcHdmwSiVuTyaSwtVOItU+sUlX18I5NAvlWgXs+ECu2VaZpSqJYkNfLtnuaC1iDgFixH+S0YBOQWci4BbFixKqUOjaJLE7lgv0wiBUjWU6vY5NIKBWK1POBWJFilaZpcsodm0Ry+bjboCFWzhONOJuFZWjS6bpekP3yEGt3rMqrCrpn3CrGfnmItTtWlW7juaqqucetKohlmuYq6TOYt/vWxVLFqh/iVr41iNKLZdv2RBBkSdJ1PdnLJrVvPcdwm2PJrdximaY5nU63YzcRhJckTvkuTscmkbg1yylulVgs27ank4n3ZufWfD5fK8ohJ2MVrWOTQNzSNDGPGkRZxdrGqp/HS5IkRVH2vmwBOzaHY+h69nGrlGJtt6x47+0ypZTKkrSOf9R7kTs2ibglSVKWpxyWTyzDMHZ+NkwSxbjrRF3Xi9yxSWROzPJjMCX7MOn2WNidUZ1SOpflWq02GAx27mDOdy9oVSlTxLIsSxiPo3/i8HE+j/IlgZJWQSFWknlVrMdPKRVns9Vq9W+5RRk7NmWhHFOhZVnjv//eL/ecyzJDSP/s7N2lZVWPWYdYkSoLoijuvaKhlG4LOcPz87f/qKrqvPA7YTAVpoXjOBNB8A5ezszn87c9n23HBnnVkYplmmaC5cqJIGzzrf/tBUWsOs6pcNuxSTaoyJLk+/7TcgmrjlQswzBS6nAtvn3DUz/SqdBxHEkU/cj1KoCIFS1WlfZEV1DQiBWxYwMQseKtASeV2F4HChSxtrEKViFiJcm2uwyrIFbCM6CIWAWxEp8BkVdBrORnQGwugFjJx6rpZILKAsRKkm3HBlZVmBzKDbZti+jYIGIlnldhBkTEShhK6dPTE6yCWKnIhUGHWABALACxAMQCAGIBiAUgFgAQC0AsALEAgFgAYgGIBQDEAhALVJKsd5AOz8+7vR7GPZ+HzbLVFIsQ0ul08IAxFQIAsQDEAhALAIgFIBaAWADkKlYQBhTvo5aZBA/UiCoWIaS+q27re77jOHg8JYVSulwud5vAMEmKVavV2u32zl8mS5JpGDhLrXRK+b6/XCxeXl52/nHEvlCMlk739NR48wGtd3EcZzwe41FVGI7jEo5Y3V5v5/eVQcWt4vlGo5GwWCzL7pwNQbW5vLyMGFzirQp7/T4G92jhef709DSVckO/3+d5HkN8nAwGg+i5UDyx6vX6zefPDIOy6tFxcnJyNhhE//vYirRarYuLCwz0sU2Ct3d3sQJKbLEIIaOLi+vrawz3kcAwzO3dXdxtzXtuTT4bDGittlws8CH4ys+An25uItauvgtAS0Xb+66bzWY6mbiuiwdQyUB1PhpdXFzsV7w8SKxarRaGoWkY6/Va13V0cqoBx3H9fr/b63Ect3dJ/FCx/iEIAtM0bdt2XTcMgxp2OZQKQgjLsnyr1el0EqkoJSYWAAetCgGAWABiAYgFAMQCEAtALAAgFoBYAGIBALEAxAIQCwCIBSAWgFgAQCwAsQDEAgBiAYgFIBYAEAtALACxAIBYAGIBiAUAxALp8l9rz86ZOS4ZWgAAAABJRU5ErkJggg==";

// src/hooks/product.ts
init_hooks_module();
var useSWR6 = useSWR;
function notUndefined(c5) {
  return c5 !== void 0;
}
function revalidateInstanceProducts() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listProductsWithId",
    void 0,
    { revalidate: true }
  );
}
function useInstanceProducts() {
  const { state, lib } = useSessionContext();
  const [offset, setOffset] = p3();
  async function fetcher([token, bid]) {
    const list = await lib.instance.listProducts(token, {
      limit: PAGINATED_LIST_REQUEST,
      offset: bid === void 0 ? void 0 : String(bid),
      order: "dec"
    });
    if (list.type !== "ok") {
      return list;
    }
    const all = await Promise.all(
      list.body.products.map(async (c5) => {
        const r3 = await lib.instance.getProductDetails(token, c5.product_id);
        if (r3.type === "fail") {
          return void 0;
        }
        return { ...r3.body, id: c5.product_id, serial: c5.product_serial };
      })
    );
    const products = all.filter(notUndefined);
    return opFixedSuccess({ products });
  }
  const { data, error: error2 } = useSWR6([state.token, offset, "listProductsWithId"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.products,
    offset,
    setOffset,
    (d6) => d6.serial,
    PAGINATED_LIST_REQUEST
  );
}
function useInstanceProductsFromIds(ids) {
  const { state, lib } = useSessionContext();
  const [offset, setOffset] = p3();
  async function fetcher([token, bid]) {
    const all = await Promise.all(
      ids.map(async (id, idx) => {
        const r3 = await lib.instance.getProductDetails(token, id);
        if (r3.type === "fail") {
          return void 0;
        }
        return { ...r3.body, id, serial: idx };
      })
    );
    const products = all.filter(notUndefined);
    return opFixedSuccess({ products });
  }
  const { data, error: error2 } = useSWR6([state.token, offset], fetcher, {
    revalidateOnFocus: true,
    revalidateIfStale: true,
    revalidateOnMount: true,
    // normally, do not refresh
    refreshInterval: 0,
    dedupingInterval: void 0,
    refreshWhenHidden: true,
    refreshWhenOffline: true,
    keepPreviousData: false
  });
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.products,
    offset,
    setOffset,
    (d6) => d6.serial,
    PAGINATED_LIST_REQUEST
  );
}
function revalidateProductDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getProductDetails",
    void 0,
    { revalidate: true }
  );
}
function useProductDetails(productId) {
  const { state, lib } = useSessionContext();
  async function fetcher([pid, token]) {
    return await lib.instance.getProductDetails(token, pid);
  }
  const { data, error: error2 } = useSWR6([productId, state.token, "getProductDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/categories/update/UpdatePage.tsx
function UpdatePage2({ category, onUpdated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const {
    state: { token },
    lib
  } = useSessionContext();
  const [state, setState] = p3({
    ...category,
    product_map: []
  });
  h2(() => {
    if (!category || !category?.products)
      return;
    const ps = category.products.map((prod) => {
      return lib.instance.getProductDetails(token, String(prod.product_id)).then((res) => {
        return res.type === "fail" ? void 0 : {
          id: String(prod.product_id),
          description: res.body.description
        };
      });
    });
    Promise.all(ps).then((all) => {
      const product_map = all.filter(notEmpty2);
      setState({ ...state, product_map });
    });
  }, []);
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const data = state;
  const update = safeFunctionHandler(
    lib.instance.updateCategory.bind(lib.instance),
    !token ? void 0 : [token, category.id, data]
  );
  update.onSuccess = onUpdated;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Id:"), "\xA0", /* @__PURE__ */ h("b", null, category.id))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(FormProvider, { object: state, valueHandler: setState }, /* @__PURE__ */ h(
    Input,
    {
      name: "name",
      label: i18n2.str`Name`,
      tooltip: i18n2.str`Name of the category`
    }
  )), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": i18n2.str`Confirm operation`,
      onClick: update
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )), /* @__PURE__ */ h(ProductListSmall, { onSelect: () => {
  }, list: category.products }))))));
}
function notEmpty2(value) {
  return value !== null && value !== void 0;
}
function ProductListSmall({
  list,
  onSelect
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const result = useInstanceProductsFromIds(list.map((d6) => d6.product_id));
  if (!result)
    return /* @__PURE__ */ h(Loading, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h("div", null, " not found ");
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h("div", null, " not authorized ");
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-shopping" })), /* @__PURE__ */ h(i18n2.Translate, null, "Products")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" })), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, result.body.length > 0 ? /* @__PURE__ */ h(Table5, { instances: result.body, onSelect }) : /* @__PURE__ */ h(EmptyTable5, null)))));
}
function Table5({
  instances: instances2,
  onSelect,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Image")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h(p2, { key: i5.id }, /* @__PURE__ */ h("tr", { key: "info" }, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(
      "img",
      {
        src: i5.image ? i5.image : empty_default,
        style: {
          border: "solid black 1px",
          maxHeight: "2em",
          width: "auto",
          height: "auto"
        }
      }
    )), /* @__PURE__ */ h("td", { class: "has-tooltip-right", style: { cursor: "pointer" } }, i5.product_name), /* @__PURE__ */ h(
      "td",
      {
        class: "has-tooltip-right",
        "data-tooltip": i5.description,
        style: { cursor: "pointer" }
      },
      i5.description.length > 30 ? i5.description.substring(0, 30) + "..." : i5.description
    )));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more products after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function EmptyTable5() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no products in this category.")));
}

// src/paths/instance/categories/update/index.tsx
function UpdateCategory({
  cid,
  onConfirm,
  onBack
}) {
  const result = useCategoryDetails(cid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage2,
    {
      category: {
        ...result.body,
        id: cid
      },
      onBack,
      onUpdated: onConfirm
    }
  ));
}

// src/paths/instance/kyc/list/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/kyc/list/ListPage.tsx
init_preact_module();
function ListPage({
  status,
  // onGetInfo,
  onShowInstructions
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-clock" })), /* @__PURE__ */ h(i18n2.Translate, null, "Account's KYC status")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" })), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, status.kyc_data.length > 0 ? /* @__PURE__ */ h(
    PendingTable,
    {
      entries: status.kyc_data,
      onShowInstructions
    }
  ) : /* @__PURE__ */ h(EmptyTable6, null))))));
}
function PendingTable({
  entries,
  onShowInstructions
  // onGetInfo,
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Exchange")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Account")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Status")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")))), /* @__PURE__ */ h("tbody", null, entries.map((e5, i5) => {
    return /* @__PURE__ */ h(
      "tr",
      {
        key: i5,
        onClick: () => onShowInstructions(e5),
        style: { cursor: "pointer" }
      },
      /* @__PURE__ */ h("td", null, e5.exchange_url),
      /* @__PURE__ */ h("td", null, e5.payto_uri),
      /* @__PURE__ */ h("td", null, function() {
        const st = getMerchantAccountKycStatusSimplified(e5.status);
        switch (st) {
          case types_taler_merchant_exports.MerchantAccountKycStatusSimplified.OK:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Ok");
          case types_taler_merchant_exports.MerchantAccountKycStatusSimplified.ACTION_REQUIRED:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Action required");
          case types_taler_merchant_exports.MerchantAccountKycStatusSimplified.WARNING:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Warning");
          case types_taler_merchant_exports.MerchantAccountKycStatusSimplified.ERROR:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Error");
          default:
            assertUnreachable(st);
        }
      }()),
      /* @__PURE__ */ h("td", null, function() {
        switch (e5.status) {
          case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_WIRE_REQUIRED:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Bank account verification required.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_REQUIRED:
            return /* @__PURE__ */ h(i18n2.Translate, null, "More information required.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.AWAITING_AML_REVIEW:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Awaiting for account review.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.READY:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Ready");
          case types_taler_merchant_exports.MerchantAccountKycStatus.NO_EXCHANGE_KEY:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Syncing...");
          case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_INTERNAL_ERROR:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Payment service internal error. Contact administrator or check again later.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_GATEWAY_TIMEOUT:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Payment service timeout. Contact administrator or check again later.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_UNREACHABLE:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Payment service unreachable. Contact administrator or check again later.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_WIRE_IMPOSSIBLE:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Incompatible core banking system.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.LOGIC_BUG:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Backend internal error. Contact administrator or check again later.");
          case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_STATUS_INVALID:
            return /* @__PURE__ */ h(i18n2.Translate, null, "Payment service response is invalid. Contact administrator or check again later.");
          default:
            assertUnreachable(e5.status);
        }
      }())
    );
  }))));
}
function EmptyTable6() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-emoticon-happy mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "No pending kyc verification!")));
}

// src/paths/instance/kyc/list/index.tsx
function ListKYC(_p) {
  const result = useInstanceKYCDetailsLongPolling();
  const [showingInstructions, setShowingInstructions] = p3(void 0);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.GatewayTimeout: {
        return /* @__PURE__ */ h("div", null);
      }
      case HttpStatusCode.BadGateway: {
        break;
      }
      case HttpStatusCode.ServiceUnavailable: {
        return /* @__PURE__ */ h("div", null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h("div", null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h("div", null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const status = result.body;
  if (!status) {
    return /* @__PURE__ */ h("div", null, "no kyc required");
  }
  return /* @__PURE__ */ h(p2, null, showingInstructions !== void 0 ? /* @__PURE__ */ h(
    ShowInstructionForKycRedirect,
    {
      e: showingInstructions,
      onCancel: () => setShowingInstructions(void 0)
    }
  ) : void 0, /* @__PURE__ */ h(
    ListPage,
    {
      status,
      onShowInstructions: (e5) => {
        setShowingInstructions(e5);
      }
    }
  ));
}
function ShowInstructionForKycRedirect({
  e: e5,
  onCancel
}) {
  const { i18n: i18n2 } = useTranslationContext();
  switch (e5.status) {
    case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_WIRE_REQUIRED:
      const uri = Paytos.fromString(e5.payto_uri);
      if (uri.type === "fail") {
        return /* @__PURE__ */ h(
          ConfirmModal,
          {
            label: i18n2.str`Ok`,
            description: i18n2.str`Wire account is invalid`,
            active: true,
            onCancel
          },
          /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, 'The backend service responded with "', e5.payto_uri, '" which is invalid.'))
        );
      }
      const tgs = (e5.payto_kycauths ?? []).map((d6) => Paytos.fromString(d6)).filter((d6) => {
        if (d6.type !== "ok") {
          console.error("server replied with a wrong payto://", d6);
        }
        return d6.type === "ok";
      }).map((d6) => d6.body);
      return /* @__PURE__ */ h(ValidBankAccount, { origin: uri.body, targets: tgs, onCancel });
    case types_taler_merchant_exports.MerchantAccountKycStatus.NO_EXCHANGE_KEY: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`No exchange keys`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The backend service is still synchronizing with the payment service provider."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_WIRE_IMPOSSIBLE: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Can't wire from this account`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.KYC_REQUIRED: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Test`,
          description: i18n2.str`KYC Required`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The payment provider requires more information."), " ", e5.access_token === void 0 ? void 0 : /* @__PURE__ */ h(
          "a",
          {
            href: `${e5.exchange_url}kyc-spa/${e5.access_token}`,
            target: "_blank",
            rel: "noreferrer"
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Click here to complete this step.")
        )),
        e5.access_token !== void 0 ? void 0 : /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "We are waiting for the access token to be present. Check again later."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.AWAITING_AML_REVIEW: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Awaiting AML review`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "This account is can't be used. The payment service provider is doing manual review of the account information."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.READY: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Ready`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "This account is ready to be used with the payment service provider."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.LOGIC_BUG: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Logic bug`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The backend service detected an internal error, contact the system administrator or check again later."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_INTERNAL_ERROR: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Internal error`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The payment service provider detected an internal error, contact the system administrator or check again later."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_GATEWAY_TIMEOUT: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Logic bug`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_UNREACHABLE: {
      return /* @__PURE__ */ h(
        ConfirmModal,
        {
          label: i18n2.str`Ok`,
          description: i18n2.str`Logic bug`,
          active: true,
          onCancel
        },
        /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Unable to reach the payment service provider, contact the system administrator or check again later."))
      );
    }
    case types_taler_merchant_exports.MerchantAccountKycStatus.EXCHANGE_STATUS_INVALID:
      {
        return /* @__PURE__ */ h(
          ConfirmModal,
          {
            label: i18n2.str`Ok`,
            description: i18n2.str`Logic bug`,
            active: true,
            onCancel
          },
          /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The payment service provider replied with a invalid status, contact the system administrator or check again later."))
        );
      }
      return /* @__PURE__ */ h("div", null);
    default:
      assertUnreachable(e5.status);
  }
}

// src/paths/instance/orders/create/index.tsx
init_preact_module();

// src/paths/instance/orders/create/CreatePage.tsx
init_preact_module();
init_hooks_module();

// src/components/form/InputCurrency.tsx
init_preact_module();
function InputCurrency({
  name,
  readonly,
  label,
  placeholder,
  help,
  tooltip,
  expand,
  addonAfter,
  children,
  side
}) {
  const { config } = useSessionContext();
  return /* @__PURE__ */ h(
    InputWithAddon,
    {
      name,
      readonly,
      addonBefore: config.currency,
      side,
      label,
      placeholder,
      help,
      tooltip,
      addonAfter,
      inputType: "number",
      expand,
      toStr: (v3) => v3?.split(":")[1] || "",
      fromStr: (v3) => !v3 ? void 0 : `${config.currency}:${v3}`,
      inputExtra: { min: 0, step: 1e-3 }
    },
    children
  );
}

// src/components/form/InputDate.tsx
init_preact_module();
init_hooks_module();

// src/components/picker/DatePicker.tsx
init_preact_module();
var DatePicker = class extends d {
  closeDatePicker() {
    this.props.closeFunction && this.props.closeFunction();
  }
  /**
   * Gets fired when a day gets clicked.
   * @param {object} e The event thrown by the <span /> element clicked
   */
  dayClicked(e5) {
    const element = e5.target;
    if (element.innerHTML === "")
      return false;
    const date = new Date(element.getAttribute("data-value"));
    this.setState({ currentDate: date });
    this.passDateToParent(date);
    return true;
  }
  /**
   * returns days in month as array
   * @param {number} month the month to display
   * @param {number} year the year to display
   */
  getDaysByMonth(month, year) {
    const calendar = [];
    const firstDay = new Date(year, month, 1).getDay();
    const lastDate = new Date(year, month + 1, 0).getDate();
    let day = 0;
    for (let i5 = 0; i5 < 42; i5++) {
      if (i5 >= firstDay && day !== null)
        day = day + 1;
      if (day !== null && day > lastDate)
        day = null;
      calendar.push({
        day: day === 0 || day === null ? null : day,
        // null or number
        date: day === 0 || day === null ? null : new Date(year, month, day),
        // null or Date()
        today: day === now.getDate() && month === now.getMonth() && year === now.getFullYear()
        // boolean
      });
    }
    return calendar;
  }
  /**
   * Display previous month by updating state
   */
  displayPrevMonth() {
    if (this.state.displayedMonth <= 0) {
      this.setState({
        displayedMonth: 11,
        displayedYear: this.state.displayedYear - 1
      });
    } else {
      this.setState({
        displayedMonth: this.state.displayedMonth - 1
      });
    }
  }
  /**
   * Display next month by updating state
   */
  displayNextMonth() {
    if (this.state.displayedMonth >= 11) {
      this.setState({
        displayedMonth: 0,
        displayedYear: this.state.displayedYear + 1
      });
    } else {
      this.setState({
        displayedMonth: this.state.displayedMonth + 1
      });
    }
  }
  /**
   * Display the selected month (gets fired when clicking on the date string)
   */
  displaySelectedMonth() {
    if (this.state.selectYearMode) {
      this.toggleYearSelector();
    } else {
      if (!this.state.currentDate)
        return false;
      this.setState({
        displayedMonth: this.state.currentDate.getMonth(),
        displayedYear: this.state.currentDate.getFullYear()
      });
    }
    return true;
  }
  toggleYearSelector() {
    this.setState({ selectYearMode: !this.state.selectYearMode });
  }
  changeDisplayedYear(e5) {
    const element = e5.target;
    this.toggleYearSelector();
    this.setState({
      displayedYear: parseInt(element.innerHTML, 10),
      displayedMonth: 0
    });
  }
  /**
   * Pass the selected date to parent when 'OK' is clicked
   */
  passSavedDateDateToParent() {
    this.passDateToParent(this.state.currentDate);
  }
  passDateToParent(date) {
    if (typeof this.props.dateReceiver === "function")
      this.props.dateReceiver(date);
    this.closeDatePicker();
  }
  componentDidUpdate() {
    if (this.state.selectYearMode) {
      document.getElementsByClassName("selected")[0].scrollIntoView();
    }
  }
  constructor() {
    super();
    this.closeDatePicker = this.closeDatePicker.bind(this);
    this.dayClicked = this.dayClicked.bind(this);
    this.displayNextMonth = this.displayNextMonth.bind(this);
    this.displayPrevMonth = this.displayPrevMonth.bind(this);
    this.getDaysByMonth = this.getDaysByMonth.bind(this);
    this.changeDisplayedYear = this.changeDisplayedYear.bind(this);
    this.passDateToParent = this.passDateToParent.bind(this);
    this.toggleYearSelector = this.toggleYearSelector.bind(this);
    this.displaySelectedMonth = this.displaySelectedMonth.bind(this);
    this.state = {
      currentDate: now,
      displayedMonth: now.getMonth(),
      displayedYear: now.getFullYear(),
      selectYearMode: false
    };
  }
  render() {
    const { currentDate, displayedMonth, displayedYear, selectYearMode } = this.state;
    return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("div", { class: `datePicker ${this.props.opened && "datePicker--opened"}` }, /* @__PURE__ */ h("div", { class: "datePicker--titles" }, /* @__PURE__ */ h(
      "h3",
      {
        style: {
          color: selectYearMode ? "rgba(255,255,255,.87)" : "rgba(255,255,255,.57)"
        },
        onClick: this.toggleYearSelector
      },
      currentDate.getFullYear()
    ), /* @__PURE__ */ h(
      "h2",
      {
        style: {
          color: !selectYearMode ? "rgba(255,255,255,.87)" : "rgba(255,255,255,.57)"
        },
        onClick: this.displaySelectedMonth
      },
      dayArr[currentDate.getDay()],
      ",",
      " ",
      monthArrShort[currentDate.getMonth()],
      " ",
      currentDate.getDate()
    )), !selectYearMode && /* @__PURE__ */ h("nav", null, /* @__PURE__ */ h("span", { onClick: this.displayPrevMonth, class: "icon" }, /* @__PURE__ */ h(
      "i",
      {
        style: { transform: "rotate(180deg)" },
        class: "mdi mdi-forward"
      }
    )), /* @__PURE__ */ h("h4", null, monthArrShortFull[displayedMonth], " ", displayedYear), /* @__PURE__ */ h("span", { onClick: this.displayNextMonth, class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-forward" }))), /* @__PURE__ */ h("div", { class: "datePicker--scroll" }, !selectYearMode && /* @__PURE__ */ h("div", { class: "datePicker--calendar" }, /* @__PURE__ */ h("div", { class: "datePicker--dayNames" }, ["S", "M", "T", "W", "T", "F", "S"].map((day, i5) => /* @__PURE__ */ h("span", { key: i5 }, day))), /* @__PURE__ */ h("div", { onClick: this.dayClicked, class: "datePicker--days" }, this.getDaysByMonth(
      this.state.displayedMonth,
      this.state.displayedYear
    ).map((day) => {
      let selected = false;
      if (currentDate && day.date)
        selected = currentDate.toLocaleDateString() === day.date.toLocaleDateString();
      return /* @__PURE__ */ h(
        "span",
        {
          key: day.day,
          class: (day.today ? "datePicker--today " : "") + (selected ? "datePicker--selected" : ""),
          disabled: !day.date,
          "data-value": day.date
        },
        day.day
      );
    }))), selectYearMode && /* @__PURE__ */ h("div", { class: "datePicker--selectYear" }, yearArr.map((year) => /* @__PURE__ */ h(
      "span",
      {
        key: year,
        class: year === displayedYear ? "selected" : "",
        onClick: this.changeDisplayedYear
      },
      year
    ))))), /* @__PURE__ */ h(
      "div",
      {
        class: "datePicker--background",
        onClick: this.closeDatePicker,
        style: {
          display: this.props.opened ? "block" : "none"
        }
      }
    ));
  }
};
var monthArrShortFull = [
  "January",
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December"
];
var monthArrShort = [
  "Jan",
  "Feb",
  "Mar",
  "Apr",
  "May",
  "Jun",
  "Jul",
  "Aug",
  "Sep",
  "Oct",
  "Nov",
  "Dec"
];
var dayArr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var now = /* @__PURE__ */ new Date();
var yearArr = [];
for (let i5 = 2010; i5 <= now.getFullYear() + 10; i5++) {
  yearArr.push(i5);
}

// src/components/form/InputDate.tsx
function InputDate({
  name,
  readonly,
  label,
  placeholder,
  help,
  tooltip,
  expand,
  withTimestampSupport,
  side
}) {
  const [opened, setOpened] = p3(false);
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  const { error: error2, required, value, onChange } = useField(name);
  let strValue = "";
  if (!value) {
    strValue = withTimestampSupport ? "unknown" : "";
  } else if (value instanceof Date) {
    strValue = format2(value, dateFormatForSettings(settings));
  } else if (value.t_s) {
    strValue = value.t_s === "never" ? withTimestampSupport ? i18n2.str`Never` : "" : format2(new Date(value.t_s * 1e3), dateFormatForSettings(settings));
  }
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, /* @__PURE__ */ h(
    "p",
    {
      class: expand ? "control is-expanded has-icons-right" : "control has-icons-right"
    },
    /* @__PURE__ */ h(
      "input",
      {
        class: "input",
        type: "text",
        readonly: true,
        value: strValue,
        placeholder,
        onClick: () => {
          if (!readonly)
            setOpened(true);
        }
      }
    ),
    help
  ), /* @__PURE__ */ h(
    "div",
    {
      class: "control",
      onClick: () => {
        if (!readonly)
          setOpened(true);
      }
    },
    /* @__PURE__ */ h("a", { class: "button is-static" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-calendar" })))
  )), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2)), !readonly && /* @__PURE__ */ h(
    "span",
    {
      "data-tooltip": withTimestampSupport ? i18n2.str`Change value to unknown date` : i18n2.str`Change value to empty`
    },
    /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info mr-3",
        onClick: () => onChange(void 0)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Clear")
    )
  ), withTimestampSupport && /* @__PURE__ */ h("span", { "data-tooltip": i18n2.str`Change value to never` }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info",
      onClick: () => onChange({ t_s: "never" })
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Never")
  )), side), /* @__PURE__ */ h(
    DatePicker,
    {
      opened,
      closeFunction: () => setOpened(false),
      dateReceiver: (d6) => {
        if (withTimestampSupport) {
          onChange({ t_s: d6.getTime() / 1e3 });
        } else {
          onChange(d6);
        }
      }
    }
  ));
}

// src/components/form/InputNumber.tsx
init_preact_module();
function InputNumber2({
  name,
  readonly,
  placeholder,
  tooltip,
  label,
  help,
  expand,
  children,
  side
}) {
  return /* @__PURE__ */ h(
    InputWithAddon,
    {
      name,
      readonly,
      fromStr: (v3) => !v3 ? void 0 : parseInt(v3, 10),
      toStr: (v3) => `${v3}`,
      inputType: "number",
      expand,
      label,
      placeholder,
      help,
      tooltip,
      inputExtra: { min: 0 },
      side
    },
    children
  );
}

// src/components/product/InventoryProductForm.tsx
init_preact_module();
init_hooks_module();

// src/components/form/InputSearchOnList.tsx
init_preact_module();
init_hooks_module();
function InputSearchOnList({
  selected,
  onChange,
  label,
  list,
  withImage
}) {
  const [nameForm, setNameForm] = p3({
    name: ""
  });
  const errors2 = {
    name: void 0
  };
  const { i18n: i18n2 } = useTranslationContext();
  if (selected) {
    return /* @__PURE__ */ h("article", { class: "media" }, withImage && /* @__PURE__ */ h("figure", { class: "media-left" }, /* @__PURE__ */ h("p", { class: "image is-128x128" }, /* @__PURE__ */ h("img", { src: selected.image ? selected.image : empty_default }))), /* @__PURE__ */ h("div", { class: "media-content" }, /* @__PURE__ */ h("div", { class: "content" }, /* @__PURE__ */ h("p", { class: "media-meta" }, /* @__PURE__ */ h(i18n2.Translate, null, "ID"), ": ", /* @__PURE__ */ h("b", null, selected.id)), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description"), ":", " ", selected.description), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info",
        onClick: () => onChange(void 0)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Clear")
    )))));
  }
  return /* @__PURE__ */ h(
    FormProvider,
    {
      errors: errors2,
      object: nameForm,
      valueHandler: setNameForm
    },
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "name",
        label,
        tooltip: i18n2.str`Enter description or id`,
        addonAfter: /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify" }))
      },
      /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
        DropdownList,
        {
          name: nameForm.name,
          list,
          onSelect: (p4) => {
            setNameForm({ name: "" });
            onChange(p4);
          },
          withImage: !!withImage
        }
      ))
    )
  );
}
function DropdownList({
  name,
  onSelect,
  list,
  withImage
}) {
  const { i18n: i18n2 } = useTranslationContext();
  if (!name) {
    return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("br", null));
  }
  const MATCH_NAME = new RegExp(name, "i");
  const filtered = list.filter(
    (p4) => MATCH_NAME.test(p4.id) || MATCH_NAME.test(p4.description)
  );
  return /* @__PURE__ */ h("div", { class: "dropdown is-active" }, /* @__PURE__ */ h(
    "div",
    {
      class: "dropdown-menu",
      id: "dropdown-menu",
      role: "menu",
      style: { minWidth: "20rem" }
    },
    /* @__PURE__ */ h("div", { class: "dropdown-content" }, !filtered.length ? /* @__PURE__ */ h("div", { class: "dropdown-item" }, /* @__PURE__ */ h(i18n2.Translate, null, "No match found for that description or ID.")) : filtered.map((p4) => /* @__PURE__ */ h(
      "div",
      {
        key: p4.id,
        class: "dropdown-item",
        onClick: () => onSelect(p4),
        style: { cursor: "pointer" }
      },
      /* @__PURE__ */ h("article", { class: "media" }, withImage && /* @__PURE__ */ h("div", { class: "media-left" }, /* @__PURE__ */ h("div", { class: "image", style: { minWidth: 64 } }, /* @__PURE__ */ h(
        "img",
        {
          src: p4.image ? p4.image : empty_default,
          style: { width: 64, height: 64 }
        }
      ))), /* @__PURE__ */ h("div", { class: "media-content" }, /* @__PURE__ */ h("div", { class: "content" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("strong", null, p4.id), " ", p4.extra !== void 0 ? /* @__PURE__ */ h("small", null, p4.extra) : void 0, /* @__PURE__ */ h("br", null), p4.description))))
    )))
  ));
}

// src/components/product/InventoryProductForm.tsx
function InventoryProductForm({
  currentProducts,
  onAddProduct,
  inventory
}) {
  const initialState = { quantity: 1 };
  const [state, setState] = p3(initialState);
  const [errors2, setErrors] = p3({});
  const { i18n: i18n2 } = useTranslationContext();
  const productWithInfiniteStock = state.product && state.product.total_stock === -1;
  const submit = () => {
    if (!state.product) {
      setErrors({
        product: i18n2.str`You must enter a valid product identifier.`
      });
      return;
    }
    if (productWithInfiniteStock) {
      onAddProduct(state.product, 1);
    } else {
      if (!state.quantity || state.quantity <= 0) {
        setErrors({ quantity: i18n2.str`Quantity must be greater than 0!` });
        return;
      }
      const currentStock = state.product.total_stock - state.product.total_lost - state.product.total_sold;
      const p4 = currentProducts[state.product.id];
      if (p4) {
        if (state.quantity + p4.quantity > currentStock) {
          const left = currentStock - p4.quantity;
          setErrors({
            quantity: i18n2.str`This quantity exceeds remaining stock. Currently, only ${left} units remain unreserved in stock.`
          });
          return;
        }
        onAddProduct(state.product, state.quantity + p4.quantity);
      } else {
        if (state.quantity > currentStock) {
          const left = currentStock;
          setErrors({
            quantity: i18n2.str`This quantity exceeds remaining stock. Currently, only ${left} units remain unreserved in stock.`
          });
          return;
        }
        onAddProduct(state.product, state.quantity);
      }
    }
    setState(initialState);
  };
  return /* @__PURE__ */ h(FormProvider, { errors: errors2, object: state, valueHandler: setState }, /* @__PURE__ */ h(
    InputSearchOnList,
    {
      label: i18n2.str`Search product`,
      selected: state.product,
      onChange: (p4) => setState((v3) => ({ ...v3, product: p4 })),
      list: inventory,
      withImage: true
    }
  ), state.product && /* @__PURE__ */ h("div", { class: "columns mt-5" }, /* @__PURE__ */ h("div", { class: "column is-two-thirds" }, !productWithInfiniteStock && /* @__PURE__ */ h(
    InputNumber2,
    {
      name: "quantity",
      label: i18n2.str`Quantity`,
      tooltip: i18n2.str`How many products will be added`
    }
  )), /* @__PURE__ */ h("div", { class: "column" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h("button", { class: "button is-success", onClick: submit }, /* @__PURE__ */ h(i18n2.Translate, null, "Add from inventory"))))));
}

// src/components/product/NonInventoryProductForm.tsx
init_preact_module();
init_hooks_module();

// src/hooks/listener.ts
init_hooks_module();
function useListener(action) {
  const [state, setState] = p3({});
  const subscriber = (listener) => {
    if (listener) {
      setState({
        toBeRan: () => {
          const whatWeGetFromTheListener = listener();
          return action(whatWeGetFromTheListener);
        }
      });
    } else {
      setState({
        toBeRan: void 0
      });
    }
  };
  const activator = state.toBeRan ? async () => {
    if (state.toBeRan) {
      return state.toBeRan();
    }
    return Promise.reject();
  } : void 0;
  return [activator, subscriber];
}

// src/components/form/InputTaxes.tsx
init_preact_module();
init_hooks_module();
function InputTaxes({ name, label }) {
  const { value: taxes, onChange } = useField(name);
  const { i18n: i18n2 } = useTranslationContext();
  const [value, valueHandler] = p3({});
  const errors2 = undefinedIfEmpty2({
    name: !value.name ? i18n2.str`Required` : void 0,
    tax: !value.tax ? i18n2.str`Required` : Amounts.parse(value.tax) === void 0 ? i18n2.str`Invalid` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const submit = T2(() => {
    onChange([value, ...taxes]);
    valueHandler({});
  }, [value]);
  return /* @__PURE__ */ h(
    InputGroup,
    {
      name: "tax",
      label,
      alternative: taxes.length > 0 && /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "This product has ", taxes.length, " applicable taxes configured."))
    },
    /* @__PURE__ */ h(
      FormProvider,
      {
        name: "tax",
        errors: errors2,
        object: value,
        valueHandler
      },
      /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }), /* @__PURE__ */ h("div", { class: "field-body", style: { display: "block" } }, taxes.map((v3, i5) => /* @__PURE__ */ h(
        "div",
        {
          key: i5,
          class: "tags has-addons mt-3 mb-0 mr-3",
          style: { flexWrap: "nowrap" }
        },
        /* @__PURE__ */ h(
          "span",
          {
            class: "tag is-medium is-info mb-0",
            style: { maxWidth: "90%" }
          },
          /* @__PURE__ */ h("b", null, v3.tax),
          ": ",
          v3.name
        ),
        /* @__PURE__ */ h(
          "a",
          {
            class: "tag is-medium is-danger is-delete mb-0",
            onClick: () => {
              onChange(taxes.filter((f3) => f3 !== v3));
              valueHandler(v3);
            }
          }
        )
      )), !taxes.length && i18n2.str`No taxes configured for this product.`)),
      /* @__PURE__ */ h(
        Input,
        {
          name: "tax",
          label: i18n2.str`Amount`,
          tooltip: i18n2.str`Taxes can be in currencies that differ from the main currency used by the merchant.`
        },
        /* @__PURE__ */ h(i18n2.Translate, null, 'Enter the currency and value separated by a colon (e.g., "USD:2.3").')
      ),
      /* @__PURE__ */ h(
        Input,
        {
          name: "name",
          label: i18n2.str`Description`,
          tooltip: i18n2.str`Legal name of the tax, e.g. VAT or import duties.`
        }
      ),
      /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, /* @__PURE__ */ h(
        "button",
        {
          type: "button",
          class: "button is-info",
          "data-tooltip": i18n2.str`Add tax to the tax list`,
          disabled: hasErrors,
          onClick: submit
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Add")
      ))
    )
  );
}

// src/components/product/NonInventoryProductForm.tsx
function NonInventoryProductFrom({
  productToEdit,
  onAddProduct
}) {
  const [showCreateProduct, setShowCreateProduct] = p3(false);
  const isEditing = !!productToEdit;
  h2(() => {
    setShowCreateProduct(isEditing);
  }, [isEditing]);
  const [submitForm, addFormSubmitter] = useListener((result) => {
    if (result) {
      setShowCreateProduct(false);
      return onAddProduct({
        product_name: result.product_name || "",
        quantity: result.quantity || 0,
        taxes: result.taxes || [],
        description: result.description || "",
        image: result.image || "",
        price: result.price || "",
        unit: result.unit || ""
      });
    }
    return Promise.resolve();
  });
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "buttons" }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-success",
      "data-tooltip": i18n2.str`Describe and add a product that is not in the inventory list`,
      onClick: () => setShowCreateProduct(true)
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Add custom product")
  )), showCreateProduct && /* @__PURE__ */ h("div", { class: "modal is-active" }, /* @__PURE__ */ h(
    "div",
    {
      class: "modal-background ",
      onClick: () => setShowCreateProduct(false)
    }
  ), /* @__PURE__ */ h("div", { class: "modal-card" }, /* @__PURE__ */ h("header", { class: "modal-card-head" }, /* @__PURE__ */ h("p", { class: "modal-card-title" }, i18n2.str`Complete information of the product`), /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "delete ",
      "aria-label": "close",
      onClick: () => setShowCreateProduct(false)
    }
  )), /* @__PURE__ */ h("section", { class: "modal-card-body" }, /* @__PURE__ */ h(
    ProductForm,
    {
      initial: productToEdit,
      onSubscribe: addFormSubmitter
    }
  )), /* @__PURE__ */ h("footer", { class: "modal-card-foot" }, /* @__PURE__ */ h("div", { class: "buttons is-right", style: { width: "100%" } }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button ",
      onClick: () => setShowCreateProduct(false)
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")
  ), /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info ",
      disabled: !submitForm,
      onClick: submitForm
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))), /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "modal-close is-large ",
      "aria-label": "close",
      onClick: () => setShowCreateProduct(false)
    }
  )));
}
function ProductForm({ onSubscribe, initial: initial4 }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [value, valueHandler] = p3({
    taxes: [],
    ...initial4
  });
  const errors2 = undefinedIfEmpty2({
    quantity: value.quantity === void 0 ? i18n2.str`Required` : typeof value.quantity !== "number" ? i18n2.str`Must be a number.` : value.quantity < 1 ? i18n2.str`Must be greater than 0.` : void 0,
    description: !value.description ? i18n2.str`Required` : void 0,
    unit: !value.unit ? i18n2.str`Required` : void 0,
    price: !value.price ? i18n2.str`Required` : Amounts.parse(value.price) === void 0 ? i18n2.str`Invalid` : void 0
  });
  const submit = T2(() => {
    return value;
  }, [value]);
  const hasErrors = errors2 !== void 0;
  h2(() => {
    onSubscribe(hasErrors ? void 0 : submit);
  }, [submit, hasErrors]);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "product",
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      InputImage,
      {
        name: "image",
        label: i18n2.str`Image`,
        tooltip: i18n2.str`Photo of the product.`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        inputType: "multiline",
        label: i18n2.str`Description`,
        tooltip: i18n2.str`Full product description.`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "unit",
        label: i18n2.str`Unit name`,
        tooltip: i18n2.str`Name of the product unit.`
      }
    ),
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "price",
        label: i18n2.str`Price per unit`,
        tooltip: i18n2.str`Amount in the current currency.`
      }
    ),
    /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "quantity",
        label: i18n2.str`Quantity`,
        tooltip: i18n2.str`How many products will be added.`
      }
    ),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 23 /* option_inventoryTaxes */ }, /* @__PURE__ */ h(
      InputTaxes,
      {
        name: "taxes",
        label: i18n2.str`Taxes`
      }
    ))
  ));
}

// src/components/product/ProductList.tsx
init_preact_module();
function ProductList({ list, actions = [] }) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Image")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Quantity")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Price per unit")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Total price")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, list.map((entry, index2) => {
    const unitPrice = !entry.price ? "0" : entry.price;
    const totalPrice = !entry.price ? "0" : Amounts.stringify(
      Amounts.mult(
        Amounts.parseOrThrow(entry.price),
        entry.quantity ?? 0
      ).amount
    );
    return /* @__PURE__ */ h("tr", { key: index2 }, /* @__PURE__ */ h("td", null, /* @__PURE__ */ h(
      "img",
      {
        style: { height: 32, width: 32 },
        src: entry.image ? entry.image : empty_default
      }
    )), /* @__PURE__ */ h("td", null, entry.product_name), /* @__PURE__ */ h("td", null, entry.quantity === 0 ? "--" : `${entry.quantity} ${entry.unit}`), /* @__PURE__ */ h("td", null, unitPrice), /* @__PURE__ */ h("td", null, totalPrice), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, actions.map((a6, i5) => {
      return /* @__PURE__ */ h("div", { key: i5, class: "buttons is-right" }, /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-danger has-tooltip-left",
          "data-tooltip": a6.tooltip,
          type: "button",
          onClick: () => a6.handler(entry, index2)
        },
        a6.name
      ));
    })));
  }))));
}

// src/utils/amount.ts
function mergeRefunds(prev, cur) {
  let tail;
  if (prev.length === 0 || //empty list
  cur.timestamp.t_s === "never" || //current does not have timestamp
  (tail = prev[prev.length - 1]).timestamp.t_s === "never" || // last does not have timestamp
  cur.reason !== tail.reason || //different reason
  cur.pending !== tail.pending || //different pending state
  Math.abs(cur.timestamp.t_s - tail.timestamp.t_s) > 1e3 * 60) {
    prev.push(cur);
    return prev;
  }
  const a6 = Amounts.parseOrThrow(tail.amount);
  const b5 = Amounts.parseOrThrow(cur.amount);
  const r3 = Amounts.add(a6, b5).amount;
  prev[prev.length - 1] = {
    ...tail,
    amount: Amounts.stringify(r3)
  };
  return prev;
}
function rate(a6, b5) {
  const af = toFloat(a6);
  const bf = toFloat(b5);
  if (bf === 0)
    return 0;
  return af / bf;
}
function toFloat(amount) {
  return amount.value + amount.fraction / amountFractionalBase;
}

// src/paths/instance/orders/create/CreatePage.tsx
function with_defaults2(config, _currency) {
  const defaultPayDelay = Duration.fromTalerProtocolDuration(
    config.default_pay_delay
  );
  const defaultWireDelay = Duration.fromTalerProtocolDuration(
    config.default_wire_transfer_delay
  );
  const defaultRefundDelay = Duration.fromTalerProtocolDuration(
    config.default_refund_delay
  );
  return {
    inventoryProducts: {},
    products: [],
    pricing: {},
    payments: {
      max_fee: void 0,
      createToken: true,
      pay_delay: defaultPayDelay,
      refund_delay: defaultRefundDelay,
      wire_transfer_delay: defaultWireDelay
    },
    shipping: {},
    extra: {}
  };
}
function isInvalidUrl(url) {
  try {
    const asd = new URL("./", url);
    return false;
  } catch (e5) {
    return true;
  }
}
function CreatePage5({
  onCreated,
  onBack,
  instanceConfig,
  instanceInventory
}) {
  const { config, lib, state: session } = useSessionContext();
  const instance_default = with_defaults2(instanceConfig, config.currency);
  const [value, valueHandler] = p3(instance_default);
  const zero = Amounts.zeroOfCurrency(config.currency);
  const inventoryList = Object.values(value.inventoryProducts || {});
  const productList = Object.values(value.products || {});
  const { i18n: i18n2 } = useTranslationContext();
  const parsedPrice = !value.pricing?.order_price ? void 0 : Amounts.parse(value.pricing.order_price);
  const errors2 = undefinedIfEmpty2({
    pricing: undefinedIfEmpty2({
      summary: !value.pricing?.summary ? i18n2.str`Required` : void 0,
      order_price: !value.pricing?.order_price ? i18n2.str`Required` : !parsedPrice ? i18n2.str`Invalid` : Amounts.isZero(parsedPrice) ? i18n2.str`Must be greater than 0` : void 0
    }),
    payments: undefinedIfEmpty2({
      wire_transfer_delay: !value.payments?.wire_transfer_delay ? i18n2.str`Required` : void 0,
      // refund_delay: !value.payments?.refund_delay ? i18n.str`Required` : undefined,
      pay_delay: !value.payments?.pay_delay ? i18n2.str`Required` : void 0,
      auto_refund_delay: !value.payments?.auto_refund_delay ? void 0 : !value.payments?.refund_delay ? i18n2.str`Must have a refund deadline` : Duration.cmp(
        value.payments.refund_delay,
        value.payments.auto_refund_delay
      ) == -1 ? i18n2.str`Auto refund can't be after refund deadline` : void 0
    }),
    shipping: undefinedIfEmpty2({
      delivery_date: !value.shipping?.delivery_date ? void 0 : !isFuture(value.shipping.delivery_date) ? i18n2.str`Must be in the future` : void 0,
      fulfillment_message: !!value.shipping?.fulfillment_message && !!value.shipping?.fulfillment_url ? i18n2.str`Either fulfillment url or fulfillment message must be specified.` : void 0,
      fulfillment_url: !!value.shipping?.fulfillment_message && !!value.shipping?.fulfillment_url ? i18n2.str`Either fulfillment url or fulfillment message must be specified.` : !!value.shipping?.fulfillment_url && isInvalidUrl(value.shipping.fulfillment_url) ? i18n2.str`is not a valid URL` : void 0
    })
  });
  const order = value;
  const price = order.pricing?.order_price;
  const summary = order.pricing?.summary;
  const payDelay = !value.payments?.pay_delay ? Duration.getZero() : value.payments.pay_delay;
  const refundDelay = !value.payments?.refund_delay ? Duration.getZero() : Duration.add(
    payDelay,
    !value.payments?.refund_delay ? Duration.getZero() : value.payments.refund_delay
  );
  const autoRefundDelay = !value.payments?.auto_refund_delay ? Duration.getZero() : Duration.add(
    payDelay,
    !value.payments?.auto_refund_delay ? Duration.getZero() : value.payments.auto_refund_delay
  );
  const wireDelay = !value.payments?.wire_transfer_delay ? Duration.getZero() : Duration.add(
    refundDelay,
    !value.payments?.wire_transfer_delay ? Duration.getZero() : value.payments.wire_transfer_delay
  );
  const pay_deadline = !value.payments?.pay_delay ? void 0 : AbsoluteTime.toProtocolTimestamp(
    AbsoluteTime.addDuration(AbsoluteTime.now(), payDelay)
  );
  const refund_deadline = !value.payments?.refund_delay ? void 0 : AbsoluteTime.toProtocolTimestamp(
    AbsoluteTime.addDuration(AbsoluteTime.now(), refundDelay)
  );
  const wire_transfer_deadline = !value.payments || !value.payments.wire_transfer_delay ? void 0 : AbsoluteTime.toProtocolTimestamp(
    AbsoluteTime.addDuration(AbsoluteTime.now(), wireDelay)
  );
  const request = !value.payments || !value.shipping || !price || !summary ? void 0 : {
    order: {
      version: OrderVersion.V0,
      amount: price,
      // version: OrderVersion.V1,
      // choices: [{
      //   amount: price,
      //   max_fee: value.payments.max_fee as AmountString,
      // }],
      summary,
      products: productList,
      extra: undefinedIfEmpty2(value.extra),
      pay_deadline,
      refund_deadline,
      wire_transfer_deadline,
      auto_refund: value.payments.auto_refund_delay ? Duration.toTalerProtocolDuration(
        value.payments.auto_refund_delay
      ) : void 0,
      delivery_date: value.shipping.delivery_date ? { t_s: value.shipping.delivery_date.getTime() / 1e3 } : void 0,
      delivery_location: value.shipping.delivery_location,
      fulfillment_url: value.shipping.fulfillment_url,
      fulfillment_message: value.shipping.fulfillment_message,
      minimum_age: value.payments.minimum_age
    },
    inventory_products: inventoryList.map((p4) => ({
      product_id: p4.product.id,
      quantity: p4.quantity
    })),
    create_token: value.payments.createToken
  };
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const create = safeFunctionHandler(
    lib.instance.createOrder.bind(lib.instance),
    !session.token || !request ? void 0 : [session.token, request]
  );
  create.onSuccess = (resp) => {
    onCreated(resp.order_id);
  };
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict`;
      case HttpStatusCode.Gone:
        return i18n2.str`Product with ID "${fail.body.product_id}" is out of stock.`;
      case HttpStatusCode.UnavailableForLegalReasons:
        return i18n2.str`No exchange would accept a payment because of KYC requirements.`;
    }
  };
  const addProductToTheInventoryList = (product, quantity) => {
    valueHandler((v3) => {
      const inventoryProducts = { ...v3.inventoryProducts };
      inventoryProducts[product.id] = { product, quantity };
      return { ...v3, inventoryProducts };
    });
  };
  const removeProductFromTheInventoryList = (id) => {
    valueHandler((v3) => {
      const inventoryProducts = { ...v3.inventoryProducts };
      delete inventoryProducts[id];
      return { ...v3, inventoryProducts };
    });
  };
  const addNewProduct = async (product) => {
    return valueHandler((v3) => {
      const products = v3.products ? [...v3.products, product] : [];
      return { ...v3, products };
    });
  };
  const removeFromNewProduct = (index2) => {
    valueHandler((v3) => {
      const products = v3.products ? [...v3.products] : [];
      products.splice(index2, 1);
      return { ...v3, products };
    });
  };
  const [editingProduct, setEditingProduct] = p3(void 0);
  const totalPriceInventory = inventoryList.reduce((prev, cur) => {
    const p4 = Amounts.parseOrThrow(cur.product.price);
    return Amounts.add(prev, Amounts.mult(p4, cur.quantity).amount).amount;
  }, zero);
  const totalPriceProducts = productList.reduce((prev, cur) => {
    if (!cur.price)
      return zero;
    const p4 = Amounts.parseOrThrow(cur.price);
    return Amounts.add(prev, Amounts.mult(p4, cur.quantity ?? 0).amount).amount;
  }, zero);
  const hasProducts = inventoryList.length > 0 || productList.length > 0;
  const totalPrice = Amounts.add(totalPriceInventory, totalPriceProducts);
  const totalAsString = Amounts.stringify(totalPrice.amount);
  const allProducts = productList.concat(inventoryList.map(asProduct));
  const [newField, setNewField] = p3("");
  h2(() => {
    valueHandler((v3) => {
      return {
        ...v3,
        pricing: {
          ...v3.pricing,
          products_price: hasProducts ? totalAsString : void 0,
          order_price: hasProducts ? totalAsString : void 0
        }
      };
    });
  }, [hasProducts, totalAsString]);
  const discountOrRise = rate(
    parsedPrice ?? Amounts.zeroOfCurrency(config.currency),
    totalPrice.amount
  );
  const discountOrRiseRounded = Math.round((discountOrRise - 1) * 100);
  const minAgeByProducts = inventoryList.reduce(
    (cur, prev) => !prev.product.minimum_age || cur > prev.product.minimum_age ? cur : prev.product.minimum_age,
    0
  );
  const noDefault_payDeadline = !instance_default.payments || !instance_default.payments.pay_delay;
  const noDefault_wireDeadline = !instance_default.payments || !instance_default.payments.wire_transfer_delay;
  const requiresSomeTalerOptions = noDefault_payDeadline || noDefault_wireDeadline;
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    InputGroup,
    {
      name: "inventory_products",
      label: i18n2.str`Manage products in order`,
      alternative: allProducts.length > 0 && /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, allProducts.length, " products with a total price of", " ", totalAsString, ".")),
      tooltip: i18n2.str`Manage list of products in the order.`
    },
    /* @__PURE__ */ h(
      InventoryProductForm,
      {
        currentProducts: value.inventoryProducts || {},
        onAddProduct: addProductToTheInventoryList,
        inventory: instanceInventory
      }
    ),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 18 /* option_advanceOrderCreation */
      },
      /* @__PURE__ */ h(
        NonInventoryProductFrom,
        {
          productToEdit: editingProduct,
          onAddProduct: (p4) => {
            setEditingProduct(void 0);
            return addNewProduct(p4);
          }
        }
      )
    ),
    allProducts.length > 0 && /* @__PURE__ */ h(
      ProductList,
      {
        list: allProducts,
        actions: [
          {
            name: i18n2.str`Remove`,
            tooltip: i18n2.str`Remove this product from the order.`,
            handler: (e5, index2) => {
              if (e5.product_id) {
                removeProductFromTheInventoryList(e5.product_id);
              } else {
                removeFromNewProduct(index2);
                setEditingProduct(e5);
              }
            }
          }
        ]
      }
    )
  ), /* @__PURE__ */ h(
    FormProvider,
    {
      errors: errors2,
      object: value,
      valueHandler
    },
    hasProducts ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "pricing.products_price",
        label: i18n2.str`Products price sum`,
        readonly: true,
        tooltip: i18n2.str`Total product price added up`
      }
    ), /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "pricing.order_price",
        label: i18n2.str`Order price`,
        addonAfter: discountOrRiseRounded > 0 && (discountOrRiseRounded < 1 ? `discount of ${discountOrRiseRounded}%` : `rise of ${discountOrRiseRounded}%`),
        tooltip: i18n2.str`Amount to be paid by the customer`
      }
    )) : /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "pricing.order_price",
        label: i18n2.str`Order price`,
        tooltip: i18n2.str`Final order price`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "pricing.summary",
        inputType: "multiline",
        label: i18n2.str`Summary`,
        tooltip: i18n2.str`Title of the order to be shown to the customer`
      }
    ),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 18 /* option_advanceOrderCreation */,
        showAnywayIf: errors2?.shipping !== void 0
      },
      /* @__PURE__ */ h(
        InputGroup,
        {
          name: "shipping",
          label: i18n2.str`Shipping and fulfillment`,
          initialActive: true
        },
        /* @__PURE__ */ h(
          InputDate,
          {
            name: "shipping.delivery_date",
            label: i18n2.str`Delivery date`,
            tooltip: i18n2.str`Deadline for physical delivery assured by the merchant.`
          }
        ),
        /* @__PURE__ */ h(
          InputGroup,
          {
            name: "shipping.delivery_location",
            label: i18n2.str`Delivery location`,
            tooltip: i18n2.str`Address where the products will be delivered`
          },
          /* @__PURE__ */ h(InputLocation, { name: "shipping.delivery_location" })
        ),
        /* @__PURE__ */ h(
          Input,
          {
            name: "shipping.fulfillment_url",
            label: i18n2.str`Fulfillment URL`,
            tooltip: i18n2.str`URL to which the user will be redirected after successful payment.`
          }
        ),
        /* @__PURE__ */ h(
          Input,
          {
            name: "shipping.fulfillment_message",
            label: i18n2.str`Fulfillment message`,
            tooltip: i18n2.str`Message shown to the customer after paying for the order.`
          }
        )
      )
    ),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 18 /* option_advanceOrderCreation */,
        showAnywayIf: requiresSomeTalerOptions || errors2?.payments !== void 0
      },
      /* @__PURE__ */ h(
        InputGroup,
        {
          name: "payments",
          label: i18n2.str`Taler payment options`,
          tooltip: i18n2.str`Override default Taler payment settings for this order`
        },
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: noDefault_payDeadline || errors2?.payments?.pay_delay !== void 0
          },
          /* @__PURE__ */ h(
            InputDuration,
            {
              name: "payments.pay_delay",
              label: i18n2.str`Payment time`,
              help: /* @__PURE__ */ h(DeadlineHelp, { duration: payDelay }),
              tooltip: i18n2.str`Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.`,
              side: /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(
                "button",
                {
                  type: "button",
                  class: "button",
                  onClick: () => {
                    const c5 = {
                      ...value,
                      payments: {
                        ...value.payments ?? {},
                        pay_delay: instance_default.payments?.pay_delay
                      }
                    };
                    valueHandler(c5);
                  }
                },
                /* @__PURE__ */ h(i18n2.Translate, null, "Default")
              ))
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: errors2?.payments?.refund_delay !== void 0
          },
          /* @__PURE__ */ h(
            InputDuration,
            {
              name: "payments.refund_delay",
              label: i18n2.str`Refund time`,
              help: /* @__PURE__ */ h(DeadlineHelp, { duration: refundDelay }),
              tooltip: i18n2.str`Time while the order can be refunded by the merchant. Time starts after the order is created.`,
              side: /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(
                "button",
                {
                  type: "button",
                  class: "button",
                  onClick: () => {
                    valueHandler({
                      ...value,
                      payments: {
                        ...value.payments ?? {},
                        refund_delay: instance_default.payments?.refund_delay
                      }
                    });
                  }
                },
                /* @__PURE__ */ h(i18n2.Translate, null, "Default")
              ))
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: noDefault_wireDeadline || errors2?.payments?.wire_transfer_delay !== void 0
          },
          /* @__PURE__ */ h(
            InputDuration,
            {
              name: "payments.wire_transfer_delay",
              label: i18n2.str`Wire transfer time`,
              help: /* @__PURE__ */ h(DeadlineHelp, { duration: wireDelay }),
              tooltip: i18n2.str`Time for the exchange to make the wire transfer. Time starts after the order is created.`,
              side: /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(
                "button",
                {
                  type: "button",
                  class: "button",
                  onClick: () => {
                    valueHandler({
                      ...value,
                      payments: {
                        ...value.payments ?? {},
                        wire_transfer_delay: instance_default.payments?.wire_transfer_delay
                      }
                    });
                  }
                },
                /* @__PURE__ */ h(i18n2.Translate, null, "Default")
              ))
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: errors2?.payments?.auto_refund_delay !== void 0
          },
          /* @__PURE__ */ h(
            InputDuration,
            {
              name: "payments.auto_refund_delay",
              label: i18n2.str`Auto-refund time`,
              help: /* @__PURE__ */ h(DeadlineHelp, { duration: autoRefundDelay }),
              tooltip: i18n2.str`Time until which the wallet will automatically check for refunds without user interaction.`,
              withForever: true
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: errors2?.payments?.max_fee !== void 0
          },
          /* @__PURE__ */ h(
            InputCurrency,
            {
              name: "payments.max_fee",
              label: i18n2.str`Maximum fee`,
              tooltip: i18n2.str`Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.`
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 18 /* option_advanceOrderCreation */,
            showAnywayIf: errors2?.payments?.createToken !== void 0
          },
          /* @__PURE__ */ h(
            InputToggle,
            {
              name: "payments.createToken",
              label: i18n2.str`Create token`,
              tooltip: i18n2.str`If the order ID is easy to guess, the token will prevent other users from claiming the order.`
            }
          )
        ),
        /* @__PURE__ */ h(
          FragmentPersonaFlag,
          {
            point: 22 /* option_ageRestriction */,
            showAnywayIf: errors2?.payments?.minimum_age !== void 0
          },
          /* @__PURE__ */ h(
            InputNumber2,
            {
              name: "payments.minimum_age",
              label: i18n2.str`Minimum age required`,
              tooltip: i18n2.str`Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products`,
              help: minAgeByProducts > 0 ? i18n2.str`Minimum age defined by the products is ${minAgeByProducts}` : i18n2.str`No product with age restriction in this order`
            }
          )
        )
      )
    ),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 18 /* option_advanceOrderCreation */,
        showAnywayIf: requiresSomeTalerOptions || errors2?.extra !== void 0
      },
      /* @__PURE__ */ h(
        InputGroup,
        {
          name: "extra",
          label: i18n2.str`Additional information`,
          tooltip: i18n2.str`Custom information to be included in the contract for this order.`
        },
        Object.keys(value.extra ?? {}).map((key, idx) => {
          return /* @__PURE__ */ h(
            Input,
            {
              name: `extra.${key}`,
              key: String(idx),
              inputType: "multiline",
              label: key,
              tooltip: i18n2.str`You must enter a value in JavaScript Object Notation (JSON).`,
              side: /* @__PURE__ */ h(
                "button",
                {
                  type: "button",
                  class: "button",
                  onClick: (e5) => {
                    if (value.extra && value.extra[key] !== void 0) {
                      delete value.extra[key];
                    }
                    valueHandler({
                      ...value
                    });
                    e5.preventDefault();
                  }
                },
                /* @__PURE__ */ h(i18n2.Translate, null, "remove")
              )
            }
          );
        }),
        /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Custom field name"), /* @__PURE__ */ h(
          "span",
          {
            class: "icon has-tooltip-right",
            "data-tooltip": "new extra field"
          },
          /* @__PURE__ */ h("i", { class: "mdi mdi-information" })
        ))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: "control" }, /* @__PURE__ */ h(
          "input",
          {
            class: "input ",
            value: newField,
            onChange: (e5) => setNewField(e5.currentTarget.value)
          }
        )))), /* @__PURE__ */ h(
          "button",
          {
            type: "button",
            class: "button",
            onClick: (e5) => {
              setNewField("");
              valueHandler({
                ...value,
                extra: {
                  ...value.extra ?? {},
                  [newField]: ""
                }
              });
              e5.preventDefault();
            }
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Add")
        ))
      )
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      class: "button is-success",
      type: "submit",
      onClick: create
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}
function asProduct(p4) {
  return {
    product_id: p4.product.id,
    product_name: p4.product.product_name,
    image: p4.product.image,
    price: p4.product.price,
    unit: p4.product.unit,
    quantity: p4.quantity,
    description: p4.product.description,
    taxes: p4.product.taxes
  };
}
function DeadlineHelp({ duration }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [now2, setNow] = p3(AbsoluteTime.now());
  h2(() => {
    const iid = setInterval(() => {
      setNow(AbsoluteTime.now());
    }, 60 * 1e3);
    return () => {
      clearInterval(iid);
    };
  });
  if (!duration || !duration.d_ms)
    return /* @__PURE__ */ h(i18n2.Translate, null, "Disabled");
  const when = AbsoluteTime.addDuration(now2, duration);
  if (when.t_ms === "never")
    return /* @__PURE__ */ h(i18n2.Translate, null, "No deadline");
  return /* @__PURE__ */ h(i18n2.Translate, null, "Deadline at ", format2(when.t_ms, "dd/MM/yy HH:mm"));
}

// src/paths/instance/orders/create/index.tsx
function OrderCreate({ onConfirm, onBack }) {
  const detailsResult = useInstanceDetails();
  const inventoryResult = useInstanceProducts();
  if (!detailsResult)
    return /* @__PURE__ */ h(Loading2, null);
  if (detailsResult instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: detailsResult });
  }
  if (detailsResult.type === "fail") {
    switch (detailsResult.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      default: {
        assertUnreachable(detailsResult);
      }
    }
  }
  if (!inventoryResult)
    return /* @__PURE__ */ h(Loading2, null);
  if (inventoryResult instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: inventoryResult });
  }
  if (inventoryResult.type === "fail") {
    switch (inventoryResult.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(inventoryResult);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage5,
    {
      onBack,
      onCreated: onConfirm,
      instanceConfig: detailsResult.body,
      instanceInventory: inventoryResult.body
    }
  ));
}

// src/paths/instance/orders/details/index.tsx
init_preact_module();

// src/hooks/order.ts
init_hooks_module();
var useSWR7 = useSWR;
function revalidateOrderDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getOrderDetails",
    void 0,
    { revalidate: true }
  );
}
function useOrderDetails(oderId) {
  const { state, lib } = useSessionContext();
  async function fetcher([dId, token]) {
    return await lib.instance.getOrderDetails(token, dId);
  }
  const { data, error: error2 } = useSWR7([oderId, state.token, "getOrderDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}
var latestRequestTime2 = 0;
function useWaitForOrderPayment(orderId, current) {
  const { state, lib } = useSessionContext();
  const token = state.status === "loggedIn" ? state.token : void 0;
  const evictWhenPaid = F(() => {
    return async () => {
      const DEFAULT_WAIT = 5e3;
      const now2 = (/* @__PURE__ */ new Date()).getTime();
      const diff = now2 - latestRequestTime2;
      if (diff < DEFAULT_WAIT) {
        console.log("PREVENT REQUEST BURST");
        await delayMs(DEFAULT_WAIT);
      }
      latestRequestTime2 = (/* @__PURE__ */ new Date()).getTime();
      const result = await lib.instance.getOrderDetails(token, orderId, {
        timeout: DEFAULT_WAIT
      });
      if (result.type === "ok" && result.body.order_status === "paid") {
        await revalidateOrderDetails();
      }
      return result;
    };
  }, [token]);
  const fetcher = !current || current.order_status === "paid" ? void 0 : evictWhenPaid;
  useAsyncWithRetry(fetcher, (r3, err) => {
    if (err !== void 0)
      return false;
    if (r3 == void 0)
      return false;
    if (r3.type === "fail") {
      return false;
    }
    if (r3.body.order_status === "paid") {
      return false;
    }
    return true;
  });
}
function revalidateInstanceOrders() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listOrders",
    void 0,
    { revalidate: true }
  );
}
function useInstanceOrders(args, updatePosition = () => {
}) {
  const { state, lib } = useSessionContext();
  async function fetcher([token, o3, p4, r3, w6, d6]) {
    return await lib.instance.listOrders(token, {
      limit: PAGINATED_LIST_REQUEST,
      offset: o3,
      order: "dec",
      paid: p4,
      refunded: r3,
      wired: w6,
      date: d6
    });
  }
  const { data, error: error2 } = useSWR7(
    [
      state.token,
      args?.position,
      args?.paid,
      args?.refunded,
      args?.wired,
      args?.date,
      "listOrders"
    ],
    fetcher
  );
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.orders,
    args?.position,
    updatePosition,
    (d6) => String(d6.row_id),
    PAGINATED_LIST_REQUEST
  );
}

// src/paths/instance/orders/details/DetailPage.tsx
init_preact_module();
init_hooks_module();

// src/components/form/TextField.tsx
init_preact_module();
function TextField({
  name,
  tooltip,
  label,
  expand,
  help,
  children,
  side
}) {
  const { error: error2 } = useField(name);
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h(
    "p",
    {
      class: expand ? "control is-expanded has-icons-right" : "control has-icons-right"
    },
    children,
    help
  ), error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, error2)), side));
}

// src/paths/instance/orders/list/Table.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/orders/list/index.tsx
init_preact_module();
init_hooks_module();

// src/components/form/JumpToElementById.tsx
init_preact_module();
init_hooks_module();
function NotificationFieldFoot({
  notification
}) {
  if (!notification)
    return null;
  if (notification.message.type === "error")
    return /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, notification.message.description);
  return null;
}
function JumpToElementById({
  onSelect,
  placeholder,
  description
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [id, setId] = p3();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const checkExist = safeFunctionHandler(
    (token, id2) => lib.instance.getProductDetails(token, id2),
    !session.token || !id ? void 0 : [session.token, id]
  );
  checkExist.onSuccess = (success, t5, id2) => {
    onSelect(id2);
  };
  checkExist.onFail = () => i18n2.str`Not found`;
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("form", null, /* @__PURE__ */ h("div", { class: "field has-addons" }, /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h(
    "input",
    {
      class: "input",
      type: "text",
      value: id ?? "",
      onChange: (e5) => {
        setId(e5.currentTarget.value);
        if (notification)
          notification.acknowledge();
      },
      placeholder
    }
  ), /* @__PURE__ */ h(NotificationFieldFoot, { notification })), /* @__PURE__ */ h("span", { class: "has-tooltip-bottom", "data-tooltip": description }, /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      class: "button",
      type: "submit",
      onClick: checkExist
    },
    /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-right" }))
  ))))))));
}

// src/paths/instance/orders/list/ListPage.tsx
init_preact_module();
init_hooks_module();
function ListPage2({
  onLoadMoreAfter,
  onLoadMoreBefore,
  orders,
  onSelectOrder,
  onRefundOrder,
  jumpToDate,
  onChangeSection,
  onSelectDate,
  section,
  onCreate
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const dateTooltip = i18n2.str`Select date to show nearby orders`;
  const [pickDate, setPickDate] = p3(false);
  const [settings] = usePreference();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-two-thirds" }, /* @__PURE__ */ h("div", { class: "tabs", style: { overflow: "inherit" } }, /* @__PURE__ */ h("ul", null, /* @__PURE__ */ h(
    "li",
    {
      class: section === "new" /* NEW */ ? "is-active" : void 0
    },
    /* @__PURE__ */ h(
      "div",
      {
        class: "has-tooltip-right",
        "data-tooltip": i18n2.str`Only show unpaid orders`
      },
      /* @__PURE__ */ h("a", { onClick: () => onChangeSection("new" /* NEW */) }, /* @__PURE__ */ h(i18n2.Translate, null, "New"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
    )
  ), /* @__PURE__ */ h(
    "li",
    {
      class: section === "paid" /* PAID */ ? "is-active" : void 0
    },
    /* @__PURE__ */ h(
      "div",
      {
        class: "has-tooltip-right",
        "data-tooltip": i18n2.str`Only show paid orders`
      },
      /* @__PURE__ */ h("a", { onClick: () => onChangeSection("paid" /* PAID */) }, /* @__PURE__ */ h(i18n2.Translate, null, "Paid"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
    )
  ), /* @__PURE__ */ h(
    "li",
    {
      class: section === "refunded" /* REFUNDED */ ? "is-active" : void 0
    },
    /* @__PURE__ */ h(
      "div",
      {
        class: "has-tooltip-right",
        "data-tooltip": i18n2.str`Only show orders with refunds`
      },
      /* @__PURE__ */ h("a", { onClick: () => onChangeSection("refunded" /* REFUNDED */) }, /* @__PURE__ */ h(i18n2.Translate, null, "Refunded"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
    )
  ), /* @__PURE__ */ h(
    "li",
    {
      class: section === "pending" /* PENDING */ ? "is-active" : void 0
    },
    /* @__PURE__ */ h(
      "div",
      {
        class: "has-tooltip-left",
        "data-tooltip": i18n2.str`Show only paid orders for which the wire transfer is still pending.`
      },
      /* @__PURE__ */ h("a", { onClick: () => onChangeSection("pending" /* PENDING */) }, /* @__PURE__ */ h(i18n2.Translate, null, "Not wired"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
    )
  ), /* @__PURE__ */ h(
    "li",
    {
      class: section === "incoming" /* INCOMING */ ? "is-active" : void 0
    },
    /* @__PURE__ */ h(
      "div",
      {
        class: "has-tooltip-left",
        "data-tooltip": i18n2.str`Only display orders that have already been transferred by the payment service provider`
      },
      /* @__PURE__ */ h("a", { onClick: () => onChangeSection("incoming" /* INCOMING */) }, /* @__PURE__ */ h(i18n2.Translate, null, "Completed"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
    )
  ), /* @__PURE__ */ h("li", { class: section === void 0 ? "is-active" : void 0 }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Remove all filters`
    },
    /* @__PURE__ */ h("a", { onClick: () => onChangeSection("all" /* ALL */) }, /* @__PURE__ */ h(i18n2.Translate, null, "All"), /* @__PURE__ */ h("i", { class: "mdi mdi-information ml-2" }))
  ))))), /* @__PURE__ */ h("div", { class: "column " }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, jumpToDate && /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h(
    "a",
    {
      class: "button is-fullwidth",
      onClick: () => onSelectDate(void 0)
    },
    /* @__PURE__ */ h(
      "span",
      {
        class: "icon",
        "data-tooltip": i18n2.str`Clear date filter`
      },
      /* @__PURE__ */ h("i", { class: "mdi mdi-close" })
    )
  )), /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("span", { class: "has-tooltip-top", "data-tooltip": dateTooltip }, /* @__PURE__ */ h(
    "input",
    {
      class: "input",
      type: "text",
      readonly: true,
      value: !jumpToDate || jumpToDate.t_ms === "never" ? "" : format2(
        jumpToDate.t_ms,
        dateFormatForSettings(settings)
      ),
      placeholder: i18n2.str`Jump to date (${dateFormatForSettings(
        settings
      )})`,
      onClick: () => {
        setPickDate(true);
      }
    }
  ))), /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("span", { class: "has-tooltip-left", "data-tooltip": dateTooltip }, /* @__PURE__ */ h(
    "a",
    {
      class: "button  is-fullwidth",
      onClick: () => {
        setPickDate(true);
      }
    },
    /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-calendar" }))
  ))))))), /* @__PURE__ */ h(
    DatePicker,
    {
      opened: pickDate,
      closeFunction: () => setPickDate(false),
      dateReceiver: (d6) => {
        onSelectDate(AbsoluteTime.fromMilliseconds(d6.getTime()));
      }
    }
  ), /* @__PURE__ */ h(
    CardTable5,
    {
      orders,
      onCreate,
      section,
      onSelect: onSelectOrder,
      onRefund: onRefundOrder,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ));
}

// src/paths/instance/orders/list/index.tsx
function sectionToFilter(s6) {
  switch (s6) {
    case "new" /* NEW */:
      return { paid: false };
    case "paid" /* PAID */:
      return { paid: true };
    case "refunded" /* REFUNDED */:
      return { refunded: true };
    case "pending" /* PENDING */:
      return { paid: true, wired: false };
    case "incoming" /* INCOMING */:
      return { wired: true };
    case "settled" /* SETTLED */:
    case "all" /* ALL */:
    case void 0:
      return {};
    default:
      assertUnreachable(s6);
  }
}
function OrderList({
  onCreate,
  onSelect,
  onChangeSection,
  section
}) {
  const [filter, setFilter] = p3({});
  const [orderToBeRefunded, setOrderToBeRefunded] = p3(void 0);
  const setNewDate = (date) => setFilter((prev) => ({ ...prev, date }));
  const result = useInstanceOrders(
    { ...sectionToFilter(section), ...filter },
    (d6) => setFilter({ ...filter, position: d6 })
  );
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const { i18n: i18n2 } = useTranslationContext();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const data = {};
  const refund = safeFunctionHandler(
    lib.instance.addRefund.bind(lib.instance),
    !session.token || !orderToBeRefunded ? void 0 : [session.token, orderToBeRefunded.order_id, data]
  );
  refund.onSuccess = () => {
    setOrderToBeRefunded(void 0);
  };
  refund.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.Forbidden:
        return i18n2.str`Forbidden.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
      case HttpStatusCode.Gone:
        return i18n2.str`Gone.`;
      case HttpStatusCode.UnavailableForLegalReasons:
        return i18n2.str`UnavailableForLegalReasons.`;
    }
  };
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    JumpToElementById,
    {
      onSelect,
      description: i18n2.str`Jump to order with the given product ID`,
      placeholder: i18n2.str`Order id`
    }
  ), /* @__PURE__ */ h(
    ListPage2,
    {
      orders: result.body.map((o3) => ({ ...o3, id: o3.order_id })),
      onLoadMoreBefore: result.loadFirst,
      onLoadMoreAfter: result.loadNext,
      onSelectOrder: (order) => onSelect(order.id),
      onRefundOrder: (value) => setOrderToBeRefunded(value),
      section,
      jumpToDate: filter.date,
      onSelectDate: setNewDate,
      onCreate,
      onChangeSection
    }
  ), orderToBeRefunded && /* @__PURE__ */ h(
    RefundModalForTable,
    {
      id: orderToBeRefunded.order_id,
      onCancel: () => setOrderToBeRefunded(void 0),
      onConfirmed: () => setOrderToBeRefunded(void 0)
    }
  ));
}
function RefundModalForTable({
  id,
  onConfirmed,
  onCancel
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const result = useOrderDetails(id);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case TalerErrorCode.MERCHANT_GENERIC_INSTANCE_UNKNOWN: {
        return /* @__PURE__ */ h(i18n2.Translate, null, "Instance unknown");
      }
      case TalerErrorCode.MERCHANT_GENERIC_ORDER_UNKNOWN: {
        return /* @__PURE__ */ h(i18n2.Translate, null, "Order unknown");
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(
    RefundModal,
    {
      id,
      order: result.body,
      onCancel,
      onConfirmed
    }
  );
}

// src/paths/instance/orders/list/Table.tsx
function CardTable5({
  orders,
  section,
  onCreate,
  onRefund,
  onSelect,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash-register" })), /* @__PURE__ */ h(i18n2.Translate, null, "Orders")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }), /* @__PURE__ */ h(
    HtmlPersonaFlag,
    {
      htmlElement: "div",
      point: 16 /* action_createOrderManually */,
      class: "card-header-icon",
      "aria-label": "more options"
    },
    /* @__PURE__ */ h("span", { class: "has-tooltip-left", "data-tooltip": i18n2.str`Create order` }, /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        accessKey: "+",
        onClick: onCreate
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    ))
  )), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, orders.length > 0 ? /* @__PURE__ */ h(
    Table6,
    {
      instances: orders,
      onSelect,
      onRefund,
      section,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable7, null)))));
}
function Table6({
  instances: instances2,
  section,
  onSelect,
  onRefund,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const copyUrl = safeFunctionHandler(
    (token, id) => lib.instance.getOrderDetails(token, id)
  );
  copyUrl.onSuccess = (success) => {
    copyToClipboard(success.order_status_url);
  };
  copyUrl.onFail = (fail) => {
    switch (fail.case) {
      case TalerErrorCode.MERCHANT_GENERIC_INSTANCE_UNKNOWN:
        return i18n2.str`The instance doesn't exist`;
      case TalerErrorCode.MERCHANT_GENERIC_ORDER_UNKNOWN:
        return i18n2.str`The order doesn't exist`;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
    }
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h("button", { class: "button is-fullwidth", onClick: onLoadMoreBefore }, /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")), /* @__PURE__ */ h("table", { class: "table is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", { style: { minWidth: 100 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Date")), /* @__PURE__ */ h("th", { style: { minWidth: 100 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Amount")), section === "refunded" /* REFUNDED */ ? /* @__PURE__ */ h("th", { style: { minWidth: 100 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Refunded")) : void 0, /* @__PURE__ */ h("th", { style: { minWidth: 400 } }, /* @__PURE__ */ h(i18n2.Translate, null, "Summary")), /* @__PURE__ */ h("th", { style: { minWidth: 50 } }))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.id }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.timestamp.t_s === "never" ? i18n2.str`Never` : format2(
        new Date(i5.timestamp.t_s * 1e3),
        datetimeFormatForSettings(settings)
      )
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.amount
    ), section === "refunded" /* REFUNDED */ ? /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.refund_amount
    ) : void 0, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.summary
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, i5.refundable && /* @__PURE__ */ h(
      "button",
      {
        class: "button is-small is-danger jb-modal",
        type: "button",
        onClick: () => onRefund(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Refund")
    ), !i5.paid && /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-small is-info jb-modal",
        type: "button",
        onClick: !session.token ? copyUrl : copyUrl.withArgs(session.token, i5.id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "copy url")
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more orders after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  )));
}
function EmptyTable7() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "No orders have been found matching your query!")));
}
function RefundModal({
  order,
  id,
  onCancel,
  onConfirmed
}) {
  const [form, setValue] = p3({});
  const [settings] = usePreference();
  const { i18n: i18n2 } = useTranslationContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  let amount;
  if (order.order_status === "paid") {
    const orderam = getOrderAmountAndWirefee(order);
    amount = typeof orderam === "string" ? void 0 : Amounts.stringify(orderam.amount);
  }
  const refunds = (order.order_status === "paid" ? order.refund_details : []).reduce(mergeRefunds, []);
  const { config } = useSessionContext();
  const totalRefunded = refunds.map((r3) => r3.amount).reduce(
    (p4, c5) => Amounts.add(p4, Amounts.parseOrThrow(c5)).amount,
    Amounts.zeroOfCurrency(config.currency)
  );
  const orderPrice = order.order_status === "paid" ? Amounts.parseOrThrow(amount) : void 0;
  const totalRefundable = !orderPrice ? Amounts.zeroOfCurrency(totalRefunded.currency) : refunds.length ? Amounts.sub(orderPrice, totalRefunded).amount : orderPrice;
  const isRefundable = Amounts.isNonZero(totalRefundable);
  const duplicatedText = i18n2.str`Duplicated`;
  const errors2 = {
    mainReason: !form.mainReason ? i18n2.str`Required` : void 0,
    description: !form.description && form.mainReason !== duplicatedText ? i18n2.str`Required` : void 0,
    refund: !form.refund ? i18n2.str`Required` : !Amounts.parse(form.refund) ? i18n2.str`Invalid` : Amounts.cmp(totalRefundable, Amounts.parse(form.refund)) === -1 ? i18n2.str`This value exceeds the refundable amount.` : void 0
  };
  const hasErrors = Object.keys(errors2).some(
    (k6) => errors2[k6] !== void 0
  );
  const req = !form.refund ? void 0 : {
    refund: Amounts.stringify(
      Amounts.add(Amounts.parse(form.refund), totalRefunded).amount
    ),
    reason: form.description === void 0 ? form.mainReason || "" : `${form.mainReason}: ${form.description}`
  };
  const refund = safeFunctionHandler(
    (token, id2, request) => lib.instance.addRefund(token, id2, request),
    !session.token || !req ? void 0 : [session.token, id, req]
  );
  refund.onSuccess = onConfirmed;
  refund.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.Forbidden:
        return i18n2.str`Forbidden`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict`;
      case HttpStatusCode.Gone:
        return i18n2.str`Gone`;
      case HttpStatusCode.UnavailableForLegalReasons:
        return i18n2.str`There are pending KYC requirements.`;
    }
  };
  return /* @__PURE__ */ h(
    ConfirmModal,
    {
      description: i18n2.str`refund`,
      label: i18n2.str`Confirm`,
      danger: true,
      active: true,
      onCancel,
      confirm: refund
    },
    /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }),
    refunds.length > 0 && /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-12" }, /* @__PURE__ */ h(
      InputGroup,
      {
        name: "asd",
        label: `${Amounts.stringify(totalRefunded)} was already refunded`
      },
      /* @__PURE__ */ h("table", { class: "table is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Date")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Amount")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Reason")))), /* @__PURE__ */ h("tbody", null, refunds.map((r3) => {
        return /* @__PURE__ */ h("tr", { key: r3.timestamp.t_s }, /* @__PURE__ */ h("td", null, r3.timestamp.t_s === "never" ? i18n2.str`Never` : format2(
          new Date(r3.timestamp.t_s * 1e3),
          datetimeFormatForSettings(settings)
        )), /* @__PURE__ */ h("td", null, r3.amount), /* @__PURE__ */ h("td", null, r3.reason));
      })))
    ))),
    isRefundable && /* @__PURE__ */ h(
      FormProvider,
      {
        errors: errors2,
        object: form,
        valueHandler: (d6) => setValue(d6)
      },
      /* @__PURE__ */ h(
        InputCurrency,
        {
          name: "refund",
          label: i18n2.str`Refund`,
          tooltip: i18n2.str`Amount to be refunded`
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Max refundable:"),
        " ",
        Amounts.stringify(totalRefundable)
      ),
      /* @__PURE__ */ h(
        InputSelector,
        {
          name: "mainReason",
          label: i18n2.str`Reason`,
          values: [
            i18n2.str`Choose one...`,
            duplicatedText,
            i18n2.str`Requested by the customer`,
            i18n2.str`Other`
          ],
          tooltip: i18n2.str`Why this order is being refunded`
        }
      ),
      form.mainReason && form.mainReason !== duplicatedText ? /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Description`,
          name: "description",
          tooltip: i18n2.str`More information to give context`
        }
      ) : void 0
    )
  );
}
async function copyToClipboard(text) {
  return navigator.clipboard.writeText(text);
}

// src/paths/instance/orders/details/Timeline.tsx
init_preact_module();
init_hooks_module();
function Timeline({ events: e5 }) {
  const { i18n: i18n2 } = useTranslationContext();
  const events2 = [...e5];
  events2.push({
    when: /* @__PURE__ */ new Date(),
    description: i18n2.str`now`,
    type: "now"
  });
  events2.sort((a6, b5) => a6.when.getTime() - b5.when.getTime());
  const [settings] = usePreference();
  const [state, setState] = p3(events2);
  h2(() => {
    const handle = setTimeout(() => {
      const eventsWithoutNow = state.filter((e6) => e6.type !== "now");
      eventsWithoutNow.push({
        when: /* @__PURE__ */ new Date(),
        description: i18n2.str`now`,
        type: "now"
      });
      setState(eventsWithoutNow);
    }, 1e3);
    return () => {
      clearTimeout(handle);
    };
  });
  return /* @__PURE__ */ h("div", { class: "timeline" }, events2.map((e6, i5) => {
    return /* @__PURE__ */ h("div", { key: i5, class: "timeline-item" }, (() => {
      switch (e6.type) {
        case "refund-deadline":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon ", "data-tooltip": i18n2.str`This is when the time for making refund has been expired.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-flag" }));
        case "pay-deadline":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon ", "data-tooltip": i18n2.str`This is when the time for making the payment has been expired.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-flag" }));
        case "wire-deadline":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon ", "data-tooltip": i18n2.str`This is when the wire transfer is going to be executed by the payment service provider.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-flag" }));
        case "delivery":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon " }, /* @__PURE__ */ h("i", { class: "mdi mdi-delivery" }));
        case "start":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-flag " }));
        case "wired-pending":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-warning", "data-tooltip": i18n2.str`This is when the wire transfer is going to be executed by the payment service provider.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash" }));
        case "wired-confirmed":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-success", "data-tooltip": i18n2.str`This wire transfer has been notified by the payment service provider.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash" }));
        case "refund-created":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-danger", "data-tooltip": i18n2.str`This refund is waiting to be claimed by the customer.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash" }));
        case "refund-taken":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-success", "data-tooltip": i18n2.str`This refund has been claimed by the customer.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash" }));
        case "now":
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-info", "data-tooltip": i18n2.str`The current moment in time.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-clock" }));
        case "refund-missed": {
          return /* @__PURE__ */ h("div", { class: "timeline-marker is-icon is-danger", "data-tooltip": i18n2.str`This refund can't be claimed because the wire transfer has already be made.` }, /* @__PURE__ */ h("i", { class: "mdi mdi-cash" }));
        }
        default: {
          assertUnreachable(e6.type);
        }
      }
    })(), /* @__PURE__ */ h("div", { class: "timeline-content" }, e6.type !== "now" && /* @__PURE__ */ h("p", { class: "heading" }, format2(e6.when, datetimeFormatForSettings(settings))), /* @__PURE__ */ h("p", null, e6.description)));
  }));
}

// src/paths/instance/orders/details/DetailPage.tsx
function ContractTerms({ value }) {
  if (value.version === void 0) {
    return /* @__PURE__ */ h(ContractTerms_V0, { value });
  }
  switch (value.version) {
    case MerchantContractVersion.V0:
      return /* @__PURE__ */ h(ContractTerms_V0, { value });
    case MerchantContractVersion.V1:
      return /* @__PURE__ */ h(ContractTerms_V1, { value });
    default:
      assertUnreachable(value.version);
  }
}
function ContractTerms_V0({ value }) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(InputGroup, { name: "contract_terms", label: i18n2.str`Contract terms` }, /* @__PURE__ */ h(FormProvider, { object: value, valueHandler: null }, /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "summary",
      label: i18n2.str`Summary`,
      tooltip: i18n2.str`Human-readable description of the whole purchase`
    }
  ), /* @__PURE__ */ h(
    InputCurrency,
    {
      readonly: true,
      name: "amount",
      label: i18n2.str`Amount`,
      tooltip: i18n2.str`Total price for the transaction`
    }
  ), value.fulfillment_url && /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "fulfillment_url",
      label: i18n2.str`Fulfillment URL`,
      tooltip: i18n2.str`URL for this purchase`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "max_fee",
      label: i18n2.str`Max fee`,
      tooltip: i18n2.str`Maximum total deposit fee accepted by the merchant for this contract`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "timestamp",
      label: i18n2.str`Created at`,
      tooltip: i18n2.str`Time when this contract was generated`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "refund_deadline",
      label: i18n2.str`Refund deadline`,
      tooltip: i18n2.str`After this deadline has passed, no refunds will be accepted.`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "pay_deadline",
      label: i18n2.str`Payment deadline`,
      tooltip: i18n2.str`After this deadline, the merchant won't accept payments for the contract`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "wire_transfer_deadline",
      label: i18n2.str`Wire transfer deadline`,
      tooltip: i18n2.str`Transfer deadline for the exchange`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "delivery_date",
      label: i18n2.str`Delivery date`,
      tooltip: i18n2.str`Time indicating when the order should be delivered`
    }
  ), /* @__PURE__ */ h(
    InputGroup,
    {
      name: "delivery_location",
      label: i18n2.str`Delivery location`,
      tooltip: i18n2.str`Where the order will be delivered`
    },
    /* @__PURE__ */ h(InputLocation, { name: "delivery_location" })
  ), /* @__PURE__ */ h(
    InputDuration,
    {
      readonly: true,
      name: "auto_refund",
      label: i18n2.str`Auto-refund delay`,
      tooltip: i18n2.str`How long the wallet should try to get an automatic refund for the purchase`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "extra",
      label: i18n2.str`Extra info`,
      tooltip: i18n2.str`Extra data that is only interpreted by the merchant frontend`
    }
  )));
}
function ContractTerms_V1({ value }) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(InputGroup, { name: "contract_terms", label: i18n2.str`Contract terms` }, /* @__PURE__ */ h(FormProvider, { object: value, valueHandler: null }, /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "summary",
      label: i18n2.str`Summary`,
      tooltip: i18n2.str`Human-readable description of the whole purchase`
    }
  ), value.fulfillment_url && /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "fulfillment_url",
      label: i18n2.str`Fulfillment URL`,
      tooltip: i18n2.str`URL for this purchase`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "timestamp",
      label: i18n2.str`Created at`,
      tooltip: i18n2.str`Time when this contract was generated`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "refund_deadline",
      label: i18n2.str`Refund deadline`,
      tooltip: i18n2.str`After this deadline has passed, no refunds will be accepted.`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "pay_deadline",
      label: i18n2.str`Payment deadline`,
      tooltip: i18n2.str`After this deadline, the merchant won't accept payments for the contract`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "wire_transfer_deadline",
      label: i18n2.str`Wire transfer deadline`,
      tooltip: i18n2.str`Transfer deadline for the exchange`
    }
  ), /* @__PURE__ */ h(
    InputDate,
    {
      readonly: true,
      name: "delivery_date",
      label: i18n2.str`Delivery date`,
      tooltip: i18n2.str`Time indicating when the order should be delivered`
    }
  ), /* @__PURE__ */ h(
    InputGroup,
    {
      name: "delivery_location",
      label: i18n2.str`Delivery location`,
      tooltip: i18n2.str`Where the order will be delivered`
    },
    /* @__PURE__ */ h(InputLocation, { name: "delivery_location" })
  ), /* @__PURE__ */ h(
    InputDuration,
    {
      readonly: true,
      name: "auto_refund",
      label: i18n2.str`Auto-refund delay`,
      tooltip: i18n2.str`How long the wallet should try to get an automatic refund for the purchase`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "extra",
      label: i18n2.str`Extra info`,
      tooltip: i18n2.str`Extra data that is only interpreted by the merchant frontend`
    }
  )));
}
function ClaimedPage({
  id,
  order
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [value, valueHandler] = p3(order);
  const [settings] = usePreference();
  useWaitForOrderPayment(id, order);
  const now2 = /* @__PURE__ */ new Date();
  const refundable = order.contract_terms.refund_deadline.t_s !== "never" && now2.getTime() < order.contract_terms.refund_deadline.t_s * 1e3;
  const events2 = [];
  if (order.contract_terms.timestamp.t_s !== "never") {
    events2.push({
      when: new Date(order.contract_terms.timestamp.t_s * 1e3),
      description: i18n2.str`order created`,
      type: "start"
    });
  }
  if (order.contract_terms.pay_deadline.t_s !== "never") {
    events2.push({
      when: new Date(order.contract_terms.pay_deadline.t_s * 1e3),
      description: i18n2.str`pay deadline`,
      type: "pay-deadline"
    });
  }
  if (order.contract_terms.refund_deadline.t_s !== "never" && refundable) {
    events2.push({
      when: new Date(order.contract_terms.refund_deadline.t_s * 1e3),
      description: i18n2.str`refund deadline`,
      type: "refund-deadline"
    });
  }
  if (order.contract_terms.delivery_date && order.contract_terms.delivery_date.t_s !== "never") {
    events2.push({
      when: new Date(order.contract_terms.delivery_date?.t_s * 1e3),
      description: i18n2.str`delivery`,
      type: "delivery"
    });
  }
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-10" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h(i18n2.Translate, null, "Order"), " #", id, /* @__PURE__ */ h("div", { class: "tag is-info ml-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Claimed"))))), /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left", style: { maxWidth: "100%" } }, /* @__PURE__ */ h("div", { class: "level-item", style: { maxWidth: "100%" } }, /* @__PURE__ */ h(
    "div",
    {
      class: "content",
      style: {
        whiteSpace: "nowrap",
        overflow: "hidden",
        textOverflow: "ellipsis"
      }
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "Claimed at"), ":"), " ", order.contract_terms.timestamp.t_s === "never" ? i18n2.str`Never` : format2(
      new Date(
        order.contract_terms.timestamp.t_s * 1e3
      ),
      datetimeFormatForSettings(settings)
    ))
  )))))), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-4" }, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Timeline")), /* @__PURE__ */ h(Timeline, { events: events2 })), /* @__PURE__ */ h("div", { class: "column is-8" }, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Payment details")), /* @__PURE__ */ h(
    FormProvider,
    {
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "contract_terms.summary",
        readonly: true,
        inputType: "multiline",
        label: i18n2.str`Summary`
      }
    ),
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "contract_terms.amount",
        readonly: true,
        label: i18n2.str`Amount`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "order_status",
        readonly: true,
        label: i18n2.str`Order status`,
        toStr: (d6) => {
          switch (d6) {
            case "paid":
              return i18n2.str`Paid`;
            case "claimed":
              return i18n2.str`Claimed`;
            case "unpiad":
              return i18n2.str`Unpaid`;
          }
          return d6;
        }
      }
    )
  )))), order.contract_terms.products?.length ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Product list")), /* @__PURE__ */ h(ProductList, { list: order.contract_terms.products })) : void 0, !value.contract_terms ? void 0 : /* @__PURE__ */ h(ContractTerms, { value: value.contract_terms })), /* @__PURE__ */ h("div", { class: "column" }))));
}
function PaidPage({
  id,
  order,
  onRefund
}) {
  const [value, valueHandler] = p3(order);
  const { state } = useSessionContext();
  const { i18n: i18n2 } = useTranslationContext();
  const now2 = /* @__PURE__ */ new Date();
  const merchantCanRefund = order.contract_terms.refund_deadline.t_s !== "never" && now2.getTime() < order.contract_terms.refund_deadline.t_s * 1e3;
  const wireDeadlineInThePast = order.contract_terms.wire_transfer_deadline.t_s !== "never" && order.contract_terms.wire_transfer_deadline.t_s * 1e3 < now2.getTime();
  const [_3, reload] = p3(false);
  h2(() => {
    if (wireDeadlineInThePast)
      return;
    const deadline = order.contract_terms.wire_transfer_deadline;
    if (deadline.t_s === "never")
      return;
    const diff = deadline.t_s * 1e3 - (/* @__PURE__ */ new Date()).getTime();
    setTimeout(() => {
      reload(true);
    }, diff + 100);
  }, []);
  const events2 = [];
  if (order.contract_terms.refund_deadline.t_s !== "never" && merchantCanRefund) {
    events2.push({
      when: new Date(order.contract_terms.refund_deadline.t_s * 1e3),
      description: i18n2.str`refund deadline`,
      type: "refund-deadline"
    });
  }
  if (order.contract_terms.delivery_date && order.contract_terms.delivery_date.t_s !== "never") {
    if (order.contract_terms.delivery_date)
      events2.push({
        when: new Date(order.contract_terms.delivery_date?.t_s * 1e3),
        description: i18n2.str`delivery`,
        type: "delivery"
      });
  }
  const sortedOrders = [...order.refund_details].sort(
    (a6, b5) => AbsoluteTime.cmp(
      AbsoluteTime.fromProtocolTimestamp(a6.timestamp),
      AbsoluteTime.fromProtocolTimestamp(b5.timestamp)
    )
  );
  sortedOrders.reduce(mergeRefunds, []).forEach((e5) => {
    if (e5.timestamp.t_s === "never")
      return;
    if (e5.pending) {
      if (wireDeadlineInThePast) {
        events2.push({
          when: new Date(e5.timestamp.t_s * 1e3),
          description: !e5.reason ? i18n2.str`refund missed: ${e5.amount}` : i18n2.str`refund missed: ${e5.amount}: ${e5.reason}`,
          type: "refund-missed"
        });
      } else {
        events2.push({
          when: new Date(e5.timestamp.t_s * 1e3),
          description: !e5.reason ? i18n2.str`refund created: ${e5.amount}` : i18n2.str`refund created: ${e5.amount}: ${e5.reason}`,
          type: "refund-created"
        });
      }
    } else {
      events2.push({
        when: new Date(e5.timestamp.t_s * 1e3),
        description: !e5.reason ? i18n2.str`refund taken: ${e5.amount}` : i18n2.str`refund taken: ${e5.amount}: ${e5.reason}`,
        type: "refund-taken"
      });
    }
  });
  const orderAmounts = getOrderAmountAndWirefee(order);
  if (orderAmounts === "v1-without-index") {
    return /* @__PURE__ */ h(i18n2.Translate, null, "The contract terms has a v1 order without choices_index.");
  }
  if (orderAmounts === "v1-wrong-index") {
    return /* @__PURE__ */ h(i18n2.Translate, null, "The contract terms has a v1 order with a bad choices_index.");
  }
  const { amount } = orderAmounts;
  const wireMap = {};
  let hasUnconfirmedWireTransfer = false;
  if (order.wire_details.length) {
    order.wire_details.forEach((w6) => {
      if (!wireMap[w6.wtid]) {
        const info = {
          time: w6.execution_time.t_s === "never" ? 0 : w6.execution_time.t_s * 1e3,
          amount: Amounts.parseOrThrow(w6.amount),
          confirmed: w6.confirmed
        };
        wireMap[w6.wtid] = info;
      } else {
        const info = {
          time: wireMap[w6.wtid].time,
          // keep the first time
          confirmed: wireMap[w6.wtid].confirmed && w6.confirmed,
          // both should be confirmed
          amount: Amounts.add(
            Amounts.parseOrThrow(w6.amount),
            wireMap[w6.wtid].amount
          ).amount
        };
        wireMap[w6.wtid] = info;
      }
      hasUnconfirmedWireTransfer = hasUnconfirmedWireTransfer || !w6.confirmed;
    });
    Object.values(wireMap).forEach((info) => {
      events2.push({
        when: new Date(info.time),
        description: i18n2.str`wired ${Amounts.stringify(info.amount)}`,
        type: info.confirmed ? "wired-confirmed" : "wired-pending"
      });
    });
  } else {
    if (order.contract_terms.wire_transfer_deadline.t_s !== "never") {
      events2.push({
        when: new Date(order.contract_terms.wire_transfer_deadline.t_s * 1e3),
        description: i18n2.str`wire deadline`,
        type: "wire-deadline"
      });
    }
  }
  events2.sort((a6, b5) => {
    return b5.when.getTime() - a6.when.getTime();
  });
  const nextEvent = events2.find((e5) => {
    return e5.when.getTime() > now2.getTime();
  });
  const refundURI = !order.refunded || wireDeadlineInThePast ? void 0 : stringifyRefundUri({
    merchantBaseUrl: state.backendUrl.href,
    orderId: order.contract_terms.order_id
  });
  const refund_taken = order.refund_details.reduce((prev, cur) => {
    if (cur.pending)
      return prev;
    return Amounts.add(prev, Amounts.parseOrThrow(cur.amount)).amount;
  }, Amounts.zeroOfCurrency(amount.currency));
  value.refund_taken = Amounts.stringify(refund_taken);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-10" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h(i18n2.Translate, null, "Order"), " #", id, /* @__PURE__ */ h("div", { class: "tag is-success ml-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Paid")), order.wired ? /* @__PURE__ */ h("div", { class: "tag is-success ml-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Wired")) : null, order.refunded ? /* @__PURE__ */ h("div", { class: "tag is-danger ml-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Refunded")) : null))), /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("h1", { class: "title" }, Amounts.stringify(amount)))), /* @__PURE__ */ h("div", { class: "level-right" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("h1", { class: "title" }, /* @__PURE__ */ h("div", { class: "buttons" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": merchantCanRefund ? i18n2.str`Refund order` : i18n2.str`Not refundable`
    },
    /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-danger",
        disabled: !merchantCanRefund,
        onClick: () => onRefund(id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Refund")
    )
  )))))), /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left", style: { maxWidth: "100%" } }, /* @__PURE__ */ h("div", { class: "level-item", style: { maxWidth: "100%" } }, /* @__PURE__ */ h(
    "div",
    {
      class: "content",
      style: {
        whiteSpace: "nowrap",
        overflow: "hidden",
        textOverflow: "ellipsis"
      }
    },
    nextEvent && /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "Next event in "), " ", formatDistance11(
      nextEvent.when,
      /* @__PURE__ */ new Date()
      // "yyyy/MM/dd HH:mm:ss",
    ))
  )))))), !hasUnconfirmedWireTransfer ? void 0 : /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        type: "INFO",
        message: i18n2.str`The order was wired.`,
        description: i18n2.str`Bank processing can take a few business days, depending on your bank.`
      }
    }
  ), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-4" }, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Timeline")), /* @__PURE__ */ h(Timeline, { events: events2 })), /* @__PURE__ */ h("div", { class: "column is-8" }, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Payment details")), /* @__PURE__ */ h(
    FormProvider,
    {
      object: value,
      valueHandler
    },
    order.refunded && /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "refund_amount",
        readonly: true,
        label: i18n2.str`Refunded amount`
      }
    ),
    order.refunded && /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "refund_taken",
        readonly: true,
        label: i18n2.str`Refund taken`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "order_status",
        readonly: true,
        label: i18n2.str`Order status`,
        toStr: (d6) => {
          switch (d6) {
            case "paid":
              return i18n2.str`Paid`;
            case "claimed":
              return i18n2.str`Claimed`;
            case "unpiad":
              return i18n2.str`Unpaid`;
          }
          return d6;
        }
      }
    ),
    /* @__PURE__ */ h(
      TextField,
      {
        name: "order_status_url",
        label: i18n2.str`Status URL`
      },
      /* @__PURE__ */ h(
        "a",
        {
          target: "_blank",
          rel: "noreferrer",
          href: order.order_status_url
        },
        order.order_status_url
      )
    ),
    refundURI && /* @__PURE__ */ h(
      TextField,
      {
        name: "order_status_url",
        label: i18n2.str`Refund URI`
      },
      /* @__PURE__ */ h("a", { target: "_blank", rel: "noreferrer", href: refundURI }, refundURI)
    )
  )))), order.contract_terms.products?.length ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Product list")), /* @__PURE__ */ h(ProductList, { list: order.contract_terms.products })) : void 0, !value.contract_terms ? void 0 : /* @__PURE__ */ h(ContractTerms, { value: value.contract_terms })), /* @__PURE__ */ h("div", { class: "column" }))));
}
function UnpaidPage({
  id,
  order
}) {
  const [value, valueHandler] = p3(order);
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  useWaitForOrderPayment(id, order);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("h1", { class: "title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Order"), " #", id)), /* @__PURE__ */ h("div", { class: "tag is-dark" }, /* @__PURE__ */ h(i18n2.Translate, null, "Unpaid")))), /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left", style: { maxWidth: "100%" } }, /* @__PURE__ */ h("div", { class: "level-item", style: { maxWidth: "100%" } }, /* @__PURE__ */ h(
    "div",
    {
      class: "content",
      style: {
        whiteSpace: "nowrap",
        overflow: "hidden",
        textOverflow: "ellipsis"
      }
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "Pay at"), ":"), " ", /* @__PURE__ */ h(
      "a",
      {
        href: order.order_status_url,
        rel: "nofollow",
        target: "new"
      },
      order.order_status_url
    )),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "Created at"), ":"), " ", order.creation_time.t_s === "never" ? i18n2.str`Never` : format2(
      new Date(order.creation_time.t_s * 1e3),
      datetimeFormatForSettings(settings)
    ))
  )))))), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(FormProvider, { object: value, valueHandler }, /* @__PURE__ */ h(
    Input,
    {
      readonly: true,
      name: "summary",
      label: i18n2.str`Summary`,
      tooltip: i18n2.str`Human-readable description of the whole purchase`
    }
  ), /* @__PURE__ */ h(
    InputCurrency,
    {
      readonly: true,
      name: "total_amount",
      label: i18n2.str`Amount`,
      tooltip: i18n2.str`Total price for the transaction`
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "order_status",
      readonly: true,
      label: i18n2.str`Order status`,
      toStr: (d6) => {
        switch (d6) {
          case "paid":
            return i18n2.str`Paid`;
          case "claimed":
            return i18n2.str`Claimed`;
          case "unpiad":
            return i18n2.str`Unpaid`;
        }
        return d6;
      }
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "order_status_url",
      readonly: true,
      label: i18n2.str`Order status URL`
    }
  ), /* @__PURE__ */ h(
    TextField,
    {
      name: "taler_pay_uri",
      label: i18n2.str`Payment URI`
    },
    /* @__PURE__ */ h("a", { target: "_blank", rel: "noreferrer", href: value.taler_pay_uri }, value.taler_pay_uri)
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}
function DetailPage({ id, selected, onRefunded, onBack }) {
  const [showRefund, setShowRefund] = p3(void 0);
  const { i18n: i18n2 } = useTranslationContext();
  const DetailByStatus = function() {
    switch (selected.order_status) {
      case "claimed":
        return /* @__PURE__ */ h(ClaimedPage, { id, order: selected });
      case "paid":
        return /* @__PURE__ */ h(PaidPage, { id, order: selected, onRefund: setShowRefund });
      case "unpaid":
        return /* @__PURE__ */ h(UnpaidPage, { id, order: selected });
      default:
        return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(i18n2.Translate, null, "Unknown order status. This is an error, please contact the administrator."));
    }
  };
  return /* @__PURE__ */ h(p2, null, DetailByStatus(), showRefund && /* @__PURE__ */ h(
    RefundModal,
    {
      order: selected,
      id,
      onCancel: () => setShowRefund(void 0),
      onConfirmed: () => {
        onRefunded();
        setShowRefund(void 0);
      }
    }
  ), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Back")))), /* @__PURE__ */ h("div", { class: "column" })));
}
function getOrderAmountAndWirefee(order) {
  if (order.contract_terms.version === void 0 || order.contract_terms.version === MerchantContractVersion.V0) {
    const amount = Amounts.parseOrThrow(order.contract_terms.amount);
    const wireFee = Amounts.parseOrThrow(order.contract_terms.max_fee);
    return { amount, wireFee };
  }
  if (order.contract_terms.version === MerchantContractVersion.V1) {
    if (order.choice_index === void 0)
      return "v1-without-index";
    if (order.choice_index > order.contract_terms.choices.length)
      return "v1-wrong-index";
    const choice = order.contract_terms.choices[order.choice_index];
    const amount = Amounts.parseOrThrow(choice.amount);
    const wireFee = Amounts.parseOrThrow(choice.max_fee);
    return { amount, wireFee };
  }
  assertUnreachable(order.contract_terms.version);
}

// src/paths/instance/orders/details/index.tsx
function Update({ oid, onBack }) {
  const result = useOrderDetails(oid);
  const { i18n: i18n2 } = useTranslationContext();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case TalerErrorCode.MERCHANT_GENERIC_INSTANCE_UNKNOWN: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case TalerErrorCode.MERCHANT_GENERIC_ORDER_UNKNOWN: {
        return /* @__PURE__ */ h(i18n2.Translate, null, "Order unknown");
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    DetailPage,
    {
      onBack,
      id: oid,
      onRefunded: () => {
      },
      selected: result.body
    }
  ));
}

// src/paths/instance/otp_devices/create/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/otp_devices/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
var algorithms = [0, 1];
var algorithmsNames = ["30s 8d TOTP-SHA1", "30s 8d eTOTP-SHA1"];
function CreatePage6({ onCreated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [state, setState] = p3({
    otp_key: "E5V6OSMTZRL2ARYKNDJ4SUDGYOCLQUOT",
    otp_ctr: 1,
    otp_device_id: "1",
    otp_device_description: "asd",
    otp_algorithm: 0
  });
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const [showKey, setShowKey] = p3(false);
  const errors2 = undefinedIfEmpty2({
    otp_device_id: !state.otp_device_id ? i18n2.str`Required` : !/[a-zA-Z0-9]*/.test(state.otp_device_id) ? i18n2.str`Invalid. Please enter letters and numbers only.` : void 0,
    // otp_algorithm: !state.otp_algorithm ? i18n.str`Required` : undefined,
    otp_key: !state.otp_key ? i18n2.str`Required` : !isRfc3548Base32Charset(state.otp_key) ? i18n2.str`Just letters and numbers from 2 to 7` : state.otp_key.length !== 32 ? i18n2.str`The size of the key must be 32 characters` : void 0,
    otp_device_description: !state.otp_device_description ? i18n2.str`Required` : !/[a-zA-Z0-9]*/.test(state.otp_device_description) ? i18n2.str`Invalid. Please enter letters and numbers only.` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const data = hasErrors ? void 0 : state;
  const create = safeFunctionHandler(
    lib.instance.addOtpDevice.bind(lib.instance),
    !session.token || !data ? void 0 : [session.token, data]
  );
  create.onSuccess = (success, token, req) => {
    onCreated(req);
  };
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "otp_device_id",
        label: i18n2.str`ID`,
        tooltip: i18n2.str`Internal ID on the system`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "otp_device_description",
        label: i18n2.str`Description`,
        tooltip: i18n2.str`Useful to identify the device physically`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "otp_algorithm",
        label: i18n2.str`Verification algorithm`,
        tooltip: i18n2.str`Algorithm used to verify transactions in offline mode`,
        values: algorithms,
        toStr: (v3) => algorithmsNames[v3],
        fromStr: (v3) => Number(v3)
      }
    ),
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        expand: true,
        name: "otp_key",
        label: i18n2.str`Device key`,
        inputType: showKey ? "text" : "password",
        help: i18n2.str`Be sure to choose a password that is hard to guess, or use the random generator.`,
        tooltip: i18n2.str`Your device needs to match exactly the same value`,
        fromStr: (v3) => v3.toUpperCase(),
        addonAfterAction: () => {
          setShowKey(!showKey);
        },
        addonAfter: /* @__PURE__ */ h("span", { class: "icon" }, showKey ? /* @__PURE__ */ h("i", { class: "mdi mdi-eye" }) : /* @__PURE__ */ h("i", { class: "mdi mdi-eye-off" })),
        side: /* @__PURE__ */ h(
          "button",
          {
            type: "button",
            "data-tooltip": i18n2.str`Generate random secret key`,
            class: "button is-info mr-3",
            onClick: (e5) => {
              setState((s6) => ({
                ...s6,
                otp_key: randomRfc3548Base32Key()
              }));
              e5.preventDefault();
            }
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Random")
        )
      }
    ),
    /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
        onClick: create,
        type: "submit"
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
    ))
  )), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
init_preact_module();

// src/components/notifications/CreatedSuccessfully.tsx
init_preact_module();
function CreatedSuccessfully({
  children,
  focus,
  onConfirm,
  onCreateAnother
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "columns is-fullwidth is-vcentered mt-3" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h("div", { class: "card" }, /* @__PURE__ */ h("header", { class: "card-header has-background-success" }, /* @__PURE__ */ h("p", { class: "card-header-title has-text-white-ter" }, "Success.")), /* @__PURE__ */ h("div", { class: "card-content" }, children)), /* @__PURE__ */ h("div", { class: "buttons is-right" }, onCreateAnother && /* @__PURE__ */ h("button", { class: "button is-info", onClick: onCreateAnother }, /* @__PURE__ */ h(i18n2.Translate, null, "Create another")), /* @__PURE__ */ h("button", { class: "button is-info", ref: focus ? doAutoFocus2 : void 0, onClick: onConfirm }, /* @__PURE__ */ h(i18n2.Translate, null, "Continue")))), /* @__PURE__ */ h("div", { class: "column" }));
}

// src/paths/instance/otp_devices/create/CreatedSuccessfully.tsx
function CreatedSuccessfully2({
  entity,
  onConfirm
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state } = useSessionContext();
  const issuer = state.backendUrl.href;
  const qrText = `otpauth://totp/${state.instance}/${entity.otp_device_id}?issuer=${issuer}&algorithm=SHA1&digits=8&period=30&secret=${entity.otp_key}`;
  const qrTextSafe = `otpauth://totp/${state.instance}/${entity.otp_device_id}?issuer=${issuer}&algorithm=SHA1&digits=8&period=30&secret=${entity.otp_key.substring(0, 6)}...`;
  return /* @__PURE__ */ h(CreatedSuccessfully, { onConfirm, focus: true }, /* @__PURE__ */ h("p", { class: "is-size-5" }, /* @__PURE__ */ h(i18n2.Translate, null, "You can scan the next QR code with your device or save the key before continuing.")), /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, "ID")), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: "control" }, /* @__PURE__ */ h(
    "input",
    {
      readonly: true,
      class: "input",
      value: entity.otp_device_id
    }
  ))))), /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Description"))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("p", { class: "control" }, /* @__PURE__ */ h(
    "input",
    {
      class: "input",
      readonly: true,
      value: entity.otp_device_description
    }
  ))))), /* @__PURE__ */ h(
    QR,
    {
      text: qrText
    }
  ), /* @__PURE__ */ h(
    "div",
    {
      style: {
        color: "grey",
        fontSize: "small",
        width: 200,
        textAlign: "center",
        margin: "auto",
        wordBreak: "break-all"
      }
    },
    qrTextSafe
  ));
}

// src/paths/instance/otp_devices/create/index.tsx
function CreateValidator2({ onConfirm, onBack }) {
  const [created, setCreated] = p3(null);
  if (created) {
    return /* @__PURE__ */ h(CreatedSuccessfully2, { entity: created, onConfirm });
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage6,
    {
      onBack,
      onCreated: setCreated
    }
  ));
}

// src/paths/instance/otp_devices/list/index.tsx
init_preact_module();

// src/hooks/otp.ts
var useSWR8 = useSWR;
function revalidateInstanceOtpDevices() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listOtpDevices",
    void 0,
    { revalidate: true }
  );
}
function useInstanceOtpDevices() {
  const { state, lib } = useSessionContext();
  async function fetcher([token, _bid]) {
    return await lib.instance.listOtpDevices(token, {
      // limit: PAGINATED_LIST_REQUEST,
      // offset: bid,
      // order: "dec",
    });
  }
  const { data, error: error2 } = useSWR8([state.token, "offset", "listOtpDevices"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function revalidateOtpDeviceDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getOtpDeviceDetails",
    void 0,
    { revalidate: true }
  );
}
function useOtpDeviceDetails(deviceId) {
  const { state, lib } = useSessionContext();
  async function fetcher([dId, token]) {
    return await lib.instance.getOtpDeviceDetails(token, dId);
  }
  const { data, error: error2 } = useSWR8([deviceId, state.token, "getOtpDeviceDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/otp_devices/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable6({
  devices,
  onCreate,
  onSelect,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const { i18n: i18n2 } = useTranslationContext();
  const remove = safeFunctionHandler(
    lib.instance.deleteOtpDevice.bind(lib.instance)
  ).lambda((id) => !session.token ? void 0 : [session.token, id]);
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-lock" })), /* @__PURE__ */ h(i18n2.Translate, null, "OTP devices")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new devices`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        onClick: onCreate,
        accessKey: "+"
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, devices.length > 0 ? /* @__PURE__ */ h(
    Table7,
    {
      instances: devices,
      onDelete: remove,
      onSelect,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable8, null))))));
}
function Table7({
  instances: instances2,
  onLoadMoreAfter,
  onDelete,
  onSelect,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices before the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.otp_device_id }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.otp_device_id
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.device_description
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected devices from the database`,
        onClick: onDelete.withArgs(i5.otp_device_id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more devices after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function EmptyTable8() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no devices to list yet, add more by pressing the + sign")));
}

// src/paths/instance/otp_devices/list/index.tsx
function ListOtpDevices2({ onCreate, onSelect }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state, lib } = useSessionContext();
  const result = useInstanceOtpDevices();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(
    CardTable6,
    {
      devices: result.body.otp_devices,
      onLoadMoreBefore: void 0,
      onLoadMoreAfter: void 0,
      onCreate,
      onSelect: (e5) => {
        onSelect(e5.otp_device_id);
      }
    }
  )));
}

// src/paths/instance/otp_devices/update/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/otp_devices/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
var algorithms2 = [0, 1, 2];
var algorithmsNames2 = ["off", "30s 8d TOTP-SHA1", "30s 8d eTOTP-SHA1"];
function UpdatePage3({ device, onUpdated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [state, setState] = p3(device);
  const [showKey, setShowKey] = p3(false);
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const update = safeFunctionHandler(
    lib.instance.updateOtpDevice.bind(lib.instance),
    !session.token ? void 0 : [session.token, device.id, state]
  );
  update.onSuccess = (suc, t5, id, req) => {
    onUpdated({ ...req, id: device.id });
  };
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Template id is unknown`;
      case HttpStatusCode.Conflict:
        return i18n2.str`The provided information is inconsistent with the current state of the template`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Device:"), /* @__PURE__ */ h("b", null, device.id))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(FormProvider, { object: state, valueHandler: setState }, /* @__PURE__ */ h(
    Input,
    {
      name: "otp_device_description",
      label: i18n2.str`Description`,
      tooltip: i18n2.str`Useful to identify the device physically`
    }
  ), /* @__PURE__ */ h(
    InputSelector,
    {
      name: "otp_algorithm",
      label: i18n2.str`Verification algorithm`,
      tooltip: i18n2.str`Algorithm to use to verify transactions in offline mode`,
      values: algorithms2,
      toStr: (v3) => algorithmsNames2[v3],
      fromStr: (v3) => Number(v3)
    }
  ), state.otp_algorithm && state.otp_algorithm > 0 ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    InputWithAddon,
    {
      name: "otp_key",
      label: i18n2.str`Device key`,
      readonly: state.otp_key === void 0,
      inputType: showKey ? "text" : "password",
      help: state.otp_key === void 0 ? i18n2.str`Not modified` : i18n2.str`Be sure to be very hard to guess or use the random generator`,
      tooltip: i18n2.str`Your device need to have exactly the same value`,
      fromStr: (v3) => v3.toUpperCase(),
      addonAfterAction: () => {
        setShowKey(!showKey);
      },
      addonAfter: /* @__PURE__ */ h(
        "span",
        {
          class: "icon",
          onClick: () => {
            setShowKey(!showKey);
          }
        },
        showKey ? /* @__PURE__ */ h("i", { class: "mdi mdi-eye" }) : /* @__PURE__ */ h("i", { class: "mdi mdi-eye-off" })
      ),
      side: state.otp_key === void 0 ? /* @__PURE__ */ h(
        "button",
        {
          type: "button",
          onClick: () => {
            setState((s6) => ({ ...s6, otp_key: "" }));
          },
          class: "button"
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Change key")
      ) : /* @__PURE__ */ h(
        "button",
        {
          type: "button",
          "data-tooltip": i18n2.str`Generate random secret key`,
          class: "button is-info mr-3",
          onClick: () => {
            setState((s6) => ({
              ...s6,
              otp_key: randomRfc3548Base32Key()
            }));
          }
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Random")
      )
    }
  )) : void 0, " "), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": i18n2.str`Confirm operation`,
      onClick: update,
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))))));
}

// src/paths/instance/otp_devices/update/index.tsx
function UpdateValidator2({
  vid,
  onConfirm,
  onBack
}) {
  const result = useOtpDeviceDetails(vid);
  const [keyUpdated, setKeyUpdated] = p3(null);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  if (keyUpdated) {
    return /* @__PURE__ */ h(CreatedSuccessfully2, { entity: keyUpdated, onConfirm });
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage3,
    {
      device: {
        id: vid,
        otp_algorithm: result.body.otp_algorithm,
        otp_device_description: result.body.device_description,
        otp_key: "",
        otp_ctr: result.body.otp_ctr
      },
      onBack,
      onUpdated: (d6) => {
        setKeyUpdated({
          otp_algorithm: d6.otp_algorithm,
          otp_device_description: d6.otp_device_description,
          otp_device_id: d6.id,
          otp_key: d6.otp_key,
          otp_ctr: d6.otp_ctr
        });
      }
    }
  ));
}

// src/paths/instance/password/index.tsx
init_preact_module();

// src/paths/instance/password/DetailPage.tsx
init_preact_module();
init_hooks_module();
function DetailPage2({
  instanceId,
  onBack,
  changePassword,
  withoutCurrentPassword
}) {
  const [form, setValue] = p3({
    current: "",
    next: "",
    repeat: ""
  });
  const { i18n: i18n2 } = useTranslationContext();
  const errors2 = undefinedIfEmpty2({
    current: withoutCurrentPassword ? void 0 : !form.current ? i18n2.str`Required` : void 0,
    next: !form.next ? i18n2.str`Required` : void 0,
    repeat: !form.repeat ? i18n2.str`Required` : form.next !== form.repeat ? i18n2.str`Is not the same` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const text = i18n2.str`You are updating the password for the instance with ID "${instanceId}"`;
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, text)))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(FormProvider, { errors: errors2, object: form, valueHandler: setValue }, /* @__PURE__ */ h(p2, null, withoutCurrentPassword ? void 0 : /* @__PURE__ */ h(
    Input,
    {
      name: "current",
      label: i18n2.str`Current password`,
      tooltip: i18n2.str`In order to verify that you have access.`,
      inputType: "password"
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "next",
      label: i18n2.str`New password`,
      tooltip: i18n2.str`Next password to be used`,
      inputType: "password"
    }
  ), /* @__PURE__ */ h(
    Input,
    {
      name: "repeat",
      label: i18n2.str`Repeat password`,
      tooltip: i18n2.str`Confirm the same password`,
      inputType: "password"
    }
  )), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("a", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      type: "submit",
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      onClick: hasErrors ? changePassword : changePassword.withArgs(form.current ?? "", form.next)
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm change")
  )))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/password/index.tsx
function PasswordPage({ onCancel, onChange }) {
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const result = useInstanceDetails();
  const instanceId = session.instance;
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const { i18n: i18n2 } = useTranslationContext();
  const mfa = useChallengeHandler();
  const changePassword = safeFunctionHandler(
    async (token, current, next, challengeIds) => {
      const resp = await lib.instance.createAccessToken(
        instanceId,
        current,
        TEMP_TEST_TOKEN(i18n2.str`Testing password change`)
      );
      if (resp.type === "fail") {
        switch (resp.case) {
          case HttpStatusCode.Unauthorized:
            return opKnownFailure("bad-current-pwd");
          case HttpStatusCode.NotFound:
            return resp;
          case HttpStatusCode.Accepted:
            break;
        }
      }
      return lib.instance.updateCurrentInstanceAuthentication(
        token,
        {
          method: MerchantAuthMethod.TOKEN,
          password: next
        },
        { challengeIds }
      );
    },
    !session.token ? void 0 : [session.token, "", "", []]
  );
  changePassword.onSuccess = (suc) => {
    onChange();
    return i18n2.str`Password changed`;
  };
  changePassword.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case "bad-current-pwd":
        return i18n2.str`The current password is wrong.`;
    }
  };
  const retry = changePassword.lambda((ids) => [
    changePassword.args[0],
    changePassword.args[1],
    changePassword.args[2],
    ids
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    DetailPage2,
    {
      onBack: onCancel,
      instanceId: result.body.name,
      changePassword: changePassword.lambda(
        (current, next) => [
          changePassword.args[0],
          current,
          next,
          changePassword.args[3]
        ]
      )
    }
  ));
}
function AdminPassword({
  instanceId,
  onCancel,
  onChange
}) {
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const subInstanceLib = lib.subInstanceApi(instanceId).instance;
  const result = useManagedInstanceDetails(instanceId);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const { i18n: i18n2 } = useTranslationContext();
  const mfa = useChallengeHandler();
  const changePassword = safeFunctionHandler(
    async (token, id, pwd, challengeIds) => {
      return await lib.instance.updateInstanceAuthentication(
        token,
        id,
        {
          method: MerchantAuthMethod.TOKEN,
          password: pwd
        },
        { challengeIds }
      );
    },
    !session.token ? void 0 : [session.token, instanceId, "", []]
  );
  changePassword.onSuccess = (suc) => {
    onChange();
    return i18n2.str`Password changed`;
  };
  changePassword.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`No enough rights to change the password.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Account not found.`;
      default:
        assertUnreachable(fail);
    }
  };
  const retry = changePassword.lambda((ids) => [
    changePassword.args[0],
    changePassword.args[1],
    changePassword.args[2],
    ids
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    DetailPage2,
    {
      onBack: onCancel,
      instanceId: result.body.name,
      changePassword: changePassword.lambda(
        (current, next) => [
          changePassword.args[0],
          changePassword.args[1],
          next,
          changePassword.args[3]
        ]
      ),
      withoutCurrentPassword: true
    }
  ));
}

// src/paths/instance/products/create/index.tsx
init_preact_module();

// src/paths/instance/products/create/CreatePage.tsx
init_preact_module();
init_hooks_module();

// src/components/product/ProductForm.tsx
init_preact_module();
init_hooks_module();

// src/components/form/InputArray.tsx
init_preact_module();
init_hooks_module();
var defaultToString4 = (f3) => f3 ? String(f3) : "";
var defaultFromString4 = (v3) => v3;
function InputArray({
  name,
  readonly,
  placeholder,
  tooltip,
  label,
  unique,
  help,
  addonBefore,
  getSuggestion,
  fromStr = defaultFromString4,
  toStr = defaultToString4
}) {
  const { error: error2, value, onChange, required } = useField(name);
  const array = value ? value : [];
  const [currentValue, setCurrentValue] = p3("");
  const [suggestions, setSuggestions] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, required && /* @__PURE__ */ h("span", { class: "has-text-danger", style: { marginLeft: 5 } }, "*"), tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, addonBefore && /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("a", { class: "button is-static" }, addonBefore)), /* @__PURE__ */ h("p", { class: "control is-expanded has-icons-right" }, /* @__PURE__ */ h(
    "input",
    {
      class: error2 ? "input is-danger" : "input",
      type: "text",
      placeholder,
      readonly,
      disabled: readonly,
      name: String(name),
      value: currentValue,
      onChange: async (e5) => {
        const v3 = e5.currentTarget.value;
        setCurrentValue(v3);
        if (getSuggestion) {
          getSuggestion(v3).then((ss) => {
            setSuggestions(ss.filter((d6) => !!d6));
          });
        }
      }
    }
  )), getSuggestion ? void 0 : /* @__PURE__ */ h("p", { class: "control" }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info has-tooltip-left",
      disabled: !currentValue,
      onClick: () => {
        const v3 = fromStr(currentValue);
        if (!unique || array.indexOf(v3) === -1) {
          onChange([v3, ...array]);
        }
        setCurrentValue("");
      },
      "data-tooltip": i18n2.str`Add element to the list`
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Add")
  ))), help, error2 && /* @__PURE__ */ h("p", { class: "help is-danger", style: { fontSize: 16 } }, " ", error2, " "), suggestions.length > 0 ? /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    DropdownList,
    {
      name: currentValue,
      list: suggestions,
      onSelect: (p4) => {
        if (!unique || array.indexOf(p4) === -1) {
          onChange([p4, ...array]);
        }
        setCurrentValue("");
        setSuggestions([]);
      },
      withImage: false
    }
  )) : void 0, array.map((v3, i5) => /* @__PURE__ */ h("div", { key: i5, class: "tags has-addons mt-3 mb-0" }, /* @__PURE__ */ h(
    "span",
    {
      class: "tag is-medium is-info mb-0",
      style: { maxWidth: "90%" }
    },
    getSuggestion ? v3.description : toStr(v3)
  ), /* @__PURE__ */ h(
    "a",
    {
      class: "tag is-medium is-danger is-delete mb-0",
      onClick: () => {
        onChange(array.filter((f3) => f3 !== v3));
      }
    }
  ))))));
}

// src/components/form/InputStock.tsx
init_preact_module();
init_hooks_module();
function InputStock({
  name,
  tooltip,
  label,
  alreadyExist
}) {
  const { error: error2, value, onChange } = useField(name);
  const [errors2, setErrors] = p3({});
  const [formValue, valueHandler] = p3(value);
  const [addedStock, setAddedStock] = p3({
    incoming: 0,
    lost: 0
  });
  const { i18n: i18n2 } = useTranslationContext();
  s2(() => {
    if (!formValue) {
      onChange(void 0);
    } else {
      onChange({
        ...formValue,
        current: (formValue?.current || 0) + addedStock.incoming,
        lost: (formValue?.lost || 0) + addedStock.lost
      });
    }
  }, [formValue, addedStock]);
  if (!formValue) {
    return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, label, tooltip && /* @__PURE__ */ h("span", { class: "icon has-tooltip-right", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "field-body is-flex-grow-3" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, !alreadyExist ? /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button",
        "data-tooltip": i18n2.str`Click here to configure the product's stock. If left as is, the backend will not control stock.`,
        onClick: () => {
          valueHandler({
            current: 0,
            lost: 0,
            sold: 0
          });
        }
      },
      /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(i18n2.Translate, null, "Manage stock"))
    ) : /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button",
        "data-tooltip": i18n2.str`This product has been configured without stock control`,
        disabled: true
      },
      /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(i18n2.Translate, null, "Infinite"))
    )))));
  }
  const currentStock = (formValue.current || 0) - (formValue.lost || 0) - (formValue.sold || 0);
  const stockAddedErrors = {
    lost: currentStock + addedStock.incoming < addedStock.lost ? i18n2.str`Shrinkage cannot exceed the current stock and incoming supplies (maximum ${currentStock + addedStock.incoming})` : void 0
  };
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "card" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, label, tooltip && /* @__PURE__ */ h("span", { class: "icon", "data-tooltip": tooltip }, /* @__PURE__ */ h("i", { class: "mdi mdi-information" })))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "stock",
      errors: errors2,
      object: formValue,
      valueHandler
    },
    alreadyExist ? /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      FormProvider,
      {
        name: "added",
        errors: stockAddedErrors,
        object: addedStock,
        valueHandler: setAddedStock
      },
      /* @__PURE__ */ h(InputNumber2, { name: "incoming", label: i18n2.str`Incoming` }),
      /* @__PURE__ */ h(InputNumber2, { name: "lost", label: i18n2.str`Lost` })
    )) : /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "current",
        label: i18n2.str`Current`,
        side: /* @__PURE__ */ h(
          "button",
          {
            type: "button",
            class: "button is-danger",
            "data-tooltip": i18n2.str`Remove stock control for this product`,
            onClick: () => {
              valueHandler(void 0);
            }
          },
          /* @__PURE__ */ h("span", null, /* @__PURE__ */ h(i18n2.Translate, null, "without stock"))
        )
      }
    ),
    /* @__PURE__ */ h(
      InputDate,
      {
        name: "nextRestock",
        label: i18n2.str`Next restock`,
        withTimestampSupport: true
      }
    ),
    /* @__PURE__ */ h(InputGroup, { name: "address", label: i18n2.str`Warehouse address` }, /* @__PURE__ */ h(InputLocation, { name: "address" }))
  ))));
}

// src/components/product/ProductForm.tsx
function ProductForm2({
  onSubscribe,
  initial: initial4,
  alreadyExist,
  categories
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state } = useSessionContext();
  const initial_categories_map = !initial4 || !initial4.categories ? [] : categories.filter((c5) => initial4.categories?.indexOf(c5.category_id) !== -1).map((c5) => ({ id: String(c5.category_id), description: c5.name }));
  const [value, valueHandler] = p3({
    address: {},
    description_i18n: {},
    taxes: [],
    categories: [],
    categories_map: initial_categories_map,
    next_restock: { t_s: "never" },
    price: ":0",
    ...initial4,
    minimum_age: !initial4?.minimum_age ? void 0 : initial4?.minimum_age,
    stock: !initial4 || initial4.total_stock === -1 ? void 0 : {
      current: initial4.total_stock || 0,
      lost: initial4.total_lost || 0,
      sold: initial4.total_sold || 0,
      address: initial4.address,
      nextRestock: initial4.next_restock
    }
  });
  const errors2 = undefinedIfEmpty2({
    product_id: !value.product_id ? i18n2.str`Required` : void 0,
    product_name: !value.product_name ? i18n2.str`Required` : void 0,
    description: !value.description ? i18n2.str`Required` : void 0,
    unit: !value.unit ? i18n2.str`Required` : void 0,
    price: !value.price ? i18n2.str`Required` : Amounts.parse(value.price) === void 0 ? i18n2.str`Invalid amount` : void 0,
    minimum_age: value.minimum_age === void 0 ? void 0 : value.minimum_age < 1 ? i18n2.str`Must be greater than 0` : void 0
  });
  if (alreadyExist && errors2) {
    delete errors2.product_id;
  }
  const hasErrors = errors2 !== void 0;
  const submit = T2(() => {
    const result = { ...value };
    const stock = value.stock;
    if (!stock) {
      result.total_stock = initial4?.total_stock;
      result.total_lost = initial4?.total_lost;
      result.next_restock = initial4?.next_restock;
      result.address = initial4?.address;
      if (!value.total_stock) {
        result.total_stock = -1;
      }
    } else {
      result.total_stock = stock.current;
      result.total_lost = stock.lost;
      result.next_restock = stock.nextRestock instanceof Date ? { t_s: stock.nextRestock.getTime() / 1e3 } : stock.nextRestock;
      result.address = stock.address;
    }
    delete result.stock;
    result.categories = value.categories_map?.map((d6) => parseInt(d6.id, 10));
    delete result.categories_map;
    if (typeof value.minimum_age !== "undefined" && value.minimum_age < 1) {
      delete result.minimum_age;
    }
    return result;
  }, [value]);
  h2(() => {
    onSubscribe(hasErrors ? void 0 : submit);
  }, [submit, hasErrors]);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "product",
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h("button", { style: { visibility: "hidden" } }),
    alreadyExist ? void 0 : /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "product_id",
        label: i18n2.str`ID`,
        addonBeforeLarge: state.backendUrl.href.length > 50,
        expand: true,
        tooltip: i18n2.str`Product identification to use in URLs (for internal use only).`
      }
    ),
    /* @__PURE__ */ h(
      InputImage,
      {
        name: "image",
        label: i18n2.str`Image`,
        tooltip: i18n2.str`Illustration of the product for customers.`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "product_name",
        label: i18n2.str`Name`,
        tooltip: i18n2.str`Product name.`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        inputType: "multiline",
        label: i18n2.str`Description`,
        tooltip: i18n2.str`Product description for customers.`
      }
    ),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 22 /* option_ageRestriction */ }, /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "minimum_age",
        label: i18n2.str`Age restriction`,
        tooltip: i18n2.str`Is this product restricted for customer below certain age?`,
        help: i18n2.str`Minimum age of the customer`
      }
    )),
    /* @__PURE__ */ h(
      Input,
      {
        name: "unit",
        label: i18n2.str`Unit name`,
        tooltip: i18n2.str`Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.`,
        help: i18n2.str`Example: kg, items or liters`
      }
    ),
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "price",
        label: i18n2.str`Price per unit`,
        tooltip: i18n2.str`Sale price for customers, including taxes, for above units of the product.`
      }
    ),
    /* @__PURE__ */ h(
      InputStock,
      {
        name: "stock",
        label: i18n2.str`Stock`,
        alreadyExist,
        tooltip: i18n2.str`Inventory for products with finite supply (for internal use only).`
      }
    ),
    /* @__PURE__ */ h(
      InputTaxes,
      {
        name: "taxes",
        label: i18n2.str`Taxes`,
        tooltip: i18n2.str`Taxes included in the product price, exposed to customers.`
      }
    ),
    /* @__PURE__ */ h(
      InputArray,
      {
        name: "categories_map",
        label: i18n2.str`Categories`,
        getSuggestion: async (v3) => {
          return categories.map((cat) => {
            return { description: cat.name, id: String(cat.category_id) };
          });
        },
        help: i18n2.str`Search by category description or id`,
        tooltip: i18n2.str`Categories where this product will be listed on.`,
        unique: true
      }
    )
  ));
}

// src/paths/instance/products/create/CreatePage.tsx
function CreatePage7({ onCreate, onBack }) {
  const { state: session, lib } = useSessionContext();
  const [form, setForm] = p3();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const create = safeFunctionHandler(
    lib.instance.addProduct.bind(lib.instance),
    !session.token || !form ? void 0 : [session.token, form]
  );
  create.onSuccess = onCreate;
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  const { i18n: i18n2 } = useTranslationContext();
  const categoriesResult = useInstanceCategories();
  if (!categoriesResult)
    return /* @__PURE__ */ h(Loading2, null);
  if (categoriesResult instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: categoriesResult });
  }
  const categories = categoriesResult.type === "fail" ? [] : categoriesResult.body.categories;
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(ProductForm2, { onSubscribe: setForm, categories }), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      onClick: create,
      "data-tooltip": !create.args ? i18n2.str`Please complete the marked fields` : "confirm operation",
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/products/create/index.tsx
function CreateProduct({ onConfirm, onBack }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage7,
    {
      onBack,
      onCreate: onConfirm
    }
  ));
}

// src/paths/instance/products/list/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/products/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable7({
  instances: instances2,
  onCreate,
  onSelect,
  onDelete,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3(
    void 0
  );
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-shopping" })), /* @__PURE__ */ h(i18n2.Translate, null, "Inventory")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, !onCreate ? void 0 : /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add product to inventory`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        onClick: onCreate,
        accessKey: "+"
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, instances2.length > 0 ? /* @__PURE__ */ h(
    Table8,
    {
      instances: instances2,
      onSelect,
      onDelete,
      onLoadMoreAfter,
      onLoadMoreBefore,
      rowSelection,
      rowSelectionHandler
    }
  ) : /* @__PURE__ */ h(EmptyTable9, null)))));
}
function Table8({
  rowSelection,
  rowSelectionHandler,
  instances: instances2,
  onSelect,
  onDelete,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [preference] = usePreference();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const update = safeFunctionHandler(
    lib.instance.updateProduct.bind(lib.instance)
  );
  update.onSuccess = () => rowSelectionHandler(void 0);
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Product not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`This change was made without outdated info.`;
    }
  };
  return /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h("button", { class: "button is-fullwidth", onClick: onLoadMoreBefore }, /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Image")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Price per unit")), /* @__PURE__ */ h(FragmentPersonaFlag, { point: 23 /* option_inventoryTaxes */ }, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Taxes")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Sales"))), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Stock")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Sold")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    const restStockInfo = !i5.next_restock ? "" : i5.next_restock.t_s === "never" ? i18n2.str`Never` : `restock at ${format2(
      new Date(i5.next_restock.t_s * 1e3),
      dateFormatForSettings(preference)
    )}`;
    let stockInfo = "";
    if (i5.total_stock < 0) {
      stockInfo = "infinite";
    } else {
      const totalStock = i5.total_stock - i5.total_lost - i5.total_sold;
      stockInfo = /* @__PURE__ */ h("label", { title: restStockInfo }, totalStock, " ", i5.unit);
    }
    const isFree = Amounts.isZero(Amounts.parseOrThrow(i5.price));
    return /* @__PURE__ */ h(p2, { key: i5.id }, /* @__PURE__ */ h("tr", { key: "info" }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      /* @__PURE__ */ h(
        "img",
        {
          src: i5.image ? i5.image : empty_default,
          style: {
            border: "solid black 1px",
            maxHeight: "2em",
            width: "auto",
            height: "auto"
          }
        }
      )
    ), /* @__PURE__ */ h(
      "td",
      {
        class: "has-tooltip-right",
        "data-tooltip": i5.product_name,
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      i5.product_name
    ), /* @__PURE__ */ h(
      "td",
      {
        class: "has-tooltip-right",
        "data-tooltip": i5.description,
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      i5.description.length > 30 ? i5.description.substring(0, 30) + "..." : i5.description
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      isFree ? i18n2.str`Free` : `${i5.price} / ${i5.unit}`
    ), /* @__PURE__ */ h(FragmentPersonaFlag, { point: 23 /* option_inventoryTaxes */ }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      sum(i5.taxes)
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      difference(i5.price, sum(i5.taxes))
    )), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      stockInfo
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.id && rowSelectionHandler(i5.id),
        style: { cursor: "pointer" }
      },
      /* @__PURE__ */ h("span", { style: { whiteSpace: "nowrap" } }, i5.total_sold, " ", i5.unit)
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      "span",
      {
        class: "has-tooltip-bottom",
        "data-tooltip": i18n2.str`Go to product update page`
      },
      /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-success ",
          type: "button",
          onClick: () => onSelect(i5)
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Update")
      )
    ), !onDelete ? void 0 : /* @__PURE__ */ h(
      "span",
      {
        class: "has-tooltip-left",
        "data-tooltip": i18n2.str`Remove this product from the database`
      },
      /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-danger",
          type: "button",
          onClick: () => onDelete(i5)
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
      )
    )))), rowSelection === i5.id && /* @__PURE__ */ h("tr", { key: "form" }, /* @__PURE__ */ h("td", { colSpan: 10 }, /* @__PURE__ */ h(
      FastProductUpdateForm,
      {
        product: i5,
        onUpdate: async (prod) => {
          (!session.token ? update : update.withArgs(session.token, i5.id, prod)).call();
        },
        onCancel: () => rowSelectionHandler(void 0)
      }
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more products after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function FastProductWithInfiniteStockUpdateForm({
  product,
  onUpdate,
  onCancel
}) {
  const [value, valueHandler] = p3({ price: product.price });
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "added",
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "price",
        label: i18n2.str`Price per unit`,
        tooltip: i18n2.str`Update the product with new price`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-expanded" }, /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Update product with new price`
    },
    /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info",
        onClick: () => onUpdate({
          ...product,
          price: value.price
        })
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm update")
    )
  ))));
}
function FastProductWithManagedStockUpdateForm({
  product,
  onUpdate,
  onCancel
}) {
  const [value, valueHandler] = p3({
    incoming: 0,
    lost: 0,
    price: product.price
  });
  const { i18n: i18n2 } = useTranslationContext();
  const currentStock = product.total_stock - product.total_sold - product.total_lost;
  const errors2 = {
    lost: currentStock + value.incoming < value.lost ? i18n2.str`lost can't be greater that current + incoming (max ${currentStock + value.incoming})` : void 0
  };
  const hasErrors = Object.keys(errors2).some(
    (k6) => errors2[k6] !== void 0
  );
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "added",
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "incoming",
        label: i18n2.str`Incoming`,
        tooltip: i18n2.str`Add more elements to the inventory`
      }
    ),
    /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "lost",
        label: i18n2.str`Lost`,
        tooltip: i18n2.str`Report elements lost in the inventory`
      }
    ),
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "price",
        label: i18n2.str`Price per unit`,
        tooltip: i18n2.str`New price for the product`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": hasErrors ? i18n2.str`There are values with errors.` : i18n2.str`Update product with new stock and price`
    },
    /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info",
        disabled: hasErrors,
        onClick: () => onUpdate({
          ...product,
          total_stock: product.total_stock + value.incoming,
          total_lost: product.total_lost + value.lost,
          price: value.price
        })
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
    )
  )));
}
function FastProductUpdateForm(props) {
  return props.product.total_stock === -1 ? /* @__PURE__ */ h(FastProductWithInfiniteStockUpdateForm, { ...props }) : /* @__PURE__ */ h(FastProductWithManagedStockUpdateForm, { ...props });
}
function EmptyTable9() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no products to list yet, add more by pressing the + sign")));
}
function difference(price, tax) {
  if (!tax)
    return price;
  const ps = price.split(":");
  const p4 = parseInt(ps[1], 10);
  ps[1] = `${p4 - tax}`;
  return ps.join(":");
}
function sum(taxes) {
  if (taxes === void 0)
    return 0;
  return taxes.reduce((p4, c5) => p4 + parseInt(c5.tax.split(":")[1], 10), 0);
}

// src/paths/instance/products/list/index.tsx
function ProductList2({ onCreate, onSelect }) {
  const result = useInstanceProducts();
  const { state: session, lib } = useSessionContext();
  const [deleting, setDeleting] = p3(null);
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { i18n: i18n2 } = useTranslationContext();
  const remove = safeFunctionHandler(
    lib.instance.deleteProduct.bind(lib.instance),
    !session.token || !deleting ? void 0 : [session.token, deleting.id]
  );
  remove.onSuccess = (suc, t5, id) => {
    setDeleting(null);
    return i18n2.str`Product (ID: ${id}) has been deleted`;
  };
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    JumpToElementById,
    {
      onSelect,
      description: i18n2.str`Jump to product with the given product ID`,
      placeholder: i18n2.str`Product id`
    }
  ), /* @__PURE__ */ h(
    CardTable7,
    {
      instances: result.body,
      onLoadMoreBefore: result.loadFirst,
      onLoadMoreAfter: result.loadNext,
      onCreate,
      onSelect: (product) => onSelect(product.id),
      onDelete: (prod) => setDeleting(prod)
    }
  ), deleting && /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Delete product`,
      description: i18n2.str`Delete the product "${deleting.description}"`,
      danger: true,
      active: true,
      onCancel: () => setDeleting(null),
      confirm: remove
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If you delete the product named", " ", /* @__PURE__ */ h("b", null, '"', deleting.description, '"'), " (ID:", " ", /* @__PURE__ */ h("b", null, deleting.id), "), the stock and related information will be lost")),
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleting a product cannot be undone."))
  ));
}

// src/paths/instance/products/update/index.tsx
init_preact_module();

// src/paths/instance/products/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
function UpdatePage4({ product, onBack, onConfirm }) {
  const { state: session, lib } = useSessionContext();
  const [form, setForm] = p3();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const update = safeFunctionHandler(
    lib.instance.updateProduct.bind(lib.instance),
    !session.token || !form ? void 0 : [session.token, product.product_id, form]
  );
  update.onSuccess = onConfirm;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  const { i18n: i18n2 } = useTranslationContext();
  const categoriesResult = useInstanceCategories();
  if (!categoriesResult)
    return /* @__PURE__ */ h(Loading2, null);
  if (categoriesResult instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: categoriesResult });
  }
  const categories = categoriesResult.type === "fail" ? [] : categoriesResult.body.categories;
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Product id:"), /* @__PURE__ */ h("b", null, product.product_id))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(ProductForm2, { initial: product, onSubscribe: setForm, alreadyExist: true, categories }), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      onClick: update,
      "data-tooltip": !update.args ? i18n2.str`Please complete the marked fields` : "confirm operation",
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/products/update/index.tsx
function UpdateProduct({
  pid,
  onConfirm,
  onBack
}) {
  const result = useProductDetails(pid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage4,
    {
      product: { ...result.body, product_id: pid },
      onBack,
      onConfirm
    }
  ));
}

// src/paths/instance/templates/create/index.tsx
init_preact_module();

// src/paths/instance/templates/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
function CreatePage8({
  defaultSettingsDuration,
  onCreated,
  onBack
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { config, state: session, lib } = useSessionContext();
  const devices = useInstanceOtpDevices();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const [state, setState] = p3({
    minimum_age: 0,
    amount_editable: true,
    summary_editable: true,
    pay_duration: defaultSettingsDuration
  });
  function updateState(up) {
    setState((old) => {
      const newState = up(old);
      if (!newState.amount_editable) {
        newState.currency_editable = false;
      }
      return newState;
    });
  }
  const parsedPrice = !state.amount ? void 0 : Amounts.parse(state.amount);
  const errors2 = {
    id: !state.id ? i18n2.str`Required` : !/[a-zA-Z0-9]*/.test(state.id) ? i18n2.str`Invalid. Please enter letters and numbers only.` : void 0,
    description: !state.description ? i18n2.str`Required` : void 0,
    summary: !state.summary ? state.summary_editable ? void 0 : i18n2.str`Required` : void 0,
    // more summary validations? none
    amount: !state.amount ? state.amount_editable ? void 0 : i18n2.str`Required` : !parsedPrice ? i18n2.str`Invalid` : Amounts.isZero(parsedPrice) ? state.amount_editable ? void 0 : i18n2.str`Must be greater than 0` : void 0,
    minimum_age: state.minimum_age && state.minimum_age < 0 ? i18n2.str`Must be greater that 0` : void 0,
    pay_duration: !state.pay_duration ? i18n2.str`Required` : state.pay_duration.d_ms === "forever" ? void 0 : state.pay_duration.d_ms < 1e3 ? i18n2.str`Too short` : void 0
  };
  const cList = Object.values(config.currencies).map((d6) => d6.name);
  const hasErrors = Object.keys(errors2).some(
    (k6) => errors2[k6] !== void 0
  );
  const zero = Amounts.stringify(Amounts.zeroOfCurrency(config.currency));
  const contract_amount = state.amount_editable ? void 0 : state.amount;
  const contract_summary = state.summary_editable ? void 0 : state.summary;
  const template_contract = {
    minimum_age: state.minimum_age,
    pay_duration: Duration.toTalerProtocolDuration(state.pay_duration),
    amount: contract_amount,
    summary: contract_summary,
    currency: cList.length > 1 && state.currency_editable ? void 0 : config.currency
  };
  const data = {
    template_id: state.id,
    template_description: state.description,
    template_contract,
    editable_defaults: {
      amount: !state.amount_editable ? void 0 : state.amount ?? zero,
      summary: !state.summary_editable ? void 0 : state.summary ?? "",
      currency: cList.length === 1 || !state.currency_editable ? void 0 : config.currency
    },
    otp_id: state.otpId
  };
  const create = safeFunctionHandler(
    lib.instance.addTemplate.bind(lib.instance),
    !session.token || hasErrors ? void 0 : [session.token, data]
  );
  create.onSuccess = onCreated;
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`You don't have enough permissions.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Instance not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`There is a template with this identifier, please choose another one.`;
      default:
        assertUnreachable(fail);
    }
  };
  const deviceList = !devices || devices instanceof TalerError || devices.type === "fail" ? [] : devices.body.otp_devices;
  const deviceMap = deviceList.reduce(
    (prev, cur) => {
      prev[cur.otp_device_id] = cur.device_description;
      return prev;
    },
    {}
  );
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: updateState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "id",
        help: new URL(
          `templates/${state.id ?? ""}`,
          session.backendUrl.href
        ).href,
        label: i18n2.str`Identifier`,
        tooltip: i18n2.str`Name of the template in URLs.`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        label: i18n2.str`Template name`,
        tooltip: i18n2.str`Describe what this template stands for`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "summary",
        inputType: "multiline",
        label: i18n2.str`Order summary`,
        tooltip: i18n2.str`If specified here, this template will create orders with the same summary`
      }
    ),
    /* @__PURE__ */ h(
      InputToggle,
      {
        name: "summary_editable",
        label: i18n2.str`Summary is editable`,
        tooltip: i18n2.str`Allow the user to change the summary.`
      }
    ),
    /* @__PURE__ */ h(
      InputCurrency,
      {
        name: "amount",
        label: i18n2.str`Amount`,
        tooltip: i18n2.str`If specified here, this template will create orders with the same price`
      }
    ),
    /* @__PURE__ */ h(
      InputToggle,
      {
        name: "amount_editable",
        label: i18n2.str`Amount is editable`,
        tooltip: i18n2.str`Allow the user to select the amount to pay.`
      }
    ),
    cList.length > 1 && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      InputToggle,
      {
        name: "currency_editable",
        readonly: !state.amount_editable,
        label: i18n2.str`Currency is editable`,
        tooltip: i18n2.str`Allow the user to change currency.`
      }
    ), /* @__PURE__ */ h(TextField, { name: "sc", label: i18n2.str`Supported currencies` }, /* @__PURE__ */ h(i18n2.Translate, null, "Supported currencies: ", cList.join(", ")))),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 22 /* option_ageRestriction */ }, /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "minimum_age",
        label: i18n2.str`Minimum age`,
        help: "",
        tooltip: i18n2.str`Is this contract restricted to some age?`
      }
    )),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 21 /* option_paymentTimeoutOnTemplate */
      },
      /* @__PURE__ */ h(
        InputDuration,
        {
          name: "pay_duration",
          label: i18n2.str`Payment timeout`,
          help: "",
          tooltip: i18n2.str`How much time the customer has to complete the payment once the order was created.`
        }
      )
    ),
    !deviceList.length ? /* @__PURE__ */ h(
      ComponentPersonaFlag,
      {
        Comp: TextField,
        point: 17 /* option_otpDevicesOnTemplate */,
        name: "otpId",
        label: i18n2.str`OTP device`,
        tooltip: i18n2.str`Use to verify transactions in offline mode.`
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "No OTP device."),
      "\xA0",
      /* @__PURE__ */ h("a", { href: "#/otp-devices/new" }, /* @__PURE__ */ h(i18n2.Translate, null, "Add one first"))
    ) : /* @__PURE__ */ h(
      InputSelector,
      {
        name: "otpId",
        label: i18n2.str`OTP device`,
        values: [
          void 0,
          ...deviceList.map((e5) => e5.otp_device_id)
        ],
        toStr: (v3) => {
          if (!v3) {
            return i18n2.str`No device`;
          }
          return deviceMap[v3];
        },
        tooltip: i18n2.str`Use to verify transactions in offline mode.`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      type: "submit",
      onClick: create
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/templates/create/index.tsx
function CreateTemplate({ onConfirm, onBack }) {
  const result = useInstanceDetails();
  if (!result)
    return /* @__PURE__ */ h(Loading, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage8,
    {
      onBack,
      onCreated: onConfirm,
      defaultSettingsDuration: Duration.fromTalerProtocolDuration(
        result.body.default_pay_delay
      )
    }
  ));
}

// src/paths/instance/templates/list/index.tsx
init_preact_module();
init_hooks_module();

// src/hooks/templates.ts
init_hooks_module();
var useSWR9 = useSWR;
function revalidateInstanceTemplates() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listTemplates",
    void 0,
    { revalidate: true }
  );
}
function useInstanceTemplates() {
  const { state, lib } = useSessionContext();
  const [offset] = p3();
  async function fetcher([token, bid]) {
    return await lib.instance.listTemplates(token, {
      limit: PAGINATED_LIST_REQUEST,
      offset: bid,
      order: "dec"
    });
  }
  const { data, error: error2 } = useSWR9([state.token, offset, "listTemplates"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function revalidateTemplateDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getTemplateDetails",
    void 0,
    { revalidate: true }
  );
}
function useTemplateDetails(templateId) {
  const { state, lib } = useSessionContext();
  async function fetcher([tid, token]) {
    return await lib.instance.getTemplateDetails(token, tid);
  }
  const { data, error: error2 } = useSWR9([templateId, state.token, "getTemplateDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/templates/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable8({
  templates,
  onCreate,
  onDelete,
  onSelect,
  onQR,
  onNewOrder,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-qrcode" })), /* @__PURE__ */ h(i18n2.Translate, null, "Templates")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new templates`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        onClick: onCreate,
        accessKey: "+"
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, templates.length > 0 ? /* @__PURE__ */ h(
    Table9,
    {
      instances: templates,
      onDelete,
      onSelect,
      onNewOrder,
      onQR,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable10, null)))));
}
function Table9({
  instances: instances2,
  onLoadMoreAfter,
  onDelete,
  onNewOrder,
  onQR,
  onSelect,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more templates before the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Description")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.template_id }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.template_id
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.template_description
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected templates from the database`,
        onClick: () => onDelete(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ), /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Use template to create new order`,
        onClick: () => onNewOrder(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Test")
    ), /* @__PURE__ */ h(
      "button",
      {
        type: "button",
        class: "button is-info is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Generate a QR code for the template.`,
        onClick: () => onQR(i5)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Show QR")
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more templates after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function EmptyTable10() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no templates to list yet, add more by pressing the + sign")));
}

// src/paths/instance/templates/list/index.tsx
function ListTemplates({
  onCreate,
  onQR,
  onSelect,
  onNewOrder
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const result = useInstanceTemplates();
  const [deleting, setDeleting] = p3(null);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const remove = safeFunctionHandler(
    lib.instance.deleteTemplate.bind(lib.instance),
    !session.token || !deleting ? void 0 : [session.token, deleting.template_id]
  );
  remove.onSuccess = () => {
    setDeleting(null);
  };
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    JumpToElementById,
    {
      onSelect,
      description: i18n2.str`Jump to template with the given template ID`,
      placeholder: i18n2.str`Template identification`
    }
  ), /* @__PURE__ */ h(
    CardTable8,
    {
      templates: result.body.templates.map((o3) => ({
        ...o3,
        id: String(o3.template_id)
      })),
      onLoadMoreBefore: void 0,
      onLoadMoreAfter: void 0,
      onCreate,
      onSelect: (e5) => {
        onSelect(e5.template_id);
      },
      onNewOrder: (e5) => {
        onNewOrder(e5.template_id);
      },
      onQR: (e5) => {
        onQR(e5.template_id);
      },
      onDelete: (e5) => {
        setDeleting(e5);
      }
    }
  ), deleting && /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Delete template`,
      description: i18n2.str`Delete the template "${deleting.template_description}"`,
      danger: true,
      active: true,
      onCancel: () => setDeleting(null),
      confirm: remove
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If you delete the template", " ", /* @__PURE__ */ h("b", null, '"', deleting.template_description, '"'), " (ID:", " ", /* @__PURE__ */ h("b", null, deleting.template_id), ") you may loose information")),
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleting a template cannot be undone."))
  ));
}

// src/paths/instance/templates/qr/index.tsx
init_preact_module();

// src/paths/instance/templates/qr/QrPage.tsx
init_preact_module();
init_hooks_module();
function QrPage({ id: templateId, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state } = useSessionContext();
  const merchantBaseUrl = state.backendUrl.href;
  const payTemplateUri = stringifyPayTemplateUri({
    merchantBaseUrl,
    templateId
    // FIXME!
    //templateParams: {},
  });
  const printThis = _2(null);
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { id: "printThis", ref: printThis }, /* @__PURE__ */ h(QR, { text: payTemplateUri }), /* @__PURE__ */ h("pre", { style: { textAlign: "center" } }, /* @__PURE__ */ h("a", { target: "_blank", rel: "noreferrer", href: payTemplateUri }, payTemplateUri))), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-info",
      onClick: () => saveAsPDF(templateId, printThis.current)
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Print")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}
function saveAsPDF(name, divContents) {
  const dom = `<!DOCTYPE html>
<html>
  <head>
    <title>Order template for ${name}</title>
    <style>
      pre > a {
        text-decoration: none;
      }
    </style>
  </head>
  <body>
    ${divContents.outerHTML}
  </body>
</html>`;
  const blobUrl = URL.createObjectURL(new Blob([dom], { type: "text/html" }));
  const f3 = document.createElement("iframe");
  f3.src = blobUrl;
  f3.style.display = "none";
  function onComplete() {
    document.body.removeChild(f3);
    URL.revokeObjectURL(blobUrl);
  }
  f3.onload = () => {
    if (!f3.contentWindow)
      return;
    f3.contentWindow.onbeforeunload = onComplete;
    f3.contentWindow.onafterprint = onComplete;
    f3.contentWindow.print();
  };
  document.body.appendChild(f3);
}

// src/paths/instance/templates/qr/index.tsx
function TemplateQrPage({ tid, onBack }) {
  const result = useTemplateDetails(tid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(QrPage, { contract: result.body.template_contract, id: tid, onBack });
}

// src/paths/instance/templates/update/index.tsx
init_preact_module();

// src/paths/instance/templates/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
function changeToCurrency(am, currency) {
  if (!am || !currency)
    return void 0;
  const amount = Amounts.parse(am);
  if (!amount)
    return void 0;
  const newAmount = {
    ...amount,
    currency
  };
  return Amounts.stringify(newAmount);
}
function UpdatePage5({ template, onUpdated, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { config, state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const cList = Object.values(config.currencies).map((d6) => d6.name);
  const supportedCurrencies = Object.keys(config.currencies);
  const currentAmount = template.editable_defaults?.amount ?? template.template_contract.amount;
  const default_currency = supportedCurrencies[0];
  const template_currency = currentAmount ? Amounts.currencyOf(currentAmount) : default_currency;
  const unsupportedCurrency = supportedCurrencies.indexOf(template_currency) === -1;
  const startingAmount = unsupportedCurrency ? changeToCurrency(currentAmount, default_currency) : currentAmount;
  const [state, setState] = p3({
    description: template.template_description,
    minimum_age: template.template_contract.minimum_age,
    otpId: template.otp_id,
    pay_duration: template.template_contract.pay_duration ? Duration.fromTalerProtocolDuration(
      template.template_contract.pay_duration
    ) : void 0,
    summary: template.editable_defaults?.summary ?? template.template_contract.summary,
    currency: unsupportedCurrency ? default_currency : template_currency,
    amount: startingAmount,
    currency_editable: !!template.editable_defaults?.currency,
    summary_editable: template.editable_defaults?.summary !== void 0,
    amount_editable: template.editable_defaults?.amount !== void 0
  });
  function updateState(up) {
    setState((old) => {
      const newState = up(old);
      if (!newState.amount_editable) {
        newState.currency_editable = false;
      }
      newState.amount = changeToCurrency(newState.amount, newState.currency);
      return newState;
    });
  }
  const devices = useInstanceOtpDevices();
  const deviceList = !devices || devices instanceof TalerError || devices.type === "fail" ? [] : devices.body.otp_devices;
  const deviceMap = deviceList.reduce(
    (prev, cur) => {
      prev[cur.otp_device_id] = cur.device_description;
      return prev;
    },
    {}
  );
  const parsedPrice = !state.amount ? void 0 : Amounts.parse(state.amount);
  const errors2 = undefinedIfEmpty({
    description: !state.description ? i18n2.str`Required` : void 0,
    summary: !state.summary ? state.summary_editable ? void 0 : i18n2.str`Required` : void 0,
    // more summary validations? none
    amount: !state.amount ? state.amount_editable ? void 0 : i18n2.str`Required` : !parsedPrice ? i18n2.str`Invalid` : Amounts.isZero(parsedPrice) ? state.amount_editable ? void 0 : i18n2.str`Must be greater than 0` : void 0,
    minimum_age: state.minimum_age && state.minimum_age < 0 ? i18n2.str`Must be greater that 0` : void 0,
    pay_duration: !state.pay_duration ? i18n2.str`Required` : state.pay_duration.d_ms === "forever" ? void 0 : state.pay_duration.d_ms < 1e3 ? i18n2.str`Too short` : void 0
  });
  const zero = Amounts.stringify(
    Amounts.zeroOfCurrency(state.currency ?? default_currency)
  );
  const contract_amount = state.amount_editable ? void 0 : state.amount;
  const contract_summary = state.summary_editable ? void 0 : state.summary;
  const template_contract = {
    minimum_age: state.minimum_age,
    pay_duration: state.pay_duration ? Duration.toTalerProtocolDuration(state.pay_duration) : TalerProtocolDuration.forever(),
    amount: contract_amount,
    summary: contract_summary,
    currency: cList.length > 1 && state.currency_editable ? void 0 : state.currency
  };
  const data = {
    template_description: state.description,
    template_contract,
    editable_defaults: {
      amount: !state.amount_editable ? void 0 : state.amount ?? zero,
      summary: !state.summary_editable ? void 0 : state.summary ?? "",
      currency: cList.length === 1 || !state.currency_editable ? void 0 : state.currency
    },
    otp_id: state.otpId
  };
  const update = safeFunctionHandler(
    lib.instance.updateTemplate.bind(lib.instance),
    !session.token || !!errors2 ? void 0 : [session.token, template.id, data]
  );
  update.onSuccess = onUpdated;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, new URL(
    `templates/${template.id}`,
    session.backendUrl.href
  ).href)))))), /* @__PURE__ */ h("hr", null), unsupportedCurrency ? /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        message: i18n2.str`The template configuration needs to be fixed.`,
        description: i18n2.str`The currency of the template is ${template_currency} and is not in the list of supported currencies.`,
        type: "WARN"
      }
    }
  ) : void 0, /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: updateState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        label: i18n2.str`Template name`,
        tooltip: i18n2.str`Describe what this template stands for`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "summary",
        inputType: "multiline",
        label: i18n2.str`Order summary`,
        tooltip: i18n2.str`If specified, this template will create order with the same summary`
      }
    ),
    /* @__PURE__ */ h(
      InputToggle,
      {
        name: "summary_editable",
        label: i18n2.str`Summary is editable`,
        tooltip: i18n2.str`Allow the user to change the summary.`
      }
    ),
    supportedCurrencies.length > 1 ? /* @__PURE__ */ h(
      InputSelector,
      {
        name: "currency",
        label: i18n2.str`Supported currencies`,
        values: supportedCurrencies
      }
    ) : void 0,
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "amount",
        label: i18n2.str`Amount`,
        addonBefore: state.currency,
        inputType: "number",
        toStr: (v3) => v3?.split(":")[1] || "",
        fromStr: (v3) => !v3 ? void 0 : `${state.currency}:${v3}`,
        inputExtra: { min: 0, step: 1e-3 },
        tooltip: i18n2.str`If specified, this template will create orders with the same price`
      }
    ),
    /* @__PURE__ */ h(
      InputToggle,
      {
        name: "amount_editable",
        label: i18n2.str`Amount is editable`,
        tooltip: i18n2.str`Allow the user to select the amount to pay.`
      }
    ),
    cList.length > 1 && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
      InputToggle,
      {
        name: "currency_editable",
        readonly: !state.amount_editable,
        label: i18n2.str`Currency is editable`,
        tooltip: i18n2.str`Allow the user to change currency.`
      }
    )),
    /* @__PURE__ */ h(FragmentPersonaFlag, { point: 22 /* option_ageRestriction */ }, /* @__PURE__ */ h(
      InputNumber2,
      {
        name: "minimum_age",
        label: i18n2.str`Minimum age`,
        tooltip: i18n2.str`Is this contract restricted to some age?`
      }
    )),
    /* @__PURE__ */ h(
      FragmentPersonaFlag,
      {
        point: 21 /* option_paymentTimeoutOnTemplate */
      },
      /* @__PURE__ */ h(
        InputDuration,
        {
          name: "pay_duration",
          label: i18n2.str`Payment timeout`,
          help: "",
          tooltip: i18n2.str`How much time has the customer to complete the payment once the order was created.`,
          withoutClear: true
        }
      )
    ),
    !deviceList.length ? /* @__PURE__ */ h(
      ComponentPersonaFlag,
      {
        Comp: TextField,
        point: 17 /* option_otpDevicesOnTemplate */,
        name: "otpId",
        label: i18n2.str`OTP device`,
        tooltip: i18n2.str`Use to verify transactions in offline mode.`
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "No OTP device."),
      "\xA0",
      /* @__PURE__ */ h("a", { href: "#/otp-devices/new" }, /* @__PURE__ */ h(i18n2.Translate, null, "Add one first"))
    ) : /* @__PURE__ */ h(
      InputSelector,
      {
        name: "otpId",
        label: i18n2.str`OTP device`,
        values: [
          void 0,
          ...deviceList.map((e5) => e5.otp_device_id)
        ],
        toStr: (v3) => {
          if (!v3) {
            return i18n2.str`No device`;
          }
          return deviceMap[v3];
        },
        tooltip: i18n2.str`Use to verify transactions in offline mode.`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": errors2 !== void 0 ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      type: "submit",
      onClick: update
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))))));
}

// src/paths/instance/templates/update/index.tsx
function UpdateTemplate({
  tid,
  onConfirm,
  onBack
}) {
  const result = useTemplateDetails(tid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage5,
    {
      template: { ...result.body, id: tid },
      onBack,
      onUpdated: onConfirm
    }
  ));
}

// src/paths/instance/templates/use/index.tsx
init_preact_module();

// src/paths/instance/templates/use/UsePage.tsx
init_preact_module();
init_hooks_module();
function UsePage({
  id,
  template,
  onBack,
  onOrderCreated
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const [state, setState] = p3({
    currency: template.editable_defaults?.currency ?? template.template_contract.currency,
    // FIXME: Add additional check here, editable default might be a plain string!
    amount: template.editable_defaults?.amount ?? template.template_contract.amount,
    summary: template.editable_defaults?.summary ?? template.template_contract.summary
  });
  const errors2 = undefinedIfEmpty({
    amount: !state.amount ? i18n2.str`An amount is required` : void 0,
    summary: !state.summary ? i18n2.str`An order summary is required` : void 0
  });
  const details = {
    amount: template.template_contract.amount ? void 0 : state.amount,
    summary: template.template_contract.summary ? void 0 : state.summary
  };
  const useTemplate = safeFunctionHandler(
    lib.instance.useTemplateCreateOrder.bind(lib.instance),
    !!errors2 ? void 0 : [id, details]
  );
  useTemplate.onSuccess = (success) => {
    onOrderCreated(success.order_id);
  };
  useTemplate.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
      case HttpStatusCode.Gone:
        return i18n2.str`No more stock for product with ID "${fail.body.product_id}".`;
      case HttpStatusCode.UnavailableForLegalReasons:
        return i18n2.str`No exchange would accept a payment because of KYC requirements.`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "New order from template"), ":", " ", /* @__PURE__ */ h("b", null, id)))))))), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "amount",
        label: i18n2.str`Amount`,
        addonBefore: state.currency,
        inputType: "number",
        toStr: (v3) => v3?.split(":")[1] || "",
        fromStr: (v3) => !v3 ? void 0 : `${state.currency}:${v3}`,
        inputExtra: { min: 0, step: 1e-3 },
        tooltip: i18n2.str`Amount of the order`,
        readonly: !!template.template_contract.amount
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "summary",
        inputType: "multiline",
        label: i18n2.str`Order summary`,
        readonly: !!template.template_contract.summary,
        tooltip: i18n2.str`Title of the order to be shown to the customer`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": errors2 !== void 0 ? i18n2.str`Please complete the marked fields` : "confirm operation",
      type: "submit",
      onClick: useTemplate
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/templates/use/index.tsx
function TemplateUsePage({
  tid,
  onOrderCreated,
  onBack
}) {
  const result = useTemplateDetails(tid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UsePage,
    {
      template: result.body,
      id: tid,
      onBack,
      onOrderCreated
    }
  ));
}

// src/paths/instance/tokenfamilies/create/index.tsx
init_preact_module();

// src/paths/instance/tokenfamilies/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
function CreatePage9({ onCreated, onBack }) {
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { i18n: i18n2 } = useTranslationContext();
  const [value, valueHandler] = p3({
    slug: void 0,
    name: void 0,
    description: void 0,
    description_i18n: {},
    kind: types_taler_merchant_exports.TokenFamilyKind.Discount,
    duration: Duration.toTalerProtocolDuration(Duration.getForever()),
    valid_after: AbsoluteTime.toProtocolTimestamp(AbsoluteTime.never()),
    valid_before: AbsoluteTime.toProtocolTimestamp(AbsoluteTime.never()),
    validity_granularity: Duration.toTalerProtocolDuration(
      Duration.getForever()
    )
  });
  const errors2 = {
    slug: !value.slug ? i18n2.str`Required` : void 0,
    name: !value.name ? i18n2.str`Required` : void 0,
    description: !value.description ? i18n2.str`Required` : void 0,
    valid_after: !value.valid_after ? void 0 : void 0,
    valid_before: !value.valid_before ? i18n2.str`Required` : void 0,
    validity_granularity: !value.validity_granularity ? i18n2.str`Required` : void 0,
    duration: !value.duration ? i18n2.str`Required` : void 0,
    kind: !value.kind ? i18n2.str`Required` : void 0
  };
  const create = safeFunctionHandler(
    lib.instance.createTokenFamily.bind(lib.instance),
    !session.token || !!errors2 ? void 0 : [session.token, value]
  );
  create.onSuccess = onCreated;
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "token_family",
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      InputWithAddon,
      {
        name: "slug",
        addonBefore: new URL("tokenfamily/", session.backendUrl.href).href,
        label: i18n2.str`Slug`,
        tooltip: i18n2.str`Token family slug to use in URLs (for internal use only)`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "kind",
        label: i18n2.str`Kind`,
        tooltip: i18n2.str`Token family kind`,
        values: ["discount", "subscription"]
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "name",
        inputType: "text",
        label: i18n2.str`Name`,
        tooltip: i18n2.str`User-readable token family name`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        inputType: "multiline",
        label: i18n2.str`Description`,
        tooltip: i18n2.str`Token family description for customers`
      }
    ),
    /* @__PURE__ */ h(
      InputDate,
      {
        name: "valid_after",
        label: i18n2.str`Valid After`,
        tooltip: i18n2.str`Token family can issue tokens after this date`,
        withTimestampSupport: true
      }
    ),
    /* @__PURE__ */ h(
      InputDate,
      {
        name: "valid_before",
        label: i18n2.str`Valid Before`,
        tooltip: i18n2.str`Token family can issue tokens until this date`,
        withTimestampSupport: true
      }
    ),
    /* @__PURE__ */ h(
      InputDuration,
      {
        name: "validity_granularity",
        label: i18n2.str`Validity Granularity`,
        tooltip: i18n2.str`Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days`,
        useProtocolDuration: true
      }
    ),
    /* @__PURE__ */ h(
      InputDuration,
      {
        name: "duration",
        label: i18n2.str`Duration`,
        tooltip: i18n2.str`Validity duration of a issued token`,
        withForever: true,
        useProtocolDuration: true
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      onClick: create,
      "data-tooltip": !create.args ? i18n2.str`Please complete the marked fields` : "confirm operation",
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/tokenfamilies/create/index.tsx
function CreateTokenFamily({ onConfirm, onBack }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    CreatePage9,
    {
      onBack,
      onCreated: onConfirm
    }
  ));
}

// src/paths/instance/tokenfamilies/list/index.tsx
init_preact_module();
init_hooks_module();

// src/hooks/tokenfamily.ts
var useSWR10 = useSWR;
function revalidateTokenFamilies() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listTokenFamilies",
    void 0,
    { revalidate: true }
  );
}
function useInstanceTokenFamilies() {
  const { state, lib } = useSessionContext();
  async function fetcher([token, _bid]) {
    return await lib.instance.listTokenFamilies(token, {
      // limit: PAGINATED_LIST_REQUEST,
      // offset: bid === undefined ? undefined: String(bid),
      // order: "dec",
    });
  }
  const { data, error: error2 } = useSWR10([state.token, "offset", "listTokenFamilies"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function revalidateTokenFamilyDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getTokenFamilyDetails",
    void 0,
    { revalidate: true }
  );
}
function useTokenFamilyDetails(tokenFamilySlug) {
  const { state, lib } = useSessionContext();
  async function fetcher([slug, token]) {
    return await lib.instance.getTokenFamilyDetails(token, slug);
  }
  const { data, error: error2 } = useSWR10([tokenFamilySlug, state.token, "getTokenFamilyDetails"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}

// src/paths/instance/tokenfamilies/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable9({
  instances: instances2,
  onCreate,
  onSelect,
  onDelete
}) {
  const [rowSelection, rowSelectionHandler] = p3(
    void 0
  );
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-clock" })), /* @__PURE__ */ h(i18n2.Translate, null, "Token Families")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add token family`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        onClick: onCreate,
        accessKey: "+"
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, instances2.length > 0 ? /* @__PURE__ */ h(
    Table10,
    {
      instances: instances2,
      onSelect,
      onDelete,
      rowSelection,
      rowSelectionHandler
    }
  ) : /* @__PURE__ */ h(EmptyTable11, null)))));
}
function Table10({
  rowSelection,
  rowSelectionHandler,
  instances: instances2,
  onSelect,
  onDelete
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Slug")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Name")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Valid After")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Valid Before")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Kind")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h(p2, { key: i5.slug }, /* @__PURE__ */ h("tr", { key: "info" }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.slug && rowSelectionHandler(i5.slug),
        style: { cursor: "pointer" }
      },
      i5.slug
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.slug && rowSelectionHandler(i5.slug),
        style: { cursor: "pointer" }
      },
      i5.name
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.slug && rowSelectionHandler(i5.slug),
        style: { cursor: "pointer" }
      },
      i5.valid_after.t_s === "never" ? i18n2.str`Never` : format2(
        new Date(i5.valid_after.t_s * 1e3),
        "yyyy/MM/dd hh:mm:ss"
      )
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.slug && rowSelectionHandler(i5.slug),
        style: { cursor: "pointer" }
      },
      i5.valid_before.t_s === "never" ? i18n2.str`Never` : format2(
        new Date(i5.valid_before.t_s * 1e3),
        "yyyy/MM/dd hh:mm:ss"
      )
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => rowSelection !== i5.slug && rowSelectionHandler(i5.slug),
        style: { cursor: "pointer" }
      },
      i5.kind
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      "span",
      {
        class: "has-tooltip-bottom",
        "data-tooltip": i18n2.str`Go to token family update page`
      },
      /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-success ",
          type: "button",
          onClick: () => onSelect(i5)
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Update")
      )
    ), /* @__PURE__ */ h(
      "span",
      {
        class: "has-tooltip-left",
        "data-tooltip": i18n2.str`Remove this token family from the database`
      },
      /* @__PURE__ */ h(
        "button",
        {
          class: "button is-small is-danger",
          type: "button",
          onClick: () => onDelete(i5)
        },
        /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
      )
    )))));
  }))));
}
function EmptyTable11() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-emoticon-sad mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no token families yet, add the first one by pressing the + sign.")));
}

// src/paths/instance/tokenfamilies/list/index.tsx
function TokenFamilyList({ onCreate, onSelect }) {
  const result = useInstanceTokenFamilies();
  const [deleting, setDeleting] = p3(null);
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  const remove = safeFunctionHandler(
    lib.instance.deleteTokenFamily.bind(lib.instance),
    !session.token || !deleting ? void 0 : [session.token, deleting.slug]
  );
  remove.onSuccess = () => {
    setDeleting(null);
    return i18n2.str`Token family has been deleted.`;
  };
  remove.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h(
    CardTable9,
    {
      instances: result.body.token_families,
      onCreate,
      onSelect: (tokenFamily) => onSelect(tokenFamily.slug),
      onDelete: (fam) => setDeleting(fam)
    }
  ), deleting && /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`Delete token family`,
      description: i18n2.str`Delete the token family "${deleting.name}"`,
      danger: true,
      active: true,
      onCancel: () => setDeleting(null),
      confirm: remove
    },
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "If you delete the ", /* @__PURE__ */ h("b", null, '"', deleting.name, '"'), " token family (Slug: ", /* @__PURE__ */ h("b", null, deleting.slug), "), all issued tokens will become invalid.")),
    /* @__PURE__ */ h("p", { class: "warning" }, /* @__PURE__ */ h(i18n2.Translate, null, "Deleting a token family", " ", /* @__PURE__ */ h("b", null, /* @__PURE__ */ h(i18n2.Translate, null, "can't be undone")), "."))
  ));
}

// src/paths/instance/tokenfamilies/update/index.tsx
init_preact_module();

// src/paths/instance/tokenfamilies/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
function UpdatePage6({ onUpdated, onBack, tokenFamily }) {
  const [value, valueHandler] = p3(tokenFamily);
  const { i18n: i18n2 } = useTranslationContext();
  const errors2 = undefinedIfEmpty2({
    name: !value.name ? i18n2.str`Required` : void 0,
    description: !value.description ? i18n2.str`Required` : void 0,
    valid_after: !value.valid_after ? i18n2.str`Required` : void 0,
    valid_before: !value.valid_before ? i18n2.str`Required` : void 0,
    duration: !value.duration ? i18n2.str`Required` : void 0
  });
  const { state: session, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const hasErrors = errors2 !== void 0;
  const update = safeFunctionHandler(
    lib.instance.updateTokenFamily.bind(lib.instance),
    !session.token || !!errors2 ? void 0 : [session.token, tokenFamily.slug, value]
  );
  update.onSuccess = onUpdated;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Token Family: ", /* @__PURE__ */ h("b", null, tokenFamily.name)))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "token_family",
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "name",
        inputType: "text",
        label: i18n2.str`Name`,
        tooltip: i18n2.str`User-readable token family name`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "description",
        inputType: "multiline",
        label: i18n2.str`Description`,
        tooltip: i18n2.str`Token family description for customers`
      }
    ),
    /* @__PURE__ */ h(
      InputDate,
      {
        name: "valid_after",
        label: i18n2.str`Valid After`,
        tooltip: i18n2.str`Token family can issue tokens after this date`,
        withTimestampSupport: true
      }
    ),
    /* @__PURE__ */ h(
      InputDate,
      {
        name: "valid_before",
        label: i18n2.str`Valid Before`,
        tooltip: i18n2.str`Token family can issue tokens until this date`,
        withTimestampSupport: true
      }
    ),
    /* @__PURE__ */ h(
      InputDuration,
      {
        name: "duration",
        label: i18n2.str`Duration`,
        tooltip: i18n2.str`Validity duration of a issued token`,
        withForever: true,
        useProtocolDuration: true
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      type: "submit",
      onClick: update
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))))));
}

// src/paths/instance/tokenfamilies/update/index.tsx
function UpdateTokenFamily({
  slug,
  onConfirm,
  onBack
}) {
  const result = useTokenFamilyDetails(slug);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage6,
    {
      tokenFamily: result.body,
      onBack,
      onUpdated: onConfirm
    }
  ));
}

// src/paths/instance/transfers/list/index.tsx
init_preact_module();
init_hooks_module();

// src/hooks/transfer.ts
var useSWR11 = useSWR;
function revalidateInstanceIncomingTransfers() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listIncomingWireTransfers",
    void 0,
    { revalidate: true }
  );
}
function useInstanceIncomingTransfers(args, updatePosition = () => {
}) {
  const { state, lib } = useSessionContext();
  async function fetcher([token, o3, p4, v3, c5]) {
    return await lib.instance.listIncomingWireTransfers(token, {
      paytoURI: p4,
      verified: v3,
      confirmed: c5,
      limit: PAGINATED_LIST_REQUEST,
      offset: o3,
      order: "dec"
    });
  }
  const { data, error: error2 } = useSWR11(
    [
      state.token,
      args?.position,
      args?.payto_uri,
      args?.verified,
      args?.confirmed,
      "listIncomingWireTransfers"
    ],
    fetcher
  );
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.incoming,
    args?.position,
    updatePosition,
    (d6) => String(d6.wtid),
    PAGINATED_LIST_REQUEST
  );
}
function revalidateInstanceConfirmedTransfers() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listConfirmedWireTransfers",
    void 0,
    { revalidate: true }
  );
}
function useInstanceConfirmedTransfers(args, updatePosition = () => {
}) {
  const { state, lib } = useSessionContext();
  async function fetcher([token, o3, p4, e5]) {
    return await lib.instance.listConfirmedWireTransfers(token, {
      paytoURI: p4,
      expected: e5,
      limit: PAGINATED_LIST_REQUEST,
      offset: o3,
      order: "dec"
    });
  }
  const { data, error: error2 } = useSWR11(
    [
      state.token,
      args?.position,
      args?.payto_uri,
      args?.expected,
      "listConfirmedWireTransfers"
    ],
    fetcher
  );
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return buildPaginatedResult(
    data.body.transfers,
    args?.position,
    updatePosition,
    (d6) => String(d6.transfer_serial_id),
    PAGINATED_LIST_REQUEST
  );
}

// src/paths/instance/transfers/list/ListPage.tsx
init_preact_module();

// src/paths/instance/transfers/list/Table.tsx
init_preact_module();
function CardTableIncoming({
  transfers,
  onLoadMoreAfter,
  onLoadMoreBefore,
  onSelectedToConfirm
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-left-right" })), /* @__PURE__ */ h(i18n2.Translate, null, "Incoming wire transfers"))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, transfers.length > 0 ? /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more wire transfers preceding the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Expected credit")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Confirmed")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Validated")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Executed on")))), /* @__PURE__ */ h("tbody", null, transfers.map((i5) => {
    return /* @__PURE__ */ h(
      "tr",
      {
        key: i5.id,
        style: {
          cursor: !i5.confirmed ? "pointer" : void 0
        },
        onClick: !i5.confirmed ? () => onSelectedToConfirm(i5) : void 0
      },
      /* @__PURE__ */ h("td", { title: i5.wtid }, i5.wtid.substring(0, 16), "..."),
      /* @__PURE__ */ h("td", null, i5.expected_credit_amount),
      /* @__PURE__ */ h("td", null, i5.confirmed ? i18n2.str`yes` : i18n2.str`no`),
      /* @__PURE__ */ h("td", null, i5.validated ? i18n2.str`yes` : i18n2.str`no`),
      /* @__PURE__ */ h("td", null, i5.execution_time ? i5.execution_time.t_s == "never" ? i18n2.str`never` : format2(
        i5.execution_time.t_s * 1e3,
        datetimeFormatForSettings(settings)
      ) : i18n2.str`unknown`)
    );
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more transfers after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  )) : /* @__PURE__ */ h(EmptyTable12, null)))));
}
function CardTableVerified({
  transfers,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  return /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-arrow-left-right" })), /* @__PURE__ */ h(i18n2.Translate, null, "Verified wire transfers"))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, transfers.length > 0 ? /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more wire transfers preceding the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Amount")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Confirmed")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Verified")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Executed on")))), /* @__PURE__ */ h("tbody", null, transfers.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.id }, /* @__PURE__ */ h("td", { title: i5.wtid }, i5.wtid.substring(0, 16), "..."), /* @__PURE__ */ h("td", null, i5.credit_amount), /* @__PURE__ */ h("td", null, i5.confirmed ? i18n2.str`yes` : i18n2.str`no`), /* @__PURE__ */ h("td", null, i5.verified ? i18n2.str`yes` : i18n2.str`no`), /* @__PURE__ */ h("td", null, i5.execution_time ? i5.execution_time.t_s == "never" ? i18n2.str`never` : format2(
      i5.execution_time.t_s * 1e3,
      datetimeFormatForSettings(settings)
    ) : i18n2.str`unknown`));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more transfers after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  )) : /* @__PURE__ */ h(EmptyTable12, null)))));
}
function EmptyTable12() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no transfers to list yet, add more by pressing the + sign")));
}

// src/paths/instance/transfers/list/ListPage.tsx
function ListPage3({
  payTo,
  onChangePayTo,
  transfers,
  incomings,
  onSelectedToConfirm,
  accounts,
  onLoadMoreBefore,
  onLoadMoreAfter,
  isNonVerifiedTransfers,
  isVerifiedTransfers,
  onShowUnverified,
  onShowVerified
}) {
  const form = { payto_uri: payTo };
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-10" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: form,
      valueHandler: (updater) => onChangePayTo(updater(form).payto_uri)
    },
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "payto_uri",
        label: i18n2.str`Bank account`,
        values: accounts,
        fromStr: (d6) => {
          const idx = accounts.indexOf(d6);
          if (idx === -1)
            return void 0;
          return d6;
        },
        placeholder: i18n2.str`All accounts`,
        tooltip: i18n2.str`Filter by account address`
      }
    )
  )), /* @__PURE__ */ h("div", { class: "column" })), /* @__PURE__ */ h("div", { class: "tabs" }, /* @__PURE__ */ h("ul", null, /* @__PURE__ */ h("li", { class: isNonVerifiedTransfers ? "is-active" : "" }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Only display transfers that have already been transferred to your bank account by the payment service provider.`
    },
    /* @__PURE__ */ h("a", { onClick: onShowUnverified }, /* @__PURE__ */ h(i18n2.Translate, null, "Incoming"))
  )), /* @__PURE__ */ h("li", { class: isVerifiedTransfers ? "is-active" : "" }, /* @__PURE__ */ h(
    "div",
    {
      class: "has-tooltip-right",
      "data-tooltip": i18n2.str`Only show wire transfers confirmed by the merchant`
    },
    /* @__PURE__ */ h("a", { onClick: onShowVerified }, /* @__PURE__ */ h(i18n2.Translate, null, "Verified"))
  )))), isNonVerifiedTransfers ? /* @__PURE__ */ h(
    CardTableIncoming,
    {
      transfers: incomings.map((o3) => ({
        ...o3,
        id: String(o3.wtid)
      })),
      onLoadMoreBefore,
      onLoadMoreAfter,
      onSelectedToConfirm
    }
  ) : /* @__PURE__ */ h(
    CardTableVerified,
    {
      transfers: transfers.map((o3) => ({
        ...o3,
        id: String(o3.wtid)
      })),
      onLoadMoreBefore,
      onLoadMoreAfter
    }
  ));
}

// src/components/Amount.tsx
init_preact_module();
function Amount2({
  value,
  maxFracSize,
  negative,
  hideCurrency,
  signType = "standard",
  signDisplay = "auto"
}) {
  const aj = Amounts.jsonifyAmount(value);
  const minFractional = maxFracSize !== void 0 && maxFracSize < 2 ? maxFracSize : 2;
  const af = aj.fraction % amountFractionalBase;
  let s6 = "";
  if (af && maxFracSize || minFractional > 0) {
    s6 += ".";
    let n2 = af;
    for (let i5 = 0; (maxFracSize === void 0 || i5 < maxFracSize) && i5 < amountFractionalLength; i5++) {
      if (!n2 && i5 >= minFractional) {
        break;
      }
      s6 = s6 + Math.floor(n2 / amountFractionalBase * 10).toString();
      n2 = n2 * 10 % amountFractionalBase;
    }
  }
  const fontSize = 18;
  const letterSpacing = 0;
  const mult = 0.7;
  return /* @__PURE__ */ h("span", { style: { textAlign: "right", whiteSpace: "nowrap" } }, /* @__PURE__ */ h(
    "span",
    {
      style: {
        display: "inline-block",
        fontFamily: "monospace",
        fontSize
      }
    },
    negative ? signType === "accounting" ? "(" : "-" : "",
    /* @__PURE__ */ h(
      "span",
      {
        style: {
          display: "inline-block",
          textAlign: "right",
          fontFamily: "monospace",
          fontSize,
          letterSpacing
        }
      },
      aj.value
    ),
    /* @__PURE__ */ h(
      "span",
      {
        style: {
          display: "inline-block",
          width: !maxFracSize ? void 0 : `${(maxFracSize + 1) * mult}em`,
          textAlign: "left",
          fontFamily: "monospace",
          fontSize,
          letterSpacing
        }
      },
      s6,
      negative && signType === "accounting" ? ")" : ""
    )
  ), hideCurrency ? void 0 : /* @__PURE__ */ h(p2, null, "\xA0", /* @__PURE__ */ h("span", null, aj.currency)));
}

// src/paths/instance/transfers/list/index.tsx
function ListTransfer({}) {
  const setFilter = (s6) => setForm({ ...form, verified: s6 });
  const { state: session, lib } = useSessionContext();
  const [position, setPosition] = p3(void 0);
  const [settings] = usePreference();
  const instance = useInstanceBankAccounts();
  const accounts = !instance || instance instanceof TalerError || instance.type === "fail" ? [] : instance.body.accounts.map((a6) => a6.payto_uri);
  const [form, setForm] = p3({ payto_uri: "", verified: false });
  const [selected, setSelected] = p3();
  const { i18n: i18n2 } = useTranslationContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const shoulUseDefaultAccount = accounts.length === 1;
  h2(() => {
    if (shoulUseDefaultAccount) {
      setForm({ ...form, payto_uri: accounts[0] });
    }
  }, [shoulUseDefaultAccount]);
  const confirm = safeFunctionHandler(
    lib.instance.informWireTransfer.bind(lib.instance),
    !session.token || !selected ? void 0 : [
      session.token,
      {
        credit_amount: selected.expected_credit_amount,
        exchange_url: selected.exchange_url,
        payto_uri: selected.payto_uri,
        wtid: selected.wtid
      }
    ]
  );
  confirm.onSuccess = () => {
    setSelected(void 0);
  };
  confirm.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Wire transfer already confirmed.`;
    }
  };
  let incoming;
  {
    const result = useInstanceIncomingTransfers(
      {
        position,
        payto_uri: form.payto_uri === "" ? void 0 : form.payto_uri
        // verified: form.verified,
        // confirmed: form.confirmed,
      },
      (id) => setPosition(id)
    );
    if (!result)
      return /* @__PURE__ */ h(Loading2, null);
    if (result instanceof TalerError) {
      return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
    }
    if (result.type === "fail") {
      switch (result.case) {
        case HttpStatusCode.Unauthorized: {
          return /* @__PURE__ */ h(LoginPage, null);
        }
        case HttpStatusCode.NotFound: {
          return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
        }
        default: {
          assertUnreachable(result);
        }
      }
    }
    incoming = result;
  }
  let confirmed;
  {
    const result = useInstanceConfirmedTransfers(
      {
        position,
        payto_uri: form.payto_uri === "" ? void 0 : form.payto_uri
        // expected: form.expected,
      },
      (id) => setPosition(id)
    );
    if (!result)
      return /* @__PURE__ */ h(Loading2, null);
    if (result instanceof TalerError) {
      return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
    }
    if (result.type === "fail") {
      switch (result.case) {
        case HttpStatusCode.Unauthorized: {
          return /* @__PURE__ */ h(LoginPage, null);
        }
        case HttpStatusCode.NotFound: {
          return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
        }
        default: {
          assertUnreachable(result);
        }
      }
    }
    confirmed = result;
  }
  const show = form.verified ? confirmed : incoming;
  return /* @__PURE__ */ h(p2, null, !selected ? void 0 : /* @__PURE__ */ h(
    ConfirmModal,
    {
      label: i18n2.str`I have received the wire transfer`,
      description: i18n2.str`Confirm the wire transfer`,
      active: true,
      onCancel: () => {
        setSelected(void 0);
      },
      confirm
    },
    /* @__PURE__ */ h("p", { style: { paddingTop: 0 } }, /* @__PURE__ */ h(i18n2.Translate, null, "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.")),
    /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", null, /* @__PURE__ */ h("tbody", null, /* @__PURE__ */ h(
      Row,
      {
        name: i18n2.str`Amount`,
        value: /* @__PURE__ */ h(Amount2, { value: selected.expected_credit_amount })
      }
    ), selected.execution_time && selected.execution_time.t_s !== "never" ? /* @__PURE__ */ h(
      Row,
      {
        name: i18n2.str`Time`,
        value: format2(
          selected.execution_time.t_s * 1e3,
          datetimeFormatForSettings(settings)
        )
      }
    ) : void 0, /* @__PURE__ */ h(
      Row,
      {
        name: i18n2.str`Transfer ID`,
        value: selected.wtid,
        literal: true
      }
    ))))
  ), /* @__PURE__ */ h(
    ListPage3,
    {
      accounts,
      transfers: confirmed.body,
      incomings: incoming.body,
      onSelectedToConfirm: (d6) => {
        setSelected(d6);
      },
      onLoadMoreBefore: show.loadFirst,
      onLoadMoreAfter: show.loadNext,
      onShowUnverified: () => setFilter(false),
      onShowVerified: () => setFilter(true),
      isVerifiedTransfers: form.verified,
      isNonVerifiedTransfers: !form.verified,
      payTo: form.payto_uri,
      onChangePayTo: (p4) => setForm((v3) => ({ ...v3, payto_uri: p4 }))
    }
  ));
}

// src/paths/instance/update/index.tsx
init_preact_module();
init_hooks_module();

// src/paths/instance/update/DeletePage.tsx
init_preact_module();
init_hooks_module();
function DeletePage({ instanceId, onBack, onDeleted }) {
  const [form, setValue] = p3({
    name: "",
    purge: false
  });
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logOut } = useSessionContext();
  const errors2 = undefinedIfEmpty2({
    name: !form.name ? i18n2.str`Required` : form.name !== instanceId ? i18n2.str`It's not the same.` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const text = i18n2.str`You are deleting the instance with ID "${instanceId}"`;
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const remove = safeFunctionHandler(
    (token, purge, challengeIds) => lib.instance.deleteCurrentInstance(token, {
      purge,
      challengeIds
    }),
    !session.token ? void 0 : [session.token, form.purge, []]
  );
  remove.onSuccess = onDeleted;
  remove.onFail = (fail, t5, p4) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(
          fail.body,
          remove.lambda((ids) => [t5, p4, ids])
        );
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  if (mfa.pendingChallenge && mfa.repeatCall) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: mfa.repeatCall,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, text)))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(FormProvider, { errors: errors2, object: form, valueHandler: setValue }, /* @__PURE__ */ h(
    Input,
    {
      name: "name",
      label: i18n2.str`Instance`,
      placeholder: instanceId,
      help: i18n2.str`Write the instance name to confirm the deletion`
    }
  ), /* @__PURE__ */ h(
    InputToggle,
    {
      name: "purge",
      label: i18n2.str`Purge`,
      tooltip: i18n2.str`All the data will be fully deleted, otherwise only the access will be removed.`
    }
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("a", { class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      class: "button is-small is-danger",
      type: "submit",
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      onClick: remove
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "DELETE")
  )))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
function convert2(from2) {
  const {
    default_pay_delay,
    default_wire_transfer_delay,
    default_refund_delay,
    ...rest
  } = from2;
  const defaults2 = {
    use_stefan: false,
    default_pay_delay: Duration.fromTalerProtocolDuration(default_pay_delay),
    default_refund_delay: Duration.fromTalerProtocolDuration(default_refund_delay),
    default_wire_transfer_delay: Duration.fromTalerProtocolDuration(
      default_wire_transfer_delay
    )
  };
  return { ...defaults2, ...rest };
}
function UpdatePage7({
  doUpdate,
  onConfirm,
  selected,
  onBack
}) {
  const { state } = useSessionContext();
  const [value, valueHandler] = p3(convert2(selected));
  const { i18n: i18n2 } = useTranslationContext();
  const errors2 = undefinedIfEmpty2({
    name: !value.name ? i18n2.str`Required` : void 0,
    default_pay_delay: !value.default_pay_delay ? i18n2.str`Required` : !!value.default_wire_transfer_delay && value.default_wire_transfer_delay.d_ms !== "forever" && value.default_pay_delay.d_ms !== "forever" && value.default_pay_delay.d_ms > value.default_wire_transfer_delay.d_ms ? i18n2.str`Pay delay can't be greater than wire transfer delay` : void 0,
    default_wire_transfer_delay: !value.default_wire_transfer_delay ? i18n2.str`Required` : void 0,
    address: undefinedIfEmpty2({
      address_lines: value.address?.address_lines && value.address?.address_lines.length > 7 ? i18n2.str`Max 7 lines` : void 0
    }),
    jurisdiction: undefinedIfEmpty2({
      address_lines: value.address?.address_lines && value.address?.address_lines.length > 7 ? i18n2.str`Max 7 lines` : void 0
    })
  });
  const hasErrors = errors2 !== void 0;
  const {
    default_pay_delay,
    default_wire_transfer_delay,
    default_refund_delay,
    ...rest
  } = value;
  const result = {
    default_pay_delay: Duration.toTalerProtocolDuration(default_pay_delay),
    default_refund_delay: Duration.toTalerProtocolDuration(default_refund_delay),
    default_wire_transfer_delay: Duration.toTalerProtocolDuration(
      default_wire_transfer_delay
    ),
    ...rest
  };
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const update = safeFunctionHandler(
    (token, d6, challengeIds) => doUpdate(token, d6, { challengeIds }),
    hasErrors || !state.token ? void 0 : [state.token, result, []]
  );
  update.onSuccess = onConfirm;
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Instance not found.`;
    }
  };
  const retry = update.lambda((challengesIds) => [
    update.args[0],
    update.args[1],
    challengesIds
  ]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, /* @__PURE__ */ h(i18n2.Translate, null, "Instance id"), ":", " ", /* @__PURE__ */ h("b", null, state.instance))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      errors: errors2,
      object: value,
      valueHandler
    },
    /* @__PURE__ */ h(DefaultInstanceFormFields, { showId: false })
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-4" }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button",
      onClick: onBack,
      "data-tooltip": "cancel operation"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")
  ), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      type: "submit",
      onClick: update,
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}

// src/paths/instance/update/index.tsx
function Update2(props) {
  const { lib } = useSessionContext();
  const updateInstance = lib.instance.updateCurrentInstance.bind(lib.instance);
  const result = useInstanceDetails();
  return CommonUpdate(props, result, updateInstance);
}
function AdminUpdate(props) {
  const { lib } = useSessionContext();
  const t5 = lib.subInstanceApi(props.instanceId).instance;
  const updateInstance = t5.updateCurrentInstance.bind(t5);
  const result = useManagedInstanceDetails(props.instanceId);
  return CommonUpdate(props, result, updateInstance);
}
function CommonUpdate({ onBack, onConfirm }, result, updateInstance) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state } = useSessionContext();
  const [deleting, setDeleting] = p3();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage7,
    {
      onBack,
      isLoading: false,
      selected: result.body,
      doUpdate: updateInstance,
      onConfirm
    }
  ), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button ",
      onClick: () => {
        setDeleting(true);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Delete this instance")
  ), !deleting ? void 0 : /* @__PURE__ */ h(DeletePage, { instanceId: state.instance, onDeleted: () => {
  } })), /* @__PURE__ */ h("div", { class: "column" })));
}

// src/paths/instance/webhooks/create/index.tsx
init_preact_module();

// src/paths/instance/webhooks/create/CreatePage.tsx
init_preact_module();
init_hooks_module();
var validType = [
  "pay",
  "refund",
  "order_settled",
  "category_added",
  "category_updated",
  "category_deleted",
  "inventory_added",
  "inventory_updated",
  "inventory_deleted"
];
var validMethod = ["GET", "POST", "PUT", "PATCH", "HEAD"];
function CreatePage10({ onCreate, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const [state, setState] = p3({});
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const { state: session, lib } = useSessionContext();
  const errors2 = undefinedIfEmpty2({
    webhook_id: !state.webhook_id ? i18n2.str`Required` : void 0,
    event_type: !state.event_type ? i18n2.str`Required` : (
      // @ts-ignore checking if event type is on the valid list
      validType.indexOf(state.event_type) === -1 ? i18n2.str`Must be one of '${validType.join(", ")}'` : void 0
    ),
    http_method: !state.http_method ? i18n2.str`Required` : validMethod.indexOf(state.http_method) === -1 ? i18n2.str`Must be one of '${validMethod.join(", ")}'` : void 0,
    url: !state.url ? i18n2.str`Required` : isInvalidUrl2(state.url) ? i18n2.str`URL is invalid` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const data = state;
  const create = safeFunctionHandler(
    lib.instance.addWebhook.bind(lib.instance),
    !session.token || hasErrors ? void 0 : [session.token, data]
  );
  create.onSuccess = onCreate;
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      Input,
      {
        name: "webhook_id",
        label: i18n2.str`ID`,
        tooltip: i18n2.str`Webhook ID to use`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "event_type",
        label: i18n2.str`Event`,
        values: ["choose", ...validType],
        toStr: (v3) => {
          const idx = validType.indexOf(v3);
          if (idx === -1)
            return i18n2.str`Choose one...`;
          const d6 = validType[idx];
          switch (d6) {
            case "pay":
              return i18n2.str`Payment`;
            case "refund":
              return i18n2.str`Refund`;
            case "order_settled":
              return i18n2.str`Order settled`;
            case "category_added":
              return i18n2.str`Category added`;
            case "category_updated":
              return i18n2.str`Category updated`;
            case "category_deleted":
              return i18n2.str`Category deleted`;
            case "inventory_added":
              return i18n2.str`Inventory added`;
            case "inventory_updated":
              return i18n2.str`Inventory updated`;
            case "inventory_deleted":
              return i18n2.str`Inventory deleted`;
            default: {
              assertUnreachable(d6);
            }
          }
        },
        tooltip: i18n2.str`The event of the webhook: why the webhook is used`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "http_method",
        label: i18n2.str`Method`,
        toStr: (v3) => {
          const idx = validMethod.indexOf(v3);
          if (idx === -1)
            return i18n2.str`Choose one...`;
          return [
            i18n2.str`GET`,
            i18n2.str`POST`,
            i18n2.str`PUT`,
            i18n2.str`PATCH`,
            i18n2.str`HEAD`
          ][idx];
        },
        values: ["choose", ...validMethod],
        tooltip: i18n2.str`Method used by the webhook`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "url",
        label: i18n2.str`URL`,
        tooltip: i18n2.str`URL of the webhook where the customer will be redirected`
      }
    ),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "The text below supports the ", /* @__PURE__ */ h(
      "a",
      {
        target: "_blank",
        rel: "noreferrer",
        href: "https://mustache.github.io/mustache.5.html"
      },
      "mustache"
    ), " template engine. Any string between ", /* @__PURE__ */ h("pre", { style: { display: "inline", padding: 0 } }, "{{"), " and ", /* @__PURE__ */ h("pre", { style: { display: "inline", padding: 0 } }, "}}"), " will be replaced with the value of the corresponding variable.")),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "For example, ", /* @__PURE__ */ h("pre", { style: { display: "inline", padding: 0 } }, "{{contract_terms.amount}}"), " will be replaced with the the order's price.")),
    /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "The short list of variables are:")),
    /* @__PURE__ */ h("div", { class: "menu" }, /* @__PURE__ */ h(
      "ul",
      {
        class: "menu-list",
        style: { listStyleType: "disc", marginLeft: 20 }
      },
      /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "contract_terms.summary:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "order's description")),
      /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "contract_terms.amount:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "order's price")),
      /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "order_id:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "order's unique identification")),
      state.event_type === "refund" && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "refund_amout:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "the amount that was being refunded")), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "reason:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "the reason entered by the merchant staff for granting the refund")), /* @__PURE__ */ h("li", null, /* @__PURE__ */ h("b", null, "timestamp:"), " ", /* @__PURE__ */ h(i18n2.Translate, null, "time of the refund in nanoseconds since 1970")))
    )),
    /* @__PURE__ */ h(
      Input,
      {
        name: "header_template",
        label: i18n2.str`Http header`,
        inputType: "multiline",
        tooltip: i18n2.str`Header template of the webhook`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "body_template",
        inputType: "multiline",
        label: i18n2.str`Http body`,
        tooltip: i18n2.str`Body template used by the webhook.`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      type: "submit",
      onClick: create
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  ))), /* @__PURE__ */ h("div", { class: "column" }))));
}
function isInvalidUrl2(url) {
  try {
    const asd = new URL("./", url);
    return false;
  } catch (e5) {
    return true;
  }
}

// src/paths/instance/webhooks/create/index.tsx
function CreateWebhook({ onConfirm, onBack }) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(CreatePage10, { onBack, onCreate: onConfirm }));
}

// src/paths/instance/webhooks/list/index.tsx
init_preact_module();

// src/hooks/webhooks.ts
var useSWR12 = useSWR;
function revalidateInstanceWebhooks() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "listWebhooks",
    void 0,
    { revalidate: true }
  );
}
function useInstanceWebhooks() {
  const { state, lib } = useSessionContext();
  async function fetcher([token, _bid]) {
    return await lib.instance.listWebhooks(token, {
      // limit: PAGINATED_LIST_REQUEST,
      // offset: bid,
      // order: "dec",
    });
  }
  const { data, error: error2 } = useSWR12([state.token, "offset", "listWebhooks"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function revalidateWebhookDetails() {
  return mutate(
    (key) => Array.isArray(key) && key[key.length - 1] === "getWebhookDetails",
    void 0,
    { revalidate: true }
  );
}
function useWebhookDetails(webhookId) {
  const { state, lib } = useSessionContext();
  async function fetcher([hookId, token]) {
    return await lib.instance.getWebhookDetails(token, hookId);
  }
  const { data, error: error2 } = useSWR12([webhookId, state.token, "getWebhookDetails"], fetcher);
  if (data)
    return data;
  if (error2)
    return error2;
  return void 0;
}

// src/paths/instance/webhooks/list/ListPage.tsx
init_preact_module();

// src/paths/instance/webhooks/list/Table.tsx
init_preact_module();
init_hooks_module();
function CardTable10({
  webhooks,
  onCreate,
  onSelect,
  onLoadMoreAfter,
  onLoadMoreBefore
}) {
  const [rowSelection, rowSelectionHandler] = p3([]);
  const { i18n: i18n2 } = useTranslationContext();
  const { state, lib } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const deleteWebhook = safeFunctionHandler(
    lib.instance.deleteWebhook.bind(lib.instance)
  );
  deleteWebhook.onSuccess = () => i18n2.str`Webhook deleted successfully`;
  deleteWebhook.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
    }
  };
  const deleteById = deleteWebhook.lambda(
    (id) => !state.token ? void 0 : [state.token, id]
  );
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-webhook" })), /* @__PURE__ */ h(i18n2.Translate, null, "Webhooks")), /* @__PURE__ */ h("div", { class: "card-header-icon", "aria-label": "more options" }, /* @__PURE__ */ h(
    "span",
    {
      class: "has-tooltip-left",
      "data-tooltip": i18n2.str`Add new webhooks`
    },
    /* @__PURE__ */ h(
      "button",
      {
        class: "button is-info",
        type: "button",
        onClick: onCreate,
        accessKey: "+"
      },
      /* @__PURE__ */ h("span", { class: "icon is-small" }, /* @__PURE__ */ h("i", { class: "mdi mdi-plus mdi-36px" }))
    )
  ))), /* @__PURE__ */ h("div", { class: "card-content" }, /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, webhooks.length > 0 ? /* @__PURE__ */ h(
    Table11,
    {
      instances: webhooks,
      deleteWebhook: deleteById,
      onSelect,
      rowSelection,
      rowSelectionHandler,
      onLoadMoreAfter,
      onLoadMoreBefore
    }
  ) : /* @__PURE__ */ h(EmptyTable13, null))))));
}
function Table11({
  instances: instances2,
  onLoadMoreAfter,
  deleteWebhook,
  onSelect,
  onLoadMoreBefore
}) {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "table-container" }, onLoadMoreBefore && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more webhooks before the first one`,
      onClick: onLoadMoreBefore
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load first page")
  ), /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "ID")), /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Event type")), /* @__PURE__ */ h("th", null))), /* @__PURE__ */ h("tbody", null, instances2.map((i5) => {
    return /* @__PURE__ */ h("tr", { key: i5.webhook_id }, /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.webhook_id
    ), /* @__PURE__ */ h(
      "td",
      {
        onClick: () => onSelect(i5),
        style: { cursor: "pointer" }
      },
      i5.event_type
    ), /* @__PURE__ */ h("td", { class: "is-actions-cell right-sticky" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
      ButtonBetterBulma,
      {
        class: "button is-danger is-small has-tooltip-left",
        "data-tooltip": i18n2.str`Delete selected webhook from the database`,
        onClick: deleteWebhook.withArgs(i5.webhook_id)
      },
      /* @__PURE__ */ h(i18n2.Translate, null, "Delete")
    ))));
  }))), onLoadMoreAfter && /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      class: "button is-fullwidth",
      "data-tooltip": i18n2.str`Load more webhooks after the last one`,
      onClick: onLoadMoreAfter
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Load next page")
  ));
}
function EmptyTable13() {
  const { i18n: i18n2 } = useTranslationContext();
  return /* @__PURE__ */ h("div", { class: "content has-text-grey has-text-centered" }, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h("span", { class: "icon is-large" }, /* @__PURE__ */ h("i", { class: "mdi mdi-magnify mdi-48px" }))), /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "There are no webhooks to list yet, add more by pressing the + sign")));
}

// src/paths/instance/webhooks/list/ListPage.tsx
function ListPage4({
  webhooks,
  onCreate,
  onSelect,
  onLoadMoreBefore,
  onLoadMoreAfter
}) {
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h(
    CardTable10,
    {
      webhooks: webhooks.map((o3) => ({
        ...o3,
        id: String(o3.webhook_id)
      })),
      onCreate,
      onSelect,
      onLoadMoreBefore,
      onLoadMoreAfter
    }
  ));
}

// src/paths/instance/webhooks/list/index.tsx
function ListWebhooks({ onCreate, onSelect }) {
  const result = useInstanceWebhooks();
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    ListPage4,
    {
      webhooks: result.body.webhooks,
      onLoadMoreBefore: void 0,
      onLoadMoreAfter: void 0,
      onCreate,
      onSelect: (e5) => {
        onSelect(e5.webhook_id);
      }
    }
  ));
}

// src/paths/instance/webhooks/update/index.tsx
init_preact_module();

// src/paths/instance/webhooks/update/UpdatePage.tsx
init_preact_module();
init_hooks_module();
var validType2 = [
  "pay",
  "refund",
  "order_settled",
  "category_added",
  "category_updated",
  "category_deleted",
  "inventory_added",
  "inventory_updated",
  "inventory_deleted"
];
var validMethod2 = ["GET", "POST", "PUT", "PATCH", "HEAD"];
function UpdatePage8({ webhook, onConfirm, onBack }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn } = useSessionContext();
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const [state, setState] = p3(webhook);
  const errors2 = undefinedIfEmpty2({
    event_type: !state.event_type ? i18n2.str`Required` : (
      // @ts-ignore checking if event type is on the valid list
      validType2.indexOf(state.event_type) === -1 ? i18n2.str`Must be one of '${validType2.join(", ")}'` : void 0
    ),
    http_method: !state.http_method ? i18n2.str`Required` : validMethod2.indexOf(state.http_method) === -1 ? i18n2.str`Must be one of '${validMethod2.join(", ")}'` : void 0,
    url: !state.url ? i18n2.str`Required` : isInvalidUrl3(state.url) ? i18n2.str`URL is invalid` : void 0
  });
  const hasErrors = errors2 !== void 0;
  const data = state;
  const update = safeFunctionHandler(
    lib.instance.updateWebhook.bind(lib.instance),
    !session.token || !!errors2 ? void 0 : [session.token, webhook.id, data]
  );
  update.onSuccess = (success) => {
    onConfirm();
    return i18n2.str`Webhook updated`;
  };
  update.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      case HttpStatusCode.Conflict:
        return i18n2.str`Conflict.`;
    }
  };
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("section", { class: "section" }, /* @__PURE__ */ h("section", { class: "hero is-hero-bar" }, /* @__PURE__ */ h("div", { class: "hero-body" }, /* @__PURE__ */ h("div", { class: "level" }, /* @__PURE__ */ h("div", { class: "level-left" }, /* @__PURE__ */ h("div", { class: "level-item" }, /* @__PURE__ */ h("span", { class: "is-size-4" }, "Webhook: ", /* @__PURE__ */ h("b", null, webhook.id))))))), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: state,
      valueHandler: setState,
      errors: errors2
    },
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "event_type",
        label: i18n2.str`Event`,
        values: ["choose", ...validType2],
        toStr: (v3) => {
          const idx = validType2.indexOf(v3);
          if (idx === -1)
            return i18n2.str`Choose one...`;
          const d6 = validType2[idx];
          switch (d6) {
            case "pay":
              return i18n2.str`Payment`;
            case "refund":
              return i18n2.str`Refund`;
            case "order_settled":
              return i18n2.str`Order settled`;
            case "category_added":
              return i18n2.str`Category added`;
            case "category_updated":
              return i18n2.str`Category updated`;
            case "category_deleted":
              return i18n2.str`Category deleted`;
            case "inventory_added":
              return i18n2.str`Inventory added`;
            case "inventory_updated":
              return i18n2.str`Inventory updated`;
            case "inventory_deleted":
              return i18n2.str`Inventory deleted`;
            default: {
              assertUnreachable(d6);
            }
          }
        },
        tooltip: i18n2.str`The event of the webhook: why the webhook is used`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "http_method",
        label: i18n2.str`Method`,
        toStr: (v3) => {
          const idx = validMethod2.indexOf(v3);
          if (idx === -1)
            return i18n2.str`Choose one...`;
          return [
            i18n2.str`GET`,
            i18n2.str`POST`,
            i18n2.str`PUT`,
            i18n2.str`PATCH`,
            i18n2.str`HEAD`
          ][idx];
        },
        values: ["choose", ...validMethod2],
        tooltip: i18n2.str`Method used by the webhook`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "url",
        label: i18n2.str`URL`,
        tooltip: i18n2.str`URL of the webhook where the customer will be redirected`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "header_template",
        label: i18n2.str`Header`,
        inputType: "multiline",
        tooltip: i18n2.str`Header template of the webhook`
      }
    ),
    /* @__PURE__ */ h(
      Input,
      {
        name: "body_template",
        inputType: "multiline",
        label: i18n2.str`Body`,
        tooltip: i18n2.str`Body template used by the webhook`
      }
    )
  ), /* @__PURE__ */ h("div", { class: "buttons is-right mt-5" }, onBack && /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onBack }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")), /* @__PURE__ */ h(
    ButtonBetterBulma,
    {
      "data-tooltip": hasErrors ? i18n2.str`Please complete the marked fields` : i18n2.str`Confirm operation`,
      onClick: update,
      type: "submit"
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Confirm")
  )))))));
}
function isInvalidUrl3(url) {
  try {
    const asd = new URL("./", url);
    return false;
  } catch (e5) {
    return true;
  }
}

// src/paths/instance/webhooks/update/index.tsx
function UpdateWebhook({
  tid,
  onConfirm,
  onBack
}) {
  const result = useWebhookDetails(tid);
  if (!result)
    return /* @__PURE__ */ h(Loading2, null);
  if (result instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: result });
  }
  if (result.type === "fail") {
    switch (result.case) {
      case HttpStatusCode.NotFound: {
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      }
      case HttpStatusCode.Unauthorized: {
        return /* @__PURE__ */ h(LoginPage, null);
      }
      default: {
        assertUnreachable(result);
      }
    }
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    UpdatePage8,
    {
      webhook: { ...result.body, id: tid },
      onBack,
      onConfirm
    }
  ));
}

// src/paths/newAccount/index.tsx
init_preact_module();
init_hooks_module();
var twoHours2 = Duration.fromSpec({ hours: 2 });
var oneDay2 = Duration.fromSpec({ days: 1 });
var twoDays2 = Duration.fromSpec({ days: 2 });
function NewAccount({ onCancel, onCreated }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn, config } = useSessionContext();
  const [value, setValue] = p3({});
  const serverRequiresEmail = config.mandatory_tan_channels?.indexOf(TanChannel.EMAIL) !== -1;
  const serverRequiresSms = config.mandatory_tan_channels?.indexOf(TanChannel.SMS) !== -1;
  const errors2 = undefinedIfEmpty({
    id: !value.id ? i18n2.str`Required` : !INSTANCE_ID_REGEX.test(value.id) ? i18n2.str`Invalid` : void 0,
    name: !value.name ? i18n2.str`Required` : void 0,
    password: !value.password ? i18n2.str`Required` : void 0,
    repeat: !value.repeat ? i18n2.str`Required` : value.password !== value.repeat ? i18n2.str`Doesn't match` : void 0,
    email: !serverRequiresEmail ? void 0 : !value.email ? i18n2.str`Required` : !EMAIL_REGEX.test(value.email) ? i18n2.str`Doesn't have the pattern of an email` : void 0,
    phone: !serverRequiresSms ? void 0 : !value.phone ? i18n2.str`Required` : !value.phone.startsWith("+") ? i18n2.str`Should start with +` : !PHONE_JUST_NUMBERS_REGEX.test(value.phone) ? i18n2.str`A phone number consists of numbers only` : void 0,
    tos: !value.tos ? i18n2.str`Required` : void 0
  });
  function valueHandler(s6) {
    const next = s6(value);
    const v3 = {
      id: next.id ?? "",
      name: next.name ?? "",
      password: next.password ?? "",
      repeat: next.repeat ?? "",
      email: next.email ?? "",
      phone: next.phone ?? "",
      tos: next.tos ?? false
    };
    setValue(v3);
  }
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const request = {
    address: {},
    auth: {
      method: MerchantAuthMethod.TOKEN,
      password: value.password
    },
    default_pay_delay: config.default_pay_delay ?? Duration.toTalerProtocolDuration(twoHours2),
    default_wire_transfer_delay: config.default_wire_transfer_delay ?? Duration.toTalerProtocolDuration(oneDay2),
    default_refund_delay: config.default_refund_delay ?? Duration.toTalerProtocolDuration(twoDays2),
    id: value.id,
    jurisdiction: {},
    name: value.name,
    use_stefan: true,
    email: value.email,
    phone_number: value.phone
  };
  const create = safeFunctionHandler(
    (req, challengeIds) => lib.instance.createInstanceSelfProvision(req, {
      challengeIds,
      tokenValidity: Duration.fromSpec({ months: 6 })
    }),
    !!errors2 ? void 0 : [request, []]
  );
  create.onSuccess = (success, req) => {
    if (success) {
      logIn(req.id, success.access_token);
    }
    onCreated();
  };
  create.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized`;
      case HttpStatusCode.Conflict:
        return i18n2.str`There is another instance with this username.`;
    }
  };
  const retry = create.lambda((ids) => [create.args[0], ids]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "columns is-centered", style: { margin: "auto" } }, /* @__PURE__ */ h("div", { class: "column is-two-thirds " }, /* @__PURE__ */ h("div", { class: "modal-card", style: { width: "100%", margin: 0 } }, /* @__PURE__ */ h(
    "header",
    {
      class: "modal-card-head",
      style: { border: "1px solid", borderBottom: 0 }
    },
    /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h(i18n2.Translate, null, "Self provision"))
  ), /* @__PURE__ */ h(
    "section",
    {
      class: "modal-card-body",
      style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
    },
    /* @__PURE__ */ h(
      FormProvider,
      {
        name: "settings",
        errors: errors2,
        object: value,
        valueHandler
      },
      /* @__PURE__ */ h(
        InputWithAddon,
        {
          name: "id",
          label: i18n2.str`Username`,
          tooltip: i18n2.str`Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.`
        }
      ),
      /* @__PURE__ */ h(
        Input,
        {
          name: "name",
          label: i18n2.str`Business name`,
          tooltip: i18n2.str`Legal name of the business represented by this instance.`
        }
      ),
      /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`New password`,
          tooltip: i18n2.str`Next password to be used`,
          inputType: "password",
          name: "password"
        }
      ),
      /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Repeat password`,
          tooltip: i18n2.str`Confirm the same password`,
          inputType: "password",
          name: "repeat"
        }
      ),
      serverRequiresEmail ? /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Email`,
          tooltip: i18n2.str`Contact email`,
          name: "email"
        }
      ) : void 0,
      serverRequiresSms ? /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Phone`,
          tooltip: i18n2.str`Contact phone number`,
          name: "phone"
        }
      ) : void 0,
      /* @__PURE__ */ h(
        InputToggle,
        {
          label: i18n2.str`I agree`,
          name: "tos",
          help: /* @__PURE__ */ h(i18n2.Translate, null, /* @__PURE__ */ h(
            "a",
            {
              href: "/terms",
              target: "_blank",
              referrerpolicy: "no-referrer"
            },
            /* @__PURE__ */ h(i18n2.Translate, null, "Terms of service")
          )),
          tooltip: i18n2.str`You must accept the Terms of service to continue.`
        }
      )
    )
  ), /* @__PURE__ */ h(
    "footer",
    {
      class: "modal-card-foot ",
      style: {
        justifyContent: "space-between",
        border: "1px solid",
        borderTop: 0
      }
    },
    /* @__PURE__ */ h("button", { class: "button", type: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")),
    /* @__PURE__ */ h(ButtonBetterBulma, { onClick: create, type: "submit" }, /* @__PURE__ */ h(i18n2.Translate, null, "Create"))
  )))));
}

// src/paths/resetAccount/index.tsx
init_preact_module();
init_hooks_module();
function ResetAccount({
  onCancel,
  onReseted,
  id: instanceId
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const { state: session, lib, logIn } = useSessionContext();
  const [value, setValue] = p3({
    // password: "asd",
    // repeat: "asd",
  });
  const errors2 = {
    password: !value.password ? i18n2.str`Required` : void 0,
    repeat: !value.repeat ? i18n2.str`Required` : value.password !== value.repeat ? i18n2.str`Doesn't match` : void 0
  };
  function valueHandler(s6) {
    const next = s6(value);
    const v3 = {
      password: next.password ?? "",
      repeat: next.repeat ?? ""
    };
    setValue(v3);
  }
  const [notification, safeFunctionHandler] = useLocalNotificationBetter();
  const mfa = useChallengeHandler();
  const reset = safeFunctionHandler(
    async (password, challengeIds) => {
      const forgot = await lib.subInstanceApi(instanceId).instance.forgotPasswordSelfProvision(
        { method: MerchantAuthMethod.TOKEN, password },
        { challengeIds }
      );
      if (forgot.type === "fail") {
        return forgot;
      }
      const login = await lib.instance.createAccessToken(
        instanceId,
        value.password,
        FOREVER_REFRESHABLE_TOKEN(i18n2.str`Password reset`)
      );
      if (login.type === "fail")
        return login;
      return opFixedSuccess(login.body);
    }
  );
  reset.onSuccess = (suc) => {
    logIn(instanceId, suc.access_token);
    onReseted();
  };
  reset.onFail = (fail) => {
    switch (fail.case) {
      case HttpStatusCode.Accepted:
        mfa.onChallengeRequired(fail.body);
        return void 0;
      case HttpStatusCode.Unauthorized:
        return i18n2.str`Unauthorized.`;
      case HttpStatusCode.Forbidden:
        return i18n2.str`Forbidden.`;
      case HttpStatusCode.NotFound:
        return i18n2.str`Not found.`;
      default:
        assertUnreachable(fail);
    }
  };
  const retry = reset.lambda((ids) => [reset.args[0], ids]);
  if (mfa.pendingChallenge) {
    return /* @__PURE__ */ h(
      SolveMFAChallenges,
      {
        currentChallenge: mfa.pendingChallenge,
        onCompleted: retry,
        onCancel: mfa.doCancelChallenge
      }
    );
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(LocalNotificationBannerBulma, { notification }), /* @__PURE__ */ h("div", { class: "columns is-centered", style: { margin: "auto" } }, /* @__PURE__ */ h("div", { class: "column is-two-thirds " }, /* @__PURE__ */ h("div", { class: "modal-card", style: { width: "100%", margin: 0 } }, /* @__PURE__ */ h(
    "header",
    {
      class: "modal-card-head",
      style: { border: "1px solid", borderBottom: 0 }
    },
    /* @__PURE__ */ h("p", { class: "modal-card-title" }, /* @__PURE__ */ h(i18n2.Translate, null, 'Resetting access to the instance "', instanceId, '"'))
  ), /* @__PURE__ */ h(
    "section",
    {
      class: "modal-card-body",
      style: { border: "1px solid", borderTop: 0, borderBottom: 0 }
    },
    /* @__PURE__ */ h(
      FormProvider,
      {
        name: "settings",
        errors: errors2,
        object: value,
        valueHandler
      },
      /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`New password`,
          inputType: "password",
          name: "password"
        }
      ),
      /* @__PURE__ */ h(
        Input,
        {
          label: i18n2.str`Repeat password`,
          inputType: "password",
          name: "repeat"
        }
      )
    )
  ), /* @__PURE__ */ h(
    "footer",
    {
      class: "modal-card-foot ",
      style: {
        justifyContent: "space-between",
        border: "1px solid",
        borderTop: 0
      }
    },
    /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onCancel }, /* @__PURE__ */ h(i18n2.Translate, null, "Cancel")),
    /* @__PURE__ */ h(ButtonBetterBulma, { type: "submit", onClick: reset }, /* @__PURE__ */ h(i18n2.Translate, null, "Reset"))
  )))));
}

// src/paths/settings/index.tsx
init_preact_module();
function Settings({ onClose }) {
  const { i18n: i18n2 } = useTranslationContext();
  const { config } = useSessionContext();
  const [value, , updateValue] = usePreference();
  const [{ showDebugInfo }, updateCommonPref] = useCommonPreferences();
  const errors2 = {};
  const formValue = {
    ...value,
    persona: value.persona ?? config.default_persona
  };
  function valueHandler(s6) {
    const next = s6(formValue);
    const v3 = {
      hideMissingAccountUntil: next.hideMissingAccountUntil ?? AbsoluteTime.never(),
      hideKycUntil: next.hideKycUntil ?? AbsoluteTime.never(),
      dateFormat: next.dateFormat ?? "ymd",
      persona: next.persona ?? config.default_persona
    };
    const isDeveloper = next.persona === "developer";
    if (isDeveloper !== showDebugInfo) {
      updateCommonPref("showDebugInfo", isDeveloper);
    }
    updateValue(v3);
  }
  return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }), /* @__PURE__ */ h("div", { class: "column is-four-fifths" }, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    FormProvider,
    {
      name: "settings",
      errors: errors2,
      object: formValue,
      valueHandler
    },
    /* @__PURE__ */ h("div", { class: "field is-horizontal" }, /* @__PURE__ */ h("div", { class: "field-label is-normal" }, /* @__PURE__ */ h("label", { class: "label" }, /* @__PURE__ */ h(i18n2.Translate, null, "Language"), /* @__PURE__ */ h(
      "span",
      {
        class: "icon has-tooltip-right",
        "data-tooltip": "Force language setting instance of taking the browser"
      },
      /* @__PURE__ */ h("i", { class: "mdi mdi-information" })
    ))), /* @__PURE__ */ h("div", { class: "field field-body has-addons is-flex-grow-3" }, /* @__PURE__ */ h(LangSelector, null))),
    /* @__PURE__ */ h(
      InputSelector,
      {
        name: "dateFormat",
        label: i18n2.str`Date format`,
        expand: true,
        help: formValue.dateFormat === "dmy" ? "31/12/2001" : formValue.dateFormat === "mdy" ? "12/31/2001" : formValue.dateFormat === "ymd" ? "2001/12/31" : "",
        toStr: (e5) => {
          if (e5 === "ymd")
            return "year month day";
          if (e5 === "mdy")
            return "month day year";
          if (e5 === "dmy")
            return "day month year";
          return "choose one";
        },
        values: ["ymd", "mdy", "dmy"],
        tooltip: i18n2.str`How the date is going to be displayed`
      }
    ),
    /* @__PURE__ */ h(
      InputSelector,
      {
        label: i18n2.str`Merchant type`,
        tooltip: i18n2.str`Simplify UI based on the user usage.`,
        name: "persona",
        values: [
          "digital-publishing",
          "e-commerce",
          "offline-vending-machine",
          "point-of-sale",
          "expert",
          "developer"
        ],
        toStr: (e5) => {
          switch (e5) {
            case "expert":
              return i18n2.str`Expert user`;
            case "developer":
              return i18n2.str`Taler developer`;
            case "offline-vending-machine":
              return i18n2.str`Unattended in-person offline vending`;
            case "point-of-sale":
              return i18n2.str`In-person online point-of-sale with inventory`;
            case "digital-publishing":
              return i18n2.str`Digital publishing`;
            case "e-commerce":
              return i18n2.str`E-commerce site`;
          }
        }
      }
    )
  )), value.persona === "developer" ? /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        message: i18n2.str`Developer mode`,
        description: i18n2.str`Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.`,
        type: "WARN"
      }
    }
  ) : void 0), /* @__PURE__ */ h("div", { class: "column" }))), onClose && /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("button", { type: "button", class: "button", onClick: onClose }, /* @__PURE__ */ h(i18n2.Translate, null, "Close"))));
}

// src/paths/instance/statistics/list/index.tsx
init_preact_module();
init_hooks_module();

// ../../node_modules/.pnpm/@kurkle+color@0.3.4/node_modules/@kurkle/color/dist/color.esm.js
function round(v3) {
  return v3 + 0.5 | 0;
}
var lim = (v3, l3, h5) => Math.max(Math.min(v3, h5), l3);
function p2b(v3) {
  return lim(round(v3 * 2.55), 0, 255);
}
function n2b(v3) {
  return lim(round(v3 * 255), 0, 255);
}
function b2n(v3) {
  return lim(round(v3 / 2.55) / 100, 0, 1);
}
function n2p(v3) {
  return lim(round(v3 * 100), 0, 100);
}
var map$1 = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };
var hex = [..."0123456789ABCDEF"];
var h1 = (b5) => hex[b5 & 15];
var h22 = (b5) => hex[(b5 & 240) >> 4] + hex[b5 & 15];
var eq = (b5) => (b5 & 240) >> 4 === (b5 & 15);
var isShort = (v3) => eq(v3.r) && eq(v3.g) && eq(v3.b) && eq(v3.a);
function hexParse(str) {
  var len = str.length;
  var ret;
  if (str[0] === "#") {
    if (len === 4 || len === 5) {
      ret = {
        r: 255 & map$1[str[1]] * 17,
        g: 255 & map$1[str[2]] * 17,
        b: 255 & map$1[str[3]] * 17,
        a: len === 5 ? map$1[str[4]] * 17 : 255
      };
    } else if (len === 7 || len === 9) {
      ret = {
        r: map$1[str[1]] << 4 | map$1[str[2]],
        g: map$1[str[3]] << 4 | map$1[str[4]],
        b: map$1[str[5]] << 4 | map$1[str[6]],
        a: len === 9 ? map$1[str[7]] << 4 | map$1[str[8]] : 255
      };
    }
  }
  return ret;
}
var alpha = (a6, f3) => a6 < 255 ? f3(a6) : "";
function hexString(v3) {
  var f3 = isShort(v3) ? h1 : h22;
  return v3 ? "#" + f3(v3.r) + f3(v3.g) + f3(v3.b) + alpha(v3.a, f3) : void 0;
}
var HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
function hsl2rgbn(h5, s6, l3) {
  const a6 = s6 * Math.min(l3, 1 - l3);
  const f3 = (n2, k6 = (n2 + h5 / 30) % 12) => l3 - a6 * Math.max(Math.min(k6 - 3, 9 - k6, 1), -1);
  return [f3(0), f3(8), f3(4)];
}
function hsv2rgbn(h5, s6, v3) {
  const f3 = (n2, k6 = (n2 + h5 / 60) % 6) => v3 - v3 * s6 * Math.max(Math.min(k6, 4 - k6, 1), 0);
  return [f3(5), f3(3), f3(1)];
}
function hwb2rgbn(h5, w6, b5) {
  const rgb = hsl2rgbn(h5, 1, 0.5);
  let i5;
  if (w6 + b5 > 1) {
    i5 = 1 / (w6 + b5);
    w6 *= i5;
    b5 *= i5;
  }
  for (i5 = 0; i5 < 3; i5++) {
    rgb[i5] *= 1 - w6 - b5;
    rgb[i5] += w6;
  }
  return rgb;
}
function hueValue(r3, g4, b5, d6, max) {
  if (r3 === max) {
    return (g4 - b5) / d6 + (g4 < b5 ? 6 : 0);
  }
  if (g4 === max) {
    return (b5 - r3) / d6 + 2;
  }
  return (r3 - g4) / d6 + 4;
}
function rgb2hsl(v3) {
  const range = 255;
  const r3 = v3.r / range;
  const g4 = v3.g / range;
  const b5 = v3.b / range;
  const max = Math.max(r3, g4, b5);
  const min = Math.min(r3, g4, b5);
  const l3 = (max + min) / 2;
  let h5, s6, d6;
  if (max !== min) {
    d6 = max - min;
    s6 = l3 > 0.5 ? d6 / (2 - max - min) : d6 / (max + min);
    h5 = hueValue(r3, g4, b5, d6, max);
    h5 = h5 * 60 + 0.5;
  }
  return [h5 | 0, s6 || 0, l3];
}
function calln(f3, a6, b5, c5) {
  return (Array.isArray(a6) ? f3(a6[0], a6[1], a6[2]) : f3(a6, b5, c5)).map(n2b);
}
function hsl2rgb(h5, s6, l3) {
  return calln(hsl2rgbn, h5, s6, l3);
}
function hwb2rgb(h5, w6, b5) {
  return calln(hwb2rgbn, h5, w6, b5);
}
function hsv2rgb(h5, s6, v3) {
  return calln(hsv2rgbn, h5, s6, v3);
}
function hue(h5) {
  return (h5 % 360 + 360) % 360;
}
function hueParse(str) {
  const m6 = HUE_RE.exec(str);
  let a6 = 255;
  let v3;
  if (!m6) {
    return;
  }
  if (m6[5] !== v3) {
    a6 = m6[6] ? p2b(+m6[5]) : n2b(+m6[5]);
  }
  const h5 = hue(+m6[2]);
  const p1 = +m6[3] / 100;
  const p22 = +m6[4] / 100;
  if (m6[1] === "hwb") {
    v3 = hwb2rgb(h5, p1, p22);
  } else if (m6[1] === "hsv") {
    v3 = hsv2rgb(h5, p1, p22);
  } else {
    v3 = hsl2rgb(h5, p1, p22);
  }
  return {
    r: v3[0],
    g: v3[1],
    b: v3[2],
    a: a6
  };
}
function rotate(v3, deg) {
  var h5 = rgb2hsl(v3);
  h5[0] = hue(h5[0] + deg);
  h5 = hsl2rgb(h5);
  v3.r = h5[0];
  v3.g = h5[1];
  v3.b = h5[2];
}
function hslString(v3) {
  if (!v3) {
    return;
  }
  const a6 = rgb2hsl(v3);
  const h5 = a6[0];
  const s6 = n2p(a6[1]);
  const l3 = n2p(a6[2]);
  return v3.a < 255 ? `hsla(${h5}, ${s6}%, ${l3}%, ${b2n(v3.a)})` : `hsl(${h5}, ${s6}%, ${l3}%)`;
}
var map2 = {
  x: "dark",
  Z: "light",
  Y: "re",
  X: "blu",
  W: "gr",
  V: "medium",
  U: "slate",
  A: "ee",
  T: "ol",
  S: "or",
  B: "ra",
  C: "lateg",
  D: "ights",
  R: "in",
  Q: "turquois",
  E: "hi",
  P: "ro",
  O: "al",
  N: "le",
  M: "de",
  L: "yello",
  F: "en",
  K: "ch",
  G: "arks",
  H: "ea",
  I: "ightg",
  J: "wh"
};
var names$1 = {
  OiceXe: "f0f8ff",
  antiquewEte: "faebd7",
  aqua: "ffff",
  aquamarRe: "7fffd4",
  azuY: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "0",
  blanKedOmond: "ffebcd",
  Xe: "ff",
  XeviTet: "8a2be2",
  bPwn: "a52a2a",
  burlywood: "deb887",
  caMtXe: "5f9ea0",
  KartYuse: "7fff00",
  KocTate: "d2691e",
  cSO: "ff7f50",
  cSnflowerXe: "6495ed",
  cSnsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "ffff",
  xXe: "8b",
  xcyan: "8b8b",
  xgTMnPd: "b8860b",
  xWay: "a9a9a9",
  xgYF: "6400",
  xgYy: "a9a9a9",
  xkhaki: "bdb76b",
  xmagFta: "8b008b",
  xTivegYF: "556b2f",
  xSange: "ff8c00",
  xScEd: "9932cc",
  xYd: "8b0000",
  xsOmon: "e9967a",
  xsHgYF: "8fbc8f",
  xUXe: "483d8b",
  xUWay: "2f4f4f",
  xUgYy: "2f4f4f",
  xQe: "ced1",
  xviTet: "9400d3",
  dAppRk: "ff1493",
  dApskyXe: "bfff",
  dimWay: "696969",
  dimgYy: "696969",
  dodgerXe: "1e90ff",
  fiYbrick: "b22222",
  flSOwEte: "fffaf0",
  foYstWAn: "228b22",
  fuKsia: "ff00ff",
  gaRsbSo: "dcdcdc",
  ghostwEte: "f8f8ff",
  gTd: "ffd700",
  gTMnPd: "daa520",
  Way: "808080",
  gYF: "8000",
  gYFLw: "adff2f",
  gYy: "808080",
  honeyMw: "f0fff0",
  hotpRk: "ff69b4",
  RdianYd: "cd5c5c",
  Rdigo: "4b0082",
  ivSy: "fffff0",
  khaki: "f0e68c",
  lavFMr: "e6e6fa",
  lavFMrXsh: "fff0f5",
  lawngYF: "7cfc00",
  NmoncEffon: "fffacd",
  ZXe: "add8e6",
  ZcSO: "f08080",
  Zcyan: "e0ffff",
  ZgTMnPdLw: "fafad2",
  ZWay: "d3d3d3",
  ZgYF: "90ee90",
  ZgYy: "d3d3d3",
  ZpRk: "ffb6c1",
  ZsOmon: "ffa07a",
  ZsHgYF: "20b2aa",
  ZskyXe: "87cefa",
  ZUWay: "778899",
  ZUgYy: "778899",
  ZstAlXe: "b0c4de",
  ZLw: "ffffe0",
  lime: "ff00",
  limegYF: "32cd32",
  lRF: "faf0e6",
  magFta: "ff00ff",
  maPon: "800000",
  VaquamarRe: "66cdaa",
  VXe: "cd",
  VScEd: "ba55d3",
  VpurpN: "9370db",
  VsHgYF: "3cb371",
  VUXe: "7b68ee",
  VsprRggYF: "fa9a",
  VQe: "48d1cc",
  VviTetYd: "c71585",
  midnightXe: "191970",
  mRtcYam: "f5fffa",
  mistyPse: "ffe4e1",
  moccasR: "ffe4b5",
  navajowEte: "ffdead",
  navy: "80",
  Tdlace: "fdf5e6",
  Tive: "808000",
  TivedBb: "6b8e23",
  Sange: "ffa500",
  SangeYd: "ff4500",
  ScEd: "da70d6",
  pOegTMnPd: "eee8aa",
  pOegYF: "98fb98",
  pOeQe: "afeeee",
  pOeviTetYd: "db7093",
  papayawEp: "ffefd5",
  pHKpuff: "ffdab9",
  peru: "cd853f",
  pRk: "ffc0cb",
  plum: "dda0dd",
  powMrXe: "b0e0e6",
  purpN: "800080",
  YbeccapurpN: "663399",
  Yd: "ff0000",
  Psybrown: "bc8f8f",
  PyOXe: "4169e1",
  saddNbPwn: "8b4513",
  sOmon: "fa8072",
  sandybPwn: "f4a460",
  sHgYF: "2e8b57",
  sHshell: "fff5ee",
  siFna: "a0522d",
  silver: "c0c0c0",
  skyXe: "87ceeb",
  UXe: "6a5acd",
  UWay: "708090",
  UgYy: "708090",
  snow: "fffafa",
  sprRggYF: "ff7f",
  stAlXe: "4682b4",
  tan: "d2b48c",
  teO: "8080",
  tEstN: "d8bfd8",
  tomato: "ff6347",
  Qe: "40e0d0",
  viTet: "ee82ee",
  JHt: "f5deb3",
  wEte: "ffffff",
  wEtesmoke: "f5f5f5",
  Lw: "ffff00",
  LwgYF: "9acd32"
};
function unpack() {
  const unpacked = {};
  const keys = Object.keys(names$1);
  const tkeys = Object.keys(map2);
  let i5, j4, k6, ok, nk;
  for (i5 = 0; i5 < keys.length; i5++) {
    ok = nk = keys[i5];
    for (j4 = 0; j4 < tkeys.length; j4++) {
      k6 = tkeys[j4];
      nk = nk.replace(k6, map2[k6]);
    }
    k6 = parseInt(names$1[ok], 16);
    unpacked[nk] = [k6 >> 16 & 255, k6 >> 8 & 255, k6 & 255];
  }
  return unpacked;
}
var names2;
function nameParse(str) {
  if (!names2) {
    names2 = unpack();
    names2.transparent = [0, 0, 0, 0];
  }
  const a6 = names2[str.toLowerCase()];
  return a6 && {
    r: a6[0],
    g: a6[1],
    b: a6[2],
    a: a6.length === 4 ? a6[3] : 255
  };
}
var RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
function rgbParse(str) {
  const m6 = RGB_RE.exec(str);
  let a6 = 255;
  let r3, g4, b5;
  if (!m6) {
    return;
  }
  if (m6[7] !== r3) {
    const v3 = +m6[7];
    a6 = m6[8] ? p2b(v3) : lim(v3 * 255, 0, 255);
  }
  r3 = +m6[1];
  g4 = +m6[3];
  b5 = +m6[5];
  r3 = 255 & (m6[2] ? p2b(r3) : lim(r3, 0, 255));
  g4 = 255 & (m6[4] ? p2b(g4) : lim(g4, 0, 255));
  b5 = 255 & (m6[6] ? p2b(b5) : lim(b5, 0, 255));
  return {
    r: r3,
    g: g4,
    b: b5,
    a: a6
  };
}
function rgbString(v3) {
  return v3 && (v3.a < 255 ? `rgba(${v3.r}, ${v3.g}, ${v3.b}, ${b2n(v3.a)})` : `rgb(${v3.r}, ${v3.g}, ${v3.b})`);
}
var to = (v3) => v3 <= 31308e-7 ? v3 * 12.92 : Math.pow(v3, 1 / 2.4) * 1.055 - 0.055;
var from = (v3) => v3 <= 0.04045 ? v3 / 12.92 : Math.pow((v3 + 0.055) / 1.055, 2.4);
function interpolate(rgb1, rgb2, t5) {
  const r3 = from(b2n(rgb1.r));
  const g4 = from(b2n(rgb1.g));
  const b5 = from(b2n(rgb1.b));
  return {
    r: n2b(to(r3 + t5 * (from(b2n(rgb2.r)) - r3))),
    g: n2b(to(g4 + t5 * (from(b2n(rgb2.g)) - g4))),
    b: n2b(to(b5 + t5 * (from(b2n(rgb2.b)) - b5))),
    a: rgb1.a + t5 * (rgb2.a - rgb1.a)
  };
}
function modHSL(v3, i5, ratio) {
  if (v3) {
    let tmp = rgb2hsl(v3);
    tmp[i5] = Math.max(0, Math.min(tmp[i5] + tmp[i5] * ratio, i5 === 0 ? 360 : 1));
    tmp = hsl2rgb(tmp);
    v3.r = tmp[0];
    v3.g = tmp[1];
    v3.b = tmp[2];
  }
}
function clone(v3, proto) {
  return v3 ? Object.assign(proto || {}, v3) : v3;
}
function fromObject(input) {
  var v3 = { r: 0, g: 0, b: 0, a: 255 };
  if (Array.isArray(input)) {
    if (input.length >= 3) {
      v3 = { r: input[0], g: input[1], b: input[2], a: 255 };
      if (input.length > 3) {
        v3.a = n2b(input[3]);
      }
    }
  } else {
    v3 = clone(input, { r: 0, g: 0, b: 0, a: 1 });
    v3.a = n2b(v3.a);
  }
  return v3;
}
function functionParse(str) {
  if (str.charAt(0) === "r") {
    return rgbParse(str);
  }
  return hueParse(str);
}
var Color = class _Color {
  constructor(input) {
    if (input instanceof _Color) {
      return input;
    }
    const type = typeof input;
    let v3;
    if (type === "object") {
      v3 = fromObject(input);
    } else if (type === "string") {
      v3 = hexParse(input) || nameParse(input) || functionParse(input);
    }
    this._rgb = v3;
    this._valid = !!v3;
  }
  get valid() {
    return this._valid;
  }
  get rgb() {
    var v3 = clone(this._rgb);
    if (v3) {
      v3.a = b2n(v3.a);
    }
    return v3;
  }
  set rgb(obj) {
    this._rgb = fromObject(obj);
  }
  rgbString() {
    return this._valid ? rgbString(this._rgb) : void 0;
  }
  hexString() {
    return this._valid ? hexString(this._rgb) : void 0;
  }
  hslString() {
    return this._valid ? hslString(this._rgb) : void 0;
  }
  mix(color2, weight) {
    if (color2) {
      const c1 = this.rgb;
      const c22 = color2.rgb;
      let w22;
      const p4 = weight === w22 ? 0.5 : weight;
      const w6 = 2 * p4 - 1;
      const a6 = c1.a - c22.a;
      const w1 = ((w6 * a6 === -1 ? w6 : (w6 + a6) / (1 + w6 * a6)) + 1) / 2;
      w22 = 1 - w1;
      c1.r = 255 & w1 * c1.r + w22 * c22.r + 0.5;
      c1.g = 255 & w1 * c1.g + w22 * c22.g + 0.5;
      c1.b = 255 & w1 * c1.b + w22 * c22.b + 0.5;
      c1.a = p4 * c1.a + (1 - p4) * c22.a;
      this.rgb = c1;
    }
    return this;
  }
  interpolate(color2, t5) {
    if (color2) {
      this._rgb = interpolate(this._rgb, color2._rgb, t5);
    }
    return this;
  }
  clone() {
    return new _Color(this.rgb);
  }
  alpha(a6) {
    this._rgb.a = n2b(a6);
    return this;
  }
  clearer(ratio) {
    const rgb = this._rgb;
    rgb.a *= 1 - ratio;
    return this;
  }
  greyscale() {
    const rgb = this._rgb;
    const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);
    rgb.r = rgb.g = rgb.b = val;
    return this;
  }
  opaquer(ratio) {
    const rgb = this._rgb;
    rgb.a *= 1 + ratio;
    return this;
  }
  negate() {
    const v3 = this._rgb;
    v3.r = 255 - v3.r;
    v3.g = 255 - v3.g;
    v3.b = 255 - v3.b;
    return this;
  }
  lighten(ratio) {
    modHSL(this._rgb, 2, ratio);
    return this;
  }
  darken(ratio) {
    modHSL(this._rgb, 2, -ratio);
    return this;
  }
  saturate(ratio) {
    modHSL(this._rgb, 1, ratio);
    return this;
  }
  desaturate(ratio) {
    modHSL(this._rgb, 1, -ratio);
    return this;
  }
  rotate(deg) {
    rotate(this._rgb, deg);
    return this;
  }
};

// ../../node_modules/.pnpm/chart.js@4.5.0/node_modules/chart.js/dist/chunks/helpers.dataset.js
function noop2() {
}
var uid = /* @__PURE__ */ (() => {
  let id = 0;
  return () => id++;
})();
function isNullOrUndef(value) {
  return value === null || value === void 0;
}
function isArray(value) {
  if (Array.isArray && Array.isArray(value)) {
    return true;
  }
  const type = Object.prototype.toString.call(value);
  if (type.slice(0, 7) === "[object" && type.slice(-6) === "Array]") {
    return true;
  }
  return false;
}
function isObject(value) {
  return value !== null && Object.prototype.toString.call(value) === "[object Object]";
}
function isNumberFinite(value) {
  return (typeof value === "number" || value instanceof Number) && isFinite(+value);
}
function finiteOrDefault(value, defaultValue) {
  return isNumberFinite(value) ? value : defaultValue;
}
function valueOrDefault(value, defaultValue) {
  return typeof value === "undefined" ? defaultValue : value;
}
var toDimension = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 * dimension : +value;
function callback(fn2, args, thisArg) {
  if (fn2 && typeof fn2.call === "function") {
    return fn2.apply(thisArg, args);
  }
}
function each(loopable, fn2, thisArg, reverse) {
  let i5, len, keys;
  if (isArray(loopable)) {
    len = loopable.length;
    if (reverse) {
      for (i5 = len - 1; i5 >= 0; i5--) {
        fn2.call(thisArg, loopable[i5], i5);
      }
    } else {
      for (i5 = 0; i5 < len; i5++) {
        fn2.call(thisArg, loopable[i5], i5);
      }
    }
  } else if (isObject(loopable)) {
    keys = Object.keys(loopable);
    len = keys.length;
    for (i5 = 0; i5 < len; i5++) {
      fn2.call(thisArg, loopable[keys[i5]], keys[i5]);
    }
  }
}
function _elementsEqual(a0, a1) {
  let i5, ilen, v0, v1;
  if (!a0 || !a1 || a0.length !== a1.length) {
    return false;
  }
  for (i5 = 0, ilen = a0.length; i5 < ilen; ++i5) {
    v0 = a0[i5];
    v1 = a1[i5];
    if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {
      return false;
    }
  }
  return true;
}
function clone2(source) {
  if (isArray(source)) {
    return source.map(clone2);
  }
  if (isObject(source)) {
    const target = /* @__PURE__ */ Object.create(null);
    const keys = Object.keys(source);
    const klen = keys.length;
    let k6 = 0;
    for (; k6 < klen; ++k6) {
      target[keys[k6]] = clone2(source[keys[k6]]);
    }
    return target;
  }
  return source;
}
function isValidKey(key) {
  return [
    "__proto__",
    "prototype",
    "constructor"
  ].indexOf(key) === -1;
}
function _merger(key, target, source, options) {
  if (!isValidKey(key)) {
    return;
  }
  const tval = target[key];
  const sval = source[key];
  if (isObject(tval) && isObject(sval)) {
    merge(tval, sval, options);
  } else {
    target[key] = clone2(sval);
  }
}
function merge(target, source, options) {
  const sources = isArray(source) ? source : [
    source
  ];
  const ilen = sources.length;
  if (!isObject(target)) {
    return target;
  }
  options = options || {};
  const merger = options.merger || _merger;
  let current;
  for (let i5 = 0; i5 < ilen; ++i5) {
    current = sources[i5];
    if (!isObject(current)) {
      continue;
    }
    const keys = Object.keys(current);
    for (let k6 = 0, klen = keys.length; k6 < klen; ++k6) {
      merger(keys[k6], target, current, options);
    }
  }
  return target;
}
function mergeIf(target, source) {
  return merge(target, source, {
    merger: _mergerIf
  });
}
function _mergerIf(key, target, source) {
  if (!isValidKey(key)) {
    return;
  }
  const tval = target[key];
  const sval = source[key];
  if (isObject(tval) && isObject(sval)) {
    mergeIf(tval, sval);
  } else if (!Object.prototype.hasOwnProperty.call(target, key)) {
    target[key] = clone2(sval);
  }
}
var keyResolvers = {
  // Chart.helpers.core resolveObjectKey should resolve empty key to root object
  "": (v3) => v3,
  // default resolvers
  x: (o3) => o3.x,
  y: (o3) => o3.y
};
function _splitKey(key) {
  const parts = key.split(".");
  const keys = [];
  let tmp = "";
  for (const part of parts) {
    tmp += part;
    if (tmp.endsWith("\\")) {
      tmp = tmp.slice(0, -1) + ".";
    } else {
      keys.push(tmp);
      tmp = "";
    }
  }
  return keys;
}
function _getKeyResolver(key) {
  const keys = _splitKey(key);
  return (obj) => {
    for (const k6 of keys) {
      if (k6 === "") {
        break;
      }
      obj = obj && obj[k6];
    }
    return obj;
  };
}
function resolveObjectKey(obj, key) {
  const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));
  return resolver(obj);
}
function _capitalize(str) {
  return str.charAt(0).toUpperCase() + str.slice(1);
}
var defined = (value) => typeof value !== "undefined";
var isFunction2 = (value) => typeof value === "function";
var setsEqual = (a6, b5) => {
  if (a6.size !== b5.size) {
    return false;
  }
  for (const item of a6) {
    if (!b5.has(item)) {
      return false;
    }
  }
  return true;
};
function _isClickEvent(e5) {
  return e5.type === "mouseup" || e5.type === "click" || e5.type === "contextmenu";
}
var PI = Math.PI;
var TAU = 2 * PI;
var PITAU = TAU + PI;
var INFINITY = Number.POSITIVE_INFINITY;
var RAD_PER_DEG = PI / 180;
var HALF_PI = PI / 2;
var QUARTER_PI = PI / 4;
var TWO_THIRDS_PI = PI * 2 / 3;
var log10 = Math.log10;
var sign2 = Math.sign;
function almostEquals(x6, y6, epsilon) {
  return Math.abs(x6 - y6) < epsilon;
}
function niceNum(range) {
  const roundedRange = Math.round(range);
  range = almostEquals(range, roundedRange, range / 1e3) ? roundedRange : range;
  const niceRange = Math.pow(10, Math.floor(log10(range)));
  const fraction = range / niceRange;
  const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;
  return niceFraction * niceRange;
}
function _factorize(value) {
  const result = [];
  const sqrt = Math.sqrt(value);
  let i5;
  for (i5 = 1; i5 < sqrt; i5++) {
    if (value % i5 === 0) {
      result.push(i5);
      result.push(value / i5);
    }
  }
  if (sqrt === (sqrt | 0)) {
    result.push(sqrt);
  }
  result.sort((a6, b5) => a6 - b5).pop();
  return result;
}
function isNonPrimitive(n2) {
  return typeof n2 === "symbol" || typeof n2 === "object" && n2 !== null && !(Symbol.toPrimitive in n2 || "toString" in n2 || "valueOf" in n2);
}
function isNumber(n2) {
  return !isNonPrimitive(n2) && !isNaN(parseFloat(n2)) && isFinite(n2);
}
function almostWhole(x6, epsilon) {
  const rounded = Math.round(x6);
  return rounded - epsilon <= x6 && rounded + epsilon >= x6;
}
function _setMinAndMaxByKey(array, target, property) {
  let i5, ilen, value;
  for (i5 = 0, ilen = array.length; i5 < ilen; i5++) {
    value = array[i5][property];
    if (!isNaN(value)) {
      target.min = Math.min(target.min, value);
      target.max = Math.max(target.max, value);
    }
  }
}
function toRadians(degrees) {
  return degrees * (PI / 180);
}
function toDegrees(radians) {
  return radians * (180 / PI);
}
function _decimalPlaces(x6) {
  if (!isNumberFinite(x6)) {
    return;
  }
  let e5 = 1;
  let p4 = 0;
  while (Math.round(x6 * e5) / e5 !== x6) {
    e5 *= 10;
    p4++;
  }
  return p4;
}
function getAngleFromPoint(centrePoint, anglePoint) {
  const distanceFromXCenter = anglePoint.x - centrePoint.x;
  const distanceFromYCenter = anglePoint.y - centrePoint.y;
  const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
  let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
  if (angle < -0.5 * PI) {
    angle += TAU;
  }
  return {
    angle,
    distance: radialDistanceFromCenter
  };
}
function distanceBetweenPoints(pt1, pt2) {
  return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
}
function _angleDiff(a6, b5) {
  return (a6 - b5 + PITAU) % TAU - PI;
}
function _normalizeAngle(a6) {
  return (a6 % TAU + TAU) % TAU;
}
function _angleBetween(angle, start, end, sameAngleIsFullCircle) {
  const a6 = _normalizeAngle(angle);
  const s6 = _normalizeAngle(start);
  const e5 = _normalizeAngle(end);
  const angleToStart = _normalizeAngle(s6 - a6);
  const angleToEnd = _normalizeAngle(e5 - a6);
  const startToAngle = _normalizeAngle(a6 - s6);
  const endToAngle = _normalizeAngle(a6 - e5);
  return a6 === s6 || a6 === e5 || sameAngleIsFullCircle && s6 === e5 || angleToStart > angleToEnd && startToAngle < endToAngle;
}
function _limitValue(value, min, max) {
  return Math.max(min, Math.min(max, value));
}
function _int16Range(value) {
  return _limitValue(value, -32768, 32767);
}
function _isBetween(value, start, end, epsilon = 1e-6) {
  return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;
}
function _lookup(table2, value, cmp) {
  cmp = cmp || ((index2) => table2[index2] < value);
  let hi = table2.length - 1;
  let lo = 0;
  let mid;
  while (hi - lo > 1) {
    mid = lo + hi >> 1;
    if (cmp(mid)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  return {
    lo,
    hi
  };
}
var _lookupByKey = (table2, key, value, last) => _lookup(table2, value, last ? (index2) => {
  const ti = table2[index2][key];
  return ti < value || ti === value && table2[index2 + 1][key] === value;
} : (index2) => table2[index2][key] < value);
var _rlookupByKey = (table2, key, value) => _lookup(table2, value, (index2) => table2[index2][key] >= value);
function _filterBetween(values, min, max) {
  let start = 0;
  let end = values.length;
  while (start < end && values[start] < min) {
    start++;
  }
  while (end > start && values[end - 1] > max) {
    end--;
  }
  return start > 0 || end < values.length ? values.slice(start, end) : values;
}
var arrayEvents = [
  "push",
  "pop",
  "shift",
  "splice",
  "unshift"
];
function listenArrayEvents(array, listener) {
  if (array._chartjs) {
    array._chartjs.listeners.push(listener);
    return;
  }
  Object.defineProperty(array, "_chartjs", {
    configurable: true,
    enumerable: false,
    value: {
      listeners: [
        listener
      ]
    }
  });
  arrayEvents.forEach((key) => {
    const method = "_onData" + _capitalize(key);
    const base2 = array[key];
    Object.defineProperty(array, key, {
      configurable: true,
      enumerable: false,
      value(...args) {
        const res = base2.apply(this, args);
        array._chartjs.listeners.forEach((object) => {
          if (typeof object[method] === "function") {
            object[method](...args);
          }
        });
        return res;
      }
    });
  });
}
function unlistenArrayEvents(array, listener) {
  const stub = array._chartjs;
  if (!stub) {
    return;
  }
  const listeners = stub.listeners;
  const index2 = listeners.indexOf(listener);
  if (index2 !== -1) {
    listeners.splice(index2, 1);
  }
  if (listeners.length > 0) {
    return;
  }
  arrayEvents.forEach((key) => {
    delete array[key];
  });
  delete array._chartjs;
}
function _arrayUnique(items) {
  const set2 = new Set(items);
  if (set2.size === items.length) {
    return items;
  }
  return Array.from(set2);
}
var requestAnimFrame = function() {
  if (typeof window === "undefined") {
    return function(callback2) {
      return callback2();
    };
  }
  return window.requestAnimationFrame;
}();
function throttled(fn2, thisArg) {
  let argsToUse = [];
  let ticking = false;
  return function(...args) {
    argsToUse = args;
    if (!ticking) {
      ticking = true;
      requestAnimFrame.call(window, () => {
        ticking = false;
        fn2.apply(thisArg, argsToUse);
      });
    }
  };
}
function debounce(fn2, delay) {
  let timeout;
  return function(...args) {
    if (delay) {
      clearTimeout(timeout);
      timeout = setTimeout(fn2, delay, args);
    } else {
      fn2.apply(this, args);
    }
    return delay;
  };
}
var _toLeftRightCenter = (align) => align === "start" ? "left" : align === "end" ? "right" : "center";
var _alignStartEnd = (align, start, end) => align === "start" ? start : align === "end" ? end : (start + end) / 2;
var _textX = (align, left, right, rtl) => {
  const check = rtl ? "left" : "right";
  return align === check ? right : align === "center" ? (left + right) / 2 : left;
};
function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {
  const pointCount = points.length;
  let start = 0;
  let count = pointCount;
  if (meta._sorted) {
    const { iScale, vScale, _parsed } = meta;
    const spanGaps = meta.dataset ? meta.dataset.options ? meta.dataset.options.spanGaps : null : null;
    const axis = iScale.axis;
    const { min, max, minDefined, maxDefined } = iScale.getUserBounds();
    if (minDefined) {
      start = Math.min(
        // @ts-expect-error Need to type _parsed
        _lookupByKey(_parsed, axis, min).lo,
        // @ts-expect-error Need to fix types on _lookupByKey
        animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo
      );
      if (spanGaps) {
        const distanceToDefinedLo = _parsed.slice(0, start + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis]));
        start -= Math.max(0, distanceToDefinedLo);
      }
      start = _limitValue(start, 0, pointCount - 1);
    }
    if (maxDefined) {
      let end = Math.max(
        // @ts-expect-error Need to type _parsed
        _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,
        // @ts-expect-error Need to fix types on _lookupByKey
        animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1
      );
      if (spanGaps) {
        const distanceToDefinedHi = _parsed.slice(end - 1).findIndex((point) => !isNullOrUndef(point[vScale.axis]));
        end += Math.max(0, distanceToDefinedHi);
      }
      count = _limitValue(end, start, pointCount) - start;
    } else {
      count = pointCount - start;
    }
  }
  return {
    start,
    count
  };
}
function _scaleRangesChanged(meta) {
  const { xScale, yScale, _scaleRanges } = meta;
  const newRanges = {
    xmin: xScale.min,
    xmax: xScale.max,
    ymin: yScale.min,
    ymax: yScale.max
  };
  if (!_scaleRanges) {
    meta._scaleRanges = newRanges;
    return true;
  }
  const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;
  Object.assign(_scaleRanges, newRanges);
  return changed;
}
var atEdge = (t5) => t5 === 0 || t5 === 1;
var elasticIn = (t5, s6, p4) => -(Math.pow(2, 10 * (t5 -= 1)) * Math.sin((t5 - s6) * TAU / p4));
var elasticOut = (t5, s6, p4) => Math.pow(2, -10 * t5) * Math.sin((t5 - s6) * TAU / p4) + 1;
var effects = {
  linear: (t5) => t5,
  easeInQuad: (t5) => t5 * t5,
  easeOutQuad: (t5) => -t5 * (t5 - 2),
  easeInOutQuad: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 : -0.5 * (--t5 * (t5 - 2) - 1),
  easeInCubic: (t5) => t5 * t5 * t5,
  easeOutCubic: (t5) => (t5 -= 1) * t5 * t5 + 1,
  easeInOutCubic: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 : 0.5 * ((t5 -= 2) * t5 * t5 + 2),
  easeInQuart: (t5) => t5 * t5 * t5 * t5,
  easeOutQuart: (t5) => -((t5 -= 1) * t5 * t5 * t5 - 1),
  easeInOutQuart: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 * t5 : -0.5 * ((t5 -= 2) * t5 * t5 * t5 - 2),
  easeInQuint: (t5) => t5 * t5 * t5 * t5 * t5,
  easeOutQuint: (t5) => (t5 -= 1) * t5 * t5 * t5 * t5 + 1,
  easeInOutQuint: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 * t5 * t5 : 0.5 * ((t5 -= 2) * t5 * t5 * t5 * t5 + 2),
  easeInSine: (t5) => -Math.cos(t5 * HALF_PI) + 1,
  easeOutSine: (t5) => Math.sin(t5 * HALF_PI),
  easeInOutSine: (t5) => -0.5 * (Math.cos(PI * t5) - 1),
  easeInExpo: (t5) => t5 === 0 ? 0 : Math.pow(2, 10 * (t5 - 1)),
  easeOutExpo: (t5) => t5 === 1 ? 1 : -Math.pow(2, -10 * t5) + 1,
  easeInOutExpo: (t5) => atEdge(t5) ? t5 : t5 < 0.5 ? 0.5 * Math.pow(2, 10 * (t5 * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t5 * 2 - 1)) + 2),
  easeInCirc: (t5) => t5 >= 1 ? t5 : -(Math.sqrt(1 - t5 * t5) - 1),
  easeOutCirc: (t5) => Math.sqrt(1 - (t5 -= 1) * t5),
  easeInOutCirc: (t5) => (t5 /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t5 * t5) - 1) : 0.5 * (Math.sqrt(1 - (t5 -= 2) * t5) + 1),
  easeInElastic: (t5) => atEdge(t5) ? t5 : elasticIn(t5, 0.075, 0.3),
  easeOutElastic: (t5) => atEdge(t5) ? t5 : elasticOut(t5, 0.075, 0.3),
  easeInOutElastic(t5) {
    const s6 = 0.1125;
    const p4 = 0.45;
    return atEdge(t5) ? t5 : t5 < 0.5 ? 0.5 * elasticIn(t5 * 2, s6, p4) : 0.5 + 0.5 * elasticOut(t5 * 2 - 1, s6, p4);
  },
  easeInBack(t5) {
    const s6 = 1.70158;
    return t5 * t5 * ((s6 + 1) * t5 - s6);
  },
  easeOutBack(t5) {
    const s6 = 1.70158;
    return (t5 -= 1) * t5 * ((s6 + 1) * t5 + s6) + 1;
  },
  easeInOutBack(t5) {
    let s6 = 1.70158;
    if ((t5 /= 0.5) < 1) {
      return 0.5 * (t5 * t5 * (((s6 *= 1.525) + 1) * t5 - s6));
    }
    return 0.5 * ((t5 -= 2) * t5 * (((s6 *= 1.525) + 1) * t5 + s6) + 2);
  },
  easeInBounce: (t5) => 1 - effects.easeOutBounce(1 - t5),
  easeOutBounce(t5) {
    const m6 = 7.5625;
    const d6 = 2.75;
    if (t5 < 1 / d6) {
      return m6 * t5 * t5;
    }
    if (t5 < 2 / d6) {
      return m6 * (t5 -= 1.5 / d6) * t5 + 0.75;
    }
    if (t5 < 2.5 / d6) {
      return m6 * (t5 -= 2.25 / d6) * t5 + 0.9375;
    }
    return m6 * (t5 -= 2.625 / d6) * t5 + 0.984375;
  },
  easeInOutBounce: (t5) => t5 < 0.5 ? effects.easeInBounce(t5 * 2) * 0.5 : effects.easeOutBounce(t5 * 2 - 1) * 0.5 + 0.5
};
function isPatternOrGradient(value) {
  if (value && typeof value === "object") {
    const type = value.toString();
    return type === "[object CanvasPattern]" || type === "[object CanvasGradient]";
  }
  return false;
}
function color(value) {
  return isPatternOrGradient(value) ? value : new Color(value);
}
function getHoverColor(value) {
  return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();
}
var numbers = [
  "x",
  "y",
  "borderWidth",
  "radius",
  "tension"
];
var colors = [
  "color",
  "borderColor",
  "backgroundColor"
];
function applyAnimationsDefaults(defaults2) {
  defaults2.set("animation", {
    delay: void 0,
    duration: 1e3,
    easing: "easeOutQuart",
    fn: void 0,
    from: void 0,
    loop: void 0,
    to: void 0,
    type: void 0
  });
  defaults2.describe("animation", {
    _fallback: false,
    _indexable: false,
    _scriptable: (name) => name !== "onProgress" && name !== "onComplete" && name !== "fn"
  });
  defaults2.set("animations", {
    colors: {
      type: "color",
      properties: colors
    },
    numbers: {
      type: "number",
      properties: numbers
    }
  });
  defaults2.describe("animations", {
    _fallback: "animation"
  });
  defaults2.set("transitions", {
    active: {
      animation: {
        duration: 400
      }
    },
    resize: {
      animation: {
        duration: 0
      }
    },
    show: {
      animations: {
        colors: {
          from: "transparent"
        },
        visible: {
          type: "boolean",
          duration: 0
        }
      }
    },
    hide: {
      animations: {
        colors: {
          to: "transparent"
        },
        visible: {
          type: "boolean",
          easing: "linear",
          fn: (v3) => v3 | 0
        }
      }
    }
  });
}
function applyLayoutsDefaults(defaults2) {
  defaults2.set("layout", {
    autoPadding: true,
    padding: {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    }
  });
}
var intlCache = /* @__PURE__ */ new Map();
function getNumberFormat(locale7, options) {
  options = options || {};
  const cacheKey = locale7 + JSON.stringify(options);
  let formatter = intlCache.get(cacheKey);
  if (!formatter) {
    formatter = new Intl.NumberFormat(locale7, options);
    intlCache.set(cacheKey, formatter);
  }
  return formatter;
}
function formatNumber(num, locale7, options) {
  return getNumberFormat(locale7, options).format(num);
}
var formatters5 = {
  values(value) {
    return isArray(value) ? value : "" + value;
  },
  numeric(tickValue, index2, ticks) {
    if (tickValue === 0) {
      return "0";
    }
    const locale7 = this.chart.options.locale;
    let notation;
    let delta = tickValue;
    if (ticks.length > 1) {
      const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));
      if (maxTick < 1e-4 || maxTick > 1e15) {
        notation = "scientific";
      }
      delta = calculateDelta(tickValue, ticks);
    }
    const logDelta = log10(Math.abs(delta));
    const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);
    const options = {
      notation,
      minimumFractionDigits: numDecimal,
      maximumFractionDigits: numDecimal
    };
    Object.assign(options, this.options.ticks.format);
    return formatNumber(tickValue, locale7, options);
  },
  logarithmic(tickValue, index2, ticks) {
    if (tickValue === 0) {
      return "0";
    }
    const remain = ticks[index2].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));
    if ([
      1,
      2,
      3,
      5,
      10,
      15
    ].includes(remain) || index2 > 0.8 * ticks.length) {
      return formatters5.numeric.call(this, tickValue, index2, ticks);
    }
    return "";
  }
};
function calculateDelta(tickValue, ticks) {
  let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;
  if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {
    delta = tickValue - Math.floor(tickValue);
  }
  return delta;
}
var Ticks = {
  formatters: formatters5
};
function applyScaleDefaults(defaults2) {
  defaults2.set("scale", {
    display: true,
    offset: false,
    reverse: false,
    beginAtZero: false,
    bounds: "ticks",
    clip: true,
    grace: 0,
    grid: {
      display: true,
      lineWidth: 1,
      drawOnChartArea: true,
      drawTicks: true,
      tickLength: 8,
      tickWidth: (_ctx, options) => options.lineWidth,
      tickColor: (_ctx, options) => options.color,
      offset: false
    },
    border: {
      display: true,
      dash: [],
      dashOffset: 0,
      width: 1
    },
    title: {
      display: false,
      text: "",
      padding: {
        top: 4,
        bottom: 4
      }
    },
    ticks: {
      minRotation: 0,
      maxRotation: 50,
      mirror: false,
      textStrokeWidth: 0,
      textStrokeColor: "",
      padding: 3,
      display: true,
      autoSkip: true,
      autoSkipPadding: 3,
      labelOffset: 0,
      callback: Ticks.formatters.values,
      minor: {},
      major: {},
      align: "center",
      crossAlign: "near",
      showLabelBackdrop: false,
      backdropColor: "rgba(255, 255, 255, 0.75)",
      backdropPadding: 2
    }
  });
  defaults2.route("scale.ticks", "color", "", "color");
  defaults2.route("scale.grid", "color", "", "borderColor");
  defaults2.route("scale.border", "color", "", "borderColor");
  defaults2.route("scale.title", "color", "", "color");
  defaults2.describe("scale", {
    _fallback: false,
    _scriptable: (name) => !name.startsWith("before") && !name.startsWith("after") && name !== "callback" && name !== "parser",
    _indexable: (name) => name !== "borderDash" && name !== "tickBorderDash" && name !== "dash"
  });
  defaults2.describe("scales", {
    _fallback: "scale"
  });
  defaults2.describe("scale.ticks", {
    _scriptable: (name) => name !== "backdropPadding" && name !== "callback",
    _indexable: (name) => name !== "backdropPadding"
  });
}
var overrides = /* @__PURE__ */ Object.create(null);
var descriptors = /* @__PURE__ */ Object.create(null);
function getScope$1(node, key) {
  if (!key) {
    return node;
  }
  const keys = key.split(".");
  for (let i5 = 0, n2 = keys.length; i5 < n2; ++i5) {
    const k6 = keys[i5];
    node = node[k6] || (node[k6] = /* @__PURE__ */ Object.create(null));
  }
  return node;
}
function set(root, scope, values) {
  if (typeof scope === "string") {
    return merge(getScope$1(root, scope), values);
  }
  return merge(getScope$1(root, ""), scope);
}
var Defaults = class {
  constructor(_descriptors2, _appliers) {
    this.animation = void 0;
    this.backgroundColor = "rgba(0,0,0,0.1)";
    this.borderColor = "rgba(0,0,0,0.1)";
    this.color = "#666";
    this.datasets = {};
    this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();
    this.elements = {};
    this.events = [
      "mousemove",
      "mouseout",
      "click",
      "touchstart",
      "touchmove"
    ];
    this.font = {
      family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
      size: 12,
      style: "normal",
      lineHeight: 1.2,
      weight: null
    };
    this.hover = {};
    this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);
    this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);
    this.hoverColor = (ctx, options) => getHoverColor(options.color);
    this.indexAxis = "x";
    this.interaction = {
      mode: "nearest",
      intersect: true,
      includeInvisible: false
    };
    this.maintainAspectRatio = true;
    this.onHover = null;
    this.onClick = null;
    this.parsing = true;
    this.plugins = {};
    this.responsive = true;
    this.scale = void 0;
    this.scales = {};
    this.showLine = true;
    this.drawActiveElementsOnTop = true;
    this.describe(_descriptors2);
    this.apply(_appliers);
  }
  set(scope, values) {
    return set(this, scope, values);
  }
  get(scope) {
    return getScope$1(this, scope);
  }
  describe(scope, values) {
    return set(descriptors, scope, values);
  }
  override(scope, values) {
    return set(overrides, scope, values);
  }
  route(scope, name, targetScope, targetName) {
    const scopeObject = getScope$1(this, scope);
    const targetScopeObject = getScope$1(this, targetScope);
    const privateName = "_" + name;
    Object.defineProperties(scopeObject, {
      [privateName]: {
        value: scopeObject[name],
        writable: true
      },
      [name]: {
        enumerable: true,
        get() {
          const local = this[privateName];
          const target = targetScopeObject[targetName];
          if (isObject(local)) {
            return Object.assign({}, target, local);
          }
          return valueOrDefault(local, target);
        },
        set(value) {
          this[privateName] = value;
        }
      }
    });
  }
  apply(appliers) {
    appliers.forEach((apply) => apply(this));
  }
};
var defaults = /* @__PURE__ */ new Defaults({
  _scriptable: (name) => !name.startsWith("on"),
  _indexable: (name) => name !== "events",
  hover: {
    _fallback: "interaction"
  },
  interaction: {
    _scriptable: false,
    _indexable: false
  }
}, [
  applyAnimationsDefaults,
  applyLayoutsDefaults,
  applyScaleDefaults
]);
function toFontString(font) {
  if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {
    return null;
  }
  return (font.style ? font.style + " " : "") + (font.weight ? font.weight + " " : "") + font.size + "px " + font.family;
}
function _measureText(ctx, data, gc, longest, string) {
  let textWidth = data[string];
  if (!textWidth) {
    textWidth = data[string] = ctx.measureText(string).width;
    gc.push(string);
  }
  if (textWidth > longest) {
    longest = textWidth;
  }
  return longest;
}
function _longestText(ctx, font, arrayOfThings, cache2) {
  cache2 = cache2 || {};
  let data = cache2.data = cache2.data || {};
  let gc = cache2.garbageCollect = cache2.garbageCollect || [];
  if (cache2.font !== font) {
    data = cache2.data = {};
    gc = cache2.garbageCollect = [];
    cache2.font = font;
  }
  ctx.save();
  ctx.font = font;
  let longest = 0;
  const ilen = arrayOfThings.length;
  let i5, j4, jlen, thing, nestedThing;
  for (i5 = 0; i5 < ilen; i5++) {
    thing = arrayOfThings[i5];
    if (thing !== void 0 && thing !== null && !isArray(thing)) {
      longest = _measureText(ctx, data, gc, longest, thing);
    } else if (isArray(thing)) {
      for (j4 = 0, jlen = thing.length; j4 < jlen; j4++) {
        nestedThing = thing[j4];
        if (nestedThing !== void 0 && nestedThing !== null && !isArray(nestedThing)) {
          longest = _measureText(ctx, data, gc, longest, nestedThing);
        }
      }
    }
  }
  ctx.restore();
  const gcLen = gc.length / 2;
  if (gcLen > arrayOfThings.length) {
    for (i5 = 0; i5 < gcLen; i5++) {
      delete data[gc[i5]];
    }
    gc.splice(0, gcLen);
  }
  return longest;
}
function _alignPixel(chart, pixel, width) {
  const devicePixelRatio = chart.currentDevicePixelRatio;
  const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;
  return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;
}
function clearCanvas(canvas, ctx) {
  if (!ctx && !canvas) {
    return;
  }
  ctx = ctx || canvas.getContext("2d");
  ctx.save();
  ctx.resetTransform();
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  ctx.restore();
}
function drawPoint(ctx, options, x6, y6) {
  drawPointLegend(ctx, options, x6, y6, null);
}
function drawPointLegend(ctx, options, x6, y6, w6) {
  let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;
  const style = options.pointStyle;
  const rotation = options.rotation;
  const radius = options.radius;
  let rad = (rotation || 0) * RAD_PER_DEG;
  if (style && typeof style === "object") {
    type = style.toString();
    if (type === "[object HTMLImageElement]" || type === "[object HTMLCanvasElement]") {
      ctx.save();
      ctx.translate(x6, y6);
      ctx.rotate(rad);
      ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);
      ctx.restore();
      return;
    }
  }
  if (isNaN(radius) || radius <= 0) {
    return;
  }
  ctx.beginPath();
  switch (style) {
    default:
      if (w6) {
        ctx.ellipse(x6, y6, w6 / 2, radius, 0, 0, TAU);
      } else {
        ctx.arc(x6, y6, radius, 0, TAU);
      }
      ctx.closePath();
      break;
    case "triangle":
      width = w6 ? w6 / 2 : radius;
      ctx.moveTo(x6 + Math.sin(rad) * width, y6 - Math.cos(rad) * radius);
      rad += TWO_THIRDS_PI;
      ctx.lineTo(x6 + Math.sin(rad) * width, y6 - Math.cos(rad) * radius);
      rad += TWO_THIRDS_PI;
      ctx.lineTo(x6 + Math.sin(rad) * width, y6 - Math.cos(rad) * radius);
      ctx.closePath();
      break;
    case "rectRounded":
      cornerRadius = radius * 0.516;
      size = radius - cornerRadius;
      xOffset = Math.cos(rad + QUARTER_PI) * size;
      xOffsetW = Math.cos(rad + QUARTER_PI) * (w6 ? w6 / 2 - cornerRadius : size);
      yOffset = Math.sin(rad + QUARTER_PI) * size;
      yOffsetW = Math.sin(rad + QUARTER_PI) * (w6 ? w6 / 2 - cornerRadius : size);
      ctx.arc(x6 - xOffsetW, y6 - yOffset, cornerRadius, rad - PI, rad - HALF_PI);
      ctx.arc(x6 + yOffsetW, y6 - xOffset, cornerRadius, rad - HALF_PI, rad);
      ctx.arc(x6 + xOffsetW, y6 + yOffset, cornerRadius, rad, rad + HALF_PI);
      ctx.arc(x6 - yOffsetW, y6 + xOffset, cornerRadius, rad + HALF_PI, rad + PI);
      ctx.closePath();
      break;
    case "rect":
      if (!rotation) {
        size = Math.SQRT1_2 * radius;
        width = w6 ? w6 / 2 : size;
        ctx.rect(x6 - width, y6 - size, 2 * width, 2 * size);
        break;
      }
      rad += QUARTER_PI;
    case "rectRot":
      xOffsetW = Math.cos(rad) * (w6 ? w6 / 2 : radius);
      xOffset = Math.cos(rad) * radius;
      yOffset = Math.sin(rad) * radius;
      yOffsetW = Math.sin(rad) * (w6 ? w6 / 2 : radius);
      ctx.moveTo(x6 - xOffsetW, y6 - yOffset);
      ctx.lineTo(x6 + yOffsetW, y6 - xOffset);
      ctx.lineTo(x6 + xOffsetW, y6 + yOffset);
      ctx.lineTo(x6 - yOffsetW, y6 + xOffset);
      ctx.closePath();
      break;
    case "crossRot":
      rad += QUARTER_PI;
    case "cross":
      xOffsetW = Math.cos(rad) * (w6 ? w6 / 2 : radius);
      xOffset = Math.cos(rad) * radius;
      yOffset = Math.sin(rad) * radius;
      yOffsetW = Math.sin(rad) * (w6 ? w6 / 2 : radius);
      ctx.moveTo(x6 - xOffsetW, y6 - yOffset);
      ctx.lineTo(x6 + xOffsetW, y6 + yOffset);
      ctx.moveTo(x6 + yOffsetW, y6 - xOffset);
      ctx.lineTo(x6 - yOffsetW, y6 + xOffset);
      break;
    case "star":
      xOffsetW = Math.cos(rad) * (w6 ? w6 / 2 : radius);
      xOffset = Math.cos(rad) * radius;
      yOffset = Math.sin(rad) * radius;
      yOffsetW = Math.sin(rad) * (w6 ? w6 / 2 : radius);
      ctx.moveTo(x6 - xOffsetW, y6 - yOffset);
      ctx.lineTo(x6 + xOffsetW, y6 + yOffset);
      ctx.moveTo(x6 + yOffsetW, y6 - xOffset);
      ctx.lineTo(x6 - yOffsetW, y6 + xOffset);
      rad += QUARTER_PI;
      xOffsetW = Math.cos(rad) * (w6 ? w6 / 2 : radius);
      xOffset = Math.cos(rad) * radius;
      yOffset = Math.sin(rad) * radius;
      yOffsetW = Math.sin(rad) * (w6 ? w6 / 2 : radius);
      ctx.moveTo(x6 - xOffsetW, y6 - yOffset);
      ctx.lineTo(x6 + xOffsetW, y6 + yOffset);
      ctx.moveTo(x6 + yOffsetW, y6 - xOffset);
      ctx.lineTo(x6 - yOffsetW, y6 + xOffset);
      break;
    case "line":
      xOffset = w6 ? w6 / 2 : Math.cos(rad) * radius;
      yOffset = Math.sin(rad) * radius;
      ctx.moveTo(x6 - xOffset, y6 - yOffset);
      ctx.lineTo(x6 + xOffset, y6 + yOffset);
      break;
    case "dash":
      ctx.moveTo(x6, y6);
      ctx.lineTo(x6 + Math.cos(rad) * (w6 ? w6 / 2 : radius), y6 + Math.sin(rad) * radius);
      break;
    case false:
      ctx.closePath();
      break;
  }
  ctx.fill();
  if (options.borderWidth > 0) {
    ctx.stroke();
  }
}
function _isPointInArea(point, area, margin) {
  margin = margin || 0.5;
  return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;
}
function clipArea(ctx, area) {
  ctx.save();
  ctx.beginPath();
  ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);
  ctx.clip();
}
function unclipArea(ctx) {
  ctx.restore();
}
function _steppedLineTo(ctx, previous, target, flip, mode) {
  if (!previous) {
    return ctx.lineTo(target.x, target.y);
  }
  if (mode === "middle") {
    const midpoint = (previous.x + target.x) / 2;
    ctx.lineTo(midpoint, previous.y);
    ctx.lineTo(midpoint, target.y);
  } else if (mode === "after" !== !!flip) {
    ctx.lineTo(previous.x, target.y);
  } else {
    ctx.lineTo(target.x, previous.y);
  }
  ctx.lineTo(target.x, target.y);
}
function _bezierCurveTo(ctx, previous, target, flip) {
  if (!previous) {
    return ctx.lineTo(target.x, target.y);
  }
  ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y);
}
function setRenderOpts(ctx, opts) {
  if (opts.translation) {
    ctx.translate(opts.translation[0], opts.translation[1]);
  }
  if (!isNullOrUndef(opts.rotation)) {
    ctx.rotate(opts.rotation);
  }
  if (opts.color) {
    ctx.fillStyle = opts.color;
  }
  if (opts.textAlign) {
    ctx.textAlign = opts.textAlign;
  }
  if (opts.textBaseline) {
    ctx.textBaseline = opts.textBaseline;
  }
}
function decorateText(ctx, x6, y6, line, opts) {
  if (opts.strikethrough || opts.underline) {
    const metrics = ctx.measureText(line);
    const left = x6 - metrics.actualBoundingBoxLeft;
    const right = x6 + metrics.actualBoundingBoxRight;
    const top = y6 - metrics.actualBoundingBoxAscent;
    const bottom = y6 + metrics.actualBoundingBoxDescent;
    const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;
    ctx.strokeStyle = ctx.fillStyle;
    ctx.beginPath();
    ctx.lineWidth = opts.decorationWidth || 2;
    ctx.moveTo(left, yDecoration);
    ctx.lineTo(right, yDecoration);
    ctx.stroke();
  }
}
function drawBackdrop(ctx, opts) {
  const oldColor = ctx.fillStyle;
  ctx.fillStyle = opts.color;
  ctx.fillRect(opts.left, opts.top, opts.width, opts.height);
  ctx.fillStyle = oldColor;
}
function renderText(ctx, text, x6, y6, font, opts = {}) {
  const lines = isArray(text) ? text : [
    text
  ];
  const stroke = opts.strokeWidth > 0 && opts.strokeColor !== "";
  let i5, line;
  ctx.save();
  ctx.font = font.string;
  setRenderOpts(ctx, opts);
  for (i5 = 0; i5 < lines.length; ++i5) {
    line = lines[i5];
    if (opts.backdrop) {
      drawBackdrop(ctx, opts.backdrop);
    }
    if (stroke) {
      if (opts.strokeColor) {
        ctx.strokeStyle = opts.strokeColor;
      }
      if (!isNullOrUndef(opts.strokeWidth)) {
        ctx.lineWidth = opts.strokeWidth;
      }
      ctx.strokeText(line, x6, y6, opts.maxWidth);
    }
    ctx.fillText(line, x6, y6, opts.maxWidth);
    decorateText(ctx, x6, y6, line, opts);
    y6 += Number(font.lineHeight);
  }
  ctx.restore();
}
function addRoundedRectPath(ctx, rect) {
  const { x: x6, y: y6, w: w6, h: h5, radius } = rect;
  ctx.arc(x6 + radius.topLeft, y6 + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);
  ctx.lineTo(x6, y6 + h5 - radius.bottomLeft);
  ctx.arc(x6 + radius.bottomLeft, y6 + h5 - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);
  ctx.lineTo(x6 + w6 - radius.bottomRight, y6 + h5);
  ctx.arc(x6 + w6 - radius.bottomRight, y6 + h5 - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);
  ctx.lineTo(x6 + w6, y6 + radius.topRight);
  ctx.arc(x6 + w6 - radius.topRight, y6 + radius.topRight, radius.topRight, 0, -HALF_PI, true);
  ctx.lineTo(x6 + radius.topLeft, y6);
}
var LINE_HEIGHT = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/;
var FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;
function toLineHeight(value, size) {
  const matches = ("" + value).match(LINE_HEIGHT);
  if (!matches || matches[1] === "normal") {
    return size * 1.2;
  }
  value = +matches[2];
  switch (matches[3]) {
    case "px":
      return value;
    case "%":
      value /= 100;
      break;
  }
  return size * value;
}
var numberOrZero = (v3) => +v3 || 0;
function _readValueToProps(value, props) {
  const ret = {};
  const objProps = isObject(props);
  const keys = objProps ? Object.keys(props) : props;
  const read = isObject(value) ? objProps ? (prop) => valueOrDefault(value[prop], value[props[prop]]) : (prop) => value[prop] : () => value;
  for (const prop of keys) {
    ret[prop] = numberOrZero(read(prop));
  }
  return ret;
}
function toTRBL(value) {
  return _readValueToProps(value, {
    top: "y",
    right: "x",
    bottom: "y",
    left: "x"
  });
}
function toTRBLCorners(value) {
  return _readValueToProps(value, [
    "topLeft",
    "topRight",
    "bottomLeft",
    "bottomRight"
  ]);
}
function toPadding(value) {
  const obj = toTRBL(value);
  obj.width = obj.left + obj.right;
  obj.height = obj.top + obj.bottom;
  return obj;
}
function toFont(options, fallback) {
  options = options || {};
  fallback = fallback || defaults.font;
  let size = valueOrDefault(options.size, fallback.size);
  if (typeof size === "string") {
    size = parseInt(size, 10);
  }
  let style = valueOrDefault(options.style, fallback.style);
  if (style && !("" + style).match(FONT_STYLE)) {
    console.warn('Invalid font style specified: "' + style + '"');
    style = void 0;
  }
  const font = {
    family: valueOrDefault(options.family, fallback.family),
    lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),
    size,
    style,
    weight: valueOrDefault(options.weight, fallback.weight),
    string: ""
  };
  font.string = toFontString(font);
  return font;
}
function resolve(inputs, context, index2, info) {
  let cacheable = true;
  let i5, ilen, value;
  for (i5 = 0, ilen = inputs.length; i5 < ilen; ++i5) {
    value = inputs[i5];
    if (value === void 0) {
      continue;
    }
    if (context !== void 0 && typeof value === "function") {
      value = value(context);
      cacheable = false;
    }
    if (index2 !== void 0 && isArray(value)) {
      value = value[index2 % value.length];
      cacheable = false;
    }
    if (value !== void 0) {
      if (info && !cacheable) {
        info.cacheable = false;
      }
      return value;
    }
  }
}
function _addGrace(minmax, grace, beginAtZero) {
  const { min, max } = minmax;
  const change = toDimension(grace, (max - min) / 2);
  const keepZero = (value, add4) => beginAtZero && value === 0 ? 0 : value + add4;
  return {
    min: keepZero(min, -Math.abs(change)),
    max: keepZero(max, change)
  };
}
function createContext(parentContext, context) {
  return Object.assign(Object.create(parentContext), context);
}
function _createResolver(scopes, prefixes = [
  ""
], rootScopes, fallback, getTarget = () => scopes[0]) {
  const finalRootScopes = rootScopes || scopes;
  if (typeof fallback === "undefined") {
    fallback = _resolve("_fallback", scopes);
  }
  const cache2 = {
    [Symbol.toStringTag]: "Object",
    _cacheable: true,
    _scopes: scopes,
    _rootScopes: finalRootScopes,
    _fallback: fallback,
    _getTarget: getTarget,
    override: (scope) => _createResolver([
      scope,
      ...scopes
    ], prefixes, finalRootScopes, fallback)
  };
  return new Proxy(cache2, {
    /**
    * A trap for the delete operator.
    */
    deleteProperty(target, prop) {
      delete target[prop];
      delete target._keys;
      delete scopes[0][prop];
      return true;
    },
    /**
    * A trap for getting property values.
    */
    get(target, prop) {
      return _cached(target, prop, () => _resolveWithPrefixes(prop, prefixes, scopes, target));
    },
    /**
    * A trap for Object.getOwnPropertyDescriptor.
    * Also used by Object.hasOwnProperty.
    */
    getOwnPropertyDescriptor(target, prop) {
      return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);
    },
    /**
    * A trap for Object.getPrototypeOf.
    */
    getPrototypeOf() {
      return Reflect.getPrototypeOf(scopes[0]);
    },
    /**
    * A trap for the in operator.
    */
    has(target, prop) {
      return getKeysFromAllScopes(target).includes(prop);
    },
    /**
    * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.
    */
    ownKeys(target) {
      return getKeysFromAllScopes(target);
    },
    /**
    * A trap for setting property values.
    */
    set(target, prop, value) {
      const storage4 = target._storage || (target._storage = getTarget());
      target[prop] = storage4[prop] = value;
      delete target._keys;
      return true;
    }
  });
}
function _attachContext(proxy, context, subProxy, descriptorDefaults) {
  const cache2 = {
    _cacheable: false,
    _proxy: proxy,
    _context: context,
    _subProxy: subProxy,
    _stack: /* @__PURE__ */ new Set(),
    _descriptors: _descriptors(proxy, descriptorDefaults),
    setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),
    override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)
  };
  return new Proxy(cache2, {
    /**
    * A trap for the delete operator.
    */
    deleteProperty(target, prop) {
      delete target[prop];
      delete proxy[prop];
      return true;
    },
    /**
    * A trap for getting property values.
    */
    get(target, prop, receiver) {
      return _cached(target, prop, () => _resolveWithContext(target, prop, receiver));
    },
    /**
    * A trap for Object.getOwnPropertyDescriptor.
    * Also used by Object.hasOwnProperty.
    */
    getOwnPropertyDescriptor(target, prop) {
      return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {
        enumerable: true,
        configurable: true
      } : void 0 : Reflect.getOwnPropertyDescriptor(proxy, prop);
    },
    /**
    * A trap for Object.getPrototypeOf.
    */
    getPrototypeOf() {
      return Reflect.getPrototypeOf(proxy);
    },
    /**
    * A trap for the in operator.
    */
    has(target, prop) {
      return Reflect.has(proxy, prop);
    },
    /**
    * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.
    */
    ownKeys() {
      return Reflect.ownKeys(proxy);
    },
    /**
    * A trap for setting property values.
    */
    set(target, prop, value) {
      proxy[prop] = value;
      delete target[prop];
      return true;
    }
  });
}
function _descriptors(proxy, defaults2 = {
  scriptable: true,
  indexable: true
}) {
  const { _scriptable = defaults2.scriptable, _indexable = defaults2.indexable, _allKeys = defaults2.allKeys } = proxy;
  return {
    allKeys: _allKeys,
    scriptable: _scriptable,
    indexable: _indexable,
    isScriptable: isFunction2(_scriptable) ? _scriptable : () => _scriptable,
    isIndexable: isFunction2(_indexable) ? _indexable : () => _indexable
  };
}
var readKey = (prefix2, name) => prefix2 ? prefix2 + _capitalize(name) : name;
var needsSubResolver = (prop, value) => isObject(value) && prop !== "adapters" && (Object.getPrototypeOf(value) === null || value.constructor === Object);
function _cached(target, prop, resolve2) {
  if (Object.prototype.hasOwnProperty.call(target, prop) || prop === "constructor") {
    return target[prop];
  }
  const value = resolve2();
  target[prop] = value;
  return value;
}
function _resolveWithContext(target, prop, receiver) {
  const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
  let value = _proxy[prop];
  if (isFunction2(value) && descriptors2.isScriptable(prop)) {
    value = _resolveScriptable(prop, value, target, receiver);
  }
  if (isArray(value) && value.length) {
    value = _resolveArray(prop, value, target, descriptors2.isIndexable);
  }
  if (needsSubResolver(prop, value)) {
    value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors2);
  }
  return value;
}
function _resolveScriptable(prop, getValue2, target, receiver) {
  const { _proxy, _context, _subProxy, _stack } = target;
  if (_stack.has(prop)) {
    throw new Error("Recursion detected: " + Array.from(_stack).join("->") + "->" + prop);
  }
  _stack.add(prop);
  let value = getValue2(_context, _subProxy || receiver);
  _stack.delete(prop);
  if (needsSubResolver(prop, value)) {
    value = createSubResolver(_proxy._scopes, _proxy, prop, value);
  }
  return value;
}
function _resolveArray(prop, value, target, isIndexable) {
  const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
  if (typeof _context.index !== "undefined" && isIndexable(prop)) {
    return value[_context.index % value.length];
  } else if (isObject(value[0])) {
    const arr = value;
    const scopes = _proxy._scopes.filter((s6) => s6 !== arr);
    value = [];
    for (const item of arr) {
      const resolver = createSubResolver(scopes, _proxy, prop, item);
      value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors2));
    }
  }
  return value;
}
function resolveFallback(fallback, prop, value) {
  return isFunction2(fallback) ? fallback(prop, value) : fallback;
}
var getScope = (key, parent) => key === true ? parent : typeof key === "string" ? resolveObjectKey(parent, key) : void 0;
function addScopes(set2, parentScopes, key, parentFallback, value) {
  for (const parent of parentScopes) {
    const scope = getScope(key, parent);
    if (scope) {
      set2.add(scope);
      const fallback = resolveFallback(scope._fallback, key, value);
      if (typeof fallback !== "undefined" && fallback !== key && fallback !== parentFallback) {
        return fallback;
      }
    } else if (scope === false && typeof parentFallback !== "undefined" && key !== parentFallback) {
      return null;
    }
  }
  return false;
}
function createSubResolver(parentScopes, resolver, prop, value) {
  const rootScopes = resolver._rootScopes;
  const fallback = resolveFallback(resolver._fallback, prop, value);
  const allScopes = [
    ...parentScopes,
    ...rootScopes
  ];
  const set2 = /* @__PURE__ */ new Set();
  set2.add(value);
  let key = addScopesFromKey(set2, allScopes, prop, fallback || prop, value);
  if (key === null) {
    return false;
  }
  if (typeof fallback !== "undefined" && fallback !== prop) {
    key = addScopesFromKey(set2, allScopes, fallback, key, value);
    if (key === null) {
      return false;
    }
  }
  return _createResolver(Array.from(set2), [
    ""
  ], rootScopes, fallback, () => subGetTarget(resolver, prop, value));
}
function addScopesFromKey(set2, allScopes, key, fallback, item) {
  while (key) {
    key = addScopes(set2, allScopes, key, fallback, item);
  }
  return key;
}
function subGetTarget(resolver, prop, value) {
  const parent = resolver._getTarget();
  if (!(prop in parent)) {
    parent[prop] = {};
  }
  const target = parent[prop];
  if (isArray(target) && isObject(value)) {
    return value;
  }
  return target || {};
}
function _resolveWithPrefixes(prop, prefixes, scopes, proxy) {
  let value;
  for (const prefix2 of prefixes) {
    value = _resolve(readKey(prefix2, prop), scopes);
    if (typeof value !== "undefined") {
      return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;
    }
  }
}
function _resolve(key, scopes) {
  for (const scope of scopes) {
    if (!scope) {
      continue;
    }
    const value = scope[key];
    if (typeof value !== "undefined") {
      return value;
    }
  }
}
function getKeysFromAllScopes(target) {
  let keys = target._keys;
  if (!keys) {
    keys = target._keys = resolveKeysFromAllScopes(target._scopes);
  }
  return keys;
}
function resolveKeysFromAllScopes(scopes) {
  const set2 = /* @__PURE__ */ new Set();
  for (const scope of scopes) {
    for (const key of Object.keys(scope).filter((k6) => !k6.startsWith("_"))) {
      set2.add(key);
    }
  }
  return Array.from(set2);
}
var EPSILON = Number.EPSILON || 1e-14;
var getPoint = (points, i5) => i5 < points.length && !points[i5].skip && points[i5];
var getValueAxis = (indexAxis) => indexAxis === "x" ? "y" : "x";
function splineCurve(firstPoint, middlePoint, afterPoint, t5) {
  const previous = firstPoint.skip ? middlePoint : firstPoint;
  const current = middlePoint;
  const next = afterPoint.skip ? middlePoint : afterPoint;
  const d01 = distanceBetweenPoints(current, previous);
  const d12 = distanceBetweenPoints(next, current);
  let s01 = d01 / (d01 + d12);
  let s12 = d12 / (d01 + d12);
  s01 = isNaN(s01) ? 0 : s01;
  s12 = isNaN(s12) ? 0 : s12;
  const fa = t5 * s01;
  const fb = t5 * s12;
  return {
    previous: {
      x: current.x - fa * (next.x - previous.x),
      y: current.y - fa * (next.y - previous.y)
    },
    next: {
      x: current.x + fb * (next.x - previous.x),
      y: current.y + fb * (next.y - previous.y)
    }
  };
}
function monotoneAdjust(points, deltaK, mK) {
  const pointsLen = points.length;
  let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;
  let pointAfter = getPoint(points, 0);
  for (let i5 = 0; i5 < pointsLen - 1; ++i5) {
    pointCurrent = pointAfter;
    pointAfter = getPoint(points, i5 + 1);
    if (!pointCurrent || !pointAfter) {
      continue;
    }
    if (almostEquals(deltaK[i5], 0, EPSILON)) {
      mK[i5] = mK[i5 + 1] = 0;
      continue;
    }
    alphaK = mK[i5] / deltaK[i5];
    betaK = mK[i5 + 1] / deltaK[i5];
    squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
    if (squaredMagnitude <= 9) {
      continue;
    }
    tauK = 3 / Math.sqrt(squaredMagnitude);
    mK[i5] = alphaK * tauK * deltaK[i5];
    mK[i5 + 1] = betaK * tauK * deltaK[i5];
  }
}
function monotoneCompute(points, mK, indexAxis = "x") {
  const valueAxis = getValueAxis(indexAxis);
  const pointsLen = points.length;
  let delta, pointBefore, pointCurrent;
  let pointAfter = getPoint(points, 0);
  for (let i5 = 0; i5 < pointsLen; ++i5) {
    pointBefore = pointCurrent;
    pointCurrent = pointAfter;
    pointAfter = getPoint(points, i5 + 1);
    if (!pointCurrent) {
      continue;
    }
    const iPixel = pointCurrent[indexAxis];
    const vPixel = pointCurrent[valueAxis];
    if (pointBefore) {
      delta = (iPixel - pointBefore[indexAxis]) / 3;
      pointCurrent[`cp1${indexAxis}`] = iPixel - delta;
      pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i5];
    }
    if (pointAfter) {
      delta = (pointAfter[indexAxis] - iPixel) / 3;
      pointCurrent[`cp2${indexAxis}`] = iPixel + delta;
      pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i5];
    }
  }
}
function splineCurveMonotone(points, indexAxis = "x") {
  const valueAxis = getValueAxis(indexAxis);
  const pointsLen = points.length;
  const deltaK = Array(pointsLen).fill(0);
  const mK = Array(pointsLen);
  let i5, pointBefore, pointCurrent;
  let pointAfter = getPoint(points, 0);
  for (i5 = 0; i5 < pointsLen; ++i5) {
    pointBefore = pointCurrent;
    pointCurrent = pointAfter;
    pointAfter = getPoint(points, i5 + 1);
    if (!pointCurrent) {
      continue;
    }
    if (pointAfter) {
      const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];
      deltaK[i5] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;
    }
    mK[i5] = !pointBefore ? deltaK[i5] : !pointAfter ? deltaK[i5 - 1] : sign2(deltaK[i5 - 1]) !== sign2(deltaK[i5]) ? 0 : (deltaK[i5 - 1] + deltaK[i5]) / 2;
  }
  monotoneAdjust(points, deltaK, mK);
  monotoneCompute(points, mK, indexAxis);
}
function capControlPoint(pt, min, max) {
  return Math.max(Math.min(pt, max), min);
}
function capBezierPoints(points, area) {
  let i5, ilen, point, inArea, inAreaPrev;
  let inAreaNext = _isPointInArea(points[0], area);
  for (i5 = 0, ilen = points.length; i5 < ilen; ++i5) {
    inAreaPrev = inArea;
    inArea = inAreaNext;
    inAreaNext = i5 < ilen - 1 && _isPointInArea(points[i5 + 1], area);
    if (!inArea) {
      continue;
    }
    point = points[i5];
    if (inAreaPrev) {
      point.cp1x = capControlPoint(point.cp1x, area.left, area.right);
      point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);
    }
    if (inAreaNext) {
      point.cp2x = capControlPoint(point.cp2x, area.left, area.right);
      point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);
    }
  }
}
function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
  let i5, ilen, point, controlPoints;
  if (options.spanGaps) {
    points = points.filter((pt) => !pt.skip);
  }
  if (options.cubicInterpolationMode === "monotone") {
    splineCurveMonotone(points, indexAxis);
  } else {
    let prev = loop ? points[points.length - 1] : points[0];
    for (i5 = 0, ilen = points.length; i5 < ilen; ++i5) {
      point = points[i5];
      controlPoints = splineCurve(prev, point, points[Math.min(i5 + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);
      point.cp1x = controlPoints.previous.x;
      point.cp1y = controlPoints.previous.y;
      point.cp2x = controlPoints.next.x;
      point.cp2y = controlPoints.next.y;
      prev = point;
    }
  }
  if (options.capBezierPoints) {
    capBezierPoints(points, area);
  }
}
function _isDomSupported() {
  return typeof window !== "undefined" && typeof document !== "undefined";
}
function _getParentNode(domNode) {
  let parent = domNode.parentNode;
  if (parent && parent.toString() === "[object ShadowRoot]") {
    parent = parent.host;
  }
  return parent;
}
function parseMaxStyle(styleValue, node, parentProperty) {
  let valueInPixels;
  if (typeof styleValue === "string") {
    valueInPixels = parseInt(styleValue, 10);
    if (styleValue.indexOf("%") !== -1) {
      valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
    }
  } else {
    valueInPixels = styleValue;
  }
  return valueInPixels;
}
var getComputedStyle = (element) => element.ownerDocument.defaultView.getComputedStyle(element, null);
function getStyle(el, property) {
  return getComputedStyle(el).getPropertyValue(property);
}
var positions = [
  "top",
  "right",
  "bottom",
  "left"
];
function getPositionedStyle(styles, style, suffix) {
  const result = {};
  suffix = suffix ? "-" + suffix : "";
  for (let i5 = 0; i5 < 4; i5++) {
    const pos = positions[i5];
    result[pos] = parseFloat(styles[style + "-" + pos + suffix]) || 0;
  }
  result.width = result.left + result.right;
  result.height = result.top + result.bottom;
  return result;
}
var useOffsetPos = (x6, y6, target) => (x6 > 0 || y6 > 0) && (!target || !target.shadowRoot);
function getCanvasPosition(e5, canvas) {
  const touches = e5.touches;
  const source = touches && touches.length ? touches[0] : e5;
  const { offsetX, offsetY } = source;
  let box = false;
  let x6, y6;
  if (useOffsetPos(offsetX, offsetY, e5.target)) {
    x6 = offsetX;
    y6 = offsetY;
  } else {
    const rect = canvas.getBoundingClientRect();
    x6 = source.clientX - rect.left;
    y6 = source.clientY - rect.top;
    box = true;
  }
  return {
    x: x6,
    y: y6,
    box
  };
}
function getRelativePosition(event, chart) {
  if ("native" in event) {
    return event;
  }
  const { canvas, currentDevicePixelRatio } = chart;
  const style = getComputedStyle(canvas);
  const borderBox = style.boxSizing === "border-box";
  const paddings = getPositionedStyle(style, "padding");
  const borders = getPositionedStyle(style, "border", "width");
  const { x: x6, y: y6, box } = getCanvasPosition(event, canvas);
  const xOffset = paddings.left + (box && borders.left);
  const yOffset = paddings.top + (box && borders.top);
  let { width, height } = chart;
  if (borderBox) {
    width -= paddings.width + borders.width;
    height -= paddings.height + borders.height;
  }
  return {
    x: Math.round((x6 - xOffset) / width * canvas.width / currentDevicePixelRatio),
    y: Math.round((y6 - yOffset) / height * canvas.height / currentDevicePixelRatio)
  };
}
function getContainerSize(canvas, width, height) {
  let maxWidth, maxHeight;
  if (width === void 0 || height === void 0) {
    const container = canvas && _getParentNode(canvas);
    if (!container) {
      width = canvas.clientWidth;
      height = canvas.clientHeight;
    } else {
      const rect = container.getBoundingClientRect();
      const containerStyle = getComputedStyle(container);
      const containerBorder = getPositionedStyle(containerStyle, "border", "width");
      const containerPadding = getPositionedStyle(containerStyle, "padding");
      width = rect.width - containerPadding.width - containerBorder.width;
      height = rect.height - containerPadding.height - containerBorder.height;
      maxWidth = parseMaxStyle(containerStyle.maxWidth, container, "clientWidth");
      maxHeight = parseMaxStyle(containerStyle.maxHeight, container, "clientHeight");
    }
  }
  return {
    width,
    height,
    maxWidth: maxWidth || INFINITY,
    maxHeight: maxHeight || INFINITY
  };
}
var round1 = (v3) => Math.round(v3 * 10) / 10;
function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {
  const style = getComputedStyle(canvas);
  const margins = getPositionedStyle(style, "margin");
  const maxWidth = parseMaxStyle(style.maxWidth, canvas, "clientWidth") || INFINITY;
  const maxHeight = parseMaxStyle(style.maxHeight, canvas, "clientHeight") || INFINITY;
  const containerSize = getContainerSize(canvas, bbWidth, bbHeight);
  let { width, height } = containerSize;
  if (style.boxSizing === "content-box") {
    const borders = getPositionedStyle(style, "border", "width");
    const paddings = getPositionedStyle(style, "padding");
    width -= paddings.width + borders.width;
    height -= paddings.height + borders.height;
  }
  width = Math.max(0, width - margins.width);
  height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);
  width = round1(Math.min(width, maxWidth, containerSize.maxWidth));
  height = round1(Math.min(height, maxHeight, containerSize.maxHeight));
  if (width && !height) {
    height = round1(width / 2);
  }
  const maintainHeight = bbWidth !== void 0 || bbHeight !== void 0;
  if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {
    height = containerSize.height;
    width = round1(Math.floor(height * aspectRatio));
  }
  return {
    width,
    height
  };
}
function retinaScale(chart, forceRatio, forceStyle) {
  const pixelRatio = forceRatio || 1;
  const deviceHeight = Math.floor(chart.height * pixelRatio);
  const deviceWidth = Math.floor(chart.width * pixelRatio);
  chart.height = Math.floor(chart.height);
  chart.width = Math.floor(chart.width);
  const canvas = chart.canvas;
  if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {
    canvas.style.height = `${chart.height}px`;
    canvas.style.width = `${chart.width}px`;
  }
  if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {
    chart.currentDevicePixelRatio = pixelRatio;
    canvas.height = deviceHeight;
    canvas.width = deviceWidth;
    chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
    return true;
  }
  return false;
}
var supportsEventListenerOptions = function() {
  let passiveSupported = false;
  try {
    const options = {
      get passive() {
        passiveSupported = true;
        return false;
      }
    };
    if (_isDomSupported()) {
      window.addEventListener("test", null, options);
      window.removeEventListener("test", null, options);
    }
  } catch (e5) {
  }
  return passiveSupported;
}();
function readUsedSize(element, property) {
  const value = getStyle(element, property);
  const matches = value && value.match(/^(\d+)(\.\d+)?px$/);
  return matches ? +matches[1] : void 0;
}
function _pointInLine(p1, p22, t5, mode) {
  return {
    x: p1.x + t5 * (p22.x - p1.x),
    y: p1.y + t5 * (p22.y - p1.y)
  };
}
function _steppedInterpolation(p1, p22, t5, mode) {
  return {
    x: p1.x + t5 * (p22.x - p1.x),
    y: mode === "middle" ? t5 < 0.5 ? p1.y : p22.y : mode === "after" ? t5 < 1 ? p1.y : p22.y : t5 > 0 ? p22.y : p1.y
  };
}
function _bezierInterpolation(p1, p22, t5, mode) {
  const cp1 = {
    x: p1.cp2x,
    y: p1.cp2y
  };
  const cp2 = {
    x: p22.cp1x,
    y: p22.cp1y
  };
  const a6 = _pointInLine(p1, cp1, t5);
  const b5 = _pointInLine(cp1, cp2, t5);
  const c5 = _pointInLine(cp2, p22, t5);
  const d6 = _pointInLine(a6, b5, t5);
  const e5 = _pointInLine(b5, c5, t5);
  return _pointInLine(d6, e5, t5);
}
var getRightToLeftAdapter = function(rectX, width) {
  return {
    x(x6) {
      return rectX + rectX + width - x6;
    },
    setWidth(w6) {
      width = w6;
    },
    textAlign(align) {
      if (align === "center") {
        return align;
      }
      return align === "right" ? "left" : "right";
    },
    xPlus(x6, value) {
      return x6 - value;
    },
    leftForLtr(x6, itemWidth) {
      return x6 - itemWidth;
    }
  };
};
var getLeftToRightAdapter = function() {
  return {
    x(x6) {
      return x6;
    },
    setWidth(w6) {
    },
    textAlign(align) {
      return align;
    },
    xPlus(x6, value) {
      return x6 + value;
    },
    leftForLtr(x6, _itemWidth) {
      return x6;
    }
  };
};
function getRtlAdapter(rtl, rectX, width) {
  return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();
}
function overrideTextDirection(ctx, direction) {
  let style, original;
  if (direction === "ltr" || direction === "rtl") {
    style = ctx.canvas.style;
    original = [
      style.getPropertyValue("direction"),
      style.getPropertyPriority("direction")
    ];
    style.setProperty("direction", direction, "important");
    ctx.prevTextDirection = original;
  }
}
function restoreTextDirection(ctx, original) {
  if (original !== void 0) {
    delete ctx.prevTextDirection;
    ctx.canvas.style.setProperty("direction", original[0], original[1]);
  }
}
function propertyFn(property) {
  if (property === "angle") {
    return {
      between: _angleBetween,
      compare: _angleDiff,
      normalize: _normalizeAngle
    };
  }
  return {
    between: _isBetween,
    compare: (a6, b5) => a6 - b5,
    normalize: (x6) => x6
  };
}
function normalizeSegment({ start, end, count, loop, style }) {
  return {
    start: start % count,
    end: end % count,
    loop: loop && (end - start + 1) % count === 0,
    style
  };
}
function getSegment(segment, points, bounds) {
  const { property, start: startBound, end: endBound } = bounds;
  const { between, normalize: normalize2 } = propertyFn(property);
  const count = points.length;
  let { start, end, loop } = segment;
  let i5, ilen;
  if (loop) {
    start += count;
    end += count;
    for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
      if (!between(normalize2(points[start % count][property]), startBound, endBound)) {
        break;
      }
      start--;
      end--;
    }
    start %= count;
    end %= count;
  }
  if (end < start) {
    end += count;
  }
  return {
    start,
    end,
    loop,
    style: segment.style
  };
}
function _boundSegment(segment, points, bounds) {
  if (!bounds) {
    return [
      segment
    ];
  }
  const { property, start: startBound, end: endBound } = bounds;
  const count = points.length;
  const { compare: compare2, between, normalize: normalize2 } = propertyFn(property);
  const { start, end, loop, style } = getSegment(segment, points, bounds);
  const result = [];
  let inside = false;
  let subStart = null;
  let value, point, prevValue;
  const startIsBefore = () => between(startBound, prevValue, value) && compare2(startBound, prevValue) !== 0;
  const endIsBefore = () => compare2(endBound, value) === 0 || between(endBound, prevValue, value);
  const shouldStart = () => inside || startIsBefore();
  const shouldStop = () => !inside || endIsBefore();
  for (let i5 = start, prev = start; i5 <= end; ++i5) {
    point = points[i5 % count];
    if (point.skip) {
      continue;
    }
    value = normalize2(point[property]);
    if (value === prevValue) {
      continue;
    }
    inside = between(value, startBound, endBound);
    if (subStart === null && shouldStart()) {
      subStart = compare2(value, startBound) === 0 ? i5 : prev;
    }
    if (subStart !== null && shouldStop()) {
      result.push(normalizeSegment({
        start: subStart,
        end: i5,
        loop,
        count,
        style
      }));
      subStart = null;
    }
    prev = i5;
    prevValue = value;
  }
  if (subStart !== null) {
    result.push(normalizeSegment({
      start: subStart,
      end,
      loop,
      count,
      style
    }));
  }
  return result;
}
function _boundSegments(line, bounds) {
  const result = [];
  const segments = line.segments;
  for (let i5 = 0; i5 < segments.length; i5++) {
    const sub = _boundSegment(segments[i5], line.points, bounds);
    if (sub.length) {
      result.push(...sub);
    }
  }
  return result;
}
function findStartAndEnd(points, count, loop, spanGaps) {
  let start = 0;
  let end = count - 1;
  if (loop && !spanGaps) {
    while (start < count && !points[start].skip) {
      start++;
    }
  }
  while (start < count && points[start].skip) {
    start++;
  }
  start %= count;
  if (loop) {
    end += start;
  }
  while (end > start && points[end % count].skip) {
    end--;
  }
  end %= count;
  return {
    start,
    end
  };
}
function solidSegments(points, start, max, loop) {
  const count = points.length;
  const result = [];
  let last = start;
  let prev = points[start];
  let end;
  for (end = start + 1; end <= max; ++end) {
    const cur = points[end % count];
    if (cur.skip || cur.stop) {
      if (!prev.skip) {
        loop = false;
        result.push({
          start: start % count,
          end: (end - 1) % count,
          loop
        });
        start = last = cur.stop ? end : null;
      }
    } else {
      last = end;
      if (prev.skip) {
        start = end;
      }
    }
    prev = cur;
  }
  if (last !== null) {
    result.push({
      start: start % count,
      end: last % count,
      loop
    });
  }
  return result;
}
function _computeSegments(line, segmentOptions) {
  const points = line.points;
  const spanGaps = line.options.spanGaps;
  const count = points.length;
  if (!count) {
    return [];
  }
  const loop = !!line._loop;
  const { start, end } = findStartAndEnd(points, count, loop, spanGaps);
  if (spanGaps === true) {
    return splitByStyles(line, [
      {
        start,
        end,
        loop
      }
    ], points, segmentOptions);
  }
  const max = end < start ? end + count : end;
  const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;
  return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);
}
function splitByStyles(line, segments, points, segmentOptions) {
  if (!segmentOptions || !segmentOptions.setContext || !points) {
    return segments;
  }
  return doSplitByStyles(line, segments, points, segmentOptions);
}
function doSplitByStyles(line, segments, points, segmentOptions) {
  const chartContext = line._chart.getContext();
  const baseStyle = readStyle(line.options);
  const { _datasetIndex: datasetIndex, options: { spanGaps } } = line;
  const count = points.length;
  const result = [];
  let prevStyle = baseStyle;
  let start = segments[0].start;
  let i5 = start;
  function addStyle(s6, e5, l3, st) {
    const dir = spanGaps ? -1 : 1;
    if (s6 === e5) {
      return;
    }
    s6 += count;
    while (points[s6 % count].skip) {
      s6 -= dir;
    }
    while (points[e5 % count].skip) {
      e5 += dir;
    }
    if (s6 % count !== e5 % count) {
      result.push({
        start: s6 % count,
        end: e5 % count,
        loop: l3,
        style: st
      });
      prevStyle = st;
      start = e5 % count;
    }
  }
  for (const segment of segments) {
    start = spanGaps ? start : segment.start;
    let prev = points[start % count];
    let style;
    for (i5 = start + 1; i5 <= segment.end; i5++) {
      const pt = points[i5 % count];
      style = readStyle(segmentOptions.setContext(createContext(chartContext, {
        type: "segment",
        p0: prev,
        p1: pt,
        p0DataIndex: (i5 - 1) % count,
        p1DataIndex: i5 % count,
        datasetIndex
      })));
      if (styleChanged(style, prevStyle)) {
        addStyle(start, i5 - 1, segment.loop, prevStyle);
      }
      prev = pt;
      prevStyle = style;
    }
    if (start < i5 - 1) {
      addStyle(start, i5 - 1, segment.loop, prevStyle);
    }
  }
  return result;
}
function readStyle(options) {
  return {
    backgroundColor: options.backgroundColor,
    borderCapStyle: options.borderCapStyle,
    borderDash: options.borderDash,
    borderDashOffset: options.borderDashOffset,
    borderJoinStyle: options.borderJoinStyle,
    borderWidth: options.borderWidth,
    borderColor: options.borderColor
  };
}
function styleChanged(style, prevStyle) {
  if (!prevStyle) {
    return false;
  }
  const cache2 = [];
  const replacer = function(key, value) {
    if (!isPatternOrGradient(value)) {
      return value;
    }
    if (!cache2.includes(value)) {
      cache2.push(value);
    }
    return cache2.indexOf(value);
  };
  return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);
}
function getSizeForArea(scale, chartArea, field) {
  return scale.options.clip ? scale[field] : chartArea[field];
}
function getDatasetArea(meta, chartArea) {
  const { xScale, yScale } = meta;
  if (xScale && yScale) {
    return {
      left: getSizeForArea(xScale, chartArea, "left"),
      right: getSizeForArea(xScale, chartArea, "right"),
      top: getSizeForArea(yScale, chartArea, "top"),
      bottom: getSizeForArea(yScale, chartArea, "bottom")
    };
  }
  return chartArea;
}
function getDatasetClipArea(chart, meta) {
  const clip = meta._clip;
  if (clip.disabled) {
    return false;
  }
  const area = getDatasetArea(meta, chart.chartArea);
  return {
    left: clip.left === false ? 0 : area.left - (clip.left === true ? 0 : clip.left),
    right: clip.right === false ? chart.width : area.right + (clip.right === true ? 0 : clip.right),
    top: clip.top === false ? 0 : area.top - (clip.top === true ? 0 : clip.top),
    bottom: clip.bottom === false ? chart.height : area.bottom + (clip.bottom === true ? 0 : clip.bottom)
  };
}

// ../../node_modules/.pnpm/chart.js@4.5.0/node_modules/chart.js/dist/chart.js
var Animator = class {
  constructor() {
    this._request = null;
    this._charts = /* @__PURE__ */ new Map();
    this._running = false;
    this._lastDate = void 0;
  }
  _notify(chart, anims, date, type) {
    const callbacks = anims.listeners[type];
    const numSteps = anims.duration;
    callbacks.forEach((fn2) => fn2({
      chart,
      initial: anims.initial,
      numSteps,
      currentStep: Math.min(date - anims.start, numSteps)
    }));
  }
  _refresh() {
    if (this._request) {
      return;
    }
    this._running = true;
    this._request = requestAnimFrame.call(window, () => {
      this._update();
      this._request = null;
      if (this._running) {
        this._refresh();
      }
    });
  }
  _update(date = Date.now()) {
    let remaining = 0;
    this._charts.forEach((anims, chart) => {
      if (!anims.running || !anims.items.length) {
        return;
      }
      const items = anims.items;
      let i5 = items.length - 1;
      let draw2 = false;
      let item;
      for (; i5 >= 0; --i5) {
        item = items[i5];
        if (item._active) {
          if (item._total > anims.duration) {
            anims.duration = item._total;
          }
          item.tick(date);
          draw2 = true;
        } else {
          items[i5] = items[items.length - 1];
          items.pop();
        }
      }
      if (draw2) {
        chart.draw();
        this._notify(chart, anims, date, "progress");
      }
      if (!items.length) {
        anims.running = false;
        this._notify(chart, anims, date, "complete");
        anims.initial = false;
      }
      remaining += items.length;
    });
    this._lastDate = date;
    if (remaining === 0) {
      this._running = false;
    }
  }
  _getAnims(chart) {
    const charts = this._charts;
    let anims = charts.get(chart);
    if (!anims) {
      anims = {
        running: false,
        initial: true,
        items: [],
        listeners: {
          complete: [],
          progress: []
        }
      };
      charts.set(chart, anims);
    }
    return anims;
  }
  listen(chart, event, cb) {
    this._getAnims(chart).listeners[event].push(cb);
  }
  add(chart, items) {
    if (!items || !items.length) {
      return;
    }
    this._getAnims(chart).items.push(...items);
  }
  has(chart) {
    return this._getAnims(chart).items.length > 0;
  }
  start(chart) {
    const anims = this._charts.get(chart);
    if (!anims) {
      return;
    }
    anims.running = true;
    anims.start = Date.now();
    anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);
    this._refresh();
  }
  running(chart) {
    if (!this._running) {
      return false;
    }
    const anims = this._charts.get(chart);
    if (!anims || !anims.running || !anims.items.length) {
      return false;
    }
    return true;
  }
  stop(chart) {
    const anims = this._charts.get(chart);
    if (!anims || !anims.items.length) {
      return;
    }
    const items = anims.items;
    let i5 = items.length - 1;
    for (; i5 >= 0; --i5) {
      items[i5].cancel();
    }
    anims.items = [];
    this._notify(chart, anims, Date.now(), "complete");
  }
  remove(chart) {
    return this._charts.delete(chart);
  }
};
var animator = /* @__PURE__ */ new Animator();
var transparent = "transparent";
var interpolators = {
  boolean(from2, to2, factor) {
    return factor > 0.5 ? to2 : from2;
  },
  color(from2, to2, factor) {
    const c0 = color(from2 || transparent);
    const c1 = c0.valid && color(to2 || transparent);
    return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to2;
  },
  number(from2, to2, factor) {
    return from2 + (to2 - from2) * factor;
  }
};
var Animation = class {
  constructor(cfg, target, prop, to2) {
    const currentValue = target[prop];
    to2 = resolve([
      cfg.to,
      to2,
      currentValue,
      cfg.from
    ]);
    const from2 = resolve([
      cfg.from,
      currentValue,
      to2
    ]);
    this._active = true;
    this._fn = cfg.fn || interpolators[cfg.type || typeof from2];
    this._easing = effects[cfg.easing] || effects.linear;
    this._start = Math.floor(Date.now() + (cfg.delay || 0));
    this._duration = this._total = Math.floor(cfg.duration);
    this._loop = !!cfg.loop;
    this._target = target;
    this._prop = prop;
    this._from = from2;
    this._to = to2;
    this._promises = void 0;
  }
  active() {
    return this._active;
  }
  update(cfg, to2, date) {
    if (this._active) {
      this._notify(false);
      const currentValue = this._target[this._prop];
      const elapsed = date - this._start;
      const remain = this._duration - elapsed;
      this._start = date;
      this._duration = Math.floor(Math.max(remain, cfg.duration));
      this._total += elapsed;
      this._loop = !!cfg.loop;
      this._to = resolve([
        cfg.to,
        to2,
        currentValue,
        cfg.from
      ]);
      this._from = resolve([
        cfg.from,
        currentValue,
        to2
      ]);
    }
  }
  cancel() {
    if (this._active) {
      this.tick(Date.now());
      this._active = false;
      this._notify(false);
    }
  }
  tick(date) {
    const elapsed = date - this._start;
    const duration = this._duration;
    const prop = this._prop;
    const from2 = this._from;
    const loop = this._loop;
    const to2 = this._to;
    let factor;
    this._active = from2 !== to2 && (loop || elapsed < duration);
    if (!this._active) {
      this._target[prop] = to2;
      this._notify(true);
      return;
    }
    if (elapsed < 0) {
      this._target[prop] = from2;
      return;
    }
    factor = elapsed / duration % 2;
    factor = loop && factor > 1 ? 2 - factor : factor;
    factor = this._easing(Math.min(1, Math.max(0, factor)));
    this._target[prop] = this._fn(from2, to2, factor);
  }
  wait() {
    const promises = this._promises || (this._promises = []);
    return new Promise((res, rej) => {
      promises.push({
        res,
        rej
      });
    });
  }
  _notify(resolved) {
    const method = resolved ? "res" : "rej";
    const promises = this._promises || [];
    for (let i5 = 0; i5 < promises.length; i5++) {
      promises[i5][method]();
    }
  }
};
var Animations = class {
  constructor(chart, config) {
    this._chart = chart;
    this._properties = /* @__PURE__ */ new Map();
    this.configure(config);
  }
  configure(config) {
    if (!isObject(config)) {
      return;
    }
    const animationOptions = Object.keys(defaults.animation);
    const animatedProps = this._properties;
    Object.getOwnPropertyNames(config).forEach((key) => {
      const cfg = config[key];
      if (!isObject(cfg)) {
        return;
      }
      const resolved = {};
      for (const option of animationOptions) {
        resolved[option] = cfg[option];
      }
      (isArray(cfg.properties) && cfg.properties || [
        key
      ]).forEach((prop) => {
        if (prop === key || !animatedProps.has(prop)) {
          animatedProps.set(prop, resolved);
        }
      });
    });
  }
  _animateOptions(target, values) {
    const newOptions = values.options;
    const options = resolveTargetOptions(target, newOptions);
    if (!options) {
      return [];
    }
    const animations = this._createAnimations(options, newOptions);
    if (newOptions.$shared) {
      awaitAll(target.options.$animations, newOptions).then(() => {
        target.options = newOptions;
      }, () => {
      });
    }
    return animations;
  }
  _createAnimations(target, values) {
    const animatedProps = this._properties;
    const animations = [];
    const running = target.$animations || (target.$animations = {});
    const props = Object.keys(values);
    const date = Date.now();
    let i5;
    for (i5 = props.length - 1; i5 >= 0; --i5) {
      const prop = props[i5];
      if (prop.charAt(0) === "$") {
        continue;
      }
      if (prop === "options") {
        animations.push(...this._animateOptions(target, values));
        continue;
      }
      const value = values[prop];
      let animation = running[prop];
      const cfg = animatedProps.get(prop);
      if (animation) {
        if (cfg && animation.active()) {
          animation.update(cfg, value, date);
          continue;
        } else {
          animation.cancel();
        }
      }
      if (!cfg || !cfg.duration) {
        target[prop] = value;
        continue;
      }
      running[prop] = animation = new Animation(cfg, target, prop, value);
      animations.push(animation);
    }
    return animations;
  }
  update(target, values) {
    if (this._properties.size === 0) {
      Object.assign(target, values);
      return;
    }
    const animations = this._createAnimations(target, values);
    if (animations.length) {
      animator.add(this._chart, animations);
      return true;
    }
  }
};
function awaitAll(animations, properties) {
  const running = [];
  const keys = Object.keys(properties);
  for (let i5 = 0; i5 < keys.length; i5++) {
    const anim = animations[keys[i5]];
    if (anim && anim.active()) {
      running.push(anim.wait());
    }
  }
  return Promise.all(running);
}
function resolveTargetOptions(target, newOptions) {
  if (!newOptions) {
    return;
  }
  let options = target.options;
  if (!options) {
    target.options = newOptions;
    return;
  }
  if (options.$shared) {
    target.options = options = Object.assign({}, options, {
      $shared: false,
      $animations: {}
    });
  }
  return options;
}
function scaleClip(scale, allowedOverflow) {
  const opts = scale && scale.options || {};
  const reverse = opts.reverse;
  const min = opts.min === void 0 ? allowedOverflow : 0;
  const max = opts.max === void 0 ? allowedOverflow : 0;
  return {
    start: reverse ? max : min,
    end: reverse ? min : max
  };
}
function defaultClip(xScale, yScale, allowedOverflow) {
  if (allowedOverflow === false) {
    return false;
  }
  const x6 = scaleClip(xScale, allowedOverflow);
  const y6 = scaleClip(yScale, allowedOverflow);
  return {
    top: y6.end,
    right: x6.end,
    bottom: y6.start,
    left: x6.start
  };
}
function toClip(value) {
  let t5, r3, b5, l3;
  if (isObject(value)) {
    t5 = value.top;
    r3 = value.right;
    b5 = value.bottom;
    l3 = value.left;
  } else {
    t5 = r3 = b5 = l3 = value;
  }
  return {
    top: t5,
    right: r3,
    bottom: b5,
    left: l3,
    disabled: value === false
  };
}
function getSortedDatasetIndices(chart, filterVisible) {
  const keys = [];
  const metasets = chart._getSortedDatasetMetas(filterVisible);
  let i5, ilen;
  for (i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
    keys.push(metasets[i5].index);
  }
  return keys;
}
function applyStack(stack, value, dsIndex, options = {}) {
  const keys = stack.keys;
  const singleMode = options.mode === "single";
  let i5, ilen, datasetIndex, otherValue;
  if (value === null) {
    return;
  }
  let found = false;
  for (i5 = 0, ilen = keys.length; i5 < ilen; ++i5) {
    datasetIndex = +keys[i5];
    if (datasetIndex === dsIndex) {
      found = true;
      if (options.all) {
        continue;
      }
      break;
    }
    otherValue = stack.values[datasetIndex];
    if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign2(value) === sign2(otherValue))) {
      value += otherValue;
    }
  }
  if (!found && !options.all) {
    return 0;
  }
  return value;
}
function convertObjectDataToArray(data, meta) {
  const { iScale, vScale } = meta;
  const iAxisKey = iScale.axis === "x" ? "x" : "y";
  const vAxisKey = vScale.axis === "x" ? "x" : "y";
  const keys = Object.keys(data);
  const adata = new Array(keys.length);
  let i5, ilen, key;
  for (i5 = 0, ilen = keys.length; i5 < ilen; ++i5) {
    key = keys[i5];
    adata[i5] = {
      [iAxisKey]: key,
      [vAxisKey]: data[key]
    };
  }
  return adata;
}
function isStacked(scale, meta) {
  const stacked = scale && scale.options.stacked;
  return stacked || stacked === void 0 && meta.stack !== void 0;
}
function getStackKey(indexScale, valueScale, meta) {
  return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;
}
function getUserBounds(scale) {
  const { min, max, minDefined, maxDefined } = scale.getUserBounds();
  return {
    min: minDefined ? min : Number.NEGATIVE_INFINITY,
    max: maxDefined ? max : Number.POSITIVE_INFINITY
  };
}
function getOrCreateStack(stacks, stackKey, indexValue) {
  const subStack = stacks[stackKey] || (stacks[stackKey] = {});
  return subStack[indexValue] || (subStack[indexValue] = {});
}
function getLastIndexInStack(stack, vScale, positive, type) {
  for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {
    const value = stack[meta.index];
    if (positive && value > 0 || !positive && value < 0) {
      return meta.index;
    }
  }
  return null;
}
function updateStacks(controller, parsed) {
  const { chart, _cachedMeta: meta } = controller;
  const stacks = chart._stacks || (chart._stacks = {});
  const { iScale, vScale, index: datasetIndex } = meta;
  const iAxis = iScale.axis;
  const vAxis = vScale.axis;
  const key = getStackKey(iScale, vScale, meta);
  const ilen = parsed.length;
  let stack;
  for (let i5 = 0; i5 < ilen; ++i5) {
    const item = parsed[i5];
    const { [iAxis]: index2, [vAxis]: value } = item;
    const itemStacks = item._stacks || (item._stacks = {});
    stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index2);
    stack[datasetIndex] = value;
    stack._top = getLastIndexInStack(stack, vScale, true, meta.type);
    stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);
    const visualValues = stack._visualValues || (stack._visualValues = {});
    visualValues[datasetIndex] = value;
  }
}
function getFirstScaleId(chart, axis) {
  const scales = chart.scales;
  return Object.keys(scales).filter((key) => scales[key].axis === axis).shift();
}
function createDatasetContext(parent, index2) {
  return createContext(parent, {
    active: false,
    dataset: void 0,
    datasetIndex: index2,
    index: index2,
    mode: "default",
    type: "dataset"
  });
}
function createDataContext(parent, index2, element) {
  return createContext(parent, {
    active: false,
    dataIndex: index2,
    parsed: void 0,
    raw: void 0,
    element,
    index: index2,
    mode: "default",
    type: "data"
  });
}
function clearStacks(meta, items) {
  const datasetIndex = meta.controller.index;
  const axis = meta.vScale && meta.vScale.axis;
  if (!axis) {
    return;
  }
  items = items || meta._parsed;
  for (const parsed of items) {
    const stacks = parsed._stacks;
    if (!stacks || stacks[axis] === void 0 || stacks[axis][datasetIndex] === void 0) {
      return;
    }
    delete stacks[axis][datasetIndex];
    if (stacks[axis]._visualValues !== void 0 && stacks[axis]._visualValues[datasetIndex] !== void 0) {
      delete stacks[axis]._visualValues[datasetIndex];
    }
  }
}
var isDirectUpdateMode = (mode) => mode === "reset" || mode === "none";
var cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);
var createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked && {
  keys: getSortedDatasetIndices(chart, true),
  values: null
};
var DatasetController = class {
  constructor(chart, datasetIndex) {
    this.chart = chart;
    this._ctx = chart.ctx;
    this.index = datasetIndex;
    this._cachedDataOpts = {};
    this._cachedMeta = this.getMeta();
    this._type = this._cachedMeta.type;
    this.options = void 0;
    this._parsing = false;
    this._data = void 0;
    this._objectData = void 0;
    this._sharedOptions = void 0;
    this._drawStart = void 0;
    this._drawCount = void 0;
    this.enableOptionSharing = false;
    this.supportsDecimation = false;
    this.$context = void 0;
    this._syncList = [];
    this.datasetElementType = new.target.datasetElementType;
    this.dataElementType = new.target.dataElementType;
    this.initialize();
  }
  initialize() {
    const meta = this._cachedMeta;
    this.configure();
    this.linkScales();
    meta._stacked = isStacked(meta.vScale, meta);
    this.addElements();
    if (this.options.fill && !this.chart.isPluginEnabled("filler")) {
      console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options");
    }
  }
  updateIndex(datasetIndex) {
    if (this.index !== datasetIndex) {
      clearStacks(this._cachedMeta);
    }
    this.index = datasetIndex;
  }
  linkScales() {
    const chart = this.chart;
    const meta = this._cachedMeta;
    const dataset = this.getDataset();
    const chooseId = (axis, x6, y6, r3) => axis === "x" ? x6 : axis === "r" ? r3 : y6;
    const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, "x"));
    const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, "y"));
    const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, "r"));
    const indexAxis = meta.indexAxis;
    const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);
    const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);
    meta.xScale = this.getScaleForId(xid);
    meta.yScale = this.getScaleForId(yid);
    meta.rScale = this.getScaleForId(rid);
    meta.iScale = this.getScaleForId(iid);
    meta.vScale = this.getScaleForId(vid);
  }
  getDataset() {
    return this.chart.data.datasets[this.index];
  }
  getMeta() {
    return this.chart.getDatasetMeta(this.index);
  }
  getScaleForId(scaleID) {
    return this.chart.scales[scaleID];
  }
  _getOtherScale(scale) {
    const meta = this._cachedMeta;
    return scale === meta.iScale ? meta.vScale : meta.iScale;
  }
  reset() {
    this._update("reset");
  }
  _destroy() {
    const meta = this._cachedMeta;
    if (this._data) {
      unlistenArrayEvents(this._data, this);
    }
    if (meta._stacked) {
      clearStacks(meta);
    }
  }
  _dataCheck() {
    const dataset = this.getDataset();
    const data = dataset.data || (dataset.data = []);
    const _data = this._data;
    if (isObject(data)) {
      const meta = this._cachedMeta;
      this._data = convertObjectDataToArray(data, meta);
    } else if (_data !== data) {
      if (_data) {
        unlistenArrayEvents(_data, this);
        const meta = this._cachedMeta;
        clearStacks(meta);
        meta._parsed = [];
      }
      if (data && Object.isExtensible(data)) {
        listenArrayEvents(data, this);
      }
      this._syncList = [];
      this._data = data;
    }
  }
  addElements() {
    const meta = this._cachedMeta;
    this._dataCheck();
    if (this.datasetElementType) {
      meta.dataset = new this.datasetElementType();
    }
  }
  buildOrUpdateElements(resetNewElements) {
    const meta = this._cachedMeta;
    const dataset = this.getDataset();
    let stackChanged = false;
    this._dataCheck();
    const oldStacked = meta._stacked;
    meta._stacked = isStacked(meta.vScale, meta);
    if (meta.stack !== dataset.stack) {
      stackChanged = true;
      clearStacks(meta);
      meta.stack = dataset.stack;
    }
    this._resyncElements(resetNewElements);
    if (stackChanged || oldStacked !== meta._stacked) {
      updateStacks(this, meta._parsed);
      meta._stacked = isStacked(meta.vScale, meta);
    }
  }
  configure() {
    const config = this.chart.config;
    const scopeKeys = config.datasetScopeKeys(this._type);
    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);
    this.options = config.createResolver(scopes, this.getContext());
    this._parsing = this.options.parsing;
    this._cachedDataOpts = {};
  }
  parse(start, count) {
    const { _cachedMeta: meta, _data: data } = this;
    const { iScale, _stacked } = meta;
    const iAxis = iScale.axis;
    let sorted = start === 0 && count === data.length ? true : meta._sorted;
    let prev = start > 0 && meta._parsed[start - 1];
    let i5, cur, parsed;
    if (this._parsing === false) {
      meta._parsed = data;
      meta._sorted = true;
      parsed = data;
    } else {
      if (isArray(data[start])) {
        parsed = this.parseArrayData(meta, data, start, count);
      } else if (isObject(data[start])) {
        parsed = this.parseObjectData(meta, data, start, count);
      } else {
        parsed = this.parsePrimitiveData(meta, data, start, count);
      }
      const isNotInOrderComparedToPrev = () => cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];
      for (i5 = 0; i5 < count; ++i5) {
        meta._parsed[i5 + start] = cur = parsed[i5];
        if (sorted) {
          if (isNotInOrderComparedToPrev()) {
            sorted = false;
          }
          prev = cur;
        }
      }
      meta._sorted = sorted;
    }
    if (_stacked) {
      updateStacks(this, parsed);
    }
  }
  parsePrimitiveData(meta, data, start, count) {
    const { iScale, vScale } = meta;
    const iAxis = iScale.axis;
    const vAxis = vScale.axis;
    const labels = iScale.getLabels();
    const singleScale = iScale === vScale;
    const parsed = new Array(count);
    let i5, ilen, index2;
    for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
      index2 = i5 + start;
      parsed[i5] = {
        [iAxis]: singleScale || iScale.parse(labels[index2], index2),
        [vAxis]: vScale.parse(data[index2], index2)
      };
    }
    return parsed;
  }
  parseArrayData(meta, data, start, count) {
    const { xScale, yScale } = meta;
    const parsed = new Array(count);
    let i5, ilen, index2, item;
    for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
      index2 = i5 + start;
      item = data[index2];
      parsed[i5] = {
        x: xScale.parse(item[0], index2),
        y: yScale.parse(item[1], index2)
      };
    }
    return parsed;
  }
  parseObjectData(meta, data, start, count) {
    const { xScale, yScale } = meta;
    const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
    const parsed = new Array(count);
    let i5, ilen, index2, item;
    for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
      index2 = i5 + start;
      item = data[index2];
      parsed[i5] = {
        x: xScale.parse(resolveObjectKey(item, xAxisKey), index2),
        y: yScale.parse(resolveObjectKey(item, yAxisKey), index2)
      };
    }
    return parsed;
  }
  getParsed(index2) {
    return this._cachedMeta._parsed[index2];
  }
  getDataElement(index2) {
    return this._cachedMeta.data[index2];
  }
  applyStack(scale, parsed, mode) {
    const chart = this.chart;
    const meta = this._cachedMeta;
    const value = parsed[scale.axis];
    const stack = {
      keys: getSortedDatasetIndices(chart, true),
      values: parsed._stacks[scale.axis]._visualValues
    };
    return applyStack(stack, value, meta.index, {
      mode
    });
  }
  updateRangeFromParsed(range, scale, parsed, stack) {
    const parsedValue = parsed[scale.axis];
    let value = parsedValue === null ? NaN : parsedValue;
    const values = stack && parsed._stacks[scale.axis];
    if (stack && values) {
      stack.values = values;
      value = applyStack(stack, parsedValue, this._cachedMeta.index);
    }
    range.min = Math.min(range.min, value);
    range.max = Math.max(range.max, value);
  }
  getMinMax(scale, canStack) {
    const meta = this._cachedMeta;
    const _parsed = meta._parsed;
    const sorted = meta._sorted && scale === meta.iScale;
    const ilen = _parsed.length;
    const otherScale = this._getOtherScale(scale);
    const stack = createStack(canStack, meta, this.chart);
    const range = {
      min: Number.POSITIVE_INFINITY,
      max: Number.NEGATIVE_INFINITY
    };
    const { min: otherMin, max: otherMax } = getUserBounds(otherScale);
    let i5, parsed;
    function _skip() {
      parsed = _parsed[i5];
      const otherValue = parsed[otherScale.axis];
      return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;
    }
    for (i5 = 0; i5 < ilen; ++i5) {
      if (_skip()) {
        continue;
      }
      this.updateRangeFromParsed(range, scale, parsed, stack);
      if (sorted) {
        break;
      }
    }
    if (sorted) {
      for (i5 = ilen - 1; i5 >= 0; --i5) {
        if (_skip()) {
          continue;
        }
        this.updateRangeFromParsed(range, scale, parsed, stack);
        break;
      }
    }
    return range;
  }
  getAllParsedValues(scale) {
    const parsed = this._cachedMeta._parsed;
    const values = [];
    let i5, ilen, value;
    for (i5 = 0, ilen = parsed.length; i5 < ilen; ++i5) {
      value = parsed[i5][scale.axis];
      if (isNumberFinite(value)) {
        values.push(value);
      }
    }
    return values;
  }
  getMaxOverflow() {
    return false;
  }
  getLabelAndValue(index2) {
    const meta = this._cachedMeta;
    const iScale = meta.iScale;
    const vScale = meta.vScale;
    const parsed = this.getParsed(index2);
    return {
      label: iScale ? "" + iScale.getLabelForValue(parsed[iScale.axis]) : "",
      value: vScale ? "" + vScale.getLabelForValue(parsed[vScale.axis]) : ""
    };
  }
  _update(mode) {
    const meta = this._cachedMeta;
    this.update(mode || "default");
    meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));
  }
  update(mode) {
  }
  draw() {
    const ctx = this._ctx;
    const chart = this.chart;
    const meta = this._cachedMeta;
    const elements = meta.data || [];
    const area = chart.chartArea;
    const active = [];
    const start = this._drawStart || 0;
    const count = this._drawCount || elements.length - start;
    const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;
    let i5;
    if (meta.dataset) {
      meta.dataset.draw(ctx, area, start, count);
    }
    for (i5 = start; i5 < start + count; ++i5) {
      const element = elements[i5];
      if (element.hidden) {
        continue;
      }
      if (element.active && drawActiveElementsOnTop) {
        active.push(element);
      } else {
        element.draw(ctx, area);
      }
    }
    for (i5 = 0; i5 < active.length; ++i5) {
      active[i5].draw(ctx, area);
    }
  }
  getStyle(index2, active) {
    const mode = active ? "active" : "default";
    return index2 === void 0 && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index2 || 0, mode);
  }
  getContext(index2, active, mode) {
    const dataset = this.getDataset();
    let context;
    if (index2 >= 0 && index2 < this._cachedMeta.data.length) {
      const element = this._cachedMeta.data[index2];
      context = element.$context || (element.$context = createDataContext(this.getContext(), index2, element));
      context.parsed = this.getParsed(index2);
      context.raw = dataset.data[index2];
      context.index = context.dataIndex = index2;
    } else {
      context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));
      context.dataset = dataset;
      context.index = context.datasetIndex = this.index;
    }
    context.active = !!active;
    context.mode = mode;
    return context;
  }
  resolveDatasetElementOptions(mode) {
    return this._resolveElementOptions(this.datasetElementType.id, mode);
  }
  resolveDataElementOptions(index2, mode) {
    return this._resolveElementOptions(this.dataElementType.id, mode, index2);
  }
  _resolveElementOptions(elementType, mode = "default", index2) {
    const active = mode === "active";
    const cache2 = this._cachedDataOpts;
    const cacheKey = elementType + "-" + mode;
    const cached = cache2[cacheKey];
    const sharing = this.enableOptionSharing && defined(index2);
    if (cached) {
      return cloneIfNotShared(cached, sharing);
    }
    const config = this.chart.config;
    const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);
    const prefixes = active ? [
      `${elementType}Hover`,
      "hover",
      elementType,
      ""
    ] : [
      elementType,
      ""
    ];
    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);
    const names3 = Object.keys(defaults.elements[elementType]);
    const context = () => this.getContext(index2, active, mode);
    const values = config.resolveNamedOptions(scopes, names3, context, prefixes);
    if (values.$shared) {
      values.$shared = sharing;
      cache2[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));
    }
    return values;
  }
  _resolveAnimations(index2, transition, active) {
    const chart = this.chart;
    const cache2 = this._cachedDataOpts;
    const cacheKey = `animation-${transition}`;
    const cached = cache2[cacheKey];
    if (cached) {
      return cached;
    }
    let options;
    if (chart.options.animation !== false) {
      const config = this.chart.config;
      const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);
      const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);
      options = config.createResolver(scopes, this.getContext(index2, active, transition));
    }
    const animations = new Animations(chart, options && options.animations);
    if (options && options._cacheable) {
      cache2[cacheKey] = Object.freeze(animations);
    }
    return animations;
  }
  getSharedOptions(options) {
    if (!options.$shared) {
      return;
    }
    return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));
  }
  includeOptions(mode, sharedOptions) {
    return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;
  }
  _getSharedOptions(start, mode) {
    const firstOpts = this.resolveDataElementOptions(start, mode);
    const previouslySharedOptions = this._sharedOptions;
    const sharedOptions = this.getSharedOptions(firstOpts);
    const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;
    this.updateSharedOptions(sharedOptions, mode, firstOpts);
    return {
      sharedOptions,
      includeOptions
    };
  }
  updateElement(element, index2, properties, mode) {
    if (isDirectUpdateMode(mode)) {
      Object.assign(element, properties);
    } else {
      this._resolveAnimations(index2, mode).update(element, properties);
    }
  }
  updateSharedOptions(sharedOptions, mode, newOptions) {
    if (sharedOptions && !isDirectUpdateMode(mode)) {
      this._resolveAnimations(void 0, mode).update(sharedOptions, newOptions);
    }
  }
  _setStyle(element, index2, mode, active) {
    element.active = active;
    const options = this.getStyle(index2, active);
    this._resolveAnimations(index2, mode, active).update(element, {
      options: !active && this.getSharedOptions(options) || options
    });
  }
  removeHoverStyle(element, datasetIndex, index2) {
    this._setStyle(element, index2, "active", false);
  }
  setHoverStyle(element, datasetIndex, index2) {
    this._setStyle(element, index2, "active", true);
  }
  _removeDatasetHoverStyle() {
    const element = this._cachedMeta.dataset;
    if (element) {
      this._setStyle(element, void 0, "active", false);
    }
  }
  _setDatasetHoverStyle() {
    const element = this._cachedMeta.dataset;
    if (element) {
      this._setStyle(element, void 0, "active", true);
    }
  }
  _resyncElements(resetNewElements) {
    const data = this._data;
    const elements = this._cachedMeta.data;
    for (const [method, arg1, arg2] of this._syncList) {
      this[method](arg1, arg2);
    }
    this._syncList = [];
    const numMeta = elements.length;
    const numData = data.length;
    const count = Math.min(numData, numMeta);
    if (count) {
      this.parse(0, count);
    }
    if (numData > numMeta) {
      this._insertElements(numMeta, numData - numMeta, resetNewElements);
    } else if (numData < numMeta) {
      this._removeElements(numData, numMeta - numData);
    }
  }
  _insertElements(start, count, resetNewElements = true) {
    const meta = this._cachedMeta;
    const data = meta.data;
    const end = start + count;
    let i5;
    const move = (arr) => {
      arr.length += count;
      for (i5 = arr.length - 1; i5 >= end; i5--) {
        arr[i5] = arr[i5 - count];
      }
    };
    move(data);
    for (i5 = start; i5 < end; ++i5) {
      data[i5] = new this.dataElementType();
    }
    if (this._parsing) {
      move(meta._parsed);
    }
    this.parse(start, count);
    if (resetNewElements) {
      this.updateElements(data, start, count, "reset");
    }
  }
  updateElements(element, start, count, mode) {
  }
  _removeElements(start, count) {
    const meta = this._cachedMeta;
    if (this._parsing) {
      const removed = meta._parsed.splice(start, count);
      if (meta._stacked) {
        clearStacks(meta, removed);
      }
    }
    meta.data.splice(start, count);
  }
  _sync(args) {
    if (this._parsing) {
      this._syncList.push(args);
    } else {
      const [method, arg1, arg2] = args;
      this[method](arg1, arg2);
    }
    this.chart._dataChanges.push([
      this.index,
      ...args
    ]);
  }
  _onDataPush() {
    const count = arguments.length;
    this._sync([
      "_insertElements",
      this.getDataset().data.length - count,
      count
    ]);
  }
  _onDataPop() {
    this._sync([
      "_removeElements",
      this._cachedMeta.data.length - 1,
      1
    ]);
  }
  _onDataShift() {
    this._sync([
      "_removeElements",
      0,
      1
    ]);
  }
  _onDataSplice(start, count) {
    if (count) {
      this._sync([
        "_removeElements",
        start,
        count
      ]);
    }
    const newCount = arguments.length - 2;
    if (newCount) {
      this._sync([
        "_insertElements",
        start,
        newCount
      ]);
    }
  }
  _onDataUnshift() {
    this._sync([
      "_insertElements",
      0,
      arguments.length
    ]);
  }
};
__publicField(DatasetController, "defaults", {});
__publicField(DatasetController, "datasetElementType", null);
__publicField(DatasetController, "dataElementType", null);
function getAllScaleValues(scale, type) {
  if (!scale._cache.$bar) {
    const visibleMetas = scale.getMatchingVisibleMetas(type);
    let values = [];
    for (let i5 = 0, ilen = visibleMetas.length; i5 < ilen; i5++) {
      values = values.concat(visibleMetas[i5].controller.getAllParsedValues(scale));
    }
    scale._cache.$bar = _arrayUnique(values.sort((a6, b5) => a6 - b5));
  }
  return scale._cache.$bar;
}
function computeMinSampleSize(meta) {
  const scale = meta.iScale;
  const values = getAllScaleValues(scale, meta.type);
  let min = scale._length;
  let i5, ilen, curr, prev;
  const updateMinAndPrev = () => {
    if (curr === 32767 || curr === -32768) {
      return;
    }
    if (defined(prev)) {
      min = Math.min(min, Math.abs(curr - prev) || min);
    }
    prev = curr;
  };
  for (i5 = 0, ilen = values.length; i5 < ilen; ++i5) {
    curr = scale.getPixelForValue(values[i5]);
    updateMinAndPrev();
  }
  prev = void 0;
  for (i5 = 0, ilen = scale.ticks.length; i5 < ilen; ++i5) {
    curr = scale.getPixelForTick(i5);
    updateMinAndPrev();
  }
  return min;
}
function computeFitCategoryTraits(index2, ruler, options, stackCount) {
  const thickness = options.barThickness;
  let size, ratio;
  if (isNullOrUndef(thickness)) {
    size = ruler.min * options.categoryPercentage;
    ratio = options.barPercentage;
  } else {
    size = thickness * stackCount;
    ratio = 1;
  }
  return {
    chunk: size / stackCount,
    ratio,
    start: ruler.pixels[index2] - size / 2
  };
}
function computeFlexCategoryTraits(index2, ruler, options, stackCount) {
  const pixels = ruler.pixels;
  const curr = pixels[index2];
  let prev = index2 > 0 ? pixels[index2 - 1] : null;
  let next = index2 < pixels.length - 1 ? pixels[index2 + 1] : null;
  const percent = options.categoryPercentage;
  if (prev === null) {
    prev = curr - (next === null ? ruler.end - ruler.start : next - curr);
  }
  if (next === null) {
    next = curr + curr - prev;
  }
  const start = curr - (curr - Math.min(prev, next)) / 2 * percent;
  const size = Math.abs(next - prev) / 2 * percent;
  return {
    chunk: size / stackCount,
    ratio: options.barPercentage,
    start
  };
}
function parseFloatBar(entry, item, vScale, i5) {
  const startValue = vScale.parse(entry[0], i5);
  const endValue = vScale.parse(entry[1], i5);
  const min = Math.min(startValue, endValue);
  const max = Math.max(startValue, endValue);
  let barStart = min;
  let barEnd = max;
  if (Math.abs(min) > Math.abs(max)) {
    barStart = max;
    barEnd = min;
  }
  item[vScale.axis] = barEnd;
  item._custom = {
    barStart,
    barEnd,
    start: startValue,
    end: endValue,
    min,
    max
  };
}
function parseValue(entry, item, vScale, i5) {
  if (isArray(entry)) {
    parseFloatBar(entry, item, vScale, i5);
  } else {
    item[vScale.axis] = vScale.parse(entry, i5);
  }
  return item;
}
function parseArrayOrPrimitive(meta, data, start, count) {
  const iScale = meta.iScale;
  const vScale = meta.vScale;
  const labels = iScale.getLabels();
  const singleScale = iScale === vScale;
  const parsed = [];
  let i5, ilen, item, entry;
  for (i5 = start, ilen = start + count; i5 < ilen; ++i5) {
    entry = data[i5];
    item = {};
    item[iScale.axis] = singleScale || iScale.parse(labels[i5], i5);
    parsed.push(parseValue(entry, item, vScale, i5));
  }
  return parsed;
}
function isFloatBar(custom) {
  return custom && custom.barStart !== void 0 && custom.barEnd !== void 0;
}
function barSign(size, vScale, actualBase) {
  if (size !== 0) {
    return sign2(size);
  }
  return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);
}
function borderProps(properties) {
  let reverse, start, end, top, bottom;
  if (properties.horizontal) {
    reverse = properties.base > properties.x;
    start = "left";
    end = "right";
  } else {
    reverse = properties.base < properties.y;
    start = "bottom";
    end = "top";
  }
  if (reverse) {
    top = "end";
    bottom = "start";
  } else {
    top = "start";
    bottom = "end";
  }
  return {
    start,
    end,
    reverse,
    top,
    bottom
  };
}
function setBorderSkipped(properties, options, stack, index2) {
  let edge = options.borderSkipped;
  const res = {};
  if (!edge) {
    properties.borderSkipped = res;
    return;
  }
  if (edge === true) {
    properties.borderSkipped = {
      top: true,
      right: true,
      bottom: true,
      left: true
    };
    return;
  }
  const { start, end, reverse, top, bottom } = borderProps(properties);
  if (edge === "middle" && stack) {
    properties.enableBorderRadius = true;
    if ((stack._top || 0) === index2) {
      edge = top;
    } else if ((stack._bottom || 0) === index2) {
      edge = bottom;
    } else {
      res[parseEdge(bottom, start, end, reverse)] = true;
      edge = top;
    }
  }
  res[parseEdge(edge, start, end, reverse)] = true;
  properties.borderSkipped = res;
}
function parseEdge(edge, a6, b5, reverse) {
  if (reverse) {
    edge = swap(edge, a6, b5);
    edge = startEnd(edge, b5, a6);
  } else {
    edge = startEnd(edge, a6, b5);
  }
  return edge;
}
function swap(orig, v1, v22) {
  return orig === v1 ? v22 : orig === v22 ? v1 : orig;
}
function startEnd(v3, start, end) {
  return v3 === "start" ? start : v3 === "end" ? end : v3;
}
function setInflateAmount(properties, { inflateAmount }, ratio) {
  properties.inflateAmount = inflateAmount === "auto" ? ratio === 1 ? 0.33 : 0 : inflateAmount;
}
var BarController = class extends DatasetController {
  parsePrimitiveData(meta, data, start, count) {
    return parseArrayOrPrimitive(meta, data, start, count);
  }
  parseArrayData(meta, data, start, count) {
    return parseArrayOrPrimitive(meta, data, start, count);
  }
  parseObjectData(meta, data, start, count) {
    const { iScale, vScale } = meta;
    const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
    const iAxisKey = iScale.axis === "x" ? xAxisKey : yAxisKey;
    const vAxisKey = vScale.axis === "x" ? xAxisKey : yAxisKey;
    const parsed = [];
    let i5, ilen, item, obj;
    for (i5 = start, ilen = start + count; i5 < ilen; ++i5) {
      obj = data[i5];
      item = {};
      item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i5);
      parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i5));
    }
    return parsed;
  }
  updateRangeFromParsed(range, scale, parsed, stack) {
    super.updateRangeFromParsed(range, scale, parsed, stack);
    const custom = parsed._custom;
    if (custom && scale === this._cachedMeta.vScale) {
      range.min = Math.min(range.min, custom.min);
      range.max = Math.max(range.max, custom.max);
    }
  }
  getMaxOverflow() {
    return 0;
  }
  getLabelAndValue(index2) {
    const meta = this._cachedMeta;
    const { iScale, vScale } = meta;
    const parsed = this.getParsed(index2);
    const custom = parsed._custom;
    const value = isFloatBar(custom) ? "[" + custom.start + ", " + custom.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]);
    return {
      label: "" + iScale.getLabelForValue(parsed[iScale.axis]),
      value
    };
  }
  initialize() {
    this.enableOptionSharing = true;
    super.initialize();
    const meta = this._cachedMeta;
    meta.stack = this.getDataset().stack;
  }
  update(mode) {
    const meta = this._cachedMeta;
    this.updateElements(meta.data, 0, meta.data.length, mode);
  }
  updateElements(bars, start, count, mode) {
    const reset = mode === "reset";
    const { index: index2, _cachedMeta: { vScale } } = this;
    const base2 = vScale.getBasePixel();
    const horizontal = vScale.isHorizontal();
    const ruler = this._getRuler();
    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);
    for (let i5 = start; i5 < start + count; i5++) {
      const parsed = this.getParsed(i5);
      const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {
        base: base2,
        head: base2
      } : this._calculateBarValuePixels(i5);
      const ipixels = this._calculateBarIndexPixels(i5, ruler);
      const stack = (parsed._stacks || {})[vScale.axis];
      const properties = {
        horizontal,
        base: vpixels.base,
        enableBorderRadius: !stack || isFloatBar(parsed._custom) || index2 === stack._top || index2 === stack._bottom,
        x: horizontal ? vpixels.head : ipixels.center,
        y: horizontal ? ipixels.center : vpixels.head,
        height: horizontal ? ipixels.size : Math.abs(vpixels.size),
        width: horizontal ? Math.abs(vpixels.size) : ipixels.size
      };
      if (includeOptions) {
        properties.options = sharedOptions || this.resolveDataElementOptions(i5, bars[i5].active ? "active" : mode);
      }
      const options = properties.options || bars[i5].options;
      setBorderSkipped(properties, options, stack, index2);
      setInflateAmount(properties, options, ruler.ratio);
      this.updateElement(bars[i5], i5, properties, mode);
    }
  }
  _getStacks(last, dataIndex) {
    const { iScale } = this._cachedMeta;
    const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta) => meta.controller.options.grouped);
    const stacked = iScale.options.stacked;
    const stacks = [];
    const currentParsed = this._cachedMeta.controller.getParsed(dataIndex);
    const iScaleValue = currentParsed && currentParsed[iScale.axis];
    const skipNull = (meta) => {
      const parsed = meta._parsed.find((item) => item[iScale.axis] === iScaleValue);
      const val = parsed && parsed[meta.vScale.axis];
      if (isNullOrUndef(val) || isNaN(val)) {
        return true;
      }
    };
    for (const meta of metasets) {
      if (dataIndex !== void 0 && skipNull(meta)) {
        continue;
      }
      if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === void 0 && meta.stack === void 0) {
        stacks.push(meta.stack);
      }
      if (meta.index === last) {
        break;
      }
    }
    if (!stacks.length) {
      stacks.push(void 0);
    }
    return stacks;
  }
  _getStackCount(index2) {
    return this._getStacks(void 0, index2).length;
  }
  _getAxisCount() {
    return this._getAxis().length;
  }
  getFirstScaleIdForIndexAxis() {
    const scales = this.chart.scales;
    const indexScaleId = this.chart.options.indexAxis;
    return Object.keys(scales).filter((key) => scales[key].axis === indexScaleId).shift();
  }
  _getAxis() {
    const axis = {};
    const firstScaleAxisId = this.getFirstScaleIdForIndexAxis();
    for (const dataset of this.chart.data.datasets) {
      axis[valueOrDefault(this.chart.options.indexAxis === "x" ? dataset.xAxisID : dataset.yAxisID, firstScaleAxisId)] = true;
    }
    return Object.keys(axis);
  }
  _getStackIndex(datasetIndex, name, dataIndex) {
    const stacks = this._getStacks(datasetIndex, dataIndex);
    const index2 = name !== void 0 ? stacks.indexOf(name) : -1;
    return index2 === -1 ? stacks.length - 1 : index2;
  }
  _getRuler() {
    const opts = this.options;
    const meta = this._cachedMeta;
    const iScale = meta.iScale;
    const pixels = [];
    let i5, ilen;
    for (i5 = 0, ilen = meta.data.length; i5 < ilen; ++i5) {
      pixels.push(iScale.getPixelForValue(this.getParsed(i5)[iScale.axis], i5));
    }
    const barThickness = opts.barThickness;
    const min = barThickness || computeMinSampleSize(meta);
    return {
      min,
      pixels,
      start: iScale._startPixel,
      end: iScale._endPixel,
      stackCount: this._getStackCount(),
      scale: iScale,
      grouped: opts.grouped,
      ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage
    };
  }
  _calculateBarValuePixels(index2) {
    const { _cachedMeta: { vScale, _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength } } = this;
    const actualBase = baseValue || 0;
    const parsed = this.getParsed(index2);
    const custom = parsed._custom;
    const floating = isFloatBar(custom);
    let value = parsed[vScale.axis];
    let start = 0;
    let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;
    let head, size;
    if (length !== value) {
      start = length - value;
      length = value;
    }
    if (floating) {
      value = custom.barStart;
      length = custom.barEnd - custom.barStart;
      if (value !== 0 && sign2(value) !== sign2(custom.barEnd)) {
        start = 0;
      }
      start += value;
    }
    const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;
    let base2 = vScale.getPixelForValue(startValue);
    if (this.chart.getDataVisibility(index2)) {
      head = vScale.getPixelForValue(start + length);
    } else {
      head = base2;
    }
    size = head - base2;
    if (Math.abs(size) < minBarLength) {
      size = barSign(size, vScale, actualBase) * minBarLength;
      if (value === actualBase) {
        base2 -= size / 2;
      }
      const startPixel = vScale.getPixelForDecimal(0);
      const endPixel = vScale.getPixelForDecimal(1);
      const min = Math.min(startPixel, endPixel);
      const max = Math.max(startPixel, endPixel);
      base2 = Math.max(Math.min(base2, max), min);
      head = base2 + size;
      if (_stacked && !floating) {
        parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base2);
      }
    }
    if (base2 === vScale.getPixelForValue(actualBase)) {
      const halfGrid = sign2(size) * vScale.getLineWidthForValue(actualBase) / 2;
      base2 += halfGrid;
      size -= halfGrid;
    }
    return {
      size,
      base: base2,
      head,
      center: head + size / 2
    };
  }
  _calculateBarIndexPixels(index2, ruler) {
    const scale = ruler.scale;
    const options = this.options;
    const skipNull = options.skipNull;
    const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);
    let center, size;
    const axisCount = this._getAxisCount();
    if (ruler.grouped) {
      const stackCount = skipNull ? this._getStackCount(index2) : ruler.stackCount;
      const range = options.barThickness === "flex" ? computeFlexCategoryTraits(index2, ruler, options, stackCount * axisCount) : computeFitCategoryTraits(index2, ruler, options, stackCount * axisCount);
      const axisID = this.chart.options.indexAxis === "x" ? this.getDataset().xAxisID : this.getDataset().yAxisID;
      const axisNumber = this._getAxis().indexOf(valueOrDefault(axisID, this.getFirstScaleIdForIndexAxis()));
      const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index2 : void 0) + axisNumber;
      center = range.start + range.chunk * stackIndex + range.chunk / 2;
      size = Math.min(maxBarThickness, range.chunk * range.ratio);
    } else {
      center = scale.getPixelForValue(this.getParsed(index2)[scale.axis], index2);
      size = Math.min(maxBarThickness, ruler.min * ruler.ratio);
    }
    return {
      base: center - size / 2,
      head: center + size / 2,
      center,
      size
    };
  }
  draw() {
    const meta = this._cachedMeta;
    const vScale = meta.vScale;
    const rects = meta.data;
    const ilen = rects.length;
    let i5 = 0;
    for (; i5 < ilen; ++i5) {
      if (this.getParsed(i5)[vScale.axis] !== null && !rects[i5].hidden) {
        rects[i5].draw(this._ctx);
      }
    }
  }
};
__publicField(BarController, "id", "bar");
__publicField(BarController, "defaults", {
  datasetElementType: false,
  dataElementType: "bar",
  categoryPercentage: 0.8,
  barPercentage: 0.9,
  grouped: true,
  animations: {
    numbers: {
      type: "number",
      properties: [
        "x",
        "y",
        "base",
        "width",
        "height"
      ]
    }
  }
});
__publicField(BarController, "overrides", {
  scales: {
    _index_: {
      type: "category",
      offset: true,
      grid: {
        offset: true
      }
    },
    _value_: {
      type: "linear",
      beginAtZero: true
    }
  }
});
var LineController = class extends DatasetController {
  initialize() {
    this.enableOptionSharing = true;
    this.supportsDecimation = true;
    super.initialize();
  }
  update(mode) {
    const meta = this._cachedMeta;
    const { dataset: line, data: points = [], _dataset } = meta;
    const animationsDisabled = this.chart._animationsDisabled;
    let { start, count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);
    this._drawStart = start;
    this._drawCount = count;
    if (_scaleRangesChanged(meta)) {
      start = 0;
      count = points.length;
    }
    line._chart = this.chart;
    line._datasetIndex = this.index;
    line._decimated = !!_dataset._decimated;
    line.points = points;
    const options = this.resolveDatasetElementOptions(mode);
    if (!this.options.showLine) {
      options.borderWidth = 0;
    }
    options.segment = this.options.segment;
    this.updateElement(line, void 0, {
      animated: !animationsDisabled,
      options
    }, mode);
    this.updateElements(points, start, count, mode);
  }
  updateElements(points, start, count, mode) {
    const reset = mode === "reset";
    const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;
    const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode);
    const iAxis = iScale.axis;
    const vAxis = vScale.axis;
    const { spanGaps, segment } = this.options;
    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;
    const directUpdate = this.chart._animationsDisabled || reset || mode === "none";
    const end = start + count;
    const pointsCount = points.length;
    let prevParsed = start > 0 && this.getParsed(start - 1);
    for (let i5 = 0; i5 < pointsCount; ++i5) {
      const point = points[i5];
      const properties = directUpdate ? point : {};
      if (i5 < start || i5 >= end) {
        properties.skip = true;
        continue;
      }
      const parsed = this.getParsed(i5);
      const nullData = isNullOrUndef(parsed[vAxis]);
      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i5);
      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i5);
      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;
      properties.stop = i5 > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;
      if (segment) {
        properties.parsed = parsed;
        properties.raw = _dataset.data[i5];
      }
      if (includeOptions) {
        properties.options = sharedOptions || this.resolveDataElementOptions(i5, point.active ? "active" : mode);
      }
      if (!directUpdate) {
        this.updateElement(point, i5, properties, mode);
      }
      prevParsed = parsed;
    }
  }
  getMaxOverflow() {
    const meta = this._cachedMeta;
    const dataset = meta.dataset;
    const border = dataset.options && dataset.options.borderWidth || 0;
    const data = meta.data || [];
    if (!data.length) {
      return border;
    }
    const firstPoint = data[0].size(this.resolveDataElementOptions(0));
    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));
    return Math.max(border, firstPoint, lastPoint) / 2;
  }
  draw() {
    const meta = this._cachedMeta;
    meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);
    super.draw();
  }
};
__publicField(LineController, "id", "line");
__publicField(LineController, "defaults", {
  datasetElementType: "line",
  dataElementType: "point",
  showLine: true,
  spanGaps: false
});
__publicField(LineController, "overrides", {
  scales: {
    _index_: {
      type: "category"
    },
    _value_: {
      type: "linear"
    }
  }
});
function abstract() {
  throw new Error("This method is not implemented: Check that a complete date adapter is provided.");
}
var DateAdapterBase = class _DateAdapterBase {
  constructor(options) {
    __publicField(this, "options");
    this.options = options || {};
  }
  /**
  * Override default date adapter methods.
  * Accepts type parameter to define options type.
  * @example
  * Chart._adapters._date.override<{myAdapterOption: string}>({
  *   init() {
  *     console.log(this.options.myAdapterOption);
  *   }
  * })
  */
  static override(members) {
    Object.assign(_DateAdapterBase.prototype, members);
  }
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  init() {
  }
  formats() {
    return abstract();
  }
  parse() {
    return abstract();
  }
  format() {
    return abstract();
  }
  add() {
    return abstract();
  }
  diff() {
    return abstract();
  }
  startOf() {
    return abstract();
  }
  endOf() {
    return abstract();
  }
};
var adapters = {
  _date: DateAdapterBase
};
function binarySearch(metaset, axis, value, intersect) {
  const { controller, data, _sorted } = metaset;
  const iScale = controller._cachedMeta.iScale;
  const spanGaps = metaset.dataset ? metaset.dataset.options ? metaset.dataset.options.spanGaps : null : null;
  if (iScale && axis === iScale.axis && axis !== "r" && _sorted && data.length) {
    const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;
    if (!intersect) {
      const result = lookupMethod(data, axis, value);
      if (spanGaps) {
        const { vScale } = controller._cachedMeta;
        const { _parsed } = metaset;
        const distanceToDefinedLo = _parsed.slice(0, result.lo + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis]));
        result.lo -= Math.max(0, distanceToDefinedLo);
        const distanceToDefinedHi = _parsed.slice(result.hi).findIndex((point) => !isNullOrUndef(point[vScale.axis]));
        result.hi += Math.max(0, distanceToDefinedHi);
      }
      return result;
    } else if (controller._sharedOptions) {
      const el = data[0];
      const range = typeof el.getRange === "function" && el.getRange(axis);
      if (range) {
        const start = lookupMethod(data, axis, value - range);
        const end = lookupMethod(data, axis, value + range);
        return {
          lo: start.lo,
          hi: end.hi
        };
      }
    }
  }
  return {
    lo: 0,
    hi: data.length - 1
  };
}
function evaluateInteractionItems(chart, axis, position, handler, intersect) {
  const metasets = chart.getSortedVisibleDatasetMetas();
  const value = position[axis];
  for (let i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
    const { index: index2, data } = metasets[i5];
    const { lo, hi } = binarySearch(metasets[i5], axis, value, intersect);
    for (let j4 = lo; j4 <= hi; ++j4) {
      const element = data[j4];
      if (!element.skip) {
        handler(element, index2, j4);
      }
    }
  }
}
function getDistanceMetricForAxis(axis) {
  const useX = axis.indexOf("x") !== -1;
  const useY = axis.indexOf("y") !== -1;
  return function(pt1, pt2) {
    const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;
    const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;
    return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
  };
}
function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {
  const items = [];
  if (!includeInvisible && !chart.isPointInArea(position)) {
    return items;
  }
  const evaluationFunc = function(element, datasetIndex, index2) {
    if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {
      return;
    }
    if (element.inRange(position.x, position.y, useFinalPosition)) {
      items.push({
        element,
        datasetIndex,
        index: index2
      });
    }
  };
  evaluateInteractionItems(chart, axis, position, evaluationFunc, true);
  return items;
}
function getNearestRadialItems(chart, position, axis, useFinalPosition) {
  let items = [];
  function evaluationFunc(element, datasetIndex, index2) {
    const { startAngle, endAngle } = element.getProps([
      "startAngle",
      "endAngle"
    ], useFinalPosition);
    const { angle } = getAngleFromPoint(element, {
      x: position.x,
      y: position.y
    });
    if (_angleBetween(angle, startAngle, endAngle)) {
      items.push({
        element,
        datasetIndex,
        index: index2
      });
    }
  }
  evaluateInteractionItems(chart, axis, position, evaluationFunc);
  return items;
}
function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
  let items = [];
  const distanceMetric = getDistanceMetricForAxis(axis);
  let minDistance = Number.POSITIVE_INFINITY;
  function evaluationFunc(element, datasetIndex, index2) {
    const inRange2 = element.inRange(position.x, position.y, useFinalPosition);
    if (intersect && !inRange2) {
      return;
    }
    const center = element.getCenterPoint(useFinalPosition);
    const pointInArea = !!includeInvisible || chart.isPointInArea(center);
    if (!pointInArea && !inRange2) {
      return;
    }
    const distance = distanceMetric(position, center);
    if (distance < minDistance) {
      items = [
        {
          element,
          datasetIndex,
          index: index2
        }
      ];
      minDistance = distance;
    } else if (distance === minDistance) {
      items.push({
        element,
        datasetIndex,
        index: index2
      });
    }
  }
  evaluateInteractionItems(chart, axis, position, evaluationFunc);
  return items;
}
function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
  if (!includeInvisible && !chart.isPointInArea(position)) {
    return [];
  }
  return axis === "r" && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);
}
function getAxisItems(chart, position, axis, intersect, useFinalPosition) {
  const items = [];
  const rangeMethod = axis === "x" ? "inXRange" : "inYRange";
  let intersectsItem = false;
  evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index2) => {
    if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) {
      items.push({
        element,
        datasetIndex,
        index: index2
      });
      intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);
    }
  });
  if (intersect && !intersectsItem) {
    return [];
  }
  return items;
}
var Interaction = {
  evaluateInteractionItems,
  modes: {
    index(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      const axis = options.axis || "x";
      const includeInvisible = options.includeInvisible || false;
      const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);
      const elements = [];
      if (!items.length) {
        return [];
      }
      chart.getSortedVisibleDatasetMetas().forEach((meta) => {
        const index2 = items[0].index;
        const element = meta.data[index2];
        if (element && !element.skip) {
          elements.push({
            element,
            datasetIndex: meta.index,
            index: index2
          });
        }
      });
      return elements;
    },
    dataset(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      const axis = options.axis || "xy";
      const includeInvisible = options.includeInvisible || false;
      let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);
      if (items.length > 0) {
        const datasetIndex = items[0].datasetIndex;
        const data = chart.getDatasetMeta(datasetIndex).data;
        items = [];
        for (let i5 = 0; i5 < data.length; ++i5) {
          items.push({
            element: data[i5],
            datasetIndex,
            index: i5
          });
        }
      }
      return items;
    },
    point(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      const axis = options.axis || "xy";
      const includeInvisible = options.includeInvisible || false;
      return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);
    },
    nearest(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      const axis = options.axis || "xy";
      const includeInvisible = options.includeInvisible || false;
      return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);
    },
    x(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      return getAxisItems(chart, position, "x", options.intersect, useFinalPosition);
    },
    y(chart, e5, options, useFinalPosition) {
      const position = getRelativePosition(e5, chart);
      return getAxisItems(chart, position, "y", options.intersect, useFinalPosition);
    }
  }
};
var STATIC_POSITIONS = [
  "left",
  "top",
  "right",
  "bottom"
];
function filterByPosition(array, position) {
  return array.filter((v3) => v3.pos === position);
}
function filterDynamicPositionByAxis(array, axis) {
  return array.filter((v3) => STATIC_POSITIONS.indexOf(v3.pos) === -1 && v3.box.axis === axis);
}
function sortByWeight(array, reverse) {
  return array.sort((a6, b5) => {
    const v0 = reverse ? b5 : a6;
    const v1 = reverse ? a6 : b5;
    return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;
  });
}
function wrapBoxes(boxes) {
  const layoutBoxes = [];
  let i5, ilen, box, pos, stack, stackWeight;
  for (i5 = 0, ilen = (boxes || []).length; i5 < ilen; ++i5) {
    box = boxes[i5];
    ({ position: pos, options: { stack, stackWeight = 1 } } = box);
    layoutBoxes.push({
      index: i5,
      box,
      pos,
      horizontal: box.isHorizontal(),
      weight: box.weight,
      stack: stack && pos + stack,
      stackWeight
    });
  }
  return layoutBoxes;
}
function buildStacks(layouts2) {
  const stacks = {};
  for (const wrap of layouts2) {
    const { stack, pos, stackWeight } = wrap;
    if (!stack || !STATIC_POSITIONS.includes(pos)) {
      continue;
    }
    const _stack = stacks[stack] || (stacks[stack] = {
      count: 0,
      placed: 0,
      weight: 0,
      size: 0
    });
    _stack.count++;
    _stack.weight += stackWeight;
  }
  return stacks;
}
function setLayoutDims(layouts2, params) {
  const stacks = buildStacks(layouts2);
  const { vBoxMaxWidth, hBoxMaxHeight } = params;
  let i5, ilen, layout;
  for (i5 = 0, ilen = layouts2.length; i5 < ilen; ++i5) {
    layout = layouts2[i5];
    const { fullSize } = layout.box;
    const stack = stacks[layout.stack];
    const factor = stack && layout.stackWeight / stack.weight;
    if (layout.horizontal) {
      layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;
      layout.height = hBoxMaxHeight;
    } else {
      layout.width = vBoxMaxWidth;
      layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;
    }
  }
  return stacks;
}
function buildLayoutBoxes(boxes) {
  const layoutBoxes = wrapBoxes(boxes);
  const fullSize = sortByWeight(layoutBoxes.filter((wrap) => wrap.box.fullSize), true);
  const left = sortByWeight(filterByPosition(layoutBoxes, "left"), true);
  const right = sortByWeight(filterByPosition(layoutBoxes, "right"));
  const top = sortByWeight(filterByPosition(layoutBoxes, "top"), true);
  const bottom = sortByWeight(filterByPosition(layoutBoxes, "bottom"));
  const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, "x");
  const centerVertical = filterDynamicPositionByAxis(layoutBoxes, "y");
  return {
    fullSize,
    leftAndTop: left.concat(top),
    rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),
    chartArea: filterByPosition(layoutBoxes, "chartArea"),
    vertical: left.concat(right).concat(centerVertical),
    horizontal: top.concat(bottom).concat(centerHorizontal)
  };
}
function getCombinedMax(maxPadding, chartArea, a6, b5) {
  return Math.max(maxPadding[a6], chartArea[a6]) + Math.max(maxPadding[b5], chartArea[b5]);
}
function updateMaxPadding(maxPadding, boxPadding) {
  maxPadding.top = Math.max(maxPadding.top, boxPadding.top);
  maxPadding.left = Math.max(maxPadding.left, boxPadding.left);
  maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);
  maxPadding.right = Math.max(maxPadding.right, boxPadding.right);
}
function updateDims(chartArea, params, layout, stacks) {
  const { pos, box } = layout;
  const maxPadding = chartArea.maxPadding;
  if (!isObject(pos)) {
    if (layout.size) {
      chartArea[pos] -= layout.size;
    }
    const stack = stacks[layout.stack] || {
      size: 0,
      count: 1
    };
    stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);
    layout.size = stack.size / stack.count;
    chartArea[pos] += layout.size;
  }
  if (box.getPadding) {
    updateMaxPadding(maxPadding, box.getPadding());
  }
  const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, "left", "right"));
  const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, "top", "bottom"));
  const widthChanged = newWidth !== chartArea.w;
  const heightChanged = newHeight !== chartArea.h;
  chartArea.w = newWidth;
  chartArea.h = newHeight;
  return layout.horizontal ? {
    same: widthChanged,
    other: heightChanged
  } : {
    same: heightChanged,
    other: widthChanged
  };
}
function handleMaxPadding(chartArea) {
  const maxPadding = chartArea.maxPadding;
  function updatePos(pos) {
    const change = Math.max(maxPadding[pos] - chartArea[pos], 0);
    chartArea[pos] += change;
    return change;
  }
  chartArea.y += updatePos("top");
  chartArea.x += updatePos("left");
  updatePos("right");
  updatePos("bottom");
}
function getMargins(horizontal, chartArea) {
  const maxPadding = chartArea.maxPadding;
  function marginForPositions(positions2) {
    const margin = {
      left: 0,
      top: 0,
      right: 0,
      bottom: 0
    };
    positions2.forEach((pos) => {
      margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);
    });
    return margin;
  }
  return horizontal ? marginForPositions([
    "left",
    "right"
  ]) : marginForPositions([
    "top",
    "bottom"
  ]);
}
function fitBoxes(boxes, chartArea, params, stacks) {
  const refitBoxes = [];
  let i5, ilen, layout, box, refit, changed;
  for (i5 = 0, ilen = boxes.length, refit = 0; i5 < ilen; ++i5) {
    layout = boxes[i5];
    box = layout.box;
    box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));
    const { same, other } = updateDims(chartArea, params, layout, stacks);
    refit |= same && refitBoxes.length;
    changed = changed || other;
    if (!box.fullSize) {
      refitBoxes.push(layout);
    }
  }
  return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;
}
function setBoxDims(box, left, top, width, height) {
  box.top = top;
  box.left = left;
  box.right = left + width;
  box.bottom = top + height;
  box.width = width;
  box.height = height;
}
function placeBoxes(boxes, chartArea, params, stacks) {
  const userPadding = params.padding;
  let { x: x6, y: y6 } = chartArea;
  for (const layout of boxes) {
    const box = layout.box;
    const stack = stacks[layout.stack] || {
      count: 1,
      placed: 0,
      weight: 1
    };
    const weight = layout.stackWeight / stack.weight || 1;
    if (layout.horizontal) {
      const width = chartArea.w * weight;
      const height = stack.size || box.height;
      if (defined(stack.start)) {
        y6 = stack.start;
      }
      if (box.fullSize) {
        setBoxDims(box, userPadding.left, y6, params.outerWidth - userPadding.right - userPadding.left, height);
      } else {
        setBoxDims(box, chartArea.left + stack.placed, y6, width, height);
      }
      stack.start = y6;
      stack.placed += width;
      y6 = box.bottom;
    } else {
      const height = chartArea.h * weight;
      const width = stack.size || box.width;
      if (defined(stack.start)) {
        x6 = stack.start;
      }
      if (box.fullSize) {
        setBoxDims(box, x6, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);
      } else {
        setBoxDims(box, x6, chartArea.top + stack.placed, width, height);
      }
      stack.start = x6;
      stack.placed += height;
      x6 = box.right;
    }
  }
  chartArea.x = x6;
  chartArea.y = y6;
}
var layouts = {
  addBox(chart, item) {
    if (!chart.boxes) {
      chart.boxes = [];
    }
    item.fullSize = item.fullSize || false;
    item.position = item.position || "top";
    item.weight = item.weight || 0;
    item._layers = item._layers || function() {
      return [
        {
          z: 0,
          draw(chartArea) {
            item.draw(chartArea);
          }
        }
      ];
    };
    chart.boxes.push(item);
  },
  removeBox(chart, layoutItem) {
    const index2 = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;
    if (index2 !== -1) {
      chart.boxes.splice(index2, 1);
    }
  },
  configure(chart, item, options) {
    item.fullSize = options.fullSize;
    item.position = options.position;
    item.weight = options.weight;
  },
  update(chart, width, height, minPadding) {
    if (!chart) {
      return;
    }
    const padding = toPadding(chart.options.layout.padding);
    const availableWidth = Math.max(width - padding.width, 0);
    const availableHeight = Math.max(height - padding.height, 0);
    const boxes = buildLayoutBoxes(chart.boxes);
    const verticalBoxes = boxes.vertical;
    const horizontalBoxes = boxes.horizontal;
    each(chart.boxes, (box) => {
      if (typeof box.beforeLayout === "function") {
        box.beforeLayout();
      }
    });
    const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) => wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;
    const params = Object.freeze({
      outerWidth: width,
      outerHeight: height,
      padding,
      availableWidth,
      availableHeight,
      vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,
      hBoxMaxHeight: availableHeight / 2
    });
    const maxPadding = Object.assign({}, padding);
    updateMaxPadding(maxPadding, toPadding(minPadding));
    const chartArea = Object.assign({
      maxPadding,
      w: availableWidth,
      h: availableHeight,
      x: padding.left,
      y: padding.top
    }, padding);
    const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);
    fitBoxes(boxes.fullSize, chartArea, params, stacks);
    fitBoxes(verticalBoxes, chartArea, params, stacks);
    if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {
      fitBoxes(verticalBoxes, chartArea, params, stacks);
    }
    handleMaxPadding(chartArea);
    placeBoxes(boxes.leftAndTop, chartArea, params, stacks);
    chartArea.x += chartArea.w;
    chartArea.y += chartArea.h;
    placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);
    chart.chartArea = {
      left: chartArea.left,
      top: chartArea.top,
      right: chartArea.left + chartArea.w,
      bottom: chartArea.top + chartArea.h,
      height: chartArea.h,
      width: chartArea.w
    };
    each(boxes.chartArea, (layout) => {
      const box = layout.box;
      Object.assign(box, chart.chartArea);
      box.update(chartArea.w, chartArea.h, {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0
      });
    });
  }
};
var BasePlatform = class {
  acquireContext(canvas, aspectRatio) {
  }
  releaseContext(context) {
    return false;
  }
  addEventListener(chart, type, listener) {
  }
  removeEventListener(chart, type, listener) {
  }
  getDevicePixelRatio() {
    return 1;
  }
  getMaximumSize(element, width, height, aspectRatio) {
    width = Math.max(0, width || element.width);
    height = height || element.height;
    return {
      width,
      height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)
    };
  }
  isAttached(canvas) {
    return true;
  }
  updateConfig(config) {
  }
};
var BasicPlatform = class extends BasePlatform {
  acquireContext(item) {
    return item && item.getContext && item.getContext("2d") || null;
  }
  updateConfig(config) {
    config.options.animation = false;
  }
};
var EXPANDO_KEY = "$chartjs";
var EVENT_TYPES = {
  touchstart: "mousedown",
  touchmove: "mousemove",
  touchend: "mouseup",
  pointerenter: "mouseenter",
  pointerdown: "mousedown",
  pointermove: "mousemove",
  pointerup: "mouseup",
  pointerleave: "mouseout",
  pointerout: "mouseout"
};
var isNullOrEmpty = (value) => value === null || value === "";
function initCanvas(canvas, aspectRatio) {
  const style = canvas.style;
  const renderHeight = canvas.getAttribute("height");
  const renderWidth = canvas.getAttribute("width");
  canvas[EXPANDO_KEY] = {
    initial: {
      height: renderHeight,
      width: renderWidth,
      style: {
        display: style.display,
        height: style.height,
        width: style.width
      }
    }
  };
  style.display = style.display || "block";
  style.boxSizing = style.boxSizing || "border-box";
  if (isNullOrEmpty(renderWidth)) {
    const displayWidth = readUsedSize(canvas, "width");
    if (displayWidth !== void 0) {
      canvas.width = displayWidth;
    }
  }
  if (isNullOrEmpty(renderHeight)) {
    if (canvas.style.height === "") {
      canvas.height = canvas.width / (aspectRatio || 2);
    } else {
      const displayHeight = readUsedSize(canvas, "height");
      if (displayHeight !== void 0) {
        canvas.height = displayHeight;
      }
    }
  }
  return canvas;
}
var eventListenerOptions = supportsEventListenerOptions ? {
  passive: true
} : false;
function addListener(node, type, listener) {
  if (node) {
    node.addEventListener(type, listener, eventListenerOptions);
  }
}
function removeListener(chart, type, listener) {
  if (chart && chart.canvas) {
    chart.canvas.removeEventListener(type, listener, eventListenerOptions);
  }
}
function fromNativeEvent(event, chart) {
  const type = EVENT_TYPES[event.type] || event.type;
  const { x: x6, y: y6 } = getRelativePosition(event, chart);
  return {
    type,
    chart,
    native: event,
    x: x6 !== void 0 ? x6 : null,
    y: y6 !== void 0 ? y6 : null
  };
}
function nodeListContains(nodeList, canvas) {
  for (const node of nodeList) {
    if (node === canvas || node.contains(canvas)) {
      return true;
    }
  }
}
function createAttachObserver(chart, type, listener) {
  const canvas = chart.canvas;
  const observer = new MutationObserver((entries) => {
    let trigger = false;
    for (const entry of entries) {
      trigger = trigger || nodeListContains(entry.addedNodes, canvas);
      trigger = trigger && !nodeListContains(entry.removedNodes, canvas);
    }
    if (trigger) {
      listener();
    }
  });
  observer.observe(document, {
    childList: true,
    subtree: true
  });
  return observer;
}
function createDetachObserver(chart, type, listener) {
  const canvas = chart.canvas;
  const observer = new MutationObserver((entries) => {
    let trigger = false;
    for (const entry of entries) {
      trigger = trigger || nodeListContains(entry.removedNodes, canvas);
      trigger = trigger && !nodeListContains(entry.addedNodes, canvas);
    }
    if (trigger) {
      listener();
    }
  });
  observer.observe(document, {
    childList: true,
    subtree: true
  });
  return observer;
}
var drpListeningCharts = /* @__PURE__ */ new Map();
var oldDevicePixelRatio = 0;
function onWindowResize() {
  const dpr = window.devicePixelRatio;
  if (dpr === oldDevicePixelRatio) {
    return;
  }
  oldDevicePixelRatio = dpr;
  drpListeningCharts.forEach((resize, chart) => {
    if (chart.currentDevicePixelRatio !== dpr) {
      resize();
    }
  });
}
function listenDevicePixelRatioChanges(chart, resize) {
  if (!drpListeningCharts.size) {
    window.addEventListener("resize", onWindowResize);
  }
  drpListeningCharts.set(chart, resize);
}
function unlistenDevicePixelRatioChanges(chart) {
  drpListeningCharts.delete(chart);
  if (!drpListeningCharts.size) {
    window.removeEventListener("resize", onWindowResize);
  }
}
function createResizeObserver(chart, type, listener) {
  const canvas = chart.canvas;
  const container = canvas && _getParentNode(canvas);
  if (!container) {
    return;
  }
  const resize = throttled((width, height) => {
    const w6 = container.clientWidth;
    listener(width, height);
    if (w6 < container.clientWidth) {
      listener();
    }
  }, window);
  const observer = new ResizeObserver((entries) => {
    const entry = entries[0];
    const width = entry.contentRect.width;
    const height = entry.contentRect.height;
    if (width === 0 && height === 0) {
      return;
    }
    resize(width, height);
  });
  observer.observe(container);
  listenDevicePixelRatioChanges(chart, resize);
  return observer;
}
function releaseObserver(chart, type, observer) {
  if (observer) {
    observer.disconnect();
  }
  if (type === "resize") {
    unlistenDevicePixelRatioChanges(chart);
  }
}
function createProxyAndListen(chart, type, listener) {
  const canvas = chart.canvas;
  const proxy = throttled((event) => {
    if (chart.ctx !== null) {
      listener(fromNativeEvent(event, chart));
    }
  }, chart);
  addListener(canvas, type, proxy);
  return proxy;
}
var DomPlatform = class extends BasePlatform {
  acquireContext(canvas, aspectRatio) {
    const context = canvas && canvas.getContext && canvas.getContext("2d");
    if (context && context.canvas === canvas) {
      initCanvas(canvas, aspectRatio);
      return context;
    }
    return null;
  }
  releaseContext(context) {
    const canvas = context.canvas;
    if (!canvas[EXPANDO_KEY]) {
      return false;
    }
    const initial4 = canvas[EXPANDO_KEY].initial;
    [
      "height",
      "width"
    ].forEach((prop) => {
      const value = initial4[prop];
      if (isNullOrUndef(value)) {
        canvas.removeAttribute(prop);
      } else {
        canvas.setAttribute(prop, value);
      }
    });
    const style = initial4.style || {};
    Object.keys(style).forEach((key) => {
      canvas.style[key] = style[key];
    });
    canvas.width = canvas.width;
    delete canvas[EXPANDO_KEY];
    return true;
  }
  addEventListener(chart, type, listener) {
    this.removeEventListener(chart, type);
    const proxies = chart.$proxies || (chart.$proxies = {});
    const handlers = {
      attach: createAttachObserver,
      detach: createDetachObserver,
      resize: createResizeObserver
    };
    const handler = handlers[type] || createProxyAndListen;
    proxies[type] = handler(chart, type, listener);
  }
  removeEventListener(chart, type) {
    const proxies = chart.$proxies || (chart.$proxies = {});
    const proxy = proxies[type];
    if (!proxy) {
      return;
    }
    const handlers = {
      attach: releaseObserver,
      detach: releaseObserver,
      resize: releaseObserver
    };
    const handler = handlers[type] || removeListener;
    handler(chart, type, proxy);
    proxies[type] = void 0;
  }
  getDevicePixelRatio() {
    return window.devicePixelRatio;
  }
  getMaximumSize(canvas, width, height, aspectRatio) {
    return getMaximumSize(canvas, width, height, aspectRatio);
  }
  isAttached(canvas) {
    const container = canvas && _getParentNode(canvas);
    return !!(container && container.isConnected);
  }
};
function _detectPlatform(canvas) {
  if (!_isDomSupported() || typeof OffscreenCanvas !== "undefined" && canvas instanceof OffscreenCanvas) {
    return BasicPlatform;
  }
  return DomPlatform;
}
var Element2 = class {
  constructor() {
    __publicField(this, "x");
    __publicField(this, "y");
    __publicField(this, "active", false);
    __publicField(this, "options");
    __publicField(this, "$animations");
  }
  tooltipPosition(useFinalPosition) {
    const { x: x6, y: y6 } = this.getProps([
      "x",
      "y"
    ], useFinalPosition);
    return {
      x: x6,
      y: y6
    };
  }
  hasValue() {
    return isNumber(this.x) && isNumber(this.y);
  }
  getProps(props, final) {
    const anims = this.$animations;
    if (!final || !anims) {
      return this;
    }
    const ret = {};
    props.forEach((prop) => {
      ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];
    });
    return ret;
  }
};
__publicField(Element2, "defaults", {});
__publicField(Element2, "defaultRoutes");
function autoSkip(scale, ticks) {
  const tickOpts = scale.options.ticks;
  const determinedMaxTicks = determineMaxTicks(scale);
  const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);
  const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];
  const numMajorIndices = majorIndices.length;
  const first = majorIndices[0];
  const last = majorIndices[numMajorIndices - 1];
  const newTicks = [];
  if (numMajorIndices > ticksLimit) {
    skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);
    return newTicks;
  }
  const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);
  if (numMajorIndices > 0) {
    let i5, ilen;
    const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;
    skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);
    for (i5 = 0, ilen = numMajorIndices - 1; i5 < ilen; i5++) {
      skip(ticks, newTicks, spacing, majorIndices[i5], majorIndices[i5 + 1]);
    }
    skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);
    return newTicks;
  }
  skip(ticks, newTicks, spacing);
  return newTicks;
}
function determineMaxTicks(scale) {
  const offset = scale.options.offset;
  const tickLength = scale._tickSize();
  const maxScale = scale._length / tickLength + (offset ? 0 : 1);
  const maxChart = scale._maxLength / tickLength;
  return Math.floor(Math.min(maxScale, maxChart));
}
function calculateSpacing(majorIndices, ticks, ticksLimit) {
  const evenMajorSpacing = getEvenSpacing(majorIndices);
  const spacing = ticks.length / ticksLimit;
  if (!evenMajorSpacing) {
    return Math.max(spacing, 1);
  }
  const factors = _factorize(evenMajorSpacing);
  for (let i5 = 0, ilen = factors.length - 1; i5 < ilen; i5++) {
    const factor = factors[i5];
    if (factor > spacing) {
      return factor;
    }
  }
  return Math.max(spacing, 1);
}
function getMajorIndices(ticks) {
  const result = [];
  let i5, ilen;
  for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
    if (ticks[i5].major) {
      result.push(i5);
    }
  }
  return result;
}
function skipMajors(ticks, newTicks, majorIndices, spacing) {
  let count = 0;
  let next = majorIndices[0];
  let i5;
  spacing = Math.ceil(spacing);
  for (i5 = 0; i5 < ticks.length; i5++) {
    if (i5 === next) {
      newTicks.push(ticks[i5]);
      count++;
      next = majorIndices[count * spacing];
    }
  }
}
function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
  const start = valueOrDefault(majorStart, 0);
  const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);
  let count = 0;
  let length, i5, next;
  spacing = Math.ceil(spacing);
  if (majorEnd) {
    length = majorEnd - majorStart;
    spacing = length / Math.floor(length / spacing);
  }
  next = start;
  while (next < 0) {
    count++;
    next = Math.round(start + count * spacing);
  }
  for (i5 = Math.max(start, 0); i5 < end; i5++) {
    if (i5 === next) {
      newTicks.push(ticks[i5]);
      count++;
      next = Math.round(start + count * spacing);
    }
  }
}
function getEvenSpacing(arr) {
  const len = arr.length;
  let i5, diff;
  if (len < 2) {
    return false;
  }
  for (diff = arr[0], i5 = 1; i5 < len; ++i5) {
    if (arr[i5] - arr[i5 - 1] !== diff) {
      return false;
    }
  }
  return diff;
}
var reverseAlign = (align) => align === "left" ? "right" : align === "right" ? "left" : align;
var offsetFromEdge = (scale, edge, offset) => edge === "top" || edge === "left" ? scale[edge] + offset : scale[edge] - offset;
var getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);
function sample(arr, numItems) {
  const result = [];
  const increment = arr.length / numItems;
  const len = arr.length;
  let i5 = 0;
  for (; i5 < len; i5 += increment) {
    result.push(arr[Math.floor(i5)]);
  }
  return result;
}
function getPixelForGridLine(scale, index2, offsetGridLines) {
  const length = scale.ticks.length;
  const validIndex2 = Math.min(index2, length - 1);
  const start = scale._startPixel;
  const end = scale._endPixel;
  const epsilon = 1e-6;
  let lineValue = scale.getPixelForTick(validIndex2);
  let offset;
  if (offsetGridLines) {
    if (length === 1) {
      offset = Math.max(lineValue - start, end - lineValue);
    } else if (index2 === 0) {
      offset = (scale.getPixelForTick(1) - lineValue) / 2;
    } else {
      offset = (lineValue - scale.getPixelForTick(validIndex2 - 1)) / 2;
    }
    lineValue += validIndex2 < index2 ? offset : -offset;
    if (lineValue < start - epsilon || lineValue > end + epsilon) {
      return;
    }
  }
  return lineValue;
}
function garbageCollect(caches, length) {
  each(caches, (cache2) => {
    const gc = cache2.gc;
    const gcLen = gc.length / 2;
    let i5;
    if (gcLen > length) {
      for (i5 = 0; i5 < gcLen; ++i5) {
        delete cache2.data[gc[i5]];
      }
      gc.splice(0, gcLen);
    }
  });
}
function getTickMarkLength(options) {
  return options.drawTicks ? options.tickLength : 0;
}
function getTitleHeight(options, fallback) {
  if (!options.display) {
    return 0;
  }
  const font = toFont(options.font, fallback);
  const padding = toPadding(options.padding);
  const lines = isArray(options.text) ? options.text.length : 1;
  return lines * font.lineHeight + padding.height;
}
function createScaleContext(parent, scale) {
  return createContext(parent, {
    scale,
    type: "scale"
  });
}
function createTickContext(parent, index2, tick) {
  return createContext(parent, {
    tick,
    index: index2,
    type: "tick"
  });
}
function titleAlign(align, position, reverse) {
  let ret = _toLeftRightCenter(align);
  if (reverse && position !== "right" || !reverse && position === "right") {
    ret = reverseAlign(ret);
  }
  return ret;
}
function titleArgs(scale, offset, position, align) {
  const { top, left, bottom, right, chart } = scale;
  const { chartArea, scales } = chart;
  let rotation = 0;
  let maxWidth, titleX, titleY;
  const height = bottom - top;
  const width = right - left;
  if (scale.isHorizontal()) {
    titleX = _alignStartEnd(align, left, right);
    if (isObject(position)) {
      const positionAxisID = Object.keys(position)[0];
      const value = position[positionAxisID];
      titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;
    } else if (position === "center") {
      titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;
    } else {
      titleY = offsetFromEdge(scale, position, offset);
    }
    maxWidth = right - left;
  } else {
    if (isObject(position)) {
      const positionAxisID = Object.keys(position)[0];
      const value = position[positionAxisID];
      titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;
    } else if (position === "center") {
      titleX = (chartArea.left + chartArea.right) / 2 - width + offset;
    } else {
      titleX = offsetFromEdge(scale, position, offset);
    }
    titleY = _alignStartEnd(align, bottom, top);
    rotation = position === "left" ? -HALF_PI : HALF_PI;
  }
  return {
    titleX,
    titleY,
    maxWidth,
    rotation
  };
}
var Scale = class _Scale extends Element2 {
  constructor(cfg) {
    super();
    this.id = cfg.id;
    this.type = cfg.type;
    this.options = void 0;
    this.ctx = cfg.ctx;
    this.chart = cfg.chart;
    this.top = void 0;
    this.bottom = void 0;
    this.left = void 0;
    this.right = void 0;
    this.width = void 0;
    this.height = void 0;
    this._margins = {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    };
    this.maxWidth = void 0;
    this.maxHeight = void 0;
    this.paddingTop = void 0;
    this.paddingBottom = void 0;
    this.paddingLeft = void 0;
    this.paddingRight = void 0;
    this.axis = void 0;
    this.labelRotation = void 0;
    this.min = void 0;
    this.max = void 0;
    this._range = void 0;
    this.ticks = [];
    this._gridLineItems = null;
    this._labelItems = null;
    this._labelSizes = null;
    this._length = 0;
    this._maxLength = 0;
    this._longestTextCache = {};
    this._startPixel = void 0;
    this._endPixel = void 0;
    this._reversePixels = false;
    this._userMax = void 0;
    this._userMin = void 0;
    this._suggestedMax = void 0;
    this._suggestedMin = void 0;
    this._ticksLength = 0;
    this._borderValue = 0;
    this._cache = {};
    this._dataLimitsCached = false;
    this.$context = void 0;
  }
  init(options) {
    this.options = options.setContext(this.getContext());
    this.axis = options.axis;
    this._userMin = this.parse(options.min);
    this._userMax = this.parse(options.max);
    this._suggestedMin = this.parse(options.suggestedMin);
    this._suggestedMax = this.parse(options.suggestedMax);
  }
  parse(raw, index2) {
    return raw;
  }
  getUserBounds() {
    let { _userMin, _userMax, _suggestedMin, _suggestedMax } = this;
    _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);
    _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);
    _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);
    _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);
    return {
      min: finiteOrDefault(_userMin, _suggestedMin),
      max: finiteOrDefault(_userMax, _suggestedMax),
      minDefined: isNumberFinite(_userMin),
      maxDefined: isNumberFinite(_userMax)
    };
  }
  getMinMax(canStack) {
    let { min, max, minDefined, maxDefined } = this.getUserBounds();
    let range;
    if (minDefined && maxDefined) {
      return {
        min,
        max
      };
    }
    const metas = this.getMatchingVisibleMetas();
    for (let i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
      range = metas[i5].controller.getMinMax(this, canStack);
      if (!minDefined) {
        min = Math.min(min, range.min);
      }
      if (!maxDefined) {
        max = Math.max(max, range.max);
      }
    }
    min = maxDefined && min > max ? max : min;
    max = minDefined && min > max ? min : max;
    return {
      min: finiteOrDefault(min, finiteOrDefault(max, min)),
      max: finiteOrDefault(max, finiteOrDefault(min, max))
    };
  }
  getPadding() {
    return {
      left: this.paddingLeft || 0,
      top: this.paddingTop || 0,
      right: this.paddingRight || 0,
      bottom: this.paddingBottom || 0
    };
  }
  getTicks() {
    return this.ticks;
  }
  getLabels() {
    const data = this.chart.data;
    return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];
  }
  getLabelItems(chartArea = this.chart.chartArea) {
    const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));
    return items;
  }
  beforeLayout() {
    this._cache = {};
    this._dataLimitsCached = false;
  }
  beforeUpdate() {
    callback(this.options.beforeUpdate, [
      this
    ]);
  }
  update(maxWidth, maxHeight, margins) {
    const { beginAtZero, grace, ticks: tickOpts } = this.options;
    const sampleSize = tickOpts.sampleSize;
    this.beforeUpdate();
    this.maxWidth = maxWidth;
    this.maxHeight = maxHeight;
    this._margins = margins = Object.assign({
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    }, margins);
    this.ticks = null;
    this._labelSizes = null;
    this._gridLineItems = null;
    this._labelItems = null;
    this.beforeSetDimensions();
    this.setDimensions();
    this.afterSetDimensions();
    this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;
    if (!this._dataLimitsCached) {
      this.beforeDataLimits();
      this.determineDataLimits();
      this.afterDataLimits();
      this._range = _addGrace(this, grace, beginAtZero);
      this._dataLimitsCached = true;
    }
    this.beforeBuildTicks();
    this.ticks = this.buildTicks() || [];
    this.afterBuildTicks();
    const samplingEnabled = sampleSize < this.ticks.length;
    this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);
    this.configure();
    this.beforeCalculateLabelRotation();
    this.calculateLabelRotation();
    this.afterCalculateLabelRotation();
    if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === "auto")) {
      this.ticks = autoSkip(this, this.ticks);
      this._labelSizes = null;
      this.afterAutoSkip();
    }
    if (samplingEnabled) {
      this._convertTicksToLabels(this.ticks);
    }
    this.beforeFit();
    this.fit();
    this.afterFit();
    this.afterUpdate();
  }
  configure() {
    let reversePixels = this.options.reverse;
    let startPixel, endPixel;
    if (this.isHorizontal()) {
      startPixel = this.left;
      endPixel = this.right;
    } else {
      startPixel = this.top;
      endPixel = this.bottom;
      reversePixels = !reversePixels;
    }
    this._startPixel = startPixel;
    this._endPixel = endPixel;
    this._reversePixels = reversePixels;
    this._length = endPixel - startPixel;
    this._alignToPixels = this.options.alignToPixels;
  }
  afterUpdate() {
    callback(this.options.afterUpdate, [
      this
    ]);
  }
  beforeSetDimensions() {
    callback(this.options.beforeSetDimensions, [
      this
    ]);
  }
  setDimensions() {
    if (this.isHorizontal()) {
      this.width = this.maxWidth;
      this.left = 0;
      this.right = this.width;
    } else {
      this.height = this.maxHeight;
      this.top = 0;
      this.bottom = this.height;
    }
    this.paddingLeft = 0;
    this.paddingTop = 0;
    this.paddingRight = 0;
    this.paddingBottom = 0;
  }
  afterSetDimensions() {
    callback(this.options.afterSetDimensions, [
      this
    ]);
  }
  _callHooks(name) {
    this.chart.notifyPlugins(name, this.getContext());
    callback(this.options[name], [
      this
    ]);
  }
  beforeDataLimits() {
    this._callHooks("beforeDataLimits");
  }
  determineDataLimits() {
  }
  afterDataLimits() {
    this._callHooks("afterDataLimits");
  }
  beforeBuildTicks() {
    this._callHooks("beforeBuildTicks");
  }
  buildTicks() {
    return [];
  }
  afterBuildTicks() {
    this._callHooks("afterBuildTicks");
  }
  beforeTickToLabelConversion() {
    callback(this.options.beforeTickToLabelConversion, [
      this
    ]);
  }
  generateTickLabels(ticks) {
    const tickOpts = this.options.ticks;
    let i5, ilen, tick;
    for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
      tick = ticks[i5];
      tick.label = callback(tickOpts.callback, [
        tick.value,
        i5,
        ticks
      ], this);
    }
  }
  afterTickToLabelConversion() {
    callback(this.options.afterTickToLabelConversion, [
      this
    ]);
  }
  beforeCalculateLabelRotation() {
    callback(this.options.beforeCalculateLabelRotation, [
      this
    ]);
  }
  calculateLabelRotation() {
    const options = this.options;
    const tickOpts = options.ticks;
    const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);
    const minRotation = tickOpts.minRotation || 0;
    const maxRotation = tickOpts.maxRotation;
    let labelRotation = minRotation;
    let tickWidth, maxHeight, maxLabelDiagonal;
    if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {
      this.labelRotation = minRotation;
      return;
    }
    const labelSizes = this._getLabelSizes();
    const maxLabelWidth = labelSizes.widest.width;
    const maxLabelHeight = labelSizes.highest.height;
    const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);
    tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);
    if (maxLabelWidth + 6 > tickWidth) {
      tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));
      maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);
      maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
      labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))));
      labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));
    }
    this.labelRotation = labelRotation;
  }
  afterCalculateLabelRotation() {
    callback(this.options.afterCalculateLabelRotation, [
      this
    ]);
  }
  afterAutoSkip() {
  }
  beforeFit() {
    callback(this.options.beforeFit, [
      this
    ]);
  }
  fit() {
    const minSize = {
      width: 0,
      height: 0
    };
    const { chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;
    const display = this._isVisible();
    const isHorizontal = this.isHorizontal();
    if (display) {
      const titleHeight = getTitleHeight(titleOpts, chart.options.font);
      if (isHorizontal) {
        minSize.width = this.maxWidth;
        minSize.height = getTickMarkLength(gridOpts) + titleHeight;
      } else {
        minSize.height = this.maxHeight;
        minSize.width = getTickMarkLength(gridOpts) + titleHeight;
      }
      if (tickOpts.display && this.ticks.length) {
        const { first, last, widest, highest } = this._getLabelSizes();
        const tickPadding = tickOpts.padding * 2;
        const angleRadians = toRadians(this.labelRotation);
        const cos = Math.cos(angleRadians);
        const sin = Math.sin(angleRadians);
        if (isHorizontal) {
          const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;
          minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);
        } else {
          const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;
          minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);
        }
        this._calculatePadding(first, last, sin, cos);
      }
    }
    this._handleMargins();
    if (isHorizontal) {
      this.width = this._length = chart.width - this._margins.left - this._margins.right;
      this.height = minSize.height;
    } else {
      this.width = minSize.width;
      this.height = this._length = chart.height - this._margins.top - this._margins.bottom;
    }
  }
  _calculatePadding(first, last, sin, cos) {
    const { ticks: { align, padding }, position } = this.options;
    const isRotated = this.labelRotation !== 0;
    const labelsBelowTicks = position !== "top" && this.axis === "x";
    if (this.isHorizontal()) {
      const offsetLeft = this.getPixelForTick(0) - this.left;
      const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
      let paddingLeft = 0;
      let paddingRight = 0;
      if (isRotated) {
        if (labelsBelowTicks) {
          paddingLeft = cos * first.width;
          paddingRight = sin * last.height;
        } else {
          paddingLeft = sin * first.height;
          paddingRight = cos * last.width;
        }
      } else if (align === "start") {
        paddingRight = last.width;
      } else if (align === "end") {
        paddingLeft = first.width;
      } else if (align !== "inner") {
        paddingLeft = first.width / 2;
        paddingRight = last.width / 2;
      }
      this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);
      this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);
    } else {
      let paddingTop = last.height / 2;
      let paddingBottom = first.height / 2;
      if (align === "start") {
        paddingTop = 0;
        paddingBottom = first.height;
      } else if (align === "end") {
        paddingTop = last.height;
        paddingBottom = 0;
      }
      this.paddingTop = paddingTop + padding;
      this.paddingBottom = paddingBottom + padding;
    }
  }
  _handleMargins() {
    if (this._margins) {
      this._margins.left = Math.max(this.paddingLeft, this._margins.left);
      this._margins.top = Math.max(this.paddingTop, this._margins.top);
      this._margins.right = Math.max(this.paddingRight, this._margins.right);
      this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);
    }
  }
  afterFit() {
    callback(this.options.afterFit, [
      this
    ]);
  }
  isHorizontal() {
    const { axis, position } = this.options;
    return position === "top" || position === "bottom" || axis === "x";
  }
  isFullSize() {
    return this.options.fullSize;
  }
  _convertTicksToLabels(ticks) {
    this.beforeTickToLabelConversion();
    this.generateTickLabels(ticks);
    let i5, ilen;
    for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
      if (isNullOrUndef(ticks[i5].label)) {
        ticks.splice(i5, 1);
        ilen--;
        i5--;
      }
    }
    this.afterTickToLabelConversion();
  }
  _getLabelSizes() {
    let labelSizes = this._labelSizes;
    if (!labelSizes) {
      const sampleSize = this.options.ticks.sampleSize;
      let ticks = this.ticks;
      if (sampleSize < ticks.length) {
        ticks = sample(ticks, sampleSize);
      }
      this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);
    }
    return labelSizes;
  }
  _computeLabelSizes(ticks, length, maxTicksLimit) {
    const { ctx, _longestTextCache: caches } = this;
    const widths = [];
    const heights = [];
    const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));
    let widestLabelSize = 0;
    let highestLabelSize = 0;
    let i5, j4, jlen, label, tickFont, fontString, cache2, lineHeight, width, height, nestedLabel;
    for (i5 = 0; i5 < length; i5 += increment) {
      label = ticks[i5].label;
      tickFont = this._resolveTickFontOptions(i5);
      ctx.font = fontString = tickFont.string;
      cache2 = caches[fontString] = caches[fontString] || {
        data: {},
        gc: []
      };
      lineHeight = tickFont.lineHeight;
      width = height = 0;
      if (!isNullOrUndef(label) && !isArray(label)) {
        width = _measureText(ctx, cache2.data, cache2.gc, width, label);
        height = lineHeight;
      } else if (isArray(label)) {
        for (j4 = 0, jlen = label.length; j4 < jlen; ++j4) {
          nestedLabel = label[j4];
          if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {
            width = _measureText(ctx, cache2.data, cache2.gc, width, nestedLabel);
            height += lineHeight;
          }
        }
      }
      widths.push(width);
      heights.push(height);
      widestLabelSize = Math.max(width, widestLabelSize);
      highestLabelSize = Math.max(height, highestLabelSize);
    }
    garbageCollect(caches, length);
    const widest = widths.indexOf(widestLabelSize);
    const highest = heights.indexOf(highestLabelSize);
    const valueAt = (idx) => ({
      width: widths[idx] || 0,
      height: heights[idx] || 0
    });
    return {
      first: valueAt(0),
      last: valueAt(length - 1),
      widest: valueAt(widest),
      highest: valueAt(highest),
      widths,
      heights
    };
  }
  getLabelForValue(value) {
    return value;
  }
  getPixelForValue(value, index2) {
    return NaN;
  }
  getValueForPixel(pixel) {
  }
  getPixelForTick(index2) {
    const ticks = this.ticks;
    if (index2 < 0 || index2 > ticks.length - 1) {
      return null;
    }
    return this.getPixelForValue(ticks[index2].value);
  }
  getPixelForDecimal(decimal) {
    if (this._reversePixels) {
      decimal = 1 - decimal;
    }
    const pixel = this._startPixel + decimal * this._length;
    return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);
  }
  getDecimalForPixel(pixel) {
    const decimal = (pixel - this._startPixel) / this._length;
    return this._reversePixels ? 1 - decimal : decimal;
  }
  getBasePixel() {
    return this.getPixelForValue(this.getBaseValue());
  }
  getBaseValue() {
    const { min, max } = this;
    return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;
  }
  getContext(index2) {
    const ticks = this.ticks || [];
    if (index2 >= 0 && index2 < ticks.length) {
      const tick = ticks[index2];
      return tick.$context || (tick.$context = createTickContext(this.getContext(), index2, tick));
    }
    return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));
  }
  _tickSize() {
    const optionTicks = this.options.ticks;
    const rot = toRadians(this.labelRotation);
    const cos = Math.abs(Math.cos(rot));
    const sin = Math.abs(Math.sin(rot));
    const labelSizes = this._getLabelSizes();
    const padding = optionTicks.autoSkipPadding || 0;
    const w6 = labelSizes ? labelSizes.widest.width + padding : 0;
    const h5 = labelSizes ? labelSizes.highest.height + padding : 0;
    return this.isHorizontal() ? h5 * cos > w6 * sin ? w6 / cos : h5 / sin : h5 * sin < w6 * cos ? h5 / cos : w6 / sin;
  }
  _isVisible() {
    const display = this.options.display;
    if (display !== "auto") {
      return !!display;
    }
    return this.getMatchingVisibleMetas().length > 0;
  }
  _computeGridLineItems(chartArea) {
    const axis = this.axis;
    const chart = this.chart;
    const options = this.options;
    const { grid, position, border } = options;
    const offset = grid.offset;
    const isHorizontal = this.isHorizontal();
    const ticks = this.ticks;
    const ticksLength = ticks.length + (offset ? 1 : 0);
    const tl = getTickMarkLength(grid);
    const items = [];
    const borderOpts = border.setContext(this.getContext());
    const axisWidth = borderOpts.display ? borderOpts.width : 0;
    const axisHalfWidth = axisWidth / 2;
    const alignBorderValue = function(pixel) {
      return _alignPixel(chart, pixel, axisWidth);
    };
    let borderValue, i5, lineValue, alignedLineValue;
    let tx1, ty1, tx2, ty2, x1, y1, x22, y23;
    if (position === "top") {
      borderValue = alignBorderValue(this.bottom);
      ty1 = this.bottom - tl;
      ty2 = borderValue - axisHalfWidth;
      y1 = alignBorderValue(chartArea.top) + axisHalfWidth;
      y23 = chartArea.bottom;
    } else if (position === "bottom") {
      borderValue = alignBorderValue(this.top);
      y1 = chartArea.top;
      y23 = alignBorderValue(chartArea.bottom) - axisHalfWidth;
      ty1 = borderValue + axisHalfWidth;
      ty2 = this.top + tl;
    } else if (position === "left") {
      borderValue = alignBorderValue(this.right);
      tx1 = this.right - tl;
      tx2 = borderValue - axisHalfWidth;
      x1 = alignBorderValue(chartArea.left) + axisHalfWidth;
      x22 = chartArea.right;
    } else if (position === "right") {
      borderValue = alignBorderValue(this.left);
      x1 = chartArea.left;
      x22 = alignBorderValue(chartArea.right) - axisHalfWidth;
      tx1 = borderValue + axisHalfWidth;
      tx2 = this.left + tl;
    } else if (axis === "x") {
      if (position === "center") {
        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
      }
      y1 = chartArea.top;
      y23 = chartArea.bottom;
      ty1 = borderValue + axisHalfWidth;
      ty2 = ty1 + tl;
    } else if (axis === "y") {
      if (position === "center") {
        borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
      }
      tx1 = borderValue - axisHalfWidth;
      tx2 = tx1 - tl;
      x1 = chartArea.left;
      x22 = chartArea.right;
    }
    const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);
    const step = Math.max(1, Math.ceil(ticksLength / limit));
    for (i5 = 0; i5 < ticksLength; i5 += step) {
      const context = this.getContext(i5);
      const optsAtIndex = grid.setContext(context);
      const optsAtIndexBorder = border.setContext(context);
      const lineWidth = optsAtIndex.lineWidth;
      const lineColor = optsAtIndex.color;
      const borderDash = optsAtIndexBorder.dash || [];
      const borderDashOffset = optsAtIndexBorder.dashOffset;
      const tickWidth = optsAtIndex.tickWidth;
      const tickColor = optsAtIndex.tickColor;
      const tickBorderDash = optsAtIndex.tickBorderDash || [];
      const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;
      lineValue = getPixelForGridLine(this, i5, offset);
      if (lineValue === void 0) {
        continue;
      }
      alignedLineValue = _alignPixel(chart, lineValue, lineWidth);
      if (isHorizontal) {
        tx1 = tx2 = x1 = x22 = alignedLineValue;
      } else {
        ty1 = ty2 = y1 = y23 = alignedLineValue;
      }
      items.push({
        tx1,
        ty1,
        tx2,
        ty2,
        x1,
        y1,
        x2: x22,
        y2: y23,
        width: lineWidth,
        color: lineColor,
        borderDash,
        borderDashOffset,
        tickWidth,
        tickColor,
        tickBorderDash,
        tickBorderDashOffset
      });
    }
    this._ticksLength = ticksLength;
    this._borderValue = borderValue;
    return items;
  }
  _computeLabelItems(chartArea) {
    const axis = this.axis;
    const options = this.options;
    const { position, ticks: optionTicks } = options;
    const isHorizontal = this.isHorizontal();
    const ticks = this.ticks;
    const { align, crossAlign, padding, mirror } = optionTicks;
    const tl = getTickMarkLength(options.grid);
    const tickAndPadding = tl + padding;
    const hTickAndPadding = mirror ? -padding : tickAndPadding;
    const rotation = -toRadians(this.labelRotation);
    const items = [];
    let i5, ilen, tick, label, x6, y6, textAlign, pixel, font, lineHeight, lineCount, textOffset;
    let textBaseline = "middle";
    if (position === "top") {
      y6 = this.bottom - hTickAndPadding;
      textAlign = this._getXAxisLabelAlignment();
    } else if (position === "bottom") {
      y6 = this.top + hTickAndPadding;
      textAlign = this._getXAxisLabelAlignment();
    } else if (position === "left") {
      const ret = this._getYAxisLabelAlignment(tl);
      textAlign = ret.textAlign;
      x6 = ret.x;
    } else if (position === "right") {
      const ret = this._getYAxisLabelAlignment(tl);
      textAlign = ret.textAlign;
      x6 = ret.x;
    } else if (axis === "x") {
      if (position === "center") {
        y6 = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
        y6 = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;
      }
      textAlign = this._getXAxisLabelAlignment();
    } else if (axis === "y") {
      if (position === "center") {
        x6 = (chartArea.left + chartArea.right) / 2 - tickAndPadding;
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
        x6 = this.chart.scales[positionAxisID].getPixelForValue(value);
      }
      textAlign = this._getYAxisLabelAlignment(tl).textAlign;
    }
    if (axis === "y") {
      if (align === "start") {
        textBaseline = "top";
      } else if (align === "end") {
        textBaseline = "bottom";
      }
    }
    const labelSizes = this._getLabelSizes();
    for (i5 = 0, ilen = ticks.length; i5 < ilen; ++i5) {
      tick = ticks[i5];
      label = tick.label;
      const optsAtIndex = optionTicks.setContext(this.getContext(i5));
      pixel = this.getPixelForTick(i5) + optionTicks.labelOffset;
      font = this._resolveTickFontOptions(i5);
      lineHeight = font.lineHeight;
      lineCount = isArray(label) ? label.length : 1;
      const halfCount = lineCount / 2;
      const color2 = optsAtIndex.color;
      const strokeColor = optsAtIndex.textStrokeColor;
      const strokeWidth = optsAtIndex.textStrokeWidth;
      let tickTextAlign = textAlign;
      if (isHorizontal) {
        x6 = pixel;
        if (textAlign === "inner") {
          if (i5 === ilen - 1) {
            tickTextAlign = !this.options.reverse ? "right" : "left";
          } else if (i5 === 0) {
            tickTextAlign = !this.options.reverse ? "left" : "right";
          } else {
            tickTextAlign = "center";
          }
        }
        if (position === "top") {
          if (crossAlign === "near" || rotation !== 0) {
            textOffset = -lineCount * lineHeight + lineHeight / 2;
          } else if (crossAlign === "center") {
            textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
          } else {
            textOffset = -labelSizes.highest.height + lineHeight / 2;
          }
        } else {
          if (crossAlign === "near" || rotation !== 0) {
            textOffset = lineHeight / 2;
          } else if (crossAlign === "center") {
            textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
          } else {
            textOffset = labelSizes.highest.height - lineCount * lineHeight;
          }
        }
        if (mirror) {
          textOffset *= -1;
        }
        if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {
          x6 += lineHeight / 2 * Math.sin(rotation);
        }
      } else {
        y6 = pixel;
        textOffset = (1 - lineCount) * lineHeight / 2;
      }
      let backdrop;
      if (optsAtIndex.showLabelBackdrop) {
        const labelPadding = toPadding(optsAtIndex.backdropPadding);
        const height = labelSizes.heights[i5];
        const width = labelSizes.widths[i5];
        let top = textOffset - labelPadding.top;
        let left = 0 - labelPadding.left;
        switch (textBaseline) {
          case "middle":
            top -= height / 2;
            break;
          case "bottom":
            top -= height;
            break;
        }
        switch (textAlign) {
          case "center":
            left -= width / 2;
            break;
          case "right":
            left -= width;
            break;
          case "inner":
            if (i5 === ilen - 1) {
              left -= width;
            } else if (i5 > 0) {
              left -= width / 2;
            }
            break;
        }
        backdrop = {
          left,
          top,
          width: width + labelPadding.width,
          height: height + labelPadding.height,
          color: optsAtIndex.backdropColor
        };
      }
      items.push({
        label,
        font,
        textOffset,
        options: {
          rotation,
          color: color2,
          strokeColor,
          strokeWidth,
          textAlign: tickTextAlign,
          textBaseline,
          translation: [
            x6,
            y6
          ],
          backdrop
        }
      });
    }
    return items;
  }
  _getXAxisLabelAlignment() {
    const { position, ticks } = this.options;
    const rotation = -toRadians(this.labelRotation);
    if (rotation) {
      return position === "top" ? "left" : "right";
    }
    let align = "center";
    if (ticks.align === "start") {
      align = "left";
    } else if (ticks.align === "end") {
      align = "right";
    } else if (ticks.align === "inner") {
      align = "inner";
    }
    return align;
  }
  _getYAxisLabelAlignment(tl) {
    const { position, ticks: { crossAlign, mirror, padding } } = this.options;
    const labelSizes = this._getLabelSizes();
    const tickAndPadding = tl + padding;
    const widest = labelSizes.widest.width;
    let textAlign;
    let x6;
    if (position === "left") {
      if (mirror) {
        x6 = this.right + padding;
        if (crossAlign === "near") {
          textAlign = "left";
        } else if (crossAlign === "center") {
          textAlign = "center";
          x6 += widest / 2;
        } else {
          textAlign = "right";
          x6 += widest;
        }
      } else {
        x6 = this.right - tickAndPadding;
        if (crossAlign === "near") {
          textAlign = "right";
        } else if (crossAlign === "center") {
          textAlign = "center";
          x6 -= widest / 2;
        } else {
          textAlign = "left";
          x6 = this.left;
        }
      }
    } else if (position === "right") {
      if (mirror) {
        x6 = this.left + padding;
        if (crossAlign === "near") {
          textAlign = "right";
        } else if (crossAlign === "center") {
          textAlign = "center";
          x6 -= widest / 2;
        } else {
          textAlign = "left";
          x6 -= widest;
        }
      } else {
        x6 = this.left + tickAndPadding;
        if (crossAlign === "near") {
          textAlign = "left";
        } else if (crossAlign === "center") {
          textAlign = "center";
          x6 += widest / 2;
        } else {
          textAlign = "right";
          x6 = this.right;
        }
      }
    } else {
      textAlign = "right";
    }
    return {
      textAlign,
      x: x6
    };
  }
  _computeLabelArea() {
    if (this.options.ticks.mirror) {
      return;
    }
    const chart = this.chart;
    const position = this.options.position;
    if (position === "left" || position === "right") {
      return {
        top: 0,
        left: this.left,
        bottom: chart.height,
        right: this.right
      };
    }
    if (position === "top" || position === "bottom") {
      return {
        top: this.top,
        left: 0,
        bottom: this.bottom,
        right: chart.width
      };
    }
  }
  drawBackground() {
    const { ctx, options: { backgroundColor }, left, top, width, height } = this;
    if (backgroundColor) {
      ctx.save();
      ctx.fillStyle = backgroundColor;
      ctx.fillRect(left, top, width, height);
      ctx.restore();
    }
  }
  getLineWidthForValue(value) {
    const grid = this.options.grid;
    if (!this._isVisible() || !grid.display) {
      return 0;
    }
    const ticks = this.ticks;
    const index2 = ticks.findIndex((t5) => t5.value === value);
    if (index2 >= 0) {
      const opts = grid.setContext(this.getContext(index2));
      return opts.lineWidth;
    }
    return 0;
  }
  drawGrid(chartArea) {
    const grid = this.options.grid;
    const ctx = this.ctx;
    const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));
    let i5, ilen;
    const drawLine = (p1, p22, style) => {
      if (!style.width || !style.color) {
        return;
      }
      ctx.save();
      ctx.lineWidth = style.width;
      ctx.strokeStyle = style.color;
      ctx.setLineDash(style.borderDash || []);
      ctx.lineDashOffset = style.borderDashOffset;
      ctx.beginPath();
      ctx.moveTo(p1.x, p1.y);
      ctx.lineTo(p22.x, p22.y);
      ctx.stroke();
      ctx.restore();
    };
    if (grid.display) {
      for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
        const item = items[i5];
        if (grid.drawOnChartArea) {
          drawLine({
            x: item.x1,
            y: item.y1
          }, {
            x: item.x2,
            y: item.y2
          }, item);
        }
        if (grid.drawTicks) {
          drawLine({
            x: item.tx1,
            y: item.ty1
          }, {
            x: item.tx2,
            y: item.ty2
          }, {
            color: item.tickColor,
            width: item.tickWidth,
            borderDash: item.tickBorderDash,
            borderDashOffset: item.tickBorderDashOffset
          });
        }
      }
    }
  }
  drawBorder() {
    const { chart, ctx, options: { border, grid } } = this;
    const borderOpts = border.setContext(this.getContext());
    const axisWidth = border.display ? borderOpts.width : 0;
    if (!axisWidth) {
      return;
    }
    const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;
    const borderValue = this._borderValue;
    let x1, x22, y1, y23;
    if (this.isHorizontal()) {
      x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;
      x22 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;
      y1 = y23 = borderValue;
    } else {
      y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;
      y23 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;
      x1 = x22 = borderValue;
    }
    ctx.save();
    ctx.lineWidth = borderOpts.width;
    ctx.strokeStyle = borderOpts.color;
    ctx.beginPath();
    ctx.moveTo(x1, y1);
    ctx.lineTo(x22, y23);
    ctx.stroke();
    ctx.restore();
  }
  drawLabels(chartArea) {
    const optionTicks = this.options.ticks;
    if (!optionTicks.display) {
      return;
    }
    const ctx = this.ctx;
    const area = this._computeLabelArea();
    if (area) {
      clipArea(ctx, area);
    }
    const items = this.getLabelItems(chartArea);
    for (const item of items) {
      const renderTextOptions = item.options;
      const tickFont = item.font;
      const label = item.label;
      const y6 = item.textOffset;
      renderText(ctx, label, 0, y6, tickFont, renderTextOptions);
    }
    if (area) {
      unclipArea(ctx);
    }
  }
  drawTitle() {
    const { ctx, options: { position, title, reverse } } = this;
    if (!title.display) {
      return;
    }
    const font = toFont(title.font);
    const padding = toPadding(title.padding);
    const align = title.align;
    let offset = font.lineHeight / 2;
    if (position === "bottom" || position === "center" || isObject(position)) {
      offset += padding.bottom;
      if (isArray(title.text)) {
        offset += font.lineHeight * (title.text.length - 1);
      }
    } else {
      offset += padding.top;
    }
    const { titleX, titleY, maxWidth, rotation } = titleArgs(this, offset, position, align);
    renderText(ctx, title.text, 0, 0, font, {
      color: title.color,
      maxWidth,
      rotation,
      textAlign: titleAlign(align, position, reverse),
      textBaseline: "middle",
      translation: [
        titleX,
        titleY
      ]
    });
  }
  draw(chartArea) {
    if (!this._isVisible()) {
      return;
    }
    this.drawBackground();
    this.drawGrid(chartArea);
    this.drawBorder();
    this.drawTitle();
    this.drawLabels(chartArea);
  }
  _layers() {
    const opts = this.options;
    const tz = opts.ticks && opts.ticks.z || 0;
    const gz = valueOrDefault(opts.grid && opts.grid.z, -1);
    const bz = valueOrDefault(opts.border && opts.border.z, 0);
    if (!this._isVisible() || this.draw !== _Scale.prototype.draw) {
      return [
        {
          z: tz,
          draw: (chartArea) => {
            this.draw(chartArea);
          }
        }
      ];
    }
    return [
      {
        z: gz,
        draw: (chartArea) => {
          this.drawBackground();
          this.drawGrid(chartArea);
          this.drawTitle();
        }
      },
      {
        z: bz,
        draw: () => {
          this.drawBorder();
        }
      },
      {
        z: tz,
        draw: (chartArea) => {
          this.drawLabels(chartArea);
        }
      }
    ];
  }
  getMatchingVisibleMetas(type) {
    const metas = this.chart.getSortedVisibleDatasetMetas();
    const axisID = this.axis + "AxisID";
    const result = [];
    let i5, ilen;
    for (i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
      const meta = metas[i5];
      if (meta[axisID] === this.id && (!type || meta.type === type)) {
        result.push(meta);
      }
    }
    return result;
  }
  _resolveTickFontOptions(index2) {
    const opts = this.options.ticks.setContext(this.getContext(index2));
    return toFont(opts.font);
  }
  _maxDigits() {
    const fontSize = this._resolveTickFontOptions(0).lineHeight;
    return (this.isHorizontal() ? this.width : this.height) / fontSize;
  }
};
var TypedRegistry = class {
  constructor(type, scope, override) {
    this.type = type;
    this.scope = scope;
    this.override = override;
    this.items = /* @__PURE__ */ Object.create(null);
  }
  isForType(type) {
    return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);
  }
  register(item) {
    const proto = Object.getPrototypeOf(item);
    let parentScope;
    if (isIChartComponent(proto)) {
      parentScope = this.register(proto);
    }
    const items = this.items;
    const id = item.id;
    const scope = this.scope + "." + id;
    if (!id) {
      throw new Error("class does not have id: " + item);
    }
    if (id in items) {
      return scope;
    }
    items[id] = item;
    registerDefaults(item, scope, parentScope);
    if (this.override) {
      defaults.override(item.id, item.overrides);
    }
    return scope;
  }
  get(id) {
    return this.items[id];
  }
  unregister(item) {
    const items = this.items;
    const id = item.id;
    const scope = this.scope;
    if (id in items) {
      delete items[id];
    }
    if (scope && id in defaults[scope]) {
      delete defaults[scope][id];
      if (this.override) {
        delete overrides[id];
      }
    }
  }
};
function registerDefaults(item, scope, parentScope) {
  const itemDefaults = merge(/* @__PURE__ */ Object.create(null), [
    parentScope ? defaults.get(parentScope) : {},
    defaults.get(scope),
    item.defaults
  ]);
  defaults.set(scope, itemDefaults);
  if (item.defaultRoutes) {
    routeDefaults(scope, item.defaultRoutes);
  }
  if (item.descriptors) {
    defaults.describe(scope, item.descriptors);
  }
}
function routeDefaults(scope, routes) {
  Object.keys(routes).forEach((property) => {
    const propertyParts = property.split(".");
    const sourceName = propertyParts.pop();
    const sourceScope = [
      scope
    ].concat(propertyParts).join(".");
    const parts = routes[property].split(".");
    const targetName = parts.pop();
    const targetScope = parts.join(".");
    defaults.route(sourceScope, sourceName, targetScope, targetName);
  });
}
function isIChartComponent(proto) {
  return "id" in proto && "defaults" in proto;
}
var Registry = class {
  constructor() {
    this.controllers = new TypedRegistry(DatasetController, "datasets", true);
    this.elements = new TypedRegistry(Element2, "elements");
    this.plugins = new TypedRegistry(Object, "plugins");
    this.scales = new TypedRegistry(Scale, "scales");
    this._typedRegistries = [
      this.controllers,
      this.scales,
      this.elements
    ];
  }
  add(...args) {
    this._each("register", args);
  }
  remove(...args) {
    this._each("unregister", args);
  }
  addControllers(...args) {
    this._each("register", args, this.controllers);
  }
  addElements(...args) {
    this._each("register", args, this.elements);
  }
  addPlugins(...args) {
    this._each("register", args, this.plugins);
  }
  addScales(...args) {
    this._each("register", args, this.scales);
  }
  getController(id) {
    return this._get(id, this.controllers, "controller");
  }
  getElement(id) {
    return this._get(id, this.elements, "element");
  }
  getPlugin(id) {
    return this._get(id, this.plugins, "plugin");
  }
  getScale(id) {
    return this._get(id, this.scales, "scale");
  }
  removeControllers(...args) {
    this._each("unregister", args, this.controllers);
  }
  removeElements(...args) {
    this._each("unregister", args, this.elements);
  }
  removePlugins(...args) {
    this._each("unregister", args, this.plugins);
  }
  removeScales(...args) {
    this._each("unregister", args, this.scales);
  }
  _each(method, args, typedRegistry) {
    [
      ...args
    ].forEach((arg) => {
      const reg = typedRegistry || this._getRegistryForType(arg);
      if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {
        this._exec(method, reg, arg);
      } else {
        each(arg, (item) => {
          const itemReg = typedRegistry || this._getRegistryForType(item);
          this._exec(method, itemReg, item);
        });
      }
    });
  }
  _exec(method, registry2, component) {
    const camelMethod = _capitalize(method);
    callback(component["before" + camelMethod], [], component);
    registry2[method](component);
    callback(component["after" + camelMethod], [], component);
  }
  _getRegistryForType(type) {
    for (let i5 = 0; i5 < this._typedRegistries.length; i5++) {
      const reg = this._typedRegistries[i5];
      if (reg.isForType(type)) {
        return reg;
      }
    }
    return this.plugins;
  }
  _get(id, typedRegistry, type) {
    const item = typedRegistry.get(id);
    if (item === void 0) {
      throw new Error('"' + id + '" is not a registered ' + type + ".");
    }
    return item;
  }
};
var registry = /* @__PURE__ */ new Registry();
var PluginService = class {
  constructor() {
    this._init = [];
  }
  notify(chart, hook, args, filter) {
    if (hook === "beforeInit") {
      this._init = this._createDescriptors(chart, true);
      this._notify(this._init, chart, "install");
    }
    const descriptors2 = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);
    const result = this._notify(descriptors2, chart, hook, args);
    if (hook === "afterDestroy") {
      this._notify(descriptors2, chart, "stop");
      this._notify(this._init, chart, "uninstall");
    }
    return result;
  }
  _notify(descriptors2, chart, hook, args) {
    args = args || {};
    for (const descriptor of descriptors2) {
      const plugin = descriptor.plugin;
      const method = plugin[hook];
      const params = [
        chart,
        args,
        descriptor.options
      ];
      if (callback(method, params, plugin) === false && args.cancelable) {
        return false;
      }
    }
    return true;
  }
  invalidate() {
    if (!isNullOrUndef(this._cache)) {
      this._oldCache = this._cache;
      this._cache = void 0;
    }
  }
  _descriptors(chart) {
    if (this._cache) {
      return this._cache;
    }
    const descriptors2 = this._cache = this._createDescriptors(chart);
    this._notifyStateChanges(chart);
    return descriptors2;
  }
  _createDescriptors(chart, all) {
    const config = chart && chart.config;
    const options = valueOrDefault(config.options && config.options.plugins, {});
    const plugins = allPlugins(config);
    return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);
  }
  _notifyStateChanges(chart) {
    const previousDescriptors = this._oldCache || [];
    const descriptors2 = this._cache;
    const diff = (a6, b5) => a6.filter((x6) => !b5.some((y6) => x6.plugin.id === y6.plugin.id));
    this._notify(diff(previousDescriptors, descriptors2), chart, "stop");
    this._notify(diff(descriptors2, previousDescriptors), chart, "start");
  }
};
function allPlugins(config) {
  const localIds = {};
  const plugins = [];
  const keys = Object.keys(registry.plugins.items);
  for (let i5 = 0; i5 < keys.length; i5++) {
    plugins.push(registry.getPlugin(keys[i5]));
  }
  const local = config.plugins || [];
  for (let i5 = 0; i5 < local.length; i5++) {
    const plugin = local[i5];
    if (plugins.indexOf(plugin) === -1) {
      plugins.push(plugin);
      localIds[plugin.id] = true;
    }
  }
  return {
    plugins,
    localIds
  };
}
function getOpts(options, all) {
  if (!all && options === false) {
    return null;
  }
  if (options === true) {
    return {};
  }
  return options;
}
function createDescriptors(chart, { plugins, localIds }, options, all) {
  const result = [];
  const context = chart.getContext();
  for (const plugin of plugins) {
    const id = plugin.id;
    const opts = getOpts(options[id], all);
    if (opts === null) {
      continue;
    }
    result.push({
      plugin,
      options: pluginOpts(chart.config, {
        plugin,
        local: localIds[id]
      }, opts, context)
    });
  }
  return result;
}
function pluginOpts(config, { plugin, local }, opts, context) {
  const keys = config.pluginScopeKeys(plugin);
  const scopes = config.getOptionScopes(opts, keys);
  if (local && plugin.defaults) {
    scopes.push(plugin.defaults);
  }
  return config.createResolver(scopes, context, [
    ""
  ], {
    scriptable: false,
    indexable: false,
    allKeys: true
  });
}
function getIndexAxis(type, options) {
  const datasetDefaults = defaults.datasets[type] || {};
  const datasetOptions = (options.datasets || {})[type] || {};
  return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || "x";
}
function getAxisFromDefaultScaleID(id, indexAxis) {
  let axis = id;
  if (id === "_index_") {
    axis = indexAxis;
  } else if (id === "_value_") {
    axis = indexAxis === "x" ? "y" : "x";
  }
  return axis;
}
function getDefaultScaleIDFromAxis(axis, indexAxis) {
  return axis === indexAxis ? "_index_" : "_value_";
}
function idMatchesAxis(id) {
  if (id === "x" || id === "y" || id === "r") {
    return id;
  }
}
function axisFromPosition(position) {
  if (position === "top" || position === "bottom") {
    return "x";
  }
  if (position === "left" || position === "right") {
    return "y";
  }
}
function determineAxis(id, ...scaleOptions) {
  if (idMatchesAxis(id)) {
    return id;
  }
  for (const opts of scaleOptions) {
    const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());
    if (axis) {
      return axis;
    }
  }
  throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);
}
function getAxisFromDataset(id, axis, dataset) {
  if (dataset[axis + "AxisID"] === id) {
    return {
      axis
    };
  }
}
function retrieveAxisFromDatasets(id, config) {
  if (config.data && config.data.datasets) {
    const boundDs = config.data.datasets.filter((d6) => d6.xAxisID === id || d6.yAxisID === id);
    if (boundDs.length) {
      return getAxisFromDataset(id, "x", boundDs[0]) || getAxisFromDataset(id, "y", boundDs[0]);
    }
  }
  return {};
}
function mergeScaleConfig(config, options) {
  const chartDefaults = overrides[config.type] || {
    scales: {}
  };
  const configScales = options.scales || {};
  const chartIndexAxis = getIndexAxis(config.type, options);
  const scales = /* @__PURE__ */ Object.create(null);
  Object.keys(configScales).forEach((id) => {
    const scaleConf = configScales[id];
    if (!isObject(scaleConf)) {
      return console.error(`Invalid scale configuration for scale: ${id}`);
    }
    if (scaleConf._proxy) {
      return console.warn(`Ignoring resolver passed as options for scale: ${id}`);
    }
    const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);
    const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);
    const defaultScaleOptions = chartDefaults.scales || {};
    scales[id] = mergeIf(/* @__PURE__ */ Object.create(null), [
      {
        axis
      },
      scaleConf,
      defaultScaleOptions[axis],
      defaultScaleOptions[defaultId]
    ]);
  });
  config.data.datasets.forEach((dataset) => {
    const type = dataset.type || config.type;
    const indexAxis = dataset.indexAxis || getIndexAxis(type, options);
    const datasetDefaults = overrides[type] || {};
    const defaultScaleOptions = datasetDefaults.scales || {};
    Object.keys(defaultScaleOptions).forEach((defaultID) => {
      const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);
      const id = dataset[axis + "AxisID"] || axis;
      scales[id] = scales[id] || /* @__PURE__ */ Object.create(null);
      mergeIf(scales[id], [
        {
          axis
        },
        configScales[id],
        defaultScaleOptions[defaultID]
      ]);
    });
  });
  Object.keys(scales).forEach((key) => {
    const scale = scales[key];
    mergeIf(scale, [
      defaults.scales[scale.type],
      defaults.scale
    ]);
  });
  return scales;
}
function initOptions(config) {
  const options = config.options || (config.options = {});
  options.plugins = valueOrDefault(options.plugins, {});
  options.scales = mergeScaleConfig(config, options);
}
function initData(data) {
  data = data || {};
  data.datasets = data.datasets || [];
  data.labels = data.labels || [];
  return data;
}
function initConfig(config) {
  config = config || {};
  config.data = initData(config.data);
  initOptions(config);
  return config;
}
var keyCache = /* @__PURE__ */ new Map();
var keysCached = /* @__PURE__ */ new Set();
function cachedKeys(cacheKey, generate) {
  let keys = keyCache.get(cacheKey);
  if (!keys) {
    keys = generate();
    keyCache.set(cacheKey, keys);
    keysCached.add(keys);
  }
  return keys;
}
var addIfFound = (set2, obj, key) => {
  const opts = resolveObjectKey(obj, key);
  if (opts !== void 0) {
    set2.add(opts);
  }
};
var Config = class {
  constructor(config) {
    this._config = initConfig(config);
    this._scopeCache = /* @__PURE__ */ new Map();
    this._resolverCache = /* @__PURE__ */ new Map();
  }
  get platform() {
    return this._config.platform;
  }
  get type() {
    return this._config.type;
  }
  set type(type) {
    this._config.type = type;
  }
  get data() {
    return this._config.data;
  }
  set data(data) {
    this._config.data = initData(data);
  }
  get options() {
    return this._config.options;
  }
  set options(options) {
    this._config.options = options;
  }
  get plugins() {
    return this._config.plugins;
  }
  update() {
    const config = this._config;
    this.clearCache();
    initOptions(config);
  }
  clearCache() {
    this._scopeCache.clear();
    this._resolverCache.clear();
  }
  datasetScopeKeys(datasetType) {
    return cachedKeys(datasetType, () => [
      [
        `datasets.${datasetType}`,
        ""
      ]
    ]);
  }
  datasetAnimationScopeKeys(datasetType, transition) {
    return cachedKeys(`${datasetType}.transition.${transition}`, () => [
      [
        `datasets.${datasetType}.transitions.${transition}`,
        `transitions.${transition}`
      ],
      [
        `datasets.${datasetType}`,
        ""
      ]
    ]);
  }
  datasetElementScopeKeys(datasetType, elementType) {
    return cachedKeys(`${datasetType}-${elementType}`, () => [
      [
        `datasets.${datasetType}.elements.${elementType}`,
        `datasets.${datasetType}`,
        `elements.${elementType}`,
        ""
      ]
    ]);
  }
  pluginScopeKeys(plugin) {
    const id = plugin.id;
    const type = this.type;
    return cachedKeys(`${type}-plugin-${id}`, () => [
      [
        `plugins.${id}`,
        ...plugin.additionalOptionScopes || []
      ]
    ]);
  }
  _cachedScopes(mainScope, resetCache) {
    const _scopeCache = this._scopeCache;
    let cache2 = _scopeCache.get(mainScope);
    if (!cache2 || resetCache) {
      cache2 = /* @__PURE__ */ new Map();
      _scopeCache.set(mainScope, cache2);
    }
    return cache2;
  }
  getOptionScopes(mainScope, keyLists, resetCache) {
    const { options, type } = this;
    const cache2 = this._cachedScopes(mainScope, resetCache);
    const cached = cache2.get(keyLists);
    if (cached) {
      return cached;
    }
    const scopes = /* @__PURE__ */ new Set();
    keyLists.forEach((keys) => {
      if (mainScope) {
        scopes.add(mainScope);
        keys.forEach((key) => addIfFound(scopes, mainScope, key));
      }
      keys.forEach((key) => addIfFound(scopes, options, key));
      keys.forEach((key) => addIfFound(scopes, overrides[type] || {}, key));
      keys.forEach((key) => addIfFound(scopes, defaults, key));
      keys.forEach((key) => addIfFound(scopes, descriptors, key));
    });
    const array = Array.from(scopes);
    if (array.length === 0) {
      array.push(/* @__PURE__ */ Object.create(null));
    }
    if (keysCached.has(keyLists)) {
      cache2.set(keyLists, array);
    }
    return array;
  }
  chartOptionScopes() {
    const { options, type } = this;
    return [
      options,
      overrides[type] || {},
      defaults.datasets[type] || {},
      {
        type
      },
      defaults,
      descriptors
    ];
  }
  resolveNamedOptions(scopes, names3, context, prefixes = [
    ""
  ]) {
    const result = {
      $shared: true
    };
    const { resolver, subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);
    let options = resolver;
    if (needContext(resolver, names3)) {
      result.$shared = false;
      context = isFunction2(context) ? context() : context;
      const subResolver = this.createResolver(scopes, context, subPrefixes);
      options = _attachContext(resolver, context, subResolver);
    }
    for (const prop of names3) {
      result[prop] = options[prop];
    }
    return result;
  }
  createResolver(scopes, context, prefixes = [
    ""
  ], descriptorDefaults) {
    const { resolver } = getResolver(this._resolverCache, scopes, prefixes);
    return isObject(context) ? _attachContext(resolver, context, void 0, descriptorDefaults) : resolver;
  }
};
function getResolver(resolverCache, scopes, prefixes) {
  let cache2 = resolverCache.get(scopes);
  if (!cache2) {
    cache2 = /* @__PURE__ */ new Map();
    resolverCache.set(scopes, cache2);
  }
  const cacheKey = prefixes.join();
  let cached = cache2.get(cacheKey);
  if (!cached) {
    const resolver = _createResolver(scopes, prefixes);
    cached = {
      resolver,
      subPrefixes: prefixes.filter((p4) => !p4.toLowerCase().includes("hover"))
    };
    cache2.set(cacheKey, cached);
  }
  return cached;
}
var hasFunction = (value) => isObject(value) && Object.getOwnPropertyNames(value).some((key) => isFunction2(value[key]));
function needContext(proxy, names3) {
  const { isScriptable, isIndexable } = _descriptors(proxy);
  for (const prop of names3) {
    const scriptable = isScriptable(prop);
    const indexable = isIndexable(prop);
    const value = (indexable || scriptable) && proxy[prop];
    if (scriptable && (isFunction2(value) || hasFunction(value)) || indexable && isArray(value)) {
      return true;
    }
  }
  return false;
}
var version = "4.5.0";
var KNOWN_POSITIONS = [
  "top",
  "bottom",
  "left",
  "right",
  "chartArea"
];
function positionIsHorizontal(position, axis) {
  return position === "top" || position === "bottom" || KNOWN_POSITIONS.indexOf(position) === -1 && axis === "x";
}
function compare2Level(l1, l22) {
  return function(a6, b5) {
    return a6[l1] === b5[l1] ? a6[l22] - b5[l22] : a6[l1] - b5[l1];
  };
}
function onAnimationsComplete(context) {
  const chart = context.chart;
  const animationOptions = chart.options.animation;
  chart.notifyPlugins("afterRender");
  callback(animationOptions && animationOptions.onComplete, [
    context
  ], chart);
}
function onAnimationProgress(context) {
  const chart = context.chart;
  const animationOptions = chart.options.animation;
  callback(animationOptions && animationOptions.onProgress, [
    context
  ], chart);
}
function getCanvas(item) {
  if (_isDomSupported() && typeof item === "string") {
    item = document.getElementById(item);
  } else if (item && item.length) {
    item = item[0];
  }
  if (item && item.canvas) {
    item = item.canvas;
  }
  return item;
}
var instances = {};
var getChart = (key) => {
  const canvas = getCanvas(key);
  return Object.values(instances).filter((c5) => c5.canvas === canvas).pop();
};
function moveNumericKeys(obj, start, move) {
  const keys = Object.keys(obj);
  for (const key of keys) {
    const intKey = +key;
    if (intKey >= start) {
      const value = obj[key];
      delete obj[key];
      if (move > 0 || intKey > start) {
        obj[intKey + move] = value;
      }
    }
  }
}
function determineLastEvent(e5, lastEvent, inChartArea, isClick) {
  if (!inChartArea || e5.type === "mouseout") {
    return null;
  }
  if (isClick) {
    return lastEvent;
  }
  return e5;
}
var Chart = class {
  static register(...items) {
    registry.add(...items);
    invalidatePlugins();
  }
  static unregister(...items) {
    registry.remove(...items);
    invalidatePlugins();
  }
  constructor(item, userConfig) {
    const config = this.config = new Config(userConfig);
    const initialCanvas = getCanvas(item);
    const existingChart = getChart(initialCanvas);
    if (existingChart) {
      throw new Error("Canvas is already in use. Chart with ID '" + existingChart.id + "' must be destroyed before the canvas with ID '" + existingChart.canvas.id + "' can be reused.");
    }
    const options = config.createResolver(config.chartOptionScopes(), this.getContext());
    this.platform = new (config.platform || _detectPlatform(initialCanvas))();
    this.platform.updateConfig(config);
    const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);
    const canvas = context && context.canvas;
    const height = canvas && canvas.height;
    const width = canvas && canvas.width;
    this.id = uid();
    this.ctx = context;
    this.canvas = canvas;
    this.width = width;
    this.height = height;
    this._options = options;
    this._aspectRatio = this.aspectRatio;
    this._layers = [];
    this._metasets = [];
    this._stacks = void 0;
    this.boxes = [];
    this.currentDevicePixelRatio = void 0;
    this.chartArea = void 0;
    this._active = [];
    this._lastEvent = void 0;
    this._listeners = {};
    this._responsiveListeners = void 0;
    this._sortedMetasets = [];
    this.scales = {};
    this._plugins = new PluginService();
    this.$proxies = {};
    this._hiddenIndices = {};
    this.attached = false;
    this._animationsDisabled = void 0;
    this.$context = void 0;
    this._doResize = debounce((mode) => this.update(mode), options.resizeDelay || 0);
    this._dataChanges = [];
    instances[this.id] = this;
    if (!context || !canvas) {
      console.error("Failed to create chart: can't acquire context from the given item");
      return;
    }
    animator.listen(this, "complete", onAnimationsComplete);
    animator.listen(this, "progress", onAnimationProgress);
    this._initialize();
    if (this.attached) {
      this.update();
    }
  }
  get aspectRatio() {
    const { options: { aspectRatio, maintainAspectRatio }, width, height, _aspectRatio } = this;
    if (!isNullOrUndef(aspectRatio)) {
      return aspectRatio;
    }
    if (maintainAspectRatio && _aspectRatio) {
      return _aspectRatio;
    }
    return height ? width / height : null;
  }
  get data() {
    return this.config.data;
  }
  set data(data) {
    this.config.data = data;
  }
  get options() {
    return this._options;
  }
  set options(options) {
    this.config.options = options;
  }
  get registry() {
    return registry;
  }
  _initialize() {
    this.notifyPlugins("beforeInit");
    if (this.options.responsive) {
      this.resize();
    } else {
      retinaScale(this, this.options.devicePixelRatio);
    }
    this.bindEvents();
    this.notifyPlugins("afterInit");
    return this;
  }
  clear() {
    clearCanvas(this.canvas, this.ctx);
    return this;
  }
  stop() {
    animator.stop(this);
    return this;
  }
  resize(width, height) {
    if (!animator.running(this)) {
      this._resize(width, height);
    } else {
      this._resizeBeforeDraw = {
        width,
        height
      };
    }
  }
  _resize(width, height) {
    const options = this.options;
    const canvas = this.canvas;
    const aspectRatio = options.maintainAspectRatio && this.aspectRatio;
    const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);
    const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();
    const mode = this.width ? "resize" : "attach";
    this.width = newSize.width;
    this.height = newSize.height;
    this._aspectRatio = this.aspectRatio;
    if (!retinaScale(this, newRatio, true)) {
      return;
    }
    this.notifyPlugins("resize", {
      size: newSize
    });
    callback(options.onResize, [
      this,
      newSize
    ], this);
    if (this.attached) {
      if (this._doResize(mode)) {
        this.render();
      }
    }
  }
  ensureScalesHaveIDs() {
    const options = this.options;
    const scalesOptions = options.scales || {};
    each(scalesOptions, (axisOptions, axisID) => {
      axisOptions.id = axisID;
    });
  }
  buildOrUpdateScales() {
    const options = this.options;
    const scaleOpts = options.scales;
    const scales = this.scales;
    const updated = Object.keys(scales).reduce((obj, id) => {
      obj[id] = false;
      return obj;
    }, {});
    let items = [];
    if (scaleOpts) {
      items = items.concat(Object.keys(scaleOpts).map((id) => {
        const scaleOptions = scaleOpts[id];
        const axis = determineAxis(id, scaleOptions);
        const isRadial = axis === "r";
        const isHorizontal = axis === "x";
        return {
          options: scaleOptions,
          dposition: isRadial ? "chartArea" : isHorizontal ? "bottom" : "left",
          dtype: isRadial ? "radialLinear" : isHorizontal ? "category" : "linear"
        };
      }));
    }
    each(items, (item) => {
      const scaleOptions = item.options;
      const id = scaleOptions.id;
      const axis = determineAxis(id, scaleOptions);
      const scaleType = valueOrDefault(scaleOptions.type, item.dtype);
      if (scaleOptions.position === void 0 || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {
        scaleOptions.position = item.dposition;
      }
      updated[id] = true;
      let scale = null;
      if (id in scales && scales[id].type === scaleType) {
        scale = scales[id];
      } else {
        const scaleClass = registry.getScale(scaleType);
        scale = new scaleClass({
          id,
          type: scaleType,
          ctx: this.ctx,
          chart: this
        });
        scales[scale.id] = scale;
      }
      scale.init(scaleOptions, options);
    });
    each(updated, (hasUpdated, id) => {
      if (!hasUpdated) {
        delete scales[id];
      }
    });
    each(scales, (scale) => {
      layouts.configure(this, scale, scale.options);
      layouts.addBox(this, scale);
    });
  }
  _updateMetasets() {
    const metasets = this._metasets;
    const numData = this.data.datasets.length;
    const numMeta = metasets.length;
    metasets.sort((a6, b5) => a6.index - b5.index);
    if (numMeta > numData) {
      for (let i5 = numData; i5 < numMeta; ++i5) {
        this._destroyDatasetMeta(i5);
      }
      metasets.splice(numData, numMeta - numData);
    }
    this._sortedMetasets = metasets.slice(0).sort(compare2Level("order", "index"));
  }
  _removeUnreferencedMetasets() {
    const { _metasets: metasets, data: { datasets } } = this;
    if (metasets.length > datasets.length) {
      delete this._stacks;
    }
    metasets.forEach((meta, index2) => {
      if (datasets.filter((x6) => x6 === meta._dataset).length === 0) {
        this._destroyDatasetMeta(index2);
      }
    });
  }
  buildOrUpdateControllers() {
    const newControllers = [];
    const datasets = this.data.datasets;
    let i5, ilen;
    this._removeUnreferencedMetasets();
    for (i5 = 0, ilen = datasets.length; i5 < ilen; i5++) {
      const dataset = datasets[i5];
      let meta = this.getDatasetMeta(i5);
      const type = dataset.type || this.config.type;
      if (meta.type && meta.type !== type) {
        this._destroyDatasetMeta(i5);
        meta = this.getDatasetMeta(i5);
      }
      meta.type = type;
      meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);
      meta.order = dataset.order || 0;
      meta.index = i5;
      meta.label = "" + dataset.label;
      meta.visible = this.isDatasetVisible(i5);
      if (meta.controller) {
        meta.controller.updateIndex(i5);
        meta.controller.linkScales();
      } else {
        const ControllerClass = registry.getController(type);
        const { datasetElementType, dataElementType } = defaults.datasets[type];
        Object.assign(ControllerClass, {
          dataElementType: registry.getElement(dataElementType),
          datasetElementType: datasetElementType && registry.getElement(datasetElementType)
        });
        meta.controller = new ControllerClass(this, i5);
        newControllers.push(meta.controller);
      }
    }
    this._updateMetasets();
    return newControllers;
  }
  _resetElements() {
    each(this.data.datasets, (dataset, datasetIndex) => {
      this.getDatasetMeta(datasetIndex).controller.reset();
    }, this);
  }
  reset() {
    this._resetElements();
    this.notifyPlugins("reset");
  }
  update(mode) {
    const config = this.config;
    config.update();
    const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());
    const animsDisabled = this._animationsDisabled = !options.animation;
    this._updateScales();
    this._checkEventBindings();
    this._updateHiddenIndices();
    this._plugins.invalidate();
    if (this.notifyPlugins("beforeUpdate", {
      mode,
      cancelable: true
    }) === false) {
      return;
    }
    const newControllers = this.buildOrUpdateControllers();
    this.notifyPlugins("beforeElementsUpdate");
    let minPadding = 0;
    for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; i5++) {
      const { controller } = this.getDatasetMeta(i5);
      const reset = !animsDisabled && newControllers.indexOf(controller) === -1;
      controller.buildOrUpdateElements(reset);
      minPadding = Math.max(+controller.getMaxOverflow(), minPadding);
    }
    minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;
    this._updateLayout(minPadding);
    if (!animsDisabled) {
      each(newControllers, (controller) => {
        controller.reset();
      });
    }
    this._updateDatasets(mode);
    this.notifyPlugins("afterUpdate", {
      mode
    });
    this._layers.sort(compare2Level("z", "_idx"));
    const { _active, _lastEvent } = this;
    if (_lastEvent) {
      this._eventHandler(_lastEvent, true);
    } else if (_active.length) {
      this._updateHoverStyles(_active, _active, true);
    }
    this.render();
  }
  _updateScales() {
    each(this.scales, (scale) => {
      layouts.removeBox(this, scale);
    });
    this.ensureScalesHaveIDs();
    this.buildOrUpdateScales();
  }
  _checkEventBindings() {
    const options = this.options;
    const existingEvents = new Set(Object.keys(this._listeners));
    const newEvents = new Set(options.events);
    if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {
      this.unbindEvents();
      this.bindEvents();
    }
  }
  _updateHiddenIndices() {
    const { _hiddenIndices } = this;
    const changes = this._getUniformDataChanges() || [];
    for (const { method, start, count } of changes) {
      const move = method === "_removeElements" ? -count : count;
      moveNumericKeys(_hiddenIndices, start, move);
    }
  }
  _getUniformDataChanges() {
    const _dataChanges = this._dataChanges;
    if (!_dataChanges || !_dataChanges.length) {
      return;
    }
    this._dataChanges = [];
    const datasetCount = this.data.datasets.length;
    const makeSet = (idx) => new Set(_dataChanges.filter((c5) => c5[0] === idx).map((c5, i5) => i5 + "," + c5.splice(1).join(",")));
    const changeSet = makeSet(0);
    for (let i5 = 1; i5 < datasetCount; i5++) {
      if (!setsEqual(changeSet, makeSet(i5))) {
        return;
      }
    }
    return Array.from(changeSet).map((c5) => c5.split(",")).map((a6) => ({
      method: a6[1],
      start: +a6[2],
      count: +a6[3]
    }));
  }
  _updateLayout(minPadding) {
    if (this.notifyPlugins("beforeLayout", {
      cancelable: true
    }) === false) {
      return;
    }
    layouts.update(this, this.width, this.height, minPadding);
    const area = this.chartArea;
    const noArea = area.width <= 0 || area.height <= 0;
    this._layers = [];
    each(this.boxes, (box) => {
      if (noArea && box.position === "chartArea") {
        return;
      }
      if (box.configure) {
        box.configure();
      }
      this._layers.push(...box._layers());
    }, this);
    this._layers.forEach((item, index2) => {
      item._idx = index2;
    });
    this.notifyPlugins("afterLayout");
  }
  _updateDatasets(mode) {
    if (this.notifyPlugins("beforeDatasetsUpdate", {
      mode,
      cancelable: true
    }) === false) {
      return;
    }
    for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
      this.getDatasetMeta(i5).controller.configure();
    }
    for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
      this._updateDataset(i5, isFunction2(mode) ? mode({
        datasetIndex: i5
      }) : mode);
    }
    this.notifyPlugins("afterDatasetsUpdate", {
      mode
    });
  }
  _updateDataset(index2, mode) {
    const meta = this.getDatasetMeta(index2);
    const args = {
      meta,
      index: index2,
      mode,
      cancelable: true
    };
    if (this.notifyPlugins("beforeDatasetUpdate", args) === false) {
      return;
    }
    meta.controller._update(mode);
    args.cancelable = false;
    this.notifyPlugins("afterDatasetUpdate", args);
  }
  render() {
    if (this.notifyPlugins("beforeRender", {
      cancelable: true
    }) === false) {
      return;
    }
    if (animator.has(this)) {
      if (this.attached && !animator.running(this)) {
        animator.start(this);
      }
    } else {
      this.draw();
      onAnimationsComplete({
        chart: this
      });
    }
  }
  draw() {
    let i5;
    if (this._resizeBeforeDraw) {
      const { width, height } = this._resizeBeforeDraw;
      this._resizeBeforeDraw = null;
      this._resize(width, height);
    }
    this.clear();
    if (this.width <= 0 || this.height <= 0) {
      return;
    }
    if (this.notifyPlugins("beforeDraw", {
      cancelable: true
    }) === false) {
      return;
    }
    const layers = this._layers;
    for (i5 = 0; i5 < layers.length && layers[i5].z <= 0; ++i5) {
      layers[i5].draw(this.chartArea);
    }
    this._drawDatasets();
    for (; i5 < layers.length; ++i5) {
      layers[i5].draw(this.chartArea);
    }
    this.notifyPlugins("afterDraw");
  }
  _getSortedDatasetMetas(filterVisible) {
    const metasets = this._sortedMetasets;
    const result = [];
    let i5, ilen;
    for (i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
      const meta = metasets[i5];
      if (!filterVisible || meta.visible) {
        result.push(meta);
      }
    }
    return result;
  }
  getSortedVisibleDatasetMetas() {
    return this._getSortedDatasetMetas(true);
  }
  _drawDatasets() {
    if (this.notifyPlugins("beforeDatasetsDraw", {
      cancelable: true
    }) === false) {
      return;
    }
    const metasets = this.getSortedVisibleDatasetMetas();
    for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
      this._drawDataset(metasets[i5]);
    }
    this.notifyPlugins("afterDatasetsDraw");
  }
  _drawDataset(meta) {
    const ctx = this.ctx;
    const args = {
      meta,
      index: meta.index,
      cancelable: true
    };
    const clip = getDatasetClipArea(this, meta);
    if (this.notifyPlugins("beforeDatasetDraw", args) === false) {
      return;
    }
    if (clip) {
      clipArea(ctx, clip);
    }
    meta.controller.draw();
    if (clip) {
      unclipArea(ctx);
    }
    args.cancelable = false;
    this.notifyPlugins("afterDatasetDraw", args);
  }
  isPointInArea(point) {
    return _isPointInArea(point, this.chartArea, this._minPadding);
  }
  getElementsAtEventForMode(e5, mode, options, useFinalPosition) {
    const method = Interaction.modes[mode];
    if (typeof method === "function") {
      return method(this, e5, options, useFinalPosition);
    }
    return [];
  }
  getDatasetMeta(datasetIndex) {
    const dataset = this.data.datasets[datasetIndex];
    const metasets = this._metasets;
    let meta = metasets.filter((x6) => x6 && x6._dataset === dataset).pop();
    if (!meta) {
      meta = {
        type: null,
        data: [],
        dataset: null,
        controller: null,
        hidden: null,
        xAxisID: null,
        yAxisID: null,
        order: dataset && dataset.order || 0,
        index: datasetIndex,
        _dataset: dataset,
        _parsed: [],
        _sorted: false
      };
      metasets.push(meta);
    }
    return meta;
  }
  getContext() {
    return this.$context || (this.$context = createContext(null, {
      chart: this,
      type: "chart"
    }));
  }
  getVisibleDatasetCount() {
    return this.getSortedVisibleDatasetMetas().length;
  }
  isDatasetVisible(datasetIndex) {
    const dataset = this.data.datasets[datasetIndex];
    if (!dataset) {
      return false;
    }
    const meta = this.getDatasetMeta(datasetIndex);
    return typeof meta.hidden === "boolean" ? !meta.hidden : !dataset.hidden;
  }
  setDatasetVisibility(datasetIndex, visible) {
    const meta = this.getDatasetMeta(datasetIndex);
    meta.hidden = !visible;
  }
  toggleDataVisibility(index2) {
    this._hiddenIndices[index2] = !this._hiddenIndices[index2];
  }
  getDataVisibility(index2) {
    return !this._hiddenIndices[index2];
  }
  _updateVisibility(datasetIndex, dataIndex, visible) {
    const mode = visible ? "show" : "hide";
    const meta = this.getDatasetMeta(datasetIndex);
    const anims = meta.controller._resolveAnimations(void 0, mode);
    if (defined(dataIndex)) {
      meta.data[dataIndex].hidden = !visible;
      this.update();
    } else {
      this.setDatasetVisibility(datasetIndex, visible);
      anims.update(meta, {
        visible
      });
      this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : void 0);
    }
  }
  hide(datasetIndex, dataIndex) {
    this._updateVisibility(datasetIndex, dataIndex, false);
  }
  show(datasetIndex, dataIndex) {
    this._updateVisibility(datasetIndex, dataIndex, true);
  }
  _destroyDatasetMeta(datasetIndex) {
    const meta = this._metasets[datasetIndex];
    if (meta && meta.controller) {
      meta.controller._destroy();
    }
    delete this._metasets[datasetIndex];
  }
  _stop() {
    let i5, ilen;
    this.stop();
    animator.remove(this);
    for (i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
      this._destroyDatasetMeta(i5);
    }
  }
  destroy() {
    this.notifyPlugins("beforeDestroy");
    const { canvas, ctx } = this;
    this._stop();
    this.config.clearCache();
    if (canvas) {
      this.unbindEvents();
      clearCanvas(canvas, ctx);
      this.platform.releaseContext(ctx);
      this.canvas = null;
      this.ctx = null;
    }
    delete instances[this.id];
    this.notifyPlugins("afterDestroy");
  }
  toBase64Image(...args) {
    return this.canvas.toDataURL(...args);
  }
  bindEvents() {
    this.bindUserEvents();
    if (this.options.responsive) {
      this.bindResponsiveEvents();
    } else {
      this.attached = true;
    }
  }
  bindUserEvents() {
    const listeners = this._listeners;
    const platform = this.platform;
    const _add = (type, listener2) => {
      platform.addEventListener(this, type, listener2);
      listeners[type] = listener2;
    };
    const listener = (e5, x6, y6) => {
      e5.offsetX = x6;
      e5.offsetY = y6;
      this._eventHandler(e5);
    };
    each(this.options.events, (type) => _add(type, listener));
  }
  bindResponsiveEvents() {
    if (!this._responsiveListeners) {
      this._responsiveListeners = {};
    }
    const listeners = this._responsiveListeners;
    const platform = this.platform;
    const _add = (type, listener2) => {
      platform.addEventListener(this, type, listener2);
      listeners[type] = listener2;
    };
    const _remove = (type, listener2) => {
      if (listeners[type]) {
        platform.removeEventListener(this, type, listener2);
        delete listeners[type];
      }
    };
    const listener = (width, height) => {
      if (this.canvas) {
        this.resize(width, height);
      }
    };
    let detached;
    const attached = () => {
      _remove("attach", attached);
      this.attached = true;
      this.resize();
      _add("resize", listener);
      _add("detach", detached);
    };
    detached = () => {
      this.attached = false;
      _remove("resize", listener);
      this._stop();
      this._resize(0, 0);
      _add("attach", attached);
    };
    if (platform.isAttached(this.canvas)) {
      attached();
    } else {
      detached();
    }
  }
  unbindEvents() {
    each(this._listeners, (listener, type) => {
      this.platform.removeEventListener(this, type, listener);
    });
    this._listeners = {};
    each(this._responsiveListeners, (listener, type) => {
      this.platform.removeEventListener(this, type, listener);
    });
    this._responsiveListeners = void 0;
  }
  updateHoverStyle(items, mode, enabled) {
    const prefix2 = enabled ? "set" : "remove";
    let meta, item, i5, ilen;
    if (mode === "dataset") {
      meta = this.getDatasetMeta(items[0].datasetIndex);
      meta.controller["_" + prefix2 + "DatasetHoverStyle"]();
    }
    for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
      item = items[i5];
      const controller = item && this.getDatasetMeta(item.datasetIndex).controller;
      if (controller) {
        controller[prefix2 + "HoverStyle"](item.element, item.datasetIndex, item.index);
      }
    }
  }
  getActiveElements() {
    return this._active || [];
  }
  setActiveElements(activeElements) {
    const lastActive = this._active || [];
    const active = activeElements.map(({ datasetIndex, index: index2 }) => {
      const meta = this.getDatasetMeta(datasetIndex);
      if (!meta) {
        throw new Error("No dataset found at index " + datasetIndex);
      }
      return {
        datasetIndex,
        element: meta.data[index2],
        index: index2
      };
    });
    const changed = !_elementsEqual(active, lastActive);
    if (changed) {
      this._active = active;
      this._lastEvent = null;
      this._updateHoverStyles(active, lastActive);
    }
  }
  notifyPlugins(hook, args, filter) {
    return this._plugins.notify(this, hook, args, filter);
  }
  isPluginEnabled(pluginId) {
    return this._plugins._cache.filter((p4) => p4.plugin.id === pluginId).length === 1;
  }
  _updateHoverStyles(active, lastActive, replay) {
    const hoverOptions = this.options.hover;
    const diff = (a6, b5) => a6.filter((x6) => !b5.some((y6) => x6.datasetIndex === y6.datasetIndex && x6.index === y6.index));
    const deactivated = diff(lastActive, active);
    const activated = replay ? active : diff(active, lastActive);
    if (deactivated.length) {
      this.updateHoverStyle(deactivated, hoverOptions.mode, false);
    }
    if (activated.length && hoverOptions.mode) {
      this.updateHoverStyle(activated, hoverOptions.mode, true);
    }
  }
  _eventHandler(e5, replay) {
    const args = {
      event: e5,
      replay,
      cancelable: true,
      inChartArea: this.isPointInArea(e5)
    };
    const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e5.native.type);
    if (this.notifyPlugins("beforeEvent", args, eventFilter) === false) {
      return;
    }
    const changed = this._handleEvent(e5, replay, args.inChartArea);
    args.cancelable = false;
    this.notifyPlugins("afterEvent", args, eventFilter);
    if (changed || args.changed) {
      this.render();
    }
    return this;
  }
  _handleEvent(e5, replay, inChartArea) {
    const { _active: lastActive = [], options } = this;
    const useFinalPosition = replay;
    const active = this._getActiveElements(e5, lastActive, inChartArea, useFinalPosition);
    const isClick = _isClickEvent(e5);
    const lastEvent = determineLastEvent(e5, this._lastEvent, inChartArea, isClick);
    if (inChartArea) {
      this._lastEvent = null;
      callback(options.onHover, [
        e5,
        active,
        this
      ], this);
      if (isClick) {
        callback(options.onClick, [
          e5,
          active,
          this
        ], this);
      }
    }
    const changed = !_elementsEqual(active, lastActive);
    if (changed || replay) {
      this._active = active;
      this._updateHoverStyles(active, lastActive, replay);
    }
    this._lastEvent = lastEvent;
    return changed;
  }
  _getActiveElements(e5, lastActive, inChartArea, useFinalPosition) {
    if (e5.type === "mouseout") {
      return [];
    }
    if (!inChartArea) {
      return lastActive;
    }
    const hoverOptions = this.options.hover;
    return this.getElementsAtEventForMode(e5, hoverOptions.mode, hoverOptions, useFinalPosition);
  }
};
__publicField(Chart, "defaults", defaults);
__publicField(Chart, "instances", instances);
__publicField(Chart, "overrides", overrides);
__publicField(Chart, "registry", registry);
__publicField(Chart, "version", version);
__publicField(Chart, "getChart", getChart);
function invalidatePlugins() {
  return each(Chart.instances, (chart) => chart._plugins.invalidate());
}
function setStyle(ctx, options, style = options) {
  ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);
  ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));
  ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);
  ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);
  ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);
  ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);
}
function lineTo(ctx, previous, target) {
  ctx.lineTo(target.x, target.y);
}
function getLineMethod(options) {
  if (options.stepped) {
    return _steppedLineTo;
  }
  if (options.tension || options.cubicInterpolationMode === "monotone") {
    return _bezierCurveTo;
  }
  return lineTo;
}
function pathVars(points, segment, params = {}) {
  const count = points.length;
  const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;
  const { start: segmentStart, end: segmentEnd } = segment;
  const start = Math.max(paramsStart, segmentStart);
  const end = Math.min(paramsEnd, segmentEnd);
  const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;
  return {
    count,
    start,
    loop: segment.loop,
    ilen: end < start && !outside ? count + end - start : end - start
  };
}
function pathSegment(ctx, line, segment, params) {
  const { points, options } = line;
  const { count, start, loop, ilen } = pathVars(points, segment, params);
  const lineMethod = getLineMethod(options);
  let { move = true, reverse } = params || {};
  let i5, point, prev;
  for (i5 = 0; i5 <= ilen; ++i5) {
    point = points[(start + (reverse ? ilen - i5 : i5)) % count];
    if (point.skip) {
      continue;
    } else if (move) {
      ctx.moveTo(point.x, point.y);
      move = false;
    } else {
      lineMethod(ctx, prev, point, reverse, options.stepped);
    }
    prev = point;
  }
  if (loop) {
    point = points[(start + (reverse ? ilen : 0)) % count];
    lineMethod(ctx, prev, point, reverse, options.stepped);
  }
  return !!loop;
}
function fastPathSegment(ctx, line, segment, params) {
  const points = line.points;
  const { count, start, ilen } = pathVars(points, segment, params);
  const { move = true, reverse } = params || {};
  let avgX = 0;
  let countX = 0;
  let i5, point, prevX, minY, maxY, lastY;
  const pointIndex = (index2) => (start + (reverse ? ilen - index2 : index2)) % count;
  const drawX = () => {
    if (minY !== maxY) {
      ctx.lineTo(avgX, maxY);
      ctx.lineTo(avgX, minY);
      ctx.lineTo(avgX, lastY);
    }
  };
  if (move) {
    point = points[pointIndex(0)];
    ctx.moveTo(point.x, point.y);
  }
  for (i5 = 0; i5 <= ilen; ++i5) {
    point = points[pointIndex(i5)];
    if (point.skip) {
      continue;
    }
    const x6 = point.x;
    const y6 = point.y;
    const truncX = x6 | 0;
    if (truncX === prevX) {
      if (y6 < minY) {
        minY = y6;
      } else if (y6 > maxY) {
        maxY = y6;
      }
      avgX = (countX * avgX + x6) / ++countX;
    } else {
      drawX();
      ctx.lineTo(x6, y6);
      prevX = truncX;
      countX = 0;
      minY = maxY = y6;
    }
    lastY = y6;
  }
  drawX();
}
function _getSegmentMethod(line) {
  const opts = line.options;
  const borderDash = opts.borderDash && opts.borderDash.length;
  const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== "monotone" && !opts.stepped && !borderDash;
  return useFastPath ? fastPathSegment : pathSegment;
}
function _getInterpolationMethod(options) {
  if (options.stepped) {
    return _steppedInterpolation;
  }
  if (options.tension || options.cubicInterpolationMode === "monotone") {
    return _bezierInterpolation;
  }
  return _pointInLine;
}
function strokePathWithCache(ctx, line, start, count) {
  let path = line._path;
  if (!path) {
    path = line._path = new Path2D();
    if (line.path(path, start, count)) {
      path.closePath();
    }
  }
  setStyle(ctx, line.options);
  ctx.stroke(path);
}
function strokePathDirect(ctx, line, start, count) {
  const { segments, options } = line;
  const segmentMethod = _getSegmentMethod(line);
  for (const segment of segments) {
    setStyle(ctx, options, segment.style);
    ctx.beginPath();
    if (segmentMethod(ctx, line, segment, {
      start,
      end: start + count - 1
    })) {
      ctx.closePath();
    }
    ctx.stroke();
  }
}
var usePath2D = typeof Path2D === "function";
function draw(ctx, line, start, count) {
  if (usePath2D && !line.options.segment) {
    strokePathWithCache(ctx, line, start, count);
  } else {
    strokePathDirect(ctx, line, start, count);
  }
}
var LineElement = class extends Element2 {
  constructor(cfg) {
    super();
    this.animated = true;
    this.options = void 0;
    this._chart = void 0;
    this._loop = void 0;
    this._fullLoop = void 0;
    this._path = void 0;
    this._points = void 0;
    this._segments = void 0;
    this._decimated = false;
    this._pointsUpdated = false;
    this._datasetIndex = void 0;
    if (cfg) {
      Object.assign(this, cfg);
    }
  }
  updateControlPoints(chartArea, indexAxis) {
    const options = this.options;
    if ((options.tension || options.cubicInterpolationMode === "monotone") && !options.stepped && !this._pointsUpdated) {
      const loop = options.spanGaps ? this._loop : this._fullLoop;
      _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);
      this._pointsUpdated = true;
    }
  }
  set points(points) {
    this._points = points;
    delete this._segments;
    delete this._path;
    this._pointsUpdated = false;
  }
  get points() {
    return this._points;
  }
  get segments() {
    return this._segments || (this._segments = _computeSegments(this, this.options.segment));
  }
  first() {
    const segments = this.segments;
    const points = this.points;
    return segments.length && points[segments[0].start];
  }
  last() {
    const segments = this.segments;
    const points = this.points;
    const count = segments.length;
    return count && points[segments[count - 1].end];
  }
  interpolate(point, property) {
    const options = this.options;
    const value = point[property];
    const points = this.points;
    const segments = _boundSegments(this, {
      property,
      start: value,
      end: value
    });
    if (!segments.length) {
      return;
    }
    const result = [];
    const _interpolate = _getInterpolationMethod(options);
    let i5, ilen;
    for (i5 = 0, ilen = segments.length; i5 < ilen; ++i5) {
      const { start, end } = segments[i5];
      const p1 = points[start];
      const p22 = points[end];
      if (p1 === p22) {
        result.push(p1);
        continue;
      }
      const t5 = Math.abs((value - p1[property]) / (p22[property] - p1[property]));
      const interpolated = _interpolate(p1, p22, t5, options.stepped);
      interpolated[property] = point[property];
      result.push(interpolated);
    }
    return result.length === 1 ? result[0] : result;
  }
  pathSegment(ctx, segment, params) {
    const segmentMethod = _getSegmentMethod(this);
    return segmentMethod(ctx, this, segment, params);
  }
  path(ctx, start, count) {
    const segments = this.segments;
    const segmentMethod = _getSegmentMethod(this);
    let loop = this._loop;
    start = start || 0;
    count = count || this.points.length - start;
    for (const segment of segments) {
      loop &= segmentMethod(ctx, this, segment, {
        start,
        end: start + count - 1
      });
    }
    return !!loop;
  }
  draw(ctx, chartArea, start, count) {
    const options = this.options || {};
    const points = this.points || [];
    if (points.length && options.borderWidth) {
      ctx.save();
      draw(ctx, this, start, count);
      ctx.restore();
    }
    if (this.animated) {
      this._pointsUpdated = false;
      this._path = void 0;
    }
  }
};
__publicField(LineElement, "id", "line");
__publicField(LineElement, "defaults", {
  borderCapStyle: "butt",
  borderDash: [],
  borderDashOffset: 0,
  borderJoinStyle: "miter",
  borderWidth: 3,
  capBezierPoints: true,
  cubicInterpolationMode: "default",
  fill: false,
  spanGaps: false,
  stepped: false,
  tension: 0
});
__publicField(LineElement, "defaultRoutes", {
  backgroundColor: "backgroundColor",
  borderColor: "borderColor"
});
__publicField(LineElement, "descriptors", {
  _scriptable: true,
  _indexable: (name) => name !== "borderDash" && name !== "fill"
});
function inRange$1(el, pos, axis, useFinalPosition) {
  const options = el.options;
  const { [axis]: value } = el.getProps([
    axis
  ], useFinalPosition);
  return Math.abs(pos - value) < options.radius + options.hitRadius;
}
var PointElement = class extends Element2 {
  constructor(cfg) {
    super();
    __publicField(this, "parsed");
    __publicField(this, "skip");
    __publicField(this, "stop");
    this.options = void 0;
    this.parsed = void 0;
    this.skip = void 0;
    this.stop = void 0;
    if (cfg) {
      Object.assign(this, cfg);
    }
  }
  inRange(mouseX, mouseY, useFinalPosition) {
    const options = this.options;
    const { x: x6, y: y6 } = this.getProps([
      "x",
      "y"
    ], useFinalPosition);
    return Math.pow(mouseX - x6, 2) + Math.pow(mouseY - y6, 2) < Math.pow(options.hitRadius + options.radius, 2);
  }
  inXRange(mouseX, useFinalPosition) {
    return inRange$1(this, mouseX, "x", useFinalPosition);
  }
  inYRange(mouseY, useFinalPosition) {
    return inRange$1(this, mouseY, "y", useFinalPosition);
  }
  getCenterPoint(useFinalPosition) {
    const { x: x6, y: y6 } = this.getProps([
      "x",
      "y"
    ], useFinalPosition);
    return {
      x: x6,
      y: y6
    };
  }
  size(options) {
    options = options || this.options || {};
    let radius = options.radius || 0;
    radius = Math.max(radius, radius && options.hoverRadius || 0);
    const borderWidth = radius && options.borderWidth || 0;
    return (radius + borderWidth) * 2;
  }
  draw(ctx, area) {
    const options = this.options;
    if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {
      return;
    }
    ctx.strokeStyle = options.borderColor;
    ctx.lineWidth = options.borderWidth;
    ctx.fillStyle = options.backgroundColor;
    drawPoint(ctx, options, this.x, this.y);
  }
  getRange() {
    const options = this.options || {};
    return options.radius + options.hitRadius;
  }
};
__publicField(PointElement, "id", "point");
/**
* @type {any}
*/
__publicField(PointElement, "defaults", {
  borderWidth: 1,
  hitRadius: 1,
  hoverBorderWidth: 1,
  hoverRadius: 4,
  pointStyle: "circle",
  radius: 3,
  rotation: 0
});
/**
* @type {any}
*/
__publicField(PointElement, "defaultRoutes", {
  backgroundColor: "backgroundColor",
  borderColor: "borderColor"
});
function getBarBounds(bar, useFinalPosition) {
  const { x: x6, y: y6, base: base2, width, height } = bar.getProps([
    "x",
    "y",
    "base",
    "width",
    "height"
  ], useFinalPosition);
  let left, right, top, bottom, half;
  if (bar.horizontal) {
    half = height / 2;
    left = Math.min(x6, base2);
    right = Math.max(x6, base2);
    top = y6 - half;
    bottom = y6 + half;
  } else {
    half = width / 2;
    left = x6 - half;
    right = x6 + half;
    top = Math.min(y6, base2);
    bottom = Math.max(y6, base2);
  }
  return {
    left,
    top,
    right,
    bottom
  };
}
function skipOrLimit(skip2, value, min, max) {
  return skip2 ? 0 : _limitValue(value, min, max);
}
function parseBorderWidth(bar, maxW, maxH) {
  const value = bar.options.borderWidth;
  const skip2 = bar.borderSkipped;
  const o3 = toTRBL(value);
  return {
    t: skipOrLimit(skip2.top, o3.top, 0, maxH),
    r: skipOrLimit(skip2.right, o3.right, 0, maxW),
    b: skipOrLimit(skip2.bottom, o3.bottom, 0, maxH),
    l: skipOrLimit(skip2.left, o3.left, 0, maxW)
  };
}
function parseBorderRadius(bar, maxW, maxH) {
  const { enableBorderRadius } = bar.getProps([
    "enableBorderRadius"
  ]);
  const value = bar.options.borderRadius;
  const o3 = toTRBLCorners(value);
  const maxR = Math.min(maxW, maxH);
  const skip2 = bar.borderSkipped;
  const enableBorder = enableBorderRadius || isObject(value);
  return {
    topLeft: skipOrLimit(!enableBorder || skip2.top || skip2.left, o3.topLeft, 0, maxR),
    topRight: skipOrLimit(!enableBorder || skip2.top || skip2.right, o3.topRight, 0, maxR),
    bottomLeft: skipOrLimit(!enableBorder || skip2.bottom || skip2.left, o3.bottomLeft, 0, maxR),
    bottomRight: skipOrLimit(!enableBorder || skip2.bottom || skip2.right, o3.bottomRight, 0, maxR)
  };
}
function boundingRects(bar) {
  const bounds = getBarBounds(bar);
  const width = bounds.right - bounds.left;
  const height = bounds.bottom - bounds.top;
  const border = parseBorderWidth(bar, width / 2, height / 2);
  const radius = parseBorderRadius(bar, width / 2, height / 2);
  return {
    outer: {
      x: bounds.left,
      y: bounds.top,
      w: width,
      h: height,
      radius
    },
    inner: {
      x: bounds.left + border.l,
      y: bounds.top + border.t,
      w: width - border.l - border.r,
      h: height - border.t - border.b,
      radius: {
        topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),
        topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),
        bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),
        bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))
      }
    }
  };
}
function inRange(bar, x6, y6, useFinalPosition) {
  const skipX = x6 === null;
  const skipY = y6 === null;
  const skipBoth = skipX && skipY;
  const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);
  return bounds && (skipX || _isBetween(x6, bounds.left, bounds.right)) && (skipY || _isBetween(y6, bounds.top, bounds.bottom));
}
function hasRadius(radius) {
  return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;
}
function addNormalRectPath(ctx, rect) {
  ctx.rect(rect.x, rect.y, rect.w, rect.h);
}
function inflateRect(rect, amount, refRect = {}) {
  const x6 = rect.x !== refRect.x ? -amount : 0;
  const y6 = rect.y !== refRect.y ? -amount : 0;
  const w6 = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x6;
  const h5 = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y6;
  return {
    x: rect.x + x6,
    y: rect.y + y6,
    w: rect.w + w6,
    h: rect.h + h5,
    radius: rect.radius
  };
}
var BarElement = class extends Element2 {
  constructor(cfg) {
    super();
    this.options = void 0;
    this.horizontal = void 0;
    this.base = void 0;
    this.width = void 0;
    this.height = void 0;
    this.inflateAmount = void 0;
    if (cfg) {
      Object.assign(this, cfg);
    }
  }
  draw(ctx) {
    const { inflateAmount, options: { borderColor, backgroundColor } } = this;
    const { inner, outer } = boundingRects(this);
    const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;
    ctx.save();
    if (outer.w !== inner.w || outer.h !== inner.h) {
      ctx.beginPath();
      addRectPath(ctx, inflateRect(outer, inflateAmount, inner));
      ctx.clip();
      addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));
      ctx.fillStyle = borderColor;
      ctx.fill("evenodd");
    }
    ctx.beginPath();
    addRectPath(ctx, inflateRect(inner, inflateAmount));
    ctx.fillStyle = backgroundColor;
    ctx.fill();
    ctx.restore();
  }
  inRange(mouseX, mouseY, useFinalPosition) {
    return inRange(this, mouseX, mouseY, useFinalPosition);
  }
  inXRange(mouseX, useFinalPosition) {
    return inRange(this, mouseX, null, useFinalPosition);
  }
  inYRange(mouseY, useFinalPosition) {
    return inRange(this, null, mouseY, useFinalPosition);
  }
  getCenterPoint(useFinalPosition) {
    const { x: x6, y: y6, base: base2, horizontal } = this.getProps([
      "x",
      "y",
      "base",
      "horizontal"
    ], useFinalPosition);
    return {
      x: horizontal ? (x6 + base2) / 2 : x6,
      y: horizontal ? y6 : (y6 + base2) / 2
    };
  }
  getRange(axis) {
    return axis === "x" ? this.width / 2 : this.height / 2;
  }
};
__publicField(BarElement, "id", "bar");
__publicField(BarElement, "defaults", {
  borderSkipped: "start",
  borderWidth: 0,
  borderRadius: 0,
  inflateAmount: "auto",
  pointStyle: void 0
});
__publicField(BarElement, "defaultRoutes", {
  backgroundColor: "backgroundColor",
  borderColor: "borderColor"
});
function _segments(line, target, property) {
  const segments = line.segments;
  const points = line.points;
  const tpoints = target.points;
  const parts = [];
  for (const segment of segments) {
    let { start, end } = segment;
    end = _findSegmentEnd(start, end, points);
    const bounds = _getBounds(property, points[start], points[end], segment.loop);
    if (!target.segments) {
      parts.push({
        source: segment,
        target: bounds,
        start: points[start],
        end: points[end]
      });
      continue;
    }
    const targetSegments = _boundSegments(target, bounds);
    for (const tgt of targetSegments) {
      const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);
      const fillSources = _boundSegment(segment, points, subBounds);
      for (const fillSource of fillSources) {
        parts.push({
          source: fillSource,
          target: tgt,
          start: {
            [property]: _getEdge(bounds, subBounds, "start", Math.max)
          },
          end: {
            [property]: _getEdge(bounds, subBounds, "end", Math.min)
          }
        });
      }
    }
  }
  return parts;
}
function _getBounds(property, first, last, loop) {
  if (loop) {
    return;
  }
  let start = first[property];
  let end = last[property];
  if (property === "angle") {
    start = _normalizeAngle(start);
    end = _normalizeAngle(end);
  }
  return {
    property,
    start,
    end
  };
}
function _pointsFromSegments(boundary, line) {
  const { x: x6 = null, y: y6 = null } = boundary || {};
  const linePoints = line.points;
  const points = [];
  line.segments.forEach(({ start, end }) => {
    end = _findSegmentEnd(start, end, linePoints);
    const first = linePoints[start];
    const last = linePoints[end];
    if (y6 !== null) {
      points.push({
        x: first.x,
        y: y6
      });
      points.push({
        x: last.x,
        y: y6
      });
    } else if (x6 !== null) {
      points.push({
        x: x6,
        y: first.y
      });
      points.push({
        x: x6,
        y: last.y
      });
    }
  });
  return points;
}
function _findSegmentEnd(start, end, points) {
  for (; end > start; end--) {
    const point = points[end];
    if (!isNaN(point.x) && !isNaN(point.y)) {
      break;
    }
  }
  return end;
}
function _getEdge(a6, b5, prop, fn2) {
  if (a6 && b5) {
    return fn2(a6[prop], b5[prop]);
  }
  return a6 ? a6[prop] : b5 ? b5[prop] : 0;
}
function _createBoundaryLine(boundary, line) {
  let points = [];
  let _loop = false;
  if (isArray(boundary)) {
    _loop = true;
    points = boundary;
  } else {
    points = _pointsFromSegments(boundary, line);
  }
  return points.length ? new LineElement({
    points,
    options: {
      tension: 0
    },
    _loop,
    _fullLoop: _loop
  }) : null;
}
function _shouldApplyFill(source) {
  return source && source.fill !== false;
}
function _resolveTarget(sources, index2, propagate) {
  const source = sources[index2];
  let fill2 = source.fill;
  const visited = [
    index2
  ];
  let target;
  if (!propagate) {
    return fill2;
  }
  while (fill2 !== false && visited.indexOf(fill2) === -1) {
    if (!isNumberFinite(fill2)) {
      return fill2;
    }
    target = sources[fill2];
    if (!target) {
      return false;
    }
    if (target.visible) {
      return fill2;
    }
    visited.push(fill2);
    fill2 = target.fill;
  }
  return false;
}
function _decodeFill(line, index2, count) {
  const fill2 = parseFillOption(line);
  if (isObject(fill2)) {
    return isNaN(fill2.value) ? false : fill2;
  }
  let target = parseFloat(fill2);
  if (isNumberFinite(target) && Math.floor(target) === target) {
    return decodeTargetIndex(fill2[0], index2, target, count);
  }
  return [
    "origin",
    "start",
    "end",
    "stack",
    "shape"
  ].indexOf(fill2) >= 0 && fill2;
}
function decodeTargetIndex(firstCh, index2, target, count) {
  if (firstCh === "-" || firstCh === "+") {
    target = index2 + target;
  }
  if (target === index2 || target < 0 || target >= count) {
    return false;
  }
  return target;
}
function _getTargetPixel(fill2, scale) {
  let pixel = null;
  if (fill2 === "start") {
    pixel = scale.bottom;
  } else if (fill2 === "end") {
    pixel = scale.top;
  } else if (isObject(fill2)) {
    pixel = scale.getPixelForValue(fill2.value);
  } else if (scale.getBasePixel) {
    pixel = scale.getBasePixel();
  }
  return pixel;
}
function _getTargetValue(fill2, scale, startValue) {
  let value;
  if (fill2 === "start") {
    value = startValue;
  } else if (fill2 === "end") {
    value = scale.options.reverse ? scale.min : scale.max;
  } else if (isObject(fill2)) {
    value = fill2.value;
  } else {
    value = scale.getBaseValue();
  }
  return value;
}
function parseFillOption(line) {
  const options = line.options;
  const fillOption = options.fill;
  let fill2 = valueOrDefault(fillOption && fillOption.target, fillOption);
  if (fill2 === void 0) {
    fill2 = !!options.backgroundColor;
  }
  if (fill2 === false || fill2 === null) {
    return false;
  }
  if (fill2 === true) {
    return "origin";
  }
  return fill2;
}
function _buildStackLine(source) {
  const { scale, index: index2, line } = source;
  const points = [];
  const segments = line.segments;
  const sourcePoints = line.points;
  const linesBelow = getLinesBelow(scale, index2);
  linesBelow.push(_createBoundaryLine({
    x: null,
    y: scale.bottom
  }, line));
  for (let i5 = 0; i5 < segments.length; i5++) {
    const segment = segments[i5];
    for (let j4 = segment.start; j4 <= segment.end; j4++) {
      addPointsBelow(points, sourcePoints[j4], linesBelow);
    }
  }
  return new LineElement({
    points,
    options: {}
  });
}
function getLinesBelow(scale, index2) {
  const below = [];
  const metas = scale.getMatchingVisibleMetas("line");
  for (let i5 = 0; i5 < metas.length; i5++) {
    const meta = metas[i5];
    if (meta.index === index2) {
      break;
    }
    if (!meta.hidden) {
      below.unshift(meta.dataset);
    }
  }
  return below;
}
function addPointsBelow(points, sourcePoint, linesBelow) {
  const postponed = [];
  for (let j4 = 0; j4 < linesBelow.length; j4++) {
    const line = linesBelow[j4];
    const { first, last, point } = findPoint(line, sourcePoint, "x");
    if (!point || first && last) {
      continue;
    }
    if (first) {
      postponed.unshift(point);
    } else {
      points.push(point);
      if (!last) {
        break;
      }
    }
  }
  points.push(...postponed);
}
function findPoint(line, sourcePoint, property) {
  const point = line.interpolate(sourcePoint, property);
  if (!point) {
    return {};
  }
  const pointValue = point[property];
  const segments = line.segments;
  const linePoints = line.points;
  let first = false;
  let last = false;
  for (let i5 = 0; i5 < segments.length; i5++) {
    const segment = segments[i5];
    const firstValue = linePoints[segment.start][property];
    const lastValue = linePoints[segment.end][property];
    if (_isBetween(pointValue, firstValue, lastValue)) {
      first = pointValue === firstValue;
      last = pointValue === lastValue;
      break;
    }
  }
  return {
    first,
    last,
    point
  };
}
var simpleArc = class {
  constructor(opts) {
    this.x = opts.x;
    this.y = opts.y;
    this.radius = opts.radius;
  }
  pathSegment(ctx, bounds, opts) {
    const { x: x6, y: y6, radius } = this;
    bounds = bounds || {
      start: 0,
      end: TAU
    };
    ctx.arc(x6, y6, radius, bounds.end, bounds.start, true);
    return !opts.bounds;
  }
  interpolate(point) {
    const { x: x6, y: y6, radius } = this;
    const angle = point.angle;
    return {
      x: x6 + Math.cos(angle) * radius,
      y: y6 + Math.sin(angle) * radius,
      angle
    };
  }
};
function _getTarget(source) {
  const { chart, fill: fill2, line } = source;
  if (isNumberFinite(fill2)) {
    return getLineByIndex(chart, fill2);
  }
  if (fill2 === "stack") {
    return _buildStackLine(source);
  }
  if (fill2 === "shape") {
    return true;
  }
  const boundary = computeBoundary(source);
  if (boundary instanceof simpleArc) {
    return boundary;
  }
  return _createBoundaryLine(boundary, line);
}
function getLineByIndex(chart, index2) {
  const meta = chart.getDatasetMeta(index2);
  const visible = meta && chart.isDatasetVisible(index2);
  return visible ? meta.dataset : null;
}
function computeBoundary(source) {
  const scale = source.scale || {};
  if (scale.getPointPositionForValue) {
    return computeCircularBoundary(source);
  }
  return computeLinearBoundary(source);
}
function computeLinearBoundary(source) {
  const { scale = {}, fill: fill2 } = source;
  const pixel = _getTargetPixel(fill2, scale);
  if (isNumberFinite(pixel)) {
    const horizontal = scale.isHorizontal();
    return {
      x: horizontal ? pixel : null,
      y: horizontal ? null : pixel
    };
  }
  return null;
}
function computeCircularBoundary(source) {
  const { scale, fill: fill2 } = source;
  const options = scale.options;
  const length = scale.getLabels().length;
  const start = options.reverse ? scale.max : scale.min;
  const value = _getTargetValue(fill2, scale, start);
  const target = [];
  if (options.grid.circular) {
    const center = scale.getPointPositionForValue(0, start);
    return new simpleArc({
      x: center.x,
      y: center.y,
      radius: scale.getDistanceFromCenterForValue(value)
    });
  }
  for (let i5 = 0; i5 < length; ++i5) {
    target.push(scale.getPointPositionForValue(i5, value));
  }
  return target;
}
function _drawfill(ctx, source, area) {
  const target = _getTarget(source);
  const { chart, index: index2, line, scale, axis } = source;
  const lineOpts = line.options;
  const fillOption = lineOpts.fill;
  const color2 = lineOpts.backgroundColor;
  const { above = color2, below = color2 } = fillOption || {};
  const meta = chart.getDatasetMeta(index2);
  const clip = getDatasetClipArea(chart, meta);
  if (target && line.points.length) {
    clipArea(ctx, area);
    doFill(ctx, {
      line,
      target,
      above,
      below,
      area,
      scale,
      axis,
      clip
    });
    unclipArea(ctx);
  }
}
function doFill(ctx, cfg) {
  const { line, target, above, below, area, scale, clip } = cfg;
  const property = line._loop ? "angle" : cfg.axis;
  ctx.save();
  let fillColor = below;
  if (below !== above) {
    if (property === "x") {
      clipVertical(ctx, target, area.top);
      fill(ctx, {
        line,
        target,
        color: above,
        scale,
        property,
        clip
      });
      ctx.restore();
      ctx.save();
      clipVertical(ctx, target, area.bottom);
    } else if (property === "y") {
      clipHorizontal(ctx, target, area.left);
      fill(ctx, {
        line,
        target,
        color: below,
        scale,
        property,
        clip
      });
      ctx.restore();
      ctx.save();
      clipHorizontal(ctx, target, area.right);
      fillColor = above;
    }
  }
  fill(ctx, {
    line,
    target,
    color: fillColor,
    scale,
    property,
    clip
  });
  ctx.restore();
}
function clipVertical(ctx, target, clipY) {
  const { segments, points } = target;
  let first = true;
  let lineLoop = false;
  ctx.beginPath();
  for (const segment of segments) {
    const { start, end } = segment;
    const firstPoint = points[start];
    const lastPoint = points[_findSegmentEnd(start, end, points)];
    if (first) {
      ctx.moveTo(firstPoint.x, firstPoint.y);
      first = false;
    } else {
      ctx.lineTo(firstPoint.x, clipY);
      ctx.lineTo(firstPoint.x, firstPoint.y);
    }
    lineLoop = !!target.pathSegment(ctx, segment, {
      move: lineLoop
    });
    if (lineLoop) {
      ctx.closePath();
    } else {
      ctx.lineTo(lastPoint.x, clipY);
    }
  }
  ctx.lineTo(target.first().x, clipY);
  ctx.closePath();
  ctx.clip();
}
function clipHorizontal(ctx, target, clipX) {
  const { segments, points } = target;
  let first = true;
  let lineLoop = false;
  ctx.beginPath();
  for (const segment of segments) {
    const { start, end } = segment;
    const firstPoint = points[start];
    const lastPoint = points[_findSegmentEnd(start, end, points)];
    if (first) {
      ctx.moveTo(firstPoint.x, firstPoint.y);
      first = false;
    } else {
      ctx.lineTo(clipX, firstPoint.y);
      ctx.lineTo(firstPoint.x, firstPoint.y);
    }
    lineLoop = !!target.pathSegment(ctx, segment, {
      move: lineLoop
    });
    if (lineLoop) {
      ctx.closePath();
    } else {
      ctx.lineTo(clipX, lastPoint.y);
    }
  }
  ctx.lineTo(clipX, target.first().y);
  ctx.closePath();
  ctx.clip();
}
function fill(ctx, cfg) {
  const { line, target, property, color: color2, scale, clip } = cfg;
  const segments = _segments(line, target, property);
  for (const { source: src, target: tgt, start, end } of segments) {
    const { style: { backgroundColor = color2 } = {} } = src;
    const notShape = target !== true;
    ctx.save();
    ctx.fillStyle = backgroundColor;
    clipBounds(ctx, scale, clip, notShape && _getBounds(property, start, end));
    ctx.beginPath();
    const lineLoop = !!line.pathSegment(ctx, src);
    let loop;
    if (notShape) {
      if (lineLoop) {
        ctx.closePath();
      } else {
        interpolatedLineTo(ctx, target, end, property);
      }
      const targetLoop = !!target.pathSegment(ctx, tgt, {
        move: lineLoop,
        reverse: true
      });
      loop = lineLoop && targetLoop;
      if (!loop) {
        interpolatedLineTo(ctx, target, start, property);
      }
    }
    ctx.closePath();
    ctx.fill(loop ? "evenodd" : "nonzero");
    ctx.restore();
  }
}
function clipBounds(ctx, scale, clip, bounds) {
  const chartArea = scale.chart.chartArea;
  const { property, start, end } = bounds || {};
  if (property === "x" || property === "y") {
    let left, top, right, bottom;
    if (property === "x") {
      left = start;
      top = chartArea.top;
      right = end;
      bottom = chartArea.bottom;
    } else {
      left = chartArea.left;
      top = start;
      right = chartArea.right;
      bottom = end;
    }
    ctx.beginPath();
    if (clip) {
      left = Math.max(left, clip.left);
      right = Math.min(right, clip.right);
      top = Math.max(top, clip.top);
      bottom = Math.min(bottom, clip.bottom);
    }
    ctx.rect(left, top, right - left, bottom - top);
    ctx.clip();
  }
}
function interpolatedLineTo(ctx, target, point, property) {
  const interpolatedPoint = target.interpolate(point, property);
  if (interpolatedPoint) {
    ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);
  }
}
var index = {
  id: "filler",
  afterDatasetsUpdate(chart, _args, options) {
    const count = (chart.data.datasets || []).length;
    const sources = [];
    let meta, i5, line, source;
    for (i5 = 0; i5 < count; ++i5) {
      meta = chart.getDatasetMeta(i5);
      line = meta.dataset;
      source = null;
      if (line && line.options && line instanceof LineElement) {
        source = {
          visible: chart.isDatasetVisible(i5),
          index: i5,
          fill: _decodeFill(line, i5, count),
          chart,
          axis: meta.controller.options.indexAxis,
          scale: meta.vScale,
          line
        };
      }
      meta.$filler = source;
      sources.push(source);
    }
    for (i5 = 0; i5 < count; ++i5) {
      source = sources[i5];
      if (!source || source.fill === false) {
        continue;
      }
      source.fill = _resolveTarget(sources, i5, options.propagate);
    }
  },
  beforeDraw(chart, _args, options) {
    const draw2 = options.drawTime === "beforeDraw";
    const metasets = chart.getSortedVisibleDatasetMetas();
    const area = chart.chartArea;
    for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
      const source = metasets[i5].$filler;
      if (!source) {
        continue;
      }
      source.line.updateControlPoints(area, source.axis);
      if (draw2 && source.fill) {
        _drawfill(chart.ctx, source, area);
      }
    }
  },
  beforeDatasetsDraw(chart, _args, options) {
    if (options.drawTime !== "beforeDatasetsDraw") {
      return;
    }
    const metasets = chart.getSortedVisibleDatasetMetas();
    for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
      const source = metasets[i5].$filler;
      if (_shouldApplyFill(source)) {
        _drawfill(chart.ctx, source, chart.chartArea);
      }
    }
  },
  beforeDatasetDraw(chart, args, options) {
    const source = args.meta.$filler;
    if (!_shouldApplyFill(source) || options.drawTime !== "beforeDatasetDraw") {
      return;
    }
    _drawfill(chart.ctx, source, chart.chartArea);
  },
  defaults: {
    propagate: true,
    drawTime: "beforeDatasetDraw"
  }
};
var getBoxSize = (labelOpts, fontSize) => {
  let { boxHeight = fontSize, boxWidth = fontSize } = labelOpts;
  if (labelOpts.usePointStyle) {
    boxHeight = Math.min(boxHeight, fontSize);
    boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);
  }
  return {
    boxWidth,
    boxHeight,
    itemHeight: Math.max(fontSize, boxHeight)
  };
};
var itemsEqual = (a6, b5) => a6 !== null && b5 !== null && a6.datasetIndex === b5.datasetIndex && a6.index === b5.index;
var Legend = class extends Element2 {
  constructor(config) {
    super();
    this._added = false;
    this.legendHitBoxes = [];
    this._hoveredItem = null;
    this.doughnutMode = false;
    this.chart = config.chart;
    this.options = config.options;
    this.ctx = config.ctx;
    this.legendItems = void 0;
    this.columnSizes = void 0;
    this.lineWidths = void 0;
    this.maxHeight = void 0;
    this.maxWidth = void 0;
    this.top = void 0;
    this.bottom = void 0;
    this.left = void 0;
    this.right = void 0;
    this.height = void 0;
    this.width = void 0;
    this._margins = void 0;
    this.position = void 0;
    this.weight = void 0;
    this.fullSize = void 0;
  }
  update(maxWidth, maxHeight, margins) {
    this.maxWidth = maxWidth;
    this.maxHeight = maxHeight;
    this._margins = margins;
    this.setDimensions();
    this.buildLabels();
    this.fit();
  }
  setDimensions() {
    if (this.isHorizontal()) {
      this.width = this.maxWidth;
      this.left = this._margins.left;
      this.right = this.width;
    } else {
      this.height = this.maxHeight;
      this.top = this._margins.top;
      this.bottom = this.height;
    }
  }
  buildLabels() {
    const labelOpts = this.options.labels || {};
    let legendItems = callback(labelOpts.generateLabels, [
      this.chart
    ], this) || [];
    if (labelOpts.filter) {
      legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));
    }
    if (labelOpts.sort) {
      legendItems = legendItems.sort((a6, b5) => labelOpts.sort(a6, b5, this.chart.data));
    }
    if (this.options.reverse) {
      legendItems.reverse();
    }
    this.legendItems = legendItems;
  }
  fit() {
    const { options, ctx } = this;
    if (!options.display) {
      this.width = this.height = 0;
      return;
    }
    const labelOpts = options.labels;
    const labelFont = toFont(labelOpts.font);
    const fontSize = labelFont.size;
    const titleHeight = this._computeTitleHeight();
    const { boxWidth, itemHeight } = getBoxSize(labelOpts, fontSize);
    let width, height;
    ctx.font = labelFont.string;
    if (this.isHorizontal()) {
      width = this.maxWidth;
      height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;
    } else {
      height = this.maxHeight;
      width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;
    }
    this.width = Math.min(width, options.maxWidth || this.maxWidth);
    this.height = Math.min(height, options.maxHeight || this.maxHeight);
  }
  _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {
    const { ctx, maxWidth, options: { labels: { padding } } } = this;
    const hitboxes = this.legendHitBoxes = [];
    const lineWidths = this.lineWidths = [
      0
    ];
    const lineHeight = itemHeight + padding;
    let totalHeight = titleHeight;
    ctx.textAlign = "left";
    ctx.textBaseline = "middle";
    let row = -1;
    let top = -lineHeight;
    this.legendItems.forEach((legendItem, i5) => {
      const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;
      if (i5 === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {
        totalHeight += lineHeight;
        lineWidths[lineWidths.length - (i5 > 0 ? 0 : 1)] = 0;
        top += lineHeight;
        row++;
      }
      hitboxes[i5] = {
        left: 0,
        top,
        row,
        width: itemWidth,
        height: itemHeight
      };
      lineWidths[lineWidths.length - 1] += itemWidth + padding;
    });
    return totalHeight;
  }
  _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {
    const { ctx, maxHeight, options: { labels: { padding } } } = this;
    const hitboxes = this.legendHitBoxes = [];
    const columnSizes = this.columnSizes = [];
    const heightLimit = maxHeight - titleHeight;
    let totalWidth = padding;
    let currentColWidth = 0;
    let currentColHeight = 0;
    let left = 0;
    let col = 0;
    this.legendItems.forEach((legendItem, i5) => {
      const { itemWidth, itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);
      if (i5 > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {
        totalWidth += currentColWidth + padding;
        columnSizes.push({
          width: currentColWidth,
          height: currentColHeight
        });
        left += currentColWidth + padding;
        col++;
        currentColWidth = currentColHeight = 0;
      }
      hitboxes[i5] = {
        left,
        top: currentColHeight,
        col,
        width: itemWidth,
        height: itemHeight
      };
      currentColWidth = Math.max(currentColWidth, itemWidth);
      currentColHeight += itemHeight + padding;
    });
    totalWidth += currentColWidth;
    columnSizes.push({
      width: currentColWidth,
      height: currentColHeight
    });
    return totalWidth;
  }
  adjustHitBoxes() {
    if (!this.options.display) {
      return;
    }
    const titleHeight = this._computeTitleHeight();
    const { legendHitBoxes: hitboxes, options: { align, labels: { padding }, rtl } } = this;
    const rtlHelper = getRtlAdapter(rtl, this.left, this.width);
    if (this.isHorizontal()) {
      let row = 0;
      let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
      for (const hitbox of hitboxes) {
        if (row !== hitbox.row) {
          row = hitbox.row;
          left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
        }
        hitbox.top += this.top + titleHeight + padding;
        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);
        left += hitbox.width + padding;
      }
    } else {
      let col = 0;
      let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
      for (const hitbox of hitboxes) {
        if (hitbox.col !== col) {
          col = hitbox.col;
          top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
        }
        hitbox.top = top;
        hitbox.left += this.left + padding;
        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);
        top += hitbox.height + padding;
      }
    }
  }
  isHorizontal() {
    return this.options.position === "top" || this.options.position === "bottom";
  }
  draw() {
    if (this.options.display) {
      const ctx = this.ctx;
      clipArea(ctx, this);
      this._draw();
      unclipArea(ctx);
    }
  }
  _draw() {
    const { options: opts, columnSizes, lineWidths, ctx } = this;
    const { align, labels: labelOpts } = opts;
    const defaultColor = defaults.color;
    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
    const labelFont = toFont(labelOpts.font);
    const { padding } = labelOpts;
    const fontSize = labelFont.size;
    const halfFontSize = fontSize / 2;
    let cursor;
    this.drawTitle();
    ctx.textAlign = rtlHelper.textAlign("left");
    ctx.textBaseline = "middle";
    ctx.lineWidth = 0.5;
    ctx.font = labelFont.string;
    const { boxWidth, boxHeight, itemHeight } = getBoxSize(labelOpts, fontSize);
    const drawLegendBox = function(x6, y6, legendItem) {
      if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {
        return;
      }
      ctx.save();
      const lineWidth = valueOrDefault(legendItem.lineWidth, 1);
      ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);
      ctx.lineCap = valueOrDefault(legendItem.lineCap, "butt");
      ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);
      ctx.lineJoin = valueOrDefault(legendItem.lineJoin, "miter");
      ctx.lineWidth = lineWidth;
      ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);
      ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
      if (labelOpts.usePointStyle) {
        const drawOptions = {
          radius: boxHeight * Math.SQRT2 / 2,
          pointStyle: legendItem.pointStyle,
          rotation: legendItem.rotation,
          borderWidth: lineWidth
        };
        const centerX = rtlHelper.xPlus(x6, boxWidth / 2);
        const centerY = y6 + halfFontSize;
        drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);
      } else {
        const yBoxTop = y6 + Math.max((fontSize - boxHeight) / 2, 0);
        const xBoxLeft = rtlHelper.leftForLtr(x6, boxWidth);
        const borderRadius = toTRBLCorners(legendItem.borderRadius);
        ctx.beginPath();
        if (Object.values(borderRadius).some((v3) => v3 !== 0)) {
          addRoundedRectPath(ctx, {
            x: xBoxLeft,
            y: yBoxTop,
            w: boxWidth,
            h: boxHeight,
            radius: borderRadius
          });
        } else {
          ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);
        }
        ctx.fill();
        if (lineWidth !== 0) {
          ctx.stroke();
        }
      }
      ctx.restore();
    };
    const fillText = function(x6, y6, legendItem) {
      renderText(ctx, legendItem.text, x6, y6 + itemHeight / 2, labelFont, {
        strikethrough: legendItem.hidden,
        textAlign: rtlHelper.textAlign(legendItem.textAlign)
      });
    };
    const isHorizontal = this.isHorizontal();
    const titleHeight = this._computeTitleHeight();
    if (isHorizontal) {
      cursor = {
        x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),
        y: this.top + padding + titleHeight,
        line: 0
      };
    } else {
      cursor = {
        x: this.left + padding,
        y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),
        line: 0
      };
    }
    overrideTextDirection(this.ctx, opts.textDirection);
    const lineHeight = itemHeight + padding;
    this.legendItems.forEach((legendItem, i5) => {
      ctx.strokeStyle = legendItem.fontColor;
      ctx.fillStyle = legendItem.fontColor;
      const textWidth = ctx.measureText(legendItem.text).width;
      const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));
      const width = boxWidth + halfFontSize + textWidth;
      let x6 = cursor.x;
      let y6 = cursor.y;
      rtlHelper.setWidth(this.width);
      if (isHorizontal) {
        if (i5 > 0 && x6 + width + padding > this.right) {
          y6 = cursor.y += lineHeight;
          cursor.line++;
          x6 = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);
        }
      } else if (i5 > 0 && y6 + lineHeight > this.bottom) {
        x6 = cursor.x = x6 + columnSizes[cursor.line].width + padding;
        cursor.line++;
        y6 = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
      }
      const realX = rtlHelper.x(x6);
      drawLegendBox(realX, y6, legendItem);
      x6 = _textX(textAlign, x6 + boxWidth + halfFontSize, isHorizontal ? x6 + width : this.right, opts.rtl);
      fillText(rtlHelper.x(x6), y6, legendItem);
      if (isHorizontal) {
        cursor.x += width + padding;
      } else if (typeof legendItem.text !== "string") {
        const fontLineHeight = labelFont.lineHeight;
        cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;
      } else {
        cursor.y += lineHeight;
      }
    });
    restoreTextDirection(this.ctx, opts.textDirection);
  }
  drawTitle() {
    const opts = this.options;
    const titleOpts = opts.title;
    const titleFont = toFont(titleOpts.font);
    const titlePadding = toPadding(titleOpts.padding);
    if (!titleOpts.display) {
      return;
    }
    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
    const ctx = this.ctx;
    const position = titleOpts.position;
    const halfFontSize = titleFont.size / 2;
    const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;
    let y6;
    let left = this.left;
    let maxWidth = this.width;
    if (this.isHorizontal()) {
      maxWidth = Math.max(...this.lineWidths);
      y6 = this.top + topPaddingPlusHalfFontSize;
      left = _alignStartEnd(opts.align, left, this.right - maxWidth);
    } else {
      const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);
      y6 = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());
    }
    const x6 = _alignStartEnd(position, left, left + maxWidth);
    ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));
    ctx.textBaseline = "middle";
    ctx.strokeStyle = titleOpts.color;
    ctx.fillStyle = titleOpts.color;
    ctx.font = titleFont.string;
    renderText(ctx, titleOpts.text, x6, y6, titleFont);
  }
  _computeTitleHeight() {
    const titleOpts = this.options.title;
    const titleFont = toFont(titleOpts.font);
    const titlePadding = toPadding(titleOpts.padding);
    return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;
  }
  _getLegendItemAt(x6, y6) {
    let i5, hitBox, lh;
    if (_isBetween(x6, this.left, this.right) && _isBetween(y6, this.top, this.bottom)) {
      lh = this.legendHitBoxes;
      for (i5 = 0; i5 < lh.length; ++i5) {
        hitBox = lh[i5];
        if (_isBetween(x6, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y6, hitBox.top, hitBox.top + hitBox.height)) {
          return this.legendItems[i5];
        }
      }
    }
    return null;
  }
  handleEvent(e5) {
    const opts = this.options;
    if (!isListened(e5.type, opts)) {
      return;
    }
    const hoveredItem = this._getLegendItemAt(e5.x, e5.y);
    if (e5.type === "mousemove" || e5.type === "mouseout") {
      const previous = this._hoveredItem;
      const sameItem = itemsEqual(previous, hoveredItem);
      if (previous && !sameItem) {
        callback(opts.onLeave, [
          e5,
          previous,
          this
        ], this);
      }
      this._hoveredItem = hoveredItem;
      if (hoveredItem && !sameItem) {
        callback(opts.onHover, [
          e5,
          hoveredItem,
          this
        ], this);
      }
    } else if (hoveredItem) {
      callback(opts.onClick, [
        e5,
        hoveredItem,
        this
      ], this);
    }
  }
};
function calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {
  const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);
  const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);
  return {
    itemWidth,
    itemHeight
  };
}
function calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {
  let legendItemText = legendItem.text;
  if (legendItemText && typeof legendItemText !== "string") {
    legendItemText = legendItemText.reduce((a6, b5) => a6.length > b5.length ? a6 : b5);
  }
  return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;
}
function calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {
  let itemHeight = _itemHeight;
  if (typeof legendItem.text !== "string") {
    itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);
  }
  return itemHeight;
}
function calculateLegendItemHeight(legendItem, fontLineHeight) {
  const labelHeight = legendItem.text ? legendItem.text.length : 0;
  return fontLineHeight * labelHeight;
}
function isListened(type, opts) {
  if ((type === "mousemove" || type === "mouseout") && (opts.onHover || opts.onLeave)) {
    return true;
  }
  if (opts.onClick && (type === "click" || type === "mouseup")) {
    return true;
  }
  return false;
}
var plugin_legend = {
  id: "legend",
  _element: Legend,
  start(chart, _args, options) {
    const legend = chart.legend = new Legend({
      ctx: chart.ctx,
      options,
      chart
    });
    layouts.configure(chart, legend, options);
    layouts.addBox(chart, legend);
  },
  stop(chart) {
    layouts.removeBox(chart, chart.legend);
    delete chart.legend;
  },
  beforeUpdate(chart, _args, options) {
    const legend = chart.legend;
    layouts.configure(chart, legend, options);
    legend.options = options;
  },
  afterUpdate(chart) {
    const legend = chart.legend;
    legend.buildLabels();
    legend.adjustHitBoxes();
  },
  afterEvent(chart, args) {
    if (!args.replay) {
      chart.legend.handleEvent(args.event);
    }
  },
  defaults: {
    display: true,
    position: "top",
    align: "center",
    fullSize: true,
    reverse: false,
    weight: 1e3,
    onClick(e5, legendItem, legend) {
      const index2 = legendItem.datasetIndex;
      const ci = legend.chart;
      if (ci.isDatasetVisible(index2)) {
        ci.hide(index2);
        legendItem.hidden = true;
      } else {
        ci.show(index2);
        legendItem.hidden = false;
      }
    },
    onHover: null,
    onLeave: null,
    labels: {
      color: (ctx) => ctx.chart.options.color,
      boxWidth: 40,
      padding: 10,
      generateLabels(chart) {
        const datasets = chart.data.datasets;
        const { labels: { usePointStyle, pointStyle, textAlign, color: color2, useBorderRadius, borderRadius } } = chart.legend.options;
        return chart._getSortedDatasetMetas().map((meta) => {
          const style = meta.controller.getStyle(usePointStyle ? 0 : void 0);
          const borderWidth = toPadding(style.borderWidth);
          return {
            text: datasets[meta.index].label,
            fillStyle: style.backgroundColor,
            fontColor: color2,
            hidden: !meta.visible,
            lineCap: style.borderCapStyle,
            lineDash: style.borderDash,
            lineDashOffset: style.borderDashOffset,
            lineJoin: style.borderJoinStyle,
            lineWidth: (borderWidth.width + borderWidth.height) / 4,
            strokeStyle: style.borderColor,
            pointStyle: pointStyle || style.pointStyle,
            rotation: style.rotation,
            textAlign: textAlign || style.textAlign,
            borderRadius: useBorderRadius && (borderRadius || style.borderRadius),
            datasetIndex: meta.index
          };
        }, this);
      }
    },
    title: {
      color: (ctx) => ctx.chart.options.color,
      display: false,
      position: "center",
      text: ""
    }
  },
  descriptors: {
    _scriptable: (name) => !name.startsWith("on"),
    labels: {
      _scriptable: (name) => ![
        "generateLabels",
        "filter",
        "sort"
      ].includes(name)
    }
  }
};
var Title = class extends Element2 {
  constructor(config) {
    super();
    this.chart = config.chart;
    this.options = config.options;
    this.ctx = config.ctx;
    this._padding = void 0;
    this.top = void 0;
    this.bottom = void 0;
    this.left = void 0;
    this.right = void 0;
    this.width = void 0;
    this.height = void 0;
    this.position = void 0;
    this.weight = void 0;
    this.fullSize = void 0;
  }
  update(maxWidth, maxHeight) {
    const opts = this.options;
    this.left = 0;
    this.top = 0;
    if (!opts.display) {
      this.width = this.height = this.right = this.bottom = 0;
      return;
    }
    this.width = this.right = maxWidth;
    this.height = this.bottom = maxHeight;
    const lineCount = isArray(opts.text) ? opts.text.length : 1;
    this._padding = toPadding(opts.padding);
    const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;
    if (this.isHorizontal()) {
      this.height = textSize;
    } else {
      this.width = textSize;
    }
  }
  isHorizontal() {
    const pos = this.options.position;
    return pos === "top" || pos === "bottom";
  }
  _drawArgs(offset) {
    const { top, left, bottom, right, options } = this;
    const align = options.align;
    let rotation = 0;
    let maxWidth, titleX, titleY;
    if (this.isHorizontal()) {
      titleX = _alignStartEnd(align, left, right);
      titleY = top + offset;
      maxWidth = right - left;
    } else {
      if (options.position === "left") {
        titleX = left + offset;
        titleY = _alignStartEnd(align, bottom, top);
        rotation = PI * -0.5;
      } else {
        titleX = right - offset;
        titleY = _alignStartEnd(align, top, bottom);
        rotation = PI * 0.5;
      }
      maxWidth = bottom - top;
    }
    return {
      titleX,
      titleY,
      maxWidth,
      rotation
    };
  }
  draw() {
    const ctx = this.ctx;
    const opts = this.options;
    if (!opts.display) {
      return;
    }
    const fontOpts = toFont(opts.font);
    const lineHeight = fontOpts.lineHeight;
    const offset = lineHeight / 2 + this._padding.top;
    const { titleX, titleY, maxWidth, rotation } = this._drawArgs(offset);
    renderText(ctx, opts.text, 0, 0, fontOpts, {
      color: opts.color,
      maxWidth,
      rotation,
      textAlign: _toLeftRightCenter(opts.align),
      textBaseline: "middle",
      translation: [
        titleX,
        titleY
      ]
    });
  }
};
function createTitle(chart, titleOpts) {
  const title = new Title({
    ctx: chart.ctx,
    options: titleOpts,
    chart
  });
  layouts.configure(chart, title, titleOpts);
  layouts.addBox(chart, title);
  chart.titleBlock = title;
}
var plugin_title = {
  id: "title",
  _element: Title,
  start(chart, _args, options) {
    createTitle(chart, options);
  },
  stop(chart) {
    const titleBlock = chart.titleBlock;
    layouts.removeBox(chart, titleBlock);
    delete chart.titleBlock;
  },
  beforeUpdate(chart, _args, options) {
    const title = chart.titleBlock;
    layouts.configure(chart, title, options);
    title.options = options;
  },
  defaults: {
    align: "center",
    display: false,
    font: {
      weight: "bold"
    },
    fullSize: true,
    padding: 10,
    position: "top",
    text: "",
    weight: 2e3
  },
  defaultRoutes: {
    color: "color"
  },
  descriptors: {
    _scriptable: true,
    _indexable: false
  }
};
var positioners = {
  average(items) {
    if (!items.length) {
      return false;
    }
    let i5, len;
    let xSet = /* @__PURE__ */ new Set();
    let y6 = 0;
    let count = 0;
    for (i5 = 0, len = items.length; i5 < len; ++i5) {
      const el = items[i5].element;
      if (el && el.hasValue()) {
        const pos = el.tooltipPosition();
        xSet.add(pos.x);
        y6 += pos.y;
        ++count;
      }
    }
    if (count === 0 || xSet.size === 0) {
      return false;
    }
    const xAverage = [
      ...xSet
    ].reduce((a6, b5) => a6 + b5) / xSet.size;
    return {
      x: xAverage,
      y: y6 / count
    };
  },
  nearest(items, eventPosition) {
    if (!items.length) {
      return false;
    }
    let x6 = eventPosition.x;
    let y6 = eventPosition.y;
    let minDistance = Number.POSITIVE_INFINITY;
    let i5, len, nearestElement;
    for (i5 = 0, len = items.length; i5 < len; ++i5) {
      const el = items[i5].element;
      if (el && el.hasValue()) {
        const center = el.getCenterPoint();
        const d6 = distanceBetweenPoints(eventPosition, center);
        if (d6 < minDistance) {
          minDistance = d6;
          nearestElement = el;
        }
      }
    }
    if (nearestElement) {
      const tp = nearestElement.tooltipPosition();
      x6 = tp.x;
      y6 = tp.y;
    }
    return {
      x: x6,
      y: y6
    };
  }
};
function pushOrConcat(base2, toPush) {
  if (toPush) {
    if (isArray(toPush)) {
      Array.prototype.push.apply(base2, toPush);
    } else {
      base2.push(toPush);
    }
  }
  return base2;
}
function splitNewlines(str) {
  if ((typeof str === "string" || str instanceof String) && str.indexOf("\n") > -1) {
    return str.split("\n");
  }
  return str;
}
function createTooltipItem(chart, item) {
  const { element, datasetIndex, index: index2 } = item;
  const controller = chart.getDatasetMeta(datasetIndex).controller;
  const { label, value } = controller.getLabelAndValue(index2);
  return {
    chart,
    label,
    parsed: controller.getParsed(index2),
    raw: chart.data.datasets[datasetIndex].data[index2],
    formattedValue: value,
    dataset: controller.getDataset(),
    dataIndex: index2,
    datasetIndex,
    element
  };
}
function getTooltipSize(tooltip, options) {
  const ctx = tooltip.chart.ctx;
  const { body, footer, title } = tooltip;
  const { boxWidth, boxHeight } = options;
  const bodyFont = toFont(options.bodyFont);
  const titleFont = toFont(options.titleFont);
  const footerFont = toFont(options.footerFont);
  const titleLineCount = title.length;
  const footerLineCount = footer.length;
  const bodyLineItemCount = body.length;
  const padding = toPadding(options.padding);
  let height = padding.height;
  let width = 0;
  let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);
  combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;
  if (titleLineCount) {
    height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;
  }
  if (combinedBodyLength) {
    const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;
    height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;
  }
  if (footerLineCount) {
    height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;
  }
  let widthPadding = 0;
  const maxLineWidth = function(line) {
    width = Math.max(width, ctx.measureText(line).width + widthPadding);
  };
  ctx.save();
  ctx.font = titleFont.string;
  each(tooltip.title, maxLineWidth);
  ctx.font = bodyFont.string;
  each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);
  widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;
  each(body, (bodyItem) => {
    each(bodyItem.before, maxLineWidth);
    each(bodyItem.lines, maxLineWidth);
    each(bodyItem.after, maxLineWidth);
  });
  widthPadding = 0;
  ctx.font = footerFont.string;
  each(tooltip.footer, maxLineWidth);
  ctx.restore();
  width += padding.width;
  return {
    width,
    height
  };
}
function determineYAlign(chart, size) {
  const { y: y6, height } = size;
  if (y6 < height / 2) {
    return "top";
  } else if (y6 > chart.height - height / 2) {
    return "bottom";
  }
  return "center";
}
function doesNotFitWithAlign(xAlign, chart, options, size) {
  const { x: x6, width } = size;
  const caret = options.caretSize + options.caretPadding;
  if (xAlign === "left" && x6 + width + caret > chart.width) {
    return true;
  }
  if (xAlign === "right" && x6 - width - caret < 0) {
    return true;
  }
}
function determineXAlign(chart, options, size, yAlign) {
  const { x: x6, width } = size;
  const { width: chartWidth, chartArea: { left, right } } = chart;
  let xAlign = "center";
  if (yAlign === "center") {
    xAlign = x6 <= (left + right) / 2 ? "left" : "right";
  } else if (x6 <= width / 2) {
    xAlign = "left";
  } else if (x6 >= chartWidth - width / 2) {
    xAlign = "right";
  }
  if (doesNotFitWithAlign(xAlign, chart, options, size)) {
    xAlign = "center";
  }
  return xAlign;
}
function determineAlignment(chart, options, size) {
  const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);
  return {
    xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),
    yAlign
  };
}
function alignX(size, xAlign) {
  let { x: x6, width } = size;
  if (xAlign === "right") {
    x6 -= width;
  } else if (xAlign === "center") {
    x6 -= width / 2;
  }
  return x6;
}
function alignY(size, yAlign, paddingAndSize) {
  let { y: y6, height } = size;
  if (yAlign === "top") {
    y6 += paddingAndSize;
  } else if (yAlign === "bottom") {
    y6 -= height + paddingAndSize;
  } else {
    y6 -= height / 2;
  }
  return y6;
}
function getBackgroundPoint(options, size, alignment, chart) {
  const { caretSize, caretPadding, cornerRadius } = options;
  const { xAlign, yAlign } = alignment;
  const paddingAndSize = caretSize + caretPadding;
  const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
  let x6 = alignX(size, xAlign);
  const y6 = alignY(size, yAlign, paddingAndSize);
  if (yAlign === "center") {
    if (xAlign === "left") {
      x6 += paddingAndSize;
    } else if (xAlign === "right") {
      x6 -= paddingAndSize;
    }
  } else if (xAlign === "left") {
    x6 -= Math.max(topLeft, bottomLeft) + caretSize;
  } else if (xAlign === "right") {
    x6 += Math.max(topRight, bottomRight) + caretSize;
  }
  return {
    x: _limitValue(x6, 0, chart.width - size.width),
    y: _limitValue(y6, 0, chart.height - size.height)
  };
}
function getAlignedX(tooltip, align, options) {
  const padding = toPadding(options.padding);
  return align === "center" ? tooltip.x + tooltip.width / 2 : align === "right" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;
}
function getBeforeAfterBodyLines(callback2) {
  return pushOrConcat([], splitNewlines(callback2));
}
function createTooltipContext(parent, tooltip, tooltipItems) {
  return createContext(parent, {
    tooltip,
    tooltipItems,
    type: "tooltip"
  });
}
function overrideCallbacks(callbacks, context) {
  const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;
  return override ? callbacks.override(override) : callbacks;
}
var defaultCallbacks = {
  beforeTitle: noop2,
  title(tooltipItems) {
    if (tooltipItems.length > 0) {
      const item = tooltipItems[0];
      const labels = item.chart.data.labels;
      const labelCount = labels ? labels.length : 0;
      if (this && this.options && this.options.mode === "dataset") {
        return item.dataset.label || "";
      } else if (item.label) {
        return item.label;
      } else if (labelCount > 0 && item.dataIndex < labelCount) {
        return labels[item.dataIndex];
      }
    }
    return "";
  },
  afterTitle: noop2,
  beforeBody: noop2,
  beforeLabel: noop2,
  label(tooltipItem) {
    if (this && this.options && this.options.mode === "dataset") {
      return tooltipItem.label + ": " + tooltipItem.formattedValue || tooltipItem.formattedValue;
    }
    let label = tooltipItem.dataset.label || "";
    if (label) {
      label += ": ";
    }
    const value = tooltipItem.formattedValue;
    if (!isNullOrUndef(value)) {
      label += value;
    }
    return label;
  },
  labelColor(tooltipItem) {
    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
    const options = meta.controller.getStyle(tooltipItem.dataIndex);
    return {
      borderColor: options.borderColor,
      backgroundColor: options.backgroundColor,
      borderWidth: options.borderWidth,
      borderDash: options.borderDash,
      borderDashOffset: options.borderDashOffset,
      borderRadius: 0
    };
  },
  labelTextColor() {
    return this.options.bodyColor;
  },
  labelPointStyle(tooltipItem) {
    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
    const options = meta.controller.getStyle(tooltipItem.dataIndex);
    return {
      pointStyle: options.pointStyle,
      rotation: options.rotation
    };
  },
  afterLabel: noop2,
  afterBody: noop2,
  beforeFooter: noop2,
  footer: noop2,
  afterFooter: noop2
};
function invokeCallbackWithFallback(callbacks, name, ctx, arg) {
  const result = callbacks[name].call(ctx, arg);
  if (typeof result === "undefined") {
    return defaultCallbacks[name].call(ctx, arg);
  }
  return result;
}
var Tooltip = class extends Element2 {
  constructor(config) {
    super();
    this.opacity = 0;
    this._active = [];
    this._eventPosition = void 0;
    this._size = void 0;
    this._cachedAnimations = void 0;
    this._tooltipItems = [];
    this.$animations = void 0;
    this.$context = void 0;
    this.chart = config.chart;
    this.options = config.options;
    this.dataPoints = void 0;
    this.title = void 0;
    this.beforeBody = void 0;
    this.body = void 0;
    this.afterBody = void 0;
    this.footer = void 0;
    this.xAlign = void 0;
    this.yAlign = void 0;
    this.x = void 0;
    this.y = void 0;
    this.height = void 0;
    this.width = void 0;
    this.caretX = void 0;
    this.caretY = void 0;
    this.labelColors = void 0;
    this.labelPointStyles = void 0;
    this.labelTextColors = void 0;
  }
  initialize(options) {
    this.options = options;
    this._cachedAnimations = void 0;
    this.$context = void 0;
  }
  _resolveAnimations() {
    const cached = this._cachedAnimations;
    if (cached) {
      return cached;
    }
    const chart = this.chart;
    const options = this.options.setContext(this.getContext());
    const opts = options.enabled && chart.options.animation && options.animations;
    const animations = new Animations(this.chart, opts);
    if (opts._cacheable) {
      this._cachedAnimations = Object.freeze(animations);
    }
    return animations;
  }
  getContext() {
    return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));
  }
  getTitle(context, options) {
    const { callbacks } = options;
    const beforeTitle = invokeCallbackWithFallback(callbacks, "beforeTitle", this, context);
    const title = invokeCallbackWithFallback(callbacks, "title", this, context);
    const afterTitle = invokeCallbackWithFallback(callbacks, "afterTitle", this, context);
    let lines = [];
    lines = pushOrConcat(lines, splitNewlines(beforeTitle));
    lines = pushOrConcat(lines, splitNewlines(title));
    lines = pushOrConcat(lines, splitNewlines(afterTitle));
    return lines;
  }
  getBeforeBody(tooltipItems, options) {
    return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, "beforeBody", this, tooltipItems));
  }
  getBody(tooltipItems, options) {
    const { callbacks } = options;
    const bodyItems = [];
    each(tooltipItems, (context) => {
      const bodyItem = {
        before: [],
        lines: [],
        after: []
      };
      const scoped = overrideCallbacks(callbacks, context);
      pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, "beforeLabel", this, context)));
      pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, "label", this, context));
      pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, "afterLabel", this, context)));
      bodyItems.push(bodyItem);
    });
    return bodyItems;
  }
  getAfterBody(tooltipItems, options) {
    return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, "afterBody", this, tooltipItems));
  }
  getFooter(tooltipItems, options) {
    const { callbacks } = options;
    const beforeFooter = invokeCallbackWithFallback(callbacks, "beforeFooter", this, tooltipItems);
    const footer = invokeCallbackWithFallback(callbacks, "footer", this, tooltipItems);
    const afterFooter = invokeCallbackWithFallback(callbacks, "afterFooter", this, tooltipItems);
    let lines = [];
    lines = pushOrConcat(lines, splitNewlines(beforeFooter));
    lines = pushOrConcat(lines, splitNewlines(footer));
    lines = pushOrConcat(lines, splitNewlines(afterFooter));
    return lines;
  }
  _createItems(options) {
    const active = this._active;
    const data = this.chart.data;
    const labelColors = [];
    const labelPointStyles = [];
    const labelTextColors = [];
    let tooltipItems = [];
    let i5, len;
    for (i5 = 0, len = active.length; i5 < len; ++i5) {
      tooltipItems.push(createTooltipItem(this.chart, active[i5]));
    }
    if (options.filter) {
      tooltipItems = tooltipItems.filter((element, index2, array) => options.filter(element, index2, array, data));
    }
    if (options.itemSort) {
      tooltipItems = tooltipItems.sort((a6, b5) => options.itemSort(a6, b5, data));
    }
    each(tooltipItems, (context) => {
      const scoped = overrideCallbacks(options.callbacks, context);
      labelColors.push(invokeCallbackWithFallback(scoped, "labelColor", this, context));
      labelPointStyles.push(invokeCallbackWithFallback(scoped, "labelPointStyle", this, context));
      labelTextColors.push(invokeCallbackWithFallback(scoped, "labelTextColor", this, context));
    });
    this.labelColors = labelColors;
    this.labelPointStyles = labelPointStyles;
    this.labelTextColors = labelTextColors;
    this.dataPoints = tooltipItems;
    return tooltipItems;
  }
  update(changed, replay) {
    const options = this.options.setContext(this.getContext());
    const active = this._active;
    let properties;
    let tooltipItems = [];
    if (!active.length) {
      if (this.opacity !== 0) {
        properties = {
          opacity: 0
        };
      }
    } else {
      const position = positioners[options.position].call(this, active, this._eventPosition);
      tooltipItems = this._createItems(options);
      this.title = this.getTitle(tooltipItems, options);
      this.beforeBody = this.getBeforeBody(tooltipItems, options);
      this.body = this.getBody(tooltipItems, options);
      this.afterBody = this.getAfterBody(tooltipItems, options);
      this.footer = this.getFooter(tooltipItems, options);
      const size = this._size = getTooltipSize(this, options);
      const positionAndSize = Object.assign({}, position, size);
      const alignment = determineAlignment(this.chart, options, positionAndSize);
      const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);
      this.xAlign = alignment.xAlign;
      this.yAlign = alignment.yAlign;
      properties = {
        opacity: 1,
        x: backgroundPoint.x,
        y: backgroundPoint.y,
        width: size.width,
        height: size.height,
        caretX: position.x,
        caretY: position.y
      };
    }
    this._tooltipItems = tooltipItems;
    this.$context = void 0;
    if (properties) {
      this._resolveAnimations().update(this, properties);
    }
    if (changed && options.external) {
      options.external.call(this, {
        chart: this.chart,
        tooltip: this,
        replay
      });
    }
  }
  drawCaret(tooltipPoint, ctx, size, options) {
    const caretPosition = this.getCaretPosition(tooltipPoint, size, options);
    ctx.lineTo(caretPosition.x1, caretPosition.y1);
    ctx.lineTo(caretPosition.x2, caretPosition.y2);
    ctx.lineTo(caretPosition.x3, caretPosition.y3);
  }
  getCaretPosition(tooltipPoint, size, options) {
    const { xAlign, yAlign } = this;
    const { caretSize, cornerRadius } = options;
    const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
    const { x: ptX, y: ptY } = tooltipPoint;
    const { width, height } = size;
    let x1, x22, x32, y1, y23, y32;
    if (yAlign === "center") {
      y23 = ptY + height / 2;
      if (xAlign === "left") {
        x1 = ptX;
        x22 = x1 - caretSize;
        y1 = y23 + caretSize;
        y32 = y23 - caretSize;
      } else {
        x1 = ptX + width;
        x22 = x1 + caretSize;
        y1 = y23 - caretSize;
        y32 = y23 + caretSize;
      }
      x32 = x1;
    } else {
      if (xAlign === "left") {
        x22 = ptX + Math.max(topLeft, bottomLeft) + caretSize;
      } else if (xAlign === "right") {
        x22 = ptX + width - Math.max(topRight, bottomRight) - caretSize;
      } else {
        x22 = this.caretX;
      }
      if (yAlign === "top") {
        y1 = ptY;
        y23 = y1 - caretSize;
        x1 = x22 - caretSize;
        x32 = x22 + caretSize;
      } else {
        y1 = ptY + height;
        y23 = y1 + caretSize;
        x1 = x22 + caretSize;
        x32 = x22 - caretSize;
      }
      y32 = y1;
    }
    return {
      x1,
      x2: x22,
      x3: x32,
      y1,
      y2: y23,
      y3: y32
    };
  }
  drawTitle(pt, ctx, options) {
    const title = this.title;
    const length = title.length;
    let titleFont, titleSpacing, i5;
    if (length) {
      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
      pt.x = getAlignedX(this, options.titleAlign, options);
      ctx.textAlign = rtlHelper.textAlign(options.titleAlign);
      ctx.textBaseline = "middle";
      titleFont = toFont(options.titleFont);
      titleSpacing = options.titleSpacing;
      ctx.fillStyle = options.titleColor;
      ctx.font = titleFont.string;
      for (i5 = 0; i5 < length; ++i5) {
        ctx.fillText(title[i5], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);
        pt.y += titleFont.lineHeight + titleSpacing;
        if (i5 + 1 === length) {
          pt.y += options.titleMarginBottom - titleSpacing;
        }
      }
    }
  }
  _drawColorBox(ctx, pt, i5, rtlHelper, options) {
    const labelColor = this.labelColors[i5];
    const labelPointStyle = this.labelPointStyles[i5];
    const { boxHeight, boxWidth } = options;
    const bodyFont = toFont(options.bodyFont);
    const colorX = getAlignedX(this, "left", options);
    const rtlColorX = rtlHelper.x(colorX);
    const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;
    const colorY = pt.y + yOffSet;
    if (options.usePointStyle) {
      const drawOptions = {
        radius: Math.min(boxWidth, boxHeight) / 2,
        pointStyle: labelPointStyle.pointStyle,
        rotation: labelPointStyle.rotation,
        borderWidth: 1
      };
      const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;
      const centerY = colorY + boxHeight / 2;
      ctx.strokeStyle = options.multiKeyBackground;
      ctx.fillStyle = options.multiKeyBackground;
      drawPoint(ctx, drawOptions, centerX, centerY);
      ctx.strokeStyle = labelColor.borderColor;
      ctx.fillStyle = labelColor.backgroundColor;
      drawPoint(ctx, drawOptions, centerX, centerY);
    } else {
      ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;
      ctx.strokeStyle = labelColor.borderColor;
      ctx.setLineDash(labelColor.borderDash || []);
      ctx.lineDashOffset = labelColor.borderDashOffset || 0;
      const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);
      const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);
      const borderRadius = toTRBLCorners(labelColor.borderRadius);
      if (Object.values(borderRadius).some((v3) => v3 !== 0)) {
        ctx.beginPath();
        ctx.fillStyle = options.multiKeyBackground;
        addRoundedRectPath(ctx, {
          x: outerX,
          y: colorY,
          w: boxWidth,
          h: boxHeight,
          radius: borderRadius
        });
        ctx.fill();
        ctx.stroke();
        ctx.fillStyle = labelColor.backgroundColor;
        ctx.beginPath();
        addRoundedRectPath(ctx, {
          x: innerX,
          y: colorY + 1,
          w: boxWidth - 2,
          h: boxHeight - 2,
          radius: borderRadius
        });
        ctx.fill();
      } else {
        ctx.fillStyle = options.multiKeyBackground;
        ctx.fillRect(outerX, colorY, boxWidth, boxHeight);
        ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);
        ctx.fillStyle = labelColor.backgroundColor;
        ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);
      }
    }
    ctx.fillStyle = this.labelTextColors[i5];
  }
  drawBody(pt, ctx, options) {
    const { body } = this;
    const { bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding } = options;
    const bodyFont = toFont(options.bodyFont);
    let bodyLineHeight = bodyFont.lineHeight;
    let xLinePadding = 0;
    const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
    const fillLineOfText = function(line) {
      ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);
      pt.y += bodyLineHeight + bodySpacing;
    };
    const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);
    let bodyItem, textColor, lines, i5, j4, ilen, jlen;
    ctx.textAlign = bodyAlign;
    ctx.textBaseline = "middle";
    ctx.font = bodyFont.string;
    pt.x = getAlignedX(this, bodyAlignForCalculation, options);
    ctx.fillStyle = options.bodyColor;
    each(this.beforeBody, fillLineOfText);
    xLinePadding = displayColors && bodyAlignForCalculation !== "right" ? bodyAlign === "center" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;
    for (i5 = 0, ilen = body.length; i5 < ilen; ++i5) {
      bodyItem = body[i5];
      textColor = this.labelTextColors[i5];
      ctx.fillStyle = textColor;
      each(bodyItem.before, fillLineOfText);
      lines = bodyItem.lines;
      if (displayColors && lines.length) {
        this._drawColorBox(ctx, pt, i5, rtlHelper, options);
        bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);
      }
      for (j4 = 0, jlen = lines.length; j4 < jlen; ++j4) {
        fillLineOfText(lines[j4]);
        bodyLineHeight = bodyFont.lineHeight;
      }
      each(bodyItem.after, fillLineOfText);
    }
    xLinePadding = 0;
    bodyLineHeight = bodyFont.lineHeight;
    each(this.afterBody, fillLineOfText);
    pt.y -= bodySpacing;
  }
  drawFooter(pt, ctx, options) {
    const footer = this.footer;
    const length = footer.length;
    let footerFont, i5;
    if (length) {
      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
      pt.x = getAlignedX(this, options.footerAlign, options);
      pt.y += options.footerMarginTop;
      ctx.textAlign = rtlHelper.textAlign(options.footerAlign);
      ctx.textBaseline = "middle";
      footerFont = toFont(options.footerFont);
      ctx.fillStyle = options.footerColor;
      ctx.font = footerFont.string;
      for (i5 = 0; i5 < length; ++i5) {
        ctx.fillText(footer[i5], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);
        pt.y += footerFont.lineHeight + options.footerSpacing;
      }
    }
  }
  drawBackground(pt, ctx, tooltipSize, options) {
    const { xAlign, yAlign } = this;
    const { x: x6, y: y6 } = pt;
    const { width, height } = tooltipSize;
    const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(options.cornerRadius);
    ctx.fillStyle = options.backgroundColor;
    ctx.strokeStyle = options.borderColor;
    ctx.lineWidth = options.borderWidth;
    ctx.beginPath();
    ctx.moveTo(x6 + topLeft, y6);
    if (yAlign === "top") {
      this.drawCaret(pt, ctx, tooltipSize, options);
    }
    ctx.lineTo(x6 + width - topRight, y6);
    ctx.quadraticCurveTo(x6 + width, y6, x6 + width, y6 + topRight);
    if (yAlign === "center" && xAlign === "right") {
      this.drawCaret(pt, ctx, tooltipSize, options);
    }
    ctx.lineTo(x6 + width, y6 + height - bottomRight);
    ctx.quadraticCurveTo(x6 + width, y6 + height, x6 + width - bottomRight, y6 + height);
    if (yAlign === "bottom") {
      this.drawCaret(pt, ctx, tooltipSize, options);
    }
    ctx.lineTo(x6 + bottomLeft, y6 + height);
    ctx.quadraticCurveTo(x6, y6 + height, x6, y6 + height - bottomLeft);
    if (yAlign === "center" && xAlign === "left") {
      this.drawCaret(pt, ctx, tooltipSize, options);
    }
    ctx.lineTo(x6, y6 + topLeft);
    ctx.quadraticCurveTo(x6, y6, x6 + topLeft, y6);
    ctx.closePath();
    ctx.fill();
    if (options.borderWidth > 0) {
      ctx.stroke();
    }
  }
  _updateAnimationTarget(options) {
    const chart = this.chart;
    const anims = this.$animations;
    const animX = anims && anims.x;
    const animY = anims && anims.y;
    if (animX || animY) {
      const position = positioners[options.position].call(this, this._active, this._eventPosition);
      if (!position) {
        return;
      }
      const size = this._size = getTooltipSize(this, options);
      const positionAndSize = Object.assign({}, position, this._size);
      const alignment = determineAlignment(chart, options, positionAndSize);
      const point = getBackgroundPoint(options, positionAndSize, alignment, chart);
      if (animX._to !== point.x || animY._to !== point.y) {
        this.xAlign = alignment.xAlign;
        this.yAlign = alignment.yAlign;
        this.width = size.width;
        this.height = size.height;
        this.caretX = position.x;
        this.caretY = position.y;
        this._resolveAnimations().update(this, point);
      }
    }
  }
  _willRender() {
    return !!this.opacity;
  }
  draw(ctx) {
    const options = this.options.setContext(this.getContext());
    let opacity = this.opacity;
    if (!opacity) {
      return;
    }
    this._updateAnimationTarget(options);
    const tooltipSize = {
      width: this.width,
      height: this.height
    };
    const pt = {
      x: this.x,
      y: this.y
    };
    opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;
    const padding = toPadding(options.padding);
    const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;
    if (options.enabled && hasTooltipContent) {
      ctx.save();
      ctx.globalAlpha = opacity;
      this.drawBackground(pt, ctx, tooltipSize, options);
      overrideTextDirection(ctx, options.textDirection);
      pt.y += padding.top;
      this.drawTitle(pt, ctx, options);
      this.drawBody(pt, ctx, options);
      this.drawFooter(pt, ctx, options);
      restoreTextDirection(ctx, options.textDirection);
      ctx.restore();
    }
  }
  getActiveElements() {
    return this._active || [];
  }
  setActiveElements(activeElements, eventPosition) {
    const lastActive = this._active;
    const active = activeElements.map(({ datasetIndex, index: index2 }) => {
      const meta = this.chart.getDatasetMeta(datasetIndex);
      if (!meta) {
        throw new Error("Cannot find a dataset at index " + datasetIndex);
      }
      return {
        datasetIndex,
        element: meta.data[index2],
        index: index2
      };
    });
    const changed = !_elementsEqual(lastActive, active);
    const positionChanged = this._positionChanged(active, eventPosition);
    if (changed || positionChanged) {
      this._active = active;
      this._eventPosition = eventPosition;
      this._ignoreReplayEvents = true;
      this.update(true);
    }
  }
  handleEvent(e5, replay, inChartArea = true) {
    if (replay && this._ignoreReplayEvents) {
      return false;
    }
    this._ignoreReplayEvents = false;
    const options = this.options;
    const lastActive = this._active || [];
    const active = this._getActiveElements(e5, lastActive, replay, inChartArea);
    const positionChanged = this._positionChanged(active, e5);
    const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;
    if (changed) {
      this._active = active;
      if (options.enabled || options.external) {
        this._eventPosition = {
          x: e5.x,
          y: e5.y
        };
        this.update(true, replay);
      }
    }
    return changed;
  }
  _getActiveElements(e5, lastActive, replay, inChartArea) {
    const options = this.options;
    if (e5.type === "mouseout") {
      return [];
    }
    if (!inChartArea) {
      return lastActive.filter((i5) => this.chart.data.datasets[i5.datasetIndex] && this.chart.getDatasetMeta(i5.datasetIndex).controller.getParsed(i5.index) !== void 0);
    }
    const active = this.chart.getElementsAtEventForMode(e5, options.mode, options, replay);
    if (options.reverse) {
      active.reverse();
    }
    return active;
  }
  _positionChanged(active, e5) {
    const { caretX, caretY, options } = this;
    const position = positioners[options.position].call(this, active, e5);
    return position !== false && (caretX !== position.x || caretY !== position.y);
  }
};
__publicField(Tooltip, "positioners", positioners);
var plugin_tooltip = {
  id: "tooltip",
  _element: Tooltip,
  positioners,
  afterInit(chart, _args, options) {
    if (options) {
      chart.tooltip = new Tooltip({
        chart,
        options
      });
    }
  },
  beforeUpdate(chart, _args, options) {
    if (chart.tooltip) {
      chart.tooltip.initialize(options);
    }
  },
  reset(chart, _args, options) {
    if (chart.tooltip) {
      chart.tooltip.initialize(options);
    }
  },
  afterDraw(chart) {
    const tooltip = chart.tooltip;
    if (tooltip && tooltip._willRender()) {
      const args = {
        tooltip
      };
      if (chart.notifyPlugins("beforeTooltipDraw", {
        ...args,
        cancelable: true
      }) === false) {
        return;
      }
      tooltip.draw(chart.ctx);
      chart.notifyPlugins("afterTooltipDraw", args);
    }
  },
  afterEvent(chart, args) {
    if (chart.tooltip) {
      const useFinalPosition = args.replay;
      if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {
        args.changed = true;
      }
    }
  },
  defaults: {
    enabled: true,
    external: null,
    position: "average",
    backgroundColor: "rgba(0,0,0,0.8)",
    titleColor: "#fff",
    titleFont: {
      weight: "bold"
    },
    titleSpacing: 2,
    titleMarginBottom: 6,
    titleAlign: "left",
    bodyColor: "#fff",
    bodySpacing: 2,
    bodyFont: {},
    bodyAlign: "left",
    footerColor: "#fff",
    footerSpacing: 2,
    footerMarginTop: 6,
    footerFont: {
      weight: "bold"
    },
    footerAlign: "left",
    padding: 6,
    caretPadding: 2,
    caretSize: 5,
    cornerRadius: 6,
    boxHeight: (ctx, opts) => opts.bodyFont.size,
    boxWidth: (ctx, opts) => opts.bodyFont.size,
    multiKeyBackground: "#fff",
    displayColors: true,
    boxPadding: 0,
    borderColor: "rgba(0,0,0,0)",
    borderWidth: 0,
    animation: {
      duration: 400,
      easing: "easeOutQuart"
    },
    animations: {
      numbers: {
        type: "number",
        properties: [
          "x",
          "y",
          "width",
          "height",
          "caretX",
          "caretY"
        ]
      },
      opacity: {
        easing: "linear",
        duration: 200
      }
    },
    callbacks: defaultCallbacks
  },
  defaultRoutes: {
    bodyFont: "font",
    footerFont: "font",
    titleFont: "font"
  },
  descriptors: {
    _scriptable: (name) => name !== "filter" && name !== "itemSort" && name !== "external",
    _indexable: false,
    callbacks: {
      _scriptable: false,
      _indexable: false
    },
    animation: {
      _fallback: false
    },
    animations: {
      _fallback: "animation"
    }
  },
  additionalOptionScopes: [
    "interaction"
  ]
};
var addIfString = (labels, raw, index2, addedLabels) => {
  if (typeof raw === "string") {
    index2 = labels.push(raw) - 1;
    addedLabels.unshift({
      index: index2,
      label: raw
    });
  } else if (isNaN(raw)) {
    index2 = null;
  }
  return index2;
};
function findOrAddLabel(labels, raw, index2, addedLabels) {
  const first = labels.indexOf(raw);
  if (first === -1) {
    return addIfString(labels, raw, index2, addedLabels);
  }
  const last = labels.lastIndexOf(raw);
  return first !== last ? index2 : first;
}
var validIndex = (index2, max) => index2 === null ? null : _limitValue(Math.round(index2), 0, max);
function _getLabelForValue(value) {
  const labels = this.getLabels();
  if (value >= 0 && value < labels.length) {
    return labels[value];
  }
  return value;
}
var CategoryScale = class extends Scale {
  constructor(cfg) {
    super(cfg);
    this._startValue = void 0;
    this._valueRange = 0;
    this._addedLabels = [];
  }
  init(scaleOptions) {
    const added = this._addedLabels;
    if (added.length) {
      const labels = this.getLabels();
      for (const { index: index2, label } of added) {
        if (labels[index2] === label) {
          labels.splice(index2, 1);
        }
      }
      this._addedLabels = [];
    }
    super.init(scaleOptions);
  }
  parse(raw, index2) {
    if (isNullOrUndef(raw)) {
      return null;
    }
    const labels = this.getLabels();
    index2 = isFinite(index2) && labels[index2] === raw ? index2 : findOrAddLabel(labels, raw, valueOrDefault(index2, raw), this._addedLabels);
    return validIndex(index2, labels.length - 1);
  }
  determineDataLimits() {
    const { minDefined, maxDefined } = this.getUserBounds();
    let { min, max } = this.getMinMax(true);
    if (this.options.bounds === "ticks") {
      if (!minDefined) {
        min = 0;
      }
      if (!maxDefined) {
        max = this.getLabels().length - 1;
      }
    }
    this.min = min;
    this.max = max;
  }
  buildTicks() {
    const min = this.min;
    const max = this.max;
    const offset = this.options.offset;
    const ticks = [];
    let labels = this.getLabels();
    labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);
    this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);
    this._startValue = this.min - (offset ? 0.5 : 0);
    for (let value = min; value <= max; value++) {
      ticks.push({
        value
      });
    }
    return ticks;
  }
  getLabelForValue(value) {
    return _getLabelForValue.call(this, value);
  }
  configure() {
    super.configure();
    if (!this.isHorizontal()) {
      this._reversePixels = !this._reversePixels;
    }
  }
  getPixelForValue(value) {
    if (typeof value !== "number") {
      value = this.parse(value);
    }
    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
  }
  getPixelForTick(index2) {
    const ticks = this.ticks;
    if (index2 < 0 || index2 > ticks.length - 1) {
      return null;
    }
    return this.getPixelForValue(ticks[index2].value);
  }
  getValueForPixel(pixel) {
    return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);
  }
  getBasePixel() {
    return this.bottom;
  }
};
__publicField(CategoryScale, "id", "category");
__publicField(CategoryScale, "defaults", {
  ticks: {
    callback: _getLabelForValue
  }
});
function generateTicks$1(generationOptions, dataRange) {
  const ticks = [];
  const MIN_SPACING = 1e-14;
  const { bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds } = generationOptions;
  const unit = step || 1;
  const maxSpaces = maxTicks - 1;
  const { min: rmin, max: rmax } = dataRange;
  const minDefined = !isNullOrUndef(min);
  const maxDefined = !isNullOrUndef(max);
  const countDefined = !isNullOrUndef(count);
  const minSpacing = (rmax - rmin) / (maxDigits + 1);
  let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;
  let factor, niceMin, niceMax, numSpaces;
  if (spacing < MIN_SPACING && !minDefined && !maxDefined) {
    return [
      {
        value: rmin
      },
      {
        value: rmax
      }
    ];
  }
  numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);
  if (numSpaces > maxSpaces) {
    spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;
  }
  if (!isNullOrUndef(precision)) {
    factor = Math.pow(10, precision);
    spacing = Math.ceil(spacing * factor) / factor;
  }
  if (bounds === "ticks") {
    niceMin = Math.floor(rmin / spacing) * spacing;
    niceMax = Math.ceil(rmax / spacing) * spacing;
  } else {
    niceMin = rmin;
    niceMax = rmax;
  }
  if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1e3)) {
    numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));
    spacing = (max - min) / numSpaces;
    niceMin = min;
    niceMax = max;
  } else if (countDefined) {
    niceMin = minDefined ? min : niceMin;
    niceMax = maxDefined ? max : niceMax;
    numSpaces = count - 1;
    spacing = (niceMax - niceMin) / numSpaces;
  } else {
    numSpaces = (niceMax - niceMin) / spacing;
    if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1e3)) {
      numSpaces = Math.round(numSpaces);
    } else {
      numSpaces = Math.ceil(numSpaces);
    }
  }
  const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));
  factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);
  niceMin = Math.round(niceMin * factor) / factor;
  niceMax = Math.round(niceMax * factor) / factor;
  let j4 = 0;
  if (minDefined) {
    if (includeBounds && niceMin !== min) {
      ticks.push({
        value: min
      });
      if (niceMin < min) {
        j4++;
      }
      if (almostEquals(Math.round((niceMin + j4 * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {
        j4++;
      }
    } else if (niceMin < min) {
      j4++;
    }
  }
  for (; j4 < numSpaces; ++j4) {
    const tickValue = Math.round((niceMin + j4 * spacing) * factor) / factor;
    if (maxDefined && tickValue > max) {
      break;
    }
    ticks.push({
      value: tickValue
    });
  }
  if (maxDefined && includeBounds && niceMax !== max) {
    if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {
      ticks[ticks.length - 1].value = max;
    } else {
      ticks.push({
        value: max
      });
    }
  } else if (!maxDefined || niceMax === max) {
    ticks.push({
      value: niceMax
    });
  }
  return ticks;
}
function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
  const rad = toRadians(minRotation);
  const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 1e-3;
  const length = 0.75 * minSpacing * ("" + value).length;
  return Math.min(minSpacing / ratio, length);
}
var LinearScaleBase = class extends Scale {
  constructor(cfg) {
    super(cfg);
    this.start = void 0;
    this.end = void 0;
    this._startValue = void 0;
    this._endValue = void 0;
    this._valueRange = 0;
  }
  parse(raw, index2) {
    if (isNullOrUndef(raw)) {
      return null;
    }
    if ((typeof raw === "number" || raw instanceof Number) && !isFinite(+raw)) {
      return null;
    }
    return +raw;
  }
  handleTickRangeOptions() {
    const { beginAtZero } = this.options;
    const { minDefined, maxDefined } = this.getUserBounds();
    let { min, max } = this;
    const setMin = (v3) => min = minDefined ? min : v3;
    const setMax = (v3) => max = maxDefined ? max : v3;
    if (beginAtZero) {
      const minSign = sign2(min);
      const maxSign = sign2(max);
      if (minSign < 0 && maxSign < 0) {
        setMax(0);
      } else if (minSign > 0 && maxSign > 0) {
        setMin(0);
      }
    }
    if (min === max) {
      let offset = max === 0 ? 1 : Math.abs(max * 0.05);
      setMax(max + offset);
      if (!beginAtZero) {
        setMin(min - offset);
      }
    }
    this.min = min;
    this.max = max;
  }
  getTickLimit() {
    const tickOpts = this.options.ticks;
    let { maxTicksLimit, stepSize } = tickOpts;
    let maxTicks;
    if (stepSize) {
      maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;
      if (maxTicks > 1e3) {
        console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);
        maxTicks = 1e3;
      }
    } else {
      maxTicks = this.computeTickLimit();
      maxTicksLimit = maxTicksLimit || 11;
    }
    if (maxTicksLimit) {
      maxTicks = Math.min(maxTicksLimit, maxTicks);
    }
    return maxTicks;
  }
  computeTickLimit() {
    return Number.POSITIVE_INFINITY;
  }
  buildTicks() {
    const opts = this.options;
    const tickOpts = opts.ticks;
    let maxTicks = this.getTickLimit();
    maxTicks = Math.max(2, maxTicks);
    const numericGeneratorOptions = {
      maxTicks,
      bounds: opts.bounds,
      min: opts.min,
      max: opts.max,
      precision: tickOpts.precision,
      step: tickOpts.stepSize,
      count: tickOpts.count,
      maxDigits: this._maxDigits(),
      horizontal: this.isHorizontal(),
      minRotation: tickOpts.minRotation || 0,
      includeBounds: tickOpts.includeBounds !== false
    };
    const dataRange = this._range || this;
    const ticks = generateTicks$1(numericGeneratorOptions, dataRange);
    if (opts.bounds === "ticks") {
      _setMinAndMaxByKey(ticks, this, "value");
    }
    if (opts.reverse) {
      ticks.reverse();
      this.start = this.max;
      this.end = this.min;
    } else {
      this.start = this.min;
      this.end = this.max;
    }
    return ticks;
  }
  configure() {
    const ticks = this.ticks;
    let start = this.min;
    let end = this.max;
    super.configure();
    if (this.options.offset && ticks.length) {
      const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;
      start -= offset;
      end += offset;
    }
    this._startValue = start;
    this._endValue = end;
    this._valueRange = end - start;
  }
  getLabelForValue(value) {
    return formatNumber(value, this.chart.options.locale, this.options.ticks.format);
  }
};
var LinearScale = class extends LinearScaleBase {
  determineDataLimits() {
    const { min, max } = this.getMinMax(true);
    this.min = isNumberFinite(min) ? min : 0;
    this.max = isNumberFinite(max) ? max : 1;
    this.handleTickRangeOptions();
  }
  computeTickLimit() {
    const horizontal = this.isHorizontal();
    const length = horizontal ? this.width : this.height;
    const minRotation = toRadians(this.options.ticks.minRotation);
    const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 1e-3;
    const tickFont = this._resolveTickFontOptions(0);
    return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));
  }
  getPixelForValue(value) {
    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
  }
  getValueForPixel(pixel) {
    return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
  }
};
__publicField(LinearScale, "id", "linear");
__publicField(LinearScale, "defaults", {
  ticks: {
    callback: Ticks.formatters.numeric
  }
});
var log10Floor = (v3) => Math.floor(log10(v3));
var changeExponent = (v3, m6) => Math.pow(10, log10Floor(v3) + m6);
function isMajor(tickVal) {
  const remain = tickVal / Math.pow(10, log10Floor(tickVal));
  return remain === 1;
}
function steps(min, max, rangeExp) {
  const rangeStep = Math.pow(10, rangeExp);
  const start = Math.floor(min / rangeStep);
  const end = Math.ceil(max / rangeStep);
  return end - start;
}
function startExp(min, max) {
  const range = max - min;
  let rangeExp = log10Floor(range);
  while (steps(min, max, rangeExp) > 10) {
    rangeExp++;
  }
  while (steps(min, max, rangeExp) < 10) {
    rangeExp--;
  }
  return Math.min(rangeExp, log10Floor(min));
}
function generateTicks(generationOptions, { min, max }) {
  min = finiteOrDefault(generationOptions.min, min);
  const ticks = [];
  const minExp = log10Floor(min);
  let exp = startExp(min, max);
  let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;
  const stepSize = Math.pow(10, exp);
  const base2 = minExp > exp ? Math.pow(10, minExp) : 0;
  const start = Math.round((min - base2) * precision) / precision;
  const offset = Math.floor((min - base2) / stepSize / 10) * stepSize * 10;
  let significand = Math.floor((start - offset) / Math.pow(10, exp));
  let value = finiteOrDefault(generationOptions.min, Math.round((base2 + offset + significand * Math.pow(10, exp)) * precision) / precision);
  while (value < max) {
    ticks.push({
      value,
      major: isMajor(value),
      significand
    });
    if (significand >= 10) {
      significand = significand < 15 ? 15 : 20;
    } else {
      significand++;
    }
    if (significand >= 20) {
      exp++;
      significand = 2;
      precision = exp >= 0 ? 1 : precision;
    }
    value = Math.round((base2 + offset + significand * Math.pow(10, exp)) * precision) / precision;
  }
  const lastTick = finiteOrDefault(generationOptions.max, value);
  ticks.push({
    value: lastTick,
    major: isMajor(lastTick),
    significand
  });
  return ticks;
}
var LogarithmicScale = class extends Scale {
  constructor(cfg) {
    super(cfg);
    this.start = void 0;
    this.end = void 0;
    this._startValue = void 0;
    this._valueRange = 0;
  }
  parse(raw, index2) {
    const value = LinearScaleBase.prototype.parse.apply(this, [
      raw,
      index2
    ]);
    if (value === 0) {
      this._zero = true;
      return void 0;
    }
    return isNumberFinite(value) && value > 0 ? value : null;
  }
  determineDataLimits() {
    const { min, max } = this.getMinMax(true);
    this.min = isNumberFinite(min) ? Math.max(0, min) : null;
    this.max = isNumberFinite(max) ? Math.max(0, max) : null;
    if (this.options.beginAtZero) {
      this._zero = true;
    }
    if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {
      this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);
    }
    this.handleTickRangeOptions();
  }
  handleTickRangeOptions() {
    const { minDefined, maxDefined } = this.getUserBounds();
    let min = this.min;
    let max = this.max;
    const setMin = (v3) => min = minDefined ? min : v3;
    const setMax = (v3) => max = maxDefined ? max : v3;
    if (min === max) {
      if (min <= 0) {
        setMin(1);
        setMax(10);
      } else {
        setMin(changeExponent(min, -1));
        setMax(changeExponent(max, 1));
      }
    }
    if (min <= 0) {
      setMin(changeExponent(max, -1));
    }
    if (max <= 0) {
      setMax(changeExponent(min, 1));
    }
    this.min = min;
    this.max = max;
  }
  buildTicks() {
    const opts = this.options;
    const generationOptions = {
      min: this._userMin,
      max: this._userMax
    };
    const ticks = generateTicks(generationOptions, this);
    if (opts.bounds === "ticks") {
      _setMinAndMaxByKey(ticks, this, "value");
    }
    if (opts.reverse) {
      ticks.reverse();
      this.start = this.max;
      this.end = this.min;
    } else {
      this.start = this.min;
      this.end = this.max;
    }
    return ticks;
  }
  getLabelForValue(value) {
    return value === void 0 ? "0" : formatNumber(value, this.chart.options.locale, this.options.ticks.format);
  }
  configure() {
    const start = this.min;
    super.configure();
    this._startValue = log10(start);
    this._valueRange = log10(this.max) - log10(start);
  }
  getPixelForValue(value) {
    if (value === void 0 || value === 0) {
      value = this.min;
    }
    if (value === null || isNaN(value)) {
      return NaN;
    }
    return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);
  }
  getValueForPixel(pixel) {
    const decimal = this.getDecimalForPixel(pixel);
    return Math.pow(10, this._startValue + decimal * this._valueRange);
  }
};
__publicField(LogarithmicScale, "id", "logarithmic");
__publicField(LogarithmicScale, "defaults", {
  ticks: {
    callback: Ticks.formatters.logarithmic,
    major: {
      enabled: true
    }
  }
});
function getTickBackdropHeight(opts) {
  const tickOpts = opts.ticks;
  if (tickOpts.display && opts.display) {
    const padding = toPadding(tickOpts.backdropPadding);
    return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;
  }
  return 0;
}
function measureLabelSize(ctx, font, label) {
  label = isArray(label) ? label : [
    label
  ];
  return {
    w: _longestText(ctx, font.string, label),
    h: label.length * font.lineHeight
  };
}
function determineLimits(angle, pos, size, min, max) {
  if (angle === min || angle === max) {
    return {
      start: pos - size / 2,
      end: pos + size / 2
    };
  } else if (angle < min || angle > max) {
    return {
      start: pos - size,
      end: pos
    };
  }
  return {
    start: pos,
    end: pos + size
  };
}
function fitWithPointLabels(scale) {
  const orig = {
    l: scale.left + scale._padding.left,
    r: scale.right - scale._padding.right,
    t: scale.top + scale._padding.top,
    b: scale.bottom - scale._padding.bottom
  };
  const limits = Object.assign({}, orig);
  const labelSizes = [];
  const padding = [];
  const valueCount = scale._pointLabels.length;
  const pointLabelOpts = scale.options.pointLabels;
  const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;
  for (let i5 = 0; i5 < valueCount; i5++) {
    const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i5));
    padding[i5] = opts.padding;
    const pointPosition = scale.getPointPosition(i5, scale.drawingArea + padding[i5], additionalAngle);
    const plFont = toFont(opts.font);
    const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i5]);
    labelSizes[i5] = textSize;
    const angleRadians = _normalizeAngle(scale.getIndexAngle(i5) + additionalAngle);
    const angle = Math.round(toDegrees(angleRadians));
    const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
    const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
    updateLimits(limits, orig, angleRadians, hLimits, vLimits);
  }
  scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);
  scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);
}
function updateLimits(limits, orig, angle, hLimits, vLimits) {
  const sin = Math.abs(Math.sin(angle));
  const cos = Math.abs(Math.cos(angle));
  let x6 = 0;
  let y6 = 0;
  if (hLimits.start < orig.l) {
    x6 = (orig.l - hLimits.start) / sin;
    limits.l = Math.min(limits.l, orig.l - x6);
  } else if (hLimits.end > orig.r) {
    x6 = (hLimits.end - orig.r) / sin;
    limits.r = Math.max(limits.r, orig.r + x6);
  }
  if (vLimits.start < orig.t) {
    y6 = (orig.t - vLimits.start) / cos;
    limits.t = Math.min(limits.t, orig.t - y6);
  } else if (vLimits.end > orig.b) {
    y6 = (vLimits.end - orig.b) / cos;
    limits.b = Math.max(limits.b, orig.b + y6);
  }
}
function createPointLabelItem(scale, index2, itemOpts) {
  const outerDistance = scale.drawingArea;
  const { extra, additionalAngle, padding, size } = itemOpts;
  const pointLabelPosition = scale.getPointPosition(index2, outerDistance + extra + padding, additionalAngle);
  const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));
  const y6 = yForAngle(pointLabelPosition.y, size.h, angle);
  const textAlign = getTextAlignForAngle(angle);
  const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);
  return {
    visible: true,
    x: pointLabelPosition.x,
    y: y6,
    textAlign,
    left,
    top: y6,
    right: left + size.w,
    bottom: y6 + size.h
  };
}
function isNotOverlapped(item, area) {
  if (!area) {
    return true;
  }
  const { left, top, right, bottom } = item;
  const apexesInArea = _isPointInArea({
    x: left,
    y: top
  }, area) || _isPointInArea({
    x: left,
    y: bottom
  }, area) || _isPointInArea({
    x: right,
    y: top
  }, area) || _isPointInArea({
    x: right,
    y: bottom
  }, area);
  return !apexesInArea;
}
function buildPointLabelItems(scale, labelSizes, padding) {
  const items = [];
  const valueCount = scale._pointLabels.length;
  const opts = scale.options;
  const { centerPointLabels, display } = opts.pointLabels;
  const itemOpts = {
    extra: getTickBackdropHeight(opts) / 2,
    additionalAngle: centerPointLabels ? PI / valueCount : 0
  };
  let area;
  for (let i5 = 0; i5 < valueCount; i5++) {
    itemOpts.padding = padding[i5];
    itemOpts.size = labelSizes[i5];
    const item = createPointLabelItem(scale, i5, itemOpts);
    items.push(item);
    if (display === "auto") {
      item.visible = isNotOverlapped(item, area);
      if (item.visible) {
        area = item;
      }
    }
  }
  return items;
}
function getTextAlignForAngle(angle) {
  if (angle === 0 || angle === 180) {
    return "center";
  } else if (angle < 180) {
    return "left";
  }
  return "right";
}
function leftForTextAlign(x6, w6, align) {
  if (align === "right") {
    x6 -= w6;
  } else if (align === "center") {
    x6 -= w6 / 2;
  }
  return x6;
}
function yForAngle(y6, h5, angle) {
  if (angle === 90 || angle === 270) {
    y6 -= h5 / 2;
  } else if (angle > 270 || angle < 90) {
    y6 -= h5;
  }
  return y6;
}
function drawPointLabelBox(ctx, opts, item) {
  const { left, top, right, bottom } = item;
  const { backdropColor } = opts;
  if (!isNullOrUndef(backdropColor)) {
    const borderRadius = toTRBLCorners(opts.borderRadius);
    const padding = toPadding(opts.backdropPadding);
    ctx.fillStyle = backdropColor;
    const backdropLeft = left - padding.left;
    const backdropTop = top - padding.top;
    const backdropWidth = right - left + padding.width;
    const backdropHeight = bottom - top + padding.height;
    if (Object.values(borderRadius).some((v3) => v3 !== 0)) {
      ctx.beginPath();
      addRoundedRectPath(ctx, {
        x: backdropLeft,
        y: backdropTop,
        w: backdropWidth,
        h: backdropHeight,
        radius: borderRadius
      });
      ctx.fill();
    } else {
      ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);
    }
  }
}
function drawPointLabels(scale, labelCount) {
  const { ctx, options: { pointLabels } } = scale;
  for (let i5 = labelCount - 1; i5 >= 0; i5--) {
    const item = scale._pointLabelItems[i5];
    if (!item.visible) {
      continue;
    }
    const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i5));
    drawPointLabelBox(ctx, optsAtIndex, item);
    const plFont = toFont(optsAtIndex.font);
    const { x: x6, y: y6, textAlign } = item;
    renderText(ctx, scale._pointLabels[i5], x6, y6 + plFont.lineHeight / 2, plFont, {
      color: optsAtIndex.color,
      textAlign,
      textBaseline: "middle"
    });
  }
}
function pathRadiusLine(scale, radius, circular, labelCount) {
  const { ctx } = scale;
  if (circular) {
    ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);
  } else {
    let pointPosition = scale.getPointPosition(0, radius);
    ctx.moveTo(pointPosition.x, pointPosition.y);
    for (let i5 = 1; i5 < labelCount; i5++) {
      pointPosition = scale.getPointPosition(i5, radius);
      ctx.lineTo(pointPosition.x, pointPosition.y);
    }
  }
}
function drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {
  const ctx = scale.ctx;
  const circular = gridLineOpts.circular;
  const { color: color2, lineWidth } = gridLineOpts;
  if (!circular && !labelCount || !color2 || !lineWidth || radius < 0) {
    return;
  }
  ctx.save();
  ctx.strokeStyle = color2;
  ctx.lineWidth = lineWidth;
  ctx.setLineDash(borderOpts.dash || []);
  ctx.lineDashOffset = borderOpts.dashOffset;
  ctx.beginPath();
  pathRadiusLine(scale, radius, circular, labelCount);
  ctx.closePath();
  ctx.stroke();
  ctx.restore();
}
function createPointLabelContext(parent, index2, label) {
  return createContext(parent, {
    label,
    index: index2,
    type: "pointLabel"
  });
}
var RadialLinearScale = class extends LinearScaleBase {
  constructor(cfg) {
    super(cfg);
    this.xCenter = void 0;
    this.yCenter = void 0;
    this.drawingArea = void 0;
    this._pointLabels = [];
    this._pointLabelItems = [];
  }
  setDimensions() {
    const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);
    const w6 = this.width = this.maxWidth - padding.width;
    const h5 = this.height = this.maxHeight - padding.height;
    this.xCenter = Math.floor(this.left + w6 / 2 + padding.left);
    this.yCenter = Math.floor(this.top + h5 / 2 + padding.top);
    this.drawingArea = Math.floor(Math.min(w6, h5) / 2);
  }
  determineDataLimits() {
    const { min, max } = this.getMinMax(false);
    this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;
    this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;
    this.handleTickRangeOptions();
  }
  computeTickLimit() {
    return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));
  }
  generateTickLabels(ticks) {
    LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
    this._pointLabels = this.getLabels().map((value, index2) => {
      const label = callback(this.options.pointLabels.callback, [
        value,
        index2
      ], this);
      return label || label === 0 ? label : "";
    }).filter((v3, i5) => this.chart.getDataVisibility(i5));
  }
  fit() {
    const opts = this.options;
    if (opts.display && opts.pointLabels.display) {
      fitWithPointLabels(this);
    } else {
      this.setCenterPoint(0, 0, 0, 0);
    }
  }
  setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {
    this.xCenter += Math.floor((leftMovement - rightMovement) / 2);
    this.yCenter += Math.floor((topMovement - bottomMovement) / 2);
    this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));
  }
  getIndexAngle(index2) {
    const angleMultiplier = TAU / (this._pointLabels.length || 1);
    const startAngle = this.options.startAngle || 0;
    return _normalizeAngle(index2 * angleMultiplier + toRadians(startAngle));
  }
  getDistanceFromCenterForValue(value) {
    if (isNullOrUndef(value)) {
      return NaN;
    }
    const scalingFactor = this.drawingArea / (this.max - this.min);
    if (this.options.reverse) {
      return (this.max - value) * scalingFactor;
    }
    return (value - this.min) * scalingFactor;
  }
  getValueForDistanceFromCenter(distance) {
    if (isNullOrUndef(distance)) {
      return NaN;
    }
    const scaledDistance = distance / (this.drawingArea / (this.max - this.min));
    return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;
  }
  getPointLabelContext(index2) {
    const pointLabels = this._pointLabels || [];
    if (index2 >= 0 && index2 < pointLabels.length) {
      const pointLabel = pointLabels[index2];
      return createPointLabelContext(this.getContext(), index2, pointLabel);
    }
  }
  getPointPosition(index2, distanceFromCenter, additionalAngle = 0) {
    const angle = this.getIndexAngle(index2) - HALF_PI + additionalAngle;
    return {
      x: Math.cos(angle) * distanceFromCenter + this.xCenter,
      y: Math.sin(angle) * distanceFromCenter + this.yCenter,
      angle
    };
  }
  getPointPositionForValue(index2, value) {
    return this.getPointPosition(index2, this.getDistanceFromCenterForValue(value));
  }
  getBasePosition(index2) {
    return this.getPointPositionForValue(index2 || 0, this.getBaseValue());
  }
  getPointLabelPosition(index2) {
    const { left, top, right, bottom } = this._pointLabelItems[index2];
    return {
      left,
      top,
      right,
      bottom
    };
  }
  drawBackground() {
    const { backgroundColor, grid: { circular } } = this.options;
    if (backgroundColor) {
      const ctx = this.ctx;
      ctx.save();
      ctx.beginPath();
      pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);
      ctx.closePath();
      ctx.fillStyle = backgroundColor;
      ctx.fill();
      ctx.restore();
    }
  }
  drawGrid() {
    const ctx = this.ctx;
    const opts = this.options;
    const { angleLines, grid, border } = opts;
    const labelCount = this._pointLabels.length;
    let i5, offset, position;
    if (opts.pointLabels.display) {
      drawPointLabels(this, labelCount);
    }
    if (grid.display) {
      this.ticks.forEach((tick, index2) => {
        if (index2 !== 0 || index2 === 0 && this.min < 0) {
          offset = this.getDistanceFromCenterForValue(tick.value);
          const context = this.getContext(index2);
          const optsAtIndex = grid.setContext(context);
          const optsAtIndexBorder = border.setContext(context);
          drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);
        }
      });
    }
    if (angleLines.display) {
      ctx.save();
      for (i5 = labelCount - 1; i5 >= 0; i5--) {
        const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i5));
        const { color: color2, lineWidth } = optsAtIndex;
        if (!lineWidth || !color2) {
          continue;
        }
        ctx.lineWidth = lineWidth;
        ctx.strokeStyle = color2;
        ctx.setLineDash(optsAtIndex.borderDash);
        ctx.lineDashOffset = optsAtIndex.borderDashOffset;
        offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max);
        position = this.getPointPosition(i5, offset);
        ctx.beginPath();
        ctx.moveTo(this.xCenter, this.yCenter);
        ctx.lineTo(position.x, position.y);
        ctx.stroke();
      }
      ctx.restore();
    }
  }
  drawBorder() {
  }
  drawLabels() {
    const ctx = this.ctx;
    const opts = this.options;
    const tickOpts = opts.ticks;
    if (!tickOpts.display) {
      return;
    }
    const startAngle = this.getIndexAngle(0);
    let offset, width;
    ctx.save();
    ctx.translate(this.xCenter, this.yCenter);
    ctx.rotate(startAngle);
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    this.ticks.forEach((tick, index2) => {
      if (index2 === 0 && this.min >= 0 && !opts.reverse) {
        return;
      }
      const optsAtIndex = tickOpts.setContext(this.getContext(index2));
      const tickFont = toFont(optsAtIndex.font);
      offset = this.getDistanceFromCenterForValue(this.ticks[index2].value);
      if (optsAtIndex.showLabelBackdrop) {
        ctx.font = tickFont.string;
        width = ctx.measureText(tick.label).width;
        ctx.fillStyle = optsAtIndex.backdropColor;
        const padding = toPadding(optsAtIndex.backdropPadding);
        ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);
      }
      renderText(ctx, tick.label, 0, -offset, tickFont, {
        color: optsAtIndex.color,
        strokeColor: optsAtIndex.textStrokeColor,
        strokeWidth: optsAtIndex.textStrokeWidth
      });
    });
    ctx.restore();
  }
  drawTitle() {
  }
};
__publicField(RadialLinearScale, "id", "radialLinear");
__publicField(RadialLinearScale, "defaults", {
  display: true,
  animate: true,
  position: "chartArea",
  angleLines: {
    display: true,
    lineWidth: 1,
    borderDash: [],
    borderDashOffset: 0
  },
  grid: {
    circular: false
  },
  startAngle: 0,
  ticks: {
    showLabelBackdrop: true,
    callback: Ticks.formatters.numeric
  },
  pointLabels: {
    backdropColor: void 0,
    backdropPadding: 2,
    display: true,
    font: {
      size: 10
    },
    callback(label) {
      return label;
    },
    padding: 5,
    centerPointLabels: false
  }
});
__publicField(RadialLinearScale, "defaultRoutes", {
  "angleLines.color": "borderColor",
  "pointLabels.color": "color",
  "ticks.color": "color"
});
__publicField(RadialLinearScale, "descriptors", {
  angleLines: {
    _fallback: "grid"
  }
});
var INTERVALS = {
  millisecond: {
    common: true,
    size: 1,
    steps: 1e3
  },
  second: {
    common: true,
    size: 1e3,
    steps: 60
  },
  minute: {
    common: true,
    size: 6e4,
    steps: 60
  },
  hour: {
    common: true,
    size: 36e5,
    steps: 24
  },
  day: {
    common: true,
    size: 864e5,
    steps: 30
  },
  week: {
    common: false,
    size: 6048e5,
    steps: 4
  },
  month: {
    common: true,
    size: 2628e6,
    steps: 12
  },
  quarter: {
    common: false,
    size: 7884e6,
    steps: 4
  },
  year: {
    common: true,
    size: 3154e7
  }
};
var UNITS = /* @__PURE__ */ Object.keys(INTERVALS);
function sorter(a6, b5) {
  return a6 - b5;
}
function parse2(scale, input) {
  if (isNullOrUndef(input)) {
    return null;
  }
  const adapter = scale._adapter;
  const { parser, round: round2, isoWeekday } = scale._parseOpts;
  let value = input;
  if (typeof parser === "function") {
    value = parser(value);
  }
  if (!isNumberFinite(value)) {
    value = typeof parser === "string" ? adapter.parse(value, parser) : adapter.parse(value);
  }
  if (value === null) {
    return null;
  }
  if (round2) {
    value = round2 === "week" && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, "isoWeek", isoWeekday) : adapter.startOf(value, round2);
  }
  return +value;
}
function determineUnitForAutoTicks(minUnit, min, max, capacity) {
  const ilen = UNITS.length;
  for (let i5 = UNITS.indexOf(minUnit); i5 < ilen - 1; ++i5) {
    const interval = INTERVALS[UNITS[i5]];
    const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;
    if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {
      return UNITS[i5];
    }
  }
  return UNITS[ilen - 1];
}
function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
  for (let i5 = UNITS.length - 1; i5 >= UNITS.indexOf(minUnit); i5--) {
    const unit = UNITS[i5];
    if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {
      return unit;
    }
  }
  return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];
}
function determineMajorUnit(unit) {
  for (let i5 = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i5 < ilen; ++i5) {
    if (INTERVALS[UNITS[i5]].common) {
      return UNITS[i5];
    }
  }
}
function addTick(ticks, time, timestamps) {
  if (!timestamps) {
    ticks[time] = true;
  } else if (timestamps.length) {
    const { lo, hi } = _lookup(timestamps, time);
    const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];
    ticks[timestamp] = true;
  }
}
function setMajorTicks(scale, ticks, map3, majorUnit) {
  const adapter = scale._adapter;
  const first = +adapter.startOf(ticks[0].value, majorUnit);
  const last = ticks[ticks.length - 1].value;
  let major, index2;
  for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {
    index2 = map3[major];
    if (index2 >= 0) {
      ticks[index2].major = true;
    }
  }
  return ticks;
}
function ticksFromTimestamps(scale, values, majorUnit) {
  const ticks = [];
  const map3 = {};
  const ilen = values.length;
  let i5, value;
  for (i5 = 0; i5 < ilen; ++i5) {
    value = values[i5];
    map3[value] = i5;
    ticks.push({
      value,
      major: false
    });
  }
  return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map3, majorUnit);
}
var TimeScale = class extends Scale {
  constructor(props) {
    super(props);
    this._cache = {
      data: [],
      labels: [],
      all: []
    };
    this._unit = "day";
    this._majorUnit = void 0;
    this._offsets = {};
    this._normalized = false;
    this._parseOpts = void 0;
  }
  init(scaleOpts, opts = {}) {
    const time = scaleOpts.time || (scaleOpts.time = {});
    const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);
    adapter.init(opts);
    mergeIf(time.displayFormats, adapter.formats());
    this._parseOpts = {
      parser: time.parser,
      round: time.round,
      isoWeekday: time.isoWeekday
    };
    super.init(scaleOpts);
    this._normalized = opts.normalized;
  }
  parse(raw, index2) {
    if (raw === void 0) {
      return null;
    }
    return parse2(this, raw);
  }
  beforeLayout() {
    super.beforeLayout();
    this._cache = {
      data: [],
      labels: [],
      all: []
    };
  }
  determineDataLimits() {
    const options = this.options;
    const adapter = this._adapter;
    const unit = options.time.unit || "day";
    let { min, max, minDefined, maxDefined } = this.getUserBounds();
    function _applyBounds(bounds) {
      if (!minDefined && !isNaN(bounds.min)) {
        min = Math.min(min, bounds.min);
      }
      if (!maxDefined && !isNaN(bounds.max)) {
        max = Math.max(max, bounds.max);
      }
    }
    if (!minDefined || !maxDefined) {
      _applyBounds(this._getLabelBounds());
      if (options.bounds !== "ticks" || options.ticks.source !== "labels") {
        _applyBounds(this.getMinMax(false));
      }
    }
    min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);
    max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;
    this.min = Math.min(min, max - 1);
    this.max = Math.max(min + 1, max);
  }
  _getLabelBounds() {
    const arr = this.getLabelTimestamps();
    let min = Number.POSITIVE_INFINITY;
    let max = Number.NEGATIVE_INFINITY;
    if (arr.length) {
      min = arr[0];
      max = arr[arr.length - 1];
    }
    return {
      min,
      max
    };
  }
  buildTicks() {
    const options = this.options;
    const timeOpts = options.time;
    const tickOpts = options.ticks;
    const timestamps = tickOpts.source === "labels" ? this.getLabelTimestamps() : this._generate();
    if (options.bounds === "ticks" && timestamps.length) {
      this.min = this._userMin || timestamps[0];
      this.max = this._userMax || timestamps[timestamps.length - 1];
    }
    const min = this.min;
    const max = this.max;
    const ticks = _filterBetween(timestamps, min, max);
    this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));
    this._majorUnit = !tickOpts.major.enabled || this._unit === "year" ? void 0 : determineMajorUnit(this._unit);
    this.initOffsets(timestamps);
    if (options.reverse) {
      ticks.reverse();
    }
    return ticksFromTimestamps(this, ticks, this._majorUnit);
  }
  afterAutoSkip() {
    if (this.options.offsetAfterAutoskip) {
      this.initOffsets(this.ticks.map((tick) => +tick.value));
    }
  }
  initOffsets(timestamps = []) {
    let start = 0;
    let end = 0;
    let first, last;
    if (this.options.offset && timestamps.length) {
      first = this.getDecimalForValue(timestamps[0]);
      if (timestamps.length === 1) {
        start = 1 - first;
      } else {
        start = (this.getDecimalForValue(timestamps[1]) - first) / 2;
      }
      last = this.getDecimalForValue(timestamps[timestamps.length - 1]);
      if (timestamps.length === 1) {
        end = last;
      } else {
        end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;
      }
    }
    const limit = timestamps.length < 3 ? 0.5 : 0.25;
    start = _limitValue(start, 0, limit);
    end = _limitValue(end, 0, limit);
    this._offsets = {
      start,
      end,
      factor: 1 / (start + 1 + end)
    };
  }
  _generate() {
    const adapter = this._adapter;
    const min = this.min;
    const max = this.max;
    const options = this.options;
    const timeOpts = options.time;
    const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));
    const stepSize = valueOrDefault(options.ticks.stepSize, 1);
    const weekday = minor === "week" ? timeOpts.isoWeekday : false;
    const hasWeekday = isNumber(weekday) || weekday === true;
    const ticks = {};
    let first = min;
    let time, count;
    if (hasWeekday) {
      first = +adapter.startOf(first, "isoWeek", weekday);
    }
    first = +adapter.startOf(first, hasWeekday ? "day" : minor);
    if (adapter.diff(max, min, minor) > 1e5 * stepSize) {
      throw new Error(min + " and " + max + " are too far apart with stepSize of " + stepSize + " " + minor);
    }
    const timestamps = options.ticks.source === "data" && this.getDataTimestamps();
    for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {
      addTick(ticks, time, timestamps);
    }
    if (time === max || options.bounds === "ticks" || count === 1) {
      addTick(ticks, time, timestamps);
    }
    return Object.keys(ticks).sort(sorter).map((x6) => +x6);
  }
  getLabelForValue(value) {
    const adapter = this._adapter;
    const timeOpts = this.options.time;
    if (timeOpts.tooltipFormat) {
      return adapter.format(value, timeOpts.tooltipFormat);
    }
    return adapter.format(value, timeOpts.displayFormats.datetime);
  }
  format(value, format3) {
    const options = this.options;
    const formats = options.time.displayFormats;
    const unit = this._unit;
    const fmt = format3 || formats[unit];
    return this._adapter.format(value, fmt);
  }
  _tickFormatFunction(time, index2, ticks, format3) {
    const options = this.options;
    const formatter = options.ticks.callback;
    if (formatter) {
      return callback(formatter, [
        time,
        index2,
        ticks
      ], this);
    }
    const formats = options.time.displayFormats;
    const unit = this._unit;
    const majorUnit = this._majorUnit;
    const minorFormat = unit && formats[unit];
    const majorFormat = majorUnit && formats[majorUnit];
    const tick = ticks[index2];
    const major = majorUnit && majorFormat && tick && tick.major;
    return this._adapter.format(time, format3 || (major ? majorFormat : minorFormat));
  }
  generateTickLabels(ticks) {
    let i5, ilen, tick;
    for (i5 = 0, ilen = ticks.length; i5 < ilen; ++i5) {
      tick = ticks[i5];
      tick.label = this._tickFormatFunction(tick.value, i5, ticks);
    }
  }
  getDecimalForValue(value) {
    return value === null ? NaN : (value - this.min) / (this.max - this.min);
  }
  getPixelForValue(value) {
    const offsets = this._offsets;
    const pos = this.getDecimalForValue(value);
    return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);
  }
  getValueForPixel(pixel) {
    const offsets = this._offsets;
    const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
    return this.min + pos * (this.max - this.min);
  }
  _getLabelSize(label) {
    const ticksOpts = this.options.ticks;
    const tickLabelWidth = this.ctx.measureText(label).width;
    const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);
    const cosRotation = Math.cos(angle);
    const sinRotation = Math.sin(angle);
    const tickFontSize = this._resolveTickFontOptions(0).size;
    return {
      w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,
      h: tickLabelWidth * sinRotation + tickFontSize * cosRotation
    };
  }
  _getLabelCapacity(exampleTime) {
    const timeOpts = this.options.time;
    const displayFormats = timeOpts.displayFormats;
    const format3 = displayFormats[timeOpts.unit] || displayFormats.millisecond;
    const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [
      exampleTime
    ], this._majorUnit), format3);
    const size = this._getLabelSize(exampleLabel);
    const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;
    return capacity > 0 ? capacity : 1;
  }
  getDataTimestamps() {
    let timestamps = this._cache.data || [];
    let i5, ilen;
    if (timestamps.length) {
      return timestamps;
    }
    const metas = this.getMatchingVisibleMetas();
    if (this._normalized && metas.length) {
      return this._cache.data = metas[0].controller.getAllParsedValues(this);
    }
    for (i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
      timestamps = timestamps.concat(metas[i5].controller.getAllParsedValues(this));
    }
    return this._cache.data = this.normalize(timestamps);
  }
  getLabelTimestamps() {
    const timestamps = this._cache.labels || [];
    let i5, ilen;
    if (timestamps.length) {
      return timestamps;
    }
    const labels = this.getLabels();
    for (i5 = 0, ilen = labels.length; i5 < ilen; ++i5) {
      timestamps.push(parse2(this, labels[i5]));
    }
    return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);
  }
  normalize(values) {
    return _arrayUnique(values.sort(sorter));
  }
};
__publicField(TimeScale, "id", "time");
__publicField(TimeScale, "defaults", {
  bounds: "data",
  adapters: {},
  time: {
    parser: false,
    unit: false,
    round: false,
    isoWeekday: false,
    minUnit: "millisecond",
    displayFormats: {}
  },
  ticks: {
    source: "auto",
    callback: false,
    major: {
      enabled: false
    }
  }
});
function interpolate2(table2, val, reverse) {
  let lo = 0;
  let hi = table2.length - 1;
  let prevSource, nextSource, prevTarget, nextTarget;
  if (reverse) {
    if (val >= table2[lo].pos && val <= table2[hi].pos) {
      ({ lo, hi } = _lookupByKey(table2, "pos", val));
    }
    ({ pos: prevSource, time: prevTarget } = table2[lo]);
    ({ pos: nextSource, time: nextTarget } = table2[hi]);
  } else {
    if (val >= table2[lo].time && val <= table2[hi].time) {
      ({ lo, hi } = _lookupByKey(table2, "time", val));
    }
    ({ time: prevSource, pos: prevTarget } = table2[lo]);
    ({ time: nextSource, pos: nextTarget } = table2[hi]);
  }
  const span = nextSource - prevSource;
  return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;
}
var TimeSeriesScale = class extends TimeScale {
  constructor(props) {
    super(props);
    this._table = [];
    this._minPos = void 0;
    this._tableRange = void 0;
  }
  initOffsets() {
    const timestamps = this._getTimestampsForTable();
    const table2 = this._table = this.buildLookupTable(timestamps);
    this._minPos = interpolate2(table2, this.min);
    this._tableRange = interpolate2(table2, this.max) - this._minPos;
    super.initOffsets(timestamps);
  }
  buildLookupTable(timestamps) {
    const { min, max } = this;
    const items = [];
    const table2 = [];
    let i5, ilen, prev, curr, next;
    for (i5 = 0, ilen = timestamps.length; i5 < ilen; ++i5) {
      curr = timestamps[i5];
      if (curr >= min && curr <= max) {
        items.push(curr);
      }
    }
    if (items.length < 2) {
      return [
        {
          time: min,
          pos: 0
        },
        {
          time: max,
          pos: 1
        }
      ];
    }
    for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
      next = items[i5 + 1];
      prev = items[i5 - 1];
      curr = items[i5];
      if (Math.round((next + prev) / 2) !== curr) {
        table2.push({
          time: curr,
          pos: i5 / (ilen - 1)
        });
      }
    }
    return table2;
  }
  _generate() {
    const min = this.min;
    const max = this.max;
    let timestamps = super.getDataTimestamps();
    if (!timestamps.includes(min) || !timestamps.length) {
      timestamps.splice(0, 0, min);
    }
    if (!timestamps.includes(max) || timestamps.length === 1) {
      timestamps.push(max);
    }
    return timestamps.sort((a6, b5) => a6 - b5);
  }
  _getTimestampsForTable() {
    let timestamps = this._cache.all || [];
    if (timestamps.length) {
      return timestamps;
    }
    const data = this.getDataTimestamps();
    const label = this.getLabelTimestamps();
    if (data.length && label.length) {
      timestamps = this.normalize(data.concat(label));
    } else {
      timestamps = data.length ? data : label;
    }
    timestamps = this._cache.all = timestamps;
    return timestamps;
  }
  getDecimalForValue(value) {
    return (interpolate2(this._table, value) - this._minPos) / this._tableRange;
  }
  getValueForPixel(pixel) {
    const offsets = this._offsets;
    const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
    return interpolate2(this._table, decimal * this._tableRange + this._minPos, true);
  }
};
__publicField(TimeSeriesScale, "id", "timeseries");
__publicField(TimeSeriesScale, "defaults", TimeScale.defaults);

// ../../node_modules/.pnpm/chartjs-adapter-date-fns@3.0.0_chart.js@4.5.0_date-fns@2.29.3/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js
var FORMATS = {
  datetime: "MMM d, yyyy, h:mm:ss aaaa",
  millisecond: "h:mm:ss.SSS aaaa",
  second: "h:mm:ss aaaa",
  minute: "h:mm aaaa",
  hour: "ha",
  day: "MMM d",
  week: "PP",
  month: "MMM yyyy",
  quarter: "qqq - yyyy",
  year: "yyyy"
};
adapters._date.override({
  _id: "date-fns",
  // DEBUG
  formats: function() {
    return FORMATS;
  },
  parse: function(value, fmt) {
    if (value === null || typeof value === "undefined") {
      return null;
    }
    const type = typeof value;
    if (type === "number" || value instanceof Date) {
      value = toDate2(value);
    } else if (type === "string") {
      if (typeof fmt === "string") {
        value = parse(value, fmt, /* @__PURE__ */ new Date(), this.options);
      } else {
        value = parseISO(value, this.options);
      }
    }
    return isValid2(value) ? value.getTime() : null;
  },
  format: function(time, fmt) {
    return format2(time, fmt, this.options);
  },
  add: function(time, amount, unit) {
    switch (unit) {
      case "millisecond":
        return addMilliseconds2(time, amount);
      case "second":
        return addSeconds(time, amount);
      case "minute":
        return addMinutes(time, amount);
      case "hour":
        return addHours(time, amount);
      case "day":
        return addDays2(time, amount);
      case "week":
        return addWeeks(time, amount);
      case "month":
        return addMonths2(time, amount);
      case "quarter":
        return addQuarters(time, amount);
      case "year":
        return addYears(time, amount);
      default:
        return time;
    }
  },
  diff: function(max, min, unit) {
    switch (unit) {
      case "millisecond":
        return differenceInMilliseconds2(max, min);
      case "second":
        return differenceInSeconds2(max, min);
      case "minute":
        return differenceInMinutes2(max, min);
      case "hour":
        return differenceInHours2(max, min);
      case "day":
        return differenceInDays2(max, min);
      case "week":
        return differenceInWeeks(max, min);
      case "month":
        return differenceInMonths2(max, min);
      case "quarter":
        return differenceInQuarters(max, min);
      case "year":
        return differenceInYears2(max, min);
      default:
        return 0;
    }
  },
  startOf: function(time, unit, weekday) {
    switch (unit) {
      case "second":
        return startOfSecond(time);
      case "minute":
        return startOfMinute(time);
      case "hour":
        return startOfHour(time);
      case "day":
        return startOfDay2(time);
      case "week":
        return startOfWeek(time);
      case "isoWeek":
        return startOfWeek(time, { weekStartsOn: +weekday });
      case "month":
        return startOfMonth(time);
      case "quarter":
        return startOfQuarter(time);
      case "year":
        return startOfYear(time);
      default:
        return time;
    }
  },
  endOf: function(time, unit) {
    switch (unit) {
      case "second":
        return endOfSecond(time);
      case "minute":
        return endOfMinute(time);
      case "hour":
        return endOfHour(time);
      case "day":
        return endOfDay2(time);
      case "week":
        return endOfWeek(time);
      case "month":
        return endOfMonth2(time);
      case "quarter":
        return endOfQuarter(time);
      case "year":
        return endOfYear(time);
      default:
        return time;
    }
  }
});

// src/paths/instance/statistics/list/OrdersChart.tsx
init_preact_module();
init_hooks_module();

// src/hooks/statistics.ts
init_hooks_module();
var useSWR13 = useSWR;
var MERCHANT_ORDER_STATS_SLUG = [
  "orders-created",
  "orders-claimed",
  "orders-paid",
  "orders-settled"
];
var MERCHANT_REVENUE_STATS_SLUG = [
  "payments-received-after-deposit-fee",
  "total-wire-fees-paid",
  "refunds-granted",
  "total-deposit-fees-paid"
];
function useInstanceStatisticsCounter() {
  const { state, lib } = useSessionContext();
  const [offset] = p3();
  async function fetcher([token]) {
    const resp = await Promise.all(
      MERCHANT_ORDER_STATS_SLUG.map((r3) => {
        return lib.instance.getStatisticsCounter(token, r3);
      })
    );
    for (const r3 of resp) {
      if (r3.type === "fail") {
        return r3;
      }
    }
    const result = /* @__PURE__ */ new Map();
    MERCHANT_ORDER_STATS_SLUG.forEach((r3, idx) => {
      if (resp[idx].type === "ok") {
        result.set(r3, resp[idx].body);
      }
    });
    return opFixedSuccess(result);
  }
  const { data, error: error2 } = useSWR13([state.token, "ANY"], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}
function useInstanceStatisticsAmount() {
  const { state, lib } = useSessionContext();
  const [offset] = p3();
  async function fetcher([token]) {
    const resp = await Promise.all(
      MERCHANT_REVENUE_STATS_SLUG.map((r3) => {
        return lib.instance.getStatisticsAmount(token, r3);
      })
    );
    for (const r3 of resp) {
      if (r3.type === "fail") {
        return r3;
      }
    }
    const result = /* @__PURE__ */ new Map();
    MERCHANT_REVENUE_STATS_SLUG.forEach((r3, idx) => {
      if (resp[idx].type === "ok") {
        result.set(r3, resp[idx].body);
      }
    });
    return opFixedSuccess(result);
  }
  const { data, error: error2 } = useSWR13([state.token, void 0], fetcher);
  if (error2)
    return error2;
  if (data === void 0)
    return void 0;
  if (data.type !== "ok")
    return data;
  return data;
}

// src/components/ChartJS.tsx
init_preact_module();
init_hooks_module();
Chart.register(
  CategoryScale,
  LinearScale,
  TimeScale,
  LineElement,
  PointElement,
  BarElement,
  BarController,
  LineController,
  plugin_title,
  index,
  plugin_tooltip,
  plugin_legend
);
function BarCanvas({
  data,
  options
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const canvasRef = _2(null);
  const chartRef = _2(null);
  h2(() => {
    if (!canvasRef.current)
      return;
    chartRef.current = new Chart(canvasRef.current, {
      type: "bar",
      data,
      options
    });
    return () => {
      if (chartRef.current) {
        chartRef.current.destroy();
      }
    };
  }, []);
  h2(() => {
    if (!chartRef.current) {
      return;
    }
    chartRef.current.data = data;
    chartRef.current.options = options;
    chartRef.current.update();
  }, [data, options]);
  return /* @__PURE__ */ h("canvas", { ref: canvasRef, role: "img" }, /* @__PURE__ */ h(i18n2.Translate, null, "Your browser does not support the canvas element."));
}
function LineCanvas({
  data,
  options
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const canvasRef = _2(null);
  const chartRef = _2(null);
  h2(() => {
    if (!canvasRef.current)
      return;
    chartRef.current = new Chart(canvasRef.current, {
      type: "line",
      data,
      options,
      plugins: []
    });
    return () => {
      if (chartRef.current) {
        chartRef.current.destroy();
      }
    };
  }, []);
  return /* @__PURE__ */ h("canvas", { ref: canvasRef, role: "img" }, /* @__PURE__ */ h(i18n2.Translate, null, "Your browser does not support the canvas element."));
}

// src/paths/instance/statistics/list/OrdersChart.tsx
function getCountForLabelAndDataset(label, ds) {
  for (let d6 of ds.data) {
    if (d6.x === label) {
      return d6.y;
    }
  }
  return 0;
}
function OrdersChart({
  colors: colors2,
  filterFromDate,
  onSelectDate
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [settings] = usePreference();
  const [pickDate, setPickDate] = p3(false);
  const [showTable, setShowTable] = p3(false);
  const counters = useInstanceStatisticsCounter();
  if (!counters) {
    return /* @__PURE__ */ h(Loading, null);
  }
  if (counters instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: counters });
  }
  if (counters.type === "fail") {
    switch (counters.case) {
      case HttpStatusCode.Unauthorized:
        return /* @__PURE__ */ h(LoginPage, null);
      case HttpStatusCode.NotFound:
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      case HttpStatusCode.BadGateway:
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              message: i18n2.str`Bad gateway`,
              type: "ERROR"
            }
          }
        );
      case HttpStatusCode.ServiceUnavailable:
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              message: i18n2.str`Service unavailable`,
              type: "ERROR"
            }
          }
        );
    }
  }
  const chart = filterOrderCharData(colors2, counters.body, filterFromDate);
  const dateTooltip = i18n2.str`Select date from which to show statistics`;
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "tabs", style: { overflow: "inherit" } }, /* @__PURE__ */ h("ul", null, /* @__PURE__ */ h("li", { class: !showTable ? "is-active" : "" }, /* @__PURE__ */ h("div", { class: "has-tooltip-right", "data-tooltip": i18n2.str`Show chart` }, /* @__PURE__ */ h(
    "a",
    {
      onClick: () => {
        setShowTable(false);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Orders chart")
  ))), /* @__PURE__ */ h("li", { class: showTable ? "is-active" : "" }, /* @__PURE__ */ h("div", { class: "has-tooltip-right", "data-tooltip": i18n2.str`Show table` }, /* @__PURE__ */ h(
    "a",
    {
      onClick: () => {
        setShowTable(true);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Orders table")
  ))))), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h("div", { class: "field has-addons" }, filterFromDate && /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h(
    "a",
    {
      class: "button is-fullwidth",
      onClick: () => onSelectDate(void 0)
    },
    /* @__PURE__ */ h(
      "span",
      {
        class: "icon",
        "data-tooltip": i18n2.str`Clear date filter`
      },
      /* @__PURE__ */ h("i", { class: "mdi mdi-close" })
    )
  )), /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("span", { class: "has-tooltip-top", "data-tooltip": dateTooltip }, /* @__PURE__ */ h(
    "input",
    {
      class: "input",
      type: "text",
      readonly: true,
      value: !filterFromDate || filterFromDate.t_ms === "never" ? "" : format2(
        filterFromDate.t_ms,
        dateFormatForSettings(settings)
      ),
      placeholder: i18n2.str`Start from (${dateFormatForSettings(
        settings
      )})`,
      onClick: () => {
        setPickDate(true);
      }
    }
  ))), /* @__PURE__ */ h("div", { class: "control" }, /* @__PURE__ */ h("span", { class: "has-tooltip-left", "data-tooltip": dateTooltip }, /* @__PURE__ */ h(
    "a",
    {
      class: "button  is-fullwidth",
      onClick: () => {
        setPickDate(true);
      }
    },
    /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-calendar" }))
  ))))))), /* @__PURE__ */ h(
    DatePicker,
    {
      opened: pickDate,
      closeFunction: () => setPickDate(false),
      dateReceiver: (d6) => {
        onSelectDate(AbsoluteTime.fromMilliseconds(d6.getTime()));
      }
    }
  ), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-shopping" })), i18n2.str`Orders statistics`)), /* @__PURE__ */ h("div", { class: "card-content" }, chart.datasets.length > 0 && chart.labels.length > 0 ? !showTable ? /* @__PURE__ */ h(
    LineCanvas,
    {
      data: chart,
      options: orderStatsChartOptions(i18n2, chart.smallestOrderDate)
    }
  ) : /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Since")), chart.datasets.map((d6) => {
    return /* @__PURE__ */ h(p2, { key: d6.label }, /* @__PURE__ */ h("th", null, d6.label));
  }))), /* @__PURE__ */ h("tbody", null, chart.labels.map((l3) => {
    return /* @__PURE__ */ h(p2, { key: l3 }, /* @__PURE__ */ h("tr", { key: "info" }, /* @__PURE__ */ h("td", null, new Date(l3).toLocaleString()), chart.datasets.map((d6) => {
      return /* @__PURE__ */ h(p2, { key: d6.label }, /* @__PURE__ */ h("td", null, getCountForLabelAndDataset(l3, d6)));
    })));
  })))))) : /* @__PURE__ */ h("i", null, i18n2.str`No order statistics yet.`))));
}
function orderStatsChartOptions(i18n2, startOrdersFromDate) {
  return {
    plugins: {
      title: {
        display: true,
        text: i18n2.str`Orders`
      },
      filler: {
        propagate: true
      }
    },
    responsive: true,
    scales: {
      x: {
        min: startOrdersFromDate,
        type: "time",
        time: { unit: "day", displayFormats: { day: "Pp" } },
        ticks: { source: "data" },
        stacked: true,
        title: { display: false }
      },
      y: {
        stacked: true,
        title: {
          display: true,
          text: i18n2.str`# of orders since`,
          align: "end"
        }
      }
    }
  };
}
function filterOrderCharData(colors2, ordersStats, startOrdersFromDate) {
  let smallestOrderDate;
  const labels = [];
  const datasets = [];
  ordersStats.forEach((stat, slug) => {
    const datasetColor = colors2.get(slug) ?? "#eeeeee";
    const info = {
      label: stat.intervals_description,
      data: [],
      backgroundColor: datasetColor,
      // hoverOffset: 4,
      fill: {
        target: "-1",
        below: datasetColor
      }
    };
    let accum = 0;
    for (let j4 = stat.intervals.length - 1; j4 >= 0; j4--) {
      const interval = stat.intervals[j4];
      if (interval.start_time.t_s == "never") {
        continue;
      }
      accum += interval.cumulative_counter;
      info.data.push({ x: interval.start_time.t_s * 1e3, y: accum });
      const intervalStart = interval.start_time.t_s * 1e3;
      if (startOrdersFromDate && "never" !== startOrdersFromDate.t_ms && intervalStart < startOrdersFromDate.t_ms) {
        continue;
      }
      if (-1 === labels.indexOf(intervalStart)) {
        labels.push(intervalStart);
      }
      if (!smallestOrderDate) {
        smallestOrderDate = intervalStart;
      }
      if (smallestOrderDate > intervalStart) {
        smallestOrderDate = intervalStart;
      }
    }
    if (info.data.length) {
      datasets.push(info);
    }
  });
  if (datasets.length && typeof datasets[0].fill === "object" && "target" in datasets[0].fill) {
    datasets[0].fill = "origin";
  }
  return { datasets, labels, smallestOrderDate };
}

// src/paths/instance/statistics/list/RevenueChart.tsx
init_preact_module();
init_hooks_module();
function RevenueChart({
  colors: colors2,
  onUpdateFilter,
  availableCurrencies,
  activeFilter
}) {
  const { i18n: i18n2 } = useTranslationContext();
  const [showTable, setShowTable] = p3(false);
  const translateMap = /* @__PURE__ */ new Map([
    ["hour", [i18n2.str`hour`, i18n2.str`hours`]],
    ["day", [i18n2.str`day`, i18n2.str`days`]],
    ["week", [i18n2.str`week`, i18n2.str`weeks`]],
    ["month", [i18n2.str`month`, i18n2.str`months`]],
    ["quarter", [i18n2.str`quarter`, i18n2.str`quarters`]],
    ["year", [i18n2.str`years`, i18n2.str`years`]]
  ]);
  function translateRange(range) {
    if (!translateMap.has(range.range)) {
      return "";
    }
    return range.rangeCount < 2 ? translateMap.get(range.range)[0] : translateMap.get(range.range)[1];
  }
  const revenues = useInstanceStatisticsAmount();
  if (!revenues) {
    return /* @__PURE__ */ h(Loading, null);
  }
  if (revenues instanceof TalerError) {
    return /* @__PURE__ */ h(ErrorLoadingMerchant, { error: revenues });
  }
  if (revenues.type === "fail") {
    switch (revenues.case) {
      case HttpStatusCode.Unauthorized:
        return /* @__PURE__ */ h(LoginPage, null);
      case HttpStatusCode.NotFound:
        return /* @__PURE__ */ h(NotFoundPageOrAdminCreate, null);
      case HttpStatusCode.BadGateway:
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              message: i18n2.str`Bad gateway`,
              type: "ERROR"
            }
          }
        );
      case HttpStatusCode.ServiceUnavailable:
        return /* @__PURE__ */ h(
          NotificationCard,
          {
            notification: {
              message: i18n2.str`Service unavailable`,
              type: "ERROR"
            }
          }
        );
    }
  }
  const chart = filterRevenueCharData(colors2, revenues.body, activeFilter);
  const form = activeFilter;
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h("div", { class: "tabs", style: { overflow: "inherit" } }, /* @__PURE__ */ h("ul", null, /* @__PURE__ */ h("li", { class: !showTable ? "is-active" : "" }, /* @__PURE__ */ h("div", { class: "has-tooltip-right", "data-tooltip": i18n2.str`Show chart` }, /* @__PURE__ */ h(
    "a",
    {
      onClick: () => {
        setShowTable(false);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Revenue chart")
  ))), /* @__PURE__ */ h("li", { class: showTable ? "is-active" : "" }, /* @__PURE__ */ h("div", { class: "has-tooltip-right", "data-tooltip": i18n2.str`Show table` }, /* @__PURE__ */ h(
    "a",
    {
      onClick: () => {
        setShowTable(true);
      }
    },
    /* @__PURE__ */ h(i18n2.Translate, null, "Revenue table")
  ))))), /* @__PURE__ */ h("div", { class: "columns" }, /* @__PURE__ */ h("div", { class: "column" }, /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
    FormProvider,
    {
      object: form,
      valueHandler: (updater) => onUpdateFilter({
        rangeCount: updater(form).rangeCount ?? activeFilter.rangeCount,
        range: updater(form).range ?? activeFilter.range,
        currency: updater(form).currency ?? activeFilter.currency
      })
    },
    /* @__PURE__ */ h(
      InputGroup,
      {
        name: "rangeFilter",
        label: i18n2.str`Revenue statistics filter`
      },
      /* @__PURE__ */ h(
        InputSelector,
        {
          name: "range",
          label: i18n2.str`Time range`,
          values: revenueRanges,
          fromStr: (d6) => {
            const idx = revenueRanges.indexOf(
              d6
            );
            if (idx === -1)
              return void 0;
            return d6;
          },
          tooltip: i18n2.str`Select time range to group dataset by`
        }
      ),
      /* @__PURE__ */ h(
        InputNumber2,
        {
          name: "rangeCount",
          label: translateMap.get(activeFilter.range)[0],
          tooltip: i18n2.str`Select the number of ranges to include in data set`
        }
      ),
      /* @__PURE__ */ h(
        InputSelector,
        {
          name: "currency",
          label: i18n2.str`Currency`,
          values: availableCurrencies,
          fromStr: (c5) => {
            const idx = availableCurrencies.indexOf(c5);
            if (idx === -1)
              return void 0;
            return c5;
          },
          tooltip: i18n2.str`Select the currency to show statistics for`
        }
      )
    )
  )))), /* @__PURE__ */ h("div", { class: "card has-table" }, /* @__PURE__ */ h("header", { class: "card-header" }, /* @__PURE__ */ h("p", { class: "card-header-title" }, /* @__PURE__ */ h("span", { class: "icon" }, /* @__PURE__ */ h("i", { class: "mdi mdi-shopping" })), i18n2.str`Revenue statistics over the past ${activeFilter.rangeCount} ${translateRange(activeFilter)} for currency '${activeFilter.currency}'`)), /* @__PURE__ */ h("div", { class: "card-content" }, chart.datasets.length > 0 && chart.labels.length > 0 ? !showTable ? /* @__PURE__ */ h(
    BarCanvas,
    {
      data: chart,
      options: revenueChartOptions(i18n2, activeFilter)
    }
  ) : /* @__PURE__ */ h("div", { class: "b-table has-pagination" }, /* @__PURE__ */ h("div", { class: "table-wrapper has-mobile-cards" }, /* @__PURE__ */ h("div", { class: "table-container" }, /* @__PURE__ */ h("table", { class: "table is-fullwidth is-striped is-hoverable is-fullwidth" }, /* @__PURE__ */ h("thead", null, /* @__PURE__ */ h("tr", null, /* @__PURE__ */ h("th", null, /* @__PURE__ */ h(i18n2.Translate, null, "Start time")), chart.datasets.map((d6) => {
    return /* @__PURE__ */ h(p2, { key: d6.label }, /* @__PURE__ */ h("th", null, d6.label));
  }))), /* @__PURE__ */ h("tbody", null, chart.labels.map((l3) => {
    return /* @__PURE__ */ h(p2, { key: l3 }, /* @__PURE__ */ h("tr", { key: "info" }, /* @__PURE__ */ h("td", null, format2(
      new Date(l3),
      formatMap.get(activeFilter.range)
    )), chart.datasets.map((d6) => {
      return /* @__PURE__ */ h(p2, { key: d6.label }, /* @__PURE__ */ h("td", null, getRevenueForLabelAndDataset(l3, d6)));
    })));
  })))))) : /* @__PURE__ */ h("i", null, i18n2.str`No revenue statistics yet.`))));
}
var revenueRanges = Object.values(StatisticBucketRange);
var formatMap = /* @__PURE__ */ new Map([
  ["hour", "yyyy MMMM d ha"],
  ["day", "yyyy MMM d"],
  ["week", "yyyy MMM w"],
  ["month", "yyyy MMM"],
  ["quarter", "yyyy qqq"],
  ["year", "yyyy"]
]);
function getRevenueForLabelAndDataset(label, ds) {
  for (let d6 of ds.data) {
    if (d6.x === label) {
      return Amounts.toPretty(d6);
    }
  }
  return "-";
}
function revenueChartOptions(i18n2, filter) {
  return {
    plugins: {
      title: {
        display: true,
        text: i18n2.str`Revenue`
      }
    },
    responsive: true,
    scales: {
      x: {
        type: "time",
        time: { unit: filter.range },
        ticks: { source: "labels" },
        stacked: true,
        title: { display: true, text: i18n2.str`Time range`, align: "end" }
      },
      y: {
        stacked: true,
        title: { display: true, text: filter.currency, align: "end" }
      }
    }
  };
}
function filterRevenueCharData(colors2, revenueStats, filter) {
  const datasets = [];
  const labels = [];
  revenueStats.forEach((stat, slug) => {
    const datasetColor = colors2.get(slug ?? "") ?? "#eeeeee";
    const info = {
      label: stat.buckets_description,
      data: [],
      backgroundColor: datasetColor
    };
    for (let b5 of stat.buckets) {
      if (b5.start_time.t_s == "never") {
        continue;
      }
      for (let c5 of b5.cumulative_amounts) {
        const a6 = Amounts.parse(c5);
        if (!a6) {
          continue;
        }
        if (filter.range !== b5.range) {
          continue;
        }
        const amount = a6.value + a6.fraction / Math.pow(10, 8);
        const timeRangeStart = b5.start_time.t_s * 1e3;
        info.data.push({ x: timeRangeStart, y: amount, ...a6 });
        if (filter.rangeCount < info.data.length) {
          info.data.shift();
          labels.shift();
        }
        if (labels.indexOf(timeRangeStart) === -1) {
          labels.push(timeRangeStart);
        }
      }
    }
    if (info.data.length) {
      datasets.push(info);
    }
  });
  return { datasets, labels };
}

// src/paths/instance/statistics/list/index.tsx
var chartColors = /* @__PURE__ */ new Map();
chartColors.set("orders-created", "#b9a5ff");
chartColors.set("payments-received-after-deposit-fee", "#b9a5ff");
chartColors.set("orders-claimed", "#647cda");
chartColors.set("total-wire-fees-paid", "#647cda");
chartColors.set("total-deposit-fees-paid", "#2830a8");
chartColors.set("orders-settled", "#2830a8");
chartColors.set("orders-paid", "#525597");
chartColors.set("refunds-granted", "#525597");
function Statistics({}) {
  const { config } = useSessionContext();
  const lastMonthAbs = AbsoluteTime.subtractDuraction(
    AbsoluteTime.now(),
    Duration.fromSpec({ months: 1 })
  );
  const [revenueChartFilter, setRevenueChartFilter] = p3({
    range: StatisticBucketRange.Quarter,
    rangeCount: 4,
    currency: config.currency
  });
  const [startOrdersFromDate, setStartOrdersFromDate] = p3(lastMonthAbs);
  const availableCurrencies = Object.keys(config.currencies);
  return /* @__PURE__ */ h("section", { class: "section is-main-section" }, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h(
    RevenueChart,
    {
      colors: chartColors,
      activeFilter: revenueChartFilter,
      availableCurrencies,
      onUpdateFilter: (filter) => setRevenueChartFilter(filter)
    }
  )), /* @__PURE__ */ h("hr", null), /* @__PURE__ */ h(
    OrdersChart,
    {
      colors: chartColors,
      filterFromDate: startOrdersFromDate,
      onSelectDate: (d6) => {
        setStartOrdersFromDate(d6);
      }
    }
  ));
}

// src/Routing.tsx
var privatePages = {
  home: urlPattern(/\/home/, () => "#/home"),
  go: urlPattern(/\/home/, () => "#/home")
};
var publicPages = {
  home: urlPattern(/\/home/, () => "#/home"),
  go: urlPattern(/\/home/, () => "#/home")
};
var history2 = createHashHistory();
function Routing(_p) {
  const { state, config } = useSessionContext();
  const { i18n: i18n2 } = useTranslationContext();
  const [globalNotification, setGlobalNotification] = p3(void 0);
  const [error2] = P2();
  const [preference] = usePreference();
  const now2 = AbsoluteTime.now();
  const instance = useInstanceBankAccounts();
  if (!instance) {
    return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(NotConnectedAppMenu, { title: i18n2.str`Welcome!` }), /* @__PURE__ */ h(Loading2, null));
  }
  const accounts = instance instanceof TalerError || instance.type === "fail" ? void 0 : instance.body;
  const shouldWarnAboutMissingBankAccounts = !state.isAdmin && accounts !== void 0 && accounts.accounts.length < 1 && (AbsoluteTime.isNever(preference.hideMissingAccountUntil) || AbsoluteTime.cmp(now2, preference.hideMissingAccountUntil) > 0);
  const unauthorized = !(instance instanceof TalerError) && instance.type === "fail" && instance.case === HttpStatusCode.Unauthorized;
  const shouldLogin = state.status === "loggedOut" || unauthorized;
  if (shouldLogin) {
    return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(NotConnectedAppMenu, { title: i18n2.str`Welcome!` }), /* @__PURE__ */ h(Router, { history: history2 }, /* @__PURE__ */ h(
      Route,
      {
        path: "/account/new" /* newAccount */,
        component: NewAccount,
        onCancel: () => route("/orders" /* order_list */),
        onCreated: () => route("/orders" /* order_list */)
      }
    ), /* @__PURE__ */ h(
      Route,
      {
        path: "/account/reset/:id" /* resetAccount */,
        component: ResetAccount,
        onCancel: () => route("/orders" /* order_list */),
        onReseted: () => route("/orders" /* order_list */)
      }
    ), /* @__PURE__ */ h(
      Route,
      {
        default: true,
        component: () => /* @__PURE__ */ h(LoginPage, { showCreateAccount: config.have_self_provisioning })
      }
    )));
  }
  if (shouldWarnAboutMissingBankAccounts) {
    return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(Menu, null), /* @__PURE__ */ h(Router, { history: history2 }, /* @__PURE__ */ h(Route, { path: "/interface" /* interface */, component: Settings }), /* @__PURE__ */ h(
      Route,
      {
        default: true,
        component: () => {
          return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(BankAccountBanner, null), /* @__PURE__ */ h(
            CreateValidator,
            {
              onConfirm: () => {
                route("/bank" /* bank_list */);
              }
            }
          ));
        }
      }
    )));
  }
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(Menu, null), /* @__PURE__ */ h(KycBanner, null), /* @__PURE__ */ h(NotificationCard, { notification: globalNotification }), error2 && /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        message: "Internal error.",
        type: "ERROR",
        description: /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(i18n2.Translate, null, "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at", " ", /* @__PURE__ */ h(
          "a",
          {
            href: "https://bugs.gnunet.org/",
            target: "_blank",
            referrerpolicy: "no-referrer"
          },
          "https://bugs.gnunet.org/"
        )), /* @__PURE__ */ h("pre", null, error2 instanceof Error ? error2.stack : String(error2)))
      }
    }
  )), /* @__PURE__ */ h(
    Router,
    {
      history: history2,
      onChange: (e5) => {
        const movingOutFromNotification = globalNotification && e5.url !== globalNotification.to;
        if (movingOutFromNotification) {
          setGlobalNotification(void 0);
        }
      }
    },
    /* @__PURE__ */ h(Route, { path: "/", component: Redirect, to: "/orders" /* order_list */ }),
    state.isAdmin && /* @__PURE__ */ h(
      Route,
      {
        path: "/instances" /* list_instances */,
        component: Instances,
        onChangePassword: (id) => {
          route(`/instance/${id}/token`);
        },
        onCreate: () => {
          route("/instance/new" /* new_instance */);
        },
        onUpdate: (id) => {
          route(`/instance/${id}/update`);
        }
      }
    ),
    state.isAdmin && /* @__PURE__ */ h(
      Route,
      {
        path: "/instance/new" /* new_instance */,
        component: Create,
        onBack: () => route("/instances" /* list_instances */),
        onConfirm: () => {
          route("/instances" /* list_instances */);
        }
      }
    ),
    state.isAdmin && /* @__PURE__ */ h(
      Route,
      {
        path: "/instance/:id/update" /* update_instance */,
        component: AdminInstanceUpdatePage,
        onBack: () => route("/instances" /* list_instances */),
        onConfirm: () => {
          route("/instances" /* list_instances */);
        }
      }
    ),
    state.isAdmin && /* @__PURE__ */ h(
      Route,
      {
        path: "/instance/:id/token" /* update_instance_auth */,
        component: AdminInstanceUpdateTokenPage,
        onCancel: () => route("/instances" /* list_instances */),
        onChange: () => {
          route("/instances" /* list_instances */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/settings" /* settings */,
        component: Update2,
        onBack: () => {
          route(`/`);
        },
        onConfirm: () => {
          route(`/`);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/password" /* password */,
        component: PasswordPage,
        onChange: () => {
          route(`/`);
        },
        onCancel: () => {
          route("/orders" /* order_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/category" /* category_list */,
        component: ListCategories,
        onCreate: () => {
          route("/category/new" /* category_new */);
        },
        onSelect: (id) => {
          route("/category/:cid/update" /* category_update */.replace(":cid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/category/:cid/update" /* category_update */,
        component: UpdateCategory,
        onConfirm: () => {
          route("/category" /* category_list */);
        },
        onBack: () => {
          route("/category" /* category_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/category/new" /* category_new */,
        component: CreateCategory,
        onConfirm: () => {
          route("/category" /* category_list */);
        },
        onBack: () => {
          route("/category" /* category_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/inventory" /* inventory_list */,
        component: ProductList2,
        onCreate: () => {
          route("/inventory/new" /* inventory_new */);
        },
        onSelect: (id) => {
          route("/inventory/:pid/update" /* inventory_update */.replace(":pid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/inventory/:pid/update" /* inventory_update */,
        component: UpdateProduct,
        onConfirm: () => {
          route("/inventory" /* inventory_list */);
        },
        onBack: () => {
          route("/inventory" /* inventory_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/inventory/new" /* inventory_new */,
        component: CreateProduct,
        onConfirm: () => {
          route("/inventory" /* inventory_list */);
        },
        onBack: () => {
          route("/inventory" /* inventory_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/bank" /* bank_list */,
        component: ListOtpDevices,
        onCreate: () => {
          route("/bank/new" /* bank_new */);
        },
        onSelect: (id) => {
          route("/bank/:bid/update" /* bank_update */.replace(":bid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/bank/:bid/update" /* bank_update */,
        component: UpdateValidator,
        onConfirm: () => {
          route("/bank" /* bank_list */);
        },
        onBack: () => {
          route("/bank" /* bank_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/bank/new" /* bank_new */,
        component: CreateValidator,
        onConfirm: () => {
          route("/bank" /* bank_list */);
        },
        onBack: () => {
          route("/bank" /* bank_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/access-token" /* access_token_list */,
        component: AccessTokenListPage,
        onCreate: () => {
          route("/access-token/new" /* access_token_new */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/access-token/new" /* access_token_new */,
        component: AccessTokenCreatePage,
        onConfirm: () => {
          route("/access-token" /* access_token_list */);
        },
        onBack: () => {
          route("/access-token" /* access_token_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/orders" /* order_list */,
        component: OrderList,
        section: "new" /* NEW */,
        onCreate: () => {
          route("/order/new" /* order_new */);
        },
        onSelect: (id) => {
          route("/order/:oid/details" /* order_details */.replace(":oid", id));
        },
        onChangeSection: (s6) => {
          if (!s6) {
            route("/orders" /* order_list */);
          } else {
            route("/orders/:section" /* order_list_section */.replace(":section", s6));
          }
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/orders/:section" /* order_list_section */,
        component: OrderList,
        onCreate: () => {
          route("/order/new" /* order_new */);
        },
        onSelect: (id) => {
          route("/order/:oid/details" /* order_details */.replace(":oid", id));
        },
        onChangeSection: (s6) => {
          if (!s6) {
            route("/orders" /* order_list */);
          } else {
            route("/orders/:section" /* order_list_section */.replace(":section", s6));
          }
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/order/:oid/details" /* order_details */,
        component: Update,
        onBack: () => {
          route("/orders" /* order_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/order/new" /* order_new */,
        component: OrderCreate,
        onConfirm: (orderId) => {
          route("/order/:oid/details" /* order_details */.replace(":oid", orderId));
        },
        onBack: () => {
          route("/orders" /* order_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/transfers" /* transfers_list */,
        component: ListTransfer
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/tokenfamilies" /* token_family_list */,
        component: TokenFamilyList,
        onCreate: () => {
          route("/tokenfamilies/new" /* token_family_new */);
        },
        onSelect: (slug) => {
          route("/tokenfamilies/:slug/update" /* token_family_update */.replace(":slug", slug));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/tokenfamilies/:slug/update" /* token_family_update */,
        component: UpdateTokenFamily,
        onConfirm: () => {
          route("/tokenfamilies" /* token_family_list */);
        },
        onBack: () => {
          route("/tokenfamilies" /* token_family_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/tokenfamilies/new" /* token_family_new */,
        component: CreateTokenFamily,
        onConfirm: () => {
          route("/tokenfamilies" /* token_family_list */);
        },
        onBack: () => {
          route("/tokenfamilies" /* token_family_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/webhooks" /* webhooks_list */,
        component: ListWebhooks,
        onCreate: () => {
          route("/webhooks/new" /* webhooks_new */);
        },
        onSelect: (id) => {
          route("/webhooks/:tid/update" /* webhooks_update */.replace(":tid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/webhooks/:tid/update" /* webhooks_update */,
        component: UpdateWebhook,
        onConfirm: () => {
          route("/webhooks" /* webhooks_list */);
        },
        onBack: () => {
          route("/webhooks" /* webhooks_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/webhooks/new" /* webhooks_new */,
        component: CreateWebhook,
        onConfirm: () => {
          route("/webhooks" /* webhooks_list */);
        },
        onBack: () => {
          route("/webhooks" /* webhooks_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/otp-devices" /* otp_devices_list */,
        component: ListOtpDevices2,
        onCreate: () => {
          route("/otp-devices/new" /* otp_devices_new */);
        },
        onSelect: (id) => {
          route("/otp-devices/:vid/update" /* otp_devices_update */.replace(":vid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/otp-devices/:vid/update" /* otp_devices_update */,
        component: UpdateValidator2,
        onConfirm: () => {
          route("/otp-devices" /* otp_devices_list */);
        },
        onBack: () => {
          route("/otp-devices" /* otp_devices_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/otp-devices/new" /* otp_devices_new */,
        component: CreateValidator2,
        onConfirm: () => {
          route("/otp-devices" /* otp_devices_list */);
        },
        onBack: () => {
          route("/otp-devices" /* otp_devices_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/templates" /* templates_list */,
        component: ListTemplates,
        onCreate: () => {
          route("/templates/new" /* templates_new */);
        },
        onNewOrder: (id) => {
          route("/templates/:tid/use" /* templates_use */.replace(":tid", id));
        },
        onQR: (id) => {
          route("/templates/:tid/qr" /* templates_qr */.replace(":tid", id));
        },
        onSelect: (id) => {
          route("/templates/:tid/update" /* templates_update */.replace(":tid", id));
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/templates/:tid/update" /* templates_update */,
        component: UpdateTemplate,
        onConfirm: () => {
          route("/templates" /* templates_list */);
        },
        onBack: () => {
          route("/templates" /* templates_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/templates/new" /* templates_new */,
        component: CreateTemplate,
        onConfirm: () => {
          route("/templates" /* templates_list */);
        },
        onBack: () => {
          route("/templates" /* templates_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/templates/:tid/use" /* templates_use */,
        component: TemplateUsePage,
        onOrderCreated: (id) => {
          route("/order/:oid/details" /* order_details */.replace(":oid", id));
        },
        onBack: () => {
          route("/templates" /* templates_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/templates/:tid/qr" /* templates_qr */,
        component: TemplateQrPage,
        onBack: () => {
          route("/templates" /* templates_list */);
        }
      }
    ),
    /* @__PURE__ */ h(
      Route,
      {
        path: "/kyc" /* kyc */,
        component: ListKYC
      }
    ),
    /* @__PURE__ */ h(Route, { path: "/interface" /* interface */, component: Settings }),
    /* @__PURE__ */ h(Route, { path: "/statistics" /* statistics */, component: Statistics }),
    /* @__PURE__ */ h(Route, { path: "/loading", component: Loading2 }),
    /* @__PURE__ */ h(Route, { default: true, component: Redirect, to: "/orders" /* order_list */ })
  ));
}
function Redirect({ to: to2 }) {
  h2(() => {
    route(to2, true);
  });
  return null;
}
function AdminInstanceUpdatePage({
  id,
  ...rest
}) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(AdminUpdate, { ...rest, instanceId: id }));
}
function AdminInstanceUpdateTokenPage({
  id,
  ...rest
}) {
  return /* @__PURE__ */ h(p2, null, /* @__PURE__ */ h(AdminPassword, { ...rest, instanceId: id }));
}
function BankAccountBanner() {
  const { i18n: i18n2 } = useTranslationContext();
  const [, updatePref] = usePreference();
  const now2 = AbsoluteTime.now();
  const oneDay3 = { d_ms: 1e3 * 60 * 60 * 24 };
  const tomorrow = AbsoluteTime.addDuration(now2, oneDay3);
  return /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        type: "INFO",
        message: i18n2.str`You need to associate a bank account to receive revenue.`,
        description: /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "Without this the merchant backend will refuse to create new orders.")), /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
          "button",
          {
            class: "button",
            type: "button",
            onClick: () => updatePref("hideMissingAccountUntil", tomorrow)
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Hide for today")
        )))
      }
    }
  );
}
function KycBanner() {
  const kycStatus = useInstanceKYCDetailsLongPolling();
  const { i18n: i18n2 } = useTranslationContext();
  const [prefs, updatePref] = usePreference();
  const now2 = AbsoluteTime.now();
  const needsToBeShown = kycStatus !== void 0 && !(kycStatus instanceof TalerError) && kycStatus.type === "ok" && !!kycStatus.body && kycStatus.body.kyc_data.findIndex(
    (d6) => d6.payto_kycauths !== void 0 || d6.access_token !== void 0
  ) !== -1;
  const hidden = AbsoluteTime.cmp(now2, prefs.hideKycUntil) < 1;
  if (hidden || !needsToBeShown)
    return /* @__PURE__ */ h(p2, null);
  const oneDay3 = { d_ms: 1e3 * 60 * 60 * 24 };
  const tomorrow = AbsoluteTime.addDuration(now2, oneDay3);
  return /* @__PURE__ */ h(
    NotificationCard,
    {
      notification: {
        type: "WARN",
        message: i18n2.str`KYC verification needed`,
        description: /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("p", null, /* @__PURE__ */ h(i18n2.Translate, null, "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.")), /* @__PURE__ */ h("div", { class: "buttons is-right" }, /* @__PURE__ */ h(
          "button",
          {
            class: "button",
            type: "button",
            onClick: () => updatePref("hideKycUntil", tomorrow)
          },
          /* @__PURE__ */ h(i18n2.Translate, null, "Hide for today")
        )))
      }
    }
  );
}

// src/context/settings.ts
init_preact_module();
init_hooks_module();
var initial3 = {};
var Context6 = B(initial3);
var SettingsProvider = ({
  children,
  value
}) => {
  return h(Context6.Provider, {
    value,
    children
  });
};

// src/i18n/strings.ts
var strings = {};
strings["uk"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;",
        "lang": "uk"
      },
      "Cancel": [
        "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        "\u0417\u0430\u043A\u0440\u0438\u0442\u0438"
      ],
      "Continue": [
        "\u041F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438"
      ],
      "Clear": [
        "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438"
      ],
      "Confirm": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438"
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        "\u0410\u0434\u0440\u0435\u0441\u0430"
      ],
      "Host": [
        "\u0425\u043E\u0441\u0442"
      ],
      "Account ID": [
        "\u0420\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "The account owner's legal name": [
        "\u0406\u043C'\u044F \u0432\u043B\u0430\u0441\u043D\u0438\u043A\u0430 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u0440\u0430\u0445\u0443\u043D\u043A\u0443."
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        "\u041C\u0456\u0441\u0442\u043E"
      ],
      "Bank host": [
        "\u0425\u043E\u0441\u0442 \u0431\u0430\u043D\u043A\u0443"
      ],
      "Bank account": [
        "\u0411\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        "\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0434\u0456\u0439\u0441\u043D\u043E\u0441\u0442\u0456 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u0440\u0430\u0445\u0443\u043D\u043A\u0443: %1$s"
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        "\u041F\u0440\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"
      ],
      "Receiver postal code": [
        "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438"
      ],
      "Receiver town": [
        "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438"
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        "\u041E\u043F\u0435\u0440\u0430\u0446\u0456\u044F \u0432\u0438\u043A\u043E\u043D\u0443\u0454\u0442\u044C\u0441\u044F..."
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        "\u041E\u043F\u0435\u0440\u0430\u0446\u0456\u044F \u0431\u0443\u0434\u0435 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E \u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u0430 \u0447\u0435\u0440\u0435\u0437 %1$s \u0441\u0435\u043A\u0443\u043D\u0434"
      ],
      "days": [
        "\u0434\u043D\u0456"
      ],
      "hours": [
        "\u0433\u043E\u0434\u0438\u043D\u0438"
      ],
      "minutes": [
        "\u0445\u0432\u0438\u043B\u0438\u043D\u0438"
      ],
      "seconds": [
        "\u0441\u0435\u043A\u0443\u043D\u0434\u0438"
      ],
      "Forever": [
        "\u043D\u0430\u0437\u0430\u0432\u0436\u0434\u0438"
      ],
      "%1$sM": [
        "%1$s\u041C"
      ],
      "%1$sY": [
        "%1$s\u0420"
      ],
      "%1$sd": [
        "%1$s\u0434\u043D."
      ],
      "%1$sh": [
        "%1$s\u0433"
      ],
      "%1$smin": [
        "%1$s\u0445\u0432"
      ],
      "%1$ssec": [
        "%1$s\u0441\u0435\u043A"
      ],
      "Change value to never": [
        "\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043D\u0430 \u043D\u0456\u043A\u043E\u043B\u0438"
      ],
      "Change value to empty": [
        "\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043D\u0430 \u043F\u043E\u0440\u043E\u0436\u043D\u0454"
      ],
      "Image must be smaller than 1 MB": [
        "\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043C\u0435\u043D\u0448\u0438\u043C \u0437\u0430 1 \u041C\u0411"
      ],
      "Add": [
        "\u0414\u043E\u0434\u0430\u0442\u0438"
      ],
      "Remove": [
        "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438"
      ],
      "Country": [
        "\u041A\u0440\u0430\u0457\u043D\u0430"
      ],
      "Building number": [
        "\u041D\u043E\u043C\u0435\u0440 \u0431\u0443\u0434\u0438\u043D\u043A\u0443"
      ],
      "Building name": [
        "\u041D\u0430\u0437\u0432\u0430 \u0431\u0443\u0434\u0438\u043D\u043A\u0443"
      ],
      "Street": [
        "\u0412\u0443\u043B\u0438\u0446\u044F"
      ],
      "Post code": [
        "\u041F\u043E\u0448\u0442\u043E\u0432\u0438\u0439 \u0456\u043D\u0434\u0435\u043A\u0441"
      ],
      "Town location": [
        "\u041E\u0431\u043B\u0430\u0441\u0442\u044C \u043C\u0456\u0441\u0442\u0430"
      ],
      "District": [
        "\u0420\u0430\u0439\u043E\u043D"
      ],
      "Country subdivision": [
        "\u0420\u0435\u0433\u0456\u043E\u043D \u043A\u0440\u0430\u0457\u043D\u0438"
      ],
      "Additional address lines": [
        "\u0414\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"
      ],
      "Orders": [
        "\u0417\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Templates": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u0434\u0456\u0457"
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        "\u0412\u0435\u0431\u0445\u0443\u043A\u0438"
      ],
      "Settings": [
        "\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F"
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        "\u0422\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Connection": [
        "\u0417'\u0454\u0434\u043D\u0430\u043D\u043D\u044F"
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        "\u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "New": [
        "\u041D\u043E\u0432\u0438\u0439"
      ],
      "List": [
        "\u0421\u043F\u0438\u0441\u043E\u043A"
      ],
      "Log out": [
        "\u0412\u0438\u0439\u0442\u0438"
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        "\u041D\u0430\u0437\u0432\u0430 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457 \u0432 URL. \u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044F 'default' \u0454 \u043E\u0441\u043E\u0431\u043B\u0438\u0432\u043E\u044E, \u043E\u0441\u043A\u0456\u043B\u044C\u043A\u0438 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u0430\u0434\u043C\u0456\u043D\u0456\u0441\u0442\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u0456\u043D\u0448\u0438\u0445 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0439."
      ],
      "Business name": [
        "\u041D\u0430\u0437\u0432\u0430 \u0431\u0456\u0437\u043D\u0435\u0441\u0443"
      ],
      "Legal name of the business represented by this instance.": [
        "\u042E\u0440\u0438\u0434\u0438\u0447\u043D\u0430 \u043D\u0430\u0437\u0432\u0430 \u0431\u0456\u0437\u043D\u0435\u0441\u0443, \u044F\u043A\u0438\u0439 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0454 \u0446\u044F \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044F."
      ],
      "Email": [
        "Email"
      ],
      "Contact email": [
        "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u0438\u0439 email"
      ],
      "Phone number": [
        "\u041D\u043E\u043C\u0435\u0440 \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0456\u0457."
      ],
      "Contact phone": [
        "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u0438\u0439 email"
      ],
      "Website URL": [
        "URL \u0432\u0435\u0431\u0441\u0430\u0439\u0442\u0443"
      ],
      "URL.": [
        "URL."
      ],
      "Logo": [
        "\u041B\u043E\u0433\u043E\u0442\u0438\u043F"
      ],
      "Logo image.": [
        "\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043B\u043E\u0433\u043E\u0442\u0438\u043F\u0443."
      ],
      "Physical location of the merchant.": [
        "\u0424\u0456\u0437\u0438\u0447\u043D\u0435 \u0440\u043E\u0437\u0442\u0430\u0448\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u044F."
      ],
      "Jurisdiction": [
        "\u042E\u0440\u0438\u0441\u0434\u0438\u043A\u0446\u0456\u044F"
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        "\u042E\u0440\u0438\u0441\u0434\u0438\u043A\u0446\u0456\u044F \u0434\u043B\u044F \u043F\u0440\u0430\u0432\u043E\u0432\u0438\u0445 \u0441\u043F\u043E\u0440\u0456\u0432 \u0437 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u0435\u043C."
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u043E\u043F\u043B\u0430\u0442\u0438 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        "\u0427\u0430\u0441, \u044F\u043A\u0438\u0439 \u043C\u0430\u044E\u0442\u044C \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0434\u043B\u044F \u043E\u043F\u043B\u0430\u0442\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0434\u043E \u0437\u0430\u043A\u0456\u043D\u0447\u0435\u043D\u043D\u044F \u0442\u0435\u0440\u043C\u0456\u043D\u0443 \u0434\u0456\u0457 \u043F\u0440\u043E\u043F\u043E\u0437\u0438\u0446\u0456\u0457 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C."
      ],
      "Default refund delay": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u043E\u043F\u043B\u0430\u0442\u0438 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0447\u0430\u0441, \u043D\u0430 \u044F\u043A\u0438\u0439 \u043E\u0431\u043C\u0456\u043D\u043D\u0438\u043A \u043C\u043E\u0436\u0435 \u0437\u0430\u0442\u0440\u0438\u043C\u0430\u0442\u0438 \u043F\u0435\u0440\u0435\u043A\u0430\u0437 \u043A\u043E\u0448\u0442\u0456\u0432 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u044E, \u0434\u043E\u0437\u0432\u043E\u043B\u044F\u044E\u0447\u0438 \u0439\u043E\u043C\u0443 \u043E\u0431'\u0454\u0434\u043D\u0443\u0432\u0430\u0442\u0438 \u043C\u0435\u043D\u0448\u0456 \u043F\u043B\u0430\u0442\u0435\u0436\u0456 \u0443 \u0431\u0456\u043B\u044C\u0448\u0456 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0442\u0430 \u0437\u043D\u0438\u0436\u0443\u044E\u0447\u0438 \u043A\u043E\u043C\u0456\u0441\u0456\u0457 \u0437\u0430 \u043F\u0435\u0440\u0435\u043A\u0430\u0437."
      ],
      "Default wire transfer rounding interval": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        "\u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "To second": [
        "\u0441\u0435\u043A\u0443\u043D\u0434\u0438"
      ],
      "To minute": [
        "\u0445\u0432\u0438\u043B\u0438\u043D\u0438"
      ],
      "To hour": [
        "\u0433\u043E\u0434\u0438\u043D\u0438"
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        "\u0417\u0430\u043A\u0456\u043D\u0447\u0443\u0454\u0442\u044C\u0441\u044F \u043E"
      ],
      "Required": [
        "\u043E\u0431\u043E\u0432\u02BC\u044F\u0437\u043A\u043E\u0432\u043E"
      ],
      "Unauthorized": [
        "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043E"
      ],
      "Sending the code failed": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u0441\u0435\u0440\u0432\u0435\u0440\u0430."
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        "\u0410\u043B\u0433\u043E\u0440\u0438\u0442\u043C \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438"
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        "\u041D\u0430\u0437\u0430\u0434"
      ],
      "Verify": [
        "\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E"
      ],
      "Failed to send the verification code.": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        "\u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "Login required": [
        "\u041F\u043E\u0442\u0440\u0456\u0431\u0435\u043D \u0432\u0445\u0456\u0434"
      ],
      "instance name": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "current password": [
        "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        "\u0417\u0430\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0438\u0439 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "Invalid": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439"
      ],
      "Doesn't have the pattern of an email": [
        "URL \u043C\u0430\u0454 \u043D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
      ],
      "Max 7 lines": [
        "\u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C 7 \u0440\u044F\u0434\u043A\u0456\u0432"
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Unauthorized.": [
        "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043E"
      ],
      "Conflict.": [
        "\u041A\u043E\u043D\u0444\u043B\u0456\u043A\u0442."
      ],
      "Not found.": [
        "\u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        "\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443, \u044F\u043A\u0438\u0439 \u0431\u0443\u0434\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043E"
      ],
      "Repeat password": [
        "\u041F\u043E\u0432\u0442\u043E\u0440\u0456\u0442\u044C \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Confirm the same password": [
        "\u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0442\u043E\u0439 \u0441\u0430\u043C\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Please complete the marked fields and choose authorization method": [
        "\u041D\u0435\u043E\u0431\u0445\u0456\u0434\u043D\u043E \u0437\u0430\u043F\u043E\u0432\u043D\u0438\u0442\u0438 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0456 \u043F\u043E\u043B\u044F \u0442\u0430 \u0432\u0438\u0431\u0440\u0430\u0442\u0438 \u043C\u0435\u0442\u043E\u0434 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0456\u0457"
      ],
      "Confirm operation": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E"
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        "\u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "Description": [
        "\u041E\u043F\u0438\u0441"
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u0434\u0456\u0457"
      ],
      "Time the access token will be valid.": [
        "\u041D\u0430\u0434\u0430\u043D\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0454 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u043C."
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043E\u0434\u043D\u0443..."
      ],
      "Read only": [
        ""
      ],
      "All": [
        "\u0412\u0441\u0456"
      ],
      "Order simple": [
        "\u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Order Point-of-Sale": [
        "\u041A\u043B\u044E\u0447 \u0442\u043E\u0447\u043A\u0438 \u043F\u0440\u043E\u0434\u0430\u0436\u0443"
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        "\u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Please complete the marked fields": [
        "\u041D\u0435\u043E\u0431\u0445\u0456\u0434\u043D\u043E \u0437\u0430\u043F\u043E\u0432\u043D\u0438\u0442\u0438 \u043F\u043E\u0437\u043D\u0430\u0447\u0435\u043D\u0456 \u043F\u043E\u043B\u044F"
      ],
      "Access token created": [
        "\u0422\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        "\u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044F 'default' \u0449\u0435 \u043D\u0435 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0430."
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        "\u0421\u0442\u0432\u043E\u0440\u0456\u0442\u044C \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E 'default', \u0449\u043E\u0431 \u043F\u043E\u0447\u0430\u0442\u0438 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0431\u0435\u043A\u043E\u0444\u0456\u0441 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u044F."
      ],
      "Create access token": [
        "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Load more devices before the first one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0448\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u0434\u043E \u043F\u0435\u0440\u0448\u043E\u0433\u043E"
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        "\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043E"
      ],
      "Expires at": [
        "\u0417\u0430\u043A\u0456\u043D\u0447\u0443\u0454\u0442\u044C\u0441\u044F \u043E"
      ],
      "Never": [
        "\u043D\u0456\u043A\u043E\u043B\u0438"
      ],
      "Remove this access token": [
        "\u041F\u043E\u0432\u0442\u043E\u0440\u0456\u0442\u044C \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Delete": [
        "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438"
      ],
      "Load more devices after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0448\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        "\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "Deleting an access token cannot be undone.": [
        "\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443, \u044F\u043A\u0438\u0439 \u0431\u0443\u0434\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043E"
      ],
      "This is not a valid Bitcoin address.": [
        "\u0426\u0435 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0456\u0442\u043A\u043E\u0439\u043D."
      ],
      "This is not a valid Ethereum address.": [
        "\u0426\u0435 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 Ethereum."
      ],
      "This is not a valid host.": [
        "\u0426\u0435 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0456\u0442\u043A\u043E\u0439\u043D."
      ],
      "IBANs usually have more than 4 digits.": [
        "\u041D\u043E\u043C\u0435\u0440\u0430 IBAN \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u043C\u0430\u044E\u0442\u044C \u0431\u0456\u043B\u044C\u0448\u0435 4-\u044C\u043E\u0445 \u0446\u0438\u0444\u0440"
      ],
      "IBANs usually have fewer than 34 digits.": [
        "\u041D\u043E\u043C\u0435\u0440\u0430 IBAN \u0437\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u043C\u0430\u044E\u0442\u044C \u043C\u0435\u043D\u0448\u0435 34-\u044C\u043E\u0445 \u0446\u0438\u0444\u0440"
      ],
      "The IBAN's country code could not be retrieved.": [
        "\u041A\u043E\u0434 \u043A\u0440\u0430\u0457\u043D\u0438 IBAN \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        "\u041D\u043E\u043C\u0435\u0440 IBAN \u043D\u0435 \u043A\u043E\u0440\u0435\u043A\u0442\u043D\u0438\u0439, \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0430 \u0441\u0443\u043C\u0430 \u043D\u0435 \u0441\u0445\u043E\u0434\u0438\u0442\u044C\u0441\u044F"
      ],
      "This account is not allowed.": [
        "\u0426\u0435 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0456\u0442\u043A\u043E\u0439\u043D."
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        "\u041C\u0435\u0442\u043E\u0434 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043E\u0434\u0438\u043D \u043C\u0435\u0442\u043E\u0434 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Routing": [
        "\u041C\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0456\u044F"
      ],
      "Routing number": [
        "\u041D\u043E\u043C\u0435\u0440 \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0456\u0457."
      ],
      "Account": [
        "\u0420\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "Account number": [
        "\u041D\u043E\u043C\u0435\u0440 \u0440\u0430\u0445\u0443\u043D\u043A\u0443."
      ],
      "Code": [
        "\u041A\u043E\u0434"
      ],
      "Business Identifier Code": [
        "\u041A\u043E\u0434 \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0446\u0456\u0457 \u0431\u0456\u0437\u043D\u0435\u0441\u0443."
      ],
      "International Bank Account Number": [
        "\u041D\u043E\u043C\u0435\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u0440\u0430\u0445\u0443\u043D\u043A\u0443."
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        "\u0423\u043D\u0456\u0444\u0456\u043A\u043E\u0432\u0430\u043D\u0438\u0439 \u0456\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432."
      ],
      "Bitcoin protocol": [
        "\u041F\u0440\u043E\u0442\u043E\u043A\u043E\u043B \u0431\u0456\u0442\u043A\u043E\u0439\u043D."
      ],
      "Ethereum protocol": [
        "\u041F\u0440\u043E\u0442\u043E\u043A\u043E\u043B Ethereum."
      ],
      "Interledger protocol": [
        "\u041F\u0440\u043E\u0442\u043E\u043A\u043E\u043B Interledger."
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        "\u041D\u0430\u0437\u0432\u0430 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0456\u0457"
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        "\u041E\u0444\u0456\u0446\u0456\u0439\u043D\u0435 \u0456\u043C'\u044F \u0432\u043B\u0430\u0441\u043D\u0438\u043A\u0430 \u0440\u0430\u0445\u0443\u043D\u043A\u0443."
      ],
      "Invalid url": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438"
      ],
      'Server replied with "bad request".': [
        "\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437 \u043A\u043E\u0434\u043E\u043C \u043F\u043E\u043C\u0438\u043B\u043A\u0438."
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        "\u0420\u0430\u0445\u0443\u043D\u043E\u043A:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        "\u0422\u0438\u043F \u043F\u043E\u0434\u0456\u0457"
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        "\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D"
      ],
      "Do not change": [
        "URL \u043E\u0431\u043C\u0456\u043D\u043D\u0438\u043A\u0430"
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        "\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437 \u043A\u043E\u0434\u043E\u043C \u043F\u043E\u043C\u0438\u043B\u043A\u0438."
      ],
      "Account details": [
        "\u0410\u0434\u0440\u0435\u0441\u0430 \u0440\u0430\u0445\u0443\u043D\u043A\u0443"
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        "\u0411\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E."
      ],
      "Bank accounts": [
        "\u0411\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "Add new account": [
        "\u0417\u0430\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0438\u0439 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "Owner's name": [
        "\u041D\u0430\u0437\u0432\u0430 \u0431\u0456\u0437\u043D\u0435\u0441\u0443"
      ],
      "Delete selected accounts from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u043F\u0435\u0440\u0435\u043A\u0430\u0437 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "There are no accounts yet, add more pressing the + sign": [
        "\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "You must provide a bank account to receive payments.": [
        "URI, \u0449\u043E \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0434\u043B\u044F \u0437\u0430\u0440\u0430\u0445\u0443\u0432\u0430\u043D\u043D\u044F \u0434\u043E\u0445\u043E\u0434\u0443."
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        "\u041D\u0430\u0437\u0432\u0430"
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        "\u0448\u0430\u0431\u043B\u043E\u043D \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E"
      ],
      "Add new devices": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0440\u0435\u0437\u0435\u0440\u0432"
      ],
      "ID": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440"
      ],
      "Total products": [
        "\u0417\u0430\u0433\u0430\u043B\u044C\u043D\u0430 \u0446\u0456\u043D\u0430"
      ],
      "Delete selected category from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u043F\u0435\u0440\u0435\u043A\u0430\u0437 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "There are no categories yet, add more pressing the + sign": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        "\u041D\u0430\u0437\u0432\u0430 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0456\u0457"
      ],
      "Products": [
        "\u0422\u043E\u0432\u0430\u0440\u0438"
      ],
      "Image": [
        "\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F"
      ],
      "Load more products after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0448\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "There are no products in this category.": [
        "\u041A\u0435\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0443 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u0456."
      ],
      "Account's KYC status": [
        "\u0410\u0434\u0440\u0435\u0441\u0430 \u0440\u0430\u0445\u0443\u043D\u043A\u0443"
      ],
      "Exchange": [
        "Exchange"
      ],
      "Status": [
        "URL \u0441\u0442\u0430\u0442\u0443\u0441\u0443"
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        "\u041F\u043E\u0442\u0440\u0456\u0431\u0435\u043D \u0432\u0445\u0456\u0434"
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        "\u0421\u0443\u043C\u0430 \u043E\u0431\u043E\u0432'\u044F\u0437\u043A\u043E\u0432\u0430"
      ],
      "More information required.": [
        "\u0434\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F \u0434\u043B\u044F \u043D\u0430\u0434\u0430\u043D\u043D\u044F \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0443"
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        "HTTP \u0441\u0442\u0430\u0442\u0443\u0441"
      ],
      "No pending kyc verification!": [
        "\u041D\u0435\u043C\u0430\u0454 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0438\u0445 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043E\u043A KYC!"
      ],
      "Wire account is invalid": [
        "\u041D\u0430\u0434\u0430\u043D\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0454 \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u043C"
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        "\u043E\u0431\u043E\u0432\u02BC\u044F\u0437\u043A\u043E\u0432\u043E"
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        "\u0412\u0438 \u0432\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044E\u0454\u0442\u0435 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0457 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0434\u0435 \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0437\u0430\u043F\u043B\u0430\u0442\u0438\u043B\u0438, \u0430\u043B\u0435 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0432\u0456\u0434 \u043F\u043E\u0441\u0442\u0430\u0447\u0430\u043B\u044C\u043D\u0438\u043A\u0430 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432 \u0449\u0435 \u043D\u0435 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u0456"
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        "\u0437\u043C\u0456\u043D\u0438\u0442\u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043D\u0430 \u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0443 \u0434\u0430\u0442\u0443"
      ],
      "Enter description or id": [
        "\u0412\u0432\u0435\u0434\u0456\u0442\u044C \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "No match found for that description or ID.": [
        "\u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0438 \u0437 \u0442\u0430\u043A\u0438\u043C \u043E\u043F\u0438\u0441\u043E\u043C \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "You must enter a valid product identifier.": [
        "\u0412\u0438 \u043F\u043E\u0432\u0438\u043D\u043D\u0456 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443."
      ],
      "Quantity must be greater than 0!": [
        "\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 0!"
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        "\u0426\u044F \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u0437\u0430\u043B\u0438\u0448\u043E\u043A \u043D\u0430 \u0441\u043A\u043B\u0430\u0434\u0456. \u041D\u0430\u0440\u0430\u0437\u0456 \u043D\u0430 \u0441\u043A\u043B\u0430\u0434\u0456 \u0437\u0430\u043B\u0438\u0448\u0438\u043B\u043E\u0441\u044F \u043B\u0438\u0448\u0435 %1$s \u043E\u0434\u0438\u043D\u0438\u0446\u044C, \u044F\u043A\u0456 \u043D\u0435 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u043E\u0432\u0430\u043D\u0456."
      ],
      "Search product": [
        "\u043D\u043E\u0432\u0430 \u0446\u0456\u043D\u0430 \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "Quantity": [
        "\u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C"
      ],
      "How many products will be added": [
        "\u0441\u043A\u0456\u043B\u044C\u043A\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0431\u0443\u0434\u0435 \u0434\u043E\u0434\u0430\u043D\u043E"
      ],
      "Add from inventory": [
        "\u0414\u043E\u0434\u0430\u0442\u0438 \u0437\u0456 \u0441\u043A\u043B\u0430\u0434\u0443"
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        "\u041F\u043E\u0434\u0430\u0442\u043A\u0438 \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u043D\u0435 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0456."
      ],
      "Amount": [
        "\u0421\u0443\u043C\u0430"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        "\u041F\u043E\u0434\u0430\u0442\u043A\u0438 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432 \u0432\u0430\u043B\u044E\u0442\u0430\u0445, \u0449\u043E \u0432\u0456\u0434\u0440\u0456\u0437\u043D\u044F\u044E\u0442\u044C\u0441\u044F \u0432\u0456\u0434 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0457 \u0432\u0430\u043B\u044E\u0442\u0438, \u044F\u043A\u0443 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454 \u043F\u0440\u043E\u0434\u0430\u0432\u0435\u0446\u044C."
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        "\u0412\u0432\u0435\u0434\u0456\u0442\u044C \u0432\u0430\u043B\u044E\u0442\u0443 \u0442\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F, \u0440\u043E\u0437\u0434\u0456\u043B\u0435\u043D\u0456 \u0434\u0432\u043E\u043A\u0440\u0430\u043F\u043A\u043E\u044E, \u043D\u0430\u043F\u0440\u0438\u043A\u043B\u0430\u0434, &quot;USD:2.3&quot;."
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        "\u041E\u0444\u0456\u0446\u0456\u0439\u043D\u0430 \u043D\u0430\u0437\u0432\u0430 \u043F\u043E\u0434\u0430\u0442\u043A\u0443, \u043D\u0430\u043F\u0440\u0438\u043A\u043B\u0430\u0434, \u041F\u0414\u0412 \u0430\u0431\u043E \u0456\u043C\u043F\u043E\u0440\u0442\u043D\u0456 \u043C\u0438\u0442\u0430."
      ],
      "Add tax to the tax list": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043F\u043E\u0434\u0430\u0442\u043E\u043A \u0434\u043E \u0441\u043F\u0438\u0441\u043A\u0443 \u043F\u043E\u0434\u0430\u0442\u043A\u0456\u0432"
      ],
      "Describe and add a product that is not in the inventory list": [
        "\u043E\u043F\u0438\u0448\u0456\u0442\u044C \u0456 \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442, \u044F\u043A\u043E\u0433\u043E \u043D\u0435\u043C\u0430\u0454 \u0432 \u0441\u043F\u0438\u0441\u043A\u0443 \u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u044E"
      ],
      "Add custom product": [
        "\u0414\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442"
      ],
      "Complete information of the product": [
        "\u041F\u043E\u0432\u043D\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F \u043F\u0440\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442"
      ],
      "Must be a number.": [
        "\u043D\u0435 \u0454 \u0447\u0438\u0441\u043B\u043E\u043C"
      ],
      "Must be greater than 0.": [
        "\u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 0"
      ],
      "Photo of the product.": [
        "\u0444\u043E\u0442\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443."
      ],
      "Full product description.": [
        "\u043F\u043E\u0432\u043D\u0438\u0439 \u043E\u043F\u0438\u0441 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443."
      ],
      "Unit name": [
        "\u041E\u0434\u0438\u043D\u0438\u0446\u044F"
      ],
      "Name of the product unit.": [
        "\u043D\u0430\u0437\u0432\u0430 \u043E\u0434\u0438\u043D\u0438\u0446\u0456 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443."
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        "\u0441\u0443\u043C\u0430 \u0432 \u043F\u043E\u0442\u043E\u0447\u043D\u0456\u0439 \u0432\u0430\u043B\u044E\u0442\u0456."
      ],
      "How many products will be added.": [
        "\u0441\u043A\u0456\u043B\u044C\u043A\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0431\u0443\u0434\u0435 \u0434\u043E\u0434\u0430\u043D\u043E."
      ],
      "Taxes": [
        "\u041F\u043E\u0434\u0430\u0442\u043A\u0438"
      ],
      "Total price": [
        "\u0417\u0430\u0433\u0430\u043B\u044C\u043D\u0430 \u0446\u0456\u043D\u0430"
      ],
      "Must be greater than 0": [
        "\u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 0"
      ],
      "Must have a refund deadline": [
        "\u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0431\u0443\u0442\u0438 \u0432\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u0442\u0435\u0440\u043C\u0456\u043D \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Auto refund can't be after refund deadline": [
        "\u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u0435 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u043D\u0435 \u043C\u043E\u0436\u0435 \u0431\u0443\u0442\u0438 \u043F\u0456\u0441\u043B\u044F \u0442\u0435\u0440\u043C\u0456\u043D\u0443 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Must be in the future": [
        "\u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u0432 \u043C\u0430\u0439\u0431\u0443\u0442\u043D\u044C\u043E\u043C\u0443"
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439"
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        "\u041A\u0435\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0430\u043C\u0438 \u0432 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u0456"
      ],
      "%1$s products with a total price of %2$s.": [
        "%1$s \u0442\u043E\u0432\u0430\u0440\u0456\u0432 \u0456\u0437 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u043E\u044E \u0446\u0456\u043D\u043E\u044E %2$s."
      ],
      "Manage list of products in the order.": [
        "\u041A\u0435\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0443 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u0456."
      ],
      "Remove this product from the order.": [
        "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0446\u0435\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0456\u0437 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F."
      ],
      "Products price sum": [
        "\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432"
      ],
      "Total product price added up": [
        "\u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0430 \u0441\u0443\u043C\u0430 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "Order price": [
        "\u0426\u0456\u043D\u0430 \u0437\u0430 \u043E\u0434\u0438\u043D\u0438\u0446\u044E"
      ],
      "Amount to be paid by the customer": [
        "\u0421\u0443\u043C\u0430, \u044F\u043A\u0443 \u043C\u0430\u0454 \u0441\u043F\u043B\u0430\u0442\u0438\u0442\u0438 \u043A\u043B\u0456\u0454\u043D\u0442"
      ],
      "Final order price": [
        "\u043A\u0456\u043D\u0446\u0435\u0432\u0430 \u0446\u0456\u043D\u0430 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Summary": [
        "\u041F\u0456\u0434\u0441\u0443\u043C\u043E\u043A"
      ],
      "Title of the order to be shown to the customer": [
        "\u041D\u0430\u0437\u0432\u0430 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u044F\u043A\u0443 \u0431\u0443\u0434\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u043A\u043B\u0456\u0454\u043D\u0442\u0443"
      ],
      "Shipping and fulfillment": [
        "\u0414\u043E\u0441\u0442\u0430\u0432\u043A\u0430 \u0442\u0430 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u043D\u044F"
      ],
      "Delivery date": [
        "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438"
      ],
      "Deadline for physical delivery assured by the merchant.": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u0444\u0456\u0437\u0438\u0447\u043D\u043E\u0457 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0433\u0430\u0440\u0430\u043D\u0442\u043E\u0432\u0430\u043D\u0438\u0439 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u0435\u043C."
      ],
      "Delivery location": [
        "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438"
      ],
      "Address where the products will be delivered": [
        "\u0430\u0434\u0440\u0435\u0441\u0430, \u0437\u0430 \u044F\u043A\u043E\u044E \u0431\u0443\u0434\u0443\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0438"
      ],
      "Fulfillment URL": [
        "URL \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u043D\u044F"
      ],
      "URL to which the user will be redirected after successful payment.": [
        "URL, \u043D\u0430 \u044F\u043A\u0438\u0439 \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430 \u0431\u0443\u0434\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u043F\u0456\u0441\u043B\u044F \u0443\u0441\u043F\u0456\u0448\u043D\u043E\u0457 \u043E\u043F\u043B\u0430\u0442\u0438."
      ],
      "Fulfillment message": [
        "URL \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u043D\u044F"
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        "\u041E\u043F\u0446\u0456\u0457 \u043E\u043F\u043B\u0430\u0442\u0438 Taler"
      ],
      "Override default Taler payment settings for this order": [
        "\u041F\u0435\u0440\u0435\u0432\u0438\u0437\u043D\u0430\u0447\u0438\u0442\u0438 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0456 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043E\u043F\u043B\u0430\u0442\u0438 Taler \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Payment time": [
        "\u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        "\u0422\u0435\u0440\u043C\u0456\u043D, \u0434\u043E \u044F\u043A\u043E\u0433\u043E \u043A\u043B\u0456\u0454\u043D\u0442 \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043E\u043F\u043B\u0430\u0442\u0438\u0442\u0438 \u043F\u0440\u043E\u043F\u043E\u0437\u0438\u0446\u0456\u044E, \u043F\u0435\u0440\u0448 \u043D\u0456\u0436 \u0432\u043E\u043D\u0430 \u0437\u0430\u043A\u0456\u043D\u0447\u0438\u0442\u044C\u0441\u044F. \u041F\u0440\u043E\u0434\u0443\u043A\u0442\u0438 \u0437 \u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u044E \u0431\u0443\u0434\u0443\u0442\u044C \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u043E\u0432\u0430\u043D\u0456 \u0434\u043E \u0446\u044C\u043E\u0433\u043E \u0442\u0435\u0440\u043C\u0456\u043D\u0443."
      ],
      "Default": [
        "\u0421\u0443\u043C\u0430 \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C"
      ],
      "Refund time": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0437\u0434\u0456\u0439\u0441\u043D\u0435\u043D\u043E"
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        "\u0427\u0430\u0441, \u0434\u043E \u044F\u043A\u043E\u0433\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043C\u043E\u0436\u0435 \u0431\u0443\u0442\u0438 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u0435 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u0435\u043C."
      ],
      "Wire transfer time": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        "\u0422\u0435\u0440\u043C\u0456\u043D, \u0434\u043E \u044F\u043A\u043E\u0433\u043E \u043E\u0431\u043C\u0456\u043D\u043D\u0438\u043A \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0434\u0456\u0439\u0441\u043D\u0438\u0442\u0438 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u043F\u0435\u0440\u0435\u043A\u0430\u0437."
      ],
      "Auto-refund time": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        "\u0427\u0430\u0441, \u0434\u043E \u044F\u043A\u043E\u0433\u043E \u0433\u0430\u043C\u0430\u043D\u0435\u0446\u044C \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u044F\u0442\u0438\u043C\u0435 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u043A\u043E\u0448\u0442\u0456\u0432 \u0431\u0435\u0437 \u0432\u0437\u0430\u0454\u043C\u043E\u0434\u0456\u0457 \u0437 \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u043C."
      ],
      "Maximum fee": [
        "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u043A\u043E\u043C\u0456\u0441\u0456\u044F \u0437\u0430 \u043F\u0435\u0440\u0435\u043A\u0430\u0437"
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u043A\u043E\u043C\u0456\u0441\u0456\u044F \u0437\u0430 \u0434\u0435\u043F\u043E\u0437\u0438\u0442, \u044F\u043A\u0443 \u043F\u0440\u043E\u0434\u0430\u0432\u0435\u0446\u044C \u0433\u043E\u0442\u043E\u0432\u0438\u0439 \u043F\u043E\u043A\u0440\u0438\u0442\u0438 \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F. \u0412\u0438\u0449\u0456 \u043A\u043E\u043C\u0456\u0441\u0456\u0457 \u0437\u0430 \u0434\u0435\u043F\u043E\u0437\u0438\u0442 \u043F\u043E\u0432\u0438\u043D\u043D\u0456 \u0431\u0443\u0442\u0438 \u043F\u043E\u0432\u043D\u0456\u0441\u0442\u044E \u043F\u043E\u043A\u0440\u0438\u0442\u0456 \u0441\u043F\u043E\u0436\u0438\u0432\u0430\u0447\u0435\u043C."
      ],
      "Create token": [
        "\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D"
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0432\u0456\u043A"
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        "\u0411\u0443\u0434\u044C-\u044F\u043A\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0431\u0456\u043B\u044C\u0448\u0435 0 \u043E\u0431\u043C\u0435\u0436\u0443\u0432\u0430\u0442\u0438\u043C\u0435 \u043C\u043E\u043D\u0435\u0442\u0438, \u044F\u043A\u0456 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u0456 \u0434\u043B\u044F \u043E\u043F\u043B\u0430\u0442\u0438 \u0446\u044C\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442\u0443. \u042F\u043A\u0449\u043E \u043F\u043E\u0440\u043E\u0436\u043D\u0454, \u0432\u0456\u043A\u043E\u0432\u0435 \u043E\u0431\u043C\u0435\u0436\u0435\u043D\u043D\u044F \u0432\u0438\u0437\u043D\u0430\u0447\u0430\u0442\u0438\u043C\u0435\u0442\u044C\u0441\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0430\u043C\u0438"
      ],
      "Minimum age defined by the products is %1$s": [
        "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0432\u0456\u043A, \u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0430\u043C\u0438, \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C %1$s"
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        "\u0414\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"
      ],
      "Custom information to be included in the contract for this order.": [
        "\u0421\u043F\u0435\u0446\u0456\u0430\u043B\u044C\u043D\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F, \u044F\u043A\u0430 \u0431\u0443\u0434\u0435 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0430 \u0432 \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442 \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F."
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        "\u0412\u0438 \u043F\u043E\u0432\u0438\u043D\u043D\u0456 \u0432\u0432\u0435\u0441\u0442\u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 \u0444\u043E\u0440\u043C\u0430\u0442\u0456 JavaScript Object Notation (JSON)."
      ],
      "remove": [
        "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438"
      ],
      "Custom field name": [
        "\u041D\u0430\u0437\u0432\u0430 \u0431\u0443\u0434\u0438\u043D\u043A\u0443"
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        "\u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u0434\u0430\u0442\u0443, \u0449\u043E\u0431 \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0438 \u043D\u0430\u0439\u0431\u043B\u0438\u0436\u0447\u0456 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Only show unpaid orders": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u043E\u043F\u043B\u0430\u0447\u0435\u043D\u0456 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Only show paid orders": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u043E\u043F\u043B\u0430\u0447\u0435\u043D\u0456 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Paid": [
        "\u041E\u043F\u043B\u0430\u0447\u0435\u043D\u043E"
      ],
      "Only show orders with refunds": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F\u043C\u0438"
      ],
      "Refunded": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043E"
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        "\u041D\u0435 \u043F\u0435\u0440\u0435\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u043E"
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0434\u0435 \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0437\u0430\u043F\u043B\u0430\u0442\u0438\u043B\u0438, \u0430\u043B\u0435 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0432\u0456\u0434 \u043F\u043E\u0441\u0442\u0430\u0447\u0430\u043B\u044C\u043D\u0438\u043A\u0430 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432 \u0449\u0435 \u043D\u0435 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u0456"
      ],
      "Completed": [
        "\u0413\u0440\u043E\u0448\u0456 \u043F\u0435\u0440\u0435\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0456"
      ],
      "Remove all filters": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0441\u0456 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"
      ],
      "Clear date filter": [
        "\u043E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u0456\u043B\u044C\u0442\u0440 \u0434\u0430\u0442\u0438"
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        "\u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u0437\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u043C \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C"
      ],
      "Order id": [
        "\u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Instance unknown": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Order unknown": [
        "\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E"
      ],
      "Create order": [
        "\u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        "\u0414\u0430\u0442\u0430"
      ],
      "Refund": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "copy url": [
        "\u0441\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 url"
      ],
      "Load more orders after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "No orders have been found matching your query!": [
        "\u0417\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0449\u043E \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u044E\u0442\u044C \u0432\u0430\u0448\u043E\u043C\u0443 \u0437\u0430\u043F\u0438\u0442\u0443, \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E!"
      ],
      "Duplicated": [
        "\u0434\u0443\u0431\u043B\u044C\u043E\u0432\u0430\u043D\u043E"
      ],
      "This value exceeds the refundable amount.": [
        "\u0446\u044F \u0441\u0443\u043C\u0430 \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u0441\u0443\u043C\u0443, \u0449\u043E \u043F\u0456\u0434\u043B\u044F\u0433\u0430\u0454 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044E"
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        "\u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Reason": [
        "\u041F\u0440\u0438\u0447\u0438\u043D\u0430"
      ],
      "Amount to be refunded": [
        "\u0441\u0443\u043C\u0430 \u0434\u043E \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Max refundable:": [
        "\u041C\u0430\u043A\u0441. \u0441\u0443\u043C\u0430 \u0434\u043B\u044F \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F:"
      ],
      "Choose one...": [
        "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043E\u0434\u043D\u0443..."
      ],
      "Requested by the customer": [
        "\u0437\u0430\u043F\u0438\u0442\u0430\u043D\u043E \u043A\u043B\u0456\u0454\u043D\u0442\u043E\u043C"
      ],
      "Other": [
        "\u0456\u043D\u0448\u0435"
      ],
      "Why this order is being refunded": [
        "\u0447\u043E\u043C\u0443 \u0446\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043F\u043E\u0432\u0435\u0440\u0442\u0430\u0454\u0442\u044C\u0441\u044F"
      ],
      "More information to give context": [
        "\u0434\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F \u0434\u043B\u044F \u043D\u0430\u0434\u0430\u043D\u043D\u044F \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0443"
      ],
      "now": [
        "\u043D\u0456"
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0434\u0435 \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0437\u0430\u043F\u043B\u0430\u0442\u0438\u043B\u0438, \u0430\u043B\u0435 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0432\u0456\u0434 \u043F\u043E\u0441\u0442\u0430\u0447\u0430\u043B\u044C\u043D\u0438\u043A\u0430 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432 \u0449\u0435 \u043D\u0435 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u0456"
      ],
      "This wire transfer has been notified by the payment service provider.": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0434\u0435 \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0437\u0430\u043F\u043B\u0430\u0442\u0438\u043B\u0438, \u0430\u043B\u0435 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0432\u0456\u0434 \u043F\u043E\u0441\u0442\u0430\u0447\u0430\u043B\u044C\u043D\u0438\u043A\u0430 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432 \u0449\u0435 \u043D\u0435 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u0456"
      ],
      "This refund is waiting to be claimed by the customer.": [
        "\u0421\u0443\u043C\u0430, \u044F\u043A\u0443 \u043C\u0430\u0454 \u0441\u043F\u043B\u0430\u0442\u0438\u0442\u0438 \u043A\u043B\u0456\u0454\u043D\u0442"
      ],
      "This refund has been claimed by the customer.": [
        "\u0421\u0443\u043C\u0430, \u044F\u043A\u0443 \u043C\u0430\u0454 \u0441\u043F\u043B\u0430\u0442\u0438\u0442\u0438 \u043A\u043B\u0456\u0454\u043D\u0442"
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        "\u0423\u043C\u043E\u0432\u0438 \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442\u0443"
      ],
      "Human-readable description of the whole purchase": [
        "\u0447\u0438\u0442\u0430\u0431\u0435\u043B\u044C\u043D\u0438\u0439 \u043E\u043F\u0438\u0441 \u0432\u0441\u0456\u0454\u0457 \u043F\u043E\u043A\u0443\u043F\u043A\u0438"
      ],
      "Total price for the transaction": [
        "\u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0430 \u0446\u0456\u043D\u0430 \u0437\u0430 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0456\u044E"
      ],
      "URL for this purchase": [
        "URL \u0434\u043B\u044F \u0446\u0456\u0454\u0457 \u043F\u043E\u043A\u0443\u043F\u043A\u0438"
      ],
      "Max fee": [
        "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u043A\u043E\u043C\u0456\u0441\u0456\u044F"
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        "\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0430 \u043A\u043E\u043C\u0456\u0441\u0456\u044F \u0437\u0430 \u0434\u0435\u043F\u043E\u0437\u0438\u0442, \u043F\u0440\u0438\u0439\u043D\u044F\u0442\u0430 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u0435\u043C \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442\u0443"
      ],
      "Time when this contract was generated": [
        "\u0447\u0430\u0441, \u043A\u043E\u043B\u0438 \u0446\u0435\u0439 \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442 \u0431\u0443\u043B\u043E \u0437\u0433\u0435\u043D\u0435\u0440\u043E\u0432\u0430\u043D\u043E"
      ],
      "Refund deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        "\u043F\u0456\u0441\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u0442\u0435\u0440\u043C\u0456\u043D\u0443 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u043D\u0435 \u043F\u0440\u0438\u0439\u043C\u0430\u044E\u0442\u044C\u0441\u044F"
      ],
      "Payment deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        "\u043F\u0456\u0441\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u0442\u0435\u0440\u043C\u0456\u043D\u0443 \u043F\u0440\u043E\u0434\u0430\u0432\u0435\u0446\u044C \u043D\u0435 \u043F\u0440\u0438\u0439\u043C\u0430\u0442\u0438\u043C\u0435 \u043F\u043B\u0430\u0442\u0435\u0436\u0456 \u0437\u0430 \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442\u043E\u043C"
      ],
      "Wire transfer deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Transfer deadline for the exchange": [
        "\u0442\u0435\u0440\u043C\u0456\u043D \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443 \u0434\u043B\u044F \u043E\u0431\u043C\u0456\u043D\u043D\u0438\u043A\u0430"
      ],
      "Time indicating when the order should be delivered": [
        "\u0447\u0430\u0441, \u0449\u043E \u0432\u043A\u0430\u0437\u0443\u0454, \u043A\u043E\u043B\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0435"
      ],
      "Where the order will be delivered": [
        "\u043A\u0443\u0434\u0438 \u0431\u0443\u0434\u0435 \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Auto-refund delay": [
        "\u0417\u0430\u0442\u0440\u0438\u043C\u043A\u0430 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        "\u0441\u043A\u0456\u043B\u044C\u043A\u0438 \u0447\u0430\u0441\u0443 \u0433\u0430\u043C\u0430\u043D\u0435\u0446\u044C \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043D\u0430\u043C\u0430\u0433\u0430\u0442\u0438\u0441\u044F \u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u0435 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0437\u0430 \u043F\u043E\u043A\u0443\u043F\u043A\u0443"
      ],
      "Extra info": [
        "\u0414\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        "\u0434\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0456 \u0434\u0430\u043D\u0456, \u044F\u043A\u0456 \u0456\u043D\u0442\u0435\u0440\u043F\u0440\u0435\u0442\u0443\u044E\u0442\u044C\u0441\u044F \u043B\u0438\u0448\u0435 \u0444\u0440\u043E\u043D\u0442\u0435\u043D\u0434\u043E\u043C \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u044F"
      ],
      "order created": [
        "\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "pay deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "refund deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "delivery": [
        "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438"
      ],
      "Order": [
        "\u0417\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Claimed": [
        "\u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E"
      ],
      "Claimed at": [
        "\u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E \u043E"
      ],
      "Timeline": [
        "\u0425\u0440\u043E\u043D\u043E\u043B\u043E\u0433\u0456\u044F"
      ],
      "Payment details": [
        "\u0414\u0435\u0442\u0430\u043B\u0456 \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "Order status": [
        "\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Unpaid": [
        "\u043D\u0435\u043E\u043F\u043B\u0430\u0447\u0435\u043D\u043E"
      ],
      "Product list": [
        "\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432"
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        "\u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043E"
      ],
      "refund created: %1$s: %2$s": [
        "\u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043E"
      ],
      "refund taken: %1$s": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0437\u0434\u0456\u0439\u0441\u043D\u0435\u043D\u043E"
      ],
      "refund taken: %1$s: %2$s": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0437\u0434\u0456\u0439\u0441\u043D\u0435\u043D\u043E"
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Wired": [
        "\u043F\u0435\u0440\u0435\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u043E"
      ],
      "Refund order": [
        "\u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0430 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Not refundable": [
        "\u043D\u0435 \u043F\u0456\u0434\u043B\u044F\u0433\u0430\u0454 \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044E"
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u0430 \u0441\u0443\u043C\u0430"
      ],
      "Refund taken": [
        "\u041F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F \u0437\u0434\u0456\u0439\u0441\u043D\u0435\u043D\u043E"
      ],
      "Status URL": [
        "URL \u0441\u0442\u0430\u0442\u0443\u0441\u0443"
      ],
      "Refund URI": [
        "URI \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "Pay at": [
        "URL \u0434\u043B\u044F \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "Order status URL": [
        "URL \u0441\u0442\u0430\u0442\u0443\u0441\u0443 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Payment URI": [
        "URI \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        "\u041D\u0435\u0432\u0456\u0434\u043E\u043C\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F. \u0426\u0435 \u043F\u043E\u043C\u0438\u043B\u043A\u0430, \u0431\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u0437\u0432'\u044F\u0436\u0456\u0442\u044C\u0441\u044F \u0437 \u0430\u0434\u043C\u0456\u043D\u0456\u0441\u0442\u0440\u0430\u0442\u043E\u0440\u043E\u043C."
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        "\u043B\u0438\u0448\u0435 \u043B\u0456\u0442\u0435\u0440\u0438 \u0442\u0430 \u0446\u0438\u0444\u0440\u0438 \u0432\u0456\u0434 2 \u0434\u043E 7"
      ],
      "The size of the key must be 32 characters": [
        "\u0440\u043E\u0437\u043C\u0456\u0440 \u043A\u043B\u044E\u0447\u0430 \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0431\u0443\u0442\u0438 32"
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        "\u0410\u043B\u0433\u043E\u0440\u0438\u0442\u043C \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438"
      ],
      "Algorithm used to verify transactions in offline mode": [
        "\u0410\u043B\u0433\u043E\u0440\u0438\u0442\u043C \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0456\u0457 \u0432 \u043E\u0444\u043B\u0430\u0439\u043D-\u0440\u0435\u0436\u0438\u043C\u0456"
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        "\u0437\u0433\u0435\u043D\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u043F\u0430\u0434\u043A\u043E\u0432\u0438\u0439 \u0441\u0435\u043A\u0440\u0435\u0442\u043D\u0438\u0439 \u043A\u043B\u044E\u0447"
      ],
      "Random": [
        "\u0432\u0438\u043F\u0430\u0434\u043A\u043E\u0432\u0438\u0439"
      ],
      "Create another": [
        "\u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0440\u0435\u0437\u0435\u0440\u0432"
      ],
      "Delete selected devices from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0440\u0435\u0437\u0435\u0440\u0432 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        "\u0429\u0435 \u043D\u0435\u043C\u0430\u0454 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0439, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        "\u041F\u0440\u0438\u0441\u0442\u0440\u0456\u0439:"
      ],
      "Algorithm to use to verify transactions in offline mode": [
        "\u0410\u043B\u0433\u043E\u0440\u0438\u0442\u043C \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0456\u0457 \u0432 \u043E\u0444\u043B\u0430\u0439\u043D-\u0440\u0435\u0436\u0438\u043C\u0456"
      ],
      "Not modified": [
        "\u041D\u0435 \u043F\u0435\u0440\u0435\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u043E"
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        "\u043D\u0435 \u0441\u043F\u0456\u0432\u043F\u0430\u0434\u0430\u0454"
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        "\u0412\u0438 \u043E\u043D\u043E\u0432\u043B\u044E\u0454\u0442\u0435 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0437 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457 \u0437 \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C %1$s"
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0437\u043C\u0456\u043D\u0443"
      ],
      "Testing password change": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0437\u043C\u0456\u043D\u0443"
      ],
      "Password changed": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0437\u043C\u0456\u043D\u0443"
      ],
      "The current password is wrong.": [
        "\u0412\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        "\u0421\u0435\u0440\u0432\u0435\u0440 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "Add element to the list": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0434\u043E \u0441\u043F\u0438\u0441\u043A\u0443"
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        "\u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u0442\u0443\u0442, \u0449\u043E\u0431 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0430\u043F\u0430\u0441 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443, \u0437\u0430\u043B\u0438\u0448\u0442\u0435 \u044F\u043A \u0454, \u0456 \u0431\u0435\u043A\u0435\u043D\u0434 \u043D\u0435 \u0431\u0443\u0434\u0435 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E\u0432\u0430\u0442\u0438 \u0437\u0430\u043F\u0430\u0441."
      ],
      "Manage stock": [
        "\u041A\u0435\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u0430\u043F\u0430\u0441\u0430\u043C\u0438"
      ],
      "This product has been configured without stock control": [
        "\u0446\u0435\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u0438\u0439 \u0431\u0435\u0437 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044E \u0437\u0430\u043F\u0430\u0441\u0456\u0432"
      ],
      "Infinite": [
        "\u041D\u0435\u0441\u043A\u0456\u043D\u0447\u0435\u043D\u043D\u0438\u0439"
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        "\u0432\u0442\u0440\u0430\u0442\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0438\u043C\u0438 \u0437\u0430 \u043F\u043E\u0442\u043E\u0447\u043D\u0456 \u0442\u0430 \u043F\u0440\u0438\u0431\u0443\u0432\u0430\u044E\u0447\u0456 (\u043C\u0430\u043A\u0441 %1$s)"
      ],
      "Incoming": [
        "\u041F\u0440\u0438\u0431\u0443\u0442\u0442\u044F"
      ],
      "Lost": [
        "\u0412\u0442\u0440\u0430\u0447\u0435\u043D\u043E"
      ],
      "Current": [
        "\u041F\u043E\u0442\u043E\u0447\u043D\u0438\u0439"
      ],
      "Remove stock control for this product": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C \u0437\u0430\u043F\u0430\u0441\u0456\u0432 \u0434\u043B\u044F \u0446\u044C\u043E\u0433\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "without stock": [
        "\u0431\u0435\u0437 \u0437\u0430\u043F\u0430\u0441\u0443"
      ],
      "Next restock": [
        "\u041D\u0430\u0441\u0442\u0443\u043F\u043D\u0435 \u043F\u043E\u043F\u043E\u0432\u043D\u0435\u043D\u043D\u044F"
      ],
      "Warehouse address": [
        "\u0410\u0434\u0440\u0435\u0441\u0430 \u0440\u0430\u0445\u0443\u043D\u043A\u0443"
      ],
      "Invalid amount": [
        "\u0424\u0456\u043A\u0441\u043E\u0432\u0430\u043D\u0430 \u0441\u0443\u043C\u0430"
      ],
      "Product identification to use in URLs (for internal use only).": [
        "\u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0446\u0456\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0432 URL (\u0442\u0456\u043B\u044C\u043A\u0438 \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u044C\u043E\u0433\u043E \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F)."
      ],
      "Illustration of the product for customers.": [
        "\u0456\u043B\u044E\u0441\u0442\u0440\u0430\u0446\u0456\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432."
      ],
      "Product name.": [
        "\u041F\u0440\u043E\u0434\u0443\u043A\u0442"
      ],
      "Product description for customers.": [
        "\u043E\u043F\u0438\u0441 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432."
      ],
      "Age restriction": [
        "\u041E\u0431\u043C\u0435\u0436\u0435\u043D\u0438\u0439 \u0437\u0430 \u0432\u0456\u043A\u043E\u043C"
      ],
      "Is this product restricted for customer below certain age?": [
        "\u0446\u0435\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u043E\u0431\u043C\u0435\u0436\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432 \u043C\u043E\u043B\u043E\u0434\u0448\u0435 \u043F\u0435\u0432\u043D\u043E\u0433\u043E \u0432\u0456\u043A\u0443?"
      ],
      "Minimum age of the customer": [
        "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0432\u0456\u043A"
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        "\u043E\u0434\u0438\u043D\u0438\u0446\u044F, \u0449\u043E \u043E\u043F\u0438\u0441\u0443\u0454 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043F\u0440\u043E\u0434\u0430\u043D\u043E\u0433\u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 (\u043D\u0430\u043F\u0440\u0438\u043A\u043B\u0430\u0434, 2 \u043A\u0456\u043B\u043E\u0433\u0440\u0430\u043C\u0438, 5 \u043B\u0456\u0442\u0440\u0456\u0432, 3 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u0438, 5 \u043C\u0435\u0442\u0440\u0456\u0432) \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432."
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        "\u0446\u0456\u043D\u0430 \u043F\u0440\u043E\u0434\u0430\u0436\u0443 \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432, \u0432\u043A\u043B\u044E\u0447\u0430\u044E\u0447\u0438 \u043F\u043E\u0434\u0430\u0442\u043A\u0438, \u0437\u0430 \u0432\u0438\u0449\u0435\u0437\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0456 \u043E\u0434\u0438\u043D\u0438\u0446\u0456 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443."
      ],
      "Stock": [
        "\u0417\u0430\u043F\u0430\u0441"
      ],
      "Inventory for products with finite supply (for internal use only).": [
        "\u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u0438\u0437\u0430\u0446\u0456\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0437 \u043E\u0431\u043C\u0435\u0436\u0435\u043D\u0438\u043C \u0437\u0430\u043F\u0430\u0441\u043E\u043C (\u0442\u0456\u043B\u044C\u043A\u0438 \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u044C\u043E\u0433\u043E \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F)"
      ],
      "Taxes included in the product price, exposed to customers.": [
        "\u043F\u043E\u0434\u0430\u0442\u043A\u0438, \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0456 \u0432 \u0446\u0456\u043D\u0443 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443, \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u0456 \u043A\u043B\u0456\u0454\u043D\u0442\u0430\u043C"
      ],
      "Search by category description or id": [
        "\u0448\u0443\u043A\u0430\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0438 \u0437\u0430 \u0457\u0445\u043D\u0456\u043C \u043E\u043F\u0438\u0441\u043E\u043C \u0430\u0431\u043E \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C"
      ],
      "Categories where this product will be listed on.": [
        "\u0430\u0434\u0440\u0435\u0441\u0430, \u0437\u0430 \u044F\u043A\u043E\u044E \u0431\u0443\u0434\u0443\u0442\u044C \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0456 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0438."
      ],
      "Add product to inventory": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0434\u043E \u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u044E"
      ],
      "Product not found.": [
        "\u0421\u0435\u0440\u0432\u0435\u0440 \u043D\u0435 \u0437\u043D\u0430\u0439\u0434\u0435\u043D\u043E"
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        "\u041F\u0440\u043E\u0434\u0430\u043D\u043E"
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        "\u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043E\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "Update": [
        "\u041E\u043D\u043E\u0432\u0438\u0442\u0438"
      ],
      "Remove this product from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0446\u0435\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "Update the product with new price": [
        "\u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0437 \u043D\u043E\u0432\u043E\u044E \u0446\u0456\u043D\u043E\u044E"
      ],
      "Update product with new price": [
        "\u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0437 \u043D\u043E\u0432\u043E\u044E \u0446\u0456\u043D\u043E\u044E"
      ],
      "Confirm update": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E"
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        "\u0432\u0442\u0440\u0430\u0442\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0438\u043C\u0438 \u0437\u0430 \u043F\u043E\u0442\u043E\u0447\u043D\u0456 \u0442\u0430 \u043F\u0440\u0438\u0431\u0443\u0432\u0430\u044E\u0447\u0456 (\u043C\u0430\u043A\u0441 %1$s)"
      ],
      "Add more elements to the inventory": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0434\u043E \u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u044E"
      ],
      "Report elements lost in the inventory": [
        "\u043F\u043E\u0432\u0456\u0434\u043E\u043C\u0438\u0442\u0438 \u043F\u0440\u043E \u0432\u0442\u0440\u0430\u0442\u0443 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u0432 \u0456\u043D\u0432\u0435\u043D\u0442\u0430\u0440\u0456"
      ],
      "New price for the product": [
        "\u043D\u043E\u0432\u0430 \u0446\u0456\u043D\u0430 \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "There are values with errors.": [
        "\u0454 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0437 \u043F\u043E\u043C\u0438\u043B\u043A\u0430\u043C\u0438"
      ],
      "Update product with new stock and price": [
        "\u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0437 \u043D\u043E\u0432\u0438\u043C \u0437\u0430\u043F\u0430\u0441\u043E\u043C \u0456 \u0446\u0456\u043D\u043E\u044E"
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        "\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Product (ID: %1$s) has been deleted": [
        "\u041F\u0440\u043E\u0434\u0443\u043A\u0442 (ID: %1$s) \u043E\u043D\u043E\u0432\u043B\u0435\u043D\u043E"
      ],
      "Jump to product with the given product ID": [
        "\u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u0437\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u043C \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C"
      ],
      "Product id": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "Delete product": [
        "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043E"
      ],
      'Delete the product "%1$s"': [
        "\u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442"
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443:"
      ],
      "Must be greater that 0": [
        "\u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 0"
      ],
      "Too short": [
        "\u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043A\u043E\u0440\u043E\u0442\u043A\u0438\u0439"
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440"
      ],
      "Name of the template in URLs.": [
        "\u041D\u0430\u0437\u0432\u0430 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 \u0432 URL."
      ],
      "Template name": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "Describe what this template stands for": [
        "\u041E\u043F\u0438\u0448\u0456\u0442\u044C, \u0449\u043E \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0454 \u0446\u0435\u0439 \u0448\u0430\u0431\u043B\u043E\u043D"
      ],
      "Order summary": [
        "\u041F\u0456\u0434\u0441\u0443\u043C\u043E\u043A \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "If specified here, this template will create orders with the same summary": [
        "\u042F\u043A\u0449\u043E \u0432\u043A\u0430\u0437\u0430\u043D\u043E, \u0446\u0435\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u043C \u043F\u0456\u0434\u0441\u0443\u043C\u043A\u043E\u043C"
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        "\u042F\u043A\u0449\u043E \u0432\u043A\u0430\u0437\u0430\u043D\u043E, \u0446\u0435\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u043E\u044E \u0446\u0456\u043D\u043E\u044E"
      ],
      "Amount is editable": [
        "\u0417\u0430\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0430 \u0441\u0443\u043C\u0430"
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        "\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0432\u0456\u043A"
      ],
      "Is this contract restricted to some age?": [
        "\u0427\u0438 \u043E\u0431\u043C\u0435\u0436\u0435\u043D\u0438\u0439 \u0446\u0435\u0439 \u043A\u043E\u043D\u0442\u0440\u0430\u043A\u0442 \u0437\u0430 \u0432\u0456\u043A\u043E\u043C?"
      ],
      "Payment timeout": [
        "\u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        "\u0421\u043A\u0456\u043B\u044C\u043A\u0438 \u0447\u0430\u0441\u0443 \u0443 \u043A\u043B\u0456\u0454\u043D\u0442\u0430 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F \u043E\u043F\u043B\u0430\u0442\u0438 \u043F\u0456\u0441\u043B\u044F \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043D\u044F \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F."
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        "\u0410\u043B\u0433\u043E\u0440\u0438\u0442\u043C \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0456\u0457 \u0432 \u043E\u0444\u043B\u0430\u0439\u043D-\u0440\u0435\u0436\u0438\u043C\u0456."
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "Load more templates before the first one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0448\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u0434\u043E \u043F\u0435\u0440\u0448\u043E\u0433\u043E"
      ],
      "Delete selected templates from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "Use template to create new order": [
        "\u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D \u0434\u043B\u044F \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043D\u044F \u043D\u043E\u0432\u043E\u0433\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Generate a QR code for the template.": [
        "\u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438 QR-\u043A\u043E\u0434 \u0434\u043B\u044F \u0448\u0430\u0431\u043B\u043E\u043D\u0443."
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0448\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Jump to template with the given template ID": [
        "\u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043E \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u0437\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u043C \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C"
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u043E\u0432\u0456\u0448\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "Print": [
        "\u0414\u0440\u0443\u043A"
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        "\u042F\u043A\u0449\u043E \u0432\u043A\u0430\u0437\u0430\u043D\u043E, \u0446\u0435\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u0438\u043C \u043F\u0456\u0434\u0441\u0443\u043C\u043A\u043E\u043C"
      ],
      "If specified, this template will create orders with the same price": [
        "\u042F\u043A\u0449\u043E \u0432\u043A\u0430\u0437\u0430\u043D\u043E, \u0446\u0435\u0439 \u0448\u0430\u0431\u043B\u043E\u043D \u0441\u0442\u0432\u043E\u0440\u0438\u0442\u044C \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0437 \u043E\u0434\u043D\u0430\u043A\u043E\u0432\u043E\u044E \u0446\u0456\u043D\u043E\u044E"
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        "\u0421\u043A\u0456\u043B\u044C\u043A\u0438 \u0447\u0430\u0441\u0443 \u0443 \u043A\u043B\u0456\u0454\u043D\u0442\u0430 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F \u043E\u043F\u043B\u0430\u0442\u0438 \u043F\u0456\u0441\u043B\u044F \u0441\u0442\u0432\u043E\u0440\u0435\u043D\u043D\u044F \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F."
      ],
      "An amount is required": [
        "\u0421\u0443\u043C\u0430 \u043E\u0431\u043E\u0432'\u044F\u0437\u043A\u043E\u0432\u0430"
      ],
      "An order summary is required": [
        "\u041F\u0456\u0434\u0441\u0443\u043C\u043E\u043A \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043E\u0431\u043E\u0432'\u044F\u0437\u043A\u043E\u0432\u0438\u0439"
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        "\u041D\u043E\u0432\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u0434\u043B\u044F \u0448\u0430\u0431\u043B\u043E\u043D\u0443"
      ],
      "Amount of the order": [
        "\u0421\u0443\u043C\u0430 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        "\u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0446\u0456\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F \u0432 URL (\u0442\u0456\u043B\u044C\u043A\u0438 \u0434\u043B\u044F \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u044C\u043E\u0433\u043E \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F)"
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        "\u043E\u043F\u0438\u0441 \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443 \u0434\u043B\u044F \u043A\u043B\u0456\u0454\u043D\u0442\u0456\u0432"
      ],
      "Valid After": [
        "\u0414\u0456\u0439\u0441\u043D\u0438\u0439 \u0434\u043E"
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        "\u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443 \u043E\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0443"
      ],
      "Remove this token family from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0446\u0435\u0439 \u043F\u0440\u043E\u0434\u0443\u043A\u0442 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +."
      ],
      "Token family has been deleted.": [
        '\u0421\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u0456\u0432 "%1$s" (SLUG: %2$s) \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E'
      ],
      "Delete token family": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0441\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u0456\u0432"
      ],
      'Delete the token family "%1$s"': [
        "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u044F \u0441\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u0430 \u0442\u043E\u043A\u0435\u043D\u0456\u0432 %1$s ."
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        "\u042F\u043A\u0449\u043E \u0432\u0438 \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0435 \u0441\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u0456\u0432 %1$s (Slug: %2$s), \u0432\u0441\u0456 \u0432\u0438\u043F\u0443\u0449\u0435\u043D\u0456 \u0442\u043E\u043A\u0435\u043D\u0438 \u0441\u0442\u0430\u043D\u0443\u0442\u044C \u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u043C\u0438."
      ],
      "Deleting a token family %1$s .": [
        "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u044F \u0441\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u0430 \u0442\u043E\u043A\u0435\u043D\u0456\u0432 %1$s ."
      ],
      "can't be undone": [
        "\u043D\u0435 \u043C\u043E\u0436\u0435 \u0431\u0443\u0442\u0438 \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u043C"
      ],
      "Token Family: %1$s": [
        "\u0421\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u0456\u0432: %1$s"
      ],
      "Incoming wire transfers": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Load more wire transfers preceding the first one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0456\u0432 \u0434\u043E \u043F\u0435\u0440\u0448\u043E\u0433\u043E"
      ],
      "Expected credit": [
        "\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u0438\u0439 \u0431\u0430\u043B\u0430\u043D\u0441"
      ],
      "Confirmed": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E"
      ],
      "Validated": [
        "\u0414\u0456\u0439\u0441\u043D\u0438\u0439 \u0434\u043E"
      ],
      "Executed on": [
        "\u0412\u0438\u043A\u043E\u043D\u0430\u043D\u043E \u043E"
      ],
      "yes": [
        "\u0442\u0430\u043A"
      ],
      "no": [
        "\u043D\u0456"
      ],
      "never": [
        "\u043D\u0456\u043A\u043E\u043B\u0438"
      ],
      "unknown": [
        "\u043D\u0435\u0432\u0456\u0434\u043E\u043C\u043E"
      ],
      "Load more transfers after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "Verified wire transfers": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "Verified": [
        "\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0435\u043D\u043E"
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        "\u041F\u0435\u0440\u0435\u043A\u0430\u0437\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "All accounts": [
        "\u0420\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "Filter by account address": [
        "\u0444\u0456\u043B\u044C\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430 \u0430\u0434\u0440\u0435\u0441\u043E\u044E \u0440\u0430\u0445\u0443\u043D\u043A\u0443"
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F, \u0434\u0435 \u043A\u043B\u0456\u0454\u043D\u0442\u0438 \u0437\u0430\u043F\u043B\u0430\u0442\u0438\u043B\u0438, \u0430\u043B\u0435 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0456 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438 \u0432\u0456\u0434 \u043F\u043E\u0441\u0442\u0430\u0447\u0430\u043B\u044C\u043D\u0438\u043A\u0430 \u043F\u043B\u0430\u0442\u0435\u0436\u0456\u0432 \u0449\u0435 \u043D\u0435 \u0432\u0438\u043A\u043E\u043D\u0430\u043D\u0456"
      ],
      "Only show wire transfers confirmed by the merchant": [
        "\u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0438, \u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u0456 \u043F\u0440\u043E\u0434\u0430\u0432\u0446\u0435\u043C"
      ],
      "Wire transfer already confirmed.": [
        "\u0422\u0435\u0440\u043C\u0456\u043D \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        "\u043F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0442\u043E\u0439 \u0441\u0430\u043C\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        "\u0425\u0440\u043E\u043D\u043E\u043B\u043E\u0433\u0456\u044F"
      ],
      "Transfer ID": [
        "\u041F\u0435\u0440\u0435\u043A\u0430\u0437\u0438"
      ],
      "It's not the same.": [
        "\u043D\u0435 \u0441\u043F\u0456\u0432\u043F\u0430\u0434\u0430\u0454"
      ],
      'You are deleting the instance with ID "%1$s"': [
        "\u0412\u0438 \u043E\u043D\u043E\u0432\u043B\u044E\u0454\u0442\u0435 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0437 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457 \u0437 \u0456\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440\u043E\u043C %1$s"
      ],
      "Instance": [
        "\u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044F"
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438"
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Delete this instance": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      "Must be one of '%1$s'": [
        "\u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043E\u0434\u043D\u0438\u043C \u0456\u0437 '%1$s'"
      ],
      "URL is invalid": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439"
      ],
      "Webhook ID to use": [
        "ID \u0432\u0435\u0431\u0445\u0443\u043A\u0430 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F"
      ],
      "Event": [
        "\u041F\u043E\u0434\u0456\u044F"
      ],
      "Payment": [
        "URI \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "Order settled": [
        "\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Category added": [
        "\u0448\u0430\u0431\u043B\u043E\u043D \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E"
      ],
      "Category updated": [
        "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0436\u0435\u043D\u043E"
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        "ID \u0432\u0435\u0431\u0445\u0443\u043A\u0430 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F"
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        "\u041F\u043E\u0434\u0456\u044F \u0432\u0435\u0431\u0445\u0443\u043A\u0430: \u0447\u043E\u043C\u0443 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F \u0432\u0435\u0431\u0445\u0443\u043A"
      ],
      "Method": [
        "\u041C\u0435\u0442\u043E\u0434"
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        "\u041C\u0435\u0442\u043E\u0434, \u0449\u043E \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F \u0432\u0435\u0431\u0445\u0443\u043A\u043E\u043C"
      ],
      "URL": [
        "URL"
      ],
      "URL of the webhook where the customer will be redirected": [
        "URL \u0432\u0435\u0431\u0445\u0443\u043A\u0430, \u043A\u0443\u0434\u0438 \u0431\u0443\u0434\u0435 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0439 \u043A\u043B\u0456\u0454\u043D\u0442"
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        "\u043E\u043F\u0438\u0441"
      ],
      "order's price": [
        "\u0426\u0456\u043D\u0430 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        "\u0441\u0443\u043C\u0430 \u0434\u043E \u043F\u043E\u0432\u0435\u0440\u043D\u0435\u043D\u043D\u044F"
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        "\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A"
      ],
      "Header template of the webhook": [
        "\u0428\u0430\u0431\u043B\u043E\u043D \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430 \u0432\u0435\u0431\u0445\u0443\u043A\u0430"
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        "\u0428\u0430\u0431\u043B\u043E\u043D \u0442\u0456\u043B\u0430 \u0432\u0435\u0431\u0445\u0443\u043A\u0430"
      ],
      "Webhook deleted successfully": [
        "\u0432\u0435\u0431\u0445\u0443\u043A \u0443\u0441\u043F\u0456\u0448\u043D\u043E \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043E"
      ],
      "Add new webhooks": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0432\u0435\u0431\u0445\u0443\u043A\u0438"
      ],
      "Load more webhooks before the first one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0432\u0435\u0431\u0445\u0443\u043A\u0456\u0432 \u0434\u043E \u043F\u0435\u0440\u0448\u043E\u0433\u043E"
      ],
      "Event type": [
        "\u0422\u0438\u043F \u043F\u043E\u0434\u0456\u0457"
      ],
      "Delete selected webhook from the database": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0432\u0435\u0431\u0445\u0443\u043A \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043D\u0438\u0445"
      ],
      "Load more webhooks after the last one": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0431\u0456\u043B\u044C\u0448\u0435 \u0432\u0435\u0431\u0445\u0443\u043A\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043E\u0441\u0442\u0430\u043D\u043D\u044C\u043E\u0433\u043E"
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        "\u0412\u0435\u0431\u0445\u0443\u043A\u0456\u0432 \u0449\u0435 \u043D\u0435\u043C\u0430\u0454, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      "Webhook updated": [
        "ID \u0432\u0435\u0431\u0445\u0443\u043A\u0430 \u0434\u043B\u044F \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F"
      ],
      "Header": [
        "\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A"
      ],
      "Body": [
        "\u0422\u0456\u043B\u043E"
      ],
      "Body template used by the webhook": [
        "\u0428\u0430\u0431\u043B\u043E\u043D \u0442\u0456\u043B\u0430 \u0432\u0435\u0431\u0445\u0443\u043A\u0430"
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u0438\u0439 email"
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        "\u0421\u0442\u0432\u043E\u0440\u0435\u043D\u043E \u043E"
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        "\u0412\u0438 \u0432\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044E\u0454\u0442\u0435 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0457 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        "\u043D\u0435\u0434\u0456\u0439\u0441\u043D\u0438\u0439 \u0444\u043E\u0440\u043C\u0430\u0442"
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        "\u0422\u0438\u043F \u043F\u043E\u0434\u0456\u0457"
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        "\u0417\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        "\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        "\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        "\u0426\u0456\u043D\u0430 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "hour": [
        "\u0433\u043E\u0434\u0438\u043D\u0438"
      ],
      "day": [
        "\u0434\u043D\u0456"
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        "\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0441\u0456 \u0444\u0456\u043B\u044C\u0442\u0440\u0438"
      ],
      "Time range": [
        "\u0425\u0440\u043E\u043D\u043E\u043B\u043E\u0433\u0456\u044F"
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        "\u041F\u043E\u0442\u043E\u0447\u043D\u0438\u0439"
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        "\u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u043F\u043B\u0430\u0442\u0438"
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        "URI, \u0449\u043E \u0432\u043A\u0430\u0437\u0443\u0454 \u043D\u0430 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0434\u043B\u044F \u0437\u0430\u0440\u0430\u0445\u0443\u0432\u0430\u043D\u043D\u044F \u0434\u043E\u0445\u043E\u0434\u0443."
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        "\u0421\u0445\u043E\u0432\u0430\u0442\u0438 \u043D\u0430 \u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456"
      ],
      "KYC verification needed": [
        "\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0438 KYC"
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        "\u041D\u0435\u0441\u043F\u043E\u0434\u0456\u0432\u0430\u043D\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430"
      ],
      "Unexpected error.": [
        "\u041D\u0435\u0441\u043F\u043E\u0434\u0456\u0432\u0430\u043D\u0430 \u043F\u043E\u043C\u0438\u043B\u043A\u0430"
      ],
      "Add new instance": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0443 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      "Edit": [
        "\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438"
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        "\u0429\u0435 \u043D\u0435\u043C\u0430\u0454 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0439, \u0434\u043E\u0434\u0430\u0439\u0442\u0435 \u0431\u0456\u043B\u044C\u0448\u0435, \u043D\u0430\u0442\u0438\u0441\u043D\u0443\u0432\u0448\u0438 \u0437\u043D\u0430\u043A +"
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        '\u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044F "%1$s" (ID: %2$s) \u0431\u0443\u043B\u0430 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0430'
      ],
      "Only show active instances": [
        "\u041F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0442\u0456\u043B\u044C\u043A\u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u0456 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Active": [
        "\u0410\u043A\u0442\u0438\u0432\u043D\u0456"
      ],
      "Only show deleted instances": [
        "\u041F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0442\u0456\u043B\u044C\u043A\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Deleted": [
        "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043E"
      ],
      "Show all instances": [
        "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0438 \u0432\u0441\u0456 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "Delete instance": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      'Delete the instance "%1$s"': [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u043E\u0432\u0456\u0448\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        "\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043D\u043E\u0432\u0456\u0448\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "This cannot be undone!": [
        "\u043D\u0435 \u043C\u043E\u0436\u0435 \u0431\u0443\u0442\u0438 \u043F\u043E\u0440\u043E\u0436\u043D\u0456\u043C"
      ],
      "Purge the instance": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      'Purge the instance "%1$s"': [
        "\u0412\u0438 \u0432\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044E\u0454\u0442\u0435 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443 \u0434\u043B\u044F \u043D\u043E\u0432\u043E\u0457 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u0441\u0435\u0440\u0432\u0435\u0440\u0430."
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u044F"
      ],
      "Changing": [
        "\u0417\u043C\u0456\u043D\u0430"
      ],
      "Manage password": [
        "\u041A\u0435\u0440\u0443\u0432\u0430\u043D\u043D\u044F \u0437\u0430\u043F\u0430\u0441\u0430\u043C\u0438"
      ],
      "Business Name": [
        "\u041D\u0430\u0437\u0432\u0430 \u0431\u0456\u0437\u043D\u0435\u0441\u0443"
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        "\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F"
      ],
      "title%1$s: New bank account": [
        "\u0411\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "title%1$s: Bank accounts": [
        "\u0411\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A"
      ],
      "title%1$s: Update bank Account": [
        "\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u043A\u0430 \u0434\u0456\u0439\u0441\u043D\u043E\u0441\u0442\u0456 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u0440\u0430\u0445\u0443\u043D\u043A\u0443: %1$s"
      ],
      "title%1$s: Orders": [
        "\u0417\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F"
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        "\u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u043F\u0440\u043E\u0434\u0443\u043A\u0442"
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        "\u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D"
      ],
      "title%1$s: Wire transfers": [
        "\u0406\u0434\u0435\u043D\u0442\u0438\u0444\u0456\u043A\u0430\u0442\u043E\u0440 \u0431\u0430\u043D\u043A\u0456\u0432\u0441\u044C\u043A\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u043A\u0430\u0437\u0443"
      ],
      "title%1$s: Webhooks": [
        "\u0412\u0435\u0431\u0445\u0443\u043A\u0438"
      ],
      "title%1$s: New webhook": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0432\u0435\u0431\u0445\u0443\u043A\u0438"
      ],
      "title%1$s: Update webhook": [
        "\u043D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0435\u0431\u0445\u0443\u043A"
      ],
      "title%1$s: OTP devices": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0440\u0435\u0437\u0435\u0440\u0432"
      ],
      "title%1$s: New OTP device": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0440\u0435\u0437\u0435\u0440\u0432"
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "title%1$s: Update template": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "title%1$s: Templates": [
        "\u0428\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "title%1$s: Use template": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0456 \u0448\u0430\u0431\u043B\u043E\u043D\u0438"
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043E\u043D\u043E\u0432\u0438\u0442\u0438 \u0441\u0456\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0442\u043E\u043A\u0435\u043D\u0456\u0432"
      ],
      "title%1$s: Access tokens": [
        "\u0422\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "title%1$s: New access token": [
        "\u041D\u043E\u0432\u0438\u0439 \u0442\u043E\u043A\u0435\u043D \u0434\u043E\u0441\u0442\u0443\u043F\u0443"
      ],
      "titleNew instance": [
        "\u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0443 \u0456\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u044E"
      ],
      "titleInstances": [
        "\u0406\u043D\u0441\u0442\u0430\u043D\u0446\u0456\u0457"
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;",
  "lang": "uk",
  "completeness": 64
};
strings["tr"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=n != 1;",
        "lang": "tr"
      },
      "Cancel": [
        "\u0130ptal"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        ""
      ],
      "Continue": [
        ""
      ],
      "Clear": [
        ""
      ],
      "Confirm": [
        ""
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        ""
      ],
      "Host": [
        ""
      ],
      "Account ID": [
        "Hesap"
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        "Kasaba"
      ],
      "Bank host": [
        "Banka hesab\u0131"
      ],
      "Bank account": [
        "Banka hesab\u0131"
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        ""
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        "Konu"
      ],
      "Receiver postal code": [
        "Teslim tarihi"
      ],
      "Receiver town": [
        "Teslim tarihi"
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        ""
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        ""
      ],
      "days": [
        ""
      ],
      "hours": [
        ""
      ],
      "minutes": [
        ""
      ],
      "seconds": [
        ""
      ],
      "Forever": [
        ""
      ],
      "%1$sM": [
        ""
      ],
      "%1$sY": [
        ""
      ],
      "%1$sd": [
        ""
      ],
      "%1$sh": [
        ""
      ],
      "%1$smin": [
        ""
      ],
      "%1$ssec": [
        ""
      ],
      "Change value to never": [
        ""
      ],
      "Change value to empty": [
        ""
      ],
      "Image must be smaller than 1 MB": [
        ""
      ],
      "Add": [
        ""
      ],
      "Remove": [
        ""
      ],
      "Country": [
        "\xDClke"
      ],
      "Building number": [
        "Bina numaras\u0131"
      ],
      "Building name": [
        "Bina ad\u0131"
      ],
      "Street": [
        "Sokak"
      ],
      "Post code": [
        "Posta kodu"
      ],
      "Town location": [
        "Kasaba konumu"
      ],
      "District": [
        "Semt"
      ],
      "Country subdivision": [
        ""
      ],
      "Additional address lines": [
        ""
      ],
      "Orders": [
        ""
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        ""
      ],
      "Templates": [
        ""
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        ""
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        ""
      ],
      "Settings": [
        ""
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        ""
      ],
      "Connection": [
        ""
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        ""
      ],
      "New": [
        ""
      ],
      "List": [
        ""
      ],
      "Log out": [
        ""
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        ""
      ],
      "Business name": [
        ""
      ],
      "Legal name of the business represented by this instance.": [
        ""
      ],
      "Email": [
        ""
      ],
      "Contact email": [
        ""
      ],
      "Phone number": [
        ""
      ],
      "Contact phone": [
        ""
      ],
      "Website URL": [
        ""
      ],
      "URL.": [
        ""
      ],
      "Logo": [
        ""
      ],
      "Logo image.": [
        ""
      ],
      "Physical location of the merchant.": [
        ""
      ],
      "Jurisdiction": [
        ""
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        ""
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        ""
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        ""
      ],
      "Default refund delay": [
        ""
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        ""
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        ""
      ],
      "Default wire transfer rounding interval": [
        ""
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        ""
      ],
      "To second": [
        ""
      ],
      "To minute": [
        ""
      ],
      "To hour": [
        ""
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        ""
      ],
      "Required": [
        ""
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        ""
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        ""
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        ""
      ],
      "Verify": [
        ""
      ],
      "Failed to send the verification code.": [
        ""
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        ""
      ],
      "Login required": [
        ""
      ],
      "instance name": [
        ""
      ],
      "current password": [
        ""
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        "Banka hesab\u0131"
      ],
      "Invalid": [
        ""
      ],
      "Doesn't have the pattern of an email": [
        ""
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        "Ge\xE7erlilik"
      ],
      "Max 7 lines": [
        ""
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        ""
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        ""
      ],
      "Not found.": [
        ""
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        ""
      ],
      "Repeat password": [
        ""
      ],
      "Confirm the same password": [
        ""
      ],
      "Please complete the marked fields and choose authorization method": [
        ""
      ],
      "Confirm operation": [
        "Kasaba konumu"
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        ""
      ],
      "Description": [
        ""
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        ""
      ],
      "Time the access token will be valid.": [
        ""
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        ""
      ],
      "Read only": [
        ""
      ],
      "All": [
        ""
      ],
      "Order simple": [
        ""
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        ""
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        ""
      ],
      "Please complete the marked fields": [
        ""
      ],
      "Access token created": [
        ""
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        ""
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        ""
      ],
      "Create access token": [
        "Olu\u015Fturulma"
      ],
      "Load more devices before the first one": [
        ""
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        "Olu\u015Fturulma"
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        ""
      ],
      "Remove this access token": [
        ""
      ],
      "Delete": [
        ""
      ],
      "Load more devices after the last one": [
        ""
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        ""
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        "Olu\u015Fturulma"
      ],
      "Deleting an access token cannot be undone.": [
        ""
      ],
      "This is not a valid Bitcoin address.": [
        ""
      ],
      "This is not a valid Ethereum address.": [
        ""
      ],
      "This is not a valid host.": [
        ""
      ],
      "IBANs usually have more than 4 digits.": [
        ""
      ],
      "IBANs usually have fewer than 34 digits.": [
        ""
      ],
      "The IBAN's country code could not be retrieved.": [
        ""
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        ""
      ],
      "This account is not allowed.": [
        ""
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        ""
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        ""
      ],
      "Routing number": [
        "Bina numaras\u0131"
      ],
      "Account": [
        "Hesap"
      ],
      "Account number": [
        "Hesap"
      ],
      "Code": [
        ""
      ],
      "Business Identifier Code": [
        ""
      ],
      "International Bank Account Number": [
        ""
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        ""
      ],
      "Bitcoin protocol": [
        ""
      ],
      "Ethereum protocol": [
        ""
      ],
      "Interledger protocol": [
        ""
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        ""
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        ""
      ],
      "Invalid url": [
        "Ge\xE7erlilik"
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        ""
      ],
      'Server replied with "bad request".': [
        ""
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        "Hesap:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        ""
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        ""
      ],
      "Do not change": [
        ""
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        ""
      ],
      "Account details": [
        "Hesap"
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        ""
      ],
      "Bank accounts": [
        "Banka hesab\u0131"
      ],
      "Add new account": [
        "Banka hesab\u0131"
      ],
      "Owner's name": [
        ""
      ],
      "Delete selected accounts from the database": [
        ""
      ],
      "There are no accounts yet, add more pressing the + sign": [
        ""
      ],
      "You must provide a bank account to receive payments.": [
        ""
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        ""
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        ""
      ],
      "Add new devices": [
        ""
      ],
      "ID": [
        ""
      ],
      "Total products": [
        "\xDCr\xFCnler"
      ],
      "Delete selected category from the database": [
        ""
      ],
      "There are no categories yet, add more pressing the + sign": [
        ""
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        ""
      ],
      "Products": [
        "\xDCr\xFCnler"
      ],
      "Image": [
        ""
      ],
      "Load more products after the last one": [
        ""
      ],
      "There are no products in this category.": [
        ""
      ],
      "Account's KYC status": [
        "Hesap"
      ],
      "Exchange": [
        ""
      ],
      "Status": [
        ""
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        ""
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        ""
      ],
      "More information required.": [
        ""
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        ""
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        ""
      ],
      "No pending kyc verification!": [
        ""
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        ""
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        ""
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        ""
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        ""
      ],
      "Enter description or id": [
        ""
      ],
      "No match found for that description or ID.": [
        ""
      ],
      "You must enter a valid product identifier.": [
        ""
      ],
      "Quantity must be greater than 0!": [
        ""
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        ""
      ],
      "Search product": [
        ""
      ],
      "Quantity": [
        ""
      ],
      "How many products will be added": [
        ""
      ],
      "Add from inventory": [
        ""
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        ""
      ],
      "Amount": [
        "Miktar"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        ""
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        ""
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        ""
      ],
      "Add tax to the tax list": [
        ""
      ],
      "Describe and add a product that is not in the inventory list": [
        ""
      ],
      "Add custom product": [
        ""
      ],
      "Complete information of the product": [
        ""
      ],
      "Must be a number.": [
        ""
      ],
      "Must be greater than 0.": [
        ""
      ],
      "Photo of the product.": [
        ""
      ],
      "Full product description.": [
        ""
      ],
      "Unit name": [
        ""
      ],
      "Name of the product unit.": [
        ""
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        ""
      ],
      "How many products will be added.": [
        ""
      ],
      "Taxes": [
        ""
      ],
      "Total price": [
        "\xDCr\xFCnler"
      ],
      "Must be greater than 0": [
        ""
      ],
      "Must have a refund deadline": [
        ""
      ],
      "Auto refund can't be after refund deadline": [
        ""
      ],
      "Must be in the future": [
        ""
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        ""
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        ""
      ],
      "%1$s products with a total price of %2$s.": [
        ""
      ],
      "Manage list of products in the order.": [
        ""
      ],
      "Remove this product from the order.": [
        ""
      ],
      "Products price sum": [
        "\xDCr\xFCnler"
      ],
      "Total product price added up": [
        "\xDCr\xFCnler"
      ],
      "Order price": [
        ""
      ],
      "Amount to be paid by the customer": [
        ""
      ],
      "Final order price": [
        ""
      ],
      "Summary": [
        ""
      ],
      "Title of the order to be shown to the customer": [
        ""
      ],
      "Shipping and fulfillment": [
        ""
      ],
      "Delivery date": [
        ""
      ],
      "Deadline for physical delivery assured by the merchant.": [
        ""
      ],
      "Delivery location": [
        "Kasaba konumu"
      ],
      "Address where the products will be delivered": [
        ""
      ],
      "Fulfillment URL": [
        ""
      ],
      "URL to which the user will be redirected after successful payment.": [
        ""
      ],
      "Fulfillment message": [
        ""
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        ""
      ],
      "Override default Taler payment settings for this order": [
        ""
      ],
      "Payment time": [
        ""
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        ""
      ],
      "Default": [
        ""
      ],
      "Refund time": [
        ""
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        ""
      ],
      "Wire transfer time": [
        ""
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        ""
      ],
      "Auto-refund time": [
        ""
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        ""
      ],
      "Maximum fee": [
        ""
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        ""
      ],
      "Create token": [
        "Olu\u015Fturulma"
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        ""
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        ""
      ],
      "Minimum age defined by the products is %1$s": [
        ""
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        ""
      ],
      "Custom information to be included in the contract for this order.": [
        ""
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        ""
      ],
      "remove": [
        ""
      ],
      "Custom field name": [
        "Bina ad\u0131"
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        ""
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        ""
      ],
      "Only show unpaid orders": [
        ""
      ],
      "Only show paid orders": [
        ""
      ],
      "Paid": [
        ""
      ],
      "Only show orders with refunds": [
        ""
      ],
      "Refunded": [
        ""
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        ""
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        ""
      ],
      "Completed": [
        ""
      ],
      "Remove all filters": [
        ""
      ],
      "Clear date filter": [
        ""
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        ""
      ],
      "Order id": [
        ""
      ],
      "Instance unknown": [
        ""
      ],
      "Order unknown": [
        ""
      ],
      "Create order": [
        "Olu\u015Fturulma"
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        ""
      ],
      "Refund": [
        ""
      ],
      "copy url": [
        ""
      ],
      "Load more orders after the last one": [
        ""
      ],
      "No orders have been found matching your query!": [
        ""
      ],
      "Duplicated": [
        ""
      ],
      "This value exceeds the refundable amount.": [
        ""
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        ""
      ],
      "Reason": [
        ""
      ],
      "Amount to be refunded": [
        ""
      ],
      "Max refundable:": [
        ""
      ],
      "Choose one...": [
        ""
      ],
      "Requested by the customer": [
        ""
      ],
      "Other": [
        ""
      ],
      "Why this order is being refunded": [
        ""
      ],
      "More information to give context": [
        ""
      ],
      "now": [
        ""
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        ""
      ],
      "This wire transfer has been notified by the payment service provider.": [
        ""
      ],
      "This refund is waiting to be claimed by the customer.": [
        ""
      ],
      "This refund has been claimed by the customer.": [
        ""
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        ""
      ],
      "Human-readable description of the whole purchase": [
        ""
      ],
      "Total price for the transaction": [
        ""
      ],
      "URL for this purchase": [
        ""
      ],
      "Max fee": [
        ""
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        ""
      ],
      "Time when this contract was generated": [
        ""
      ],
      "Refund deadline": [
        ""
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        ""
      ],
      "Payment deadline": [
        ""
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        ""
      ],
      "Wire transfer deadline": [
        ""
      ],
      "Transfer deadline for the exchange": [
        ""
      ],
      "Time indicating when the order should be delivered": [
        ""
      ],
      "Where the order will be delivered": [
        ""
      ],
      "Auto-refund delay": [
        ""
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        ""
      ],
      "Extra info": [
        ""
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        ""
      ],
      "order created": [
        ""
      ],
      "pay deadline": [
        ""
      ],
      "refund deadline": [
        ""
      ],
      "delivery": [
        ""
      ],
      "Order": [
        ""
      ],
      "Claimed": [
        ""
      ],
      "Claimed at": [
        "Olu\u015Fturulma"
      ],
      "Timeline": [
        ""
      ],
      "Payment details": [
        "Hesap"
      ],
      "Order status": [
        ""
      ],
      "Unpaid": [
        ""
      ],
      "Product list": [
        "\xDCr\xFCnler"
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        ""
      ],
      "refund created: %1$s: %2$s": [
        ""
      ],
      "refund taken: %1$s": [
        ""
      ],
      "refund taken: %1$s: %2$s": [
        ""
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        ""
      ],
      "Wired": [
        ""
      ],
      "Refund order": [
        ""
      ],
      "Not refundable": [
        ""
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        ""
      ],
      "Refund taken": [
        ""
      ],
      "Status URL": [
        ""
      ],
      "Refund URI": [
        ""
      ],
      "Pay at": [
        ""
      ],
      "Order status URL": [
        ""
      ],
      "Payment URI": [
        ""
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        ""
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        ""
      ],
      "The size of the key must be 32 characters": [
        ""
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        ""
      ],
      "Algorithm used to verify transactions in offline mode": [
        ""
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        ""
      ],
      "Random": [
        ""
      ],
      "Create another": [
        "Olu\u015Fturulma"
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        ""
      ],
      "Delete selected devices from the database": [
        ""
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        ""
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        ""
      ],
      "Algorithm to use to verify transactions in offline mode": [
        ""
      ],
      "Not modified": [
        ""
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        ""
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        ""
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        "Kasaba konumu"
      ],
      "Testing password change": [
        ""
      ],
      "Password changed": [
        ""
      ],
      "The current password is wrong.": [
        ""
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        "Hesap"
      ],
      "Add element to the list": [
        ""
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        ""
      ],
      "Manage stock": [
        ""
      ],
      "This product has been configured without stock control": [
        ""
      ],
      "Infinite": [
        ""
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        ""
      ],
      "Incoming": [
        ""
      ],
      "Lost": [
        ""
      ],
      "Current": [
        ""
      ],
      "Remove stock control for this product": [
        ""
      ],
      "without stock": [
        ""
      ],
      "Next restock": [
        ""
      ],
      "Warehouse address": [
        ""
      ],
      "Invalid amount": [
        "Ge\xE7erlilik"
      ],
      "Product identification to use in URLs (for internal use only).": [
        ""
      ],
      "Illustration of the product for customers.": [
        ""
      ],
      "Product name.": [
        "\xDCr\xFCnler"
      ],
      "Product description for customers.": [
        ""
      ],
      "Age restriction": [
        ""
      ],
      "Is this product restricted for customer below certain age?": [
        ""
      ],
      "Minimum age of the customer": [
        ""
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        ""
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        ""
      ],
      "Stock": [
        ""
      ],
      "Inventory for products with finite supply (for internal use only).": [
        ""
      ],
      "Taxes included in the product price, exposed to customers.": [
        ""
      ],
      "Search by category description or id": [
        ""
      ],
      "Categories where this product will be listed on.": [
        ""
      ],
      "Add product to inventory": [
        ""
      ],
      "Product not found.": [
        ""
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        ""
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        ""
      ],
      "Update": [
        ""
      ],
      "Remove this product from the database": [
        ""
      ],
      "Update the product with new price": [
        ""
      ],
      "Update product with new price": [
        ""
      ],
      "Confirm update": [
        "Kasaba konumu"
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        ""
      ],
      "Add more elements to the inventory": [
        ""
      ],
      "Report elements lost in the inventory": [
        ""
      ],
      "New price for the product": [
        ""
      ],
      "There are values with errors.": [
        ""
      ],
      "Update product with new stock and price": [
        ""
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        ""
      ],
      "Product (ID: %1$s) has been deleted": [
        ""
      ],
      "Jump to product with the given product ID": [
        ""
      ],
      "Product id": [
        "\xDCr\xFCnler"
      ],
      "Delete product": [
        "\xDCr\xFCnler"
      ],
      'Delete the product "%1$s"': [
        ""
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        "\xDCr\xFCnler"
      ],
      "Must be greater that 0": [
        ""
      ],
      "Too short": [
        ""
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        ""
      ],
      "Name of the template in URLs.": [
        ""
      ],
      "Template name": [
        ""
      ],
      "Describe what this template stands for": [
        ""
      ],
      "Order summary": [
        ""
      ],
      "If specified here, this template will create orders with the same summary": [
        ""
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        ""
      ],
      "Amount is editable": [
        "Hesap"
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        ""
      ],
      "Is this contract restricted to some age?": [
        ""
      ],
      "Payment timeout": [
        ""
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        ""
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        ""
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        "Banka hesab\u0131"
      ],
      "Load more templates before the first one": [
        ""
      ],
      "Delete selected templates from the database": [
        ""
      ],
      "Use template to create new order": [
        ""
      ],
      "Generate a QR code for the template.": [
        ""
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        ""
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        ""
      ],
      "Jump to template with the given template ID": [
        ""
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        ""
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        ""
      ],
      "Print": [
        ""
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        ""
      ],
      "If specified, this template will create orders with the same price": [
        ""
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        ""
      ],
      "An amount is required": [
        ""
      ],
      "An order summary is required": [
        ""
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        ""
      ],
      "Amount of the order": [
        ""
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        ""
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        ""
      ],
      "Valid After": [
        ""
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        ""
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        ""
      ],
      "Remove this token family from the database": [
        ""
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        ""
      ],
      "Token family has been deleted.": [
        ""
      ],
      "Delete token family": [
        "Olu\u015Fturulma"
      ],
      'Delete the token family "%1$s"': [
        ""
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        ""
      ],
      "Deleting a token family %1$s .": [
        ""
      ],
      "can't be undone": [
        ""
      ],
      "Token Family: %1$s": [
        ""
      ],
      "Incoming wire transfers": [
        ""
      ],
      "Load more wire transfers preceding the first one": [
        ""
      ],
      "Expected credit": [
        ""
      ],
      "Confirmed": [
        "Kasaba konumu"
      ],
      "Validated": [
        ""
      ],
      "Executed on": [
        ""
      ],
      "yes": [
        ""
      ],
      "no": [
        ""
      ],
      "never": [
        ""
      ],
      "unknown": [
        ""
      ],
      "Load more transfers after the last one": [
        ""
      ],
      "Verified wire transfers": [
        ""
      ],
      "Verified": [
        ""
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        ""
      ],
      "All accounts": [
        "Hesap"
      ],
      "Filter by account address": [
        ""
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        ""
      ],
      "Only show wire transfers confirmed by the merchant": [
        ""
      ],
      "Wire transfer already confirmed.": [
        ""
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        ""
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        ""
      ],
      "Transfer ID": [
        ""
      ],
      "It's not the same.": [
        ""
      ],
      'You are deleting the instance with ID "%1$s"': [
        ""
      ],
      "Instance": [
        ""
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        ""
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        ""
      ],
      "Delete this instance": [
        ""
      ],
      "Must be one of '%1$s'": [
        ""
      ],
      "URL is invalid": [
        ""
      ],
      "Webhook ID to use": [
        ""
      ],
      "Event": [
        ""
      ],
      "Payment": [
        ""
      ],
      "Order settled": [
        ""
      ],
      "Category added": [
        ""
      ],
      "Category updated": [
        ""
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        ""
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        ""
      ],
      "Method": [
        ""
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        ""
      ],
      "URL": [
        ""
      ],
      "URL of the webhook where the customer will be redirected": [
        ""
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        ""
      ],
      "order's price": [
        ""
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        ""
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        ""
      ],
      "Header template of the webhook": [
        ""
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        ""
      ],
      "Webhook deleted successfully": [
        ""
      ],
      "Add new webhooks": [
        ""
      ],
      "Load more webhooks before the first one": [
        ""
      ],
      "Event type": [
        ""
      ],
      "Delete selected webhook from the database": [
        ""
      ],
      "Load more webhooks after the last one": [
        ""
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        ""
      ],
      "Webhook updated": [
        ""
      ],
      "Header": [
        ""
      ],
      "Body": [
        ""
      ],
      "Body template used by the webhook": [
        ""
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        ""
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        "Olu\u015Fturulma"
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        ""
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        ""
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        ""
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        ""
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        ""
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        ""
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        ""
      ],
      "hour": [
        ""
      ],
      "day": [
        ""
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        ""
      ],
      "Time range": [
        ""
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        ""
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        ""
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        ""
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        ""
      ],
      "KYC verification needed": [
        ""
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        ""
      ],
      "Unexpected error.": [
        ""
      ],
      "Add new instance": [
        "Banka hesab\u0131"
      ],
      "Edit": [
        ""
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        ""
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        ""
      ],
      "Only show active instances": [
        ""
      ],
      "Active": [
        ""
      ],
      "Only show deleted instances": [
        ""
      ],
      "Deleted": [
        ""
      ],
      "Show all instances": [
        ""
      ],
      "Delete instance": [
        ""
      ],
      'Delete the instance "%1$s"': [
        ""
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        ""
      ],
      "This cannot be undone!": [
        ""
      ],
      "Purge the instance": [
        ""
      ],
      'Purge the instance "%1$s"': [
        ""
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        ""
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        ""
      ],
      "Changing": [
        ""
      ],
      "Manage password": [
        ""
      ],
      "Business Name": [
        ""
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        ""
      ],
      "title%1$s: New bank account": [
        "Banka hesab\u0131"
      ],
      "title%1$s: Bank accounts": [
        "Banka hesab\u0131"
      ],
      "title%1$s: Update bank Account": [
        ""
      ],
      "title%1$s: Orders": [
        ""
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        ""
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        ""
      ],
      "title%1$s: Wire transfers": [
        ""
      ],
      "title%1$s: Webhooks": [
        ""
      ],
      "title%1$s: New webhook": [
        ""
      ],
      "title%1$s: Update webhook": [
        ""
      ],
      "title%1$s: OTP devices": [
        ""
      ],
      "title%1$s: New OTP device": [
        ""
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        ""
      ],
      "title%1$s: Update template": [
        ""
      ],
      "title%1$s: Templates": [
        ""
      ],
      "title%1$s: Use template": [
        ""
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        ""
      ],
      "title%1$s: Access tokens": [
        "Olu\u015Fturulma"
      ],
      "title%1$s: New access token": [
        "Olu\u015Fturulma"
      ],
      "titleNew instance": [
        ""
      ],
      "titleInstances": [
        ""
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=n != 1;",
  "lang": "tr",
  "completeness": 6
};
strings["sv"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=n != 1;",
        "lang": "sv"
      },
      "Cancel": [
        "Avbryt"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        ""
      ],
      "Continue": [
        ""
      ],
      "Clear": [
        ""
      ],
      "Confirm": [
        "Bekr\xE4fta"
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        ""
      ],
      "Host": [
        ""
      ],
      "Account ID": [
        ""
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        ""
      ],
      "Bank host": [
        ""
      ],
      "Bank account": [
        ""
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        ""
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        ""
      ],
      "Receiver postal code": [
        ""
      ],
      "Receiver town": [
        ""
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        ""
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        ""
      ],
      "days": [
        ""
      ],
      "hours": [
        ""
      ],
      "minutes": [
        ""
      ],
      "seconds": [
        ""
      ],
      "Forever": [
        ""
      ],
      "%1$sM": [
        ""
      ],
      "%1$sY": [
        ""
      ],
      "%1$sd": [
        ""
      ],
      "%1$sh": [
        ""
      ],
      "%1$smin": [
        ""
      ],
      "%1$ssec": [
        ""
      ],
      "Change value to never": [
        ""
      ],
      "Change value to empty": [
        ""
      ],
      "Image must be smaller than 1 MB": [
        ""
      ],
      "Add": [
        ""
      ],
      "Remove": [
        ""
      ],
      "Country": [
        ""
      ],
      "Building number": [
        ""
      ],
      "Building name": [
        ""
      ],
      "Street": [
        ""
      ],
      "Post code": [
        ""
      ],
      "Town location": [
        ""
      ],
      "District": [
        ""
      ],
      "Country subdivision": [
        ""
      ],
      "Additional address lines": [
        ""
      ],
      "Orders": [
        ""
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        ""
      ],
      "Templates": [
        ""
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        ""
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        ""
      ],
      "Settings": [
        ""
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        ""
      ],
      "Connection": [
        ""
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        ""
      ],
      "New": [
        ""
      ],
      "List": [
        ""
      ],
      "Log out": [
        ""
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        ""
      ],
      "Business name": [
        ""
      ],
      "Legal name of the business represented by this instance.": [
        ""
      ],
      "Email": [
        ""
      ],
      "Contact email": [
        ""
      ],
      "Phone number": [
        ""
      ],
      "Contact phone": [
        ""
      ],
      "Website URL": [
        ""
      ],
      "URL.": [
        ""
      ],
      "Logo": [
        ""
      ],
      "Logo image.": [
        ""
      ],
      "Physical location of the merchant.": [
        ""
      ],
      "Jurisdiction": [
        ""
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        ""
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        ""
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        ""
      ],
      "Default refund delay": [
        ""
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        ""
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        ""
      ],
      "Default wire transfer rounding interval": [
        ""
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        ""
      ],
      "To second": [
        ""
      ],
      "To minute": [
        ""
      ],
      "To hour": [
        ""
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        ""
      ],
      "Required": [
        "Obligatoriskt"
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        ""
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        ""
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        ""
      ],
      "Verify": [
        ""
      ],
      "Failed to send the verification code.": [
        ""
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        ""
      ],
      "Login required": [
        ""
      ],
      "instance name": [
        ""
      ],
      "current password": [
        ""
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        ""
      ],
      "Invalid": [
        ""
      ],
      "Doesn't have the pattern of an email": [
        ""
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        ""
      ],
      "Max 7 lines": [
        ""
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        ""
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        "Bekr\xE4fta"
      ],
      "Not found.": [
        ""
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        ""
      ],
      "Repeat password": [
        ""
      ],
      "Confirm the same password": [
        ""
      ],
      "Please complete the marked fields and choose authorization method": [
        ""
      ],
      "Confirm operation": [
        ""
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        ""
      ],
      "Description": [
        ""
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        ""
      ],
      "Time the access token will be valid.": [
        ""
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        ""
      ],
      "Read only": [
        ""
      ],
      "All": [
        ""
      ],
      "Order simple": [
        ""
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        ""
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        ""
      ],
      "Please complete the marked fields": [
        ""
      ],
      "Access token created": [
        ""
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        ""
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        ""
      ],
      "Create access token": [
        ""
      ],
      "Load more devices before the first one": [
        ""
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        ""
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        ""
      ],
      "Remove this access token": [
        ""
      ],
      "Delete": [
        ""
      ],
      "Load more devices after the last one": [
        ""
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        ""
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        ""
      ],
      "Deleting an access token cannot be undone.": [
        ""
      ],
      "This is not a valid Bitcoin address.": [
        ""
      ],
      "This is not a valid Ethereum address.": [
        ""
      ],
      "This is not a valid host.": [
        ""
      ],
      "IBANs usually have more than 4 digits.": [
        ""
      ],
      "IBANs usually have fewer than 34 digits.": [
        ""
      ],
      "The IBAN's country code could not be retrieved.": [
        ""
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        ""
      ],
      "This account is not allowed.": [
        ""
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        ""
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        ""
      ],
      "Routing number": [
        ""
      ],
      "Account": [
        ""
      ],
      "Account number": [
        ""
      ],
      "Code": [
        ""
      ],
      "Business Identifier Code": [
        ""
      ],
      "International Bank Account Number": [
        ""
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        ""
      ],
      "Bitcoin protocol": [
        ""
      ],
      "Ethereum protocol": [
        ""
      ],
      "Interledger protocol": [
        ""
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        ""
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        ""
      ],
      "Invalid url": [
        ""
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        "Bekr\xE4fta"
      ],
      'Server replied with "bad request".': [
        ""
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        ""
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        ""
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        ""
      ],
      "Do not change": [
        ""
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        ""
      ],
      "Account details": [
        ""
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        ""
      ],
      "Bank accounts": [
        ""
      ],
      "Add new account": [
        ""
      ],
      "Owner's name": [
        ""
      ],
      "Delete selected accounts from the database": [
        ""
      ],
      "There are no accounts yet, add more pressing the + sign": [
        ""
      ],
      "You must provide a bank account to receive payments.": [
        ""
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        ""
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        ""
      ],
      "Add new devices": [
        ""
      ],
      "ID": [
        ""
      ],
      "Total products": [
        ""
      ],
      "Delete selected category from the database": [
        ""
      ],
      "There are no categories yet, add more pressing the + sign": [
        ""
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        ""
      ],
      "Products": [
        ""
      ],
      "Image": [
        ""
      ],
      "Load more products after the last one": [
        ""
      ],
      "There are no products in this category.": [
        ""
      ],
      "Account's KYC status": [
        ""
      ],
      "Exchange": [
        ""
      ],
      "Status": [
        ""
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        "Obligatoriskt"
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        ""
      ],
      "More information required.": [
        ""
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        ""
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        ""
      ],
      "No pending kyc verification!": [
        ""
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        "Obligatoriskt"
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        ""
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        ""
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        ""
      ],
      "Enter description or id": [
        ""
      ],
      "No match found for that description or ID.": [
        ""
      ],
      "You must enter a valid product identifier.": [
        ""
      ],
      "Quantity must be greater than 0!": [
        ""
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        ""
      ],
      "Search product": [
        ""
      ],
      "Quantity": [
        ""
      ],
      "How many products will be added": [
        ""
      ],
      "Add from inventory": [
        ""
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        ""
      ],
      "Amount": [
        ""
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        ""
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        ""
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        ""
      ],
      "Add tax to the tax list": [
        ""
      ],
      "Describe and add a product that is not in the inventory list": [
        ""
      ],
      "Add custom product": [
        ""
      ],
      "Complete information of the product": [
        ""
      ],
      "Must be a number.": [
        ""
      ],
      "Must be greater than 0.": [
        ""
      ],
      "Photo of the product.": [
        ""
      ],
      "Full product description.": [
        ""
      ],
      "Unit name": [
        ""
      ],
      "Name of the product unit.": [
        ""
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        ""
      ],
      "How many products will be added.": [
        ""
      ],
      "Taxes": [
        ""
      ],
      "Total price": [
        ""
      ],
      "Must be greater than 0": [
        ""
      ],
      "Must have a refund deadline": [
        ""
      ],
      "Auto refund can't be after refund deadline": [
        ""
      ],
      "Must be in the future": [
        ""
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        ""
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        ""
      ],
      "%1$s products with a total price of %2$s.": [
        ""
      ],
      "Manage list of products in the order.": [
        ""
      ],
      "Remove this product from the order.": [
        ""
      ],
      "Products price sum": [
        ""
      ],
      "Total product price added up": [
        ""
      ],
      "Order price": [
        ""
      ],
      "Amount to be paid by the customer": [
        ""
      ],
      "Final order price": [
        ""
      ],
      "Summary": [
        ""
      ],
      "Title of the order to be shown to the customer": [
        ""
      ],
      "Shipping and fulfillment": [
        ""
      ],
      "Delivery date": [
        ""
      ],
      "Deadline for physical delivery assured by the merchant.": [
        ""
      ],
      "Delivery location": [
        ""
      ],
      "Address where the products will be delivered": [
        ""
      ],
      "Fulfillment URL": [
        ""
      ],
      "URL to which the user will be redirected after successful payment.": [
        ""
      ],
      "Fulfillment message": [
        ""
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        ""
      ],
      "Override default Taler payment settings for this order": [
        ""
      ],
      "Payment time": [
        ""
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        ""
      ],
      "Default": [
        ""
      ],
      "Refund time": [
        ""
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        ""
      ],
      "Wire transfer time": [
        ""
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        ""
      ],
      "Auto-refund time": [
        ""
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        ""
      ],
      "Maximum fee": [
        ""
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        ""
      ],
      "Create token": [
        ""
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        ""
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        ""
      ],
      "Minimum age defined by the products is %1$s": [
        ""
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        ""
      ],
      "Custom information to be included in the contract for this order.": [
        ""
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        ""
      ],
      "remove": [
        ""
      ],
      "Custom field name": [
        ""
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        ""
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        ""
      ],
      "Only show unpaid orders": [
        ""
      ],
      "Only show paid orders": [
        ""
      ],
      "Paid": [
        ""
      ],
      "Only show orders with refunds": [
        ""
      ],
      "Refunded": [
        ""
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        ""
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        ""
      ],
      "Completed": [
        ""
      ],
      "Remove all filters": [
        ""
      ],
      "Clear date filter": [
        ""
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        ""
      ],
      "Order id": [
        ""
      ],
      "Instance unknown": [
        ""
      ],
      "Order unknown": [
        ""
      ],
      "Create order": [
        ""
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        ""
      ],
      "Refund": [
        ""
      ],
      "copy url": [
        ""
      ],
      "Load more orders after the last one": [
        ""
      ],
      "No orders have been found matching your query!": [
        ""
      ],
      "Duplicated": [
        ""
      ],
      "This value exceeds the refundable amount.": [
        ""
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        ""
      ],
      "Reason": [
        ""
      ],
      "Amount to be refunded": [
        ""
      ],
      "Max refundable:": [
        ""
      ],
      "Choose one...": [
        ""
      ],
      "Requested by the customer": [
        ""
      ],
      "Other": [
        ""
      ],
      "Why this order is being refunded": [
        ""
      ],
      "More information to give context": [
        ""
      ],
      "now": [
        ""
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        ""
      ],
      "This wire transfer has been notified by the payment service provider.": [
        ""
      ],
      "This refund is waiting to be claimed by the customer.": [
        ""
      ],
      "This refund has been claimed by the customer.": [
        ""
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        ""
      ],
      "Human-readable description of the whole purchase": [
        ""
      ],
      "Total price for the transaction": [
        ""
      ],
      "URL for this purchase": [
        ""
      ],
      "Max fee": [
        ""
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        ""
      ],
      "Time when this contract was generated": [
        ""
      ],
      "Refund deadline": [
        ""
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        ""
      ],
      "Payment deadline": [
        ""
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        ""
      ],
      "Wire transfer deadline": [
        ""
      ],
      "Transfer deadline for the exchange": [
        ""
      ],
      "Time indicating when the order should be delivered": [
        ""
      ],
      "Where the order will be delivered": [
        ""
      ],
      "Auto-refund delay": [
        ""
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        ""
      ],
      "Extra info": [
        ""
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        ""
      ],
      "order created": [
        ""
      ],
      "pay deadline": [
        ""
      ],
      "refund deadline": [
        ""
      ],
      "delivery": [
        ""
      ],
      "Order": [
        ""
      ],
      "Claimed": [
        ""
      ],
      "Claimed at": [
        ""
      ],
      "Timeline": [
        ""
      ],
      "Payment details": [
        ""
      ],
      "Order status": [
        ""
      ],
      "Unpaid": [
        ""
      ],
      "Product list": [
        ""
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        ""
      ],
      "refund created: %1$s: %2$s": [
        ""
      ],
      "refund taken: %1$s": [
        ""
      ],
      "refund taken: %1$s: %2$s": [
        ""
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        ""
      ],
      "Wired": [
        ""
      ],
      "Refund order": [
        ""
      ],
      "Not refundable": [
        ""
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        ""
      ],
      "Refund taken": [
        ""
      ],
      "Status URL": [
        ""
      ],
      "Refund URI": [
        ""
      ],
      "Pay at": [
        ""
      ],
      "Order status URL": [
        ""
      ],
      "Payment URI": [
        ""
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        ""
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        ""
      ],
      "The size of the key must be 32 characters": [
        ""
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        ""
      ],
      "Algorithm used to verify transactions in offline mode": [
        ""
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        ""
      ],
      "Random": [
        ""
      ],
      "Create another": [
        ""
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        ""
      ],
      "Delete selected devices from the database": [
        ""
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        ""
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        ""
      ],
      "Algorithm to use to verify transactions in offline mode": [
        ""
      ],
      "Not modified": [
        ""
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        ""
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        ""
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        ""
      ],
      "Testing password change": [
        ""
      ],
      "Password changed": [
        ""
      ],
      "The current password is wrong.": [
        ""
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        ""
      ],
      "Add element to the list": [
        ""
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        ""
      ],
      "Manage stock": [
        ""
      ],
      "This product has been configured without stock control": [
        ""
      ],
      "Infinite": [
        ""
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        ""
      ],
      "Incoming": [
        ""
      ],
      "Lost": [
        ""
      ],
      "Current": [
        ""
      ],
      "Remove stock control for this product": [
        ""
      ],
      "without stock": [
        ""
      ],
      "Next restock": [
        ""
      ],
      "Warehouse address": [
        ""
      ],
      "Invalid amount": [
        ""
      ],
      "Product identification to use in URLs (for internal use only).": [
        ""
      ],
      "Illustration of the product for customers.": [
        ""
      ],
      "Product name.": [
        ""
      ],
      "Product description for customers.": [
        ""
      ],
      "Age restriction": [
        ""
      ],
      "Is this product restricted for customer below certain age?": [
        ""
      ],
      "Minimum age of the customer": [
        ""
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        ""
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        ""
      ],
      "Stock": [
        ""
      ],
      "Inventory for products with finite supply (for internal use only).": [
        ""
      ],
      "Taxes included in the product price, exposed to customers.": [
        ""
      ],
      "Search by category description or id": [
        ""
      ],
      "Categories where this product will be listed on.": [
        ""
      ],
      "Add product to inventory": [
        ""
      ],
      "Product not found.": [
        ""
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        ""
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        ""
      ],
      "Update": [
        ""
      ],
      "Remove this product from the database": [
        ""
      ],
      "Update the product with new price": [
        ""
      ],
      "Update product with new price": [
        ""
      ],
      "Confirm update": [
        ""
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        ""
      ],
      "Add more elements to the inventory": [
        ""
      ],
      "Report elements lost in the inventory": [
        ""
      ],
      "New price for the product": [
        ""
      ],
      "There are values with errors.": [
        ""
      ],
      "Update product with new stock and price": [
        ""
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        ""
      ],
      "Product (ID: %1$s) has been deleted": [
        ""
      ],
      "Jump to product with the given product ID": [
        ""
      ],
      "Product id": [
        ""
      ],
      "Delete product": [
        ""
      ],
      'Delete the product "%1$s"': [
        ""
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        ""
      ],
      "Must be greater that 0": [
        ""
      ],
      "Too short": [
        ""
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        ""
      ],
      "Name of the template in URLs.": [
        ""
      ],
      "Template name": [
        ""
      ],
      "Describe what this template stands for": [
        ""
      ],
      "Order summary": [
        ""
      ],
      "If specified here, this template will create orders with the same summary": [
        ""
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        ""
      ],
      "Amount is editable": [
        ""
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        ""
      ],
      "Is this contract restricted to some age?": [
        ""
      ],
      "Payment timeout": [
        ""
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        ""
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        ""
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        ""
      ],
      "Load more templates before the first one": [
        ""
      ],
      "Delete selected templates from the database": [
        ""
      ],
      "Use template to create new order": [
        ""
      ],
      "Generate a QR code for the template.": [
        ""
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        ""
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        ""
      ],
      "Jump to template with the given template ID": [
        ""
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        ""
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        ""
      ],
      "Print": [
        ""
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        ""
      ],
      "If specified, this template will create orders with the same price": [
        ""
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        ""
      ],
      "An amount is required": [
        ""
      ],
      "An order summary is required": [
        ""
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        ""
      ],
      "Amount of the order": [
        ""
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        ""
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        ""
      ],
      "Valid After": [
        ""
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        ""
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        ""
      ],
      "Remove this token family from the database": [
        ""
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        ""
      ],
      "Token family has been deleted.": [
        ""
      ],
      "Delete token family": [
        ""
      ],
      'Delete the token family "%1$s"': [
        ""
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        ""
      ],
      "Deleting a token family %1$s .": [
        ""
      ],
      "can't be undone": [
        ""
      ],
      "Token Family: %1$s": [
        ""
      ],
      "Incoming wire transfers": [
        ""
      ],
      "Load more wire transfers preceding the first one": [
        ""
      ],
      "Expected credit": [
        ""
      ],
      "Confirmed": [
        ""
      ],
      "Validated": [
        ""
      ],
      "Executed on": [
        ""
      ],
      "yes": [
        ""
      ],
      "no": [
        ""
      ],
      "never": [
        ""
      ],
      "unknown": [
        ""
      ],
      "Load more transfers after the last one": [
        ""
      ],
      "Verified wire transfers": [
        ""
      ],
      "Verified": [
        ""
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        ""
      ],
      "All accounts": [
        ""
      ],
      "Filter by account address": [
        ""
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        ""
      ],
      "Only show wire transfers confirmed by the merchant": [
        ""
      ],
      "Wire transfer already confirmed.": [
        ""
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        ""
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        ""
      ],
      "Transfer ID": [
        ""
      ],
      "It's not the same.": [
        ""
      ],
      'You are deleting the instance with ID "%1$s"': [
        ""
      ],
      "Instance": [
        ""
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        ""
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        ""
      ],
      "Delete this instance": [
        ""
      ],
      "Must be one of '%1$s'": [
        ""
      ],
      "URL is invalid": [
        ""
      ],
      "Webhook ID to use": [
        ""
      ],
      "Event": [
        ""
      ],
      "Payment": [
        ""
      ],
      "Order settled": [
        ""
      ],
      "Category added": [
        ""
      ],
      "Category updated": [
        ""
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        ""
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        ""
      ],
      "Method": [
        ""
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        ""
      ],
      "URL": [
        ""
      ],
      "URL of the webhook where the customer will be redirected": [
        ""
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        ""
      ],
      "order's price": [
        ""
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        ""
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        ""
      ],
      "Header template of the webhook": [
        ""
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        ""
      ],
      "Webhook deleted successfully": [
        ""
      ],
      "Add new webhooks": [
        ""
      ],
      "Load more webhooks before the first one": [
        ""
      ],
      "Event type": [
        ""
      ],
      "Delete selected webhook from the database": [
        ""
      ],
      "Load more webhooks after the last one": [
        ""
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        ""
      ],
      "Webhook updated": [
        ""
      ],
      "Header": [
        ""
      ],
      "Body": [
        ""
      ],
      "Body template used by the webhook": [
        ""
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        ""
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        ""
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        ""
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        ""
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        ""
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        ""
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        ""
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        ""
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        ""
      ],
      "hour": [
        ""
      ],
      "day": [
        ""
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        ""
      ],
      "Time range": [
        ""
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        ""
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        ""
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        ""
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        ""
      ],
      "KYC verification needed": [
        ""
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        ""
      ],
      "Unexpected error.": [
        ""
      ],
      "Add new instance": [
        ""
      ],
      "Edit": [
        ""
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        ""
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        ""
      ],
      "Only show active instances": [
        ""
      ],
      "Active": [
        ""
      ],
      "Only show deleted instances": [
        ""
      ],
      "Deleted": [
        ""
      ],
      "Show all instances": [
        ""
      ],
      "Delete instance": [
        ""
      ],
      'Delete the instance "%1$s"': [
        ""
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        ""
      ],
      "This cannot be undone!": [
        ""
      ],
      "Purge the instance": [
        ""
      ],
      'Purge the instance "%1$s"': [
        ""
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        ""
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        ""
      ],
      "Changing": [
        ""
      ],
      "Manage password": [
        ""
      ],
      "Business Name": [
        ""
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        ""
      ],
      "title%1$s: New bank account": [
        ""
      ],
      "title%1$s: Bank accounts": [
        ""
      ],
      "title%1$s: Update bank Account": [
        ""
      ],
      "title%1$s: Orders": [
        ""
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        ""
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        ""
      ],
      "title%1$s: Wire transfers": [
        ""
      ],
      "title%1$s: Webhooks": [
        ""
      ],
      "title%1$s: New webhook": [
        ""
      ],
      "title%1$s: Update webhook": [
        ""
      ],
      "title%1$s: OTP devices": [
        ""
      ],
      "title%1$s: New OTP device": [
        ""
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        ""
      ],
      "title%1$s: Update template": [
        ""
      ],
      "title%1$s: Templates": [
        ""
      ],
      "title%1$s: Use template": [
        ""
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        ""
      ],
      "title%1$s: Access tokens": [
        ""
      ],
      "title%1$s: New access token": [
        ""
      ],
      "titleNew instance": [
        ""
      ],
      "titleInstances": [
        ""
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=n != 1;",
  "lang": "sv",
  "completeness": 0
};
strings["it"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=n != 1;",
        "lang": "it"
      },
      "Cancel": [
        ""
      ],
      "%1$s": [
        ""
      ],
      "Close": [
        ""
      ],
      "Continue": [
        ""
      ],
      "Clear": [
        ""
      ],
      "Confirm": [
        "Confermare"
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        ""
      ],
      "Host": [
        ""
      ],
      "Account ID": [
        "Importo"
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        ""
      ],
      "Bank host": [
        ""
      ],
      "Bank account": [
        ""
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        ""
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        "Soggetto"
      ],
      "Receiver postal code": [
        ""
      ],
      "Receiver town": [
        ""
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        ""
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        ""
      ],
      "days": [
        ""
      ],
      "hours": [
        ""
      ],
      "minutes": [
        ""
      ],
      "seconds": [
        ""
      ],
      "Forever": [
        ""
      ],
      "%1$sM": [
        ""
      ],
      "%1$sY": [
        ""
      ],
      "%1$sd": [
        ""
      ],
      "%1$sh": [
        ""
      ],
      "%1$smin": [
        ""
      ],
      "%1$ssec": [
        ""
      ],
      "Change value to never": [
        ""
      ],
      "Change value to empty": [
        ""
      ],
      "Image must be smaller than 1 MB": [
        ""
      ],
      "Add": [
        ""
      ],
      "Remove": [
        ""
      ],
      "Country": [
        ""
      ],
      "Building number": [
        ""
      ],
      "Building name": [
        ""
      ],
      "Street": [
        ""
      ],
      "Post code": [
        ""
      ],
      "Town location": [
        ""
      ],
      "District": [
        ""
      ],
      "Country subdivision": [
        ""
      ],
      "Additional address lines": [
        ""
      ],
      "Orders": [
        ""
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        ""
      ],
      "Templates": [
        ""
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        ""
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        ""
      ],
      "Settings": [
        "Impostazioni"
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        ""
      ],
      "Connection": [
        ""
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        ""
      ],
      "New": [
        ""
      ],
      "List": [
        ""
      ],
      "Log out": [
        ""
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        ""
      ],
      "Business name": [
        ""
      ],
      "Legal name of the business represented by this instance.": [
        ""
      ],
      "Email": [
        ""
      ],
      "Contact email": [
        ""
      ],
      "Phone number": [
        ""
      ],
      "Contact phone": [
        ""
      ],
      "Website URL": [
        ""
      ],
      "URL.": [
        ""
      ],
      "Logo": [
        ""
      ],
      "Logo image.": [
        ""
      ],
      "Physical location of the merchant.": [
        ""
      ],
      "Jurisdiction": [
        ""
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        ""
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        ""
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        ""
      ],
      "Default refund delay": [
        ""
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        ""
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        ""
      ],
      "Default wire transfer rounding interval": [
        ""
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        ""
      ],
      "To second": [
        ""
      ],
      "To minute": [
        ""
      ],
      "To hour": [
        ""
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        ""
      ],
      "Required": [
        "Obbligatorio"
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        ""
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        ""
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        "Indietro"
      ],
      "Verify": [
        ""
      ],
      "Failed to send the verification code.": [
        ""
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        ""
      ],
      "Login required": [
        ""
      ],
      "instance name": [
        ""
      ],
      "current password": [
        ""
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        ""
      ],
      "Invalid": [
        ""
      ],
      "Doesn't have the pattern of an email": [
        ""
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        ""
      ],
      "Max 7 lines": [
        ""
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        ""
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        "Confermare"
      ],
      "Not found.": [
        ""
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        ""
      ],
      "Repeat password": [
        ""
      ],
      "Confirm the same password": [
        ""
      ],
      "Please complete the marked fields and choose authorization method": [
        ""
      ],
      "Confirm operation": [
        ""
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        ""
      ],
      "Description": [
        ""
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        ""
      ],
      "Time the access token will be valid.": [
        ""
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        ""
      ],
      "Read only": [
        ""
      ],
      "All": [
        ""
      ],
      "Order simple": [
        ""
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        ""
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        ""
      ],
      "Please complete the marked fields": [
        ""
      ],
      "Access token created": [
        ""
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        ""
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        ""
      ],
      "Create access token": [
        ""
      ],
      "Load more devices before the first one": [
        ""
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        ""
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        ""
      ],
      "Remove this access token": [
        ""
      ],
      "Delete": [
        ""
      ],
      "Load more devices after the last one": [
        ""
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        ""
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        ""
      ],
      "Deleting an access token cannot be undone.": [
        ""
      ],
      "This is not a valid Bitcoin address.": [
        ""
      ],
      "This is not a valid Ethereum address.": [
        ""
      ],
      "This is not a valid host.": [
        ""
      ],
      "IBANs usually have more than 4 digits.": [
        ""
      ],
      "IBANs usually have fewer than 34 digits.": [
        ""
      ],
      "The IBAN's country code could not be retrieved.": [
        ""
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        ""
      ],
      "This account is not allowed.": [
        ""
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        ""
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        ""
      ],
      "Routing number": [
        ""
      ],
      "Account": [
        ""
      ],
      "Account number": [
        "Importo"
      ],
      "Code": [
        ""
      ],
      "Business Identifier Code": [
        ""
      ],
      "International Bank Account Number": [
        ""
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        ""
      ],
      "Bitcoin protocol": [
        ""
      ],
      "Ethereum protocol": [
        ""
      ],
      "Interledger protocol": [
        ""
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        ""
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        ""
      ],
      "Invalid url": [
        ""
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        "Confermare"
      ],
      'Server replied with "bad request".': [
        ""
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        "Conto:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        ""
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        ""
      ],
      "Do not change": [
        ""
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        ""
      ],
      "Account details": [
        ""
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        ""
      ],
      "Bank accounts": [
        ""
      ],
      "Add new account": [
        ""
      ],
      "Owner's name": [
        ""
      ],
      "Delete selected accounts from the database": [
        ""
      ],
      "There are no accounts yet, add more pressing the + sign": [
        ""
      ],
      "You must provide a bank account to receive payments.": [
        ""
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        ""
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        ""
      ],
      "Add new devices": [
        ""
      ],
      "ID": [
        ""
      ],
      "Total products": [
        ""
      ],
      "Delete selected category from the database": [
        ""
      ],
      "There are no categories yet, add more pressing the + sign": [
        ""
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        ""
      ],
      "Products": [
        ""
      ],
      "Image": [
        ""
      ],
      "Load more products after the last one": [
        ""
      ],
      "There are no products in this category.": [
        ""
      ],
      "Account's KYC status": [
        ""
      ],
      "Exchange": [
        ""
      ],
      "Status": [
        ""
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        "Obbligatorio"
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        ""
      ],
      "More information required.": [
        ""
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        ""
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        ""
      ],
      "No pending kyc verification!": [
        ""
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        "Obbligatorio"
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        ""
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        ""
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        ""
      ],
      "Enter description or id": [
        ""
      ],
      "No match found for that description or ID.": [
        ""
      ],
      "You must enter a valid product identifier.": [
        ""
      ],
      "Quantity must be greater than 0!": [
        ""
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        ""
      ],
      "Search product": [
        ""
      ],
      "Quantity": [
        ""
      ],
      "How many products will be added": [
        ""
      ],
      "Add from inventory": [
        ""
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        ""
      ],
      "Amount": [
        "Importo"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        ""
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        ""
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        ""
      ],
      "Add tax to the tax list": [
        ""
      ],
      "Describe and add a product that is not in the inventory list": [
        ""
      ],
      "Add custom product": [
        ""
      ],
      "Complete information of the product": [
        ""
      ],
      "Must be a number.": [
        ""
      ],
      "Must be greater than 0.": [
        ""
      ],
      "Photo of the product.": [
        ""
      ],
      "Full product description.": [
        ""
      ],
      "Unit name": [
        ""
      ],
      "Name of the product unit.": [
        ""
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        ""
      ],
      "How many products will be added.": [
        ""
      ],
      "Taxes": [
        ""
      ],
      "Total price": [
        ""
      ],
      "Must be greater than 0": [
        ""
      ],
      "Must have a refund deadline": [
        ""
      ],
      "Auto refund can't be after refund deadline": [
        ""
      ],
      "Must be in the future": [
        ""
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        ""
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        ""
      ],
      "%1$s products with a total price of %2$s.": [
        ""
      ],
      "Manage list of products in the order.": [
        ""
      ],
      "Remove this product from the order.": [
        ""
      ],
      "Products price sum": [
        ""
      ],
      "Total product price added up": [
        ""
      ],
      "Order price": [
        ""
      ],
      "Amount to be paid by the customer": [
        ""
      ],
      "Final order price": [
        ""
      ],
      "Summary": [
        ""
      ],
      "Title of the order to be shown to the customer": [
        ""
      ],
      "Shipping and fulfillment": [
        ""
      ],
      "Delivery date": [
        ""
      ],
      "Deadline for physical delivery assured by the merchant.": [
        ""
      ],
      "Delivery location": [
        ""
      ],
      "Address where the products will be delivered": [
        ""
      ],
      "Fulfillment URL": [
        ""
      ],
      "URL to which the user will be redirected after successful payment.": [
        ""
      ],
      "Fulfillment message": [
        ""
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        ""
      ],
      "Override default Taler payment settings for this order": [
        ""
      ],
      "Payment time": [
        ""
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        ""
      ],
      "Default": [
        ""
      ],
      "Refund time": [
        "Rimborsato"
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        ""
      ],
      "Wire transfer time": [
        ""
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        ""
      ],
      "Auto-refund time": [
        ""
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        ""
      ],
      "Maximum fee": [
        ""
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        ""
      ],
      "Create token": [
        ""
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        ""
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        ""
      ],
      "Minimum age defined by the products is %1$s": [
        ""
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        ""
      ],
      "Custom information to be included in the contract for this order.": [
        ""
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        ""
      ],
      "remove": [
        ""
      ],
      "Custom field name": [
        ""
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        ""
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        ""
      ],
      "Only show unpaid orders": [
        ""
      ],
      "Only show paid orders": [
        ""
      ],
      "Paid": [
        ""
      ],
      "Only show orders with refunds": [
        ""
      ],
      "Refunded": [
        "Rimborsato"
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        ""
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        ""
      ],
      "Completed": [
        ""
      ],
      "Remove all filters": [
        ""
      ],
      "Clear date filter": [
        ""
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        ""
      ],
      "Order id": [
        ""
      ],
      "Instance unknown": [
        ""
      ],
      "Order unknown": [
        ""
      ],
      "Create order": [
        ""
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        "Data"
      ],
      "Refund": [
        ""
      ],
      "copy url": [
        ""
      ],
      "Load more orders after the last one": [
        ""
      ],
      "No orders have been found matching your query!": [
        ""
      ],
      "Duplicated": [
        ""
      ],
      "This value exceeds the refundable amount.": [
        ""
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        "Rimborsato"
      ],
      "Reason": [
        ""
      ],
      "Amount to be refunded": [
        ""
      ],
      "Max refundable:": [
        ""
      ],
      "Choose one...": [
        ""
      ],
      "Requested by the customer": [
        ""
      ],
      "Other": [
        ""
      ],
      "Why this order is being refunded": [
        ""
      ],
      "More information to give context": [
        ""
      ],
      "now": [
        ""
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        ""
      ],
      "This wire transfer has been notified by the payment service provider.": [
        ""
      ],
      "This refund is waiting to be claimed by the customer.": [
        ""
      ],
      "This refund has been claimed by the customer.": [
        ""
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        ""
      ],
      "Human-readable description of the whole purchase": [
        ""
      ],
      "Total price for the transaction": [
        ""
      ],
      "URL for this purchase": [
        ""
      ],
      "Max fee": [
        ""
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        ""
      ],
      "Time when this contract was generated": [
        ""
      ],
      "Refund deadline": [
        ""
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        ""
      ],
      "Payment deadline": [
        ""
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        ""
      ],
      "Wire transfer deadline": [
        ""
      ],
      "Transfer deadline for the exchange": [
        ""
      ],
      "Time indicating when the order should be delivered": [
        ""
      ],
      "Where the order will be delivered": [
        ""
      ],
      "Auto-refund delay": [
        ""
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        ""
      ],
      "Extra info": [
        ""
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        ""
      ],
      "order created": [
        ""
      ],
      "pay deadline": [
        ""
      ],
      "refund deadline": [
        "Rimborsato"
      ],
      "delivery": [
        ""
      ],
      "Order": [
        ""
      ],
      "Claimed": [
        ""
      ],
      "Claimed at": [
        ""
      ],
      "Timeline": [
        ""
      ],
      "Payment details": [
        ""
      ],
      "Order status": [
        ""
      ],
      "Unpaid": [
        ""
      ],
      "Product list": [
        ""
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        ""
      ],
      "refund created: %1$s: %2$s": [
        ""
      ],
      "refund taken: %1$s": [
        ""
      ],
      "refund taken: %1$s: %2$s": [
        ""
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        ""
      ],
      "Wired": [
        ""
      ],
      "Refund order": [
        "Rimborsato"
      ],
      "Not refundable": [
        ""
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        ""
      ],
      "Refund taken": [
        ""
      ],
      "Status URL": [
        ""
      ],
      "Refund URI": [
        ""
      ],
      "Pay at": [
        ""
      ],
      "Order status URL": [
        ""
      ],
      "Payment URI": [
        ""
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        ""
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        ""
      ],
      "The size of the key must be 32 characters": [
        ""
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        ""
      ],
      "Algorithm used to verify transactions in offline mode": [
        ""
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        ""
      ],
      "Random": [
        ""
      ],
      "Create another": [
        ""
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        ""
      ],
      "Delete selected devices from the database": [
        ""
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        ""
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        ""
      ],
      "Algorithm to use to verify transactions in offline mode": [
        ""
      ],
      "Not modified": [
        ""
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        ""
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        ""
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        ""
      ],
      "Testing password change": [
        ""
      ],
      "Password changed": [
        ""
      ],
      "The current password is wrong.": [
        ""
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        "Importo"
      ],
      "Add element to the list": [
        ""
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        ""
      ],
      "Manage stock": [
        ""
      ],
      "This product has been configured without stock control": [
        ""
      ],
      "Infinite": [
        ""
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        ""
      ],
      "Incoming": [
        ""
      ],
      "Lost": [
        ""
      ],
      "Current": [
        ""
      ],
      "Remove stock control for this product": [
        ""
      ],
      "without stock": [
        ""
      ],
      "Next restock": [
        ""
      ],
      "Warehouse address": [
        ""
      ],
      "Invalid amount": [
        ""
      ],
      "Product identification to use in URLs (for internal use only).": [
        ""
      ],
      "Illustration of the product for customers.": [
        ""
      ],
      "Product name.": [
        ""
      ],
      "Product description for customers.": [
        ""
      ],
      "Age restriction": [
        ""
      ],
      "Is this product restricted for customer below certain age?": [
        ""
      ],
      "Minimum age of the customer": [
        ""
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        ""
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        ""
      ],
      "Stock": [
        ""
      ],
      "Inventory for products with finite supply (for internal use only).": [
        ""
      ],
      "Taxes included in the product price, exposed to customers.": [
        ""
      ],
      "Search by category description or id": [
        ""
      ],
      "Categories where this product will be listed on.": [
        ""
      ],
      "Add product to inventory": [
        ""
      ],
      "Product not found.": [
        ""
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        ""
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        ""
      ],
      "Update": [
        ""
      ],
      "Remove this product from the database": [
        ""
      ],
      "Update the product with new price": [
        ""
      ],
      "Update product with new price": [
        ""
      ],
      "Confirm update": [
        ""
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        ""
      ],
      "Add more elements to the inventory": [
        ""
      ],
      "Report elements lost in the inventory": [
        ""
      ],
      "New price for the product": [
        ""
      ],
      "There are values with errors.": [
        ""
      ],
      "Update product with new stock and price": [
        ""
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        ""
      ],
      "Product (ID: %1$s) has been deleted": [
        ""
      ],
      "Jump to product with the given product ID": [
        ""
      ],
      "Product id": [
        ""
      ],
      "Delete product": [
        ""
      ],
      'Delete the product "%1$s"': [
        ""
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        ""
      ],
      "Must be greater that 0": [
        ""
      ],
      "Too short": [
        ""
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        ""
      ],
      "Name of the template in URLs.": [
        ""
      ],
      "Template name": [
        ""
      ],
      "Describe what this template stands for": [
        ""
      ],
      "Order summary": [
        ""
      ],
      "If specified here, this template will create orders with the same summary": [
        ""
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        ""
      ],
      "Amount is editable": [
        ""
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        ""
      ],
      "Is this contract restricted to some age?": [
        ""
      ],
      "Payment timeout": [
        ""
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        ""
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        ""
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        ""
      ],
      "Load more templates before the first one": [
        ""
      ],
      "Delete selected templates from the database": [
        ""
      ],
      "Use template to create new order": [
        ""
      ],
      "Generate a QR code for the template.": [
        ""
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        ""
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        ""
      ],
      "Jump to template with the given template ID": [
        ""
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        ""
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        ""
      ],
      "Print": [
        ""
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        ""
      ],
      "If specified, this template will create orders with the same price": [
        ""
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        ""
      ],
      "An amount is required": [
        ""
      ],
      "An order summary is required": [
        ""
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        ""
      ],
      "Amount of the order": [
        ""
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        ""
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        ""
      ],
      "Valid After": [
        ""
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        ""
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        ""
      ],
      "Remove this token family from the database": [
        ""
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        ""
      ],
      "Token family has been deleted.": [
        ""
      ],
      "Delete token family": [
        ""
      ],
      'Delete the token family "%1$s"': [
        ""
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        ""
      ],
      "Deleting a token family %1$s .": [
        ""
      ],
      "can't be undone": [
        ""
      ],
      "Token Family: %1$s": [
        ""
      ],
      "Incoming wire transfers": [
        ""
      ],
      "Load more wire transfers preceding the first one": [
        ""
      ],
      "Expected credit": [
        ""
      ],
      "Confirmed": [
        ""
      ],
      "Validated": [
        ""
      ],
      "Executed on": [
        ""
      ],
      "yes": [
        ""
      ],
      "no": [
        ""
      ],
      "never": [
        ""
      ],
      "unknown": [
        ""
      ],
      "Load more transfers after the last one": [
        ""
      ],
      "Verified wire transfers": [
        ""
      ],
      "Verified": [
        ""
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        ""
      ],
      "All accounts": [
        ""
      ],
      "Filter by account address": [
        ""
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        ""
      ],
      "Only show wire transfers confirmed by the merchant": [
        ""
      ],
      "Wire transfer already confirmed.": [
        ""
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        ""
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        ""
      ],
      "Transfer ID": [
        ""
      ],
      "It's not the same.": [
        ""
      ],
      'You are deleting the instance with ID "%1$s"': [
        ""
      ],
      "Instance": [
        ""
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        ""
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        ""
      ],
      "Delete this instance": [
        ""
      ],
      "Must be one of '%1$s'": [
        ""
      ],
      "URL is invalid": [
        ""
      ],
      "Webhook ID to use": [
        ""
      ],
      "Event": [
        ""
      ],
      "Payment": [
        ""
      ],
      "Order settled": [
        ""
      ],
      "Category added": [
        ""
      ],
      "Category updated": [
        ""
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        ""
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        ""
      ],
      "Method": [
        ""
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        ""
      ],
      "URL": [
        ""
      ],
      "URL of the webhook where the customer will be redirected": [
        ""
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        ""
      ],
      "order's price": [
        ""
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        ""
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        ""
      ],
      "Header template of the webhook": [
        ""
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        ""
      ],
      "Webhook deleted successfully": [
        ""
      ],
      "Add new webhooks": [
        ""
      ],
      "Load more webhooks before the first one": [
        ""
      ],
      "Event type": [
        ""
      ],
      "Delete selected webhook from the database": [
        ""
      ],
      "Load more webhooks after the last one": [
        ""
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        ""
      ],
      "Webhook updated": [
        ""
      ],
      "Header": [
        ""
      ],
      "Body": [
        ""
      ],
      "Body template used by the webhook": [
        ""
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        ""
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        ""
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        ""
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        ""
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        ""
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        ""
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        ""
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        ""
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        ""
      ],
      "hour": [
        ""
      ],
      "day": [
        ""
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        ""
      ],
      "Time range": [
        ""
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        ""
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        ""
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        ""
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        ""
      ],
      "KYC verification needed": [
        ""
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        ""
      ],
      "Unexpected error.": [
        ""
      ],
      "Add new instance": [
        ""
      ],
      "Edit": [
        ""
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        ""
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        ""
      ],
      "Only show active instances": [
        ""
      ],
      "Active": [
        ""
      ],
      "Only show deleted instances": [
        ""
      ],
      "Deleted": [
        ""
      ],
      "Show all instances": [
        ""
      ],
      "Delete instance": [
        ""
      ],
      'Delete the instance "%1$s"': [
        ""
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        ""
      ],
      "This cannot be undone!": [
        ""
      ],
      "Purge the instance": [
        ""
      ],
      'Purge the instance "%1$s"': [
        ""
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        ""
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        ""
      ],
      "Changing": [
        ""
      ],
      "Manage password": [
        ""
      ],
      "Business Name": [
        ""
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        "Impostazioni"
      ],
      "title%1$s: New bank account": [
        ""
      ],
      "title%1$s: Bank accounts": [
        ""
      ],
      "title%1$s: Update bank Account": [
        ""
      ],
      "title%1$s: Orders": [
        ""
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        ""
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        ""
      ],
      "title%1$s: Wire transfers": [
        ""
      ],
      "title%1$s: Webhooks": [
        ""
      ],
      "title%1$s: New webhook": [
        ""
      ],
      "title%1$s: Update webhook": [
        ""
      ],
      "title%1$s: OTP devices": [
        ""
      ],
      "title%1$s: New OTP device": [
        ""
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        ""
      ],
      "title%1$s: Update template": [
        ""
      ],
      "title%1$s: Templates": [
        ""
      ],
      "title%1$s: Use template": [
        ""
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        ""
      ],
      "title%1$s: Access tokens": [
        ""
      ],
      "title%1$s: New access token": [
        ""
      ],
      "titleNew instance": [
        ""
      ],
      "titleInstances": [
        ""
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=n != 1;",
  "lang": "it",
  "completeness": 2
};
strings["he"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && n % 10 == 0) ? 2 : 3));",
        "lang": "he"
      },
      "Cancel": [
        ""
      ],
      "%1$s": [
        ""
      ],
      "Close": [
        ""
      ],
      "Continue": [
        ""
      ],
      "Clear": [
        ""
      ],
      "Confirm": [
        ""
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        ""
      ],
      "Host": [
        ""
      ],
      "Account ID": [
        ""
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        ""
      ],
      "Bank host": [
        ""
      ],
      "Bank account": [
        ""
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        ""
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        ""
      ],
      "Receiver postal code": [
        ""
      ],
      "Receiver town": [
        ""
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        ""
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        ""
      ],
      "days": [
        ""
      ],
      "hours": [
        ""
      ],
      "minutes": [
        ""
      ],
      "seconds": [
        ""
      ],
      "Forever": [
        ""
      ],
      "%1$sM": [
        ""
      ],
      "%1$sY": [
        ""
      ],
      "%1$sd": [
        ""
      ],
      "%1$sh": [
        ""
      ],
      "%1$smin": [
        ""
      ],
      "%1$ssec": [
        ""
      ],
      "Change value to never": [
        ""
      ],
      "Change value to empty": [
        ""
      ],
      "Image must be smaller than 1 MB": [
        ""
      ],
      "Add": [
        ""
      ],
      "Remove": [
        ""
      ],
      "Country": [
        ""
      ],
      "Building number": [
        ""
      ],
      "Building name": [
        ""
      ],
      "Street": [
        ""
      ],
      "Post code": [
        ""
      ],
      "Town location": [
        ""
      ],
      "District": [
        ""
      ],
      "Country subdivision": [
        ""
      ],
      "Additional address lines": [
        ""
      ],
      "Orders": [
        ""
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        ""
      ],
      "Templates": [
        ""
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        ""
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        ""
      ],
      "Settings": [
        ""
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        ""
      ],
      "Connection": [
        ""
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        ""
      ],
      "New": [
        ""
      ],
      "List": [
        ""
      ],
      "Log out": [
        ""
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        ""
      ],
      "Business name": [
        ""
      ],
      "Legal name of the business represented by this instance.": [
        ""
      ],
      "Email": [
        ""
      ],
      "Contact email": [
        ""
      ],
      "Phone number": [
        ""
      ],
      "Contact phone": [
        ""
      ],
      "Website URL": [
        ""
      ],
      "URL.": [
        ""
      ],
      "Logo": [
        ""
      ],
      "Logo image.": [
        ""
      ],
      "Physical location of the merchant.": [
        ""
      ],
      "Jurisdiction": [
        ""
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        ""
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        ""
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        ""
      ],
      "Default refund delay": [
        ""
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        ""
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        ""
      ],
      "Default wire transfer rounding interval": [
        ""
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        ""
      ],
      "To second": [
        ""
      ],
      "To minute": [
        ""
      ],
      "To hour": [
        ""
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        ""
      ],
      "Required": [
        ""
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        ""
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        ""
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        ""
      ],
      "Verify": [
        ""
      ],
      "Failed to send the verification code.": [
        ""
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        ""
      ],
      "Login required": [
        ""
      ],
      "instance name": [
        ""
      ],
      "current password": [
        ""
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        ""
      ],
      "Invalid": [
        ""
      ],
      "Doesn't have the pattern of an email": [
        ""
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        ""
      ],
      "Max 7 lines": [
        ""
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        ""
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        ""
      ],
      "Not found.": [
        ""
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        ""
      ],
      "Repeat password": [
        ""
      ],
      "Confirm the same password": [
        ""
      ],
      "Please complete the marked fields and choose authorization method": [
        ""
      ],
      "Confirm operation": [
        ""
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        ""
      ],
      "Description": [
        ""
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        ""
      ],
      "Time the access token will be valid.": [
        ""
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        ""
      ],
      "Read only": [
        ""
      ],
      "All": [
        ""
      ],
      "Order simple": [
        ""
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        ""
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        ""
      ],
      "Please complete the marked fields": [
        ""
      ],
      "Access token created": [
        ""
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        ""
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        ""
      ],
      "Create access token": [
        ""
      ],
      "Load more devices before the first one": [
        ""
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        ""
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        ""
      ],
      "Remove this access token": [
        ""
      ],
      "Delete": [
        ""
      ],
      "Load more devices after the last one": [
        ""
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        ""
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        ""
      ],
      "Deleting an access token cannot be undone.": [
        ""
      ],
      "This is not a valid Bitcoin address.": [
        ""
      ],
      "This is not a valid Ethereum address.": [
        ""
      ],
      "This is not a valid host.": [
        ""
      ],
      "IBANs usually have more than 4 digits.": [
        ""
      ],
      "IBANs usually have fewer than 34 digits.": [
        ""
      ],
      "The IBAN's country code could not be retrieved.": [
        ""
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        ""
      ],
      "This account is not allowed.": [
        ""
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        ""
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        ""
      ],
      "Routing number": [
        ""
      ],
      "Account": [
        ""
      ],
      "Account number": [
        ""
      ],
      "Code": [
        ""
      ],
      "Business Identifier Code": [
        ""
      ],
      "International Bank Account Number": [
        ""
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        ""
      ],
      "Bitcoin protocol": [
        ""
      ],
      "Ethereum protocol": [
        ""
      ],
      "Interledger protocol": [
        ""
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        ""
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        ""
      ],
      "Invalid url": [
        ""
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        ""
      ],
      'Server replied with "bad request".': [
        ""
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        ""
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        ""
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        ""
      ],
      "Do not change": [
        ""
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        ""
      ],
      "Account details": [
        ""
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        ""
      ],
      "Bank accounts": [
        ""
      ],
      "Add new account": [
        ""
      ],
      "Owner's name": [
        ""
      ],
      "Delete selected accounts from the database": [
        ""
      ],
      "There are no accounts yet, add more pressing the + sign": [
        ""
      ],
      "You must provide a bank account to receive payments.": [
        ""
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        ""
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        ""
      ],
      "Add new devices": [
        ""
      ],
      "ID": [
        ""
      ],
      "Total products": [
        ""
      ],
      "Delete selected category from the database": [
        ""
      ],
      "There are no categories yet, add more pressing the + sign": [
        ""
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        ""
      ],
      "Products": [
        ""
      ],
      "Image": [
        ""
      ],
      "Load more products after the last one": [
        ""
      ],
      "There are no products in this category.": [
        ""
      ],
      "Account's KYC status": [
        ""
      ],
      "Exchange": [
        ""
      ],
      "Status": [
        ""
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        ""
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        ""
      ],
      "More information required.": [
        ""
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        ""
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        ""
      ],
      "No pending kyc verification!": [
        ""
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        ""
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        ""
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        ""
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        ""
      ],
      "Enter description or id": [
        ""
      ],
      "No match found for that description or ID.": [
        ""
      ],
      "You must enter a valid product identifier.": [
        ""
      ],
      "Quantity must be greater than 0!": [
        ""
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        ""
      ],
      "Search product": [
        ""
      ],
      "Quantity": [
        ""
      ],
      "How many products will be added": [
        ""
      ],
      "Add from inventory": [
        ""
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        ""
      ],
      "Amount": [
        ""
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        ""
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        ""
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        ""
      ],
      "Add tax to the tax list": [
        ""
      ],
      "Describe and add a product that is not in the inventory list": [
        ""
      ],
      "Add custom product": [
        ""
      ],
      "Complete information of the product": [
        ""
      ],
      "Must be a number.": [
        ""
      ],
      "Must be greater than 0.": [
        ""
      ],
      "Photo of the product.": [
        ""
      ],
      "Full product description.": [
        ""
      ],
      "Unit name": [
        ""
      ],
      "Name of the product unit.": [
        ""
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        ""
      ],
      "How many products will be added.": [
        ""
      ],
      "Taxes": [
        ""
      ],
      "Total price": [
        ""
      ],
      "Must be greater than 0": [
        ""
      ],
      "Must have a refund deadline": [
        ""
      ],
      "Auto refund can't be after refund deadline": [
        ""
      ],
      "Must be in the future": [
        ""
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        ""
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        ""
      ],
      "%1$s products with a total price of %2$s.": [
        ""
      ],
      "Manage list of products in the order.": [
        ""
      ],
      "Remove this product from the order.": [
        ""
      ],
      "Products price sum": [
        ""
      ],
      "Total product price added up": [
        ""
      ],
      "Order price": [
        ""
      ],
      "Amount to be paid by the customer": [
        ""
      ],
      "Final order price": [
        ""
      ],
      "Summary": [
        ""
      ],
      "Title of the order to be shown to the customer": [
        ""
      ],
      "Shipping and fulfillment": [
        ""
      ],
      "Delivery date": [
        ""
      ],
      "Deadline for physical delivery assured by the merchant.": [
        ""
      ],
      "Delivery location": [
        ""
      ],
      "Address where the products will be delivered": [
        ""
      ],
      "Fulfillment URL": [
        ""
      ],
      "URL to which the user will be redirected after successful payment.": [
        ""
      ],
      "Fulfillment message": [
        ""
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        ""
      ],
      "Override default Taler payment settings for this order": [
        ""
      ],
      "Payment time": [
        ""
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        ""
      ],
      "Default": [
        ""
      ],
      "Refund time": [
        ""
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        ""
      ],
      "Wire transfer time": [
        ""
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        ""
      ],
      "Auto-refund time": [
        ""
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        ""
      ],
      "Maximum fee": [
        ""
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        ""
      ],
      "Create token": [
        ""
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        ""
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        ""
      ],
      "Minimum age defined by the products is %1$s": [
        ""
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        ""
      ],
      "Custom information to be included in the contract for this order.": [
        ""
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        ""
      ],
      "remove": [
        ""
      ],
      "Custom field name": [
        ""
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        ""
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        ""
      ],
      "Only show unpaid orders": [
        ""
      ],
      "Only show paid orders": [
        ""
      ],
      "Paid": [
        ""
      ],
      "Only show orders with refunds": [
        ""
      ],
      "Refunded": [
        ""
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        ""
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        ""
      ],
      "Completed": [
        ""
      ],
      "Remove all filters": [
        ""
      ],
      "Clear date filter": [
        ""
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        ""
      ],
      "Order id": [
        ""
      ],
      "Instance unknown": [
        ""
      ],
      "Order unknown": [
        ""
      ],
      "Create order": [
        ""
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        ""
      ],
      "Refund": [
        ""
      ],
      "copy url": [
        ""
      ],
      "Load more orders after the last one": [
        ""
      ],
      "No orders have been found matching your query!": [
        ""
      ],
      "Duplicated": [
        ""
      ],
      "This value exceeds the refundable amount.": [
        ""
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        ""
      ],
      "Reason": [
        ""
      ],
      "Amount to be refunded": [
        ""
      ],
      "Max refundable:": [
        ""
      ],
      "Choose one...": [
        ""
      ],
      "Requested by the customer": [
        ""
      ],
      "Other": [
        ""
      ],
      "Why this order is being refunded": [
        ""
      ],
      "More information to give context": [
        ""
      ],
      "now": [
        ""
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        ""
      ],
      "This wire transfer has been notified by the payment service provider.": [
        ""
      ],
      "This refund is waiting to be claimed by the customer.": [
        ""
      ],
      "This refund has been claimed by the customer.": [
        ""
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        ""
      ],
      "Human-readable description of the whole purchase": [
        ""
      ],
      "Total price for the transaction": [
        ""
      ],
      "URL for this purchase": [
        ""
      ],
      "Max fee": [
        ""
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        ""
      ],
      "Time when this contract was generated": [
        ""
      ],
      "Refund deadline": [
        ""
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        ""
      ],
      "Payment deadline": [
        ""
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        ""
      ],
      "Wire transfer deadline": [
        ""
      ],
      "Transfer deadline for the exchange": [
        ""
      ],
      "Time indicating when the order should be delivered": [
        ""
      ],
      "Where the order will be delivered": [
        ""
      ],
      "Auto-refund delay": [
        ""
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        ""
      ],
      "Extra info": [
        ""
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        ""
      ],
      "order created": [
        ""
      ],
      "pay deadline": [
        ""
      ],
      "refund deadline": [
        ""
      ],
      "delivery": [
        ""
      ],
      "Order": [
        ""
      ],
      "Claimed": [
        ""
      ],
      "Claimed at": [
        ""
      ],
      "Timeline": [
        ""
      ],
      "Payment details": [
        ""
      ],
      "Order status": [
        ""
      ],
      "Unpaid": [
        ""
      ],
      "Product list": [
        ""
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        ""
      ],
      "refund created: %1$s: %2$s": [
        ""
      ],
      "refund taken: %1$s": [
        ""
      ],
      "refund taken: %1$s: %2$s": [
        ""
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        ""
      ],
      "Wired": [
        ""
      ],
      "Refund order": [
        ""
      ],
      "Not refundable": [
        ""
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        ""
      ],
      "Refund taken": [
        ""
      ],
      "Status URL": [
        ""
      ],
      "Refund URI": [
        ""
      ],
      "Pay at": [
        ""
      ],
      "Order status URL": [
        ""
      ],
      "Payment URI": [
        ""
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        ""
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        ""
      ],
      "The size of the key must be 32 characters": [
        ""
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        ""
      ],
      "Algorithm used to verify transactions in offline mode": [
        ""
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        ""
      ],
      "Random": [
        ""
      ],
      "Create another": [
        ""
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        ""
      ],
      "Delete selected devices from the database": [
        ""
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        ""
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        ""
      ],
      "Algorithm to use to verify transactions in offline mode": [
        ""
      ],
      "Not modified": [
        ""
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        ""
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        ""
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        ""
      ],
      "Testing password change": [
        ""
      ],
      "Password changed": [
        ""
      ],
      "The current password is wrong.": [
        ""
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        ""
      ],
      "Add element to the list": [
        ""
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        ""
      ],
      "Manage stock": [
        ""
      ],
      "This product has been configured without stock control": [
        ""
      ],
      "Infinite": [
        ""
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        ""
      ],
      "Incoming": [
        ""
      ],
      "Lost": [
        ""
      ],
      "Current": [
        ""
      ],
      "Remove stock control for this product": [
        ""
      ],
      "without stock": [
        ""
      ],
      "Next restock": [
        ""
      ],
      "Warehouse address": [
        ""
      ],
      "Invalid amount": [
        ""
      ],
      "Product identification to use in URLs (for internal use only).": [
        ""
      ],
      "Illustration of the product for customers.": [
        ""
      ],
      "Product name.": [
        ""
      ],
      "Product description for customers.": [
        ""
      ],
      "Age restriction": [
        ""
      ],
      "Is this product restricted for customer below certain age?": [
        ""
      ],
      "Minimum age of the customer": [
        ""
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        ""
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        ""
      ],
      "Stock": [
        ""
      ],
      "Inventory for products with finite supply (for internal use only).": [
        ""
      ],
      "Taxes included in the product price, exposed to customers.": [
        ""
      ],
      "Search by category description or id": [
        ""
      ],
      "Categories where this product will be listed on.": [
        ""
      ],
      "Add product to inventory": [
        ""
      ],
      "Product not found.": [
        ""
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        ""
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        ""
      ],
      "Update": [
        ""
      ],
      "Remove this product from the database": [
        ""
      ],
      "Update the product with new price": [
        ""
      ],
      "Update product with new price": [
        ""
      ],
      "Confirm update": [
        ""
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        ""
      ],
      "Add more elements to the inventory": [
        ""
      ],
      "Report elements lost in the inventory": [
        ""
      ],
      "New price for the product": [
        ""
      ],
      "There are values with errors.": [
        ""
      ],
      "Update product with new stock and price": [
        ""
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        ""
      ],
      "Product (ID: %1$s) has been deleted": [
        ""
      ],
      "Jump to product with the given product ID": [
        ""
      ],
      "Product id": [
        ""
      ],
      "Delete product": [
        ""
      ],
      'Delete the product "%1$s"': [
        ""
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        ""
      ],
      "Must be greater that 0": [
        ""
      ],
      "Too short": [
        ""
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        ""
      ],
      "Name of the template in URLs.": [
        ""
      ],
      "Template name": [
        ""
      ],
      "Describe what this template stands for": [
        ""
      ],
      "Order summary": [
        ""
      ],
      "If specified here, this template will create orders with the same summary": [
        ""
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        ""
      ],
      "Amount is editable": [
        ""
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        ""
      ],
      "Is this contract restricted to some age?": [
        ""
      ],
      "Payment timeout": [
        ""
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        ""
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        ""
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        ""
      ],
      "Load more templates before the first one": [
        ""
      ],
      "Delete selected templates from the database": [
        ""
      ],
      "Use template to create new order": [
        ""
      ],
      "Generate a QR code for the template.": [
        ""
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        ""
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        ""
      ],
      "Jump to template with the given template ID": [
        ""
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        ""
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        ""
      ],
      "Print": [
        ""
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        ""
      ],
      "If specified, this template will create orders with the same price": [
        ""
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        ""
      ],
      "An amount is required": [
        ""
      ],
      "An order summary is required": [
        ""
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        ""
      ],
      "Amount of the order": [
        ""
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        ""
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        ""
      ],
      "Valid After": [
        ""
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        ""
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        ""
      ],
      "Remove this token family from the database": [
        ""
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        ""
      ],
      "Token family has been deleted.": [
        ""
      ],
      "Delete token family": [
        ""
      ],
      'Delete the token family "%1$s"': [
        ""
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        ""
      ],
      "Deleting a token family %1$s .": [
        ""
      ],
      "can't be undone": [
        ""
      ],
      "Token Family: %1$s": [
        ""
      ],
      "Incoming wire transfers": [
        ""
      ],
      "Load more wire transfers preceding the first one": [
        ""
      ],
      "Expected credit": [
        ""
      ],
      "Confirmed": [
        ""
      ],
      "Validated": [
        ""
      ],
      "Executed on": [
        ""
      ],
      "yes": [
        ""
      ],
      "no": [
        ""
      ],
      "never": [
        ""
      ],
      "unknown": [
        ""
      ],
      "Load more transfers after the last one": [
        ""
      ],
      "Verified wire transfers": [
        ""
      ],
      "Verified": [
        ""
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        ""
      ],
      "All accounts": [
        ""
      ],
      "Filter by account address": [
        ""
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        ""
      ],
      "Only show wire transfers confirmed by the merchant": [
        ""
      ],
      "Wire transfer already confirmed.": [
        ""
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        ""
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        ""
      ],
      "Transfer ID": [
        ""
      ],
      "It's not the same.": [
        ""
      ],
      'You are deleting the instance with ID "%1$s"': [
        ""
      ],
      "Instance": [
        ""
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        ""
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        ""
      ],
      "Delete this instance": [
        ""
      ],
      "Must be one of '%1$s'": [
        ""
      ],
      "URL is invalid": [
        ""
      ],
      "Webhook ID to use": [
        ""
      ],
      "Event": [
        ""
      ],
      "Payment": [
        ""
      ],
      "Order settled": [
        ""
      ],
      "Category added": [
        ""
      ],
      "Category updated": [
        ""
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        ""
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        ""
      ],
      "Method": [
        ""
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        ""
      ],
      "URL": [
        ""
      ],
      "URL of the webhook where the customer will be redirected": [
        ""
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        ""
      ],
      "order's price": [
        ""
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        ""
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        ""
      ],
      "Header template of the webhook": [
        ""
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        ""
      ],
      "Webhook deleted successfully": [
        ""
      ],
      "Add new webhooks": [
        ""
      ],
      "Load more webhooks before the first one": [
        ""
      ],
      "Event type": [
        ""
      ],
      "Delete selected webhook from the database": [
        ""
      ],
      "Load more webhooks after the last one": [
        ""
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        ""
      ],
      "Webhook updated": [
        ""
      ],
      "Header": [
        ""
      ],
      "Body": [
        ""
      ],
      "Body template used by the webhook": [
        ""
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        ""
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        ""
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        ""
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        ""
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        ""
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        ""
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        ""
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        ""
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        ""
      ],
      "hour": [
        ""
      ],
      "day": [
        ""
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        ""
      ],
      "Time range": [
        ""
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        ""
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        ""
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        ""
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        ""
      ],
      "KYC verification needed": [
        ""
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        ""
      ],
      "Unexpected error.": [
        ""
      ],
      "Add new instance": [
        ""
      ],
      "Edit": [
        ""
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        ""
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        ""
      ],
      "Only show active instances": [
        ""
      ],
      "Active": [
        ""
      ],
      "Only show deleted instances": [
        ""
      ],
      "Deleted": [
        ""
      ],
      "Show all instances": [
        ""
      ],
      "Delete instance": [
        ""
      ],
      'Delete the instance "%1$s"': [
        ""
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        ""
      ],
      "This cannot be undone!": [
        ""
      ],
      "Purge the instance": [
        ""
      ],
      'Purge the instance "%1$s"': [
        ""
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        ""
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        ""
      ],
      "Changing": [
        ""
      ],
      "Manage password": [
        ""
      ],
      "Business Name": [
        ""
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        ""
      ],
      "title%1$s: New bank account": [
        ""
      ],
      "title%1$s: Bank accounts": [
        ""
      ],
      "title%1$s: Update bank Account": [
        ""
      ],
      "title%1$s: Orders": [
        ""
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        ""
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        ""
      ],
      "title%1$s: Wire transfers": [
        ""
      ],
      "title%1$s: Webhooks": [
        ""
      ],
      "title%1$s: New webhook": [
        ""
      ],
      "title%1$s: Update webhook": [
        ""
      ],
      "title%1$s: OTP devices": [
        ""
      ],
      "title%1$s: New OTP device": [
        ""
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        ""
      ],
      "title%1$s: Update template": [
        ""
      ],
      "title%1$s: Templates": [
        ""
      ],
      "title%1$s: Use template": [
        ""
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        ""
      ],
      "title%1$s: Access tokens": [
        ""
      ],
      "title%1$s: New access token": [
        ""
      ],
      "titleNew instance": [
        ""
      ],
      "titleInstances": [
        ""
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && n % 10 == 0) ? 2 : 3));",
  "lang": "he",
  "completeness": 0
};
strings["fr"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=(n!=1);",
        "lang": "fr"
      },
      "Cancel": [
        "Annuler"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        "Fermer"
      ],
      "Continue": [
        "Continuer"
      ],
      "Clear": [
        "Effacer"
      ],
      "Confirm": [
        "Confirmer"
      ],
      "Correct form": [
        "Formulaire correct"
      ],
      "Comparing account details": [
        "Comparaison des d\xE9tails du compte"
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        "Le test de l'URL des informations du compte a r\xE9ussi mais les informations sur le compte retourn\xE9es sont diff\xE9rentes de celles du formulaire des d\xE9tails du compte."
      ],
      "Field": [
        "Champs"
      ],
      "In the form": [
        "Dans le formulaire"
      ],
      "Reported": [
        "Rapport\xE9"
      ],
      "Type": [
        "Type"
      ],
      "IBAN": [
        "IBAN"
      ],
      "Address": [
        "Adresse"
      ],
      "Host": [
        "H\xF4te"
      ],
      "Account ID": [
        "Compte"
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        "Ville"
      ],
      "Bank host": [
        "Serveur de la banque"
      ],
      "Bank account": [
        "Compte bancaire"
      ],
      "BIC": [
        "Code BIC"
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        "Valider le compte bancaire\u202F: %1$s"
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        "\xC9tape 1\u202F:"
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        "Copiez et collez l'IBAN et le nom dans les champs destinataires de votre application bancaire ou de votre site web"
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        "\xC9tape 2\u202F:"
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        "Copiez ce code et collez-le dans le champ 'r\xE9f\xE9rence/objet' de votre application bancaire ou du site web de votre banque"
      ],
      "Subject": [
        "R\xE9f\xE9rence"
      ],
      "Receiver postal code": [
        "Nom du b\xE9n\xE9ficiaire"
      ],
      "Receiver town": [
        "Nom du b\xE9n\xE9ficiaire"
      ],
      "Step 3:": [
        "\xC9tape 3\u202F:"
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        "S\xE9lectionnez le montant le plus petit possible pour le virement bancaire dans votre application bancaire ou sur votre site Web de banque en ligne."
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        "Assurez-vous que TOUTES les donn\xE9es sont correctes, y compris la r\xE9f\xE9rence, et que vous utilisez le compte bancaire s\xE9lectionn\xE9. Vous pouvez utiliser les boutons de copie (%1$s) pour \xE9viter les erreurs de frappe ou l'URI \xAB payto:// \xBB ci-dessous pour copier une seule valeur."
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        "Alternativement, si votre banque prend en charge les URI de type PayTO, vous pouvez utiliser ce %1$s lien \xE0 la place"
      ],
      "Operation in progress...": [
        "Op\xE9ration en cours..."
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        "L'op\xE9ration sera automatiquement annul\xE9e apr\xE8s %1$s secondes"
      ],
      "days": [
        "jours"
      ],
      "hours": [
        "heures"
      ],
      "minutes": [
        "minutes"
      ],
      "seconds": [
        "secondes"
      ],
      "Forever": [
        "Pour toujours"
      ],
      "%1$sM": [
        "%1$sM"
      ],
      "%1$sY": [
        "%1$sY"
      ],
      "%1$sd": [
        "%1$sd"
      ],
      "%1$sh": [
        "%1$sh"
      ],
      "%1$smin": [
        "%1$smin"
      ],
      "%1$ssec": [
        "%1$ss"
      ],
      "Change value to never": [
        "Changer la valeur pour jamais"
      ],
      "Change value to empty": [
        "Changer la valeur pour vide"
      ],
      "Image must be smaller than 1 MB": [
        "La taille de l'image doit \xEAtre inf\xE9rieure \xE0 1Mo"
      ],
      "Add": [
        "Ajouter"
      ],
      "Remove": [
        "Effacer"
      ],
      "Country": [
        "Pays"
      ],
      "Building number": [
        "Num\xE9ro de b\xE2timent"
      ],
      "Building name": [
        "Nom du b\xE2timent"
      ],
      "Street": [
        "Rue"
      ],
      "Post code": [
        "Code postal"
      ],
      "Town location": [
        "Localisation de la ville"
      ],
      "District": [
        "District"
      ],
      "Country subdivision": [
        "Subdivision du pays"
      ],
      "Additional address lines": [
        "Informations compl\xE9mentaires"
      ],
      "Orders": [
        "Commandes"
      ],
      "Inventory": [
        "Inventaire"
      ],
      "Categories": [
        "Cat\xE9gories"
      ],
      "Wire transfers": [
        "Virements bancaires"
      ],
      "Templates": [
        "Mod\xE8les"
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        "Configuration"
      ],
      "OTP Devices": [
        "Appareils OTP"
      ],
      "Webhooks": [
        "Webhooks"
      ],
      "Settings": [
        "Configuration"
      ],
      "Password": [
        "Mot de passe"
      ],
      "Access tokens": [
        "Jeton d'acc\xE8s"
      ],
      "Connection": [
        "Connexion"
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        "Instances"
      ],
      "New": [
        "Nouveau"
      ],
      "List": [
        "Liste"
      ],
      "Log out": [
        "Logout"
      ],
      "Username": [
        "Nom d'utilisateur"
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        "Nom de l'instance dans les URL. L'instance 'default' est particuli\xE8re en ce sens qu'elle est utilis\xE9e pour administrer les autres instances."
      ],
      "Business name": [
        "Nom de l'entreprise"
      ],
      "Legal name of the business represented by this instance.": [
        "Nom l\xE9gal de l'entreprise repr\xE9sent\xE9e par cette instance."
      ],
      "Email": [
        "Email"
      ],
      "Contact email": [
        "Email de contact"
      ],
      "Phone number": [
        "Code bancaire."
      ],
      "Contact phone": [
        "Email de contact"
      ],
      "Website URL": [
        "URL du site web"
      ],
      "URL.": [
        "URL."
      ],
      "Logo": [
        "Logo"
      ],
      "Logo image.": [
        "Image du Logo."
      ],
      "Physical location of the merchant.": [
        "Localisation physique du commer\xE7ant."
      ],
      "Jurisdiction": [
        "Juridiction"
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        "Juridiction comp\xE9tente pour les litiges avec le commer\xE7ant."
      ],
      "Pay transaction fee": [
        "Payer les frais de transaction"
      ],
      "Cover the transaction cost or pass it on to the user.": [
        "Prendre en charge le co\xFBt de la transaction ou le r\xE9percuter sur l'utilisateur."
      ],
      "Default payment delay": [
        "D\xE9lai de paiement par d\xE9faut"
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        "Temps par d\xE9faut qu'ont les clients pour payer une commande avant que celle ci n'expire."
      ],
      "Default refund delay": [
        "D\xE9lai de paiement par d\xE9faut"
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        "D\xE9lai par d\xE9faut pour les virements bancaires"
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        "Dur\xE9e maximale pendant laquelle un exchange est autoris\xE9 \xE0 retarder le transfert de fonds au commer\xE7ant, ce qui lui permet de regrouper les petits paiements en virements plus importants et de r\xE9duire les frais de virement."
      ],
      "Default wire transfer rounding interval": [
        "D\xE9lai par d\xE9faut pour les virements bancaires"
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        "Non trouv\xE9"
      ],
      "To second": [
        "secondes"
      ],
      "To minute": [
        "minutes"
      ],
      "To hour": [
        "heures"
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        "Virement effectu\xE9"
      ],
      "Required": [
        "Obligatoire"
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        "Impossible de contacter le serveur"
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        "Algorithme de v\xE9rification"
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        "Retour"
      ],
      "Verify": [
        "V\xE9rifi\xE9"
      ],
      "Failed to send the verification code.": [
        "Echec de la suppression de l'instance"
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        "Aucune authentification"
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        "Aucun exchange ne pourra accepter le paiement en raison des exigences en mati\xE8re de connaissance du client (proc\xE9dure KYC)."
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        "Non trouv\xE9"
      ],
      "Login required": [
        "Login obligatoire"
      ],
      "instance name": [
        "Identifiant d'instance"
      ],
      "current password": [
        "Avec mot de passe"
      ],
      "Forgot password": [
        "Avec mot de passe"
      ],
      "Create new account": [
        "Compte bancaire cr\xE9dit\xE9"
      ],
      "Invalid": [
        "Invalide"
      ],
      "Doesn't have the pattern of an email": [
        "L'URL n'a pas le format correct"
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        "URL invalide"
      ],
      "Max 7 lines": [
        "7 lignes maximum"
      ],
      "Doesn't match": [
        "Ne correspond pas"
      ],
      "Instance created": [
        "Identifiant d'instance"
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        "Confirmer"
      ],
      "Not found.": [
        "Non trouv\xE9"
      ],
      "New password": [
        "Avec mot de passe"
      ],
      "Next password to be used": [
        "Prochain jeton d'acc\xE8s utilis\xE9"
      ],
      "Repeat password": [
        "Avec mot de passe"
      ],
      "Confirm the same password": [
        "Confirmez le m\xEAme jeton d'acc\xE8s"
      ],
      "Please complete the marked fields and choose authorization method": [
        "Il faut remplir les champs marqu\xE9s et choisir la m\xE9thode d'autorisation"
      ],
      "Confirm operation": [
        "Confirmez l'op\xE9ration"
      ],
      "Check the password.": [
        "Avec mot de passe"
      ],
      "Instance not found.": [
        "Votre instance n'a pas \xE9t\xE9 trouv\xE9e"
      ],
      "Description": [
        "Description"
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        "Dur\xE9e"
      ],
      "Time the access token will be valid.": [
        "Prochain jeton d'acc\xE8s utilis\xE9"
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        "Choisissez un ..."
      ],
      "Read only": [
        ""
      ],
      "All": [
        "Toutes"
      ],
      "Order simple": [
        "Identifiant de commande"
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        "Identifiant de commande"
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        "Avec mot de passe"
      ],
      "Please complete the marked fields": [
        "Besoin de compl\xE9ter les champs marqu\xE9s"
      ],
      "Access token created": [
        "Jeton d'acc\xE8s"
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        "Jeton"
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        "Aucune instance 'par d\xE9faut' n'a encore \xE9t\xE9 configur\xE9e."
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        "Cr\xE9er une instance 'par d\xE9faut' pour commencer \xE0 utiliser le backoffice du commer\xE7ant."
      ],
      "Create access token": [
        "Jeton d'acc\xE8s actuel"
      ],
      "Load more devices before the first one": [
        "Ajouter d'autres appareils avant le premier"
      ],
      "Load first page": [
        "Charger la premi\xE8re page"
      ],
      "Created at": [
        "Cr\xE9\xE9 \xE0"
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        "Jamais"
      ],
      "Remove this access token": [
        "R\xE9p\xE9tez le jeton d'acc\xE8s"
      ],
      "Delete": [
        "Effacer"
      ],
      "Load more devices after the last one": [
        "Ajouter d'autres appareils apr\xE8s le dernier"
      ],
      "Load next page": [
        "Charger la page suivante"
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        "Il n'y a pas encore de compte, ajoutez-en un en appuyant sur le signe +"
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        "D\xE9finir un jeton d'acc\xE8s"
      ],
      "Deleting an access token cannot be undone.": [
        "La suppression d'un produit est irr\xE9versible."
      ],
      "This is not a valid Bitcoin address.": [
        "Ceci n'est pas une adresse Bitcoin valide."
      ],
      "This is not a valid Ethereum address.": [
        "Ceci n'est pas une adresse Ethereum valide."
      ],
      "This is not a valid host.": [
        "Ceci n'est pas un serveur valide."
      ],
      "IBANs usually have more than 4 digits.": [
        "Les num\xE9ros IBAN comportent g\xE9n\xE9ralement plus de 4 chiffres"
      ],
      "IBANs usually have fewer than 34 digits.": [
        "Les num\xE9ros IBAN comportent g\xE9n\xE9ralement moins de 34 chiffres"
      ],
      "The IBAN's country code could not be retrieved.": [
        "Le code pays de l'IBAN n'a pas \xE9t\xE9 trouv\xE9"
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        "Le num\xE9ro IBAN n'est pas valide, la somme de contr\xF4le est erron\xE9e"
      ],
      "This account is not allowed.": [
        "Ceci n'est pas un serveur valide."
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        "M\xE9thode de virement\u202F: IBAN"
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        "S\xE9lectionnez le montant le plus petit possible pour le virement bancaire dans votre application bancaire ou sur votre site Web de banque en ligne."
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        "Code bancaire"
      ],
      "Routing number": [
        "Code bancaire."
      ],
      "Account": [
        "Compte"
      ],
      "Account number": [
        "Num\xE9ro de compte."
      ],
      "Code": [
        "Code"
      ],
      "Business Identifier Code": [
        "Code BIC de la banque."
      ],
      "International Bank Account Number": [
        "Code IBAN."
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        "Interface de paiement unifi\xE9e (Unified Payment Interface)."
      ],
      "Bitcoin protocol": [
        "Protocole Bitcoin."
      ],
      "Ethereum protocol": [
        "Protocole Ethereum."
      ],
      "Interledger protocol": [
        "Protocole Interledger."
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        "Nom de la cat\xE9gorie"
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        "Nom l\xE9gal de la personne titulaire du compte."
      ],
      "Invalid url": [
        "URL invalide"
      ],
      "URL must end with a '/'": [
        "L'URL doit terminer avec un '/'"
      ],
      "URL must not contain params": [
        "L'URL ne doit pas contenir de parametres"
      ],
      "URL must not hash param": [
        "L'URL ne doit pas comporter de param\xE8tre de hachage"
      ],
      "Conflict": [
        "Confirmer"
      ],
      'Server replied with "bad request".': [
        'Le serveur a r\xE9pondu "Mauvaise requ\xEAte".'
      ],
      "Unauthorized, check credentials.": [
        "Non autoris\xE9, v\xE9rifiez les informations d'identification."
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        "Ce endpoint ne semble par ressembler \xE0 une URL Taler Revenue."
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        "La requ\xEAte a abouti mais le serveur n'a pas r\xE9pondu avec la valeur appropri\xE9e pour le champ 'credit_account' et nous ne pouvons donc pas v\xE9rifier que le compte est le m\xEAme."
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        "Compte\u202F:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        "Si la banque supporte l'API Taler Revenue, vous pouvez ajouter l'URL du endpoint ci-dessous pour garder les informations sur les revenus synchronis\xE9es."
      ],
      "Endpoint URL": [
        "URL du endpoint"
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        "Endroit d'o\xF9 le commer\xE7ant peut t\xE9l\xE9charger des informations sur les virements entrants sur ce compte"
      ],
      "Auth type": [
        "Type d'authentification"
      ],
      "Choose the authentication type for the account info URL": [
        "Choisir le type d'authentification pour l'URL des info sur le compte"
      ],
      "Without authentication": [
        "Aucune authentification"
      ],
      "With username and password": [
        "Avec mot de passe"
      ],
      "With token": [
        "Avec jeton"
      ],
      "Do not change": [
        "Ne pas changer"
      ],
      "Username to access the account information.": [
        "Nom d'utilisateur pour acc\xE9der aux informations sur le compte."
      ],
      "Password to access the account information.": [
        "Mot de passe pour acc\xE9der aux informations du compte."
      ],
      "Access token to access the account information.": [
        "Jeton d'acc\xE8s pour acc\xE9der aux informations du compte."
      ],
      "Match": [
        "Correspondance"
      ],
      "Check where the information match against the server info.": [
        "V\xE9rifier si les informations correspondent \xE0 celles du serveur."
      ],
      "Compare info from server with account form": [
        "Comparer les informations du serveur avec le formulaire de compte"
      ],
      "Test": [
        "Test"
      ],
      "Server didn't like the request we made.": [
        'Le serveur a r\xE9pondu "Mauvaise requ\xEAte".'
      ],
      "Account details": [
        "D\xE9tails du compte"
      ],
      "Check if the information matches the server info.": [
        "V\xE9rifier si les informations correspondent \xE0 celles du serveur."
      ],
      "The bank account has been deleted.": [
        "Le compte bancaire a \xE9t\xE9 supprim\xE9 avec succ\xE8s."
      ],
      "Bank accounts": [
        "Comptes bancaires"
      ],
      "Add new account": [
        "Ajouter un nouveau compte"
      ],
      "Owner's name": [
        "Nom du propri\xE9taire"
      ],
      "Delete selected accounts from the database": [
        "Supprimer les comptes s\xE9lectionn\xE9s de la base de donn\xE9es"
      ],
      "There are no accounts yet, add more pressing the + sign": [
        "Il n'y a pas encore de compte, ajoutez-en un en appuyant sur le signe +"
      ],
      "You must provide a bank account to receive payments.": [
        "Vous devez associer un compte bancaire pour recevoir des fonds."
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        "Invalide. Veuillez ins\xE9rer uniquement des caract\xE8res et des chiffres"
      ],
      "Name": [
        "Nom"
      ],
      "Category name": [
        "Nom de la cat\xE9gorie"
      ],
      "Category deleted": [
        "Nom de la cat\xE9gorie"
      ],
      "Add new devices": [
        "Ajouter de nouveaux appareils"
      ],
      "ID": [
        "Identifiant"
      ],
      "Total products": [
        "Total des produits"
      ],
      "Delete selected category from the database": [
        "Supprimer la cat\xE9gorie s\xE9lectionn\xE9e de la base de donn\xE9es"
      ],
      "There are no categories yet, add more pressing the + sign": [
        "Il n'y a pas encore de cat\xE9gorie, ajoutez-en en appuyant sur le signe +"
      ],
      "Id:": [
        "Identifiant\u202F:"
      ],
      "Name of the category": [
        "Nom de la cat\xE9gorie"
      ],
      "Products": [
        "Produits"
      ],
      "Image": [
        "Image"
      ],
      "Load more products after the last one": [
        "Ajouter des produits apr\xE8s le dernier"
      ],
      "There are no products in this category.": [
        "G\xE9rer la liste des produits dans la commande."
      ],
      "Account's KYC status": [
        "D\xE9tails du compte"
      ],
      "Exchange": [
        "Exchange"
      ],
      "Status": [
        "URL de l'\xE9tat"
      ],
      "Ok": [
        "OK"
      ],
      "Action required": [
        "Login obligatoire"
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        "Montant obligatoire"
      ],
      "More information required.": [
        "Plus d'informations pour situer le contexte"
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        "Chargement ..."
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        "Status HTTP"
      ],
      "No pending kyc verification!": [
        "Aucune v\xE9rification kyc en cours\u202F!"
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        "Changer la cl\xE9"
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        "Obligatoire"
      ],
      "The payment provider requires more information.": [
        "Le prestataire du service de paiement requi\xE8re une v\xE9rification du compte."
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        "Vous d\xE9finissez le jeton d'acc\xE8s pour la nouvelle instance"
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        "Afficher uniquement les commandes qui ont d\xE9j\xE0 \xE9t\xE9 transf\xE9r\xE9es par le prestataire de services de paiement"
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        "Interface"
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        "Changer la valeur pour une date inconnue"
      ],
      "Enter description or id": [
        "Entrez soit une description soit un identifiant"
      ],
      "No match found for that description or ID.": [
        "aucune correspondance de trouv\xE9e pour cette description ou cet identifiant"
      ],
      "You must enter a valid product identifier.": [
        "Vous devez entrer un identifiant de produit valide."
      ],
      "Quantity must be greater than 0!": [
        "La quantit\xE9 doit \xEAtre sup\xE9rieure \xE0 0\u202F!"
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        "Cette quantit\xE9 d\xE9passe le stock restant. Actuellement, il ne reste que %1$s unit\xE9s non r\xE9serv\xE9es en stock."
      ],
      "Search product": [
        "Recherche produit"
      ],
      "Quantity": [
        "Quantit\xE9"
      ],
      "How many products will be added": [
        "Combien de produits seront ajout\xE9s"
      ],
      "Add from inventory": [
        "Ajouter depuis l'inventaire"
      ],
      "This product has %1$s applicable taxes configured.": [
        "Ce produit a %1$s taxes applicables configur\xE9es."
      ],
      "No taxes configured for this product.": [
        "Aucune taxe n'est configur\xE9e pour ce produit."
      ],
      "Amount": [
        "Montant"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        "Les taxes peuvent \xEAtre libell\xE9es dans des monnaies diff\xE9rentes de la monnaie principale utilis\xE9e par le commer\xE7ant."
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        "Saisissez la devise et la valeur s\xE9par\xE9es par deux points, par exemple &quot;USD:2.3&quot\u202F;."
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        "Nom l\xE9gal de la taxe, par exemple TVA ou droits d'importation."
      ],
      "Add tax to the tax list": [
        "Ajouter une taxe \xE0 la liste des taxes"
      ],
      "Describe and add a product that is not in the inventory list": [
        "D\xE9crire et ajouter un produit qui ne figure pas dans la liste d'inventaire"
      ],
      "Add custom product": [
        "Ajouter un produit personnalis\xE9"
      ],
      "Complete information of the product": [
        "Informations compl\xE8tes sur le produit"
      ],
      "Must be a number.": [
        "Doit \xEAtre un nombre"
      ],
      "Must be greater than 0.": [
        "Doit \xEAtre sup\xE9rieur \xE0 0"
      ],
      "Photo of the product.": [
        "Photo du produit."
      ],
      "Full product description.": [
        "Description d\xE9taill\xE9e du produit."
      ],
      "Unit name": [
        "Nom de l'unit\xE9"
      ],
      "Name of the product unit.": [
        "Nom de l'unit\xE9 du produit."
      ],
      "Price per unit": [
        "Prix \xE0 l'unit\xE9"
      ],
      "Amount in the current currency.": [
        "Montant dans la monnaie courante."
      ],
      "How many products will be added.": [
        "Combien de produits seront ajout\xE9s."
      ],
      "Taxes": [
        "Taxes"
      ],
      "Total price": [
        "Prix total"
      ],
      "Must be greater than 0": [
        "Doit \xEAtre sup\xE9rieur \xE0 0"
      ],
      "Must have a refund deadline": [
        "Le d\xE9lai de remboursement doit \xEAtre fix\xE9"
      ],
      "Auto refund can't be after refund deadline": [
        "Le remboursement automatique ne peut pas \xEAtre effectu\xE9 apr\xE8s la date limite de remboursement"
      ],
      "Must be in the future": [
        "Doit \xEAtre dans le future"
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        "Ceci n'est pas un serveur valide."
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        "Aucun exchange ne pourra accepter le paiement en raison des exigences en mati\xE8re de connaissance du client (proc\xE9dure KYC)."
      ],
      "Manage products in order": [
        "G\xE9rer les produits dans l'ordre"
      ],
      "%1$s products with a total price of %2$s.": [
        "%1$s produits pour un prix total de %2$s."
      ],
      "Manage list of products in the order.": [
        "G\xE9rer la liste des produits dans la commande."
      ],
      "Remove this product from the order.": [
        "Retirer ce produit de la commande."
      ],
      "Products price sum": [
        "Liste des produits"
      ],
      "Total product price added up": [
        "Prix total des produits additionn\xE9s"
      ],
      "Order price": [
        "Prix par article"
      ],
      "Amount to be paid by the customer": [
        "Montant \xE0 payer par le client"
      ],
      "Final order price": [
        "Prix final de la commande"
      ],
      "Summary": [
        "R\xE9sum\xE9"
      ],
      "Title of the order to be shown to the customer": [
        "Titre de la commande \xE0 afficher au client"
      ],
      "Shipping and fulfillment": [
        "Exp\xE9dition et traitement des commandes"
      ],
      "Delivery date": [
        "Date de livraison"
      ],
      "Deadline for physical delivery assured by the merchant.": [
        "Date limite de livraison physique assur\xE9e par le commer\xE7ant."
      ],
      "Delivery location": [
        "Date de livraison"
      ],
      "Address where the products will be delivered": [
        "Adresse de livraison des produits"
      ],
      "Fulfillment URL": [
        "URL du service de traitement des commandes"
      ],
      "URL to which the user will be redirected after successful payment.": [
        "URL vers laquelle l'utilisateur sera redirig\xE9 apr\xE8s un paiement r\xE9ussi."
      ],
      "Fulfillment message": [
        "URL du service de traitement des commandes"
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        "Options de paiement Taler"
      ],
      "Override default Taler payment settings for this order": [
        "Remplacer les param\xE8tres de paiement par d\xE9faut de Taler pour cette commande"
      ],
      "Payment time": [
        "D\xE9lai de paiement"
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        "D\xE9lai accord\xE9 au client pour payer l'offre avant qu'elle n'expire. Les produits en stock seront r\xE9serv\xE9s jusqu'\xE0 cette date. Le temps commence \xE0 courir apr\xE8s la cr\xE9ation de la commande."
      ],
      "Default": [
        "Par d\xE9faut"
      ],
      "Refund time": [
        "D\xE9lai de remboursement"
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        "D\xE9lai pendant lequel la commande peut \xEAtre rembours\xE9e par le commer\xE7ant. Le temps commence \xE0 la cr\xE9ation de la commande."
      ],
      "Wire transfer time": [
        "D\xE9lai de virement"
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        "Temps n\xE9cessaire \xE0 l'exchange pour effectuer le virement. Le temps commence \xE0 la cr\xE9ation de la commande."
      ],
      "Auto-refund time": [
        "D\xE9lai de remboursement automatique"
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        "D\xE9lai jusqu'auquel le portefeuille v\xE9rifiera automatiquement les remboursements sans intervention de l'utilisateur."
      ],
      "Maximum fee": [
        "Frais maximums"
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        "Frais maximums que le commer\xE7ant est pr\xEAt \xE0 couvrir pour cette commande. Les frais de d\xE9p\xF4t plus \xE9lev\xE9s doivent \xEAtre int\xE9gralement pris en charge par le consommateur."
      ],
      "Create token": [
        "Cr\xE9er un jeton"
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        "Si l'identifiant de la commande est facile \xE0 deviner, le jeton emp\xEAchera les utilisateurs de voler les commandes d'autres personnes."
      ],
      "Minimum age required": [
        "\xC2ge minimum requis"
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        "Toute valeur sup\xE9rieure \xE0 0 limitera le type de pi\xE8ces pouvant \xEAtre utilis\xE9es pour payer ce contrat. Si la valeur est vide, la restriction d'\xE2ge sera d\xE9finie par les produits"
      ],
      "Minimum age defined by the products is %1$s": [
        "L'\xE2ge minimum d\xE9fini par les produits est de %1$s"
      ],
      "No product with age restriction in this order": [
        "Aucun produit avec restriction d'\xE2ge dans cette commande"
      ],
      "Additional information": [
        "Informations compl\xE9mentaires"
      ],
      "Custom information to be included in the contract for this order.": [
        "Informations personnalis\xE9es \xE0 inclure dans le contrat pour cette commande."
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        "Vous devez saisir une valeur en JavaScript Object Notation (JSON)."
      ],
      "remove": [
        "Effacer"
      ],
      "Custom field name": [
        "Nom du champ personnalis\xE9"
      ],
      "Disabled": [
        "D\xE9sactiv\xE9"
      ],
      "No deadline": [
        "Aucune date limite"
      ],
      "Deadline at %1$s": [
        "Date limite \xE0 %1$s"
      ],
      "Select date to show nearby orders": [
        "S\xE9lectionnez la date pour afficher les commandes proches"
      ],
      "Only show unpaid orders": [
        "Afficher uniquement les commandes pay\xE9es"
      ],
      "Only show paid orders": [
        "Afficher uniquement les commandes pay\xE9es"
      ],
      "Paid": [
        "Pay\xE9e"
      ],
      "Only show orders with refunds": [
        "Afficher uniquement les commandes avec remboursement"
      ],
      "Refunded": [
        "Rembours\xE9e"
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        "Virement non effectu\xE9"
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        "Afficher uniquement les commandes qui ont d\xE9j\xE0 \xE9t\xE9 transf\xE9r\xE9es par le prestataire de services de paiement"
      ],
      "Completed": [
        "Transfer\xE9"
      ],
      "Remove all filters": [
        "Effacer tous les filtres"
      ],
      "Clear date filter": [
        "Effacer le filtre de date"
      ],
      "Jump to date (%1$s)": [
        "Aller \xE0 la date (%1$s)"
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        "Aller \xE0 la commande en fonction d'un identifiant de produit"
      ],
      "Order id": [
        "Identifiant de commande"
      ],
      "Instance unknown": [
        "Identifiant d'instance"
      ],
      "Order unknown": [
        "inconnu"
      ],
      "Create order": [
        "Cr\xE9er une commande"
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        "Date"
      ],
      "Refund": [
        "Remboursement"
      ],
      "copy url": [
        "copiez l'URL"
      ],
      "Load more orders after the last one": [
        "Charger d'autres commandes apr\xE8s la derni\xE8re"
      ],
      "No orders have been found matching your query!": [
        "Aucune commande n'a \xE9t\xE9 trouv\xE9e correspondant \xE0 votre requ\xEAte\u202F!"
      ],
      "Duplicated": [
        "Dupliqu\xE9"
      ],
      "This value exceeds the refundable amount.": [
        "Cette valeur d\xE9passe le montant remboursable"
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        "Des exigences en mati\xE8re de connaissance du client (KYC) sont en suspens."
      ],
      "refund": [
        "Remboursement"
      ],
      "Reason": [
        "R\xE9f\xE9rence"
      ],
      "Amount to be refunded": [
        "Montant \xE0 rembourser"
      ],
      "Max refundable:": [
        "Remboursement maximum\u202F:"
      ],
      "Choose one...": [
        "Choisissez un ..."
      ],
      "Requested by the customer": [
        "A la demande du client"
      ],
      "Other": [
        "Autre"
      ],
      "Why this order is being refunded": [
        "Pourquoi cette commande est-elle rembours\xE9e"
      ],
      "More information to give context": [
        "Plus d'informations pour situer le contexte"
      ],
      "now": [
        "non"
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        "Afficher uniquement les commandes qui ont d\xE9j\xE0 \xE9t\xE9 transf\xE9r\xE9es par le prestataire de services de paiement"
      ],
      "This wire transfer has been notified by the payment service provider.": [
        "Afficher uniquement les commandes qui ont d\xE9j\xE0 \xE9t\xE9 transf\xE9r\xE9es par le prestataire de services de paiement"
      ],
      "This refund is waiting to be claimed by the customer.": [
        "Montant \xE0 payer par le client"
      ],
      "This refund has been claimed by the customer.": [
        "Montant \xE0 payer par le client"
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        "Conditions du contrat"
      ],
      "Human-readable description of the whole purchase": [
        "Description en langage courant de l'ensemble de la transaction"
      ],
      "Total price for the transaction": [
        "Prix total de la transaction"
      ],
      "URL for this purchase": [
        "URL de cet achat"
      ],
      "Max fee": [
        "Frais maximums"
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        "Montant total maximum des frais de d\xE9p\xF4t accept\xE9s par le commer\xE7ant pour ce contrat"
      ],
      "Time when this contract was generated": [
        "Heure \xE0 laquelle ce contrat a \xE9t\xE9 g\xE9n\xE9r\xE9"
      ],
      "Refund deadline": [
        "Date limite de remboursement"
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        "Pass\xE9 ce d\xE9lai, aucun remboursement ne sera accept\xE9"
      ],
      "Payment deadline": [
        "Date limite de paiement"
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        "Pass\xE9 ce d\xE9lai, le commer\xE7ant n'acceptera plus de paiements pour le contrat"
      ],
      "Wire transfer deadline": [
        "Date limite pour les virements"
      ],
      "Transfer deadline for the exchange": [
        "Date limite de transfert pour l'exchange"
      ],
      "Time indicating when the order should be delivered": [
        "Date \xE0 laquelle la commande doit \xEAtre livr\xE9e"
      ],
      "Where the order will be delivered": [
        "Lieu de livraison de la commande"
      ],
      "Auto-refund delay": [
        "D\xE9lai de remboursement automatique"
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        "Combien de temps le portefeuille doit-il essayer d'obtenir un remboursement automatique de l'achat"
      ],
      "Extra info": [
        "Infos suppl\xE9mentaires"
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        "Donn\xE9es suppl\xE9mentaires qui ne sont interpr\xE9t\xE9es que par le frontend du commer\xE7ant"
      ],
      "order created": [
        "Statut de la commande"
      ],
      "pay deadline": [
        "Date limite de paiement"
      ],
      "refund deadline": [
        "Date limite de remboursement"
      ],
      "delivery": [
        "Date de livraison"
      ],
      "Order": [
        "Commande"
      ],
      "Claimed": [
        "Id\xE9es pour les projets r\xE9clam\xE9es"
      ],
      "Claimed at": [
        "R\xE9clam\xE9e \xE0"
      ],
      "Timeline": [
        "Calendrier"
      ],
      "Payment details": [
        "Modalit\xE9s de paiement"
      ],
      "Order status": [
        "Statut de la commande"
      ],
      "Unpaid": [
        "Non pay\xE9"
      ],
      "Product list": [
        "Liste des produits"
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        "Cr\xE9ation r\xE9ussie du remboursement"
      ],
      "refund created: %1$s: %2$s": [
        "Cr\xE9ation r\xE9ussie du remboursement"
      ],
      "refund taken: %1$s": [
        "Remboursement pris"
      ],
      "refund taken: %1$s: %2$s": [
        "Remboursement pris"
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        "Aucune date limite"
      ],
      "Wired": [
        "Virement effectu\xE9"
      ],
      "Refund order": [
        "Rembourser la commande"
      ],
      "Not refundable": [
        "Non remboursable"
      ],
      "Next event in": [
        "Nouvel \xE9v\xE8nement dans"
      ],
      "The order was wired.": [
        "La demande a \xE9t\xE9 annul\xE9e."
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        "Montant rembours\xE9"
      ],
      "Refund taken": [
        "Remboursement pris"
      ],
      "Status URL": [
        "URL de l'\xE9tat"
      ],
      "Refund URI": [
        "URI de remboursement"
      ],
      "Pay at": [
        "URL de paiement"
      ],
      "Order status URL": [
        "URL de l'\xE9tat de la commande"
      ],
      "Payment URI": [
        "URI de payment"
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        "Statut de la commande inconnu. Il s'agit d'une erreur, veuillez contacter l'administrateur."
      ],
      "Invalid. Please enter letters and numbers only.": [
        "Invalide. Veuillez n'ins\xE9rer que des caract\xE8res et des chiffres"
      ],
      "Just letters and numbers from 2 to 7": [
        "Juste des lettres et des chiffres de 2 \xE0 7"
      ],
      "The size of the key must be 32 characters": [
        "La cl\xE9 doit comporter exactement 32 caract\xE8res"
      ],
      "Internal ID on the system": [
        "Identifiant interne au syst\xE8me"
      ],
      "Useful to identify the device physically": [
        "Utile pour identifier physiquement l'appareil"
      ],
      "Verification algorithm": [
        "Algorithme de v\xE9rification"
      ],
      "Algorithm used to verify transactions in offline mode": [
        "Algorithme utilis\xE9 pour v\xE9rifier la transaction en mode hors ligne"
      ],
      "Device key": [
        "Cl\xE9 de l'appareil"
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        "Veillez \xE0 ce que votre mot de passe soit tr\xE8s difficile \xE0 deviner ou utilisez le g\xE9n\xE9rateur al\xE9atoire"
      ],
      "Your device needs to match exactly the same value": [
        "Votre appareil doit afficher exactement la m\xEAme valeur"
      ],
      "Generate random secret key": [
        "G\xE9n\xE9rer une cl\xE9 secr\xE8te al\xE9atoire"
      ],
      "Random": [
        "Al\xE9atoire"
      ],
      "Create another": [
        "Cr\xE9er une commande"
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        "Vous pouvez scanner le code QR suivant avec votre appareil ou enregistrer la cl\xE9 avant de continuer."
      ],
      "OTP devices": [
        "Appareils OTP"
      ],
      "Delete selected devices from the database": [
        "Supprimer les appareils s\xE9lectionn\xE9s de la base de donn\xE9es"
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        "Il n'y a pas encore d'appareil, ajoutez-en un en appuyant sur le signe +"
      ],
      "Template id is unknown": [
        "Identifiant du mod\xE8le inconnu"
      ],
      "The provided information is inconsistent with the current state of the template": [
        "Les informations fournies ne correspondent pas \xE0 l'\xE9tat actuel du mod\xE8le"
      ],
      "Device:": [
        "Appareil\u202F:"
      ],
      "Algorithm to use to verify transactions in offline mode": [
        "Algorithme \xE0 utiliser pour v\xE9rifier les transactions en mode hors ligne"
      ],
      "Not modified": [
        "Pas de modification"
      ],
      "Be sure to be very hard to guess or use the random generator": [
        "Veillez \xE0 ce qu'il soit tr\xE8s difficile \xE0 deviner ou utilisez le g\xE9n\xE9rateur al\xE9atoire"
      ],
      "Your device need to have exactly the same value": [
        "Votre appareil doit avoir exactement la m\xEAme valeur"
      ],
      "Change key": [
        "Changer la cl\xE9"
      ],
      "Is not the same": [
        "N'est pas le m\xEAme"
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        "Vous mettez \xE0 jour le jeton d'acc\xE8s de l'instance dont l'identifiant est %1$s"
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        "Confirmer le changement"
      ],
      "Testing password change": [
        "Mot de passe"
      ],
      "Password changed": [
        "Mot de passe"
      ],
      "The current password is wrong.": [
        "Avec mot de passe"
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        "Identifiant du produit"
      ],
      "Add element to the list": [
        "Ajouter l'\xE9l\xE9ment \xE0 la liste"
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        "Cliquez ici pour configurer le stock du produit, laissez-le tel quel et le backend ne contr\xF4lera pas le stock."
      ],
      "Manage stock": [
        "Gestion du stock"
      ],
      "This product has been configured without stock control": [
        "Ce produit a \xE9t\xE9 configur\xE9 sans contr\xF4le du stock"
      ],
      "Infinite": [
        "Infini"
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        "Le retrait ne peut pas d\xE9passer le stock actuel plus les quantit\xE9es entrantes (maximum %1$s)"
      ],
      "Incoming": [
        "Arriv\xE9es"
      ],
      "Lost": [
        "Perte"
      ],
      "Current": [
        "Courant"
      ],
      "Remove stock control for this product": [
        "Supprimer le contr\xF4le des stocks pour ce produit"
      ],
      "without stock": [
        "sans stock"
      ],
      "Next restock": [
        "Prochain r\xE9approvisionnement"
      ],
      "Warehouse address": [
        "Adresse de l'entrep\xF4t"
      ],
      "Invalid amount": [
        "Montant invalide"
      ],
      "Product identification to use in URLs (for internal use only).": [
        "Identification du produit \xE0 utiliser dans les URL (\xE0 usage interne uniquement)."
      ],
      "Illustration of the product for customers.": [
        "Illustration du produit pour les clients."
      ],
      "Product name.": [
        "Identifiant du produit"
      ],
      "Product description for customers.": [
        "Description du produit pour les clients."
      ],
      "Age restriction": [
        "Restriction d'\xE2ge"
      ],
      "Is this product restricted for customer below certain age?": [
        "Ce produit est-il interdit aux personnes en dessous d'un certain \xE2ge\u202F?"
      ],
      "Minimum age of the customer": [
        "\xC2ge minimum du client"
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        "Unit\xE9 d\xE9crivant la quantit\xE9 de produits vendus (par exemple, 2 kilogrammes, 5 litres, 3 articles, 5 m\xE8tres) aux clients."
      ],
      "Example: kg, items or liters": [
        "Exemple\u202F: kg, pi\xE8ces ou litres"
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        "Prix de vente TTC des produits pour les clients, correspondant aux unit\xE9s de produits ci-dessus."
      ],
      "Stock": [
        "Stock"
      ],
      "Inventory for products with finite supply (for internal use only).": [
        "Inventaire des produits dont l'offre est limit\xE9e (\xE0 usage interne uniquement)."
      ],
      "Taxes included in the product price, exposed to customers.": [
        "Taxes incluses dans le prix du produit, communiqu\xE9es aux clients."
      ],
      "Search by category description or id": [
        "Recherche par description de cat\xE9gorie ou par identifiant"
      ],
      "Categories where this product will be listed on.": [
        "Cat\xE9gories dans lesquelles ce produit sera rang\xE9."
      ],
      "Add product to inventory": [
        "Ajouter le produit \xE0 l'inventaire"
      ],
      "Product not found.": [
        "Identifiant du produit"
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        "Ventes"
      ],
      "Sold": [
        "Vendu"
      ],
      "Free": [
        "Libre"
      ],
      "Go to product update page": [
        "Aller \xE0 la page de modification du produit"
      ],
      "Update": [
        "Modification"
      ],
      "Remove this product from the database": [
        "Effacer ce produit de la base de donn\xE9es"
      ],
      "Update the product with new price": [
        "Modifier le prix du produit"
      ],
      "Update product with new price": [
        "Modifier le prix du produit"
      ],
      "Confirm update": [
        "Confirmer la modification"
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        "La perte ne peut pas \xEAtre sup\xE9rieure au courant + entr\xE9es (max %1$s)"
      ],
      "Add more elements to the inventory": [
        "Ajouter d'autres \xE9l\xE9ments \xE0 l'inventaire"
      ],
      "Report elements lost in the inventory": [
        "Signaler les \xE9l\xE9ments perdus dans l'inventaire"
      ],
      "New price for the product": [
        "Nouveau prix pour le produit"
      ],
      "There are values with errors.": [
        "Certaines valeurs ont des erreurs"
      ],
      "Update product with new stock and price": [
        "Changer le stock et le prix du produit"
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        "Il n'y a pas encore de produits, ajoutez-en en appuyant sur le signe +"
      ],
      "Product (ID: %1$s) has been deleted": [
        "Le produit (identifiant\u202F: %1$s) a \xE9t\xE9 modifi\xE9"
      ],
      "Jump to product with the given product ID": [
        "Aller directement au produit avec son identifiant"
      ],
      "Product id": [
        "Identifiant du produit"
      ],
      "Delete product": [
        "Effac\xE9es"
      ],
      'Delete the product "%1$s"': [
        "Impossible d'effacer le produit"
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        "Si vous effacez le produit nomm\xE9 %1$s (identifiant\u202F: %2$s), le stock et toutes les informations li\xE9es seront perdus"
      ],
      "Deleting a product cannot be undone.": [
        "La suppression d'un produit est irr\xE9versible."
      ],
      "Product id:": [
        "Identifiant du produit\u202F:"
      ],
      "Must be greater that 0": [
        "Doit \xEAtre sup\xE9rieur \xE0 0"
      ],
      "Too short": [
        "Trop court"
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        "Identifiant"
      ],
      "Name of the template in URLs.": [
        "Nom du mod\xE8le dans les URLs."
      ],
      "Template name": [
        "Mod\xE8les"
      ],
      "Describe what this template stands for": [
        "D\xE9crire ce que ce mod\xE8le repr\xE9sente"
      ],
      "Order summary": [
        "R\xE9sum\xE9 de la commande"
      ],
      "If specified here, this template will create orders with the same summary": [
        "S'il est utilis\xE9, ce mod\xE8le cr\xE9era des commandes avec le m\xEAme r\xE9sum\xE9"
      ],
      "Summary is editable": [
        "Le r\xE9sum\xE9 est \xE9ditable"
      ],
      "Allow the user to change the summary.": [
        "Autoriser l'utilisateur \xE0 modifier le r\xE9sum\xE9."
      ],
      "If specified here, this template will create orders with the same price": [
        "S'il est utilis\xE9, ce mod\xE8le cr\xE9era des commandes avec le m\xEAme prix"
      ],
      "Amount is editable": [
        "Le montant est modifiable"
      ],
      "Allow the user to select the amount to pay.": [
        "Permettre \xE0 l'utilisateur de s\xE9lectionner le montant \xE0 payer."
      ],
      "Currency is editable": [
        "La devise est modifiable"
      ],
      "Allow the user to change currency.": [
        "Permettre \xE0 l'utilisateur de changer de devise."
      ],
      "Supported currencies": [
        "Devises prises en charge"
      ],
      "Supported currencies: %1$s": [
        "Devises prises en charge\u202F: %1$s"
      ],
      "Minimum age": [
        "Age minimum"
      ],
      "Is this contract restricted to some age?": [
        "Ce contrat doit-il contenir une limite d'\xE2ge\u202F?"
      ],
      "Payment timeout": [
        "D\xE9lai de paiement"
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        "De combien de temps le client dispose pour le paiement apr\xE8s la cr\xE9ation de la commande."
      ],
      "OTP device": [
        "Appareil OTP"
      ],
      "Use to verify transactions in offline mode.": [
        "A utiliser pour v\xE9rifier la transaction en mode hors ligne."
      ],
      "No OTP device.": [
        "Aucun appareil OTP."
      ],
      "Add one first": [
        "Ajouter un premier \xE9l\xE9ment"
      ],
      "No device": [
        "Aucun appareil"
      ],
      "Add new templates": [
        "Ajouter de nouveaux mod\xE8les"
      ],
      "Load more templates before the first one": [
        "Ajouter de nouveaux mod\xE8les avant le premier"
      ],
      "Delete selected templates from the database": [
        "Effacer les mod\xE8les s\xE9lectionn\xE9s de la base de donn\xE9es"
      ],
      "Use template to create new order": [
        "Utiliser le mod\xE8le pour cr\xE9er une nouvelle commande"
      ],
      "Generate a QR code for the template.": [
        "Cr\xE9er un code QR pour le mod\xE8le."
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        "Ajouter des mod\xE8les apr\xE8s le dernier"
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        "Il n'y a pas encore de mod\xE8les, ajoutez-en en appuyant sur le signe +"
      ],
      "Jump to template with the given template ID": [
        "Aller directement au mod\xE8le avec cet identifiant"
      ],
      "Template identification": [
        "Identification du mod\xE8le"
      ],
      "Delete template": [
        "Suppression d'un mod\xE8le"
      ],
      'Delete the template "%1$s"': [
        "Suppression d'un mod\xE8le"
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        "Si vous effacez le mod\xE8le %1$s (identifiant\u202F: %2$s) vous pourriez perdre des informations"
      ],
      "Deleting a template cannot be undone.": [
        "La suppression d'un produit est irr\xE9versible."
      ],
      "Print": [
        "Imprimer"
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        "S'il est utilis\xE9, ce mod\xE8le cr\xE9era des commandes avec le m\xEAme r\xE9sum\xE9."
      ],
      "If specified, this template will create orders with the same price": [
        "S'il est utilis\xE9, ce mod\xE8le cr\xE9era des commandes avec le m\xEAme prix"
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        "De combien de temps le client dispose pour le paiement apr\xE8s la cr\xE9ation de la commande."
      ],
      "An amount is required": [
        "Montant obligatoire"
      ],
      "An order summary is required": [
        "Un r\xE9sum\xE9 de la commande est obligatoire"
      ],
      'No more stock for product with ID "%1$s".': [
        `Il n'y a plus de stock pour le produit dont l'identifiant est "%1$s".`
      ],
      "New order from template": [
        "Nouvelle commande \xE0 partir d'un mod\xE8le"
      ],
      "Amount of the order": [
        "Montant de la commande"
      ],
      "Slug": [
        "Type"
      ],
      "Token family slug to use in URLs (for internal use only)": [
        "Type de famille de jetons \xE0 utiliser dans les URL (\xE0 usage interne uniquement)"
      ],
      "Kind": [
        "Type"
      ],
      "Token family kind": [
        "Type de famille de jeton"
      ],
      "User-readable token family name": [
        "Nom de famille du jeton compr\xE9hensible par l'utilisateur"
      ],
      "Token family description for customers": [
        "Description de la famille de jetons pour les clients"
      ],
      "Valid After": [
        "Valide \xE0 partir de"
      ],
      "Token family can issue tokens after this date": [
        "La famille de jetons peut \xE9mettre des jetons apr\xE8s cette date"
      ],
      "Valid Before": [
        "Valide jusqu'\xE0"
      ],
      "Token family can issue tokens until this date": [
        "La famille de jetons peut \xE9mettre des jetons jusqu'\xE0 cette date"
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        "Dur\xE9e de validit\xE9 d'un jeton \xE9mis"
      ],
      "Token Families": [
        "Familles de jetons"
      ],
      "Add token family": [
        "Ajouter une famille de jetons"
      ],
      "Go to token family update page": [
        "Aller \xE0 la page de modification des familles de jetons"
      ],
      "Remove this token family from the database": [
        "Effacer cette famille de jetons de la base de donn\xE9es"
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        "Il n'y a pas encore de familles de jetons, ajoutez la premi\xE8re en appuyant sur le signe +."
      ],
      "Token family has been deleted.": [
        'Famille de jetons "%1$s" (type\u202F: %2$s) a \xE9t\xE9 effac\xE9e'
      ],
      "Delete token family": [
        "\xC9chec de la suppression de la famille de jetons"
      ],
      'Delete the token family "%1$s"': [
        "Suppression de la famille de jetons %1$s ."
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        "Si vous supprimez la famille de jetons %1$s ( Cat\xE9gorie\u202F: %2$s), tous les jetons \xE9mis deviendront invalides."
      ],
      "Deleting a token family %1$s .": [
        "Suppression de la famille de jetons %1$s ."
      ],
      "can't be undone": [
        "ne peut \xEAtre annul\xE9"
      ],
      "Token Family: %1$s": [
        "Famille de jetons\u202F: %1$s"
      ],
      "Incoming wire transfers": [
        "Virements bancaires"
      ],
      "Load more wire transfers preceding the first one": [
        "Charger des virements avant le premier"
      ],
      "Expected credit": [
        "Ex\xE9cut\xE9 le"
      ],
      "Confirmed": [
        "Confirm\xE9"
      ],
      "Validated": [
        "Valide \xE0 partir de"
      ],
      "Executed on": [
        "Ex\xE9cut\xE9 le"
      ],
      "yes": [
        "oui"
      ],
      "no": [
        "non"
      ],
      "never": [
        "jamais"
      ],
      "unknown": [
        "inconnu"
      ],
      "Load more transfers after the last one": [
        "Ajouter des virements apr\xE8s le dernier"
      ],
      "Verified wire transfers": [
        "Virements bancaires"
      ],
      "Verified": [
        "V\xE9rifi\xE9"
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        "Il n'y a pas encore de virements, ajoutez-en en appuyant sur le signe +"
      ],
      "All accounts": [
        "Tous les comptes"
      ],
      "Filter by account address": [
        "Filtre sur l'adresse du compte"
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        "Afficher uniquement les commandes qui ont d\xE9j\xE0 \xE9t\xE9 transf\xE9r\xE9es par le prestataire de services de paiement"
      ],
      "Only show wire transfers confirmed by the merchant": [
        "Afficher uniquement les virements bancaires confirm\xE9s par le commer\xE7ant"
      ],
      "Wire transfer already confirmed.": [
        "Date limite pour les virements"
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        "Confirmez le m\xEAme jeton d'acc\xE8s"
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        "Calendrier"
      ],
      "Transfer ID": [
        "Virements"
      ],
      "It's not the same.": [
        "N'est pas le m\xEAme"
      ],
      'You are deleting the instance with ID "%1$s"': [
        `Vous modifiez le jeton d'acc\xE8s de l'instance dont l'identifiant est "%1$s"`
      ],
      "Instance": [
        "Instances"
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        "Purger"
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        "Le d\xE9lai de paiement ne peut \xEAtre sup\xE9rieur au d\xE9lai de virement"
      ],
      "Instance id": [
        "Identifiant d'instance"
      ],
      "Delete this instance": [
        "Suppression d'une instance %1$s ."
      ],
      "Must be one of '%1$s'": [
        "Doit \xEAtre l'un des \xE9l\xE9ments suivants '%1$s'"
      ],
      "URL is invalid": [
        "La chaine JSON est invalide"
      ],
      "Webhook ID to use": [
        "Identifiant du Webhook \xE0 utiliser"
      ],
      "Event": [
        "Ev\xE8nement"
      ],
      "Payment": [
        "URI de payment"
      ],
      "Order settled": [
        "Statut de la commande"
      ],
      "Category added": [
        "Nom de la cat\xE9gorie"
      ],
      "Category updated": [
        "Nom de la cat\xE9gorie"
      ],
      "Inventory added": [
        "Inventaire"
      ],
      "Inventory updated": [
        "Inventaire"
      ],
      "Inventory deleted": [
        "Inventaire"
      ],
      "The event of the webhook: why the webhook is used": [
        "L'\xE9v\xE9nement du webhook\u202F: pourquoi le webhook est-il utilis\xE9"
      ],
      "Method": [
        "M\xE9thode"
      ],
      "GET": [
        "GET"
      ],
      "POST": [
        "POST"
      ],
      "PUT": [
        "PUT"
      ],
      "PATCH": [
        "PATCH"
      ],
      "HEAD": [
        "HEAD"
      ],
      "Method used by the webhook": [
        "M\xE9thode utilis\xE9e par le webhook"
      ],
      "URL": [
        "URL"
      ],
      "URL of the webhook where the customer will be redirected": [
        "URL du webhook o\xF9 le client sera redirig\xE9"
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        "Le texte ci-dessous prend en charge le moteur de mod\xE8le %1$s. Toute cha\xEEne comprise entre %2$s et %3$s sera remplac\xE9e par la valeur de la variable correspondante."
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        "Par exemple, %1$s sera remplac\xE9 par le prix de la commande"
      ],
      "The short list of variables are:": [
        "La liste restreinte des variables est la suivante\u202F:"
      ],
      "order's description": [
        "description de la commande"
      ],
      "order's price": [
        "prix de la commande"
      ],
      "order's unique identification": [
        "identification unique de la commande"
      ],
      "the amount that was being refunded": [
        "le montant rembours\xE9"
      ],
      "the reason entered by the merchant staff for granting the refund": [
        "la raison invoqu\xE9e par le personnel du commer\xE7ant pour accorder le remboursement"
      ],
      "time of the refund in nanoseconds since 1970": [
        "instant du remboursement en nanosecondes depuis 1970"
      ],
      "Http header": [
        "Ent\xEAte"
      ],
      "Header template of the webhook": [
        "Mod\xE8le d'ent\xEAte pour le webhook"
      ],
      "Http body": [
        "body HTTP"
      ],
      "Body template used by the webhook.": [
        "Mod\xE8le de body pour le webhook"
      ],
      "Webhook deleted successfully": [
        "Suppression r\xE9ussie du webhook"
      ],
      "Add new webhooks": [
        "Ajouter de nouveaux webhooks"
      ],
      "Load more webhooks before the first one": [
        "Ajouter des webhooks avant le premier"
      ],
      "Event type": [
        "Type d'\xE9v\xE8nement"
      ],
      "Delete selected webhook from the database": [
        "Supprimer le webhook s\xE9lectionn\xE9 de la base de donn\xE9es"
      ],
      "Load more webhooks after the last one": [
        "Ajouter des webhooks apr\xE8s le dernier"
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        "Il n'y a pas encore de webhook, ajoutez-en en appuyant sur le signe +"
      ],
      "Webhook updated": [
        "Webhook modifi\xE9"
      ],
      "Header": [
        "Ent\xEAte"
      ],
      "Body": [
        "Corps"
      ],
      "Body template used by the webhook": [
        "Mod\xE8le de body pour le webhook"
      ],
      "There is another instance with this username.": [
        "Affiche plus d'options dans le formulaire de configuration de l'instance"
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        "Email de contact"
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        "Cr\xE9\xE9 \xE0"
      ],
      "Password reset": [
        "Mot de passe"
      ],
      'Resetting access to the instance "%1$s"': [
        "Vous d\xE9finissez le jeton d'acc\xE8s pour la nouvelle instance"
      ],
      "Reset": [
        ""
      ],
      "Language": [
        "Langue"
      ],
      "Date format": [
        "Format de la date"
      ],
      "How the date is going to be displayed": [
        "Comment la date sera affich\xE9e"
      ],
      "Merchant type": [
        "Type d'\xE9v\xE8nement"
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        "Mode d\xE9velopeur"
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        "Commandes"
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        "Statut de la commande"
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        "Statut de la commande"
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        "prix de la commande"
      ],
      "hour": [
        "heures"
      ],
      "day": [
        "jours"
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        "Effacer tous les filtres"
      ],
      "Time range": [
        "Calendrier"
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        "Courant"
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        "D\xE9lai de paiement"
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        "Vous devez associer un compte bancaire pour recevoir des fonds."
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        "Sans cela, le backend du commer\xE7ant refusera de cr\xE9er de nouvelles commandes."
      ],
      "Hide for today": [
        "Cacher pour aujourd'hui"
      ],
      "KYC verification needed": [
        "V\xE9rification de l'identit\xE9 du client (KYC) n\xE9cessaire"
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        "Certains transferts sont suspendus jusqu'\xE0 ce que la proc\xE9dure de v\xE9rification de l'identit\xE9 du client (KYC) soit achev\xE9e. Pour plus d'informations, consultez la section KYC dans le panneau de gauche"
      ],
      "The request reached a timeout, check your connection.": [
        "La demande a d\xE9pass\xE9 le temps de traitement maximum, v\xE9rifiez votre connexion."
      ],
      "The request was cancelled.": [
        "La demande a \xE9t\xE9 annul\xE9e."
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        "Un grand nombre de demandes ont \xE9t\xE9 adress\xE9es au m\xEAme serveur et cette action a \xE9t\xE9 ralentie."
      ],
      "The server's response was malformed.": [
        "La r\xE9ponse de la demande est malform\xE9e."
      ],
      "Could not complete the request due to a network problem.": [
        "La demande n'a pas pu \xEAtre trait\xE9e en raison d'un probl\xE8me de r\xE9seau."
      ],
      "Unexpected request error.": [
        "Erreur inattendue sur la requ\xEAte."
      ],
      "Unexpected error.": [
        "Erreur inattendue."
      ],
      "Add new instance": [
        "Ajouter une nouvelle instance"
      ],
      "Edit": [
        "Editer"
      ],
      "Change password": [
        "Avec mot de passe"
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        "Il n'y a pas encore d'instance, ajoutez-en une en appuyant sur le signe +"
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        `L'instance "%1$s" (identifiant\u202F: %2$s) a \xE9t\xE9 effac\xE9e`
      ],
      "Only show active instances": [
        "N'afficher que les instances actives"
      ],
      "Active": [
        "Actives"
      ],
      "Only show deleted instances": [
        "N'afficher que les instances effac\xE9es"
      ],
      "Deleted": [
        "Effac\xE9es"
      ],
      "Show all instances": [
        "Afficher toutes les instances"
      ],
      "Delete instance": [
        "Suppression d'une instance %1$s ."
      ],
      'Delete the instance "%1$s"': [
        "Suppression d'une instance %1$s ."
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        "Si vous supprimez l'instance nomm\xE9e %1$s (ID\u202F: %2$s), le commer\xE7ant ne sera plus en mesure de traiter les commandes ou les remboursements"
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        "Cette action supprime la cl\xE9 priv\xE9e de l'instance, mais pr\xE9serve toutes les donn\xE9es de transaction. Vous pouvez toujours acc\xE9der \xE0 ces donn\xE9es apr\xE8s avoir supprim\xE9 l'instance."
      ],
      "Deleting an instance %1$s": [
        "Suppression d'une instance %1$s ."
      ],
      "This cannot be undone!": [
        "ne peut \xEAtre annul\xE9"
      ],
      "Purge the instance": [
        "Suppression d'une instance %1$s ."
      ],
      'Purge the instance "%1$s"': [
        "Purge d'une instance %1$s ."
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        "Si vous purgez l'instance nomm\xE9e %1$s (ID\u202F: %2$s), vous supprimerez \xE9galement toutes ses donn\xE9es de transaction."
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        "L'instance dispara\xEEtra de votre liste et vous ne pourrez plus acc\xE9der \xE0 ses donn\xE9es."
      ],
      "Purging an instance %1$s": [
        "Purge d'une instance %1$s ."
      ],
      "checking compatibility with server...": [
        "v\xE9rification de la compatibilit\xE9 avec le serveur..."
      ],
      "Contacting the server failed": [
        "Impossible de contacter le serveur"
      ],
      "The server version is not supported": [
        "La version du serveur n'est pas support\xE9e"
      ],
      'Supported version "%1$s", server version "%2$s".': [
        'Version support\xE9e "%1$s", version du serveur "%2$s".'
      ],
      "Deleting": [
        "Suppression"
      ],
      "Changing": [
        "Modification"
      ],
      "Manage password": [
        "Gestion du stock"
      ],
      "Business Name": [
        "Nom de l'entreprise"
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        "Configuration"
      ],
      "title%1$s: New bank account": [
        "Compte bancaire"
      ],
      "title%1$s: Bank accounts": [
        "Comptes bancaires"
      ],
      "title%1$s: Update bank Account": [
        "Valider le compte bancaire\u202F: %1$s"
      ],
      "title%1$s: Orders": [
        "Commandes"
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        "Inventaire"
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        "Modification du produit impossible"
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        "Impossible de modifier la cat\xE9gorie"
      ],
      "title%1$s: Wire transfers": [
        "Virements bancaires"
      ],
      "title%1$s: Webhooks": [
        "Webhooks"
      ],
      "title%1$s: New webhook": [
        "Ajouter de nouveaux webhooks"
      ],
      "title%1$s: Update webhook": [
        "Impossible de modifier le webhook"
      ],
      "title%1$s: OTP devices": [
        "Appareils OTP"
      ],
      "title%1$s: New OTP device": [
        "Aucun appareil OTP."
      ],
      "title%1$s: Update OTP device": [
        "Appareil OTP"
      ],
      "title%1$s: New template": [
        "Utiliser le mod\xE8le"
      ],
      "title%1$s: Update template": [
        "Utiliser le mod\xE8le"
      ],
      "title%1$s: Templates": [
        "Mod\xE8les"
      ],
      "title%1$s: Use template": [
        "Utiliser le mod\xE8le"
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        "Familles de jetons"
      ],
      "title%1$s: New token family": [
        "Ajouter une famille de jetons"
      ],
      "title%1$s: Update token family": [
        "Impossible de mettre \xE0 jour la famille de jetons"
      ],
      "title%1$s: Access tokens": [
        "Jeton d'acc\xE8s"
      ],
      "title%1$s: New access token": [
        "Nouveau jeton d'acc\xE8s"
      ],
      "titleNew instance": [
        "Ajouter une nouvelle instance"
      ],
      "titleInstances": [
        "Instances"
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=(n!=1);",
  "lang": "fr",
  "completeness": 79
};
strings["es"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=n != 1;",
        "lang": "es"
      },
      "Cancel": [
        "Cancelar"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        "Cerrar"
      ],
      "Continue": [
        "Continuar"
      ],
      "Clear": [
        "Limpiar"
      ],
      "Confirm": [
        "Confirmar"
      ],
      "Correct form": [
        "Formulario correcto"
      ],
      "Comparing account details": [
        "Comparando detalle de cuentas"
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        "Verificando contra la URL de informaci\xF3n de cuenta exitoso pero la informaci\xF3n de la cuenta reportada es diferente a los detalles de cuenta en el formulario."
      ],
      "Field": [
        "Campo"
      ],
      "In the form": [
        "En el formulario"
      ],
      "Reported": [
        "Reportado"
      ],
      "Type": [
        "Tipo"
      ],
      "IBAN": [
        "IBAN"
      ],
      "Address": [
        "Direcci\xF3n"
      ],
      "Host": [
        "Host"
      ],
      "Account ID": [
        "Cuenta"
      ],
      "The account owner's legal name": [
        "Nombre del titular de la cuenta bancaria."
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        "Ciudad"
      ],
      "Bank host": [
        "Host del banco"
      ],
      "Bank account": [
        "Cuenta bancaria"
      ],
      "BIC": [
        "BIC"
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        "Validar cuenta bancaria: %1$s"
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        "Paso 1:"
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        "Copia y pega este IBAN y el nombre en el campo destinatario en to aplicaion bancaria o sitio web"
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        "Paso 2:"
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        "Copia este codigo y pegalo en el campo asunto de to aplicacion bancaria o sitio de banco"
      ],
      "Subject": [
        "Asunto"
      ],
      "Receiver postal code": [
        "Fecha de entrega"
      ],
      "Receiver town": [
        "Fecha de entrega"
      ],
      "Step 3:": [
        "Paso 3:"
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        'Asegurate que TODA la informacion es correcta, incuyendo el asunto y que estas usando la cuenta indicada. Puedes usar el boton copiar (%1$s) para prevenir errores de tipeo o el "payto://" URI debajo para copiar un solo valor.'
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        "Alternativamente si tu banco soporta PayTo URI, puedes usar este %1$s link"
      ],
      "Operation in progress...": [
        "Operaci\xF3n en progreso..."
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        "La operaci\xF3n ser\xE1 autom\xE1ticamente cancelada luego de %1$s segundos"
      ],
      "days": [
        "d\xEDas"
      ],
      "hours": [
        "horas"
      ],
      "minutes": [
        "minutos"
      ],
      "seconds": [
        "segundos"
      ],
      "Forever": [
        "por siempre"
      ],
      "%1$sM": [
        "%1$sM"
      ],
      "%1$sY": [
        "%1$sA"
      ],
      "%1$sd": [
        "%1$sd"
      ],
      "%1$sh": [
        "%1$sh"
      ],
      "%1$smin": [
        "%1$smin"
      ],
      "%1$ssec": [
        "%1$sseg"
      ],
      "Change value to never": [
        "cambiar valor a nunca"
      ],
      "Change value to empty": [
        "cambiar valor a vac\xEDo"
      ],
      "Image must be smaller than 1 MB": [
        "La imagen debe ser mas chica que 1 MB"
      ],
      "Add": [
        "Agregar"
      ],
      "Remove": [
        "Eliminar"
      ],
      "Country": [
        "Pa\xEDs"
      ],
      "Building number": [
        "N\xFAmero de edificio"
      ],
      "Building name": [
        "Nombre de edificio"
      ],
      "Street": [
        "Calle"
      ],
      "Post code": [
        "C\xF3digo postal"
      ],
      "Town location": [
        "Ubicaci\xF3n de ciudad"
      ],
      "District": [
        "Distrito"
      ],
      "Country subdivision": [
        "Subdivisi\xF3n de pa\xEDs"
      ],
      "Additional address lines": [
        "Informaci\xF3n adicional"
      ],
      "Orders": [
        "\xD3rdenes"
      ],
      "Inventory": [
        "Inventario"
      ],
      "Categories": [
        "Categorias"
      ],
      "Wire transfers": [
        "ID de la transferencia"
      ],
      "Templates": [
        "Plantillas"
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        "Expiraci\xF3n"
      ],
      "OTP Devices": [
        "Dispositivos OTP"
      ],
      "Webhooks": [
        "Webhooks"
      ],
      "Settings": [
        "Configuraci\xF3n"
      ],
      "Password": [
        "Contrasena"
      ],
      "Access tokens": [
        "Token de acceso"
      ],
      "Connection": [
        "Conexi\xF3n"
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        "Instancias"
      ],
      "New": [
        "Nuevo"
      ],
      "List": [
        "Lista"
      ],
      "Log out": [
        "Salir"
      ],
      "Username": [
        "Usuario"
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        'Nombre de la instancia en URL. La instancia "por defecto" es especial, ya que se utiliza para administrar otras instancias.'
      ],
      "Business name": [
        "Nombre del negocio"
      ],
      "Legal name of the business represented by this instance.": [
        "Nombre legal de la empresa representada por esta instancia."
      ],
      "Email": [
        "Correo eletr\xF3nico"
      ],
      "Contact email": [
        "Correo electr\xF3nico del contacto"
      ],
      "Phone number": [
        "N\xFAmero de enrutamiento."
      ],
      "Contact phone": [
        "Correo electr\xF3nico del contacto"
      ],
      "Website URL": [
        "URL de sitio web"
      ],
      "URL.": [
        "URL."
      ],
      "Logo": [
        "Logotipo"
      ],
      "Logo image.": [
        "Imagen del logotipo."
      ],
      "Physical location of the merchant.": [
        "Ubicaci\xF3n f\xEDsica del comerciante."
      ],
      "Jurisdiction": [
        "Jurisdicci\xF3n"
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        "Jurisdicci\xF3n para disputas legales con el comerciante."
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        "Retraso del pago por defecto"
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        "Tiempo que los clientes tienen para pagar un pedido antes de que caduque la oferta de forma predeterminada."
      ],
      "Default refund delay": [
        "Retraso del pago por defecto"
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        "Retrazo de transferencia por omisi\xF3n"
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        "Tiempo m\xE1ximo que un proveedor puede retrasar la transferencia de fondos al comerciante, lo que le permite agrupar pagos m\xE1s peque\xF1os en transferencias m\xE1s grandes y reducir las comisiones por transferencia."
      ],
      "Default wire transfer rounding interval": [
        "Retrazo de transferencia por omisi\xF3n"
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        "Orden no encontrada"
      ],
      "To second": [
        "segundos"
      ],
      "To minute": [
        "minutos"
      ],
      "To hour": [
        "horas"
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        "Vence en"
      ],
      "Required": [
        "Requerido"
      ],
      "Unauthorized": [
        "Autorizado"
      ],
      "Sending the code failed": [
        "No se pudo aceder al servidor"
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        "Algoritmo de verificaci\xF3n"
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        "Regresar"
      ],
      "Verify": [
        "Verificado"
      ],
      "Failed to send the verification code.": [
        "Fallo al eliminar instancia"
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        "Sin autenticacion"
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        "Ningun exchange aceptara pagos debido a requerimientos de KYC."
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        "Orden no encontrada"
      ],
      "Login required": [
        "Login necesario"
      ],
      "instance name": [
        "ID de instancia"
      ],
      "current password": [
        "Con contrasena"
      ],
      "Forgot password": [
        "Con contrasena"
      ],
      "Create new account": [
        "Abono en cuenta bancaria"
      ],
      "Invalid": [
        "no v\xE1lido"
      ],
      "Doesn't have the pattern of an email": [
        "La URL no tiene el formato correcto"
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        "formato inv\xE1lido"
      ],
      "Max 7 lines": [
        "m\xE1ximo 7 l\xEDneas"
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        "ID de instancia"
      ],
      "Unauthorized.": [
        "Autorizado"
      ],
      "Conflict.": [
        "Conflicto."
      ],
      "Not found.": [
        "Orden no encontrada"
      ],
      "New password": [
        "Nueva contrase\xF1a"
      ],
      "Next password to be used": [
        "siguiente token de acceso a usar"
      ],
      "Repeat password": [
        "Repetir contrase\xF1a"
      ],
      "Confirm the same password": [
        "confirmar el mismo token de acceso"
      ],
      "Please complete the marked fields and choose authorization method": [
        "Necesita completar campos marcados y escoger un m\xE9todo de autorizaci\xF3n"
      ],
      "Confirm operation": [
        "Confirmado"
      ],
      "Check the password.": [
        "Con contrasena"
      ],
      "Instance not found.": [
        "Orden no encontrada"
      ],
      "Description": [
        "Descripci\xF3n"
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        "Expiraci\xF3n"
      ],
      "Time the access token will be valid.": [
        "El token de acceso proporcionado no es v\xE1lido."
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        "Elija uno..."
      ],
      "Read only": [
        ""
      ],
      "All": [
        "Todo"
      ],
      "Order simple": [
        "ID de la orden"
      ],
      "Order Point-of-Sale": [
        "Clave punto de venta"
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        "ID de la orden"
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        "Con contrasena"
      ],
      "Please complete the marked fields": [
        "Necesita completar los campos marcados"
      ],
      "Access token created": [
        "Token de acceso"
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        "Token"
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        "No se ha configurado una instancia por 'defecto' todav\xEDa."
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        'Cree una instancia "por defecto" para empezar a utilizar el backoffice comerciante.'
      ],
      "Create access token": [
        "Establecer token de acceso"
      ],
      "Load more devices before the first one": [
        "cargar m\xE1s plantillas antes de la primera"
      ],
      "Load first page": [
        "Cargar primera pagina"
      ],
      "Created at": [
        "Creado en"
      ],
      "Expires at": [
        "Vence en"
      ],
      "Never": [
        "nunca"
      ],
      "Remove this access token": [
        "Repetir token de acceso"
      ],
      "Delete": [
        "Borrar"
      ],
      "Load more devices after the last one": [
        "cargar m\xE1s plantillas despu\xE9s de la \xFAltima"
      ],
      "Load next page": [
        "Cargar siguiente pagina"
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        "No existen productos todav\xEDa, a\xF1adir m\xE1s pulsando el s\xEDmbolo +"
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        "Establecer token de acceso"
      ],
      "Deleting an access token cannot be undone.": [
        "El borrado de un producto no se puede restaurar."
      ],
      "This is not a valid Bitcoin address.": [
        "Esta no es una direcci\xF3n de bitcoin v\xE1lida."
      ],
      "This is not a valid Ethereum address.": [
        "Esta no es una direcci\xF3n de Ethereum v\xE1lida."
      ],
      "This is not a valid host.": [
        "Esta no es una direcci\xF3n de bitcoin v\xE1lida."
      ],
      "IBANs usually have more than 4 digits.": [
        "Los n\xFAmeros IBAN usualmente tienen mas de 4 digitos"
      ],
      "IBANs usually have fewer than 34 digits.": [
        "Los n\xFAmeros IBAN usualmente tienen menos de 34 digitos"
      ],
      "The IBAN's country code could not be retrieved.": [
        "C\xF3digo de pais de IBAN no encontrado"
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        "El n\xFAmero IBAN no es v\xE1lido, fall\xF3 la verificaci\xF3n"
      ],
      "This account is not allowed.": [
        "Esta no es una direcci\xF3n de bitcoin v\xE1lida."
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        "M\xE9todo de transferencia"
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        "Selecciona un m\xE9todo de transferencia"
      ],
      "Routing": [
        "Enrutamiento"
      ],
      "Routing number": [
        "N\xFAmero de enrutamiento."
      ],
      "Account": [
        "Cuenta"
      ],
      "Account number": [
        "Numero de cuenta"
      ],
      "Code": [
        "C\xF3digo"
      ],
      "Business Identifier Code": [
        "C\xF3digo de identificaci\xF3n de la empresa."
      ],
      "International Bank Account Number": [
        "N\xFAmero de cuenta bancaria."
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        "Interfaz de pago unificado."
      ],
      "Bitcoin protocol": [
        "Protocolo Bitcoin."
      ],
      "Ethereum protocol": [
        "Protocolo Ethereum."
      ],
      "Interledger protocol": [
        "Protocolo Interledger."
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        "El nombre de la categor\xEDa"
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        "Nombre legal de la persona titular de la cuenta."
      ],
      "Invalid url": [
        "formato inv\xE1lido"
      ],
      "URL must end with a '/'": [
        "La URL que debe terminar con '/'"
      ],
      "URL must not contain params": [
        "La URL no debe contener parametros"
      ],
      "URL must not hash param": [
        "La URL no debe contener hash"
      ],
      "Conflict": [
        "Confirmar"
      ],
      'Server replied with "bad request".': [
        "El servidor responde con un c\xF3digo de error."
      ],
      "Unauthorized, check credentials.": [
        "Sin autorizacion, revisar credenciales."
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        "El endpoint no parece pertenecer al API Taler Revenue."
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        'El request tuvo exito pero el server no respondio con el campo "credit_account" asi que no podemos verificar que sea la misma cuenta.'
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        "Cuenta:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        "Si el banco soporta el API Taler Revenue entonces puedes agregar el endpoint URL debajo para mantener la informacion de ganancias sincronizada."
      ],
      "Endpoint URL": [
        "URL endpoint"
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        "Desde donde el comerciante puede descargar informacion acerca de las transferencias bancarias entrantes hacia esta cuenta"
      ],
      "Auth type": [
        "Tipo de evento"
      ],
      "Choose the authentication type for the account info URL": [
        "Verifica el tipo de autenticacion para la URL de infomacion de cuenta"
      ],
      "Without authentication": [
        "Sin autenticacion"
      ],
      "With username and password": [
        "Con contrasena"
      ],
      "With token": [
        "Crear token"
      ],
      "Do not change": [
        "URL del proveedor"
      ],
      "Username to access the account information.": [
        "Usuario para cceder a la informacion de la cuenta."
      ],
      "Password to access the account information.": [
        "Contrasena para acceder a la informacion de la cuenta."
      ],
      "Access token to access the account information.": [
        "Token de acceso para acceder a la informacion de la cuenta."
      ],
      "Match": [
        "Coincidencia"
      ],
      "Check where the information match against the server info.": [
        "Verifica si la informacion con el servidor coincide."
      ],
      "Compare info from server with account form": [
        "Comparar la informacion del servidor con el formulario de la cuenta"
      ],
      "Test": [
        "Probar"
      ],
      "Server didn't like the request we made.": [
        "El servidor responde con un c\xF3digo de error."
      ],
      "Account details": [
        "Direcci\xF3n de cuenta"
      ],
      "Check if the information matches the server info.": [
        "Verifica si la informacion con el servidor coincide."
      ],
      "The bank account has been deleted.": [
        "La cuenta bancaria se ha eliminado correctamente."
      ],
      "Bank accounts": [
        "Cuenta bancaria"
      ],
      "Add new account": [
        "Abono en cuenta bancaria"
      ],
      "Owner's name": [
        "Nombre del dueno"
      ],
      "Delete selected accounts from the database": [
        "eliminar transferencia seleccionada de la base de datos"
      ],
      "There are no accounts yet, add more pressing the + sign": [
        "No existen productos todav\xEDa, a\xF1adir m\xE1s pulsando el s\xEDmbolo +"
      ],
      "You must provide a bank account to receive payments.": [
        "URI que especifica la cuenta bancaria para acreditar los ingresos."
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        "Invalido. Solo caracteres y numero"
      ],
      "Name": [
        "Nombre"
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        "producto fue eliminado correctamente"
      ],
      "Add new devices": [
        "cargar nuevas transferencias"
      ],
      "ID": [
        "ID"
      ],
      "Total products": [
        "Precio total"
      ],
      "Delete selected category from the database": [
        "eliminar transferencia seleccionada de la base de datos"
      ],
      "There are no categories yet, add more pressing the + sign": [
        "No hay propinas todav\xEDa, agregar mas presionando el signo +"
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        "El nombre de la categor\xEDa"
      ],
      "Products": [
        "Productos"
      ],
      "Image": [
        "Imagen"
      ],
      "Load more products after the last one": [
        "cargar m\xE1s plantillas despu\xE9s de la \xFAltima"
      ],
      "There are no products in this category.": [
        "Manejar lista de productos en la orden."
      ],
      "Account's KYC status": [
        "Direcci\xF3n de cuenta"
      ],
      "Exchange": [
        "Exchange"
      ],
      "Status": [
        "Estado de la URL"
      ],
      "Ok": [
        "Ok"
      ],
      "Action required": [
        "Login necesario"
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        "Se requiere una cantidad"
      ],
      "More information required.": [
        "m\xE1s informaci\xF3n para dar contexto"
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        "Cargando..."
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        "Estado http"
      ],
      "No pending kyc verification!": [
        "\xA1No hay verificaci\xF3n kyc pendiente!"
      ],
      "Wire account is invalid": [
        "El token de acceso proporcionado no es v\xE1lido"
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        "Cambiar clave"
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        "Requerido"
      ],
      "The payment provider requires more information.": [
        "El exchange require una verificacion de la cuenta."
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        "Est\xE1 estableciendo el token de acceso para la nueva instancia"
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        "mostrar s\xF3lo los pedidos en los que los clientes han pagado, pero los pagos por transferencia del proveedor de pago siguen pendientes"
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        "cambiar valor a fecha desconocida"
      ],
      "Enter description or id": [
        "Insertar un ID para el pedido"
      ],
      "No match found for that description or ID.": [
        "no se encontraron productos con esa descripci\xF3n"
      ],
      "You must enter a valid product identifier.": [
        "Debe ingresar un identificador de producto v\xE1lido."
      ],
      "Quantity must be greater than 0!": [
        "\xA1Cantidad debe ser mayor que 0!"
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        "Esta cantidad excede las existencias restantes. Actualmente, solo quedan %1$s unidades sin reservar en las existencias."
      ],
      "Search product": [
        "Productos de inventario"
      ],
      "Quantity": [
        "Cantidad"
      ],
      "How many products will be added": [
        "cu\xE1ntos productos ser\xE1n agregados"
      ],
      "Add from inventory": [
        "Agregar del inventario"
      ],
      "This product has %1$s applicable taxes configured.": [
        "Este producto tiene %1$s impuestos aplicables configurados."
      ],
      "No taxes configured for this product.": [
        "Ningun impuesto configurado para este producto."
      ],
      "Amount": [
        "Monto"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        "Impuestos pueden estar en divisas que difieren de la principal divisa usada por el comerciante."
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        "Ingrese divisa y valor separado por dos puntos, e.g. &quot;USD:2.3&quot;."
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        "Nombre legal del impuesto, e.g. IVA o arancel."
      ],
      "Add tax to the tax list": [
        "agregar impuesto a la lista de impuestos"
      ],
      "Describe and add a product that is not in the inventory list": [
        "describa y agregue un producto que no est\xE1 en la lista de inventarios"
      ],
      "Add custom product": [
        "Agregue un producto personalizado"
      ],
      "Complete information of the product": [
        "Complete informaci\xF3n del producto"
      ],
      "Must be a number.": [
        "no es un n\xFAmero"
      ],
      "Must be greater than 0.": [
        "debe ser mayor que 0"
      ],
      "Photo of the product.": [
        "foto del producto."
      ],
      "Full product description.": [
        "descripci\xF3n completa del producto"
      ],
      "Unit name": [
        "Unidad"
      ],
      "Name of the product unit.": [
        "nombre de la unidad del producto."
      ],
      "Price per unit": [
        "Precio por unidad"
      ],
      "Amount in the current currency.": [
        "Monto de la divisa actual."
      ],
      "How many products will be added.": [
        "Cu\xE1ntos productos ser\xE1n agregados."
      ],
      "Taxes": [
        "Impuestos"
      ],
      "Total price": [
        "Precio total"
      ],
      "Must be greater than 0": [
        "debe ser mayor que 0"
      ],
      "Must have a refund deadline": [
        "deber\xEDa tener un plazo de reembolso"
      ],
      "Auto refund can't be after refund deadline": [
        "reembolso autom\xE1tico no puede ser despu\xE9s qu el plazo de reembolso"
      ],
      "Must be in the future": [
        "deber\xEDan ser en el futuro"
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        "no es v\xE1lido"
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        "Ningun exchange aceptara pagos debido a requerimientos de KYC."
      ],
      "Manage products in order": [
        "Manejar productos en orden"
      ],
      "%1$s products with a total price of %2$s.": [
        "%1$s productos con un precio total de %2$s."
      ],
      "Manage list of products in the order.": [
        "Manejar lista de productos en la orden."
      ],
      "Remove this product from the order.": [
        "Remover este producto de la orden."
      ],
      "Products price sum": [
        "Lista de producto"
      ],
      "Total product price added up": [
        "precio total de producto agregado"
      ],
      "Order price": [
        "Precio por art\xEDculo"
      ],
      "Amount to be paid by the customer": [
        "Monto a ser pagado por el cliente"
      ],
      "Final order price": [
        "Precio final de la orden"
      ],
      "Summary": [
        "Resumen"
      ],
      "Title of the order to be shown to the customer": [
        "T\xEDtulo de la orden a ser mostrado al cliente"
      ],
      "Shipping and fulfillment": [
        "Env\xEDo y cumplimiento"
      ],
      "Delivery date": [
        "Fecha de entrega"
      ],
      "Deadline for physical delivery assured by the merchant.": [
        "Plazo para la entrega f\xEDsica asegurado por el comerciante."
      ],
      "Delivery location": [
        "Fecha de entrega"
      ],
      "Address where the products will be delivered": [
        "direcci\xF3n a donde los productos ser\xE1n entregados"
      ],
      "Fulfillment URL": [
        "URL de cumplimiento"
      ],
      "URL to which the user will be redirected after successful payment.": [
        "URL al cual el usuario ser\xE1 redirigido luego de pago exitoso."
      ],
      "Fulfillment message": [
        "URL de cumplimiento"
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        "Opciones de pago de Taler"
      ],
      "Override default Taler payment settings for this order": [
        "Sobrescribir pagos por omisi\xF3n de Taler para esta orden"
      ],
      "Payment time": [
        "Opciones de pago"
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        "Plazo l\xEDmite para que el cliente pague por la oferta antes de que expire. Productos del inventario ser\xE1n reservados hasta este plazo l\xEDmite."
      ],
      "Default": [
        "Importe por defecto"
      ],
      "Refund time": [
        "Reembolsado"
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        "Tiempo hasta el cual la orden puede ser reembolsada por el comerciante."
      ],
      "Wire transfer time": [
        "ID de la transferencia"
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        "Plazo para que el proveedor haga la transferencia bancaria."
      ],
      "Auto-refund time": [
        "Plazo de reembolso autom\xE1tico"
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        "Tiempo hasta el cual la cartera ser\xE1 autom\xE1ticamente revisada por reembolsos sin interacci\xF3n por parte del usuario."
      ],
      "Maximum fee": [
        "M\xE1xima tarifa de transferencia"
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        "M\xE1xima tarifa de dep\xF3sito que el comerciante esta dispuesto a cubir para esta orden. Mayores tarifas de dep\xF3sito deben ser cubiertas completamente por el consumidor."
      ],
      "Create token": [
        "Crear token"
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        "Si el ID de orden es facil de adivinar el token previene que los usuarios puedan robar ordenes de otras personas."
      ],
      "Minimum age required": [
        "Edad m\xEDnima requerida"
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        "Cualquier valor superior a 0 limitar\xE1 las monedas que se pueden utilizar para pagar este contrato. Si est\xE1 vac\xEDo, la restricci\xF3n de edad vendr\xE1 definida por los productos"
      ],
      "Minimum age defined by the products is %1$s": [
        "La edad m\xEDnima definida por el producto es%1$s"
      ],
      "No product with age restriction in this order": [
        "No hay productos con restriccion de edad en esta orden"
      ],
      "Additional information": [
        "Informaci\xF3n adicional"
      ],
      "Custom information to be included in the contract for this order.": [
        "Informaci\xF3n personalizada que debe incluirse en el contrato para este pedido."
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        "Debes introducir un valor en JavaScript Object Notation (JSON)."
      ],
      "remove": [
        "Eliminar"
      ],
      "Custom field name": [
        "Nombre de edificio"
      ],
      "Disabled": [
        "Inhabilitado"
      ],
      "No deadline": [
        "Plazo de reembolso"
      ],
      "Deadline at %1$s": [
        "Expiracion en %1$s"
      ],
      "Select date to show nearby orders": [
        "seleccione la fecha para mostrar pedidos cercanos"
      ],
      "Only show unpaid orders": [
        "mostrar s\xF3lo pedidos pagados"
      ],
      "Only show paid orders": [
        "mostrar s\xF3lo pedidos pagados"
      ],
      "Paid": [
        "Pagado"
      ],
      "Only show orders with refunds": [
        "mostrar solo pedidos con reembolso"
      ],
      "Refunded": [
        "Reembolsado"
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        "No transferido"
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        "mostrar s\xF3lo los pedidos en los que los clientes han pagado, pero los pagos por transferencia del proveedor de pago siguen pendientes"
      ],
      "Completed": [
        "Transferido"
      ],
      "Remove all filters": [
        "Eliminar todos los filtros"
      ],
      "Clear date filter": [
        "borrar filtro de fechas"
      ],
      "Jump to date (%1$s)": [
        "Saltar a la fecha (%1$s)"
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        "saltar al pedido con el ID de pedido proporcionado"
      ],
      "Order id": [
        "ID de la orden"
      ],
      "Instance unknown": [
        "ID de instancia"
      ],
      "Order unknown": [
        "desconocido"
      ],
      "Create order": [
        "crear orden"
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        "Fecha"
      ],
      "Refund": [
        "Devoluci\xF3n"
      ],
      "copy url": [
        "copiar url"
      ],
      "Load more orders after the last one": [
        "cargue m\xE1s transferencia luego de la \xFAltima"
      ],
      "No orders have been found matching your query!": [
        "\xA1No se encontraron \xF3rdenes que emparejen su b\xFAsqueda!"
      ],
      "Duplicated": [
        "duplicado"
      ],
      "This value exceeds the refundable amount.": [
        "este monto excede el monto reembolsable"
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        "Hay requerimientos de KYC pendientes."
      ],
      "refund": [
        "reembolzar"
      ],
      "Reason": [
        "Raz\xF3n"
      ],
      "Amount to be refunded": [
        "monto a ser reembolsado"
      ],
      "Max refundable:": [
        "M\xE1ximo reembolzable:"
      ],
      "Choose one...": [
        "Elija uno..."
      ],
      "Requested by the customer": [
        "pedido por el consumidor"
      ],
      "Other": [
        "otro"
      ],
      "Why this order is being refunded": [
        "por qu\xE9 esta orden est\xE1 siendo reembolsada"
      ],
      "More information to give context": [
        "m\xE1s informaci\xF3n para dar contexto"
      ],
      "now": [
        "no"
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        "mostrar s\xF3lo los pedidos en los que los clientes han pagado, pero los pagos por transferencia del proveedor de pago siguen pendientes"
      ],
      "This wire transfer has been notified by the payment service provider.": [
        "mostrar s\xF3lo los pedidos en los que los clientes han pagado, pero los pagos por transferencia del proveedor de pago siguen pendientes"
      ],
      "This refund is waiting to be claimed by the customer.": [
        "Monto a ser pagado por el cliente"
      ],
      "This refund has been claimed by the customer.": [
        "Monto a ser pagado por el cliente"
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        "T\xE9rminos de contrato"
      ],
      "Human-readable description of the whole purchase": [
        "descripci\xF3n legible de toda la compra"
      ],
      "Total price for the transaction": [
        "precio total de la transacci\xF3n"
      ],
      "URL for this purchase": [
        "URL para esta compra"
      ],
      "Max fee": [
        "M\xE1xima comisi\xF3n"
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        "tasa m\xE1xima total de dep\xF3sito aceptada por el comerciante para este contrato"
      ],
      "Time when this contract was generated": [
        "momento en que se gener\xF3 este contrato"
      ],
      "Refund deadline": [
        "Plazo de reembolso"
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        "pasado este plazo no se aceptar\xE1n devoluciones"
      ],
      "Payment deadline": [
        "Plazo de pago"
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        "pasado este plazo, el comerciante no aceptar\xE1 pagos por el contrato"
      ],
      "Wire transfer deadline": [
        "Plazo de la transferencia bancaria"
      ],
      "Transfer deadline for the exchange": [
        "plazo de transferencia para el proveedor"
      ],
      "Time indicating when the order should be delivered": [
        "fecha en la que debe entregarse el pedido"
      ],
      "Where the order will be delivered": [
        "d\xF3nde se entregar\xE1 el pedido"
      ],
      "Auto-refund delay": [
        "Plazo de reembolso autom\xE1tico"
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        "cu\xE1nto tiempo debe intentar la cartera obtener el reembolso autom\xE1tico de la compra"
      ],
      "Extra info": [
        "Informaci\xF3n adicional"
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        "datos adicionales que solo son interpretados por la interfaz del comerciante"
      ],
      "order created": [
        "Estado de orden"
      ],
      "pay deadline": [
        "Plazo de pago"
      ],
      "refund deadline": [
        "Plazo de reembolso"
      ],
      "delivery": [
        "Fecha de entrega"
      ],
      "Order": [
        "Orden"
      ],
      "Claimed": [
        "reclamado"
      ],
      "Claimed at": [
        "reclamado en"
      ],
      "Timeline": [
        "Cronolog\xEDa"
      ],
      "Payment details": [
        "Detalles de pago"
      ],
      "Order status": [
        "Estado de orden"
      ],
      "Unpaid": [
        "impago"
      ],
      "Product list": [
        "Lista de producto"
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        "Recibimos el mensaje %1$s desde %2$s"
      ],
      "refund created: %1$s": [
        "reembolzo creado satisfactoriamente"
      ],
      "refund created: %1$s: %2$s": [
        "reembolzo creado satisfactoriamente"
      ],
      "refund taken: %1$s": [
        "Reembolsado"
      ],
      "refund taken: %1$s: %2$s": [
        "Reembolsado"
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        "Plazo de reembolso"
      ],
      "Wired": [
        "transferido"
      ],
      "Refund order": [
        "reembolsado"
      ],
      "Not refundable": [
        "No reembolsable"
      ],
      "Next event in": [
        "Proximo evento en"
      ],
      "The order was wired.": [
        "El pedido a sido cancelado."
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        "Monto reembolsado"
      ],
      "Refund taken": [
        "Reembolsado"
      ],
      "Status URL": [
        "Estado de la URL"
      ],
      "Refund URI": [
        "URI de devoluci\xF3n"
      ],
      "Pay at": [
        "URL de pago"
      ],
      "Order status URL": [
        "URL de estado de orden"
      ],
      "Payment URI": [
        "URI de pago"
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        "Estado de orden desconocido. Esto es un error, por favor contacte a su administrador."
      ],
      "Invalid. Please enter letters and numbers only.": [
        "Invalido. Solo caracteres y numero"
      ],
      "Just letters and numbers from 2 to 7": [
        "s\xF3lo letras y n\xFAmeros del 2 al 7"
      ],
      "The size of the key must be 32 characters": [
        "el tama\xF1o de la clave debe ser 32"
      ],
      "Internal ID on the system": [
        "Id interno en el sistema"
      ],
      "Useful to identify the device physically": [
        "Util para identificar dispositivos fisicos"
      ],
      "Verification algorithm": [
        "Algoritmo de verificaci\xF3n"
      ],
      "Algorithm used to verify transactions in offline mode": [
        "Algoritmo a utilizar para verificar la transacci\xF3n en modo offline"
      ],
      "Device key": [
        "Clave del dispositivo"
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        "Asegurese de que sea muy dificil de adivinar o use el generado aleatorio"
      ],
      "Your device needs to match exactly the same value": [
        "Su dispositivo necesita tener exactamente el mismo valor"
      ],
      "Generate random secret key": [
        "generar clave secreta aleatoria"
      ],
      "Random": [
        "aleatorio"
      ],
      "Create another": [
        "crear orden"
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        "Puede escanear el siguiente codigo QR con su dispositivo o guardar la clave antes de continuar."
      ],
      "OTP devices": [
        "Dispositivo OTP"
      ],
      "Delete selected devices from the database": [
        "eliminar la reserva seleccionada de la base de datos"
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        "Todav\xEDa no hay instancias, agregue m\xE1s presionando el signo +"
      ],
      "Template id is unknown": [
        "El id de la plantilla es desconocido"
      ],
      "The provided information is inconsistent with the current state of the template": [
        "La informacion provista es inconsistente con el estado actual de la plantilla"
      ],
      "Device:": [
        "Dispositivo:"
      ],
      "Algorithm to use to verify transactions in offline mode": [
        "Algoritmo a utilizar para verificar la transacci\xF3n en modo offline"
      ],
      "Not modified": [
        "No transferido"
      ],
      "Be sure to be very hard to guess or use the random generator": [
        "Asegurese de que sea muy dificil de adivinar o use el generado aleatorio"
      ],
      "Your device need to have exactly the same value": [
        "Su dispositivo necesita tener exactamente el mismo valor"
      ],
      "Change key": [
        "Cambiar clave"
      ],
      "Is not the same": [
        "no son iguales"
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        "Est\xE1 actualizando el token de acceso para la instancia con id %1$s"
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        "Confirmar modificaci\xF3n"
      ],
      "Testing password change": [
        "Contrasena"
      ],
      "Password changed": [
        "Contrasena"
      ],
      "The current password is wrong.": [
        "Con contrasena"
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        "Servidor no encontrado"
      ],
      "Add element to the list": [
        "agregar elemento a la lista"
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        "Pulse aqu\xED para configurar el stock del producto, d\xE9jelo como est\xE1 y el backend no controlar\xE1 el stock."
      ],
      "Manage stock": [
        "Administrar stock"
      ],
      "This product has been configured without stock control": [
        "este producto se ha configurado sin control de existencias"
      ],
      "Infinite": [
        "Inifinito"
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        "la p\xE9rdida no puede ser mayor que la cantidad entrante actual (max %1$s )"
      ],
      "Incoming": [
        "Ingresando"
      ],
      "Lost": [
        "Perdido"
      ],
      "Current": [
        "Actual"
      ],
      "Remove stock control for this product": [
        "eliminar el control de existencias de este producto"
      ],
      "without stock": [
        "sin stock"
      ],
      "Next restock": [
        "Pr\xF3ximo reabastecimiento"
      ],
      "Warehouse address": [
        "Direcci\xF3n de cuenta"
      ],
      "Invalid amount": [
        "Importe fijo"
      ],
      "Product identification to use in URLs (for internal use only).": [
        "Identificaci\xF3n del producto para usar en las URL (solo para uso interno)."
      ],
      "Illustration of the product for customers.": [
        "ilustraci\xF3n del producto para los clientes."
      ],
      "Product name.": [
        "Producto"
      ],
      "Product description for customers.": [
        "Descripci\xF3n del producto para los clientes."
      ],
      "Age restriction": [
        "Restricci\xF3n de edad"
      ],
      "Is this product restricted for customer below certain age?": [
        "\xBFeste producto est\xE1 restringido para clientes menores de cierta edad?"
      ],
      "Minimum age of the customer": [
        "Edad m\xEDnima requerida"
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        "Unidad que describe la cantidad de producto vendido (por ejemplo, 2 kilogramos, 5 litros, 3 art\xEDculos, 5 metros) para los clientes."
      ],
      "Example: kg, items or liters": [
        "Ejemplo: kg, item o litros"
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        "Precio de venta para los clientes, impuestos incluidos, por encima de las unidades del producto."
      ],
      "Stock": [
        "Existencias"
      ],
      "Inventory for products with finite supply (for internal use only).": [
        "Inventario de productos para productos con suministro finito (s\xF3lo para uso interno)."
      ],
      "Taxes included in the product price, exposed to customers.": [
        "Impuestos incluidos en el precio del producto, expuestos a los clientes."
      ],
      "Search by category description or id": [
        "buscar productos por su descripci\xF3n o ID"
      ],
      "Categories where this product will be listed on.": [
        "Direcci\xF3n a donde los productos ser\xE1n entregados."
      ],
      "Add product to inventory": [
        "A\xF1adir producto al inventario"
      ],
      "Product not found.": [
        "Servidor no encontrado"
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        "Ventas"
      ],
      "Sold": [
        "Vendido"
      ],
      "Free": [
        "Gratuito"
      ],
      "Go to product update page": [
        "ir a la p\xE1gina de actualizaci\xF3n del producto"
      ],
      "Update": [
        "Actualizar"
      ],
      "Remove this product from the database": [
        "eliminar este producto de la base de datos"
      ],
      "Update the product with new price": [
        "actualizar el producto con el nuevo precio"
      ],
      "Update product with new price": [
        "actualizar producto con nuevo precio"
      ],
      "Confirm update": [
        "Confirmado"
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        "la p\xE9rdida no puede ser mayor que la cantidad entrante actual (max %1$s )"
      ],
      "Add more elements to the inventory": [
        "a\xF1adir m\xE1s elementos al inventario"
      ],
      "Report elements lost in the inventory": [
        "informar de elementos perdidos en el inventario"
      ],
      "New price for the product": [
        "nuevo precio para el producto"
      ],
      "There are values with errors.": [
        "hay valores con errores"
      ],
      "Update product with new stock and price": [
        "actualizar el producto con nuevas existencias y precio"
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        "No existen productos todav\xEDa, a\xF1adir m\xE1s pulsando el s\xEDmbolo +"
      ],
      "Product (ID: %1$s) has been deleted": [
        "El producto (ID: %1$s) se ha actualizado"
      ],
      "Jump to product with the given product ID": [
        "saltar al pedido con el ID de pedido proporcionado"
      ],
      "Product id": [
        "Id de producto"
      ],
      "Delete product": [
        "seleccione un producto primero"
      ],
      'Delete the product "%1$s"': [
        "no se pudo eliminar el producto"
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        "Si elimina el producto con nombre %1$s (ID: %2$s ), el stock y la informacion relacionada se perdera"
      ],
      "Deleting a product cannot be undone.": [
        "El borrado de un producto no se puede restaurar."
      ],
      "Product id:": [
        "ID de producto:"
      ],
      "Must be greater that 0": [
        "debe ser mayor que 0"
      ],
      "Too short": [
        "demasiado corta"
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        "Identificador"
      ],
      "Name of the template in URLs.": [
        "Nombre de la plantilla en las URL."
      ],
      "Template name": [
        "Plantillas"
      ],
      "Describe what this template stands for": [
        "Describa lo que representa esta plantilla"
      ],
      "Order summary": [
        "Estado de orden"
      ],
      "If specified here, this template will create orders with the same summary": [
        "Si se especifica, esta plantilla crear\xE1 pedidos con el mismo resumen"
      ],
      "Summary is editable": [
        "El detalle es editable"
      ],
      "Allow the user to change the summary.": [
        "Permitir el usuario cambiar el detalle."
      ],
      "If specified here, this template will create orders with the same price": [
        "Si se especifica, esta plantilla crear\xE1 pedidos con el mismo precio"
      ],
      "Amount is editable": [
        "Monto abonado"
      ],
      "Allow the user to select the amount to pay.": [
        "Permitir al usuario seleccionar el monto a pagar."
      ],
      "Currency is editable": [
        "La moneda es editable"
      ],
      "Allow the user to change currency.": [
        "Permitir al usuario cambiar la moneda."
      ],
      "Supported currencies": [
        "Monedas soportadas"
      ],
      "Supported currencies: %1$s": [
        "Monedas soportadas: %1$s"
      ],
      "Minimum age": [
        "Edad m\xEDnima"
      ],
      "Is this contract restricted to some age?": [
        "\xBFEste contrato est\xE1 restringido a alguna edad?"
      ],
      "Payment timeout": [
        "Opciones de pago"
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        "Cu\xE1nto tiempo tiene el cliente para completar el pago una vez creado el pedido."
      ],
      "OTP device": [
        "Dispositivo OTP"
      ],
      "Use to verify transactions in offline mode.": [
        "Algoritmo a utilizar para verificar la transacci\xF3n en modo offline."
      ],
      "No OTP device.": [
        "Sin dispositivo OTP."
      ],
      "Add one first": [
        "Agregar uno primero"
      ],
      "No device": [
        "Sin dispotivo"
      ],
      "Add new templates": [
        "a\xF1adir nuevas plantillas"
      ],
      "Load more templates before the first one": [
        "cargar m\xE1s plantillas antes de la primera"
      ],
      "Delete selected templates from the database": [
        "eliminar las plantillas seleccionadas de la base de datos"
      ],
      "Use template to create new order": [
        "utilizar la plantilla para crear un nuevo pedido"
      ],
      "Generate a QR code for the template.": [
        "No se pudo create el reembolso"
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        "cargar m\xE1s plantillas despu\xE9s de la \xFAltima"
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        "No hay propinas todav\xEDa, agregar mas presionando el signo +"
      ],
      "Jump to template with the given template ID": [
        "saltar al pedido con el ID de pedido proporcionado"
      ],
      "Template identification": [
        "Identificacion de plantilla"
      ],
      "Delete template": [
        "cargar nuevas transferencias"
      ],
      'Delete the template "%1$s"': [
        "cargar nuevas transferencias"
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        "Si elimina la plantilla %1$s (ID: %2$s) perdera informacion"
      ],
      "Deleting a template cannot be undone.": [
        "El borrado de un producto no se puede restaurar."
      ],
      "Print": [
        "Imprimir"
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        "Si se especifica, esta plantilla crear\xE1 pedidos con el mismo resumen"
      ],
      "If specified, this template will create orders with the same price": [
        "Si se especifica, esta plantilla crear\xE1 pedidos con el mismo precio"
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        "Cu\xE1nto tiempo tiene el cliente para completar el pago una vez creado el pedido."
      ],
      "An amount is required": [
        "Se requiere una cantidad"
      ],
      "An order summary is required": [
        "Se requiere resumen del pedido"
      ],
      'No more stock for product with ID "%1$s".': [
        'No hay mas stock del producto con id "%1$s".'
      ],
      "New order from template": [
        "cargar viejas transferencias"
      ],
      "Amount of the order": [
        "Importe del pedido"
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        "Identificaci\xF3n del producto para usar en las URL (solo para uso interno)"
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        "descripci\xF3n del producto para los clientes"
      ],
      "Valid After": [
        "V\xE1lido hasta"
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        "formato inv\xE1lido"
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        "Familias de tokens"
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        "ir a la p\xE1gina de actualizaci\xF3n del producto"
      ],
      "Remove this token family from the database": [
        "eliminar este producto de la base de datos"
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        "No hay propinas todav\xEDa, agregar mas presionando el signo +."
      ],
      "Token family has been deleted.": [
        'Se ha eliminado la familia de tokens "%1$s" (SLUG: %2$s)'
      ],
      "Delete token family": [
        "No se ha podido eliminar la familia de tokens"
      ],
      'Delete the token family "%1$s"': [
        "Eliminando una familia de tokens %1$s ."
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        "Si elimina la familia de tokens %1$s (Slug: %2$s), todos los tokens emitidos no ser\xE1n v\xE1lidos."
      ],
      "Deleting a token family %1$s .": [
        "Eliminando una familia de tokens %1$s ."
      ],
      "can't be undone": [
        "no puede ser vac\xEDo"
      ],
      "Token Family: %1$s": [
        "Familia de tokens: %1$s"
      ],
      "Incoming wire transfers": [
        "ID de la transferencia"
      ],
      "Load more wire transfers preceding the first one": [
        "cargar m\xE1s transferencias antes de la primera"
      ],
      "Expected credit": [
        "Ejecutado en"
      ],
      "Confirmed": [
        "Confirmado"
      ],
      "Validated": [
        "V\xE1lido hasta"
      ],
      "Executed on": [
        "Ejecutado en"
      ],
      "yes": [
        "si"
      ],
      "no": [
        "no"
      ],
      "never": [
        "nunca"
      ],
      "unknown": [
        "desconocido"
      ],
      "Load more transfers after the last one": [
        "cargue m\xE1s transferencia luego de la \xFAltima"
      ],
      "Verified wire transfers": [
        "ID de la transferencia"
      ],
      "Verified": [
        "Verificado"
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        "No hay transferencias todav\xEDa, agregar mas presionando el signo +"
      ],
      "All accounts": [
        "Cuenta"
      ],
      "Filter by account address": [
        "filtrar por direcci\xF3n de cuenta"
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        "mostrar s\xF3lo los pedidos en los que los clientes han pagado, pero los pagos por transferencia del proveedor de pago siguen pendientes"
      ],
      "Only show wire transfers confirmed by the merchant": [
        "mostrar s\xF3lo las transferencias confirmadas por el comerciante"
      ],
      "Wire transfer already confirmed.": [
        "Plazo de la transferencia bancaria"
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        "confirmar el mismo token de acceso"
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        "Cronolog\xEDa"
      ],
      "Transfer ID": [
        "Transferencias"
      ],
      "It's not the same.": [
        "no son iguales"
      ],
      'You are deleting the instance with ID "%1$s"': [
        "Est\xE1 actualizando el token de acceso para la instancia con id %1$s"
      ],
      "Instance": [
        "Instancia"
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        "Purgar"
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        "ID de instancia"
      ],
      "Delete this instance": [
        "Borrando la instancia %1$s."
      ],
      "Must be one of '%1$s'": [
        "deber\xEDan ser iguales"
      ],
      "URL is invalid": [
        "no es v\xE1lido"
      ],
      "Webhook ID to use": [
        "ID de webhook a utilizar"
      ],
      "Event": [
        "Evento"
      ],
      "Payment": [
        "URI de pago"
      ],
      "Order settled": [
        "Estado de orden"
      ],
      "Category added": [
        "producto fue eliminado correctamente"
      ],
      "Category updated": [
        "Confirmado"
      ],
      "Inventory added": [
        "Inventario"
      ],
      "Inventory updated": [
        "Inventario"
      ],
      "Inventory deleted": [
        "Inventario"
      ],
      "The event of the webhook: why the webhook is used": [
        "El evento del webhook: por qu\xE9 se utiliza el webhook"
      ],
      "Method": [
        "M\xE9todo"
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        "M\xE9todo utilizado por el webhook"
      ],
      "URL": [
        "URL"
      ],
      "URL of the webhook where the customer will be redirected": [
        "URL del webhook al que se redirigir\xE1 al cliente"
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        "descripci\xF3n"
      ],
      "order's price": [
        "Precio de la orden"
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        "monto a ser reembolsado"
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        "Cabecera"
      ],
      "Header template of the webhook": [
        "Plantilla de cabecera del webhook"
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        "Plantilla del cuerpo del webhook"
      ],
      "Webhook deleted successfully": [
        "el webhook ha sido borrado correctamente"
      ],
      "Add new webhooks": [
        "a\xF1adir nuevos webhooks"
      ],
      "Load more webhooks before the first one": [
        "cargar m\xE1s webhooks antes del primero"
      ],
      "Event type": [
        "Tipo de evento"
      ],
      "Delete selected webhook from the database": [
        "eliminar el webhook seleccionado de la base de datos"
      ],
      "Load more webhooks after the last one": [
        "cargar m\xE1s webhooks despu\xE9s del \xFAltimo"
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        "No hay webhooks todav\xEDa, a\xF1ade m\xE1s pulsando sobre el s\xEDmbolo +"
      ],
      "Webhook updated": [
        "ID de webhook a utilizar"
      ],
      "Header": [
        "Cabecera"
      ],
      "Body": [
        "Cuerpo"
      ],
      "Body template used by the webhook": [
        "Plantilla del cuerpo del webhook"
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        "Correo electr\xF3nico del contacto"
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        "Creado en"
      ],
      "Password reset": [
        "Contrasena"
      ],
      'Resetting access to the instance "%1$s"': [
        "Est\xE1 estableciendo el token de acceso para la nueva instancia"
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        "formato inv\xE1lido"
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        "Tipo de evento"
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        "\xD3rdenes"
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        "Estado de orden"
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        "Estado de orden"
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        "Precio de la orden"
      ],
      "hour": [
        "horas"
      ],
      "day": [
        "d\xEDas"
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        "Eliminar todos los filtros"
      ],
      "Time range": [
        "Cronolog\xEDa"
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        "Actual"
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        "Opciones de pago"
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        "URI que especifica la cuenta bancaria para acreditar los ingresos."
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        "Ocultar por hoy"
      ],
      "KYC verification needed": [
        "Verificaci\xF3n KYC pendiente"
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        "El pedido a terminado en tiempo agotado, verifique su conexi\xF3n."
      ],
      "The request was cancelled.": [
        "El pedido a sido cancelado."
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        "Se hicieron muchos pedidos al mismo servidor y esta acci\xF3n a sido limitada."
      ],
      "The server's response was malformed.": [
        "La respuesta del pedido no esta bien formada."
      ],
      "Could not complete the request due to a network problem.": [
        "No se pudo completar el pedido por problemas de red."
      ],
      "Unexpected request error.": [
        "Error inesperado en el pedido."
      ],
      "Unexpected error.": [
        "Error inesperado."
      ],
      "Add new instance": [
        "agregar nueva instancia"
      ],
      "Edit": [
        "Editar"
      ],
      "Change password": [
        "Con contrasena"
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        "Todav\xEDa no hay instancias, agregue m\xE1s presionando el signo +"
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        "La instancia '%1$s' (ID: %2$s) fue eliminada"
      ],
      "Only show active instances": [
        "Solo mostrar instancias activas"
      ],
      "Active": [
        "Activo"
      ],
      "Only show deleted instances": [
        "Mostrar solo instancias eliminadas"
      ],
      "Deleted": [
        "Eliminado"
      ],
      "Show all instances": [
        "Mostrar todas las instancias"
      ],
      "Delete instance": [
        "Borrando la instancia %1$s."
      ],
      'Delete the instance "%1$s"': [
        "Borrando la instancia %1$s."
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        "Si eliminas la instancia con nombre %1$s (ID: %2$s), el comerciante no podr\xE1 procesar ordenes o rembolsos"
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        "Esta accion elimina la clave privada de la instancia pero preserva toda la informaci\xF3n transaccional. Podr\xE1s acceder a esa informaci\xF3n despu\xE9s de borrar la instancia."
      ],
      "Deleting an instance %1$s": [
        "Borrando la instancia %1$s."
      ],
      "This cannot be undone!": [
        "no puede ser vac\xEDo"
      ],
      "Purge the instance": [
        "Borrando la instancia %1$s."
      ],
      'Purge the instance "%1$s"': [
        "Purgando la instancia %1$s."
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        "Si purgas la instancia con nombre %1$s (ID: %2$s), tambien borraras toda su informacion transaccional."
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        "La instancia desaparecera de tu lista, y no volveras a tener acceso a su informacion."
      ],
      "Purging an instance %1$s": [
        "Purgando la instancia %1$s."
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        "No se pudo aceder al servidor"
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        "Borrando"
      ],
      "Changing": [
        "Cambiando"
      ],
      "Manage password": [
        "Administrar stock"
      ],
      "Business Name": [
        "Nombre del negocio"
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        "Configuraci\xF3n"
      ],
      "title%1$s: New bank account": [
        "Cuenta bancaria"
      ],
      "title%1$s: Bank accounts": [
        "Cuenta bancaria"
      ],
      "title%1$s: Update bank Account": [
        "Validar cuenta bancaria: %1$s"
      ],
      "title%1$s: Orders": [
        "\xD3rdenes"
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        "Inventario"
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        "No se pudo actualizar el producto"
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        "no se pudo actualizar el producto"
      ],
      "title%1$s: Wire transfers": [
        "ID de la transferencia"
      ],
      "title%1$s: Webhooks": [
        "Webhooks"
      ],
      "title%1$s: New webhook": [
        "a\xF1adir nuevos webhooks"
      ],
      "title%1$s: Update webhook": [
        "no se ha podido eliminar el webhook"
      ],
      "title%1$s: OTP devices": [
        "Dispositivo OTP"
      ],
      "title%1$s: New OTP device": [
        "Sin dispositivo OTP."
      ],
      "title%1$s: Update OTP device": [
        "Dispositivo OTP"
      ],
      "title%1$s: New template": [
        "a\xF1adir nuevas plantillas"
      ],
      "title%1$s: Update template": [
        "a\xF1adir nuevas plantillas"
      ],
      "title%1$s: Templates": [
        "Plantillas"
      ],
      "title%1$s: Use template": [
        "a\xF1adir nuevas plantillas"
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        "Familias de tokens"
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        "No se ha podido actualizar la familia de tokens"
      ],
      "title%1$s: Access tokens": [
        "Token de acceso"
      ],
      "title%1$s: New access token": [
        "Nuevo token de acceso"
      ],
      "titleNew instance": [
        "agregar nueva instancia"
      ],
      "titleInstances": [
        "Instancias"
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=n != 1;",
  "lang": "es",
  "completeness": 76
};
strings["en"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=(n != 1);",
        "lang": "en"
      },
      "Cancel": [
        ""
      ],
      "%1$s": [
        ""
      ],
      "Close": [
        ""
      ],
      "Continue": [
        ""
      ],
      "Clear": [
        ""
      ],
      "Confirm": [
        ""
      ],
      "Correct form": [
        ""
      ],
      "Comparing account details": [
        ""
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        ""
      ],
      "Field": [
        ""
      ],
      "In the form": [
        ""
      ],
      "Reported": [
        ""
      ],
      "Type": [
        ""
      ],
      "IBAN": [
        ""
      ],
      "Address": [
        ""
      ],
      "Host": [
        ""
      ],
      "Account ID": [
        ""
      ],
      "The account owner's legal name": [
        ""
      ],
      "The postal code of the account owner's address": [
        ""
      ],
      "Town": [
        ""
      ],
      "Bank host": [
        ""
      ],
      "Bank account": [
        ""
      ],
      "BIC": [
        ""
      ],
      "OK": [
        ""
      ],
      "Validate bank account: %1$s": [
        ""
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        ""
      ],
      "Step 1:": [
        ""
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        ""
      ],
      "Beneficiary": [
        ""
      ],
      "Step 2:": [
        ""
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        ""
      ],
      "Subject": [
        ""
      ],
      "Receiver postal code": [
        ""
      ],
      "Receiver town": [
        ""
      ],
      "Step 3:": [
        ""
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        ""
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        ""
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        ""
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        ""
      ],
      "Operation in progress...": [
        ""
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        ""
      ],
      "days": [
        ""
      ],
      "hours": [
        ""
      ],
      "minutes": [
        ""
      ],
      "seconds": [
        ""
      ],
      "Forever": [
        ""
      ],
      "%1$sM": [
        ""
      ],
      "%1$sY": [
        ""
      ],
      "%1$sd": [
        ""
      ],
      "%1$sh": [
        ""
      ],
      "%1$smin": [
        ""
      ],
      "%1$ssec": [
        ""
      ],
      "Change value to never": [
        ""
      ],
      "Change value to empty": [
        ""
      ],
      "Image must be smaller than 1 MB": [
        ""
      ],
      "Add": [
        ""
      ],
      "Remove": [
        ""
      ],
      "Country": [
        ""
      ],
      "Building number": [
        ""
      ],
      "Building name": [
        ""
      ],
      "Street": [
        ""
      ],
      "Post code": [
        ""
      ],
      "Town location": [
        ""
      ],
      "District": [
        ""
      ],
      "Country subdivision": [
        ""
      ],
      "Additional address lines": [
        ""
      ],
      "Orders": [
        ""
      ],
      "Inventory": [
        ""
      ],
      "Categories": [
        ""
      ],
      "Wire transfers": [
        ""
      ],
      "Templates": [
        ""
      ],
      "Statistics": [
        ""
      ],
      "Subscriptions and Discounts": [
        ""
      ],
      "Configuration": [
        ""
      ],
      "OTP Devices": [
        ""
      ],
      "Webhooks": [
        ""
      ],
      "Settings": [
        ""
      ],
      "Password": [
        ""
      ],
      "Access tokens": [
        ""
      ],
      "Connection": [
        ""
      ],
      "Personalization": [
        ""
      ],
      "Instances": [
        ""
      ],
      "New": [
        ""
      ],
      "List": [
        ""
      ],
      "Log out": [
        ""
      ],
      "Username": [
        ""
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        ""
      ],
      "Business name": [
        ""
      ],
      "Legal name of the business represented by this instance.": [
        ""
      ],
      "Email": [
        ""
      ],
      "Contact email": [
        ""
      ],
      "Phone number": [
        ""
      ],
      "Contact phone": [
        ""
      ],
      "Website URL": [
        ""
      ],
      "URL.": [
        ""
      ],
      "Logo": [
        ""
      ],
      "Logo image.": [
        ""
      ],
      "Physical location of the merchant.": [
        ""
      ],
      "Jurisdiction": [
        ""
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        ""
      ],
      "Pay transaction fee": [
        ""
      ],
      "Cover the transaction cost or pass it on to the user.": [
        ""
      ],
      "Default payment delay": [
        ""
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        ""
      ],
      "Default refund delay": [
        ""
      ],
      "Time merchants have to refund an order.": [
        ""
      ],
      "Default wire transfer delay": [
        ""
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        ""
      ],
      "Default wire transfer rounding interval": [
        ""
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        ""
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        ""
      ],
      "No rounding": [
        ""
      ],
      "To second": [
        ""
      ],
      "To minute": [
        ""
      ],
      "To hour": [
        ""
      ],
      "To day": [
        ""
      ],
      "To week": [
        ""
      ],
      "To month": [
        ""
      ],
      "To quarter": [
        ""
      ],
      "To year": [
        ""
      ],
      "Expired": [
        ""
      ],
      "Required": [
        ""
      ],
      "Unauthorized": [
        ""
      ],
      "Sending the code failed": [
        ""
      ],
      "Challenge expired": [
        ""
      ],
      "Too many attempts": [
        ""
      ],
      "Validation code sent.": [
        ""
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        ""
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        ""
      ],
      "Verification code": [
        ""
      ],
      "It will expire at %1$s": [
        ""
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        ""
      ],
      "Back": [
        ""
      ],
      "Verify": [
        ""
      ],
      "Failed to send the verification code.": [
        ""
      ],
      "The request was valid, but the server is refusing action.": [
        ""
      ],
      "The backend is not aware of the specified MFA challenge.": [
        ""
      ],
      "Code transmission failed.": [
        ""
      ],
      "Already solved.": [
        ""
      ],
      "It is too early to request another transmission of the challenge.": [
        ""
      ],
      "Multi-factor authentication required.": [
        ""
      ],
      "You need to complete all of this requirements.": [
        ""
      ],
      "You need to complete at least one of this requirements.": [
        ""
      ],
      "An SMS to the phone number starting with %1$s": [
        ""
      ],
      "An email to the address starting with %1$s": [
        ""
      ],
      "You have to wait until %1$s to send a new code.": [
        ""
      ],
      "I have a code": [
        ""
      ],
      "Send me a message": [
        ""
      ],
      "Logged in": [
        ""
      ],
      "Not found": [
        ""
      ],
      "Login required": [
        ""
      ],
      "instance name": [
        ""
      ],
      "current password": [
        ""
      ],
      "Forgot password": [
        ""
      ],
      "Create new account": [
        ""
      ],
      "Invalid": [
        ""
      ],
      "Doesn't have the pattern of an email": [
        ""
      ],
      "Should start with +": [
        ""
      ],
      "A phone number consists of numbers only": [
        ""
      ],
      "Invalid value": [
        ""
      ],
      "Max 7 lines": [
        ""
      ],
      "Doesn't match": [
        ""
      ],
      "Instance created": [
        ""
      ],
      "Unauthorized.": [
        ""
      ],
      "Conflict.": [
        ""
      ],
      "Not found.": [
        ""
      ],
      "New password": [
        ""
      ],
      "Next password to be used": [
        ""
      ],
      "Repeat password": [
        ""
      ],
      "Confirm the same password": [
        ""
      ],
      "Please complete the marked fields and choose authorization method": [
        ""
      ],
      "Confirm operation": [
        ""
      ],
      "Check the password.": [
        ""
      ],
      "Instance not found.": [
        ""
      ],
      "Description": [
        ""
      ],
      "Helps you remember where this token is being used before deleting it.": [
        ""
      ],
      "Duration": [
        ""
      ],
      "Time the access token will be valid.": [
        ""
      ],
      "Refreshable tokens can pose a security risk!": [
        ""
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        ""
      ],
      "Scope": [
        ""
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        ""
      ],
      "Allows all operations without limit.": [
        ""
      ],
      "Allows all operations to read information.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        ""
      ],
      "Allows all operations to read information with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        ""
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        ""
      ],
      "All (refreshable)": [
        ""
      ],
      "Spa": [
        ""
      ],
      "Spa (refreshable)": [
        ""
      ],
      "Choose one": [
        ""
      ],
      "Read only": [
        ""
      ],
      "All": [
        ""
      ],
      "Order simple": [
        ""
      ],
      "Order Point-of-Sale": [
        ""
      ],
      "Order management": [
        ""
      ],
      "Order full": [
        ""
      ],
      "Read only (refreshable)": [
        ""
      ],
      "Order simple (refreshable)": [
        ""
      ],
      "Order Point-of-Sale (refreshable)": [
        ""
      ],
      "Order management (refreshable)": [
        ""
      ],
      "Order full (refreshable)": [
        ""
      ],
      "Current password": [
        ""
      ],
      "Please complete the marked fields": [
        ""
      ],
      "Access token created": [
        ""
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        ""
      ],
      "Token": [
        ""
      ],
      "This token will never expire": [
        ""
      ],
      "This token will be available until %1$s": [
        ""
      ],
      "No 'admin' instance configured yet.": [
        ""
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        ""
      ],
      "Create access token": [
        ""
      ],
      "Load more devices before the first one": [
        ""
      ],
      "Load first page": [
        ""
      ],
      "Created at": [
        ""
      ],
      "Expires at": [
        ""
      ],
      "Never": [
        ""
      ],
      "Remove this access token": [
        ""
      ],
      "Delete": [
        ""
      ],
      "Load more devices after the last one": [
        ""
      ],
      "Load next page": [
        ""
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        ""
      ],
      "Forbidden.": [
        ""
      ],
      "Delete access token": [
        ""
      ],
      "Deleting an access token cannot be undone.": [
        ""
      ],
      "This is not a valid Bitcoin address.": [
        ""
      ],
      "This is not a valid Ethereum address.": [
        ""
      ],
      "This is not a valid host.": [
        ""
      ],
      "IBANs usually have more than 4 digits.": [
        ""
      ],
      "IBANs usually have fewer than 34 digits.": [
        ""
      ],
      "The IBAN's country code could not be retrieved.": [
        ""
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        ""
      ],
      "This account is not allowed.": [
        ""
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        ""
      ],
      "Wire method": [
        ""
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        ""
      ],
      "Select a wire method...": [
        ""
      ],
      "Routing": [
        ""
      ],
      "Routing number": [
        ""
      ],
      "Account": [
        ""
      ],
      "Account number": [
        ""
      ],
      "Code": [
        ""
      ],
      "Business Identifier Code": [
        ""
      ],
      "International Bank Account Number": [
        ""
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        ""
      ],
      "Unified Payment Interface": [
        ""
      ],
      "Bitcoin protocol": [
        ""
      ],
      "Ethereum protocol": [
        ""
      ],
      "Interledger protocol": [
        ""
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        ""
      ],
      "Name of the account holder": [
        ""
      ],
      "John Doe": [
        ""
      ],
      "Legal name of the person holding the account.": [
        ""
      ],
      "Invalid url": [
        ""
      ],
      "URL must end with a '/'": [
        ""
      ],
      "URL must not contain params": [
        ""
      ],
      "URL must not hash param": [
        ""
      ],
      "Conflict": [
        ""
      ],
      'Server replied with "bad request".': [
        ""
      ],
      "Unauthorized, check credentials.": [
        ""
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        ""
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        ""
      ],
      "Unsupported type of account": [
        ""
      ],
      "Account:": [
        ""
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        ""
      ],
      "Endpoint URL": [
        ""
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        ""
      ],
      "Auth type": [
        ""
      ],
      "Choose the authentication type for the account info URL": [
        ""
      ],
      "Without authentication": [
        ""
      ],
      "With username and password": [
        ""
      ],
      "With token": [
        ""
      ],
      "Do not change": [
        ""
      ],
      "Username to access the account information.": [
        ""
      ],
      "Password to access the account information.": [
        ""
      ],
      "Access token to access the account information.": [
        ""
      ],
      "Match": [
        ""
      ],
      "Check where the information match against the server info.": [
        ""
      ],
      "Compare info from server with account form": [
        ""
      ],
      "Test": [
        ""
      ],
      "Server didn't like the request we made.": [
        ""
      ],
      "Account details": [
        ""
      ],
      "Check if the information matches the server info.": [
        ""
      ],
      "The bank account has been deleted.": [
        ""
      ],
      "Bank accounts": [
        ""
      ],
      "Add new account": [
        ""
      ],
      "Owner's name": [
        ""
      ],
      "Delete selected accounts from the database": [
        ""
      ],
      "There are no accounts yet, add more pressing the + sign": [
        ""
      ],
      "You must provide a bank account to receive payments.": [
        ""
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        ""
      ],
      "Invalid. Please use only letters and numbers.": [
        ""
      ],
      "Name": [
        ""
      ],
      "Category name": [
        ""
      ],
      "Category deleted": [
        ""
      ],
      "Add new devices": [
        ""
      ],
      "ID": [
        ""
      ],
      "Total products": [
        ""
      ],
      "Delete selected category from the database": [
        ""
      ],
      "There are no categories yet, add more pressing the + sign": [
        ""
      ],
      "Id:": [
        ""
      ],
      "Name of the category": [
        ""
      ],
      "Products": [
        ""
      ],
      "Image": [
        ""
      ],
      "Load more products after the last one": [
        ""
      ],
      "There are no products in this category.": [
        ""
      ],
      "Account's KYC status": [
        ""
      ],
      "Exchange": [
        ""
      ],
      "Status": [
        ""
      ],
      "Ok": [
        ""
      ],
      "Action required": [
        ""
      ],
      "Warning": [
        ""
      ],
      "Error": [
        ""
      ],
      "Bank account verification required.": [
        ""
      ],
      "More information required.": [
        ""
      ],
      "Awaiting for account review.": [
        ""
      ],
      "Ready": [
        ""
      ],
      "Syncing...": [
        ""
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        ""
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        ""
      ],
      "Incompatible core banking system.": [
        ""
      ],
      "Backend internal error. Contact administrator or check again later.": [
        ""
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        ""
      ],
      "Http Status": [
        ""
      ],
      "No pending kyc verification!": [
        ""
      ],
      "Wire account is invalid": [
        ""
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        ""
      ],
      "No exchange keys": [
        ""
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        ""
      ],
      "Can't wire from this account": [
        ""
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        ""
      ],
      "KYC Required": [
        ""
      ],
      "The payment provider requires more information.": [
        ""
      ],
      "Click here to complete this step.": [
        ""
      ],
      "We are waiting for the access token to be present. Check again later.": [
        ""
      ],
      "Awaiting AML review": [
        ""
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        ""
      ],
      "This account is ready to be used with the payment service provider.": [
        ""
      ],
      "Logic bug": [
        ""
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "Internal error": [
        ""
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        ""
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        ""
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        ""
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        ""
      ],
      "Change value to unknown date": [
        ""
      ],
      "Enter description or id": [
        ""
      ],
      "No match found for that description or ID.": [
        ""
      ],
      "You must enter a valid product identifier.": [
        ""
      ],
      "Quantity must be greater than 0!": [
        ""
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        ""
      ],
      "Search product": [
        ""
      ],
      "Quantity": [
        ""
      ],
      "How many products will be added": [
        ""
      ],
      "Add from inventory": [
        ""
      ],
      "This product has %1$s applicable taxes configured.": [
        ""
      ],
      "No taxes configured for this product.": [
        ""
      ],
      "Amount": [
        ""
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        ""
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        ""
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        ""
      ],
      "Add tax to the tax list": [
        ""
      ],
      "Describe and add a product that is not in the inventory list": [
        ""
      ],
      "Add custom product": [
        ""
      ],
      "Complete information of the product": [
        ""
      ],
      "Must be a number.": [
        ""
      ],
      "Must be greater than 0.": [
        ""
      ],
      "Photo of the product.": [
        ""
      ],
      "Full product description.": [
        ""
      ],
      "Unit name": [
        ""
      ],
      "Name of the product unit.": [
        ""
      ],
      "Price per unit": [
        ""
      ],
      "Amount in the current currency.": [
        ""
      ],
      "How many products will be added.": [
        ""
      ],
      "Taxes": [
        ""
      ],
      "Total price": [
        ""
      ],
      "Must be greater than 0": [
        ""
      ],
      "Must have a refund deadline": [
        ""
      ],
      "Auto refund can't be after refund deadline": [
        ""
      ],
      "Must be in the future": [
        ""
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        ""
      ],
      "is not a valid URL": [
        ""
      ],
      'Product with ID "%1$s" is out of stock.': [
        ""
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        ""
      ],
      "Manage products in order": [
        ""
      ],
      "%1$s products with a total price of %2$s.": [
        ""
      ],
      "Manage list of products in the order.": [
        ""
      ],
      "Remove this product from the order.": [
        ""
      ],
      "Products price sum": [
        ""
      ],
      "Total product price added up": [
        ""
      ],
      "Order price": [
        ""
      ],
      "Amount to be paid by the customer": [
        ""
      ],
      "Final order price": [
        ""
      ],
      "Summary": [
        ""
      ],
      "Title of the order to be shown to the customer": [
        ""
      ],
      "Shipping and fulfillment": [
        ""
      ],
      "Delivery date": [
        ""
      ],
      "Deadline for physical delivery assured by the merchant.": [
        ""
      ],
      "Delivery location": [
        ""
      ],
      "Address where the products will be delivered": [
        ""
      ],
      "Fulfillment URL": [
        ""
      ],
      "URL to which the user will be redirected after successful payment.": [
        ""
      ],
      "Fulfillment message": [
        ""
      ],
      "Message shown to the customer after paying for the order.": [
        ""
      ],
      "Taler payment options": [
        ""
      ],
      "Override default Taler payment settings for this order": [
        ""
      ],
      "Payment time": [
        ""
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        ""
      ],
      "Default": [
        ""
      ],
      "Refund time": [
        ""
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        ""
      ],
      "Wire transfer time": [
        ""
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        ""
      ],
      "Auto-refund time": [
        ""
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        ""
      ],
      "Maximum fee": [
        ""
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        ""
      ],
      "Create token": [
        ""
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        ""
      ],
      "Minimum age required": [
        ""
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        ""
      ],
      "Minimum age defined by the products is %1$s": [
        ""
      ],
      "No product with age restriction in this order": [
        ""
      ],
      "Additional information": [
        ""
      ],
      "Custom information to be included in the contract for this order.": [
        ""
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        ""
      ],
      "remove": [
        ""
      ],
      "Custom field name": [
        ""
      ],
      "Disabled": [
        ""
      ],
      "No deadline": [
        ""
      ],
      "Deadline at %1$s": [
        ""
      ],
      "Select date to show nearby orders": [
        ""
      ],
      "Only show unpaid orders": [
        ""
      ],
      "Only show paid orders": [
        ""
      ],
      "Paid": [
        ""
      ],
      "Only show orders with refunds": [
        ""
      ],
      "Refunded": [
        ""
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        ""
      ],
      "Not wired": [
        ""
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        ""
      ],
      "Completed": [
        ""
      ],
      "Remove all filters": [
        ""
      ],
      "Clear date filter": [
        ""
      ],
      "Jump to date (%1$s)": [
        ""
      ],
      "Gone.": [
        ""
      ],
      "UnavailableForLegalReasons.": [
        ""
      ],
      "Jump to order with the given product ID": [
        ""
      ],
      "Order id": [
        ""
      ],
      "Instance unknown": [
        ""
      ],
      "Order unknown": [
        ""
      ],
      "Create order": [
        ""
      ],
      "The instance doesn't exist": [
        ""
      ],
      "The order doesn't exist": [
        ""
      ],
      "Date": [
        ""
      ],
      "Refund": [
        ""
      ],
      "copy url": [
        ""
      ],
      "Load more orders after the last one": [
        ""
      ],
      "No orders have been found matching your query!": [
        ""
      ],
      "Duplicated": [
        ""
      ],
      "This value exceeds the refundable amount.": [
        ""
      ],
      "Forbidden": [
        ""
      ],
      "Gone": [
        ""
      ],
      "There are pending KYC requirements.": [
        ""
      ],
      "refund": [
        ""
      ],
      "Reason": [
        ""
      ],
      "Amount to be refunded": [
        ""
      ],
      "Max refundable:": [
        ""
      ],
      "Choose one...": [
        ""
      ],
      "Requested by the customer": [
        ""
      ],
      "Other": [
        ""
      ],
      "Why this order is being refunded": [
        ""
      ],
      "More information to give context": [
        ""
      ],
      "now": [
        ""
      ],
      "This is when the time for making refund has been expired.": [
        ""
      ],
      "This is when the time for making the payment has been expired.": [
        ""
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        ""
      ],
      "This wire transfer has been notified by the payment service provider.": [
        ""
      ],
      "This refund is waiting to be claimed by the customer.": [
        ""
      ],
      "This refund has been claimed by the customer.": [
        ""
      ],
      "The current moment in time.": [
        ""
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        ""
      ],
      "Contract terms": [
        ""
      ],
      "Human-readable description of the whole purchase": [
        ""
      ],
      "Total price for the transaction": [
        ""
      ],
      "URL for this purchase": [
        ""
      ],
      "Max fee": [
        ""
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        ""
      ],
      "Time when this contract was generated": [
        ""
      ],
      "Refund deadline": [
        ""
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        ""
      ],
      "Payment deadline": [
        ""
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        ""
      ],
      "Wire transfer deadline": [
        ""
      ],
      "Transfer deadline for the exchange": [
        ""
      ],
      "Time indicating when the order should be delivered": [
        ""
      ],
      "Where the order will be delivered": [
        ""
      ],
      "Auto-refund delay": [
        ""
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        ""
      ],
      "Extra info": [
        ""
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        ""
      ],
      "order created": [
        ""
      ],
      "pay deadline": [
        ""
      ],
      "refund deadline": [
        ""
      ],
      "delivery": [
        ""
      ],
      "Order": [
        ""
      ],
      "Claimed": [
        ""
      ],
      "Claimed at": [
        ""
      ],
      "Timeline": [
        ""
      ],
      "Payment details": [
        ""
      ],
      "Order status": [
        ""
      ],
      "Unpaid": [
        ""
      ],
      "Product list": [
        ""
      ],
      "refund missed: %1$s": [
        ""
      ],
      "refund missed: %1$s: %2$s": [
        ""
      ],
      "refund created: %1$s": [
        ""
      ],
      "refund created: %1$s: %2$s": [
        ""
      ],
      "refund taken: %1$s": [
        ""
      ],
      "refund taken: %1$s: %2$s": [
        ""
      ],
      "The contract terms has a v1 order without choices_index.": [
        ""
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        ""
      ],
      "wired %1$s": [
        ""
      ],
      "wire deadline": [
        ""
      ],
      "Wired": [
        ""
      ],
      "Refund order": [
        ""
      ],
      "Not refundable": [
        ""
      ],
      "Next event in": [
        ""
      ],
      "The order was wired.": [
        ""
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        ""
      ],
      "Refunded amount": [
        ""
      ],
      "Refund taken": [
        ""
      ],
      "Status URL": [
        ""
      ],
      "Refund URI": [
        ""
      ],
      "Pay at": [
        ""
      ],
      "Order status URL": [
        ""
      ],
      "Payment URI": [
        ""
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        ""
      ],
      "Invalid. Please enter letters and numbers only.": [
        ""
      ],
      "Just letters and numbers from 2 to 7": [
        ""
      ],
      "The size of the key must be 32 characters": [
        ""
      ],
      "Internal ID on the system": [
        ""
      ],
      "Useful to identify the device physically": [
        ""
      ],
      "Verification algorithm": [
        ""
      ],
      "Algorithm used to verify transactions in offline mode": [
        ""
      ],
      "Device key": [
        ""
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        ""
      ],
      "Your device needs to match exactly the same value": [
        ""
      ],
      "Generate random secret key": [
        ""
      ],
      "Random": [
        ""
      ],
      "Create another": [
        ""
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        ""
      ],
      "OTP devices": [
        ""
      ],
      "Delete selected devices from the database": [
        ""
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        ""
      ],
      "Template id is unknown": [
        ""
      ],
      "The provided information is inconsistent with the current state of the template": [
        ""
      ],
      "Device:": [
        ""
      ],
      "Algorithm to use to verify transactions in offline mode": [
        ""
      ],
      "Not modified": [
        ""
      ],
      "Be sure to be very hard to guess or use the random generator": [
        ""
      ],
      "Your device need to have exactly the same value": [
        ""
      ],
      "Change key": [
        ""
      ],
      "Is not the same": [
        ""
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        ""
      ],
      "In order to verify that you have access.": [
        ""
      ],
      "Confirm change": [
        ""
      ],
      "Testing password change": [
        ""
      ],
      "Password changed": [
        ""
      ],
      "The current password is wrong.": [
        ""
      ],
      "No enough rights to change the password.": [
        ""
      ],
      "Account not found.": [
        ""
      ],
      "Add element to the list": [
        ""
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        ""
      ],
      "Manage stock": [
        ""
      ],
      "This product has been configured without stock control": [
        ""
      ],
      "Infinite": [
        ""
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        ""
      ],
      "Incoming": [
        ""
      ],
      "Lost": [
        ""
      ],
      "Current": [
        ""
      ],
      "Remove stock control for this product": [
        ""
      ],
      "without stock": [
        ""
      ],
      "Next restock": [
        ""
      ],
      "Warehouse address": [
        ""
      ],
      "Invalid amount": [
        ""
      ],
      "Product identification to use in URLs (for internal use only).": [
        ""
      ],
      "Illustration of the product for customers.": [
        ""
      ],
      "Product name.": [
        ""
      ],
      "Product description for customers.": [
        ""
      ],
      "Age restriction": [
        ""
      ],
      "Is this product restricted for customer below certain age?": [
        ""
      ],
      "Minimum age of the customer": [
        ""
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        ""
      ],
      "Example: kg, items or liters": [
        ""
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        ""
      ],
      "Stock": [
        ""
      ],
      "Inventory for products with finite supply (for internal use only).": [
        ""
      ],
      "Taxes included in the product price, exposed to customers.": [
        ""
      ],
      "Search by category description or id": [
        ""
      ],
      "Categories where this product will be listed on.": [
        ""
      ],
      "Add product to inventory": [
        ""
      ],
      "Product not found.": [
        ""
      ],
      "This change was made without outdated info.": [
        ""
      ],
      "Sales": [
        ""
      ],
      "Sold": [
        ""
      ],
      "Free": [
        ""
      ],
      "Go to product update page": [
        ""
      ],
      "Update": [
        ""
      ],
      "Remove this product from the database": [
        ""
      ],
      "Update the product with new price": [
        ""
      ],
      "Update product with new price": [
        ""
      ],
      "Confirm update": [
        ""
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        ""
      ],
      "Add more elements to the inventory": [
        ""
      ],
      "Report elements lost in the inventory": [
        ""
      ],
      "New price for the product": [
        ""
      ],
      "There are values with errors.": [
        ""
      ],
      "Update product with new stock and price": [
        ""
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        ""
      ],
      "Product (ID: %1$s) has been deleted": [
        ""
      ],
      "Jump to product with the given product ID": [
        ""
      ],
      "Product id": [
        ""
      ],
      "Delete product": [
        ""
      ],
      'Delete the product "%1$s"': [
        ""
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        ""
      ],
      "Deleting a product cannot be undone.": [
        ""
      ],
      "Product id:": [
        ""
      ],
      "Must be greater that 0": [
        ""
      ],
      "Too short": [
        ""
      ],
      "You don't have enough permissions.": [
        ""
      ],
      "There is a template with this identifier, please choose another one.": [
        ""
      ],
      "Identifier": [
        ""
      ],
      "Name of the template in URLs.": [
        ""
      ],
      "Template name": [
        ""
      ],
      "Describe what this template stands for": [
        ""
      ],
      "Order summary": [
        ""
      ],
      "If specified here, this template will create orders with the same summary": [
        ""
      ],
      "Summary is editable": [
        ""
      ],
      "Allow the user to change the summary.": [
        ""
      ],
      "If specified here, this template will create orders with the same price": [
        ""
      ],
      "Amount is editable": [
        ""
      ],
      "Allow the user to select the amount to pay.": [
        ""
      ],
      "Currency is editable": [
        ""
      ],
      "Allow the user to change currency.": [
        ""
      ],
      "Supported currencies": [
        ""
      ],
      "Supported currencies: %1$s": [
        ""
      ],
      "Minimum age": [
        ""
      ],
      "Is this contract restricted to some age?": [
        ""
      ],
      "Payment timeout": [
        ""
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        ""
      ],
      "OTP device": [
        ""
      ],
      "Use to verify transactions in offline mode.": [
        ""
      ],
      "No OTP device.": [
        ""
      ],
      "Add one first": [
        ""
      ],
      "No device": [
        ""
      ],
      "Add new templates": [
        ""
      ],
      "Load more templates before the first one": [
        ""
      ],
      "Delete selected templates from the database": [
        ""
      ],
      "Use template to create new order": [
        ""
      ],
      "Generate a QR code for the template.": [
        ""
      ],
      "Show QR": [
        ""
      ],
      "Load more templates after the last one": [
        ""
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        ""
      ],
      "Jump to template with the given template ID": [
        ""
      ],
      "Template identification": [
        ""
      ],
      "Delete template": [
        ""
      ],
      'Delete the template "%1$s"': [
        ""
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        ""
      ],
      "Deleting a template cannot be undone.": [
        ""
      ],
      "Print": [
        ""
      ],
      "The template configuration needs to be fixed.": [
        ""
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        ""
      ],
      "If specified, this template will create order with the same summary": [
        ""
      ],
      "If specified, this template will create orders with the same price": [
        ""
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        ""
      ],
      "An amount is required": [
        ""
      ],
      "An order summary is required": [
        ""
      ],
      'No more stock for product with ID "%1$s".': [
        ""
      ],
      "New order from template": [
        ""
      ],
      "Amount of the order": [
        ""
      ],
      "Slug": [
        ""
      ],
      "Token family slug to use in URLs (for internal use only)": [
        ""
      ],
      "Kind": [
        ""
      ],
      "Token family kind": [
        ""
      ],
      "User-readable token family name": [
        ""
      ],
      "Token family description for customers": [
        ""
      ],
      "Valid After": [
        ""
      ],
      "Token family can issue tokens after this date": [
        ""
      ],
      "Valid Before": [
        ""
      ],
      "Token family can issue tokens until this date": [
        ""
      ],
      "Validity Granularity": [
        ""
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        ""
      ],
      "Validity duration of a issued token": [
        ""
      ],
      "Token Families": [
        ""
      ],
      "Add token family": [
        ""
      ],
      "Go to token family update page": [
        ""
      ],
      "Remove this token family from the database": [
        ""
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        ""
      ],
      "Token family has been deleted.": [
        ""
      ],
      "Delete token family": [
        ""
      ],
      'Delete the token family "%1$s"': [
        ""
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        ""
      ],
      "Deleting a token family %1$s .": [
        ""
      ],
      "can't be undone": [
        ""
      ],
      "Token Family: %1$s": [
        ""
      ],
      "Incoming wire transfers": [
        ""
      ],
      "Load more wire transfers preceding the first one": [
        ""
      ],
      "Expected credit": [
        ""
      ],
      "Confirmed": [
        ""
      ],
      "Validated": [
        ""
      ],
      "Executed on": [
        ""
      ],
      "yes": [
        ""
      ],
      "no": [
        ""
      ],
      "never": [
        ""
      ],
      "unknown": [
        ""
      ],
      "Load more transfers after the last one": [
        ""
      ],
      "Verified wire transfers": [
        ""
      ],
      "Verified": [
        ""
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        ""
      ],
      "All accounts": [
        ""
      ],
      "Filter by account address": [
        ""
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        ""
      ],
      "Only show wire transfers confirmed by the merchant": [
        ""
      ],
      "Wire transfer already confirmed.": [
        ""
      ],
      "I have received the wire transfer": [
        ""
      ],
      "Confirm the wire transfer": [
        ""
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        ""
      ],
      "Time": [
        ""
      ],
      "Transfer ID": [
        ""
      ],
      "It's not the same.": [
        ""
      ],
      'You are deleting the instance with ID "%1$s"': [
        ""
      ],
      "Instance": [
        ""
      ],
      "Write the instance name to confirm the deletion": [
        ""
      ],
      "Purge": [
        ""
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        ""
      ],
      "DELETE": [
        ""
      ],
      "Pay delay can't be greater than wire transfer delay": [
        ""
      ],
      "Instance id": [
        ""
      ],
      "Delete this instance": [
        ""
      ],
      "Must be one of '%1$s'": [
        ""
      ],
      "URL is invalid": [
        ""
      ],
      "Webhook ID to use": [
        ""
      ],
      "Event": [
        ""
      ],
      "Payment": [
        ""
      ],
      "Order settled": [
        ""
      ],
      "Category added": [
        ""
      ],
      "Category updated": [
        ""
      ],
      "Inventory added": [
        ""
      ],
      "Inventory updated": [
        ""
      ],
      "Inventory deleted": [
        ""
      ],
      "The event of the webhook: why the webhook is used": [
        ""
      ],
      "Method": [
        ""
      ],
      "GET": [
        ""
      ],
      "POST": [
        ""
      ],
      "PUT": [
        ""
      ],
      "PATCH": [
        ""
      ],
      "HEAD": [
        ""
      ],
      "Method used by the webhook": [
        ""
      ],
      "URL": [
        ""
      ],
      "URL of the webhook where the customer will be redirected": [
        ""
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        ""
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        ""
      ],
      "The short list of variables are:": [
        ""
      ],
      "order's description": [
        ""
      ],
      "order's price": [
        ""
      ],
      "order's unique identification": [
        ""
      ],
      "the amount that was being refunded": [
        ""
      ],
      "the reason entered by the merchant staff for granting the refund": [
        ""
      ],
      "time of the refund in nanoseconds since 1970": [
        ""
      ],
      "Http header": [
        ""
      ],
      "Header template of the webhook": [
        ""
      ],
      "Http body": [
        ""
      ],
      "Body template used by the webhook.": [
        ""
      ],
      "Webhook deleted successfully": [
        ""
      ],
      "Add new webhooks": [
        ""
      ],
      "Load more webhooks before the first one": [
        ""
      ],
      "Event type": [
        ""
      ],
      "Delete selected webhook from the database": [
        ""
      ],
      "Load more webhooks after the last one": [
        ""
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        ""
      ],
      "Webhook updated": [
        ""
      ],
      "Header": [
        ""
      ],
      "Body": [
        ""
      ],
      "Body template used by the webhook": [
        ""
      ],
      "There is another instance with this username.": [
        ""
      ],
      "Self provision": [
        ""
      ],
      "Phone": [
        ""
      ],
      "Contact phone number": [
        ""
      ],
      "I agree": [
        ""
      ],
      "Accept the Terms of service": [
        ""
      ],
      "You must accept the Terms of service to continue.": [
        ""
      ],
      "Create": [
        ""
      ],
      "Password reset": [
        ""
      ],
      'Resetting access to the instance "%1$s"': [
        ""
      ],
      "Reset": [
        ""
      ],
      "Language": [
        ""
      ],
      "Date format": [
        ""
      ],
      "How the date is going to be displayed": [
        ""
      ],
      "Merchant type": [
        ""
      ],
      "Simplify UI based on the user usage.": [
        ""
      ],
      "Expert user": [
        ""
      ],
      "Taler developer": [
        ""
      ],
      "Unattended in-person offline vending": [
        ""
      ],
      "In-person online point-of-sale with inventory": [
        ""
      ],
      "Digital publishing": [
        ""
      ],
      "E-commerce site": [
        ""
      ],
      "Developer mode": [
        ""
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        ""
      ],
      "Your browser does not support the canvas element.": [
        ""
      ],
      "Bad gateway": [
        ""
      ],
      "Service unavailable": [
        ""
      ],
      "Select date from which to show statistics": [
        ""
      ],
      "Show chart": [
        ""
      ],
      "Orders chart": [
        ""
      ],
      "Show table": [
        ""
      ],
      "Orders table": [
        ""
      ],
      "Start from (%1$s)": [
        ""
      ],
      "Orders statistics": [
        ""
      ],
      "Since": [
        ""
      ],
      "No order statistics yet.": [
        ""
      ],
      "# of orders since": [
        ""
      ],
      "hour": [
        ""
      ],
      "day": [
        ""
      ],
      "week": [
        ""
      ],
      "weeks": [
        ""
      ],
      "month": [
        ""
      ],
      "months": [
        ""
      ],
      "quarter": [
        ""
      ],
      "quarters": [
        ""
      ],
      "years": [
        ""
      ],
      "Revenue chart": [
        ""
      ],
      "Revenue table": [
        ""
      ],
      "Revenue statistics filter": [
        ""
      ],
      "Time range": [
        ""
      ],
      "Select time range to group dataset by": [
        ""
      ],
      "Select the number of ranges to include in data set": [
        ""
      ],
      "Currency": [
        ""
      ],
      "Select the currency to show statistics for": [
        ""
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        ""
      ],
      "Start time": [
        ""
      ],
      "No revenue statistics yet.": [
        ""
      ],
      "Revenue": [
        ""
      ],
      "Welcome!": [
        ""
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        ""
      ],
      "You need to associate a bank account to receive revenue.": [
        ""
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        ""
      ],
      "Hide for today": [
        ""
      ],
      "KYC verification needed": [
        ""
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        ""
      ],
      "The request reached a timeout, check your connection.": [
        ""
      ],
      "The request was cancelled.": [
        ""
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        ""
      ],
      "The server's response was malformed.": [
        ""
      ],
      "Could not complete the request due to a network problem.": [
        ""
      ],
      "Unexpected request error.": [
        ""
      ],
      "Unexpected error.": [
        ""
      ],
      "Add new instance": [
        ""
      ],
      "Edit": [
        ""
      ],
      "Change password": [
        ""
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        ""
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        ""
      ],
      "Only show active instances": [
        ""
      ],
      "Active": [
        ""
      ],
      "Only show deleted instances": [
        ""
      ],
      "Deleted": [
        ""
      ],
      "Show all instances": [
        ""
      ],
      "Delete instance": [
        ""
      ],
      'Delete the instance "%1$s"': [
        ""
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        ""
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        ""
      ],
      "Deleting an instance %1$s": [
        ""
      ],
      "This cannot be undone!": [
        ""
      ],
      "Purge the instance": [
        ""
      ],
      'Purge the instance "%1$s"': [
        ""
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        ""
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        ""
      ],
      "Purging an instance %1$s": [
        ""
      ],
      "checking compatibility with server...": [
        ""
      ],
      "Contacting the server failed": [
        ""
      ],
      "The server version is not supported": [
        ""
      ],
      'Supported version "%1$s", server version "%2$s".': [
        ""
      ],
      "Deleting": [
        ""
      ],
      "Changing": [
        ""
      ],
      "Manage password": [
        ""
      ],
      "Business Name": [
        ""
      ],
      "Available statistics": [
        ""
      ],
      "There are no statistics to list": [
        ""
      ],
      "title%1$s: Settings": [
        ""
      ],
      "title%1$s: New bank account": [
        ""
      ],
      "title%1$s: Bank accounts": [
        ""
      ],
      "title%1$s: Update bank Account": [
        ""
      ],
      "title%1$s: Orders": [
        ""
      ],
      "title%1$s: New order": [
        ""
      ],
      "title%1$s: Inventory": [
        ""
      ],
      "title%1$s: New product": [
        ""
      ],
      "title%1$s: Update product": [
        ""
      ],
      "title%1$s: Category": [
        ""
      ],
      "title%1$s: New category": [
        ""
      ],
      "title%1$s: Update category": [
        ""
      ],
      "title%1$s: Wire transfers": [
        ""
      ],
      "title%1$s: Webhooks": [
        ""
      ],
      "title%1$s: New webhook": [
        ""
      ],
      "title%1$s: Update webhook": [
        ""
      ],
      "title%1$s: OTP devices": [
        ""
      ],
      "title%1$s: New OTP device": [
        ""
      ],
      "title%1$s: Update OTP device": [
        ""
      ],
      "title%1$s: New template": [
        ""
      ],
      "title%1$s: Update template": [
        ""
      ],
      "title%1$s: Templates": [
        ""
      ],
      "title%1$s: Use template": [
        ""
      ],
      "title%1$s: Personalization": [
        ""
      ],
      "title%1$s: Token families": [
        ""
      ],
      "title%1$s: New token family": [
        ""
      ],
      "title%1$s: Update token family": [
        ""
      ],
      "title%1$s: Access tokens": [
        ""
      ],
      "title%1$s: New access token": [
        ""
      ],
      "titleNew instance": [
        ""
      ],
      "titleInstances": [
        ""
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=(n != 1);",
  "lang": "en",
  "completeness": 100
};
strings["de"] = {
  "locale_data": {
    "messages": {
      "": {
        "domain": "messages",
        "plural_forms": "nplurals=2; plural=n != 1;",
        "lang": "de"
      },
      "Cancel": [
        "Abbrechen"
      ],
      "%1$s": [
        "%1$s"
      ],
      "Close": [
        "Schlie\xDFen"
      ],
      "Continue": [
        "Weiter"
      ],
      "Clear": [
        "Leeren"
      ],
      "Confirm": [
        "Eingeben"
      ],
      "Correct form": [
        "Korrektur der Angaben"
      ],
      "Comparing account details": [
        "Vergleich der Kontodetails"
      ],
      "The connection to the account info URL was successful, but the reported account information does not match the details in the form.": [
        "Die Verbindung zur Kontoinformationen-URL ist zustandegekommen, aber die zur\xFCckgemeldeten Kontendaten unterscheiden sich von den Kontodetails im Formular."
      ],
      "Field": [
        "Feld"
      ],
      "In the form": [
        "Im Formular"
      ],
      "Reported": [
        "Gemeldet"
      ],
      "Type": [
        "Typ"
      ],
      "IBAN": [
        "IBAN"
      ],
      "Address": [
        "Adresse"
      ],
      "Host": [
        "Host"
      ],
      "Account ID": [
        "Konto-ID"
      ],
      "The account owner's legal name": [
        "Der rechtsg\xFCltige Vor- und Zuname des Kontoinhabers"
      ],
      "The postal code of the account owner's address": [
        "Postleitzahl der Adresse des Kontoinhabers"
      ],
      "Town": [
        "Ort"
      ],
      "Bank host": [
        "Server der Bank (Bank host)"
      ],
      "Bank account": [
        "Bankkonto"
      ],
      "BIC": [
        "BIC"
      ],
      "OK": [
        "OK"
      ],
      "Validate bank account: %1$s": [
        "Pr\xFCfung der G\xFCltigkeit der Kontonummer: %1$s"
      ],
      "In order to prove that you are the beneficial owner of the bank account, you are required to wire a small amount to a specified bank account with the subject below.": [
        "Um nachzuweisen, dass Sie der wirtschaftlich Berechtigte des Bankkontos sind, m\xFCssen Sie einen kleinen Betrag auf das Bankkonto des Zahlungsdiensts mit dem folgenden Text im Mitteilungsfeld \xFCberweisen."
      ],
      "Step 1:": [
        "Schritt 1:"
      ],
      "Copy and paste this IBAN and the legal name of the beneficial owner into the respective fields in your preferred banking app or online banking website.": [
        "Kopieren Sie diese IBAN und f\xFCgen Sie diese mit dem Namen des Beg\xFCnstigten in die entsprechenden Felder Ihrer Banking-App oder Ihrer Online-Banking-Website ein."
      ],
      "Beneficiary": [
        "Beg\xFCnstigter"
      ],
      "Step 2:": [
        "Schritt 2:"
      ],
      "Copy this string and paste it into the 'Subject' or 'Purpose' field in your preferred banking app or online banking website.": [
        'Kopieren Sie diese Zeichenkette ins Feld \u201EBuchungsvermerk\u201C (bzw. \u201EVerwendungszweck\u201C oder "Mitteilung an Empf\xE4nger") Ihrer Banking-App oder Online-Banking-Webseite.'
      ],
      "Subject": [
        "Buchungsvermerk"
      ],
      "Receiver postal code": [
        "Postleitzahl der Adresse des Beg\xFCnstigten"
      ],
      "Receiver town": [
        "Stadt mit Sitz des Beg\xFCnstigten"
      ],
      "Step 3:": [
        "Schritt 3:"
      ],
      "Select the smallest possible amount for a wire transfer in your preferred banking app or online banking website.": [
        "W\xE4hlen Sie in Ihrer Banking-App oder Ihrem Online-Banking den kleinstm\xF6glichen Betrag f\xFCr eine \xDCberweisung aus."
      ],
      'Make sure ALL data is correct, especially the subject, and that you are choosing the bank account from which you definitely want to make the wire transfer. You can use the copy buttons (%1$s) to avoid typos or make use of the "payto://" URI below to copy just one value.': [
        'Vergewissern Sie sich, dass ALLE Daten und der Buchungsvermerk korrekt sind und Sie das richtige Bankkonto gew\xE4hlt haben. Sie k\xF6nnen die Daten durch Klicks auf die Kopiersymbole \xFCbernehmen (%1$s), um Fehler durch eigenh\xE4ndige Eingabe zu vermeiden, oder den "payto://"-URI verwenden, um mit einer Angabe alles zu kopieren.'
      ],
      "If your bank application allows you make a wire transfer using standard QR codes then try scanning the following:": [
        "Wenn Ihre Bank-App eine \xDCberweisung mit QR-Codes erm\xF6glicht, versuchen Sie, diesen Code zu scannen:"
      ],
      "As an alternative, in case that your bank already supports the 'PayTo URI' standard, you can use this %1$s link instead": [
        "Falls Ihre Bank den technischen Standard \u201Epayto:// URI\u201C bereits unterst\xFCtzt, k\xF6nnen Sie alternativ dazu den Link %1$s verwenden"
      ],
      "Operation in progress...": [
        "Die Verarbeitung ist im Gange..."
      ],
      "The operation will be automatically cancelled after %1$s seconds": [
        "Der Vorgang wird nach %1$s Sekunden automatisch abgebrochen"
      ],
      "days": [
        "Tage"
      ],
      "hours": [
        "Stunden"
      ],
      "minutes": [
        "Minuten"
      ],
      "seconds": [
        "Sekunden"
      ],
      "Forever": [
        "Unbegrenzt"
      ],
      "%1$sM": [
        "%1$sM"
      ],
      "%1$sY": [
        "%1$sY"
      ],
      "%1$sd": [
        "%1$sd"
      ],
      "%1$sh": [
        "%1$sh"
      ],
      "%1$smin": [
        "%1$smin"
      ],
      "%1$ssec": [
        "%1$ssec"
      ],
      "Change value to never": [
        "Wert auf \u201Enie\u201C setzen"
      ],
      "Change value to empty": [
        "Wert annullieren"
      ],
      "Image must be smaller than 1 MB": [
        "Die Bilddatei muss kleiner als 1 MB sein"
      ],
      "Add": [
        "Hinzuf\xFCgen"
      ],
      "Remove": [
        "Entfernen"
      ],
      "Country": [
        "Land"
      ],
      "Building number": [
        "Zus\xE4tzliche Adressangabe"
      ],
      "Building name": [
        "Name des Geb\xE4udes"
      ],
      "Street": [
        "Str."
      ],
      "Post code": [
        "Postleitzahl"
      ],
      "Town location": [
        "Ortsteil"
      ],
      "District": [
        "Bezirk/Kanton"
      ],
      "Country subdivision": [
        "Region"
      ],
      "Additional address lines": [
        "Zus\xE4tzliche Adresszeilen"
      ],
      "Orders": [
        "Bestellungen"
      ],
      "Inventory": [
        "Lagerbestand"
      ],
      "Categories": [
        "Kategorien"
      ],
      "Wire transfers": [
        "\xDCberweisungen"
      ],
      "Templates": [
        "Vorlagen"
      ],
      "Statistics": [
        "Statistiken"
      ],
      "Subscriptions and Discounts": [
        "Abos und Rabatte"
      ],
      "Configuration": [
        "Einstellungen"
      ],
      "OTP Devices": [
        "OTP-Ger\xE4te"
      ],
      "Webhooks": [
        "Webhooks"
      ],
      "Settings": [
        "Einstellungen"
      ],
      "Password": [
        "Passwort"
      ],
      "Access tokens": [
        "Zugangstoken"
      ],
      "Connection": [
        "Verbindung"
      ],
      "Personalization": [
        "Personalisierung"
      ],
      "Instances": [
        "Instanzen"
      ],
      "New": [
        "Neu"
      ],
      "List": [
        "Listen"
      ],
      "Log out": [
        "Abmelden"
      ],
      "Username": [
        "Benutzername"
      ],
      "Name of the instance in URLs. The 'admin' instance is special in that it is used to administer other instances.": [
        "K\xFCrzel Ihres Betriebsnamens, der auch f\xFCr eine Webadresse verwendet werden wird."
      ],
      "Business name": [
        "Firmenname"
      ],
      "Legal name of the business represented by this instance.": [
        "Offizieller Name des Gesch\xE4fts, der Firma oder des Verkaufsorts (z.B. wie im Handelsregister angegeben)."
      ],
      "Email": [
        "E-Mail"
      ],
      "Contact email": [
        "E-Mail-Adresse f\xFCr allgemeinen Kontakt"
      ],
      "Phone number": [
        "Telefonnummer"
      ],
      "Contact phone": [
        "Telefonnummer f\xFCr allgemeinen Kontakt"
      ],
      "Website URL": [
        "Webseiten-URL"
      ],
      "URL.": [
        "URL."
      ],
      "Logo": [
        "Logo (Signet)"
      ],
      "Logo image.": [
        "Abbildung des Firmenlogos."
      ],
      "Physical location of the merchant.": [
        "Niederlassung (Firmensitz) des H\xE4ndlers oder Verk\xE4ufers."
      ],
      "Jurisdiction": [
        "Gerichtsstand"
      ],
      "Jurisdiction for legal disputes with the merchant.": [
        "Gerichtsstand der Firma."
      ],
      "Pay transaction fee": [
        "Transaktionsgeb\xFChren bezahlen"
      ],
      "Cover the transaction cost or pass it on to the user.": [
        "Geb\xFChren aller Transaktionen \xFCbernehmen die Verk\xE4ufer (an) oder die Zahlenden (aus)."
      ],
      "Default payment delay": [
        "Normale Zahlungsfrist"
      ],
      "Time customers have to pay an order before the offer expires by default.": [
        "Zeitraum, in dem K\xE4ufer eine Bestellung bezahlen m\xFCssen, bevor das Angebot regul\xE4r verf\xE4llt."
      ],
      "Default refund delay": [
        "Zeitraum f\xFCr R\xFCckerstattungen"
      ],
      "Time merchants have to refund an order.": [
        "Dies ist der Zeitraum, in dem ein Verk\xE4ufer R\xFCckerstattungen f\xFCr bereits bezahlte Bestellungen gew\xE4hren kann."
      ],
      "Default wire transfer delay": [
        "Zeitlicher Aufschub der \xDCberweisungen"
      ],
      "Maximum time an exchange is allowed to delay wiring funds to the merchant, enabling it to aggregate smaller payments into larger wire transfers and reducing wire fees.": [
        "Zeitraum, in dem alle Kundenzahlungen zu einem Betrag zusammengefasst und vom Zahlungsdienstleister an das Bankkonto des Verk\xE4ufers \xFCberwiesen werden, um die \xDCberweisungsgeb\xFChren zu reduzieren."
      ],
      "Default wire transfer rounding interval": [
        "Rundung des zeitlichen Aufschubs der \xDCberweisungen"
      ],
      "Interval to which wire deadlines should be rounded up to.": [
        "Dies ist die Rundung des Zeitraums auf ganze Zeiteinheiten, nach deren Ablauf die zusammengefassten Ums\xE4tze an das Bankkonto \xFCberwiesen werden."
      ],
      "As an example if you set the interval to day the wire transfer deadline will be rounded to midnight.": [
        "Wenn Sie beispielsweise das Intervall auf einen Tag festlegen, wird die \xDCberweisungsfrist zu Mitternacht dieses Tages aufgerundet."
      ],
      "No rounding": [
        "Keine Rundung"
      ],
      "To second": [
        "Rundung auf eine Sekunde"
      ],
      "To minute": [
        "Rundung auf eine Minute"
      ],
      "To hour": [
        "Rundung auf eine Stunde"
      ],
      "To day": [
        "Rundung auf einen Tag"
      ],
      "To week": [
        "Rundung auf eine Woche"
      ],
      "To month": [
        "Rundung auf einen Monat"
      ],
      "To quarter": [
        "Rundung auf ein Vierteljahr"
      ],
      "To year": [
        "Rundung auf ein Jahr"
      ],
      "Expired": [
        "Abgelaufen"
      ],
      "Required": [
        "Erforderlich"
      ],
      "Unauthorized": [
        "Unberechtigter Zugriff"
      ],
      "Sending the code failed": [
        "Die \xDCbermittlung des Best\xE4tigungscodes ist fehlgeschlagen"
      ],
      "Challenge expired": [
        "Der Zeitraum f\xFCr die \xDCberpr\xFCfung ist abgelaufen"
      ],
      "Too many attempts": [
        "Es gab zu viele fehlgeschlagene Versuche"
      ],
      "Validation code sent.": [
        "Ein Best\xE4tigungscode wurde gerade zugesendet."
      ],
      'The verification code sent to the phone number starting with "%1$s"': [
        'Ein Best\xE4tigungscode wurde an die Telefonnummer gesendet, die mit "%1$s" beginnt'
      ],
      'The verification code sent to the email address starting with "%1$s"': [
        'Ein Best\xE4tigungscode wurde an die E-Mailadresse gesendet, die mit "%1$s" beginnt'
      ],
      "Verification code": [
        "Best\xE4tigungscode"
      ],
      "It will expire at %1$s": [
        "Ende der G\xFCltigkeit %1$s"
      ],
      "The challenge is expired and can't be solved but you can go back and create a new challenge.": [
        "Das Pr\xFCfverfahren zur gesicherten Anmeldung ist abgelaufen und kann nicht mehr verwendet werden, es ist jedoch m\xF6glich, ein neues Pr\xFCfverfahren anzufordern (bitte gehen Sie im Browser einen Schritt zur\xFCck)."
      ],
      "Back": [
        "Zur\xFCck"
      ],
      "Verify": [
        "Pr\xFCfen"
      ],
      "Failed to send the verification code.": [
        "Das Versenden des Best\xE4tigungscodes hat nicht funktioniert."
      ],
      "The request was valid, but the server is refusing action.": [
        "Die Anfrage war g\xFCltig, aber der Server verweigert die Bearbeitung."
      ],
      "The backend is not aware of the specified MFA challenge.": [
        "Dieser Anwendung ist die angegebene Multi-Faktor-\xDCberpr\xFCfung nicht bekannt."
      ],
      "Code transmission failed.": [
        "Die Code-\xDCbertragung ist fehlgeschlagen."
      ],
      "Already solved.": [
        "Bereits gel\xF6st."
      ],
      "It is too early to request another transmission of the challenge.": [
        "Es muss noch gewartet werden, um eine weitere \xDCbertragung des \xDCberpr\xFCfungscodes zu verlangen."
      ],
      "Multi-factor authentication required.": [
        "Es ist eine Multi-Faktor-Authentifizierung erforderlich."
      ],
      "You need to complete all of this requirements.": [
        "Sie m\xFCssen alle dieser Bedingungen erf\xFCllen."
      ],
      "You need to complete at least one of this requirements.": [
        "Sie m\xFCssen mindestens eine dieser Bedingungen erf\xFCllen."
      ],
      "An SMS to the phone number starting with %1$s": [
        "SMS erhalten an die Telefonnummer beginnend mit %1$s"
      ],
      "An email to the address starting with %1$s": [
        "Best\xE4tigungscode erhalten an die E-Mailadresse beginnend mit %1$s"
      ],
      "You have to wait until %1$s to send a new code.": [
        "Sie m\xFCssen bis %1$s warten, damit ein neuer Best\xE4tigungscode gesendet werden kann."
      ],
      "I have a code": [
        "Ich habe bereits einen g\xFCltigen Best\xE4tigungscode"
      ],
      "Send me a message": [
        "Best\xE4tigungscode zusenden"
      ],
      "Logged in": [
        "Sie sind angemeldet"
      ],
      "Not found": [
        "Nicht gefunden"
      ],
      "Login required": [
        "Anmeldung erforderlich"
      ],
      "instance name": [
        "Name zur Anmeldung im Taler Merchant Backoffice UND zur Verwendung in Webadressen"
      ],
      "current password": [
        "Ihr Passwort f\xFCr diesen Benutzernamen"
      ],
      "Forgot password": [
        "Ich habe mein Passwort vergessen"
      ],
      "Create new account": [
        "Neues Benutzerkonto erstellen"
      ],
      "Invalid": [
        "Ung\xFCltig"
      ],
      "Doesn't have the pattern of an email": [
        "Dies entspricht keiner g\xFCltigen E-Mailadresse"
      ],
      "Should start with +": [
        "Die Nummer sollte mit + beginnen"
      ],
      "A phone number consists of numbers only": [
        "Eine Telefonnummer besteht nur aus Ziffern"
      ],
      "Invalid value": [
        "Ung\xFCltiger Wert"
      ],
      "Max 7 lines": [
        "H\xF6chstens 7 Zeilen"
      ],
      "Doesn't match": [
        "Dies stimmt nicht \xFCberein"
      ],
      "Instance created": [
        "Die Instanz wurde angelegt"
      ],
      "Unauthorized.": [
        "Unberechtigter Zugriff."
      ],
      "Conflict.": [
        "Es besteht ein Konflikt zwischen erwarteter und gesendeter Information."
      ],
      "Not found.": [
        "Die Information wurde nicht gefunden."
      ],
      "New password": [
        "Neues Passwort"
      ],
      "Next password to be used": [
        "Geben Sie hier ein neues Passwort ein"
      ],
      "Repeat password": [
        "Passwort wiederholen"
      ],
      "Confirm the same password": [
        "Bitte geben Sie das Passwort hier wiederholt ein"
      ],
      "Please complete the marked fields and choose authorization method": [
        "Sie m\xFCssen die gekennzeichneten Felder ausf\xFCllen und eine Methode der Berechtigungspr\xFCfung w\xE4hlen"
      ],
      "Confirm operation": [
        "Vorgang best\xE4tigen"
      ],
      "Check the password.": [
        "\xDCberpr\xFCfen Sie das Passwort."
      ],
      "Instance not found.": [
        "Die Instanz wurde nicht gefunden."
      ],
      "Description": [
        "Beschreibung"
      ],
      "Helps you remember where this token is being used before deleting it.": [
        "Dies hilft Ihnen zur Erinnerung, wo dieser Zugangstoken verwendet wird, bevor Sie ihn l\xF6schen."
      ],
      "Duration": [
        "G\xFCltigkeitszeitraum"
      ],
      "Time the access token will be valid.": [
        "Zeitraum, in dem der Zugangstoken g\xFCltig ist."
      ],
      "Refreshable tokens can pose a security risk!": [
        "Aktualisierbare Token k\xF6nnen ein Sicherheitsrisiko darstellen!"
      ],
      "Refreshable tokens can be refreshed before their lifetime ends, effectively giving any bearer access without expiration. Only use this if you know what you are doing and you have evaluated associated risks especially in respect to the permissions granted by the scope.": [
        "Aktualisierbare Token k\xF6nnen vor Ablauf ihrer Lebensdauer aktualisiert werden, wodurch alle ihre Besitzer effektiv eine zeitlich unbegrenzte Zugangsberechtigung haben w\xFCrde. Verwenden Sie diese daher nur, wenn Sie wissen, was Sie tun und die damit verbundenen Risiken insbesondere im Hinblick auf den zugewiesenen Einsatzbereich der Berechtigung richtig einsch\xE4tzen k\xF6nnen."
      ],
      "Scope": [
        "Einsatzbereich des Zugangstokens"
      ],
      "The scope defines the set of permissions for the access token. Refreshable tokens has the permission to extend the expiration time.": [
        "Der Einsatzbereich definiert die Berechtigungen eines Zugangstokens. Bei aktualisierbaren Token k\xF6nnen ihre Besitzer die G\xFCltigkeitszeit unbegrenzt verl\xE4ngern."
      ],
      "Allows all operations without limit.": [
        "Dies erlaubt alle Vorg\xE4nge ohne jede Einschr\xE4nkung."
      ],
      "Allows all operations to read information.": [
        "Dies erm\xF6glicht allen Vorg\xE4ngen, Informationen zu lesen."
      ],
      "Allows the creation of orders and checking of payment status.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen sowie die \xDCberpr\xFCfung des Zahlungsstatus."
      ],
      "Allows the creation of orders, checking of payment status and inventory locking.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, die \xDCberpr\xFCfung des Zahlungsstatus und das Sperren des Lagerbestands."
      ],
      "Allows the creation of orders, checking of payment status and refunds.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, die \xDCberpr\xFCfung des Zahlungsstatus sowie R\xFCckerstattungen."
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, das Sperren des Lagerbestands sowie R\xFCckerstattungen."
      ],
      "Allows all operations to read information with extendable expiration time.": [
        "Dies erm\xF6glicht allen Vorg\xE4ngen das Einlesen von Informationen mit einer verl\xE4ngerbaren Verfallszeit."
      ],
      "Allows the creation of orders and checking of payment status with extendable expiration time.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen sowie die \xDCberpr\xFCfung des Zahlungsstatus mit verl\xE4ngerbarer Verfallszeit."
      ],
      "Allows the creation of orders, checking of payment status and inventory locking with extendable expiration time.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, die \xDCberpr\xFCfung des Zahlungsstatus sowie das Sperren des Lagerbestands mit verl\xE4ngerbarer Verfallszeit."
      ],
      "Allows the creation of orders, checking of payment status and refunds with extendable expiration time.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, die \xDCberpr\xFCfung des Zahlungsstatus sowie R\xFCckerstattungen mit verl\xE4ngerbarer Verfallszeit."
      ],
      "Allows the creation of orders, checking of payment status, inventory locking and refunds with extendable expiration time.": [
        "Dies erm\xF6glicht die Erstellung von Bestellungen und Barrechnungen, die \xDCberpr\xFCfung des Zahlungsstatus sowie das Sperren des Lagerbestands und R\xFCckerstattungen mit verl\xE4ngerbarer Verfallszeit."
      ],
      "All (refreshable)": [
        "Alle (aktualisierbar)"
      ],
      "Spa": [
        "SPA"
      ],
      "Spa (refreshable)": [
        "SPA (aktualisierbar)"
      ],
      "Choose one": [
        "Bitte w\xE4hlen Sie eine Option aus"
      ],
      "Read only": [
        "Schreibgesch\xFCtzt"
      ],
      "All": [
        "Alle"
      ],
      "Order simple": [
        "Einfache Bestellungen"
      ],
      "Order Point-of-Sale": [
        "Bestellungen an der Verkaufsstelle (POS)"
      ],
      "Order management": [
        "Verwaltung der Bestellungen"
      ],
      "Order full": [
        "Komplexe Bestellungen"
      ],
      "Read only (refreshable)": [
        "Schreibgesch\xFCtzt (aktualisierbar)"
      ],
      "Order simple (refreshable)": [
        "Einfache Bestellungen (aktualisierbar)"
      ],
      "Order Point-of-Sale (refreshable)": [
        "Bestellungen an der Verkaufsstelle (aktualisierbar)"
      ],
      "Order management (refreshable)": [
        "Verwaltung der Bestellungen (aktualisierbar)"
      ],
      "Order full (refreshable)": [
        "Komplexe Bestellungen (aktualisierbar)"
      ],
      "Current password": [
        "Aktuelles Passwort dieser Instanz"
      ],
      "Please complete the marked fields": [
        "Bitte f\xFCllen Sie die Felder mit verpflichtenden Angaben aus"
      ],
      "Access token created": [
        "Zugangstoken wurde erzeugt"
      ],
      "Copy the value of the access token and save it, as you cannot retrieve it again.": [
        "Kopieren und speichern Sie den Zugangstoken sofort, da Sie ihn nicht erneut abrufen k\xF6nnen."
      ],
      "Token": [
        "Zugangstoken"
      ],
      "This token will never expire": [
        "Dieser Zugangstoken wird nie ung\xFCltig"
      ],
      "This token will be available until %1$s": [
        "Dieser Zugangstoken ist verf\xFCgbar bis %1$s"
      ],
      "No 'admin' instance configured yet.": [
        "Es wurde noch keine Instanz 'admin' konfiguriert."
      ],
      "Create an 'admin' instance to begin using the merchant backoffice.": [
        "Erstellen Sie eine Instanz 'admin', um Merchant Backoffice erstmalig zu verwenden."
      ],
      "Create access token": [
        "Zugangstoken erzeugen"
      ],
      "Load more devices before the first one": [
        "Mehr Ger\xE4te vor ein erstes Ger\xE4t laden"
      ],
      "Load first page": [
        "Erste Seite laden"
      ],
      "Created at": [
        "Erstellungsdatum"
      ],
      "Expires at": [
        "Wird ung\xFCltig zum Zeitpunkt"
      ],
      "Never": [
        "Nie"
      ],
      "Remove this access token": [
        "Diesen Zugangstoken entfernen"
      ],
      "Delete": [
        "L\xF6schen"
      ],
      "Load more devices after the last one": [
        "Mehr Ger\xE4te nach dem letzten Ger\xE4t laden"
      ],
      "Load next page": [
        "N\xE4chste Seite laden"
      ],
      "There are no active sessions yet, add one by pressing the + sign": [
        "Es bestehen noch keine aktiven Sitzungen, Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Forbidden.": [
        "Unzul\xE4ssig."
      ],
      "Delete access token": [
        "Zugangstoken l\xF6schen"
      ],
      "Deleting an access token cannot be undone.": [
        "Das L\xF6schen eines Zugangstoken kann nicht r\xFCckg\xE4ngig gemacht werden."
      ],
      "This is not a valid Bitcoin address.": [
        "Dies ist keine g\xFCltige Bitcoin-Adresse."
      ],
      "This is not a valid Ethereum address.": [
        "Dies ist keine zul\xE4ssige Ethereum-Adresse."
      ],
      "This is not a valid host.": [
        "Dies ist kein g\xFCltiger Host."
      ],
      "IBANs usually have more than 4 digits.": [
        "Eine IBAN besteht normalerweise aus mehr als 4 Ziffern."
      ],
      "IBANs usually have fewer than 34 digits.": [
        "Eine IBAN besteht normalerweise aus weniger als 34 Ziffern."
      ],
      "The IBAN's country code could not be retrieved.": [
        "Der IBAN-L\xE4ndercode wurde nicht gefunden."
      ],
      "The IBAN is invalid because the checksum is wrong.": [
        "Die IBAN-Nummer ist ung\xFCltig, die Pr\xFCfsumme ist falsch."
      ],
      "This account is not allowed.": [
        "Dieses Konto ist nicht zul\xE4ssig."
      ],
      "None of the supported wire method of the server are currently supported by this app. Server settings: %1$s": [
        "Keine der g\xE4ngigen \xDCbertragungsmethoden des Servers wird zurzeit von dieser Anwendung unterst\xFCtzt. Server-Einstellungen: %1$s"
      ],
      "Wire method": [
        "\xDCberweisungsmethode"
      ],
      "Select the method you want to use to transfer your earnings to your business account.": [
        "W\xE4hlen Sie die Methode, mit der Sie Ihre Einnahmen an Ihr Gesch\xE4ftskonto \xFCberweisen m\xF6chten."
      ],
      "Select a wire method...": [
        "W\xE4hlen Sie eine \xDCberweisungsmethode..."
      ],
      "Routing": [
        "Bankleitzahlensystem"
      ],
      "Routing number": [
        "Bankleitzahl"
      ],
      "Account": [
        "Konto"
      ],
      "Account number": [
        "Kontonummer"
      ],
      "Code": [
        "Code"
      ],
      "Business Identifier Code": [
        "Business Identifier Code (BIC)"
      ],
      "International Bank Account Number": [
        "IBAN (Internationale Bankkontonummer)"
      ],
      "your bank account number, e.g. DE12 0000 1111 2222 3333 00": [
        "Ihre IBAN, z.B. CH12 0000 1111 2222 3333 00"
      ],
      "Unified Payment Interface": [
        "Unified Payment Interface (UPI)"
      ],
      "Bitcoin protocol": [
        "Bitcoin-Protokoll"
      ],
      "Ethereum protocol": [
        "Ethereum-Protokoll"
      ],
      "Interledger protocol": [
        "Interledger-Protokoll"
      ],
      "Enter the data without a scheme. A subpath may be included:": [
        "Geben Sie die Daten ohne Schema ein. Ein Pfad kann darin enthalten sein:"
      ],
      "Name of the account holder": [
        "Name des Kontoinhabers"
      ],
      "John Doe": [
        "Max Muster"
      ],
      "Legal name of the person holding the account.": [
        "Rechtsg\xFCltiger Name des Kontoinhabers."
      ],
      "Invalid url": [
        "ung\xFCltige URL"
      ],
      "URL must end with a '/'": [
        "Die URL muss mit '/' enden"
      ],
      "URL must not contain params": [
        "Die URL darf keine Parameter enthalten"
      ],
      "URL must not hash param": [
        "Die URL darf keinen Hash-Parameter enthalten"
      ],
      "Conflict": [
        "Konflikt"
      ],
      'Server replied with "bad request".': [
        'Der Server antwortete mit "bad request".'
      ],
      "Unauthorized, check credentials.": [
        "Unzul\xE4ssiger Vorgang, bitte die Zugangsdaten (Token, Anmeldename, Passwort) \xFCberpr\xFCfen."
      ],
      "The endpoint does not seem to be a Taler Revenue API.": [
        "Die Gegenstelle scheint keine Taler-Einzahlungsschnittstelle (Taler Revenue API) zu sein."
      ],
      "The request was made correctly, but the bank's server did not respond with the appropriate value for 'credit_account', so we cannot confirm that it is the same bank account.": [
        "Die Anfrage war richtig gestellt, doch der Server der Bank antwortete nicht mit dem passenden Wert (f\xFCr 'credit_account'), so dass wir nicht best\xE4tigen k\xF6nnen, dass es sich um dasselbe Bankkonto handelt."
      ],
      "Unsupported type of account": [
        "Nicht unterst\xFCtzter Kontotyp"
      ],
      "Account:": [
        "Konto:"
      ],
      "If the bank supports Taler Revenue API then you can add the endpoint URL below to keep the revenue information in sync.": [
        "Wenn die kontof\xFChrende Bank die Schnittstelle Taler Revenue API unterst\xFCtzt, k\xF6nnen Sie die untenstehende Gegenstelle (endpoint URL) hinzuf\xFCgen, um die Umsatzinformationen zwischen dem Backend und dem Bankkonto zu synchronisieren."
      ],
      "Endpoint URL": [
        "Gegenstelle (endpoint URL)"
      ],
      "From where the merchant can download information about incoming wire transfers to this account": [
        "Informationsquelle zu eingehenden \xDCberweisungen auf dieses Bankkonto"
      ],
      "Auth type": [
        "Authentifizierungsmethode"
      ],
      "Choose the authentication type for the account info URL": [
        "W\xE4hlen Sie die Authentifizierungsmethode zum Zugriff auf das Bankkonto, um die eingegangenen \xDCberweisungen abzufragen"
      ],
      "Without authentication": [
        "Ohne Authentifizierung"
      ],
      "With username and password": [
        "Mit Benutzername und Passwort"
      ],
      "With token": [
        "Mit Zugangstoken"
      ],
      "Do not change": [
        "Lassen Sie dies unver\xE4ndert"
      ],
      "Username to access the account information.": [
        "Benutzername f\xFCr den Zugriff auf die Kontoinformationen."
      ],
      "Password to access the account information.": [
        "Passwort f\xFCr den Zugriff auf die Kontoinformationen."
      ],
      "Access token to access the account information.": [
        "Zugangstoken f\xFCr den Zugriff auf die Kontoinformationen."
      ],
      "Match": [
        "\xDCbereinstimmung"
      ],
      "Check where the information match against the server info.": [
        "Pr\xFCfung der \xDCbereinstimmung dieser Information und der Daten auf dem Server."
      ],
      "Compare info from server with account form": [
        "Vergleich der Information des Servers mit den Bankkonto-Formulardaten"
      ],
      "Test": [
        "Test"
      ],
      "Server didn't like the request we made.": [
        "Der Server war mit unserer Anfrage nicht einverstanden."
      ],
      "Account details": [
        "Kontodetails"
      ],
      "Check if the information matches the server info.": [
        "Bitte pr\xFCfen Sie, ob die Information und die Daten auf dem Server \xFCbereinstimmen."
      ],
      "The bank account has been deleted.": [
        "Die Verkn\xFCpfung mit dem Bankkonto wurde erfolgreich gel\xF6scht."
      ],
      "Bank accounts": [
        "Bankkonten"
      ],
      "Add new account": [
        "Neues Konto hinzuf\xFCgen"
      ],
      "Owner's name": [
        "Name des Kontoinhabers"
      ],
      "Delete selected accounts from the database": [
        "L\xF6schen ausgew\xE4hlter Konten von der Datenbank"
      ],
      "There are no accounts yet, add more pressing the + sign": [
        "Es sind noch keine Konten angelegt, Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "You must provide a bank account to receive payments.": [
        "Sie m\xFCssen ein Bankkonto verkn\xFCpfen, um Einnahmen an dieses Konto zu \xFCberweisen."
      ],
      "Without this information, you cannot create new payment orders that are transferred to a bank account.": [
        "Ohne diese Informationen k\xF6nnen Sie keine neuen Zahlungsabwicklungen erstellen, die an ein Bankkonto \xFCberwiesen werden."
      ],
      "Invalid. Please use only letters and numbers.": [
        "Ung\xFCltig. Bitte geben Sie nur Buchstaben und Zahlen ein."
      ],
      "Name": [
        "Name"
      ],
      "Category name": [
        "Kategoriename"
      ],
      "Category deleted": [
        "Die Kategorie wurde gel\xF6scht"
      ],
      "Add new devices": [
        "Neue Ger\xE4te hinzuf\xFCgen"
      ],
      "ID": [
        "ID"
      ],
      "Total products": [
        "Gesamte Artikelmenge"
      ],
      "Delete selected category from the database": [
        "Ausgew\xE4hlte Kategorie aus der Datenbank l\xF6schen"
      ],
      "There are no categories yet, add more pressing the + sign": [
        "Es gibt noch keine Kategorien. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Id:": [
        "ID:"
      ],
      "Name of the category": [
        "Benennung der Kategorie (Warengruppe)"
      ],
      "Products": [
        "Artikel"
      ],
      "Image": [
        "Bild"
      ],
      "Load more products after the last one": [
        "Weitere Artikel nach dem letzten laden"
      ],
      "There are no products in this category.": [
        "Es befinden sich keine Artikel in dieser Kategorie."
      ],
      "Account's KYC status": [
        "KYC-Status des Bankkontos"
      ],
      "Exchange": [
        "Zahlungsdienstleister"
      ],
      "Status": [
        "Status"
      ],
      "Ok": [
        "OK"
      ],
      "Action required": [
        "Sie m\xFCssen noch eine Aktion ausf\xFChren (eine \xDCberweisung oder eine KYC-Pr\xFCfung ist erforderlich)"
      ],
      "Warning": [
        "Warnung"
      ],
      "Error": [
        "Fehler"
      ],
      "Bank account verification required.": [
        "Eine Bankkonto-Verifizierung ist erforderlich."
      ],
      "More information required.": [
        "Weitere Informationen sind erforderlich."
      ],
      "Awaiting for account review.": [
        "Es wird auf die \xDCberpr\xFCfung des Kontos gewartet."
      ],
      "Ready": [
        "Bereit zum Einsatz"
      ],
      "Syncing...": [
        "Die Daten werden eingelesen..."
      ],
      "Payment service internal error. Contact administrator or check again later.": [
        "Interner Fehler des Zahlungsdiensts. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Payment service timeout. Contact administrator or check again later.": [
        "Zeit\xFCberschreitung der Antwort des Zahlungsdiensts. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Payment service unreachable. Contact administrator or check again later.": [
        "Der Zahlungsdienst ist nicht erreichbar. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Incompatible core banking system.": [
        "Inkompatibles Kernbankensystem."
      ],
      "Backend internal error. Contact administrator or check again later.": [
        "Interner Fehler im Backend. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Payment service response is invalid. Contact administrator or check again later.": [
        "Die Antwort des Zahlungsdiensts ist ung\xFCltig. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Http Status": [
        "HTTP-Status"
      ],
      "No pending kyc verification!": [
        "Eine KYC-Pr\xFCfung ist nicht (mehr) ausstehend!"
      ],
      "Wire account is invalid": [
        "Das zur \xDCberweisung gew\xE4hlte Bankkonto ist ung\xFCltig"
      ],
      'The backend service responded with "%1$s" which is invalid.': [
        'Das Backend hat mit "%1$s" geantwortet, was ung\xFCltig ist.'
      ],
      "No exchange keys": [
        "Es sind keine Schl\xFCssel des Exchange vorhanden"
      ],
      "The backend service is still synchronizing with the payment service provider.": [
        "Das Backend synchronisiert zurzeit noch mit dem Zahlungsdienst."
      ],
      "Can't wire from this account": [
        "Von diesem Bankkonto kann keine \xDCberweisung erfolgen"
      ],
      "The core banking system cannot perform wire transfers between the payment service provider's accounts and your bank accounts. Thus you cannot use this payment service provider. the exchange.": [
        "Das Kernbankensystem kann keine \xDCberweisungen zwischen dem Bankkonto des Zahlungsdiensts und Ihren Bankkonten durchf\xFChren. Daher k\xF6nnen Sie diesen Zahlungsdienst nicht nutzen. Der Taler Exchange."
      ],
      "KYC Required": [
        "Es ist eine KYC-Pr\xFCfung erforderlich"
      ],
      "The payment provider requires more information.": [
        "Der Zahlungsdienst verlangt mehr Informationen."
      ],
      "Click here to complete this step.": [
        "Klicken Sie hier, um diesen Schritt abzuschlie\xDFen."
      ],
      "We are waiting for the access token to be present. Check again later.": [
        "Bitte warten Sie auf die Erzeugung des Zugangstokens und pr\xFCfen diese zu einem sp\xE4teren Zeitpunkt erneut."
      ],
      "Awaiting AML review": [
        "Eine AML-\xDCberpr\xFCfung steht noch aus"
      ],
      "This account is can't be used. The payment service provider is doing manual review of the account information.": [
        "Dieses Konto kann nicht verwendet werden. Der Zahlungsdienst f\xFChrt eine manuelle \xDCberpr\xFCfung der Kontoinformationen durch."
      ],
      "This account is ready to be used with the payment service provider.": [
        "Dieses Konto ist bereit f\xFCr die Nutzung mit diesem Zahlungsdienst."
      ],
      "Logic bug": [
        "Logischer Fehler"
      ],
      "The backend service detected an internal error, contact the system administrator or check again later.": [
        "Das Backend hat einen internen Fehler festgestellt. Wenden Sie sich an den Systemadministrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Internal error": [
        "Interner Systemfehler"
      ],
      "The payment service provider detected an internal error, contact the system administrator or check again later.": [
        "Interner Fehler des Zahlungsdiensts. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "The backend service couldn't contact the payment service provider due to a timeout, contact the system administrator or check again later.": [
        "Das Backend konnte den Zahlungsdienst aufgrund einer Zeit\xFCberschreitung nicht kontaktieren. Wenden Sie sich an den Systemadministrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Unable to reach the payment service provider, contact the system administrator or check again later.": [
        "Der Zahlungsdienst ist zurzeit nicht erreichbar. Wenden Sie sich an den Administrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "The payment service provider replied with a invalid status, contact the system administrator or check again later.": [
        "Der Zahlungsdienst hat mit einem ung\xFCltigen Status geantwortet. Wenden Sie sich an den Systemadministrator oder pr\xFCfen Sie sp\xE4ter erneut."
      ],
      "Change value to unknown date": [
        "Wert auf unbekanntes Datum \xE4ndern"
      ],
      "Enter description or id": [
        "Geben Sie die Beschreibung oder eine ID ein"
      ],
      "No match found for that description or ID.": [
        "F\xFCr diese Beschreibung oder ID wurde keine \xDCbereinstimmung gefunden."
      ],
      "You must enter a valid product identifier.": [
        "Sie m\xFCssen eine g\xFCltige Artikelkennung eingeben."
      ],
      "Quantity must be greater than 0!": [
        "Die Menge muss gr\xF6\xDFer als 0 sein!"
      ],
      "This quantity exceeds remaining stock. Currently, only %1$s units remain unreserved in stock.": [
        "Diese Menge \xFCberschreitet den Bestand. Momentan sind nur %1$s St\xFCck im Inventar ohne Vorbestellung."
      ],
      "Search product": [
        "Artikel suchen"
      ],
      "Quantity": [
        "Menge"
      ],
      "How many products will be added": [
        "Wie viele Artikel hinzugef\xFCgt werden"
      ],
      "Add from inventory": [
        "Vom Bestand hinzuf\xFCgen"
      ],
      "This product has %1$s applicable taxes configured.": [
        "F\xFCr diesen Artikel ist ein Steuersatz von %1$s angelegt."
      ],
      "No taxes configured for this product.": [
        "F\xFCr diesen Artikel sind keine Steuern angelegt."
      ],
      "Amount": [
        "Betrag"
      ],
      "Taxes can be in currencies that differ from the main currency used by the merchant.": [
        "Steuern k\xF6nnen in einer anderen W\xE4hrung sein als die Hauptw\xE4hrung, welche f\xFCr Verk\xE4ufe normalerweise verwendet wird."
      ],
      "Enter the currency and value separated by a colon (e.g., &quot;USD:2.3&quot;).": [
        "Geben Sie W\xE4hrung und Betrag mit einem Doppelpunkt getrennt ein, z.B. &quot;CH:2.3&quot; oder &quot;EUR:2,3&quot;."
      ],
      "Legal name of the tax, e.g. VAT or import duties.": [
        "Offizielle Bezeichnung der Steuer, z.B. Mehrwertsteuer oder Einfuhrsteuer."
      ],
      "Add tax to the tax list": [
        "Steuersatz zur Liste der Steuern hinzuf\xFCgen"
      ],
      "Describe and add a product that is not in the inventory list": [
        "Bisher nicht inventarisierte Artikel beschreiben und hinzuf\xFCgen"
      ],
      "Add custom product": [
        "Individuellen Artikel hinzuf\xFCgen"
      ],
      "Complete information of the product": [
        "Informationen zum Artikel vervollst\xE4ndigen"
      ],
      "Must be a number.": [
        "Dieser Wert muss eine Nummer sein."
      ],
      "Must be greater than 0.": [
        "Dieser Wert muss gr\xF6\xDFer als Null sein."
      ],
      "Photo of the product.": [
        "Abbildung des Artikels."
      ],
      "Full product description.": [
        "Vollst\xE4ndige Artikelbeschreibung."
      ],
      "Unit name": [
        "Art der Mengeneinheit"
      ],
      "Name of the product unit.": [
        "Bezeichnung der Einheit des Artikels."
      ],
      "Price per unit": [
        "Preis pro Mengeneinheit"
      ],
      "Amount in the current currency.": [
        "Betrag in der aktuellen W\xE4hrung."
      ],
      "How many products will be added.": [
        "Wie viele Artikel hinzugef\xFCgt werden."
      ],
      "Taxes": [
        "Steuern"
      ],
      "Total price": [
        "Gesamtpreis"
      ],
      "Must be greater than 0": [
        "Dieser Wert muss gr\xF6\xDFer als Null sein"
      ],
      "Must have a refund deadline": [
        "Es sollte eine R\xFCckerstattungsfrist geben"
      ],
      "Auto refund can't be after refund deadline": [
        "Eine automatische R\xFCckerstattung kann nicht nach der R\xFCckerstattungsfrist erfolgen"
      ],
      "Must be in the future": [
        "Dieser Wert sollte in der Zukunft liegen"
      ],
      "Either fulfillment url or fulfillment message must be specified.": [
        "Es m\xFCssen entweder fulfillment-URL oder fulfillment message angegeben werden."
      ],
      "is not a valid URL": [
        "ist keine g\xFCltige URL"
      ],
      'Product with ID "%1$s" is out of stock.': [
        'Der Artikel mit der ID "%1$s" ist nicht auf Lager.'
      ],
      "No exchange would accept a payment because of KYC requirements.": [
        "Aufgrund vorgegebener KYC-Erfordernisse w\xFCrde kein Zahlungsdienstleister eine Zahlung annehmen."
      ],
      "Manage products in order": [
        "Artikel in der Bestellung verwalten"
      ],
      "%1$s products with a total price of %2$s.": [
        "%1$s Artikel zu einer Gesamtsumme von %2$s."
      ],
      "Manage list of products in the order.": [
        "Liste der Artikel in der Bestellung verwalten."
      ],
      "Remove this product from the order.": [
        "Diesen Artikel aus der Bestellung entfernen."
      ],
      "Products price sum": [
        "Summe der Preise der Artikel"
      ],
      "Total product price added up": [
        "Gesamtpreis des Artikels hinzugerechnet"
      ],
      "Order price": [
        "Preis eines Artikels"
      ],
      "Amount to be paid by the customer": [
        "Vom Kunden zu zahlender Betrag"
      ],
      "Final order price": [
        "Endg\xFCltiger Bestellwert"
      ],
      "Summary": [
        "Zusammenfassung"
      ],
      "Title of the order to be shown to the customer": [
        "Bezeichnung der Bestellung, die den Kunden angezeigt wird"
      ],
      "Shipping and fulfillment": [
        "Versand und Lieferung"
      ],
      "Delivery date": [
        "Lieferdatum"
      ],
      "Deadline for physical delivery assured by the merchant.": [
        "Vom H\xE4ndler zugesicherte Zustellfrist."
      ],
      "Delivery location": [
        "Lieferadresse"
      ],
      "Address where the products will be delivered": [
        "Zustelladresse der Artikel"
      ],
      "Fulfillment URL": [
        "Adresse digitaler Dienstleistung (Fulfillment-URL)"
      ],
      "URL to which the user will be redirected after successful payment.": [
        "URL der von Kunden zu besuchenden Adresse nach erfolgter Bezahlung."
      ],
      "Fulfillment message": [
        "Fulfillment message (Nachricht an Zahlende \xFCber bereitgestelltes digitales Gut)"
      ],
      "Message shown to the customer after paying for the order.": [
        "Die Nachricht, die den Kunden nach der Bezahlung der Bestellung angezeigt wird."
      ],
      "Taler payment options": [
        "Taler-Zahlungsoptionen"
      ],
      "Override default Taler payment settings for this order": [
        "\xDCberschreibe die vorgegebenen Zahlungseinstellungen im Taler-System f\xFCr diese Bestellung"
      ],
      "Payment time": [
        "Zahlungsdatum"
      ],
      "Time for the customer to pay before the offer expires. Inventory products will be reserved until this deadline. The time starts after the order is created.": [
        "Zeitraum, im dem die K\xE4ufer bezahlen m\xFCssen, bevor das Vertragsangebot verf\xE4llt. Inventarisierte Artikel f\xFCr ein aktuelles Angebot werden bis zum Ablauf dieses Zeitraums reserviert. Der Zeitablauf beginnt mit der Erstellzeit der Bestellung."
      ],
      "Default": [
        "Standardeinstellung"
      ],
      "Refund time": [
        "R\xFCckerstattungsdatum"
      ],
      "Time while the order can be refunded by the merchant. Time starts after the order is created.": [
        "Zeitdauer, in der die Bestellung vom Verk\xE4ufer erstattet werden kann. Die Zeitdauer beginnt mit der Erstellzeit der Bestellungen."
      ],
      "Wire transfer time": [
        "Zeitpunkt der \xDCberweisung"
      ],
      "Time for the exchange to make the wire transfer. Time starts after the order is created.": [
        "Zeitraum, nach dessen Ablauf der Zahlungsdienst \xDCberweisungen ausf\xFChrt. Die Zeitdauer beginnt mit der Erstellzeit der Bestellung."
      ],
      "Auto-refund time": [
        "Zeitdauer f\xFCr automatische R\xFCckerstattungen"
      ],
      "Time until which the wallet will automatically check for refunds without user interaction.": [
        "Zeit, bis zu der das Wallet automatisch und ohne Benutzerinteraktion auf R\xFCckerstattungen pr\xFCft."
      ],
      "Maximum fee": [
        "Maximale Geb\xFChrenh\xF6he"
      ],
      "Maximum fees the merchant is willing to cover for this order. Higher deposit fees must be covered in full by the consumer.": [
        "Die maximale Geb\xFChrenh\xF6he, die ein Verk\xE4ufer f\xFCr eine Bestellung zu \xFCbernehmen bereit ist. Einl\xF6segeb\xFChren, die \xFCber dieser liegen, sind komplett von den K\xE4ufern zu \xFCbernehmen."
      ],
      "Create token": [
        "Token erzeugen"
      ],
      "If the order ID is easy to guess, the token will prevent other users from claiming the order.": [
        "Selbst wenn die ID einer Bestellung leicht zu erraten w\xE4re, verhindert der Token, dass die Bestellung von Unberechtigten \xFCbernommen werden k\xF6nnte."
      ],
      "Minimum age required": [
        "Mindestalter erforderlich"
      ],
      "Any value greater than 0 will limit the coins able be used to pay this contract. If empty the age restriction will be defined by the products": [
        "Eine Zahl gr\xF6\xDFer als 0 schr\xE4nkt ein, welches e-Geld zur Bezahlung dieses Kaufvertrags verwendet werden kann. Bleibt das Feld leer, werden Altersbeschr\xE4nkungen durch die Artikel selbst festgelegt"
      ],
      "Minimum age defined by the products is %1$s": [
        "Das Mindestalter f\xFCr den Erwerb dieses Artikels ist %1$s"
      ],
      "No product with age restriction in this order": [
        "Es befindet sich kein Artikel mit einer Altersbeschr\xE4nkung in dieser Bestellung"
      ],
      "Additional information": [
        "Zus\xE4tzliche Informationen"
      ],
      "Custom information to be included in the contract for this order.": [
        "Individuelle Informationen, die in den Kaufvertrag f\xFCr diese Bestellung aufgenommen werden sollen."
      ],
      "You must enter a value in JavaScript Object Notation (JSON).": [
        "Sie m\xFCssen einen Wert im Format JavaScript Object Notation (JSON) eingeben."
      ],
      "remove": [
        "Entfernen"
      ],
      "Custom field name": [
        "Benutzerdefinierter Feldname"
      ],
      "Disabled": [
        "Deaktiviert"
      ],
      "No deadline": [
        "Keine Zahlungsfrist"
      ],
      "Deadline at %1$s": [
        "Frist bis %1$s"
      ],
      "Select date to show nearby orders": [
        "Bitte w\xE4hlen Sie ein Datum, um die Bestellungen dieses Zeitraums anzuzeigen"
      ],
      "Only show unpaid orders": [
        "Nur unbezahlte Bestellungen anzeigen"
      ],
      "Only show paid orders": [
        "Nur bezahlte Bestellungen anzeigen"
      ],
      "Paid": [
        "Bezahlt"
      ],
      "Only show orders with refunds": [
        "Nur Bestellungen mit erfolgter R\xFCckerstattung anzeigen"
      ],
      "Refunded": [
        "R\xFCckerstattet"
      ],
      "Show only paid orders for which the wire transfer is still pending.": [
        "Nur bezahlte Bestellungen anzeigen, f\xFCr welche die \xDCberweisung noch aussteht."
      ],
      "Not wired": [
        "Nicht \xFCberwiesen"
      ],
      "Only display orders that have already been transferred by the payment service provider": [
        "Nur Bestellungen anzeigen, die vom Zahlungsdienst bereits an das H\xE4ndlerbankkonto \xFCberwiesen wurden"
      ],
      "Completed": [
        "\xDCberwiesen"
      ],
      "Remove all filters": [
        "Alle Filter aufheben"
      ],
      "Clear date filter": [
        "Datumsfilter aufheben"
      ],
      "Jump to date (%1$s)": [
        "Springe zum Datum (%1$s)"
      ],
      "Gone.": [
        "Nicht mehr vorhanden."
      ],
      "UnavailableForLegalReasons.": [
        "Aus rechtlichen Gr\xFCnden nicht verf\xFCgbar."
      ],
      "Jump to order with the given product ID": [
        "Zur Bestellung mit angegebener Artikel-ID gehen"
      ],
      "Order id": [
        "Bestellnummer"
      ],
      "Instance unknown": [
        "Unbekannte Instanz"
      ],
      "Order unknown": [
        "Unbekannte Bestellung"
      ],
      "Create order": [
        "Bestellung erzeugen"
      ],
      "The instance doesn't exist": [
        "Die Instanz existiert nicht"
      ],
      "The order doesn't exist": [
        "Die Bestellung existiert nicht"
      ],
      "Date": [
        "Datum"
      ],
      "Refund": [
        "R\xFCckerstattung"
      ],
      "copy url": [
        "URL kopieren"
      ],
      "Load more orders after the last one": [
        "Nach der letzten Bestellung weitere laden"
      ],
      "No orders have been found matching your query!": [
        "Es wurden keine Bestellungen gefunden, die zu Ihrer Abfrage passen!"
      ],
      "Duplicated": [
        "Dupliziert"
      ],
      "This value exceeds the refundable amount.": [
        "Dieser Wert \xFCbersteigt den erstattungsf\xE4higen Betrag."
      ],
      "Forbidden": [
        "Verboten"
      ],
      "Gone": [
        "Nicht mehr vorhanden"
      ],
      "There are pending KYC requirements.": [
        "Es sind noch KYC-Erfordernisse zu erf\xFCllen (Pr\xFCfung der wirtschaftlich Berechtigten)."
      ],
      "refund": [
        "R\xFCckerstattung"
      ],
      "Reason": [
        "Buchungsvermerk"
      ],
      "Amount to be refunded": [
        "Zu erstattender Betrag"
      ],
      "Max refundable:": [
        "Maximale R\xFCckerstattung:"
      ],
      "Choose one...": [
        "Bitte w\xE4hlen Sie eine Option aus..."
      ],
      "Requested by the customer": [
        "Vom K\xE4ufer angefordert"
      ],
      "Other": [
        "Sonstiges"
      ],
      "Why this order is being refunded": [
        "Grund f\xFCr die Erstattung dieser Bestellung"
      ],
      "More information to give context": [
        "Weitere Informationen f\xFCr eine genauere Beschreibung"
      ],
      "now": [
        "jetzt"
      ],
      "This is when the time for making refund has been expired.": [
        "Zu diesem Zeitpunkt ist die R\xFCckerstattungsfrist abgelaufen."
      ],
      "This is when the time for making the payment has been expired.": [
        "Zu diesem Zeitpunkt ist die Zahlungsfrist abgelaufen."
      ],
      "This is when the wire transfer is going to be executed by the payment service provider.": [
        "Zu diesem Zeitpunkt ist der Aufschub f\xFCr die \xDCberweisung durch den Zahlungsdienst abgelaufen."
      ],
      "This wire transfer has been notified by the payment service provider.": [
        "Diese \xDCberweisung wurde vom Zahlungsdienst gemeldet."
      ],
      "This refund is waiting to be claimed by the customer.": [
        "Diese R\xFCckerstattung kann vom K\xE4ufer beantragt werden."
      ],
      "This refund has been claimed by the customer.": [
        "Diese R\xFCckerstattung wurde vom K\xE4ufer verlangt."
      ],
      "The current moment in time.": [
        "Der jetzige Zeitpunkt."
      ],
      "This refund can't be claimed because the wire transfer has already be made.": [
        "Diese R\xFCckerstattung kann nicht mehr beantragt werden, da die Zahlung des K\xE4ufers bereits \xFCberwiesen wurde."
      ],
      "Contract terms": [
        "Vertragsbedingungen"
      ],
      "Human-readable description of the whole purchase": [
        "F\xFCr Menschen lesbare Information \xFCber den gesamten Kaufvorgang"
      ],
      "Total price for the transaction": [
        "Gesamtpreis der Transaktion"
      ],
      "URL for this purchase": [
        "URL f\xFCr diesen Kauf"
      ],
      "Max fee": [
        "H\xF6chster Geb\xFChrenbetrag"
      ],
      "Maximum total deposit fee accepted by the merchant for this contract": [
        "Maximale Einl\xF6sege\xFChr, die ein Verk\xE4ufer f\xFCr diesen Kaufvertrag selbst tragen will"
      ],
      "Time when this contract was generated": [
        "Zeitpunkt, zu dem der Kaufvertrag erstellt wurde"
      ],
      "Refund deadline": [
        "R\xFCckerstattungsfrist"
      ],
      "After this deadline has passed, no refunds will be accepted.": [
        "Nach Ablauf dieser Frist werden keine R\xFCckerstattungen mehr akzeptiert."
      ],
      "Payment deadline": [
        "Zahlungsfrist"
      ],
      "After this deadline, the merchant won't accept payments for the contract": [
        "Nach Ablauf dieser Frist akzeptiert ein Verk\xE4ufer f\xFCr den Vertrag keinen Rechnungsausgleich (Bezahlung durch K\xE4ufer)"
      ],
      "Wire transfer deadline": [
        "\xDCberweisungsfrist"
      ],
      "Transfer deadline for the exchange": [
        "Frist der \xDCberweisung vom Zahlungsdienstleister an das Bankkonto"
      ],
      "Time indicating when the order should be delivered": [
        "Zeitangabe, wann die Bestellung geliefert werden soll"
      ],
      "Where the order will be delivered": [
        "Zustelladresse der Bestellung"
      ],
      "Auto-refund delay": [
        "Zeitliche Verz\xF6gerung der automatischen R\xFCckerstattung"
      ],
      "How long the wallet should try to get an automatic refund for the purchase": [
        "So lange sollte ein Wallet versuchen, eine automatische R\xFCckerstattung auf den Kaufvertrag zu erhalten"
      ],
      "Extra info": [
        "Weitere Informationen"
      ],
      "Extra data that is only interpreted by the merchant frontend": [
        "Zus\xE4tzliche Daten, die nur im Verk\xE4ufer-Frontend verarbeitet werden"
      ],
      "order created": [
        "Die Bestellung wurde angelegt"
      ],
      "pay deadline": [
        "Zahlungsfrist"
      ],
      "refund deadline": [
        "R\xFCckerstattungsfrist"
      ],
      "delivery": [
        "Lieferung"
      ],
      "Order": [
        "Bestellung"
      ],
      "Claimed": [
        "Schon f\xFCr jemanden reserviert"
      ],
      "Claimed at": [
        "Reserviert f\xFCr"
      ],
      "Timeline": [
        "Zeitleiste"
      ],
      "Payment details": [
        "Zahlungsdetails"
      ],
      "Order status": [
        "Bestellstatus"
      ],
      "Unpaid": [
        "Noch nicht bezahlt"
      ],
      "Product list": [
        "Artikelliste"
      ],
      "refund missed: %1$s": [
        "Nicht verlangte R\xFCckerstattung: %1$s"
      ],
      "refund missed: %1$s: %2$s": [
        "Nicht verlangte R\xFCckerstattung: %1$s: %2$s"
      ],
      "refund created: %1$s": [
        "R\xFCckerstattung gew\xE4hrt: %1$s"
      ],
      "refund created: %1$s: %2$s": [
        "R\xFCckerstattung gew\xE4hrt: %1$s: %2$s"
      ],
      "refund taken: %1$s": [
        "Dem K\xE4ufer zugegangene R\xFCckerstattung: %1$s"
      ],
      "refund taken: %1$s: %2$s": [
        "Dem K\xE4ufer zugegangene R\xFCckerstattung: %1$s: %2$s"
      ],
      "The contract terms has a v1 order without choices_index.": [
        "Die Vertragsbedingungen haben eine Bestellung der Version v1 (ohne choices_index)."
      ],
      "The contract terms has a v1 order with a bad choices_index.": [
        "Die Vertragsbedingungen haben eine Bestellung der Version v1 (mit einem schlechten choices_index)."
      ],
      "wired %1$s": [
        "\xFCberwiesen %1$s"
      ],
      "wire deadline": [
        "\xDCberweisungszeitpunkt"
      ],
      "Wired": [
        "\xDCberwiesen"
      ],
      "Refund order": [
        "Zahlbetrag der Bestellung zur\xFCckerstatten"
      ],
      "Not refundable": [
        "Nicht erstattungsf\xE4hig"
      ],
      "Next event in": [
        "N\xE4chster Event in"
      ],
      "The order was wired.": [
        "Die Zahlung wurde \xFCberwiesen."
      ],
      "Bank processing can take a few business days, depending on your bank.": [
        "Die Verarbeitung der \xDCberweisung kann je nach Finanzinstitut einige Bankarbeitstage dauern."
      ],
      "Refunded amount": [
        "R\xFCckerstattungsbetrag"
      ],
      "Refund taken": [
        "Erhaltener R\xFCckerstattungsbetrag"
      ],
      "Status URL": [
        "Status-URL"
      ],
      "Refund URI": [
        "R\xFCckerstattungs-URI"
      ],
      "Pay at": [
        "Zahlungs-URL"
      ],
      "Order status URL": [
        "Bestellstatus-URL"
      ],
      "Payment URI": [
        "Zahlungs-URI"
      ],
      "Unknown order status. This is an error, please contact the administrator.": [
        "Unbekannter Bestellstatus. Dies ist ein Fehler, bitte kontaktieren Sie den Administrator."
      ],
      "Invalid. Please enter letters and numbers only.": [
        "Ung\xFCltig. Bitte geben Sie nur Buchstaben und Zahlen ein."
      ],
      "Just letters and numbers from 2 to 7": [
        "Nur Buchstaben und Zahlen von 2 bis 7"
      ],
      "The size of the key must be 32 characters": [
        "Die Schl\xFCssell\xE4nge muss 32 Zeichen betragen"
      ],
      "Internal ID on the system": [
        "Interne ID auf dem System"
      ],
      "Useful to identify the device physically": [
        "Dies ist n\xFCtzlich, um das Ger\xE4t physisch zu identifizieren"
      ],
      "Verification algorithm": [
        "\xDCberpr\xFCfungsalgorithmus"
      ],
      "Algorithm used to verify transactions in offline mode": [
        "Algorithmus zum \xDCberpr\xFCfen von Transaktionen im Offline-Modus"
      ],
      "Device key": [
        "Ger\xE4teschl\xFCssel (Device key)"
      ],
      "Be sure to choose a password that is hard to guess, or use the random generator.": [
        "Das Passwort muss schwer zu erraten sein - andernfalls verwenden Sie den Zufallszahlengenerator."
      ],
      "Your device needs to match exactly the same value": [
        "Ihr Ger\xE4t muss genau das gleiche Ergebnis anzeigen"
      ],
      "Generate random secret key": [
        "Zuf\xE4lligen privaten Schl\xFCssel erzeugen"
      ],
      "Random": [
        "Zufallsbasiert"
      ],
      "Create another": [
        "Weitere erzeugen"
      ],
      "You can scan the next QR code with your device or save the key before continuing.": [
        "Sie k\xF6nnen den n\xE4chsten QR-Code mit Ihrem Ger\xE4t scannen oder den Schl\xFCssel speichern, bevor Sie fortfahren."
      ],
      "OTP devices": [
        "OTP-Ger\xE4te"
      ],
      "Delete selected devices from the database": [
        "Ausgew\xE4hlte Ger\xE4te aus der Datenbank entfernen"
      ],
      "There are no devices to list yet, add more by pressing the + sign": [
        "Es gibt noch keine Ger\xE4te. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Template id is unknown": [
        "Die Vorlagen-ID ist unbekannt"
      ],
      "The provided information is inconsistent with the current state of the template": [
        "Die bereitgestellten Informationen stimmen nicht mit dem aktuellen Stand der Vorlage \xFCberein"
      ],
      "Device:": [
        "Ger\xE4t:"
      ],
      "Algorithm to use to verify transactions in offline mode": [
        "Algorithmus zum \xDCberpr\xFCfen von Transaktionen im Offline-Modus"
      ],
      "Not modified": [
        "Unver\xE4ndert"
      ],
      "Be sure to be very hard to guess or use the random generator": [
        "Das Passwort muss schwer zu erraten sein oder aus einem Zufallszahlengenerator stammen"
      ],
      "Your device need to have exactly the same value": [
        "Ihr Ger\xE4t muss genau das gleiche Ergebnis anzeigen"
      ],
      "Change key": [
        "Schl\xFCssel \xE4ndern"
      ],
      "Is not the same": [
        "ungleich"
      ],
      'You are updating the password for the instance with ID "%1$s"': [
        'Sie erneuern nun das Passwort f\xFCr die Instanz mit der ID "%1$s"'
      ],
      "In order to verify that you have access.": [
        "Um zu \xFCberpr\xFCfen, ob der Zugang gew\xE4hrt wird."
      ],
      "Confirm change": [
        "\xC4nderung best\xE4tigen"
      ],
      "Testing password change": [
        "Die Passwort\xE4nderung wird \xFCberpr\xFCft"
      ],
      "Password changed": [
        "Passwort ge\xE4ndert"
      ],
      "The current password is wrong.": [
        "Das aktuelle Passwort ist falsch."
      ],
      "No enough rights to change the password.": [
        "Es bestehen keine ausreichenden Rechte, um das Passwort zu \xE4ndern."
      ],
      "Account not found.": [
        "Das Bankkonto wurde nicht gefunden."
      ],
      "Add element to the list": [
        "Ein Element zur Liste hinzuf\xFCgen"
      ],
      "Click here to configure the product's stock. If left as is, the backend will not control stock.": [
        "Klicken Sie hier, um den Lagerbestand des Artikels zu konfigurieren. Falls dieses Programm den Bestand nicht \xFCberwachen soll, lassen Sie seine Grundeinstellung unver\xE4ndert."
      ],
      "Manage stock": [
        "Bestand verwalten"
      ],
      "This product has been configured without stock control": [
        "Dieser Artikel wurde ohne Bestandskontrolle angelegt"
      ],
      "Infinite": [
        "Unbegrenzt"
      ],
      "Shrinkage cannot exceed the current stock and incoming supplies (maximum %1$s)": [
        "Der Schwund kann nicht den aktuellen Bestand und die Menge der Zulieferung \xFCbersteigen (maximal %1$s)"
      ],
      "Incoming": [
        "Erwartete \xDCberweisungen"
      ],
      "Lost": [
        "Schwund (Inventurdifferenz)"
      ],
      "Current": [
        "Aktuell"
      ],
      "Remove stock control for this product": [
        "Bestandskontrolle f\xFCr diesen Artikel entfernen"
      ],
      "without stock": [
        "ohne Bestand"
      ],
      "Next restock": [
        "N\xE4chstes Auff\xFCllen des Bestands"
      ],
      "Warehouse address": [
        "Adresse des Lagers"
      ],
      "Invalid amount": [
        "Kein g\xFCltiger Betrag"
      ],
      "Product identification to use in URLs (for internal use only).": [
        "Identifikation zur Nutzung in URLs (nur f\xFCr den internen Gebrauch)."
      ],
      "Illustration of the product for customers.": [
        "Abbildung des Artikels f\xFCr Kunden."
      ],
      "Product name.": [
        "Artikelbezeichnung."
      ],
      "Product description for customers.": [
        "Artikelbeschreibung, die Kunden zu sehen bekommen."
      ],
      "Age restriction": [
        "Altersbeschr\xE4nkung"
      ],
      "Is this product restricted for customer below certain age?": [
        "Besteht f\xFCr diesen Artikel eine Verkaufsbeschr\xE4nkung unterhalb eines bestimmten Alters?"
      ],
      "Minimum age of the customer": [
        "Mindestalter von K\xE4ufern"
      ],
      "Unit describing quantity of product sold (e.g. 2 kilograms, 5 liters, 3 items, 5 meters) for customers.": [
        "Die den K\xE4ufern angezeigte Mengeneinheit des Artikels im Verkauf (z.B. 2 Kilogramm, 5 Liter, 3 St\xFCck, 5 Meter)."
      ],
      "Example: kg, items or liters": [
        "Beispiel: kg, St\xFCck oder Liter"
      ],
      "Sale price for customers, including taxes, for above units of the product.": [
        "Verkaufspreis an Endkunden, inklusive Steuern, f\xFCr jede oben genannte Mengeneinheit des Artikels."
      ],
      "Stock": [
        "Bestand"
      ],
      "Inventory for products with finite supply (for internal use only).": [
        "Lagerbestand f\xFCr Artikel mit begrenztem Vorrat (nur f\xFCr den internen Gebrauch)."
      ],
      "Taxes included in the product price, exposed to customers.": [
        "Im Artikelpreis enthaltene Steuern, die den K\xE4ufern angezeigt werden."
      ],
      "Search by category description or id": [
        "Nach Kategoriebeschreibung oder -ID suchen"
      ],
      "Categories where this product will be listed on.": [
        "Kategorien, in denen dieser Artikel aufgef\xFChrt sein wird."
      ],
      "Add product to inventory": [
        "Artikel zum Lagerbestand hinzuf\xFCgen"
      ],
      "Product not found.": [
        "Der Artikel wurde nicht gefunden."
      ],
      "This change was made without outdated info.": [
        "Diese \xC4nderung wurde ohne bisher bekannte Daten durchgef\xFChrt."
      ],
      "Sales": [
        "Sales"
      ],
      "Sold": [
        "Verkauft"
      ],
      "Free": [
        "Kostenlos"
      ],
      "Go to product update page": [
        "Zur Seite der Artikelaktualisierung gehen"
      ],
      "Update": [
        "Aktualisieren"
      ],
      "Remove this product from the database": [
        "Diesen Artikel aus der Datenbank entfernen"
      ],
      "Update the product with new price": [
        "Artikel mit neuem Preis aktualisieren"
      ],
      "Update product with new price": [
        "Artikel mit neuem Verkaufspreis aktualisieren"
      ],
      "Confirm update": [
        "Aktualisierung best\xE4tigen"
      ],
      "lost can't be greater that current + incoming (max %1$s)": [
        "Der Schwund kann nicht gr\xF6\xDFer sein als der aktuelle Bestand und die Menge der Zulieferung (max %1$s)"
      ],
      "Add more elements to the inventory": [
        "Mehr Elemente zum Lagerbestand hinzuf\xFCgen"
      ],
      "Report elements lost in the inventory": [
        "Aus dem Lagerbestand verlorene Elemente melden"
      ],
      "New price for the product": [
        "Neuer Preis f\xFCr den Artikel"
      ],
      "There are values with errors.": [
        "Einige Werte sind fehlerhaft."
      ],
      "Update product with new stock and price": [
        "Artikel mit neuem Bestand und Preis aktualisieren"
      ],
      "There are no products to list yet, add more by pressing the + sign": [
        "Es gibt noch keine Artikel. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Product (ID: %1$s) has been deleted": [
        "Der Artikel (ID: %1$s) wurde gel\xF6scht"
      ],
      "Jump to product with the given product ID": [
        "Zum Artikel mit der angegebenen Artikel-ID springen"
      ],
      "Product id": [
        "Artikel-ID"
      ],
      "Delete product": [
        "Artikel l\xF6schen"
      ],
      'Delete the product "%1$s"': [
        'Artikel "%1$s" l\xF6schen'
      ],
      "If you delete the product named %1$s (ID: %2$s ), the stock and related information will be lost": [
        "Wenn Sie den Artikel mit der Bezeichnung %1$s (ID: %2$s) l\xF6schen, gehen seine Bestandsdaten und alle zugeh\xF6rigen Informationen verloren"
      ],
      "Deleting a product cannot be undone.": [
        "Das L\xF6schen eines Artikels kann nicht r\xFCckg\xE4ngig gemacht werden."
      ],
      "Product id:": [
        "Artikel-ID:"
      ],
      "Must be greater that 0": [
        "Dieser Wert muss gr\xF6\xDFer als Null sein"
      ],
      "Too short": [
        "Zu kurz"
      ],
      "You don't have enough permissions.": [
        "Sie haben keine ausreichende Berechtigung."
      ],
      "There is a template with this identifier, please choose another one.": [
        "Es gibt bereits eine Vorlage mit dieser Kennung, bitte w\xE4hlen Sie eine andere."
      ],
      "Identifier": [
        "Eindeutige Kennung"
      ],
      "Name of the template in URLs.": [
        "Name der Vorlage in URLs."
      ],
      "Template name": [
        "Name der Vorlage"
      ],
      "Describe what this template stands for": [
        "Beschreiben Sie, wof\xFCr diese Vorlage stehen soll"
      ],
      "Order summary": [
        "Zusammenfassung der Bestellung"
      ],
      "If specified here, this template will create orders with the same summary": [
        "Falls angegeben, wird diese Vorlage Bestellungen mit der gleichen Zusammenfassung erzeugen"
      ],
      "Summary is editable": [
        "Die Zusammenfassung kann umgeschrieben werden"
      ],
      "Allow the user to change the summary.": [
        "Den Nutzern die Bearbeitung der Zusammenfassung erlauben."
      ],
      "If specified here, this template will create orders with the same price": [
        "Diese Vorlage wird Bestellungen zum stets gleichen Preis erzeugen"
      ],
      "Amount is editable": [
        "Der Betrag l\xE4sst sich ver\xE4ndern"
      ],
      "Allow the user to select the amount to pay.": [
        "Den Nutzern die Auswahl des Zahlbetrags erlauben."
      ],
      "Currency is editable": [
        "Die W\xE4hrung ist ver\xE4nderbar"
      ],
      "Allow the user to change currency.": [
        "Den Nutzern die \xC4nderung der W\xE4hrung erlauben."
      ],
      "Supported currencies": [
        "Unterst\xFCtzte W\xE4hrungen"
      ],
      "Supported currencies: %1$s": [
        "Unterst\xFCtzte W\xE4hrungen: %1$s"
      ],
      "Minimum age": [
        "Mindestalter"
      ],
      "Is this contract restricted to some age?": [
        "Verlangt dieser Kaufvertrag ein bestimmtes Mindestalter?"
      ],
      "Payment timeout": [
        "Die Zahlungsfrist ist verstrichen nach"
      ],
      "How much time the customer has to complete the payment once the order was created.": [
        "Wie lange der K\xE4ufer Zeit hat, um zu bezahlen, nachdem die Bestellung angelegt wurde."
      ],
      "OTP device": [
        "OTP-Ger\xE4t"
      ],
      "Use to verify transactions in offline mode.": [
        "Verwenden zum \xDCberpr\xFCfen von Transaktionen im Offline-Modus."
      ],
      "No OTP device.": [
        "Kein OTP-Ger\xE4t."
      ],
      "Add one first": [
        "F\xFCgen Sie zuerst ein erstes hinzu"
      ],
      "No device": [
        "Kein Ger\xE4t"
      ],
      "Add new templates": [
        "Neue Vorlagen hinzuf\xFCgen"
      ],
      "Load more templates before the first one": [
        "Mehrere Vorlagen vor der ersten laden"
      ],
      "Delete selected templates from the database": [
        "Ausgew\xE4hlte Vorlagen aus der Datenbank l\xF6schen"
      ],
      "Use template to create new order": [
        "Vorlage verwenden, um eine neue Bestellung anzulegen"
      ],
      "Generate a QR code for the template.": [
        "QR-Code f\xFCr die Vorlage erstellen."
      ],
      "Show QR": [
        "QR-Code anzeigen"
      ],
      "Load more templates after the last one": [
        "Weitere Vorlagen nach der letzten laden"
      ],
      "There are no templates to list yet, add more by pressing the + sign": [
        "Es gibt noch keine Vorlagen. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Jump to template with the given template ID": [
        "Zur Vorlage mit der angegebenen Vorlagen-ID springen"
      ],
      "Template identification": [
        "Vorlagenidentifikation"
      ],
      "Delete template": [
        "Vorlage l\xF6schen"
      ],
      'Delete the template "%1$s"': [
        'Vorlage "%1$s" l\xF6schen'
      ],
      "If you delete the template %1$s (ID: %2$s) you may loose information": [
        "Wenn Sie die Vorlage %1$s (ID: %2$s) l\xF6schen, k\xF6nnen Information verlorengehen"
      ],
      "Deleting a template cannot be undone.": [
        "Das L\xF6schen einer Vorlage kann nicht r\xFCckg\xE4ngig gemacht werden."
      ],
      "Print": [
        "Drucken"
      ],
      "The template configuration needs to be fixed.": [
        "Die Detaileinstellung der Vorlage muss korrigiert werden."
      ],
      "The currency of the template is %1$s and is not in the list of supported currencies.": [
        "Die W\xE4hrung der Vorlage lautet %1$s, steht aber nicht in der Liste der unterst\xFCtzten W\xE4hrungen."
      ],
      "If specified, this template will create order with the same summary": [
        "Falls angegeben, wird diese Vorlage Bestellungen mit der gleichen Zusammenfassung erzeugen"
      ],
      "If specified, this template will create orders with the same price": [
        "Diese Vorlage wird Bestellungen zum stets gleichen Preis erzeugen"
      ],
      "How much time has the customer to complete the payment once the order was created.": [
        "Dies bestimmt die Zeitdauer zur Bezahlung nach einer erfolgten Bestellung."
      ],
      "An amount is required": [
        "Ein Betrag ist erforderlich"
      ],
      "An order summary is required": [
        "Eine Zusammenfassung der Bestellung ist erforderlich"
      ],
      'No more stock for product with ID "%1$s".': [
        'Es gibt keinen Bestand f\xFCr den Artikel mit der ID "%1$s".'
      ],
      "New order from template": [
        "Neue Bestellung aus einer Vorlage erzeugen"
      ],
      "Amount of the order": [
        "Summe der Bestellung"
      ],
      "Slug": [
        "Slug (benutzer- und suchmaschinenfreundlicher Text als Bestandteil einer URL)"
      ],
      "Token family slug to use in URLs (for internal use only)": [
        "Slug der Token-Familie zur Benutzung in URLs (nur f\xFCr interne Zwecke)"
      ],
      "Kind": [
        "Art"
      ],
      "Token family kind": [
        "Art der Tokenfamilie"
      ],
      "User-readable token family name": [
        "Benutzerfreundliche Bezeichnung der Tokenfamilie"
      ],
      "Token family description for customers": [
        "Tokenfamilien-Beschreibung f\xFCr Kunden"
      ],
      "Valid After": [
        "G\xFCltig nach"
      ],
      "Token family can issue tokens after this date": [
        "Die Tokenfamilie kann nach diesem Datum Token ausgeben"
      ],
      "Valid Before": [
        "G\xFCltig vor"
      ],
      "Token family can issue tokens until this date": [
        "Die Tokenfamilie kann bis zu diesem Datum Token ausgeben"
      ],
      "Validity Granularity": [
        "Rundungsgenauigkeit des G\xFCltigkeitszeitraums"
      ],
      "Rounding granularity for the start validity of keys, must be 1 minute, 1 hour, 1 day, 1 week, 30 days or 90 days": [
        "Rundungsgenauigkeit f\xFCr Schl\xFCssel, diese muss 1 Minute, 1 Stunde, 1 Tag, 1 Woche, 30 Tage oder 90 Tage betragen"
      ],
      "Validity duration of a issued token": [
        "Zeitraum der G\xFCltigkeit eines ausgestellten Tokens"
      ],
      "Token Families": [
        "Tokenfamilien"
      ],
      "Add token family": [
        "Tokenfamilie hinzuf\xFCgen"
      ],
      "Go to token family update page": [
        "Zur Aktualisierungsseite f\xFCr Tokenfamilien gehen"
      ],
      "Remove this token family from the database": [
        "Diese Token aus der Datenbank entfernen"
      ],
      "There are no token families yet, add the first one by pressing the + sign.": [
        "Es sind noch keine Token-Familien angelegt. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen."
      ],
      "Token family has been deleted.": [
        "Die Tokenfamilie wurde gel\xF6scht."
      ],
      "Delete token family": [
        "Tokenfamilie l\xF6schen"
      ],
      'Delete the token family "%1$s"': [
        'Tokenfamilie "%1$s" l\xF6schen'
      ],
      "If you delete the %1$s token family (Slug: %2$s), all issued tokens will become invalid.": [
        "Wenn Sie die Tokenfamilie %1$s (SLUG: %2$s) l\xF6schen, werden alle ausgestellten Token ung\xFCltig."
      ],
      "Deleting a token family %1$s .": [
        "Tokenfamilie %1$s wird gel\xF6scht."
      ],
      "can't be undone": [
        "Das kann nicht r\xFCckg\xE4ngig gemacht werden"
      ],
      "Token Family: %1$s": [
        "Tokenfamilie: %1$s"
      ],
      "Incoming wire transfers": [
        "Erwartete \xDCberweisungen"
      ],
      "Load more wire transfers preceding the first one": [
        "Weitere \xDCberweisungen vor der ersten laden"
      ],
      "Expected credit": [
        "Erwartete Gutschrift"
      ],
      "Confirmed": [
        "Best\xE4tigt"
      ],
      "Validated": [
        "\xDCberpr\xFCft (validiert)"
      ],
      "Executed on": [
        "Ausf\xFChrungsdatum"
      ],
      "yes": [
        "ja"
      ],
      "no": [
        "nein"
      ],
      "never": [
        "nie"
      ],
      "unknown": [
        "unbekannt"
      ],
      "Load more transfers after the last one": [
        "Mehr \xDCberweisungen nach der letzten laden"
      ],
      "Verified wire transfers": [
        "\xDCberpr\xFCfte und best\xE4tigte \xDCberweisungen"
      ],
      "Verified": [
        "Verifizierte (best\xE4tigte) \xDCberweisungen"
      ],
      "There are no transfers to list yet, add more by pressing the + sign": [
        "Es gibt noch keine \xDCberweisungen anzuzeigen. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "All accounts": [
        "Alle Konten"
      ],
      "Filter by account address": [
        "Filtern nach Kontoadressen"
      ],
      "Only display transfers that have already been transferred to your bank account by the payment service provider.": [
        "Nur \xDCberweisungen anzeigen, die vom Zahlungsdienst bereits an Ihr Bankkonto \xFCberwiesen wurden."
      ],
      "Only show wire transfers confirmed by the merchant": [
        "Nur \xDCberweisungen anzeigen, die vom Verk\xE4ufer als auf dem Bankkonto eingegangen best\xE4tigt sind"
      ],
      "Wire transfer already confirmed.": [
        "Die \xDCberweisung ist bereits best\xE4tigt."
      ],
      "I have received the wire transfer": [
        "Ich habe die \xDCberweisung erhalten"
      ],
      "Confirm the wire transfer": [
        "Best\xE4tigen der \xDCberweisung"
      ],
      "The wire transfer has been sent and should be in your bank account in any time. You can manually confirm the reception usign the information below.": [
        "Die \xDCberweisung wurde ausgef\xFChrt und sollte in K\xFCrze auf Ihrem Bankkonto eingehen. Mithilfe der unten stehenden Informationen k\xF6nnen Sie die Gutschrift manuell \xFCberpr\xFCfen und best\xE4tigen."
      ],
      "Time": [
        "Zeit"
      ],
      "Transfer ID": [
        "Transfer-ID"
      ],
      "It's not the same.": [
        "Dies stimmt nicht \xFCberein."
      ],
      'You are deleting the instance with ID "%1$s"': [
        'Sie l\xF6schen nun die Instanz mit der ID "%1$s"'
      ],
      "Instance": [
        "Instanz"
      ],
      "Write the instance name to confirm the deletion": [
        "Schreiben Sie den Namen der Instanz hier hinein, um die L\xF6schung zu best\xE4tigen"
      ],
      "Purge": [
        "Vollst\xE4ndig verwerfen"
      ],
      "All the data will be fully deleted, otherwise only the access will be removed.": [
        "Alle Daten werden vollst\xE4ndig gel\xF6scht, andernfalls wird nur der Zugang entfernt."
      ],
      "DELETE": [
        "L\xD6SCHEN"
      ],
      "Pay delay can't be greater than wire transfer delay": [
        "Die Zahlungsfrist f\xFCr K\xE4ufer darf nicht l\xE4nger sein als der zeitliche Aufschub der \xDCberweisung"
      ],
      "Instance id": [
        "Instanz-ID"
      ],
      "Delete this instance": [
        "L\xF6schung dieser Instanz"
      ],
      "Must be one of '%1$s'": [
        "Muss eines von '%1$s' sein"
      ],
      "URL is invalid": [
        "URL ist ung\xFCltig"
      ],
      "Webhook ID to use": [
        "zu verwendende Webhook-ID"
      ],
      "Event": [
        "Event"
      ],
      "Payment": [
        "Zahlung"
      ],
      "Order settled": [
        "Die Bestellung wurde bezahlt und dem Konto gutgeschrieben"
      ],
      "Category added": [
        "Kategorie hinzugef\xFCgt"
      ],
      "Category updated": [
        "Die Kategorie wurde aktualisiert"
      ],
      "Inventory added": [
        "Der Bestand wurde hinzugef\xFCgt"
      ],
      "Inventory updated": [
        "Der Bestand wurde aktualisiert"
      ],
      "Inventory deleted": [
        "Bestand gel\xF6scht"
      ],
      "The event of the webhook: why the webhook is used": [
        "Event (Anlass, Bedingung) f\xFCr einen Webhook, um durch diesen nachfolgende Prozesse auszul\xF6sen"
      ],
      "Method": [
        "Methode"
      ],
      "GET": [
        "GET"
      ],
      "POST": [
        "POST"
      ],
      "PUT": [
        "PUT"
      ],
      "PATCH": [
        "PATCH"
      ],
      "HEAD": [
        "HEAD"
      ],
      "Method used by the webhook": [
        "Methode, die der Webhook verwendet"
      ],
      "URL": [
        "URL"
      ],
      "URL of the webhook where the customer will be redirected": [
        "URL des Webhooks, zu der die K\xE4ufer nach der Bezahlung weitergeleitet werden"
      ],
      "The text below supports the %1$s template engine. Any string between %2$s and %3$s will be replaced with the value of the corresponding variable.": [
        "Der folgende Text unterst\xFCtzt %1$s Vorlagen-Ersteller. Jede Zeichenkette zwischen %2$s und %3$s wird durch den Wert der entsprechenden Variablen ersetzt."
      ],
      "For example, %1$s will be replaced with the the order's price.": [
        "Beispielsweise wird %1$s durch den Bestellwert ersetzt."
      ],
      "The short list of variables are:": [
        "Einige der Variablen sind:"
      ],
      "order's description": [
        "Beschreibung der Bestellung"
      ],
      "order's price": [
        "Gesamtpreis der Bestellung"
      ],
      "order's unique identification": [
        "Laufende Nummer der Bestellung"
      ],
      "the amount that was being refunded": [
        "Der erstattete Betrag"
      ],
      "the reason entered by the merchant staff for granting the refund": [
        "Der vom Personal des Verk\xE4ufers angegebene Grund f\xFCr die Gew\xE4hrung einer Erstattung"
      ],
      "time of the refund in nanoseconds since 1970": [
        "Zeitpunkt der Erstattung in Nanosekunden seit 1970"
      ],
      "Http header": [
        "HTTP-Header"
      ],
      "Header template of the webhook": [
        "Vorlage f\xFCr den Webhook-Header"
      ],
      "Http body": [
        "HTTP-Body"
      ],
      "Body template used by the webhook.": [
        "Vorlage f\xFCr den Webhook-Body."
      ],
      "Webhook deleted successfully": [
        "Webhook wurde erfolgreich gel\xF6scht"
      ],
      "Add new webhooks": [
        "Neue Webhooks hinzuf\xFCgen"
      ],
      "Load more webhooks before the first one": [
        "Mehr Webhooks vor dem ersten laden"
      ],
      "Event type": [
        "Event-Typ"
      ],
      "Delete selected webhook from the database": [
        "Ausgew\xE4hlten Webhook aus der Datenbank l\xF6schen"
      ],
      "Load more webhooks after the last one": [
        "Mehr Webhooks nach dem letzten laden"
      ],
      "There are no webhooks to list yet, add more by pressing the + sign": [
        "Es gibt noch keine Webhooks. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen"
      ],
      "Webhook updated": [
        "Webhook aktualisiert"
      ],
      "Header": [
        "Header"
      ],
      "Body": [
        "Body"
      ],
      "Body template used by the webhook": [
        "Vorlage, die f\xFCr den Webhook-Body verwendet wird"
      ],
      "There is another instance with this username.": [
        "Es besteht bereits eine andere Instanz mit diesem Benutzernamen."
      ],
      "Self provision": [
        "Erstellen Sie Ihr eigenes Taler-Portal"
      ],
      "Phone": [
        "Telefon"
      ],
      "Contact phone number": [
        "Telefonnummer f\xFCr allgemeinen Kontakt"
      ],
      "I agree": [
        "AGB annehmen"
      ],
      "Accept the Terms of service": [
        "Allgemeine Gesch\xE4ftsbedingungen annehmen"
      ],
      "You must accept the Terms of service to continue.": [
        "Um fortzufahren m\xFCssen Sie zuerst die Allgemeinen Gesch\xE4ftsbedingungen dieser Verwaltungssoftware akzeptieren."
      ],
      "Create": [
        "Anlegen"
      ],
      "Password reset": [
        "Passwort zur\xFCcksetzen"
      ],
      'Resetting access to the instance "%1$s"': [
        'Zur\xFCcksetzen des Zugangs zur Instanz "%1$s"'
      ],
      "Reset": [
        "Zur\xFCcksetzen"
      ],
      "Language": [
        "Sprache"
      ],
      "Date format": [
        "Datumsformat"
      ],
      "How the date is going to be displayed": [
        "Wie das Datum angezeigt wird"
      ],
      "Merchant type": [
        "Merchant-Typus"
      ],
      "Simplify UI based on the user usage.": [
        "Passen Sie hier den Komplexit\xE4tsgrad der Benutzeroberfl\xE4che f\xFCr verschiedene Benutzer an."
      ],
      "Expert user": [
        "Erfahrener Benutzer (expert user)"
      ],
      "Taler developer": [
        "Entwickler (Taler developer)"
      ],
      "Unattended in-person offline vending": [
        "Personalloser Verkauf, z.B. Hofl\xE4den mit Vertrauenskassen (Unattended in-person offline vending)"
      ],
      "In-person online point-of-sale with inventory": [
        "Verkaufsstelle mit Internetzugang und Bestandserfassung (In-person online point-of-sale with inventory)"
      ],
      "Digital publishing": [
        "Vertrieb digitaler G\xFCter (Digital publishing)"
      ],
      "E-commerce site": [
        "Onlineshops (E-commerce site)"
      ],
      "Developer mode": [
        "Entwicklermodus"
      ],
      "Only use developer mode if you know how the application works. Some features enabled in this mode are still under testing.": [
        "Verwenden Sie den Entwicklermodus nur, wenn Sie wissen, wie die Anwendung funktioniert. Einige der in diesem Modus aktivierten Funktionen befinden sich noch in der Testphase."
      ],
      "Your browser does not support the canvas element.": [
        "Ihr Browser unterst\xFCtzt nicht das Canvas-Element."
      ],
      "Bad gateway": [
        "502 Bad gateway"
      ],
      "Service unavailable": [
        "Der Dienst ist nicht verf\xFCgbar"
      ],
      "Select date from which to show statistics": [
        "Bitte w\xE4hlen Sie das Datum, ab dem die Statistik angezeigt werden soll"
      ],
      "Show chart": [
        "Diagramm anzeigen"
      ],
      "Orders chart": [
        "Bestellungen als Diagramm"
      ],
      "Show table": [
        "Tabelle anzeigen"
      ],
      "Orders table": [
        "Tabellarische \xDCbersicht der Bestellungen"
      ],
      "Start from (%1$s)": [
        "Start von (%1$s)"
      ],
      "Orders statistics": [
        "Statistik der Bestellungen"
      ],
      "Since": [
        "Seit"
      ],
      "No order statistics yet.": [
        "Es wurde noch keine Bestellstatistik erstellt."
      ],
      "# of orders since": [
        "Anzahl der Bestellungen seit"
      ],
      "hour": [
        "Stunde"
      ],
      "day": [
        "Tag"
      ],
      "week": [
        "Woche"
      ],
      "weeks": [
        "Wochen"
      ],
      "month": [
        "Monat"
      ],
      "months": [
        "Monate"
      ],
      "quarter": [
        "Quartal"
      ],
      "quarters": [
        "Quartale"
      ],
      "years": [
        "Jahre"
      ],
      "Revenue chart": [
        "Umsatzdiagramm"
      ],
      "Revenue table": [
        "Tabellarische \xDCbersicht der Ums\xE4tze"
      ],
      "Revenue statistics filter": [
        "Umsatzstatistik-Filter"
      ],
      "Time range": [
        "Zeitraum"
      ],
      "Select time range to group dataset by": [
        "W\xE4hlen Sie den Zeitraum f\xFCr die Darstellung der Daten"
      ],
      "Select the number of ranges to include in data set": [
        "W\xE4hlen Sie die Anzahl der Zeitr\xE4ume f\xFCr die Datens\xE4tze, die angezeigt werden sollen"
      ],
      "Currency": [
        "W\xE4hrung"
      ],
      "Select the currency to show statistics for": [
        "Bitte w\xE4hlen Sie die W\xE4hrung, f\xFCr die Statistiken angezeigt werden sollen"
      ],
      "Revenue statistics over the past %1$s %2$s for currency '%3$s'": [
        "Umsatzstatistik der letzten %1$s %2$s f\xFCr W\xE4hrung '%3$s'"
      ],
      "Start time": [
        "Zeitraum"
      ],
      "No revenue statistics yet.": [
        "Es wurde noch keine Umsatzstatistik erstellt."
      ],
      "Revenue": [
        "Ums\xE4tze (Einnahmen)"
      ],
      "Welcome!": [
        "Willkommen im Taler Merchant Backoffice!"
      ],
      "The application is in a unexpected state and can't recover from here. You can report the problem to the developers at %1$s": [
        "Die Anwendung befindet sich in einem unerwarteten Betriebszustand. Bitte seien Sie so nett und melden das Problem den Entwicklern unter %1$s"
      ],
      "You need to associate a bank account to receive revenue.": [
        "Sie m\xFCssen ein Bankkonto verkn\xFCpfen, um Einnahmen aus \xDCberweisungen auf dieses Konto zu erhalten."
      ],
      "Without this the merchant backend will refuse to create new orders.": [
        "Ohne dies wird Taler Merchant Backend keine neuen Bestellungen erzeugen."
      ],
      "Hide for today": [
        "F\xFCr heute nicht anzeigen"
      ],
      "KYC verification needed": [
        "Eine KYC-\xDCberpr\xFCfung ist notwendig (Know-Your-Customer)"
      ],
      "Some transfers are on hold until the KYC process is completed. Visit the KYC section in the left-hand menu for more information.": [
        "Einige \xDCberweisungen werden bis zum Abschluss des KYC-Prozesses zur\xFCckgehalten. Bitte gehen Sie zum KYC-Status im Hauptmen\xFC links f\xFCr weitere Informationen."
      ],
      "The request reached a timeout, check your connection.": [
        "Die Anfrage hat ihr Zeitlimit erreicht, \xFCberpr\xFCfen Sie bitte Ihre Internetverbindung."
      ],
      "The request was cancelled.": [
        "Die Anfrage wurde abgebrochen."
      ],
      "Too many requests were made to the server, and this action was throttled.": [
        "Es wurden gleichzeitig zu viele Anfragen an denselben Server gestellt, daher ist diese Aktion gedrosselt worden."
      ],
      "The server's response was malformed.": [
        "Die Antwort des Servers auf die Anfrage war fehlerhaft."
      ],
      "Could not complete the request due to a network problem.": [
        "Die Anfrage konnte aufgrund eines Netzwerkproblems nicht abgeschlossen werden."
      ],
      "Unexpected request error.": [
        "Unerwarteter Fehler bei der Anfrage."
      ],
      "Unexpected error.": [
        "Unerwarteter Fehler."
      ],
      "Add new instance": [
        "Neue Instanz hinzuf\xFCgen"
      ],
      "Edit": [
        "Bearbeiten"
      ],
      "Change password": [
        "Passwort \xE4ndern"
      ],
      "There are no instances yet. Add one by pressing the '+' sign.": [
        "Es gibt noch keine Instanzen. Sie k\xF6nnen diese mit dem +-Zeichen hinzuf\xFCgen."
      ],
      'Instance "%1$s" (ID: %2$s) has been deleted.': [
        'Instanz "%1$s" (ID: %2$s) wurde gel\xF6scht.'
      ],
      "Only show active instances": [
        "Zeige nur aktive Instanzen"
      ],
      "Active": [
        "Aktiv"
      ],
      "Only show deleted instances": [
        "Zeige nur gel\xF6schte Instanzen"
      ],
      "Deleted": [
        "Gel\xF6scht"
      ],
      "Show all instances": [
        "Zeige alle Instanzen"
      ],
      "Delete instance": [
        "Instanz l\xF6schen"
      ],
      'Delete the instance "%1$s"': [
        'Instanz "%1$s" l\xF6schen'
      ],
      "If you delete the instance named %1$s (ID: %2$s), the merchant will no longer be able to process orders and refunds": [
        "Wenn Sie die Instanz mit der Bezeichnung %1$s (ID: %2$s) l\xF6schen, wird sie keine weiteren Bestellungen oder R\xFCckerstattungen bearbeiten k\xF6nnen"
      ],
      "This action deletes the instance's private key, but preserves all transaction data. You can still access the transaction data after having deleted the instance.": [
        "Dieser Vorgang l\xF6scht den privaten Schl\xFCssel der Instanz, l\xE4sst jedoch alle Transaktionsdaten unber\xFChrt. Sie k\xF6nnen daher auch weiterhin nach der L\xF6schung der Instanz auf diese Daten zugreifen."
      ],
      "Deleting an instance %1$s": [
        "L\xF6schung der Instanz %1$s"
      ],
      "This cannot be undone!": [
        "Das kann nicht r\xFCckg\xE4ngig gemacht werden!"
      ],
      "Purge the instance": [
        "Instanz l\xF6schen"
      ],
      'Purge the instance "%1$s"': [
        'Instanz "%1$s" wird endg\xFCltig verworfen'
      ],
      "If you purge the instance named %1$s (ID: %2$s), you will also delete all of its transaction data!": [
        "Falls Sie die Instanz %1$s (ID: %2$s) vollst\xE4ndig verwerfen, l\xF6schen Sie damit auch unwiderruflich alle Transaktionsdaten!"
      ],
      "The instance will disappear from your list and you will no longer be able to access its data.": [
        "Die Instanz wird von Ihrer Liste gestrichen und alle ihre Daten werden nicht mehr zug\xE4nglich sein."
      ],
      "Purging an instance %1$s": [
        "Die Instanz %1$s wird endg\xFCltig verworfen"
      ],
      "checking compatibility with server...": [
        "Pr\xFCfe Kompatibilit\xE4t mit dem Server..."
      ],
      "Contacting the server failed": [
        "Der Kontaktversuch mit dem Server ist fehlgeschlagen"
      ],
      "The server version is not supported": [
        "Die Serverversion wird nicht unterst\xFCtzt"
      ],
      'Supported version "%1$s", server version "%2$s".': [
        'Unterst\xFCtzte Version "%1$s", Serverversion "%2$s".'
      ],
      "Deleting": [
        "l\xF6scht\u2026"
      ],
      "Changing": [
        "\xE4ndern\u2026"
      ],
      "Manage password": [
        "Passwort verwalten"
      ],
      "Business Name": [
        "Firmenname"
      ],
      "Available statistics": [
        "Verf\xFCgbare Statistiken"
      ],
      "There are no statistics to list": [
        "Es gibt noch keine Statistiken anzuzeigen"
      ],
      "title%1$s: Settings": [
        "%1$s: Einstellungen"
      ],
      "title%1$s: New bank account": [
        "%1$s: Neues Bankkonto"
      ],
      "title%1$s: Bank accounts": [
        "%1$s: Bankkonten"
      ],
      "title%1$s: Update bank Account": [
        "%1$s: Bankkonto aktualisieren"
      ],
      "title%1$s: Orders": [
        "%1$s: Bestellungen"
      ],
      "title%1$s: New order": [
        "%1$s: Neue Bestellung"
      ],
      "title%1$s: Inventory": [
        "%1$s: Lagerbestand"
      ],
      "title%1$s: New product": [
        "%1$s: Neuer Artikel"
      ],
      "title%1$s: Update product": [
        "%1$s: Artikel aktualisieren"
      ],
      "title%1$s: Category": [
        "%1$s: Kategorie"
      ],
      "title%1$s: New category": [
        "%1$s: Neue Kategorie"
      ],
      "title%1$s: Update category": [
        "%1$s: Kategorie aktualisieren"
      ],
      "title%1$s: Wire transfers": [
        "%1$s: \xDCberweisungen"
      ],
      "title%1$s: Webhooks": [
        "%1$s: Webhooks"
      ],
      "title%1$s: New webhook": [
        "%1$s: Neuer Webhook"
      ],
      "title%1$s: Update webhook": [
        "%1$s: Webhook aktualisieren"
      ],
      "title%1$s: OTP devices": [
        "%1$s: OTP-Ger\xE4te"
      ],
      "title%1$s: New OTP device": [
        "%1$s: Neues OTP-Ger\xE4t"
      ],
      "title%1$s: Update OTP device": [
        "%1$s: OTP-Ger\xE4t aktualisieren"
      ],
      "title%1$s: New template": [
        "%1$s: Neue Vorlage"
      ],
      "title%1$s: Update template": [
        "%1$s: Vorlage aktualisieren"
      ],
      "title%1$s: Templates": [
        "%1$s: Vorlagen"
      ],
      "title%1$s: Use template": [
        "%1$s: Vorlage verwenden"
      ],
      "title%1$s: Personalization": [
        "%1$s: Personalisierung"
      ],
      "title%1$s: Token families": [
        "%1$s: Tokenfamilien"
      ],
      "title%1$s: New token family": [
        "%1$s: Neue Tokenfamilie"
      ],
      "title%1$s: Update token family": [
        "%1$s: Tokenfamilie aktualisieren"
      ],
      "title%1$s: Access tokens": [
        "%1$s: Zugangstoken"
      ],
      "title%1$s: New access token": [
        "%1$s: Neuer Zugangstoken"
      ],
      "titleNew instance": [
        "Neue Instanz"
      ],
      "titleInstances": [
        "Instanzen"
      ]
    }
  },
  "domain": "messages",
  "plural_forms": "nplurals=2; plural=n != 1;",
  "lang": "de",
  "completeness": 100
};

// src/settings.ts
var defaultSettings2 = {
  backendBaseURL: buildDefaultBackendBaseURL()
};
var codecForBankUISettings = () => buildCodecForObject().property("backendBaseURL", codecOptional(codecForString())).build("MerchantUiSettings");
function removeUndefineField(obj) {
  const keys = Object.keys(obj);
  return keys.reduce((prev, cur) => {
    if (typeof prev[cur] === "undefined") {
      delete prev[cur];
    }
    return prev;
  }, obj);
}
function fetchSettings(listener) {
  fetch("./settings.json").then((resp) => resp.json()).then((json) => codecForBankUISettings().decode(json)).then(
    (result) => listener({
      ...defaultSettings2,
      ...removeUndefineField(result)
    })
  ).catch((e5) => {
    console.log("failed to fetch settings", e5);
    listener(defaultSettings2);
  });
}
function buildDefaultBackendBaseURL() {
  if (typeof window !== "undefined") {
    const currentLocation = new URL(
      window.location.pathname,
      window.location.origin
    ).href;
    return canonicalizeBaseUrl(currentLocation.replace("/webui", ""));
  }
  throw Error("No default URL");
}

// src/Application.tsx
var WITH_LOCAL_STORAGE_CACHE = false;
function Application() {
  const [settings, setSettings] = p3();
  h2(() => {
    fetchSettings(setSettings);
  }, []);
  if (!settings)
    return /* @__PURE__ */ h(Loading2, null);
  const baseUrl = getInitialBackendBaseURL(settings.backendBaseURL);
  return /* @__PURE__ */ h(SettingsProvider, { value: settings }, /* @__PURE__ */ h(
    TranslationProvider,
    {
      source: strings,
      completeness: {
        uk: strings["uk"].completeness,
        tr: strings["tr"].completeness,
        // ru: strings["ru"].completeness,
        sv: strings["sv"].completeness,
        it: strings["it"].completeness,
        fr: strings["fr"].completeness,
        es: strings["es"].completeness,
        de: strings["de"].completeness
      }
    },
    /* @__PURE__ */ h(
      MerchantApiProvider,
      {
        baseUrl: new URL("./", baseUrl),
        frameOnError: OnConfigError,
        evictors: {
          management: swrCacheEvictor
        }
      },
      /* @__PURE__ */ h(SessionContextProvider, null, /* @__PURE__ */ h(
        SWRConfig2,
        {
          value: {
            provider: WITH_LOCAL_STORAGE_CACHE ? localStorageProvider : void 0,
            // normally, do not revalidate
            revalidateOnFocus: false,
            revalidateOnReconnect: false,
            revalidateIfStale: false,
            revalidateOnMount: void 0,
            focusThrottleInterval: void 0,
            // normally, do not refresh
            refreshInterval: void 0,
            dedupingInterval: 2e3,
            refreshWhenHidden: false,
            refreshWhenOffline: false,
            // ignore errors
            shouldRetryOnError: false,
            errorRetryCount: 0,
            errorRetryInterval: void 0,
            // do not go to loading again if already has data
            keepPreviousData: true
          }
        },
        /* @__PURE__ */ h(TalerWalletIntegrationBrowserProvider, null, /* @__PURE__ */ h(BrowserHashNavigationProvider, null, /* @__PURE__ */ h(Routing, null)))
      ))
    )
  ));
}
function getInitialBackendBaseURL(backendFromSettings) {
  const overrideUrl = typeof localStorage !== "undefined" ? localStorage.getItem("merchant-base-url") : void 0;
  let result;
  if (overrideUrl) {
    result = overrideUrl;
  } else {
    if (!backendFromSettings) {
      console.error(
        "ERROR: backendBaseURL was overridden by a setting file and missing. Setting value to 'window.origin'"
      );
      result = buildDefaultBackendBaseURL();
    } else {
      result = backendFromSettings;
    }
  }
  try {
    return canonicalizeBaseUrl(result);
  } catch (e5) {
    return canonicalizeBaseUrl(window.origin);
  }
}
function localStorageProvider() {
  const map3 = new Map(JSON.parse(localStorage.getItem("app-cache") || "[]"));
  window.addEventListener("beforeunload", () => {
    const appCache = JSON.stringify(Array.from(map3.entries()));
    localStorage.setItem("app-cache", appCache);
  });
  return map3;
}
function OnConfigError({
  state
}) {
  const { i18n: i18n2 } = useTranslationContext();
  if (!state) {
    return /* @__PURE__ */ h(i18n2.Translate, null, "checking compatibility with server...");
  }
  switch (state.type) {
    case "error": {
      return /* @__PURE__ */ h(
        NotificationCard,
        {
          notification: {
            message: i18n2.str`Contacting the server failed`,
            description: state.error.message,
            details: JSON.stringify(state.error.errorDetail, void 0, 2),
            type: "ERROR"
          }
        }
      );
    }
    case "incompatible": {
      return /* @__PURE__ */ h(
        NotificationCard,
        {
          notification: {
            message: i18n2.str`The server version is not supported`,
            description: i18n2.str`Supported version "${state.supported}", server version "${state.result.version}".`,
            type: "WARN"
          }
        }
      );
    }
    default:
      assertUnreachable(state);
  }
}
var swrCacheEvictor = new class {
  async notifySuccess(op) {
    switch (op) {
      case TalerMerchantManagementCacheEviction.CREATE_INSTANCE: {
        await Promise.all([revalidateBackendInstances()]);
        return;
      }
      case TalerMerchantManagementCacheEviction.UPDATE_INSTANCE: {
        await Promise.all([revalidateManagedInstanceDetails()]);
        return;
      }
      case TalerMerchantManagementCacheEviction.DELETE_INSTANCE: {
        await Promise.all([revalidateBackendInstances()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_CURRENT_INSTANCE: {
        await Promise.all([revalidateInstanceDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_CURRENT_INSTANCE: {
        await Promise.all([revalidateInstanceDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_BANK_ACCOUNT: {
        await Promise.all([revalidateInstanceBankAccounts()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_BANK_ACCOUNT: {
        await Promise.all([revalidateBankAccountDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_BANK_ACCOUNT: {
        await Promise.all([revalidateInstanceBankAccounts()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_CATEGORY: {
        await Promise.all([revalidateInstanceCategories()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_CATEGORY: {
        await Promise.all([revalidateInstanceCategories()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_CATEGORY: {
        await Promise.all([revalidateInstanceCategories()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_PRODUCT: {
        await Promise.all([
          revalidateInstanceProducts(),
          revalidateInstanceCategories()
        ]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_PRODUCT: {
        await Promise.all([
          revalidateProductDetails(),
          revalidateInstanceProducts(),
          revalidateInstanceCategories()
        ]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_PRODUCT: {
        await Promise.all([
          revalidateInstanceProducts(),
          revalidateInstanceCategories()
        ]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_TRANSFER: {
        await Promise.all([
          revalidateInstanceConfirmedTransfers(),
          revalidateInstanceIncomingTransfers()
        ]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_TRANSFER: {
        await Promise.all([
          revalidateInstanceConfirmedTransfers(),
          revalidateInstanceIncomingTransfers()
        ]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_DEVICE: {
        await Promise.all([revalidateInstanceOtpDevices()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_DEVICE: {
        await Promise.all([revalidateOtpDeviceDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_DEVICE: {
        await Promise.all([revalidateInstanceOtpDevices()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_TEMPLATE: {
        await Promise.all([revalidateInstanceTemplates()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_TEMPLATE: {
        await Promise.all([revalidateTemplateDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_TEMPLATE: {
        await Promise.all([revalidateInstanceTemplates()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_WEBHOOK: {
        await Promise.all([revalidateInstanceWebhooks()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_WEBHOOK: {
        await Promise.all([revalidateWebhookDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_WEBHOOK: {
        await Promise.all([revalidateInstanceWebhooks()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_ORDER: {
        await Promise.all([revalidateInstanceOrders()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_ORDER: {
        await Promise.all([revalidateOrderDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_ORDER: {
        await Promise.all([revalidateInstanceOrders()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_TOKENFAMILY: {
        await Promise.all([revalidateTokenFamilies()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.UPDATE_TOKENFAMILY: {
        await Promise.all([revalidateTokenFamilyDetails()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_TOKENFAMILY: {
        await Promise.all([revalidateTokenFamilies()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.CREATE_ACCESSTOKEN: {
        await Promise.all([revalidateInstanceAccessTokens()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.DELETE_ACCESSTOKEN: {
        await Promise.all([revalidateInstanceAccessTokens()]);
        return;
      }
      case TalerMerchantInstanceCacheEviction.LAST: {
        return;
      }
      default: {
        assertUnreachable(op);
      }
    }
  }
}();

// src/index.tsx
init_preact_module();
var app = document.getElementById("app");
if (app) {
  P(/* @__PURE__ */ h(Application, null), app);
} else {
  console.error("HTML element with id 'app' not found.");
}
/*! Bundled license information:

jed/jed.js:
  (**
   * @preserve jed.js https://github.com/SlexAxton/Jed
   *)

use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js:
  (**
   * @license React
   * use-sync-external-store-shim.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

@kurkle/color/dist/color.esm.js:
  (*!
   * @kurkle/color v0.3.4
   * https://github.com/kurkle/color#readme
   * (c) 2024 Jukka Kurkela
   * Released under the MIT License
   *)

chart.js/dist/chunks/helpers.dataset.js:
  (*!
   * Chart.js v4.5.0
   * https://www.chartjs.org
   * (c) 2025 Chart.js Contributors
   * Released under the MIT License
   *)

chart.js/dist/chart.js:
  (*!
   * Chart.js v4.5.0
   * https://www.chartjs.org
   * (c) 2025 Chart.js Contributors
   * Released under the MIT License
   *)

chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js:
  (*!
   * chartjs-adapter-date-fns v3.0.0
   * https://www.chartjs.org
   * (c) 2022 chartjs-adapter-date-fns Contributors
   * Released under the MIT license
   *)
*/
//# sourceMappingURL=index.js.map
