import { e as g, j as Y, k as B, b as P, c as R, p as v, _ as y, a as G, l as L, m as C, o as $, T as I, g as E } from "./PlainValue-b8036b75.js";
import { d, P as p, t as w, Y as D, l as b, S as j, j as U, b as N, c as x, h as Z, g as F, k as K } from "./resolveSeq-492ab440.js";
var re = {
  identify: function(n) {
    return n instanceof Uint8Array;
  },
  default: !1,
  tag: "tag:yaml.org,2002:binary",
  resolve: function(n, e) {
    var r = U(n, e);
    if (typeof Buffer == "function")
      return Buffer.from(r, "base64");
    if (typeof atob == "function") {
      for (var t = atob(r.replace(/[\n\r]/g, "")), s = new Uint8Array(t.length), a = 0; a < t.length; ++a)
        s[a] = t.charCodeAt(a);
      return s;
    } else {
      var i = "This environment does not support reading binary tags; either Buffer or atob is required";
      return n.errors.push(new $(e, i)), null;
    }
  },
  options: N,
  stringify: function(n, e, r, t) {
    var s = n.comment, a = n.type, i = n.value, f;
    if (typeof Buffer == "function")
      f = i instanceof Buffer ? i.toString("base64") : Buffer.from(i.buffer).toString("base64");
    else if (typeof btoa == "function") {
      for (var u = "", l = 0; l < i.length; ++l)
        u += String.fromCharCode(i[l]);
      f = btoa(u);
    } else
      throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
    if (a || (a = N.defaultType), a === I.QUOTE_DOUBLE)
      i = f;
    else {
      for (var c = N.lineWidth, m = Math.ceil(f.length / c), M = new Array(m), _ = 0, O = 0; _ < m; ++_, O += c)
        M[_] = f.substr(O, c);
      i = M.join(a === I.BLOCK_LITERAL ? `
` : " ");
    }
    return x({
      comment: s,
      type: a,
      value: i
    }, e, r, t);
  }
};
function W(o, n) {
  for (var e = Z(o, n), r = 0; r < e.items.length; ++r) {
    var t = e.items[r];
    if (!(t instanceof p)) {
      if (t instanceof d) {
        if (t.items.length > 1) {
          var s = "Each pair must have its own sequence indicator";
          throw new E(n, s);
        }
        var a = t.items[0] || new p();
        t.commentBefore && (a.commentBefore = a.commentBefore ? "".concat(t.commentBefore, `
`).concat(a.commentBefore) : t.commentBefore), t.comment && (a.comment = a.comment ? "".concat(t.comment, `
`).concat(a.comment) : t.comment), t = a;
      }
      e.items[r] = t instanceof p ? t : new p(t);
    }
  }
  return e;
}
function k(o, n, e) {
  var r = new D(o);
  r.tag = "tag:yaml.org,2002:pairs";
  var t = y(n), s;
  try {
    for (t.s(); !(s = t.n()).done; ) {
      var a = s.value, i = void 0, f = void 0;
      if (Array.isArray(a))
        if (a.length === 2)
          i = a[0], f = a[1];
        else
          throw new TypeError("Expected [key, value] tuple: ".concat(a));
      else if (a && a instanceof Object) {
        var u = Object.keys(a);
        if (u.length === 1)
          i = u[0], f = a[i];
        else
          throw new TypeError("Expected { key: value } tuple: ".concat(a));
      } else
        i = a;
      var l = o.createPair(i, f, e);
      r.items.push(l);
    }
  } catch (c) {
    t.e(c);
  } finally {
    t.f();
  }
  return r;
}
var ae = {
  default: !1,
  tag: "tag:yaml.org,2002:pairs",
  resolve: W,
  createNode: k
}, h = /* @__PURE__ */ function(o) {
  Y(e, o);
  var n = B(e);
  function e() {
    var r;
    return R(this, e), r = n.call(this), g(v(r), "add", d.prototype.add.bind(v(r))), g(v(r), "delete", d.prototype.delete.bind(v(r))), g(v(r), "get", d.prototype.get.bind(v(r))), g(v(r), "has", d.prototype.has.bind(v(r))), g(v(r), "set", d.prototype.set.bind(v(r))), r.tag = e.tag, r;
  }
  return P(e, [{
    key: "toJSON",
    value: function(t, s) {
      var a = /* @__PURE__ */ new Map();
      s && s.onCreate && s.onCreate(a);
      var i = y(this.items), f;
      try {
        for (i.s(); !(f = i.n()).done; ) {
          var u = f.value, l = void 0, c = void 0;
          if (u instanceof p ? (l = w(u.key, "", s), c = w(u.value, l, s)) : l = w(u, "", s), a.has(l))
            throw new Error("Ordered maps must not include duplicate keys");
          a.set(l, c);
        }
      } catch (m) {
        i.e(m);
      } finally {
        i.f();
      }
      return a;
    }
  }]), e;
}(D);
g(h, "tag", "tag:yaml.org,2002:omap");
function V(o, n) {
  var e = W(o, n), r = [], t = y(e.items), s;
  try {
    for (t.s(); !(s = t.n()).done; ) {
      var a = s.value.key;
      if (a instanceof j)
        if (r.includes(a.value)) {
          var i = "Ordered maps must not include duplicate keys";
          throw new E(n, i);
        } else
          r.push(a.value);
    }
  } catch (f) {
    t.e(f);
  } finally {
    t.f();
  }
  return Object.assign(new h(), e);
}
function H(o, n, e) {
  var r = k(o, n, e), t = new h();
  return t.items = r.items, t;
}
var ne = {
  identify: function(n) {
    return n instanceof Map;
  },
  nodeClass: h,
  default: !1,
  tag: "tag:yaml.org,2002:omap",
  resolve: V,
  createNode: H
}, S = /* @__PURE__ */ function(o) {
  Y(e, o);
  var n = B(e);
  function e() {
    var r;
    return R(this, e), r = n.call(this), r.tag = e.tag, r;
  }
  return P(e, [{
    key: "add",
    value: function(t) {
      var s = t instanceof p ? t : new p(t), a = b(this.items, s.key);
      a || this.items.push(s);
    }
  }, {
    key: "get",
    value: function(t, s) {
      var a = b(this.items, t);
      return !s && a instanceof p ? a.key instanceof j ? a.key.value : a.key : a;
    }
  }, {
    key: "set",
    value: function(t, s) {
      if (typeof s != "boolean")
        throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(G(s)));
      var a = b(this.items, t);
      a && !s ? this.items.splice(this.items.indexOf(a), 1) : !a && s && this.items.push(new p(t));
    }
  }, {
    key: "toJSON",
    value: function(t, s) {
      return L(C(e.prototype), "toJSON", this).call(this, t, s, Set);
    }
  }, {
    key: "toString",
    value: function(t, s, a) {
      if (!t)
        return JSON.stringify(this);
      if (this.hasAllNullValues())
        return L(C(e.prototype), "toString", this).call(this, t, s, a);
      throw new Error("Set items must all have null values");
    }
  }]), e;
}(d);
g(S, "tag", "tag:yaml.org,2002:set");
function Q(o, n) {
  var e = F(o, n);
  if (!e.hasAllNullValues())
    throw new E(n, "Set items must all have null values");
  return Object.assign(new S(), e);
}
function X(o, n, e) {
  var r = new S(), t = y(n), s;
  try {
    for (t.s(); !(s = t.n()).done; ) {
      var a = s.value;
      r.items.push(o.createPair(a, null, e));
    }
  } catch (i) {
    t.e(i);
  } finally {
    t.f();
  }
  return r;
}
var se = {
  identify: function(n) {
    return n instanceof Set;
  },
  nodeClass: S,
  default: !1,
  tag: "tag:yaml.org,2002:set",
  resolve: Q,
  createNode: X
}, A = function(n, e) {
  var r = e.split(":").reduce(function(t, s) {
    return t * 60 + Number(s);
  }, 0);
  return n === "-" ? -r : r;
}, J = function(n) {
  var e = n.value;
  if (isNaN(e) || !isFinite(e))
    return K(e);
  var r = "";
  e < 0 && (r = "-", e = Math.abs(e));
  var t = [e % 60];
  return e < 60 ? t.unshift(0) : (e = Math.round((e - t[0]) / 60), t.unshift(e % 60), e >= 60 && (e = Math.round((e - t[0]) / 60), t.unshift(e))), r + t.map(function(s) {
    return s < 10 ? "0" + String(s) : String(s);
  }).join(":").replace(/000000\d*$/, "");
}, oe = {
  identify: function(n) {
    return typeof n == "number";
  },
  default: !0,
  tag: "tag:yaml.org,2002:int",
  format: "TIME",
  test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
  resolve: function(n, e, r) {
    return A(e, r.replace(/_/g, ""));
  },
  stringify: J
}, ie = {
  identify: function(n) {
    return typeof n == "number";
  },
  default: !0,
  tag: "tag:yaml.org,2002:float",
  format: "TIME",
  test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
  resolve: function(n, e, r) {
    return A(e, r.replace(/_/g, ""));
  },
  stringify: J
}, fe = {
  identify: function(n) {
    return n instanceof Date;
  },
  default: !0,
  tag: "tag:yaml.org,2002:timestamp",
  test: RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),
  resolve: function(n, e, r, t, s, a, i, f, u) {
    f && (f = (f + "00").substr(1, 3));
    var l = Date.UTC(e, r - 1, t, s || 0, a || 0, i || 0, f || 0);
    if (u && u !== "Z") {
      var c = A(u[0], u.slice(1));
      Math.abs(c) < 30 && (c *= 60), l -= 6e4 * c;
    }
    return new Date(l);
  },
  stringify: function(n) {
    var e = n.value;
    return e.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "");
  }
};
function q(o) {
  var n = typeof process < "u" && process.env || {};
  return o ? typeof YAML_SILENCE_DEPRECATION_WARNINGS < "u" ? !YAML_SILENCE_DEPRECATION_WARNINGS : !n.YAML_SILENCE_DEPRECATION_WARNINGS : typeof YAML_SILENCE_WARNINGS < "u" ? !YAML_SILENCE_WARNINGS : !n.YAML_SILENCE_WARNINGS;
}
function z(o, n) {
  if (q(!1)) {
    var e = typeof process < "u" && process.emitWarning;
    e ? e(o, n) : console.warn(n ? "".concat(n, ": ").concat(o) : o);
  }
}
var T = {};
function ue(o, n) {
  if (!T[o] && q(!0)) {
    T[o] = !0;
    var e = "The option '".concat(o, "' will be removed in a future release");
    e += n ? ", use '".concat(n, "' instead.") : ".", z(e, "DeprecationWarning");
  }
}
export {
  ue as a,
  re as b,
  ie as f,
  oe as i,
  ne as o,
  ae as p,
  se as s,
  fe as t,
  z as w
};
//# sourceMappingURL=warnings-df54cb69.js.map
