import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/slicedToArray";import{useState as n,useEffect as o}from"react";import{TableColumns as c,ColumnType as i}from"../constants.js";function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function f(e){var p=n(null),f=t(p,2),b=f[0],a=f[1];return o((function(){if(e){var t=e.length<3?e.length:3,n=c.reduce((function(n,o){return o.type===i.metrics?e.reduce((function(e,n){return[].concat(r(e),[u(u({},o),{},{key:n,width:o.width[t]})])}),n):n.concat(u(u({},o),{},{width:o.width[t]}))}),[]);a(n)}}),[e]),b}export{f as useTableColumns};
