import f from "./index-classCallCheck.js";
import m from "./index-createClass.js";
import n from "./index-assertThisInitialized.js";
import b from "./index-inherits.js";
import u from "./index-createSuper.js";
import s from "./index-defineProperty.js";
import { Parser as c } from "./index-Parser4.js";
import { dayPeriodEnumToHours as p } from "./index-utils12.js";
var M = /* @__PURE__ */ (function(d) {
  b(o, d);
  var a = u(o);
  function o() {
    var e;
    f(this, o);
    for (var t = arguments.length, i = new Array(t), r = 0; r < t; r++)
      i[r] = arguments[r];
    return e = a.call.apply(a, [this].concat(i)), s(n(e), "priority", 80), s(n(e), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]), e;
  }
  return m(o, [{
    key: "parse",
    value: function(t, i, r) {
      switch (i) {
        case "b":
        case "bb":
        case "bbb":
          return r.dayPeriod(t, {
            width: "abbreviated",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbbb":
          return r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
        case "bbbb":
        default:
          return r.dayPeriod(t, {
            width: "wide",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "abbreviated",
            context: "formatting"
          }) || r.dayPeriod(t, {
            width: "narrow",
            context: "formatting"
          });
      }
    }
  }, {
    key: "set",
    value: function(t, i, r) {
      return t.setUTCHours(p(r), 0, 0, 0), t;
    }
  }]), o;
})(c);
export {
  M as AMPMMidnightParser
};
