(function() { Rev.registerComponent('TabsAccordion', { getDefaultProps: function() { var props; return props = { onChange: function() {}, activeKey: null }; }, getInitialState: function() { var activeTabKey, children, state; children = this.getNormalizedChildren(); activeTabKey = this.props.activeKey; if (children.length > 0) { activeTabKey || (activeTabKey = children[0].key); } return state = { activeTabKey: activeTabKey }; }, render: function() { var children; children = this.getNormalizedChildren(); return React.createElement("ul", { "className": "RevAccordion accordion" }, children.map(this.renderChild)); }, renderChild: function(child) { var active, className, content, key, tab; key = child.key; active = key === this.state.activeTabKey; className = this.classSet({ "RevTabsAccordion": true, "RevTabsAccordion is-active": true, "accordion-navigation": true, "active": active }); tab = React.addons.cloneWithProps(child.props.tab, { onClick: this.handleTabClick(child) }); content = React.addons.cloneWithProps(child, { active: active }); return React.createElement("li", { "key": key, "className": className }, tab, content); }, handleTabClick: function(activeTab) { return (function(_this) { return function(e) { e.preventDefault(); e.stopPropagation(); _this.setState({ activeTabKey: activeTab.key }); e.activeTab = activeTab; return _this.props.onChange(e); }; })(this); } }); }).call(this);