"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const index = require("./components/PreviewRenderList/index.vue.js");
const utils = require("../../utils/utils.js");
require("../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../enums/pageEnum.js");
require("../../router/index.js");
const style$1 = require("../../utils/style.js");
require("../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../components/GoSkeleton/index.vue.js");
require("../../components/GoLoading/index.js");
require("../../settings/designSetting.js");
const style = require("./utils/style.js");
const storage = require("./utils/storage.js");
const keyboard = require("./utils/keyboard.js");
const drag = require("./utils/drag.js");
const useComInstall_hook = require("./hooks/useComInstall.hook.js");
const useScale_hook = require("./hooks/useScale.hook.js");
const useStore_hook = require("./hooks/useStore.hook.js");
const styleEnum = require("../../enums/styleEnum.js");
const chartEditStore = require("../../store/modules/chartEditStore/chartEditStore.js");
const runtimeCore_esmBundler = require("../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "suspenseIndex",
  async setup(__props) {
    let __temp, __restore;
    [__temp, __restore] = runtimeCore_esmBundler.withAsyncContext(() => storage.getSessionStorageInfo()), await __temp, __restore();
    const chartEditStore$1 = chartEditStore.useChartEditStore();
    utils.setTitle(`预览-${chartEditStore$1.editCanvasConfig.projectName}`);
    const previewRefStyle = runtimeCore_esmBundler.computed(() => {
      return {
        ...style.getEditCanvasConfigStyle(chartEditStore$1.editCanvasConfig),
        ...style$1.getFilterStyle(chartEditStore$1.editCanvasConfig)
      };
    });
    const showEntity = runtimeCore_esmBundler.computed(() => {
      const type = chartEditStore$1.editCanvasConfig.previewScaleType;
      return type === styleEnum.PreviewScaleEnum.SCROLL_Y || type === styleEnum.PreviewScaleEnum.SCROLL_X;
    });
    useStore_hook.useStore(chartEditStore$1);
    const { entityRef, previewRef } = useScale_hook.useScale(chartEditStore$1);
    const { show } = useComInstall_hook.useComInstall(chartEditStore$1);
    keyboard.keyRecordHandle();
    return (_ctx, _cache) => {
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
        class: shared_esmBundler.normalizeClass(`go-preview ${reactivity_esmBundler.unref(chartEditStore$1).editCanvasConfig.previewScaleType}`),
        onMousedown: _cache[0] || (_cache[0] = //@ts-ignore
        (...args) => reactivity_esmBundler.unref(drag.dragCanvas) && reactivity_esmBundler.unref(drag.dragCanvas)(...args))
      }, [
        showEntity.value ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
          key: 0,
          ref_key: "entityRef",
          ref: entityRef,
          class: "go-preview-entity"
        }, [
          runtimeCore_esmBundler.createElementVNode("div", {
            ref_key: "previewRef",
            ref: previewRef,
            class: "go-preview-scale"
          }, [
            reactivity_esmBundler.unref(show) ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
              key: 0,
              style: shared_esmBundler.normalizeStyle(previewRefStyle.value)
            }, [
              runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index.default))
            ], 4)) : runtimeCore_esmBundler.createCommentVNode("", true)
          ], 512)
        ], 512)) : (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
          key: 1,
          ref_key: "previewRef",
          ref: previewRef,
          class: "go-preview-scale"
        }, [
          reactivity_esmBundler.unref(show) ? (runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
            key: 0,
            style: shared_esmBundler.normalizeStyle(previewRefStyle.value)
          }, [
            runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index.default))
          ], 4)) : runtimeCore_esmBundler.createCommentVNode("", true)
        ], 512))
      ], 34);
    };
  }
});
exports.default = _sfc_main;
