var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
import { b as bemMixin } from "./bem.js";
import { c as createIframeEvent } from "./create-iframe-event.js";
import { n as normalizeComponent } from "./index.js";
import { _ as __$_require_3a80dcdf__, a as __$_require_16177530__ } from "./index17.js";
import "vue";
import "./index18.js";
var __$_require_1595ff9c__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQwIDc5LjE2MDQ1MSwgMjAxNy8wNS8wNi0wMTowODoyMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlL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/MLQ/Kq9+yJU9P///8G4iioAAAJ+SURBVHja7NvpU9NAGIDxIChQQQu2csotl6KI4K1436IghyBegHiw+/9/lRkgu0wqDZ3S5H15no+bTDa/mcxkZ9MGVkkBECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgJSpcyYsCwQIkNRCqot2RwbEFK0ZCBAgB3az5uAuuFO7ipxa8ypJSDnLAgECJClIxqs7nHDdDX4SAvGrCycMCr4mgAABUgDy8EQZe5ogROJ2EBAgQIDs63TMWtIOifv6OwkEiALIGa9ceAtL3uhfGZBSNuiAAAFy7CBfmyL9EQmpil6wAQgQXZCzrsxweAsvvOEZGRCvZnPoRWM6Ib1KIO1GCWRQCWTovBJIjykM+VkbyZ2Xix5sdUcvRo9WANL3H8ipsn5EPHrIbE4J5INRArmqBNJmlECySiC/apVAWowSyA8lkPl3sSCdjTu5kYHGSL/d0Y3doYGKQd6YWJD6EtdaVZWC5PuVQO4bJZAVJZBb3UogW0YJJFACWetQAvlmdEBGOpVARo0SyIISyPJLJZAr3ibVpmTIIzdJX51gSL33PPVIhng714/HBENWvZ3rRSsY8sR7stolQ7rcFL1WMGRibt/HW7mQy963jCbJkGtuhmkrGOLvXH8pCRJkIr1OAHLbTXBppCRIvJ85HTXkrbtx89EKhnj/Fu64IRny3F3/s5UMeT8ZXv+eaMj22vfuzlqr9YFwiLVDU9+HjbluxUO2G3/W36ACYm0+rwSy17GDVMdsNO2QwwYECBAgQIAASQKSqoAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAaIV8k+AAQBgEvg+YNtBSgAAAABJRU5ErkJggg==";
var render$1 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("section", {
    class: _vm.bem()
  }, [_c("div", {
    class: _vm.bem("icon")
  }), _c("div", {
    class: _vm.bem("content")
  }, [_c("span", {
    class: _vm.bem("title")
  }, [_vm._v(" " + _vm._s(_vm.shareTitle) + " ")]), _c("div", {
    class: _vm.bem("desc")
  }, [_vm._v(" " + _vm._s(_vm.shareDesc) + " ")]), _c("div", {
    class: _vm.bem("pic")
  }, [_vm.data.cover_url ? _c("img", {
    attrs: {
      "src": _vm.data.cover_url,
      "alt": _vm.data.title
    }
  }) : _c("img", {
    attrs: {
      "alt": "\u9ED8\u8BA4\u5C01\u9762",
      "src": __$_require_1595ff9c__
    }
  })])])]);
};
var staticRenderFns$1 = [];
var shareView_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.em-editor-webpage-share-view{display:flex;justify-content:space-between;&__icon{width:56px;height:56px;margin-right:20px;color:#09c463;border-radius:12px;flex-shrink:0;background:url(data:image/png;base64, ) no-repeat center / cover}&__content{position:relative;display:flex;flex-direction:column;flex:1;height:108px;padding:12px;background:#fff;border:1px solid #DADDE1;border-radius:4px;&:after{content:" ";position:absolute;top:18px;left:-11px;width:20px;height:20px;border:1px solid #DADDE1;border-top:none;border-right:none;background:#fff;border-radius:0 0 0 2px;transform:rotate(45deg)}}&__title{height:20px;margin-bottom:8px;color:#000;font-size:14px;font-weight:600;line-height:20px;max-width:314px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}&__desc{flex:1;width:225px;color:#8d949e;font-size:14px;overflow:hidden;line-height:18px}&__pic{position:absolute;right:12px;bottom:12px;width:56px;height:56px;overflow:hidden;border:1px solid #DADDE1;img {dispaly: block; width: 100%; height: 100%;}}}\n')();
const __vue2_script$1 = {
  name: "em-editor-webpage-share-view",
  mixins: [bemMixin],
  props: {
    data: {
      type: Object,
      required: true
    }
  },
  data() {
    return {};
  },
  computed: {
    shareTitle() {
      return this.data.title || "\u672A\u547D\u540D";
    },
    shareDesc() {
      return this.data.description || "\u672A\u914D\u7F6E";
    }
  }
};
const __cssModules$1 = {};
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
function __vue2_injectStyles$1(context) {
  for (let o in __cssModules$1) {
    this[o] = __cssModules$1[o];
  }
}
var ShareView = /* @__PURE__ */ function() {
  return __component__$1.exports;
}();
var __$_require_abf59b50__ = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPG1hc2sgaWQ9Im1hc2swIiBtYXNrLXR5cGU9ImFscGhhIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgMEgyMFYyMEgwVjBaIiBmaWxsPSJ3aGl0ZSIvPgo8L21hc2s+CjxnIG1hc2s9InVybCgjbWFzazApIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy43OTQ4IDYuNjY2NzFDMTAuNzc0NCA2LjY3OTM4IDguMzI5NzIgOC42ODg2MSA3LjgxMDQ0IDExLjMyOTlDNy43MzgxMyAxMS41NTk0IDcuNjk4ODMgMTEuNzkzNiA3LjY5ODgzIDEyLjAzMTVDNy42OTg4MyAxMi4xMzUyIDcuNzAyMTUgMTIuMjM4NSA3LjcwODY0IDEyLjM0MTNMNy43MDg1IDEyLjM4MDlDNy43MDg1IDEyLjc0MjkgNy43NDM4NyAxMy4wOTcxIDcuODExNjUgMTMuNDQwM0M3LjY0MDQxIDEzLjQ1NTcgNy40NjkxNiAxMy40NjEgNy4yOTc5NCAxMy40NjFDNi42Mjk3MSAxMy40NjEgNi4wNjU5NyAxMy4zNDI4IDUuNDI4NDYgMTMuMjA5MUM1LjMwMTE4IDEzLjE4MjQgNS4xNzAzNyAxMy4xNTQ5IDUuMDM1NzggMTMuMTI3OE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C4xMjVMMTUuNzExMiAxNy4wODY5TDE1LjY1IDE3LjEwMzNDMTUuMDQyOSAxNy4yNjYxIDE0LjQyOTggMTcuNDMwNCAxMy44MjMxIDE3LjQzMDRDMTAuODI3MiAxNy40MzA0IDguNDcyMzggMTUuMTkzOCA4LjQ3MjM4IDEyLjQzMDVDOC40NzIzOCA5LjY3NDc3IDEwLjgyNzIgNy40MzA1MyAxMy44MjMxIDcuNDMwNTNaTTEyLjQ4MjggMTAuMzk5M0MxMi40ODI4IDEwLjc3MzIgMTIuMTgzNSAxMS4wNzY0IDExLjgxNDQgMTEuMDc2NEMxMS40NDUyIDExLjA3NjQgMTEuMTQ2IDEwLjc3MzIgMTEuMTQ2IDEwLjM5OTNDMTEuMTQ2IDEwLjAyNTMgMTEuNDQ1MiA5LjcyMjIgMTEuODE0NCA5LjcyMjJDMTIuMTgzNSA5LjcyMjIgMTIuNDgyOCAxMC4wMjUzIDEyLjQ4MjggMTAuMzk5M1pNMTUuMzc5MiAxMS4wNzY0QzE1Ljc0ODQgMTEuMDc2NCAxNi4wNDc2IDEwLjc3MzIgMTYuMDQ3NiAxMC4zOTkzQzE2LjA0NzYgMTAuMDI1MyAxNS43NDg0IDkuNzIyMiAxNS4zNzkyIDkuNzIyMkMxNS4wMTAxIDkuNzIyMiAxNC43MTA4IDEwLjAyNTMgMTQuNzEwOCAxMC4zOTkzQzE0LjcxMDggMTAuNzczMiAxNS4wMTAxIDExLjA3NjQgMTUuMzc5MiAxMS4wNzY0WiIgZmlsbD0iIzA1Q0I2NSIvPgo8L2c+Cjwvc3ZnPgo=";
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("section", {
    ref: "container",
    class: _vm.bem()
  }, [_c("div", {
    class: _vm.bem("editor-hideen-wrap")
  }, [_c("div", {
    ref: "editorWrap"
  })]), _c("div", {
    class: _vm.bem("inner"),
    style: _vm.boxStyle
  }, [_c("iframe", {
    ref: "inspect",
    class: _vm.bem("inspect"),
    style: _vm.boxStyle,
    attrs: {
      "id": "odyssey-inspect-page",
      "src": _vm.frameURL,
      "frameborder": "0"
    }
  }), !_vm.isFlow ? _c("div", {
    class: _vm.bem("paging")
  }, [_c("button", {
    class: _vm.bem("paging-item"),
    attrs: {
      "disabled": _vm.layoutIndex < 1
    },
    on: {
      "click": function($event) {
        return _vm.switchLayout(-1);
      }
    }
  }, [_c("img", {
    class: _vm.bem("paging-icon", ["prev"]),
    attrs: {
      "src": __$_require_3a80dcdf__
    }
  })]), _c("span", {
    class: _vm.bem("paging-item")
  }, [_vm._v(" " + _vm._s(_vm.pagingInfo) + " ")]), _c("button", {
    class: _vm.bem("paging-item"),
    attrs: {
      "disabled": _vm.layoutIndex >= _vm.pagingLength - 1
    },
    on: {
      "click": function($event) {
        return _vm.switchLayout(1);
      }
    }
  }, [_c("img", {
    class: _vm.bem("paging-icon", ["next"]),
    attrs: {
      "src": __$_require_3a80dcdf__
    }
  })])]) : _c("div", {
    class: _vm.bem("scroll")
  }, [_vm._v(" \u6EDA\u52A8\u9875\u9762\u5BA1\u67E5 ")])]), _c("div", {
    class: _vm.bem("preview")
  }, [_vm.webpageConfig.page ? _c("div", {
    class: _vm.bem("preview-item", ["share"])
  }, [_c("img", {
    attrs: {
      "src": __$_require_abf59b50__
    }
  }), _c("div", {
    class: _vm.bem("share-info"),
    style: _vm.shareStyle
  }, [_c("h3", {
    class: _vm.bem("share-info-title")
  }, [_vm._v(" \u5FAE\u4FE1\u5206\u4EAB\u6837\u5F0F\u9884\u89C8 ")]), _c("ShareView", {
    attrs: {
      "data": _vm.webpageConfig.page
    }
  })], 1)]) : _vm._e(), _c("div", {
    class: _vm.bem("preview-item"),
    on: {
      "click": _vm.handleFullClick
    }
  }, [!_vm.isFullScreen ? _c("img", {
    class: _vm.bem("icon"),
    attrs: {
      "src": __$_require_16177530__
    }
  }) : _vm._e(), _c("span", [_vm._v(_vm._s(_vm.isFullScreen ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F\u9884\u89C8"))])])])]);
};
var staticRenderFns = [];
var index_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.em-editor-webpage-view{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.em-editor-webpage-view__editor-hideen-wrap{position:fixed;top:0;left:300%;opacity:0;visibility:hidden}.em-editor-webpage-view__inner,.em-editor-webpage-view__inspect{position:relative;width:100%;height:100%}.em-editor-webpage-view__paging,.em-editor-webpage-view__scroll{position:absolute;top:50%;left:calc(100% + 16px);display:flex;flex-direction:column;align-items:center;overflow:hidden;width:40px;height:108px;padding:4px 0;color:#606770;background:#fff;box-shadow:0 2px 8px #0000001f;border-radius:20px;transform:translateY(-50%)}.em-editor-webpage-view__scroll{justify-content:center;font-size:12px;letter-spacing:2px;writing-mode:vertical-rl}.em-editor-webpage-view__paging-item{display:flex;justify-content:center;align-items:center;flex:1;width:40px;font-size:14px;background:#fff;border:none;outline:none;cursor:pointer}.em-editor-webpage-view__paging-item:disabled{cursor:not-allowed;opacity:.5}.em-editor-webpage-view__paging-icon{width:32px}.em-editor-webpage-view__paging-icon--prev{transform:rotate(90deg)}.em-editor-webpage-view__paging-icon--next{transform:rotate(-90deg)}.em-editor-webpage-view__preview{position:absolute;right:24px;bottom:24px;height:36px;line-height:36px;padding:0 15px;background:rgba(239,241,246,.9);border:1px solid rgba(0,0,0,.08);border-radius:4px;display:flex;justify-content:center;align-items:center;user-select:none;font-size:12px}.em-editor-webpage-view__preview-item{display:flex;align-items:center;color:#636c78;cursor:pointer}.em-editor-webpage-view__preview-item--share{height:14px;padding-right:16px;margin-right:16px;border-right:1px solid #636C78}.em-editor-webpage-view__preview-item--share:hover .em-editor-webpage-view__share-info{display:block;visibility:visible}.em-editor-webpage-view__icon{margin-right:4px}.em-editor-webpage-view__share-info{width:486px;position:absolute;padding:24px;right:0;bottom:calc(100% + 8px);background:#FFFFFF;box-shadow:0 4px 12px #0000000a,0 8px 28px #0000000f,0 12px 48px #0000000a;border-radius:4px;display:none;visibility:hidden}.em-editor-webpage-view__share-info-title{font-weight:600;font-size:16px;color:#33383e;margin:0 0 24px}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const VIEW_WH_RATIO = 0.51;
const __vue2_script = {
  name: "em-editor-webpage-view",
  components: {
    ShareView
  },
  mixins: [bemMixin],
  props: {
    initEditor: {
      type: [Object, Function],
      default: () => null
    },
    editorOptions: {
      type: Object,
      default: () => ({})
    },
    webpage: {
      type: Object,
      required: true
    },
    templetContent: {
      type: Object,
      required: true
    },
    isFlowTemplet: {
      type: Boolean,
      default: false
    },
    isFullScreen: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      editor: null,
      boxStyle: {},
      shareStyle: {},
      layoutIndex: 0
    };
  },
  computed: {
    webpageConfig() {
      return Object.assign({ origin: "" }, this.webpage || {});
    },
    frameURL() {
      const { origin, org_code } = this.webpageConfig;
      return `${origin || ""}/odyssey/inspect?frame_source=1&from=saas&org_code=${org_code}`;
    },
    isFlow() {
      var _a;
      const { templetContent } = this;
      return ((_a = templetContent == null ? void 0 : templetContent.global) == null ? void 0 : _a.mode) === "flow";
    },
    pagingLength() {
      return this.templetContent ? this.templetContent.layouts.length : 0;
    },
    pagingInfo() {
      const {
        layoutIndex,
        pagingLength
      } = this;
      if (!pagingLength)
        return "";
      return `${layoutIndex + 1}/${pagingLength}`;
    }
  },
  watch: {
    editorOptions(v) {
      v && this.editor && this.editor.setOptions(v);
    }
  },
  mounted() {
    setTimeout(() => {
      this.initInnerBox();
      this.$nextTick(() => {
        this.initFrameSourece();
      });
    }, 80);
    this.initEditorInstance();
  },
  methods: {
    initEditorInstance() {
      if (this.initEditor) {
        const Editor = typeof this.initEditor === "function" ? this.initEditor : this.initEditor.constructor;
        this.editor = new Editor({
          el: this.$refs.editorWrap,
          propsData: {
            editorOptions: this.editorOptions
          }
        });
        window.editor = this.editor;
        this.initEditorFn();
      }
    },
    async initEditorFn() {
      const { templet } = this;
      let mode = "design";
      if (this.isFlowTemplet) {
        mode = "flow";
      }
      const editorData = this.templetContent || JSON.parse(templet.content);
      const editor = this.editor;
      editor.disableHotkey();
      const options = await this.getEditorOptions(this.editorOptions);
      editor.setOptions(__spreadValues({
        mode
      }, options));
      editor.$on("templetCreated", (e) => {
        this.$emit("templetCreated", e);
      });
      editor.$on("layoutLoaded", (layout) => {
        this.$emit("layoutLoaded", layout);
      });
      editor.setTemplet(editorData).then(() => {
        this.$emit("editorReady", editor);
      });
    },
    async getEditorOptions(options = {}) {
      return __spreadValues({
        padding: [50, 0, 50, 0],
        showGuider: false,
        showHover: false,
        showResizeGuider: false,
        fontLoadTimeout: 15 * 1e3,
        selector: false,
        bindHotkey: false,
        contextmenu: false,
        fontList: []
      }, options);
    },
    initInnerBox() {
      const { container } = this.$refs;
      const { height, width } = container.getBoundingClientRect();
      const viewHeight = Math.round(height * 0.8);
      const viewWidth = Math.round(viewHeight * VIEW_WH_RATIO);
      this.boxStyle = {
        width: `${viewWidth}px`,
        height: `${viewHeight}px`
      };
      this.shareStyle = {
        width: `${Math.min(width - 48, 486)}px`
      };
    },
    initFrameSourece() {
      const { inspect } = this.$refs;
      const iframeEvent = createIframeEvent(inspect.contentWindow);
      iframeEvent.$on("init-frame-sourece", () => {
        iframeEvent.$emit("post-frame-sourece", { content: JSON.parse(JSON.stringify(this.templetContent)) });
      });
      iframeEvent.$on("active-page", (index2) => {
        this.layoutIndex = index2;
      });
      this.iframeEvent = iframeEvent;
    },
    handleFullClick() {
      const fullScreen = !this.isFullScreen;
      this.$emit("fullChange", fullScreen);
      setTimeout(() => {
        if (fullScreen) {
          this.boxStyle = {
            width: "100%",
            height: "100%"
          };
        } else {
          this.initInnerBox();
        }
      }, 200);
    },
    switchLayout(step) {
      this.iframeEvent.$emit("switch-page", step);
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var index = /* @__PURE__ */ function() {
  return __component__.exports;
}();
export { index as default };
