import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["children", "lookControls"];

/* eslint-disable @typescript-eslint/no-unsafe-member-access */

/* eslint-disable @typescript-eslint/no-unsafe-argument */

/* eslint-disable @typescript-eslint/no-unsafe-assignment */

/* eslint-disable no-undef */

/* eslint-disable func-names */
import React from 'react';
import { toProps } from '../core';

function toCameraProps(_ref) {
  var far = _ref.far,
      fov = _ref.fov,
      _ref$lookControlsEnab = _ref.lookControlsEnabled,
      lookControlsEnabled = _ref$lookControlsEnab === void 0 ? true : _ref$lookControlsEnab,
      near = _ref.near,
      reverseMouseDrag = _ref.reverseMouseDrag,
      _ref$wasdControlsEnab = _ref.wasdControlsEnabled,
      wasdControlsEnabled = _ref$wasdControlsEnab === void 0 ? false : _ref$wasdControlsEnab;
  return {
    far: far,
    fov: fov,
    'look-controls-enabled': lookControlsEnabled,
    near: near,
    'reverse-mouse-drag': reverseMouseDrag,
    'wasd-controls-enabled': wasdControlsEnabled
  };
}
/**
 * The camera primitive determines what the user sees.
 * We can change the viewport by modifying the camera entity’s position and rotation.
 *
 * @see https://aframe.io/docs/1.3.0/primitives/a-camera.html
 *
 * @example
 * ```tsx
 * <Scene>
 *   <Box />
 *   <Camera />
 * </Scene>
 * ```
 */


export var Camera = function Camera(props) {
  var cameraKeys = ['far', 'fov', 'lookControlsEnabled', 'near', 'reverseMouseDrag', 'wasdControlsEnabled'];

  var children = props.children,
      _props$lookControls = props.lookControls,
      lookControls = _props$lookControls === void 0 ? {
    magicWindowTrackingEnabled: false,
    reverseMouseDrag: true,
    reverseTouchDrag: true
  } : _props$lookControls,
      restProps = _objectWithoutPropertiesLoose(props, _excluded);

  return /*#__PURE__*/React.createElement("a-camera", _extends({}, toProps(_extends({
    lookControls: lookControls
  }, restProps), cameraKeys), toCameraProps(restProps)), children);
};