"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[8604],{28846:(e,t,r)=>{r.d(t,{A:()=>A});var s=r(96540),i=r(47665),o=r(80116),n=r(1081),a=r(98837),h=r(91249),d=r(80145),l=r(95579),c=r(27577),p=r(40012),u=r(54111),m=r(11460),f=r(2445);function g(e){return e}const v=()=>null,y={id:"",className:"",preTransformProps:g,overrideTransformProps:void 0,postTransformProps:g,onRenderSuccess(){},onRenderFailure(){}},P=new u.A;class w extends s.PureComponent{constructor(...e){super(...e),this.container=void 0,this.processChartProps=(0,n.Mz)([e=>e.chartProps,e=>e.preTransformProps,e=>e.transformProps,e=>e.postTransformProps],((e,t=g,r=g,s=g)=>s(r(t(e))))),this.createLoadableRenderer=(0,n.Mz)([e=>e.chartType,e=>e.overrideTransformProps],((e,t)=>{if(e){const r=(0,m.A)({loader:{Chart:()=>(0,c.A)().getAsPromise(e),transformProps:t?()=>Promise.resolve(t):()=>(0,p.A)().getAsPromise(e)},loading:t=>this.renderLoading(t,e),render:this.renderChart});return r.preload(),r}return v})),this.renderChart=(e,t)=>{const{Chart:r,transformProps:s}=e,{chartProps:i,preTransformProps:o,postTransformProps:n}=t;return(0,f.Y)(r,{...this.processChartProps({chartProps:i,preTransformProps:o,transformProps:s,postTransformProps:n})})},this.renderLoading=(e,t)=>{const{error:r}=e;return r?(0,f.FD)("div",{className:"alert alert-warning",role:"alert",children:[(0,f.Y)("strong",{children:(0,l.t)("ERROR")})," ",(0,f.FD)("code",{children:['chartType="',t,'"']})," —",r.toString()]}):null},this.setRef=e=>{this.container=e}}render(){const{id:e,className:t,preTransformProps:r,postTransformProps:s,chartProps:i=P,onRenderSuccess:o,onRenderFailure:n}=this.props,a=this.createLoadableRenderer(this.props);if(null===i)return null;const h={};return e&&(h.id=e),t&&(h.className=t),(0,f.Y)("div",{...h,ref:this.setRef,children:(0,f.Y)(a,{preTransformProps:r,postTransformProps:s,chartProps:i,onRenderSuccess:o,onRenderFailure:n})})}}w.defaultProps=y;var D=r(96453),R=r(17437);const S={maxWidth:800},C=D.I4.div`
  ${({theme:e,width:t,height:r})=>R.AH`
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    height: ${r}px;
    width: ${t}px;
    padding: ${4*e.gridUnit}px;

    & .no-results-title {
      font-size: ${e.typography.sizes.l}px;
      font-weight: ${e.typography.weights.bold};
      padding-bottom: ${2*e.gridUnit};
    }

    & .no-results-body {
      font-size: ${e.typography.sizes.m}px;
    }
  `}
`,b=({className:e,height:t,id:r,width:s})=>{const i="string"==typeof s||s>250,o=(0,l.t)("No results were returned for this query. If you expected results to be returned, ensure any filters are configured properly and the datasource contains data for the selected time range.");return(0,f.Y)(C,{height:t,width:s,className:e,id:r,title:i?void 0:o,children:(0,f.FD)("div",{style:S,children:[(0,f.Y)("div",{className:"no-results-title",children:(0,l.t)("No Results")}),i&&(0,f.Y)("div",{className:"no-results-body",children:o})]})})},T={FallbackComponent:function({error:e,height:t,width:r}){return(0,f.Y)("div",{css:e=>({backgroundColor:e.colors.grayscale.dark2,color:e.colors.grayscale.light5,overflow:"auto",padding:32}),style:{height:t,width:r},children:(0,f.FD)("div",{children:[(0,f.Y)("div",{children:(0,f.Y)("b",{children:(0,l.t)("Oops! An error occurred!")})}),(0,f.Y)("code",{children:e?e.toString():"Unknown Error"})]})})},height:400,width:"100%",enableNoResults:!0};class F extends s.PureComponent{constructor(...e){super(...e),this.core=void 0,this.createChartProps=u.A.createSelector(),this.parseDimension=(0,n.Mz)([({width:e})=>e,({height:e})=>e],((e,t)=>{const r=(0,h.A)(e),i=(0,h.A)(t),o={height:i.isDynamic?100*i.multiplier+"%":i.value,width:r.isDynamic?100*r.multiplier+"%":r.value};return{BoundingBox:r.isDynamic&&i.isDynamic&&1===r.multiplier&&1===i.multiplier?s.Fragment:({children:e})=>(0,f.Y)("div",{style:o,children:e}),heightInfo:i,widthInfo:r}})),this.setRef=e=>{this.core=e},this.getQueryCount=()=>{var e,t;return null!=(e=null==(t=(0,d.A)().get(this.props.chartType))?void 0:t.queryObjectCount)?e:1}}renderChart(e,t){const{id:r,className:s,chartType:o,preTransformProps:n,overrideTransformProps:a,postTransformProps:h,onRenderSuccess:d,onRenderFailure:l,disableErrorBoundary:c,FallbackComponent:p,onErrorBoundary:u,Wrapper:m,queriesData:g,enableNoResults:v,noResults:y,theme:P,...D}=this.props,R=this.createChartProps({...D,queriesData:g,height:t,width:e,theme:P});let S;if(!v||g&&!g.slice(0,this.getQueryCount()).every((({data:e})=>!e||Array.isArray(e)&&0===e.length))){const i=(0,f.Y)(w,{ref:this.setRef,id:r,className:s,chartType:o,chartProps:R,preTransformProps:n,overrideTransformProps:a,postTransformProps:h,onRenderSuccess:d,onRenderFailure:l});S=m?(0,f.Y)(m,{width:e,height:t,children:i}):i}else S=y||(0,f.Y)(b,{id:r,className:s,height:t,width:e});return!0===c?S:(0,f.Y)(i.tH,{FallbackComponent:r=>(0,f.Y)(p,{width:e,height:t,...r}),onError:u,children:S})}render(){const{heightInfo:e,widthInfo:t,BoundingBox:r}=this.parseDimension(this.props);if(t.isDynamic||e.isDynamic){const{debounceTime:s}=this.props;return(0,f.Y)(r,{children:(0,f.Y)(o.A,{debounceTime:s,children:({width:r,height:s})=>this.renderChart(t.isDynamic?Math.floor(r):t.value,e.isDynamic?Math.floor(s):e.value)})})}return this.renderChart(t.value,e.value)}}F.defaultProps=T;const A=(0,a.b)(F)},11460:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(53259),i=r.n(s);const o={onRenderFailure(){},onRenderSuccess(){}};function n(e){const t=i().Map(e);class r extends t{componentDidMount(){this.afterRender()}componentDidUpdate(){this.afterRender()}afterRender(){const{loaded:e,loading:t,error:r}=this.state,{onRenderFailure:s,onRenderSuccess:i}=this.props;t||(r?s(r):e&&Object.keys(e).length>0&&i())}}return r.defaultProps=void 0,r.defaultProps=o,r.preload=t.preload,r}},54111:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(1081),i=r(75451);const o=800,n=600;class a{constructor(e={}){this.annotationData=void 0,this.datasource=void 0,this.rawDatasource=void 0,this.initialValues=void 0,this.formData=void 0,this.rawFormData=void 0,this.height=void 0,this.hooks=void 0,this.ownState=void 0,this.filterState=void 0,this.legendState=void 0,this.queriesData=void 0,this.width=void 0,this.behaviors=void 0,this.displaySettings=void 0,this.appSection=void 0,this.isRefreshing=void 0,this.inputRef=void 0,this.inContextMenu=void 0,this.emitCrossFilters=void 0,this.theme=void 0;const{annotationData:t={},datasource:r={},formData:s={},hooks:a={},ownState:h={},filterState:d={},legendState:l,initialValues:c={},queriesData:p=[],behaviors:u=[],displaySettings:m={},width:f=o,height:g=n,appSection:v,isRefreshing:y,inputRef:P,inContextMenu:w=!1,emitCrossFilters:D=!1,theme:R}=e;this.width=f,this.height=g,this.annotationData=t,this.datasource=(0,i.A)(r),this.rawDatasource=r,this.formData=(0,i.A)(s),this.rawFormData=s,this.hooks=a,this.initialValues=c,this.queriesData=p,this.ownState=h,this.filterState=d,this.legendState=l,this.behaviors=u,this.displaySettings=m,this.appSection=v,this.isRefreshing=y,this.inputRef=P,this.inContextMenu=w,this.emitCrossFilters=D,this.theme=R}}a.createSelector=void 0,a.createSelector=function(){return(0,s.Mz)((e=>e.annotationData),(e=>e.datasource),(e=>e.formData),(e=>e.height),(e=>e.hooks),(e=>e.initialValues),(e=>e.queriesData),(e=>e.width),(e=>e.ownState),(e=>e.filterState),(e=>e.legendState),(e=>e.behaviors),(e=>e.displaySettings),(e=>e.appSection),(e=>e.isRefreshing),(e=>e.inputRef),(e=>e.inContextMenu),(e=>e.emitCrossFilters),(e=>e.theme),((e,t,r,s,i,o,n,h,d,l,c,p,u,m,f,g,v,y,P)=>new a({annotationData:e,datasource:t,formData:r,height:s,hooks:i,initialValues:o,queriesData:n,ownState:d,filterState:l,legendState:c,width:h,behaviors:p,displaySettings:u,appSection:m,isRefreshing:f,inputRef:g,inContextMenu:v,emitCrossFilters:y,theme:P})))}},91249:(e,t,r)=>{r.d(t,{A:()=>i});const s={isDynamic:!0,multiplier:1};function i(e){return"auto"===e||"100%"===e?s:"string"==typeof e&&e.length>0&&"%"===e[e.length-1]?{isDynamic:!0,multiplier:parseFloat(e)/100}:{isDynamic:!1,value:"number"==typeof e?e:parseFloat(e)}}},45905:(e,t,r)=>{r.d(t,{h:()=>o});var s=r(96540),i=r(83505);function o(e,t){const r=(0,i.Z)(e);(0,s.useEffect)((()=>{e!==r&&t(r,e)}),[e,r,t])}}}]);