export const visual2DEditorPageUrl = `${import.meta.env.VITE_VIEW_URL}/`;

export const visual2DPreviewPageUrl = `${import.meta.env.VITE_VIEW_URL}/preview`;

/**
 * 实时监测和大屏等模块与其可视化 Iframe 内嵌网页通信的消息前缀
 */
export const visual2DMsgPrefix = 'hvac-visual-2d';

/**
 * 实时监测和大屏模块与其可视化 Iframe 内嵌网页通信的消息类型
 */
export const enum Visual2DMsgType {
  EditLoaded = 'edit-loaded',
  CloseEditor = 'close-editor',
  SendDeviceData = 'send-device-data',
  SendDeviceIds = 'send-device-ids',
  SaveModule = 'save-module',
  SaveModuleFailed = 'save-module-failed',
  OpenDevCtrlModal = 'open-dev-ctrl-modal',
  PreviewLoaded = 'preview-loaded',
  PreviewClicked = 'preview-clicked',
  ExportImg = 'export-img',
}

export const getVisual2DMsgType = (type: Visual2DMsgType) => {
  return visual2DMsgPrefix + '-' + type;
};
