import { parseDigit as i } from "./index-parseDigits.js";
function u(r, e) {
  var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
  if (t) return (t = t.call(r)).next.bind(t);
  if (Array.isArray(r) || (t = f(r)) || e) {
    t && (r = t);
    var n = 0;
    return function() {
      return n >= r.length ? { done: !0 } : { done: !1, value: r[n++] };
    };
  }
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function f(r, e) {
  if (r) {
    if (typeof r == "string") return a(r, e);
    var t = Object.prototype.toString.call(r).slice(8, -1);
    if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return a(r, e);
  }
}
function a(r, e) {
  (e == null || e > r.length) && (e = r.length);
  for (var t = 0, n = new Array(e); t < e; t++)
    n[t] = r[t];
  return n;
}
function s(r) {
  for (var e = "", t = u(r.split("")), n; !(n = t()).done; ) {
    var o = n.value;
    e += l(o, e) || "";
  }
  return e;
}
function l(r, e) {
  return r === "+" ? e ? void 0 : "+" : i(r);
}
export {
  s as default,
  l as parsePhoneNumberCharacter
};
