"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[868],{88274:(t,e,r)=>{r.d(e,{Z:()=>x});var s=r(73126),i=r(67294),o=r(47859),n=r(49302),a=r(22222),h=r(68135),l=r(80644),d=r(11064),c=r(61988),u=r(54085),p=r(74464),m=r(9330),f=r(89453),g=r(11965);function v(t){return t}const y=()=>null,P={id:"",className:"",preTransformProps:v,overrideTransformProps:void 0,postTransformProps:v,onRenderSuccess(){},onRenderFailure(){}},Z=new m.Z;class w extends i.PureComponent{constructor(...t){super(...t),this.container=void 0,this.processChartProps=(0,a.P1)([t=>t.chartProps,t=>t.preTransformProps,t=>t.transformProps,t=>t.postTransformProps],((t,e=v,r=v,s=v)=>s(r(e(t))))),this.createLoadableRenderer=(0,a.P1)([t=>t.chartType,t=>t.overrideTransformProps],((t,e)=>{if(t){const r=(0,f.Z)({loader:{Chart:()=>(0,u.Z)().getAsPromise(t),transformProps:e?()=>Promise.resolve(e):()=>(0,p.Z)().getAsPromise(t)},loading:e=>this.renderLoading(e,t),render:this.renderChart});return r.preload(),r}return y})),this.renderChart=(t,e)=>{const{Chart:r,transformProps:s}=t,{chartProps:i,preTransformProps:o,postTransformProps:n}=e;return(0,g.tZ)(r,this.processChartProps({chartProps:i,preTransformProps:o,transformProps:s,postTransformProps:n}))},this.renderLoading=(t,e)=>{const{error:r}=t;return r?(0,g.tZ)("div",{className:"alert alert-warning",role:"alert"},(0,g.tZ)("strong",null,(0,c.t)("ERROR"))," ",(0,g.tZ)("code",null,'chartType="',e,'"')," —",r.toString()):null},this.setRef=t=>{this.container=t}}render(){const{id:t,className:e,preTransformProps:r,postTransformProps:i,chartProps:o=Z,onRenderSuccess:n,onRenderFailure:a}=this.props,h=this.createLoadableRenderer(this.props);if(null===o)return null;const l={};return t&&(l.id=t),e&&(l.className=e),(0,g.tZ)("div",(0,s.Z)({},l,{ref:this.setRef}),(0,g.tZ)(h,{preTransformProps:r,postTransformProps:i,chartProps:o,onRenderSuccess:n,onRenderFailure:a}))}}w.defaultProps=P;var R=r(51995);const S={maxWidth:800},D=R.iK.div`
  ${({theme:t,width:e,height:r})=>g.iv`
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    height: ${r}px;
    width: ${e}px;
    padding: ${4*t.gridUnit}px;

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

    & .no-results-body {
      font-size: ${t.typography.sizes.m}px;
    }
  `}
`,C=({className:t,height:e,id:r,width:s})=>{const i="string"==typeof s||s>250,o=(0,c.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,g.tZ)(D,{height:e,width:s,className:t,id:r,title:i?void 0:o},(0,g.tZ)("div",{style:S},(0,g.tZ)("div",{className:"no-results-title"},(0,c.t)("No Results")),i&&(0,g.tZ)("div",{className:"no-results-body"},o)))},b={FallbackComponent:function({componentStack:t,error:e,height:r,width:s}){return(0,g.tZ)("div",{css:t=>({backgroundColor:t.colors.grayscale.dark2,color:t.colors.grayscale.light5,overflow:"auto",padding:32}),style:{height:r,width:s}},(0,g.tZ)("div",null,(0,g.tZ)("div",null,(0,g.tZ)("b",null,(0,c.t)("Oops! An error occurred!"))),(0,g.tZ)("code",null,e?e.toString():"Unknown Error")),t&&(0,g.tZ)("div",null,(0,g.tZ)("b",null,(0,c.t)("Stack Trace:")),(0,g.tZ)("code",null,t.split("\n").map((t=>(0,g.tZ)("div",{key:t},t))))))},height:400,width:"100%",enableNoResults:!0};class T extends i.PureComponent{constructor(...t){super(...t),this.core=void 0,this.createChartProps=m.Z.createSelector(),this.parseDimension=(0,a.P1)([({width:t})=>t,({height:t})=>t],((t,e)=>{const r=(0,l.Z)(t),s=(0,l.Z)(e),o={height:s.isDynamic?100*s.multiplier+"%":s.value,width:r.isDynamic?100*r.multiplier+"%":r.value};return{BoundingBox:r.isDynamic&&s.isDynamic&&1===r.multiplier&&1===s.multiplier?i.Fragment:({children:t})=>(0,g.tZ)("div",{style:o},t),heightInfo:s,widthInfo:r}})),this.setRef=t=>{this.core=t},this.getQueryCount=()=>{var t,e;return null!=(t=null==(e=(0,d.Z)().get(this.props.chartType))?void 0:e.queryObjectCount)?t:1}}renderChart(t,e){const{id:r,className:i,chartType:n,preTransformProps:a,overrideTransformProps:h,postTransformProps:l,onRenderSuccess:d,onRenderFailure:c,disableErrorBoundary:u,FallbackComponent:p,onErrorBoundary:m,Wrapper:f,queriesData:v,enableNoResults:y,noResults:P,theme:Z,...R}=this.props,S=this.createChartProps({...R,queriesData:v,height:e,width:t,theme:Z});let D;if(!y||v&&!v.slice(0,this.getQueryCount()).every((({data:t})=>!t||Array.isArray(t)&&0===t.length))){const s=(0,g.tZ)(w,{ref:this.setRef,id:r,className:i,chartType:n,chartProps:S,preTransformProps:a,overrideTransformProps:h,postTransformProps:l,onRenderSuccess:d,onRenderFailure:c});D=f?(0,g.tZ)(f,{width:t,height:e},s):s}else D=P||(0,g.tZ)(C,{id:r,className:i,height:e,width:t});return!0===u?D:(0,g.tZ)(o.ZP,{FallbackComponent:r=>(0,g.tZ)(p,(0,s.Z)({width:t,height:e},r)),onError:m},D)}render(){const{heightInfo:t,widthInfo:e,BoundingBox:r}=this.parseDimension(this.props);if(e.isDynamic||t.isDynamic){const{debounceTime:s}=this.props;return(0,g.tZ)(r,null,(0,g.tZ)(n.Z,{debounceTime:s},(({width:r,height:s})=>this.renderChart(e.isDynamic?Math.floor(r):e.value,t.isDynamic?Math.floor(s):t.value))))}return this.renderChart(e.value,t.value)}}T.defaultProps=b;const x=(0,h.b)(T)},89453:(t,e,r)=>{r.d(e,{Z:()=>n});var s=r(68356),i=r.n(s);const o={onRenderFailure(){},onRenderSuccess(){}};function n(t){const e=i().Map(t);class r extends e{componentDidMount(){this.afterRender()}componentDidUpdate(){this.afterRender()}afterRender(){const{loaded:t,loading:e,error:r}=this.state,{onRenderFailure:s,onRenderSuccess:i}=this.props;e||(r?s(r):t&&Object.keys(t).length>0&&i())}}return r.defaultProps=void 0,r.defaultProps=o,r.preload=e.preload,r}},9330:(t,e,r)=>{r.d(e,{Z:()=>a});var s=r(22222),i=r(78036);const o=800,n=600;class a{constructor(t={}){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:e={},datasource:r={},formData:s={},hooks:a={},ownState:h={},filterState:l={},legendState:d,initialValues:c={},queriesData:u=[],behaviors:p=[],displaySettings:m={},width:f=o,height:g=n,appSection:v,isRefreshing:y,inputRef:P,inContextMenu:Z=!1,emitCrossFilters:w=!1,theme:R}=t;this.width=f,this.height=g,this.annotationData=e,this.datasource=(0,i.Z)(r),this.rawDatasource=r,this.formData=(0,i.Z)(s),this.rawFormData=s,this.hooks=a,this.initialValues=c,this.queriesData=u,this.ownState=h,this.filterState=l,this.legendState=d,this.behaviors=p,this.displaySettings=m,this.appSection=v,this.isRefreshing=y,this.inputRef=P,this.inContextMenu=Z,this.emitCrossFilters=w,this.theme=R}}a.createSelector=void 0,a.createSelector=function(){return(0,s.P1)((t=>t.annotationData),(t=>t.datasource),(t=>t.formData),(t=>t.height),(t=>t.hooks),(t=>t.initialValues),(t=>t.queriesData),(t=>t.width),(t=>t.ownState),(t=>t.filterState),(t=>t.legendState),(t=>t.behaviors),(t=>t.displaySettings),(t=>t.appSection),(t=>t.isRefreshing),(t=>t.inputRef),(t=>t.inContextMenu),(t=>t.emitCrossFilters),(t=>t.theme),((t,e,r,s,i,o,n,h,l,d,c,u,p,m,f,g,v,y,P)=>new a({annotationData:t,datasource:e,formData:r,height:s,hooks:i,initialValues:o,queriesData:n,ownState:l,filterState:d,legendState:c,width:h,behaviors:u,displaySettings:p,appSection:m,isRefreshing:f,inputRef:g,inContextMenu:v,emitCrossFilters:y,theme:P})))}},80644:(t,e,r)=>{r.d(e,{Z:()=>i});const s={isDynamic:!0,multiplier:1};function i(t){return"auto"===t||"100%"===t?s:"string"==typeof t&&t.length>0&&"%"===t[t.length-1]?{isDynamic:!0,multiplier:parseFloat(t)/100}:{isDynamic:!1,value:"number"==typeof t?t:parseFloat(t)}}},28291:(t,e,r)=>{r.d(e,{S:()=>o});var s=r(67294),i=r(85716);function o(t,e){const r=(0,i.D)(t);(0,s.useEffect)((()=>{t!==r&&e(r,t)}),[t,r,e])}},78036:(t,e,r)=>{r.d(e,{Z:()=>l});var s=r(67523),i=r.n(s),o=r(68630),n=r.n(o),a=r(68929),h=r.n(a);function l(t){if(null==t)return t;if(n()(t))return i()(t,((t,e)=>h()(e)));throw new Error(`Cannot convert input that is not a plain object: ${t}`)}}}]);
//# sourceMappingURL=40b7f298fe6f97502ad9.chunk.js.map