var J = Object.defineProperty;
var N = (S, P, C) => P in S ? J(S, P, { enumerable: !0, configurable: !0, writable: !0, value: C }) : S[P] = C;
var I = (S, P, C) => N(S, typeof P != "symbol" ? P + "" : P, C);
var L;
(() => {
  var S = { 470: (y) => {
    function m(t) {
      if (typeof t != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(t));
    }
    function A(t, e) {
      for (var n, o = "", f = 0, h = -1, l = 0, c = 0; c <= t.length; ++c) {
        if (c < t.length) n = t.charCodeAt(c);
        else {
          if (n === 47) break;
          n = 47;
        }
        if (n === 47) {
          if (!(h === c - 1 || l === 1)) if (h !== c - 1 && l === 2) {
            if (o.length < 2 || f !== 2 || o.charCodeAt(o.length - 1) !== 46 || o.charCodeAt(o.length - 2) !== 46) {
              if (o.length > 2) {
                var v = o.lastIndexOf("/");
                if (v !== o.length - 1) {
                  v === -1 ? (o = "", f = 0) : f = (o = o.slice(0, v)).length - 1 - o.lastIndexOf("/"), h = c, l = 0;
                  continue;
                }
              } else if (o.length === 2 || o.length === 1) {
                o = "", f = 0, h = c, l = 0;
                continue;
              }
            }
            e && (o.length > 0 ? o += "/.." : o = "..", f = 2);
          } else o.length > 0 ? o += "/" + t.slice(h + 1, c) : o = t.slice(h + 1, c), f = c - h - 1;
          h = c, l = 0;
        } else n === 46 && l !== -1 ? ++l : l = -1;
      }
      return o;
    }
    var q = { resolve: function() {
      for (var t, e = "", n = !1, o = arguments.length - 1; o >= -1 && !n; o--) {
        var f;
        o >= 0 ? f = arguments[o] : (t === void 0 && (t = process.cwd()), f = t), m(f), f.length !== 0 && (e = f + "/" + e, n = f.charCodeAt(0) === 47);
      }
      return e = A(e, !n), n ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
    }, normalize: function(t) {
      if (m(t), t.length === 0) return ".";
      var e = t.charCodeAt(0) === 47, n = t.charCodeAt(t.length - 1) === 47;
      return (t = A(t, !e)).length !== 0 || e || (t = "."), t.length > 0 && n && (t += "/"), e ? "/" + t : t;
    }, isAbsolute: function(t) {
      return m(t), t.length > 0 && t.charCodeAt(0) === 47;
    }, join: function() {
      if (arguments.length === 0) return ".";
      for (var t, e = 0; e < arguments.length; ++e) {
        var n = arguments[e];
        m(n), n.length > 0 && (t === void 0 ? t = n : t += "/" + n);
      }
      return t === void 0 ? "." : q.normalize(t);
    }, relative: function(t, e) {
      if (m(t), m(e), t === e || (t = q.resolve(t)) === (e = q.resolve(e))) return "";
      for (var n = 1; n < t.length && t.charCodeAt(n) === 47; ++n) ;
      for (var o = t.length, f = o - n, h = 1; h < e.length && e.charCodeAt(h) === 47; ++h) ;
      for (var l = e.length - h, c = f < l ? f : l, v = -1, d = 0; d <= c; ++d) {
        if (d === c) {
          if (l > c) {
            if (e.charCodeAt(h + d) === 47) return e.slice(h + d + 1);
            if (d === 0) return e.slice(h + d);
          } else f > c && (t.charCodeAt(n + d) === 47 ? v = d : d === 0 && (v = 0));
          break;
        }
        var x = t.charCodeAt(n + d);
        if (x !== e.charCodeAt(h + d)) break;
        x === 47 && (v = d);
      }
      var _ = "";
      for (d = n + v + 1; d <= o; ++d) d !== o && t.charCodeAt(d) !== 47 || (_.length === 0 ? _ += ".." : _ += "/..");
      return _.length > 0 ? _ + e.slice(h + v) : (h += v, e.charCodeAt(h) === 47 && ++h, e.slice(h));
    }, _makeLong: function(t) {
      return t;
    }, dirname: function(t) {
      if (m(t), t.length === 0) return ".";
      for (var e = t.charCodeAt(0), n = e === 47, o = -1, f = !0, h = t.length - 1; h >= 1; --h) if ((e = t.charCodeAt(h)) === 47) {
        if (!f) {
          o = h;
          break;
        }
      } else f = !1;
      return o === -1 ? n ? "/" : "." : n && o === 1 ? "//" : t.slice(0, o);
    }, basename: function(t, e) {
      if (e !== void 0 && typeof e != "string") throw new TypeError('"ext" argument must be a string');
      m(t);
      var n, o = 0, f = -1, h = !0;
      if (e !== void 0 && e.length > 0 && e.length <= t.length) {
        if (e.length === t.length && e === t) return "";
        var l = e.length - 1, c = -1;
        for (n = t.length - 1; n >= 0; --n) {
          var v = t.charCodeAt(n);
          if (v === 47) {
            if (!h) {
              o = n + 1;
              break;
            }
          } else c === -1 && (h = !1, c = n + 1), l >= 0 && (v === e.charCodeAt(l) ? --l == -1 && (f = n) : (l = -1, f = c));
        }
        return o === f ? f = c : f === -1 && (f = t.length), t.slice(o, f);
      }
      for (n = t.length - 1; n >= 0; --n) if (t.charCodeAt(n) === 47) {
        if (!h) {
          o = n + 1;
          break;
        }
      } else f === -1 && (h = !1, f = n + 1);
      return f === -1 ? "" : t.slice(o, f);
    }, extname: function(t) {
      m(t);
      for (var e = -1, n = 0, o = -1, f = !0, h = 0, l = t.length - 1; l >= 0; --l) {
        var c = t.charCodeAt(l);
        if (c !== 47) o === -1 && (f = !1, o = l + 1), c === 46 ? e === -1 ? e = l : h !== 1 && (h = 1) : e !== -1 && (h = -1);
        else if (!f) {
          n = l + 1;
          break;
        }
      }
      return e === -1 || o === -1 || h === 0 || h === 1 && e === o - 1 && e === n + 1 ? "" : t.slice(e, o);
    }, format: function(t) {
      if (t === null || typeof t != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
      return (function(e, n) {
        var o = n.dir || n.root, f = n.base || (n.name || "") + (n.ext || "");
        return o ? o === n.root ? o + f : o + "/" + f : f;
      })(0, t);
    }, parse: function(t) {
      m(t);
      var e = { root: "", dir: "", base: "", ext: "", name: "" };
      if (t.length === 0) return e;
      var n, o = t.charCodeAt(0), f = o === 47;
      f ? (e.root = "/", n = 1) : n = 0;
      for (var h = -1, l = 0, c = -1, v = !0, d = t.length - 1, x = 0; d >= n; --d) if ((o = t.charCodeAt(d)) !== 47) c === -1 && (v = !1, c = d + 1), o === 46 ? h === -1 ? h = d : x !== 1 && (x = 1) : h !== -1 && (x = -1);
      else if (!v) {
        l = d + 1;
        break;
      }
      return h === -1 || c === -1 || x === 0 || x === 1 && h === c - 1 && h === l + 1 ? c !== -1 && (e.base = e.name = l === 0 && f ? t.slice(1, c) : t.slice(l, c)) : (l === 0 && f ? (e.name = t.slice(1, h), e.base = t.slice(1, c)) : (e.name = t.slice(l, h), e.base = t.slice(l, c)), e.ext = t.slice(h, c)), l > 0 ? e.dir = t.slice(0, l - 1) : f && (e.dir = "/"), e;
    }, sep: "/", delimiter: ":", win32: null, posix: null };
    q.posix = q, y.exports = q;
  } }, P = {};
  function C(y) {
    var m = P[y];
    if (m !== void 0) return m.exports;
    var A = P[y] = { exports: {} };
    return S[y](A, A.exports, C), A.exports;
  }
  C.d = (y, m) => {
    for (var A in m) C.o(m, A) && !C.o(y, A) && Object.defineProperty(y, A, { enumerable: !0, get: m[A] });
  }, C.o = (y, m) => Object.prototype.hasOwnProperty.call(y, m), C.r = (y) => {
    typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(y, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(y, "__esModule", { value: !0 });
  };
  var R = {};
  (() => {
    let y;
    C.r(R), C.d(R, { URI: () => f, Utils: () => k }), typeof process == "object" ? y = process.platform === "win32" : typeof navigator == "object" && (y = navigator.userAgent.indexOf("Windows") >= 0);
    const m = /^\w[\w\d+.-]*$/, A = /^\//, q = /^\/\//;
    function t(a, r) {
      if (!a.scheme && r) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${a.authority}", path: "${a.path}", query: "${a.query}", fragment: "${a.fragment}"}`);
      if (a.scheme && !m.test(a.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
      if (a.path) {
        if (a.authority) {
          if (!A.test(a.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
        } else if (q.test(a.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
      }
    }
    const e = "", n = "/", o = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
    class f {
      constructor(r, i, s, p, g, u = !1) {
        I(this, "scheme");
        I(this, "authority");
        I(this, "path");
        I(this, "query");
        I(this, "fragment");
        typeof r == "object" ? (this.scheme = r.scheme || e, this.authority = r.authority || e, this.path = r.path || e, this.query = r.query || e, this.fragment = r.fragment || e) : (this.scheme = /* @__PURE__ */ (function(O, w) {
          return O || w ? O : "file";
        })(r, u), this.authority = i || e, this.path = (function(O, w) {
          switch (O) {
            case "https":
            case "http":
            case "file":
              w ? w[0] !== n && (w = n + w) : w = n;
          }
          return w;
        })(this.scheme, s || e), this.query = p || e, this.fragment = g || e, t(this, u));
      }
      static isUri(r) {
        return r instanceof f || !!r && typeof r.authority == "string" && typeof r.fragment == "string" && typeof r.path == "string" && typeof r.query == "string" && typeof r.scheme == "string" && typeof r.fsPath == "string" && typeof r.with == "function" && typeof r.toString == "function";
      }
      get fsPath() {
        return x(this);
      }
      with(r) {
        if (!r) return this;
        let { scheme: i, authority: s, path: p, query: g, fragment: u } = r;
        return i === void 0 ? i = this.scheme : i === null && (i = e), s === void 0 ? s = this.authority : s === null && (s = e), p === void 0 ? p = this.path : p === null && (p = e), g === void 0 ? g = this.query : g === null && (g = e), u === void 0 ? u = this.fragment : u === null && (u = e), i === this.scheme && s === this.authority && p === this.path && g === this.query && u === this.fragment ? this : new l(i, s, p, g, u);
      }
      static parse(r, i = !1) {
        const s = o.exec(r);
        return s ? new l(s[2] || e, j(s[4] || e), j(s[5] || e), j(s[7] || e), j(s[9] || e), i) : new l(e, e, e, e, e);
      }
      static file(r) {
        let i = e;
        if (y && (r = r.replace(/\\/g, n)), r[0] === n && r[1] === n) {
          const s = r.indexOf(n, 2);
          s === -1 ? (i = r.substring(2), r = n) : (i = r.substring(2, s), r = r.substring(s) || n);
        }
        return new l("file", i, r, e, e);
      }
      static from(r) {
        const i = new l(r.scheme, r.authority, r.path, r.query, r.fragment);
        return t(i, !0), i;
      }
      toString(r = !1) {
        return _(this, r);
      }
      toJSON() {
        return this;
      }
      static revive(r) {
        if (r) {
          if (r instanceof f) return r;
          {
            const i = new l(r);
            return i._formatted = r.external, i._fsPath = r._sep === h ? r.fsPath : null, i;
          }
        }
        return r;
      }
    }
    const h = y ? 1 : void 0;
    class l extends f {
      constructor() {
        super(...arguments);
        I(this, "_formatted", null);
        I(this, "_fsPath", null);
      }
      get fsPath() {
        return this._fsPath || (this._fsPath = x(this)), this._fsPath;
      }
      toString(i = !1) {
        return i ? _(this, !0) : (this._formatted || (this._formatted = _(this, !1)), this._formatted);
      }
      toJSON() {
        const i = { $mid: 1 };
        return this._fsPath && (i.fsPath = this._fsPath, i._sep = h), this._formatted && (i.external = this._formatted), this.path && (i.path = this.path), this.scheme && (i.scheme = this.scheme), this.authority && (i.authority = this.authority), this.query && (i.query = this.query), this.fragment && (i.fragment = this.fragment), i;
      }
    }
    const c = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" };
    function v(a, r, i) {
      let s, p = -1;
      for (let g = 0; g < a.length; g++) {
        const u = a.charCodeAt(g);
        if (u >= 97 && u <= 122 || u >= 65 && u <= 90 || u >= 48 && u <= 57 || u === 45 || u === 46 || u === 95 || u === 126 || r && u === 47 || i && u === 91 || i && u === 93 || i && u === 58) p !== -1 && (s += encodeURIComponent(a.substring(p, g)), p = -1), s !== void 0 && (s += a.charAt(g));
        else {
          s === void 0 && (s = a.substr(0, g));
          const O = c[u];
          O !== void 0 ? (p !== -1 && (s += encodeURIComponent(a.substring(p, g)), p = -1), s += O) : p === -1 && (p = g);
        }
      }
      return p !== -1 && (s += encodeURIComponent(a.substring(p))), s !== void 0 ? s : a;
    }
    function d(a) {
      let r;
      for (let i = 0; i < a.length; i++) {
        const s = a.charCodeAt(i);
        s === 35 || s === 63 ? (r === void 0 && (r = a.substr(0, i)), r += c[s]) : r !== void 0 && (r += a[i]);
      }
      return r !== void 0 ? r : a;
    }
    function x(a, r) {
      let i;
      return i = a.authority && a.path.length > 1 && a.scheme === "file" ? `//${a.authority}${a.path}` : a.path.charCodeAt(0) === 47 && (a.path.charCodeAt(1) >= 65 && a.path.charCodeAt(1) <= 90 || a.path.charCodeAt(1) >= 97 && a.path.charCodeAt(1) <= 122) && a.path.charCodeAt(2) === 58 ? a.path[1].toLowerCase() + a.path.substr(2) : a.path, y && (i = i.replace(/\//g, "\\")), i;
    }
    function _(a, r) {
      const i = r ? d : v;
      let s = "", { scheme: p, authority: g, path: u, query: O, fragment: w } = a;
      if (p && (s += p, s += ":"), (g || p === "file") && (s += n, s += n), g) {
        let b = g.indexOf("@");
        if (b !== -1) {
          const E = g.substr(0, b);
          g = g.substr(b + 1), b = E.lastIndexOf(":"), b === -1 ? s += i(E, !1, !1) : (s += i(E.substr(0, b), !1, !1), s += ":", s += i(E.substr(b + 1), !1, !0)), s += "@";
        }
        g = g.toLowerCase(), b = g.lastIndexOf(":"), b === -1 ? s += i(g, !1, !0) : (s += i(g.substr(0, b), !1, !0), s += g.substr(b));
      }
      if (u) {
        if (u.length >= 3 && u.charCodeAt(0) === 47 && u.charCodeAt(2) === 58) {
          const b = u.charCodeAt(1);
          b >= 65 && b <= 90 && (u = `/${String.fromCharCode(b + 32)}:${u.substr(3)}`);
        } else if (u.length >= 2 && u.charCodeAt(1) === 58) {
          const b = u.charCodeAt(0);
          b >= 65 && b <= 90 && (u = `${String.fromCharCode(b + 32)}:${u.substr(2)}`);
        }
        s += i(u, !0, !1);
      }
      return O && (s += "?", s += i(O, !1, !1)), w && (s += "#", s += r ? w : v(w, !1, !1)), s;
    }
    function T(a) {
      try {
        return decodeURIComponent(a);
      } catch {
        return a.length > 3 ? a.substr(0, 3) + T(a.substr(3)) : a;
      }
    }
    const z = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
    function j(a) {
      return a.match(z) ? a.replace(z, ((r) => T(r))) : a;
    }
    var B = C(470);
    const U = B.posix || B, $ = "/";
    var k;
    (function(a) {
      a.joinPath = function(r, ...i) {
        return r.with({ path: U.join(r.path, ...i) });
      }, a.resolvePath = function(r, ...i) {
        let s = r.path, p = !1;
        s[0] !== $ && (s = $ + s, p = !0);
        let g = U.resolve(s, ...i);
        return p && g[0] === $ && !r.authority && (g = g.substring(1)), r.with({ path: g });
      }, a.dirname = function(r) {
        if (r.path.length === 0 || r.path === $) return r;
        let i = U.dirname(r.path);
        return i.length === 1 && i.charCodeAt(0) === 46 && (i = ""), r.with({ path: i });
      }, a.basename = function(r) {
        return U.basename(r.path);
      }, a.extname = function(r) {
        return U.extname(r.path);
      };
    })(k || (k = {}));
  })(), L = R;
})();
const { URI: F, Utils: M } = L;
export {
  F as URI,
  M as Utils
};
