import p from "./index-classCallCheck.js";
import f from "./index-createClass.js";
import n from "./index-assertThisInitialized.js";
import c from "./index-inherits.js";
import l from "./index-createSuper.js";
import u from "./index-defineProperty.js";
import { Parser as h } from "./index-Parser4.js";
import { numericPatterns as C } from "./index-constants4.js";
import { parseNDigits as H, parseNumericPattern as P } from "./index-utils12.js";
var w = /* @__PURE__ */ (function(m) {
  c(s, m);
  var i = l(s);
  function s() {
    var o;
    p(this, s);
    for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
      e[t] = arguments[t];
    return o = i.call.apply(i, [this].concat(e)), u(n(o), "priority", 70), u(n(o), "incompatibleTokens", ["H", "K", "k", "t", "T"]), o;
  }
  return f(s, [{
    key: "parse",
    value: function(r, e, t) {
      switch (e) {
        case "h":
          return P(C.hour12h, r);
        case "ho":
          return t.ordinalNumber(r, {
            unit: "hour"
          });
        default:
          return H(e.length, r);
      }
    }
  }, {
    key: "validate",
    value: function(r, e) {
      return e >= 1 && e <= 12;
    }
  }, {
    key: "set",
    value: function(r, e, t) {
      var a = r.getUTCHours() >= 12;
      return a && t < 12 ? r.setUTCHours(t + 12, 0, 0, 0) : !a && t === 12 ? r.setUTCHours(0, 0, 0, 0) : r.setUTCHours(t, 0, 0, 0), r;
    }
  }]), s;
})(h);
export {
  w as Hour1to12Parser
};
