import { defineComponent, ref, openBlock, createBlock, unref } from "vue";
import { S as SavePageEnum, $ as getSessionStorageInfo, s as setSessionStorage, n as StorageEnum, a0 as _sfc_main$1 } from "./index-e2623483.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "wrapper",
  setup(__props) {
    let key = ref(Date.now());
    [SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW].forEach((saveEvent) => {
      if (!window.opener)
        return;
      window.opener.addEventListener(saveEvent, async (e) => {
        const localStorageInfo = await getSessionStorageInfo();
        setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }]);
        key.value = Date.now();
      });
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$1, { key: unref(key) });
    };
  }
});
export {
  _sfc_main as default
};
