"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};

// index.ts
var react_scanner_client_exports = {};
__export(react_scanner_client_exports, {
  add: () => add,
  default: () => react_scanner_client_default
});
module.exports = __toCommonJS(react_scanner_client_exports);
var rrweb = __toESM(require("rrweb"));
console.log("react-scanner-client");
window.getReactDomComponent = function(dom) {
  console.log("getReactDomComponent", dom);
  const internalInstance = (
    // @ts-ignore
    dom[Object.keys(dom != null ? dom : {}).find((key) => key.startsWith("__react"))]
  );
  if (!internalInstance)
    return null;
  return {
    internalInstance,
    props: internalInstance.memoizedProps,
    state: internalInstance.memoizedState
  };
};
var events = [];
var stop = rrweb.record({
  emit(event) {
    events.push(event);
  }
});
setInterval(() => {
  console.log({ events });
}, 1e3);
function init() {
  return __async(this, null, function* () {
    console.log("rrweb", rrweb);
    let events2 = [];
    const stop2 = rrweb.record({
      emit(event) {
        events2.push(event);
      }
    });
    setInterval(() => {
      console.log({ events: events2 });
    }, 1e3);
  });
}
var react_scanner_client_default = init;
var add = (a, b) => {
  return a + b;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  add
});
