import _toConsumableArray from"babel-runtime/helpers/toConsumableArray";import _extends from"babel-runtime/helpers/extends";import*as React from"react";export function flatArray(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children",t=[];return function e(n){n.forEach(function(n){if(n[r]){var o=_extends({},n);delete o[r],t.push(o),n[r].length>0&&e(n[r])}else t.push(n)})}(e),t};export function treeMap(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return e.map(function(e,n){var o={};return e[t]&&(o[t]=treeMap(e[t],r,t)),_extends({},r(e,n),o)})};export function flatFilter(e,r){return e.reduce(function(e,t){if(r(t)&&e.push(t),t.children){var n=flatFilter(t.children,r);e.push.apply(e,_toConsumableArray(n))}return e},[])};export function normalizeColumns(e){var r=[];return React.Children.forEach(e,function(e){if(React.isValidElement(e)){var t=_extends({},e.props);e.key&&(t.key=e.key),e.type&&e.type.__ANT_TABLE_COLUMN_GROUP&&(t.children=normalizeColumns(t.children)),r.push(t)}}),r};