class e {
  constructor() {
    this.validationMap = /* @__PURE__ */ new Map(), this.subscriber = /* @__PURE__ */ new Set();
  }
  set(i, t) {
    this.validationMap.set(i, t), this.notifySubscribers();
  }
  get(i) {
    return this.validationMap.get(i) || null;
  }
  delete(i) {
    return this.validationMap.delete(i);
  }
  clear() {
    this.validationMap = /* @__PURE__ */ new Map(), this.notifySubscribers();
  }
  listen(i) {
    this.subscriber.add(i);
  }
  unlisten(i) {
    this.subscriber.delete(i);
  }
  clearSubscriber() {
    this.subscriber = /* @__PURE__ */ new Set();
  }
  isValid(i) {
    return !this.validationMap.get(i);
  }
  isAllValid() {
    return this.validationMap.size === 0 ? !0 : Array.from(this.validationMap.values()).every((t) => t === null);
  }
  notifySubscribers() {
    Array.from(this.subscriber).forEach((i) => i());
  }
}
export {
  e as Validation
};
