var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var addEventListener_exports = {};
__export(addEventListener_exports, {
  ADD_EVENT_LISTENER_METADATA_KEY: () => ADD_EVENT_LISTENER_METADATA_KEY,
  addEventListener: () => addEventListener,
  getAddEventListenerMetadata: () => getAddEventListenerMetadata
});
module.exports = __toCommonJS(addEventListener_exports);
var import_ReflectUtils = require("@dooboostore/core/reflect/ReflectUtils");
const ADD_EVENT_LISTENER_METADATA_KEY = Symbol("simple-web-component:add-event-listener");
function addEventListener(arg1, arg2) {
  return (target, propertyKey, descriptor) => {
    const constructor = target.constructor;
    const options = typeof arg1 === "string" ? { type: arg1, query: arg2 } : arg1;
    let listeners = import_ReflectUtils.ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
    if (!listeners) {
      listeners = [];
      import_ReflectUtils.ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);
    }
    listeners.push({ options, propertyKey });
  };
}
const getAddEventListenerMetadata = (target) => {
  const constructor = target instanceof Function ? target : target.constructor;
  return import_ReflectUtils.ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
};
//# sourceMappingURL=addEventListener.js.map
