"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.clickUrl = void 0;

var __assign = void 0 && (void 0).__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

var isDesignMode = function isDesignMode() {
  return window.magicDesign.mode === 'designer';
};

exports.isDesignMode = isDesignMode;

var isPc = function isPc() {
  return window.magicDesign.device === 'pc';
};

exports.isPc = isPc;

var setMagicDesign = function setMagicDesign(magicDesignObj) {
  window.magicDesign = __assign(__assign({}, window.magicDesign), magicDesignObj);
};

exports.setMagicDesign = setMagicDesign;

var clickUrl = function clickUrl(url) {
  console.log('---click', url);
};
/** 刷新预览区域 */


exports.clickUrl = clickUrl;

var renderPreview = function renderPreview() {
  var evt = new Event('render-view', {
    bubbles: false
  });
  window.document.dispatchEvent(evt);
};

exports.renderPreview = renderPreview;