"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),V=require("react"),Z=require("semantic-ui-react"),K=require("react-redux"),Q=require("../data/DataConsumer.js"),S=require("../reducers/data.js"),q=require("../utils/parseUtils.js"),W=require("./DataProvider.js"),X=require("./BigNumberGroup.js"),Y=r=>{const{editing:d=!1,unique:n,intl:p,"data-csv":f="","data-dimension1":t="none","data-dimension2":s="none","data-dvz-proxy-dataset-id":c,"data-no-data-message":F="No data matches your selection","data-view-mode":b="info","data-height":o,"data-app":a,"data-measures":m="{}","data-group":x,"data-parent":l,"data-block-name":i,"data-filters":C="[]","data-number-font-size":P=20,"data-label-font-size":k=20,"data-unselected-number-color":w="#000000","data-unselected-label-color":z="#000000","data-unselected-background-color":I="#fdfdfdff","data-number-color":y="#000000","data-label-color":A="#000000","data-background-color":M="#ffffffff","data-label":N="","data-wait-for-filters":B="false","data-n-columns":D=4,"data-sort":R="alpha","data-order":G="asc","data-show-zero-values":U="false",hasParentFilters:J,effectiveFilter:E,appliedFilters:O,parentAppliedFilters:T,onSetFilter:_,onUnSetFilter:$}=r,H=V.useRef(null),L=d?o-80:o-40,v={dvzProxyDatasetId:c},h=q.parse(C)||{};h&&h.forEach&&h.forEach(u=>{u.value!=null&&u.value.filter(j=>j!=null&&j.toString().trim()!="").length>0&&(v[u.param]=u.value)});const g=[];return t!="none"&&g.push(t),s!="none"&&g.push(s),e.jsx("div",{ref:H,children:e.jsxs(Z.Container,{fluid:!0,style:{padding:"0px",margin:"0px",height:`${o}px`},children:[(!a||a==="csv")&&e.jsxs("p",{children:[e.jsx("h2",{children:"Big Filter:"}),e.jsx("h4",{children:"Please select an API! "})]}),a!=="csv"&&t=="none"&&e.jsxs("p",{children:[e.jsx("h2",{children:"Big Filter:"}),e.jsx("h4",{children:"Please select dimension! "})]}),a&&t!="none"&&e.jsx(W.default,{style:{height:`${L}px`},blockName:i,params:v,app:a,useAncestor:!0,parent:l,editing:d,waitForFilters:B==="true",store:[a,n],source:g.join("/"),children:e.jsx(Q.default,{noDataMessage:e.jsx("h1",{children:"No data"}),children:e.jsx(X.default,{nColumns:D,parent:l,sort:R,order:G,showZeroValues:U,onSetFilter:_,onUnSetFilter:$,appliedFilters:O,height:o,intl:p,app:a,group:x,blockName:i,measures:q.parse(m),label:N,numberFontSize:P,labelFontSize:k,numberColor:y,labelColor:A,backgroundColor:M,unselectedNumberColor:w,unselectedLabelColor:z,unselectedBackgroundColor:I,hasParentFilters:J,effectiveFilter:E,parentAppliedFilters:T,dimension1:t,dimension2:s})})})]})})},ee=(r,d)=>{const{"data-app":n,"data-group":p,"data-block-name":f,"data-parent":t,"data-dimension1":s}=d,c=p,F=t||f+Math.random(0,1),b=f,o=r.getIn(["data","filters",n,b]),a=t!=""&&t!=null,m=r.getIn(["data","filters",n,c])?r.getIn(["data","filters",n,c]).toJS():{};let l=(a?r.getIn(["data","filters",n,F]):null)?Object.values(r.getIn(["data","filters",n,t]).toJS())[0]:[],i=o?o.toJS()[s]:[];return{hasParentFilters:a,effectiveFilter:m,parentAppliedFilters:l||[],appliedFilters:i||[]}},te={onSetFilter:S.setFilter,onUnSetFilter:S.unsetFilter},ae=K.connect(ee,te)(Y);exports.default=ae;
