import y from "./index-classCallCheck.js";
import w from "./index-createClass.js";
import u from "./index-assertThisInitialized.js";
import d from "./index-inherits.js";
import h from "./index-createSuper.js";
import c from "./index-defineProperty.js";
import { Parser as v } from "./index-Parser4.js";
import { mapValue as l, parseNDigits as x } from "./index-utils12.js";
import b from "./index-setUTCDay.js";
var N = /* @__PURE__ */ (function(m) {
  d(a, m);
  var n = h(a);
  function a() {
    var o;
    y(this, a);
    for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++)
      t[e] = arguments[e];
    return o = n.call.apply(n, [this].concat(t)), c(u(o), "priority", 90), c(u(o), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]), o;
  }
  return w(a, [{
    key: "parse",
    value: function(r, t, e, i) {
      var s = function(f) {
        var p = Math.floor((f - 1) / 7) * 7;
        return (f + i.weekStartsOn + 6) % 7 + p;
      };
      switch (t) {
        // 3
        case "e":
        case "ee":
          return l(x(t.length, r), s);
        // 3rd
        case "eo":
          return l(e.ordinalNumber(r, {
            unit: "day"
          }), s);
        // Tue
        case "eee":
          return e.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || e.day(r, {
            width: "short",
            context: "formatting"
          }) || e.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // T
        case "eeeee":
          return e.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // Tu
        case "eeeeee":
          return e.day(r, {
            width: "short",
            context: "formatting"
          }) || e.day(r, {
            width: "narrow",
            context: "formatting"
          });
        // Tuesday
        case "eeee":
        default:
          return e.day(r, {
            width: "wide",
            context: "formatting"
          }) || e.day(r, {
            width: "abbreviated",
            context: "formatting"
          }) || e.day(r, {
            width: "short",
            context: "formatting"
          }) || e.day(r, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "validate",
    value: function(r, t) {
      return t >= 0 && t <= 6;
    }
  }, {
    key: "set",
    value: function(r, t, e, i) {
      return r = b(r, e, i), r.setUTCHours(0, 0, 0, 0), r;
    }
  }]), a;
})(v);
export {
  N as LocalDayParser
};
