import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import{useState as e,useEffect as i,useRef as o}from"react";import n from"react-dom";import{isEqual as s}from"lodash";import{MuiThemeProvider as l}from"@material-ui/core/styles";import m from"../components/FiltersToggler.js";import{getStartComponent as h,getMiddleComponent as c,getEndComponents as u}from"../utils.js";import{LARGE_SIZE_LAYOUT as a,MEDIUM_SIZE_LAYOUT as p,SMALL_SIZE_LAYOUT as d}from"../constants.js";import{darkTheme as f}from"../../../config/theme/index.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/helpers/typeof";import"@babel/runtime/regenerator";import"highcharts-v8";import"highcharts-v8/highcharts-more";import"highcharts-v8/modules/solid-gauge";import"highcharts-v8/modules/heatmap";import"highcharts-v8/modules/boost";import"highcharts-v8/modules/exporting";import"highcharts-v8/modules/xrange";import"highcharts-v8/modules/dumbbell";import"highcharts-v8/modules/pattern-fill";import"highcharts-multicolor-series-v8";import"highcharts";import"highcharts/highcharts-more";import"highcharts/modules/solid-gauge";import"highcharts/modules/heatmap";import"highcharts/modules/boost";import"highcharts/modules/exporting";import"highcharts/modules/xrange";import"highcharts/modules/dumbbell";import"highcharts/modules/pattern-fill";import"highcharts-multicolor-series";import"dompurify";import"../../../config/mapbox/index.js";import"../../../clients/subscriptions/constants.js";import"../../../clients/subscriptions.v1.js";import"../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../config/extendNative.js";import{jsx as g}from"react/jsx-runtime";function v(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,i)}return e}function b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?v(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}return t}function y(r,o,n,s){var l=e(null),m=t(l,2),f=m[0],g=m[1];return i((function(){if(s&&o){var t=h(r),e=c(r),i=u(r),l=t&&e&&!i,m=t&&!e&&i,f=t&&e&&i;if(t&&!e&&!i){var v=o[t.key];if(v<=s)return void g(a);if(v<=s/2)return void g(p)}else if(l||m){var b=o[t.key],y=l?o[e.key]:o[i.key];if(b+y<=s)return void g(a);if(n+y<=s)return void g(p)}else if(f){var j=o[t.key],O=o[e.key],k=o[i.key];if(j+O+k<=s)return void g(a);if(n+O+k<=s)return void g(p);if(n+k<=s)return void g(d)}g(d)}}),[o,s]),f}function j(n){var l=o(),m=e(null),h=t(m,2),c=h[0],u=h[1],a=o({}),p=n.filter((function(r){return!!r})),d=g("div",{ref:l,style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:p.map((function(r,t){return g("div",{"data-key":null==r?void 0:r.key,style:{position:"absolute"},children:r},t)}))});return i((function(){var t;if(!s(p,a.current)){var e=Array.from(null===(t=l.current)||void 0===t?void 0:t.childNodes).reduce((function(t,e){var i,o=null==e||null===(i=e.getAttribute)||void 0===i?void 0:i.call(e,"data-key"),n=null==e?void 0:e.getBoundingClientRect().width;return b(b({},t),{},r({},o,n))}),{});Object.values(e).length===p.length&&(s(c,e)||u(e)),a.current=p}})),{componentsWidth:c,hiddenElements:d}}function O(){var r=e(null),o=t(r,2),s=o[0],h=o[1];return i((function(){var r=document.createElement("div");r.style.position="absolute",r.style.visibility="hidden",document.body.appendChild(r),n.render(g(l,{theme:f,children:g(m,{})}),r,(function(){var t=r.getBoundingClientRect();r.remove(),h(t.width)}))}),[]),s}export{O as useAppFilterTogglerWidth,j as useComonentsWidth,y as useFilterLayout};
//# sourceMappingURL=index.js.map
