import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useEffect as n}from"react";import{sortBy as o,uniqBy as c}from"lodash";import{FILTERS as u}from"../constants.js";function i(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var l=Object.values(u);function p(u,i){var p=t({}),a=e(p,2),s=a[0],b=a[1];return n((function(){i&&b(l.reduce((function(e,t){return f(f({},e),{},r({},t,function(r,e,t,n){var u=e.reduce((function(r,e){return r.filter((function(r){return!t[e]||0===t[e].length||t[e].includes(r[e])}))}),n),i=o(c(u.map((function(e){return e[r]}))));return i.includes("Null")?i.filter((function(r){return"Null"!==r})).concat("Null"):i}(t,l.filter((function(r){return r!==t})),u,i)))}),{}))}),[u,i]),s}export{p as default};
