'use strict';

exports.__esModule = true;
exports.title = exports.Preview = undefined;
exports.head = head;

var _ramda = require('ramda');

var _ramda2 = _interopRequireDefault(_ramda);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactSeeds = require('react-seeds');

var _reactSeeds2 = _interopRequireDefault(_reactSeeds);

var _spectacle = require('spectacle');

var _Vanilla = require('./Vanilla');

var Vanilla = _interopRequireWildcard(_Vanilla);

var _render = require('./render');

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var text = function text(tag, mentions, _text) {
	return _react2.default.createElement(_spectacle.Text, { children: _text });
};

var elementRendererForTags = _ramda2.default.cond([
// [ R.has('field'), R.curry(Vanilla.field) ],
// [ R.has('button'), R.curry(Vanilla.button) ],
// [ R.has('cta'), R.curry(Vanilla.cta) ],
// [ R.has('image'), R.curry(Vanilla.image) ],
// [ R.has('video'), R.curry(Vanilla.video) ],
[_ramda2.default.has('text'), _ramda2.default.curry(text)],
// [ R.has('swatch'), R.curry(Vanilla.swatch) ],
// [ R.has('nav'), R.curry(Vanilla.nav) ],
// [ R.has('columns'), R.curry(Vanilla.columns) ],
// [ R.has('list'), R.curry(Vanilla.list) ],
[_ramda2.default.T, _ramda2.default.curry(text)]]);

var Section = _react2.default.createClass({
	displayName: 'Section',
	getDefaultProps: function getDefaultProps() {
		return {
			transition: ['zoom']
		};
	},
	render: function render() {
		return _react2.default.createElement(_spectacle.Slide, this.props);
	}
});

var Master = function Master(_ref) {
	var children = _ref.children;
	return _react2.default.createElement(
		_spectacle.Spectacle,
		null,
		_react2.default.createElement(_spectacle.Deck, { children: children, transition: ['zoom'] })
	);
};

var Preview = exports.Preview = _ramda2.default.pipe((0, _render.renderTreeUsing)({
	elementRendererForTags: elementRendererForTags,
	Section: _spectacle.Slide,
	Master: Master
}));

var title = exports.title = 'Slides';

function head() {
	return _react2.default.createElement('head', null);
}