import { __require as p } from "./index-window2.js";
var f, l;
function c() {
  if (l) return f;
  l = 1;
  var h = p(), v = function(e, i) {
    return i === void 0 && (i = !1), function(n, t, r) {
      if (n) {
        e(n);
        return;
      }
      if (t.statusCode >= 400 && t.statusCode <= 599) {
        var a = r;
        if (i)
          if (h.TextDecoder) {
            var o = d(t.headers && t.headers["content-type"]);
            try {
              a = new TextDecoder(o).decode(r);
            } catch {
            }
          } else
            a = String.fromCharCode.apply(null, new Uint8Array(r));
        e({
          cause: a
        });
        return;
      }
      e(null, r);
    };
  };
  function d(u) {
    return u === void 0 && (u = ""), u.toLowerCase().split(";").reduce(function(e, i) {
      var n = i.split("="), t = n[0], r = n[1];
      return t.trim() === "charset" ? r.trim() : e;
    }, "utf-8");
  }
  return f = v, f;
}
export {
  c as __require
};
