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