import { removeFromViewport } from '../helpers';
import { toggleInspector, toggleSafeFrame, focusCamera, toggleRotateWidget, toggleMoveWidget, hideSelected, unhideAll, toggleCulling, modelToOrigin, toggleScaleWidget, toggleBoundingBoxWidget, toggleOrthographicViews, toggleTurntable } from '../actions';
const deletePayload = {
  payload: {
    deleteSelectedMesh: true
  }
};
export const shortcuts = {
  camera: [{
    name: 'focusCamera',
    key: 'C',
    action: () => focusCamera?.()
  }, {
    name: 'toggleSafeFrame',
    key: 'F',
    action: () => toggleSafeFrame?.()
  }, {
    name: 'orthoLeft',
    key: '1',
    action: e => toggleOrthographicViews(e, 'orthoLeft')
  }, {
    name: 'orthoRight',
    key: '2',
    action: e => toggleOrthographicViews(e, 'orthoRight')
  }, {
    name: 'orthoFront',
    key: '3',
    action: e => toggleOrthographicViews(e, 'orthoFront')
  }, {
    name: 'orthoBack',
    key: '4',
    action: e => toggleOrthographicViews(e, 'orthoBack')
  }, {
    name: 'orthoTop',
    key: '5',
    action: e => toggleOrthographicViews(e, 'orthoTop')
  }, {
    name: 'orthoBottom',
    key: '6',
    action: e => toggleOrthographicViews(e, 'orthoBottom')
  }],
  utilities: [{
    name: 'inspector',
    key: 'N',
    action: () => toggleInspector?.()
  }, {
    name: 'turntable',
    key: '/',
    action: (e, override) => toggleTurntable?.(override)
  }],
  viewport: [{
    name: 'moveWidget',
    key: 'M',
    action: () => toggleMoveWidget?.()
  }, {
    name: 'rotateWidget',
    key: 'R',
    action: () => toggleRotateWidget?.()
  }, {
    name: 'scaleWidget',
    key: 'S',
    action: () => toggleScaleWidget?.()
  }, {
    name: 'hideSelected',
    key: 'H',
    action: () => hideSelected?.()
  }, {
    name: 'unhideAll',
    key: 'U',
    action: () => unhideAll?.()
  }, {
    name: 'boundingBox',
    key: 'B',
    action: () => toggleBoundingBoxWidget?.()
  }, {
    name: 'deleteSelected',
    key: 'Delete',
    action: () => removeFromViewport(deletePayload)
  }],
  model: [{
    name: 'toggleCulling',
    key: 'c',
    action: () => toggleCulling?.()
  }, {
    name: 'modelToOrigin',
    key: 'O',
    action: () => modelToOrigin?.()
  }]
};