"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3193],{16737:(e,t,i)=>{function r(e){return e.map((e=>[e,e.toString()]))}function n(e,t){return`${e}__${t}`}i.d(t,{mG:()=>r,n_:()=>n})},61819:(e,t,i)=>{i.d(t,{Z:()=>d});var r=i(21804),n=i.n(r),o=(i(67294),i(51995)),a=i(61988),l=i(51776),s=i(11965);const c=o.iK.div`
  margin-bottom: ${({theme:e})=>2*e.gridUnit}px;
`,d=function({certifiedBy:e,details:t,metricName:i}){const r=(0,o.Fg)();return(0,s.tZ)(l.Z,{id:`${n()(i)}-tooltip`,title:(0,s.tZ)("div",null,e&&(0,s.tZ)(c,null,(0,a.t)("Certified by %s",e)),(0,s.tZ)("div",null,t))},(0,s.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"16",viewBox:"0 0 24 24",width:"16"},(0,s.tZ)("g",null,(0,s.tZ)("path",{fill:r.colors.primary.base,d:"M23,12l-2.44-2.79l0.34-3.69l-3.61-0.82L15.4,1.5L12,2.96L8.6,1.5L6.71,4.69L3.1,5.5L3.44,9.2L1,12l2.44,2.79l-0.34,3.7 l3.61,0.82L8.6,22.5l3.4-1.47l3.4,1.46l1.89-3.19l3.61-0.82l-0.34-3.69L23,12z M9.38,16.01L7,13.61c-0.39-0.39-0.39-1.02,0-1.41 l0.07-0.07c0.39-0.39,1.03-0.39,1.42,0l1.61,1.62l5.15-5.16c0.39-0.39,1.03-0.39,1.42,0l0.07,0.07c0.39,0.39,0.39,1.02,0,1.41 l-5.92,5.94C10.41,16.4,9.78,16.4,9.38,16.01z"}))))}},65634:(e,t,i)=>{i.d(t,{E:()=>m});var r=i(67294),n=i(51995),o=i(51776),a=i(45737),l=i(9882),s=i(61819),c=i(71963),d=i(11965);const u=n.iK.span`
  svg {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`;function m({column:e,labelRef:t,showType:i=!1}){const{expression:n,column_name:m,type_generic:p}=e,h=n&&n!==m,g=h?"expression":p,[f,b]=(0,r.useState)(e.column_name);return(0,r.useLayoutEffect)((()=>{b((0,c.ZK)(e,t))}),[t,e]),(0,d.tZ)(u,null,i&&void 0!==g&&(0,d.tZ)(a.j,{type:g}),e.is_certified&&(0,d.tZ)(s.Z,{metricName:e.metric_name,certifiedBy:e.certified_by,details:e.certification_details}),(0,d.tZ)(o.u,{id:"metric-name-tooltip",title:f},(0,d.tZ)("span",{className:"m-r-5 option-label column-option-label",ref:t},(0,c.ok)(e))),h&&(0,d.tZ)(l.Z,{className:"m-r-5 text-muted",icon:"question-circle-o",tooltip:e.expression,label:`expr-${e.column_name}`,placement:"top"}))}},45737:(e,t,i)=>{i.d(t,{j:()=>o,Z:()=>a});var r=i(88889),n=(i(67294),i(11965));function o({type:e}){let t="?";""===e||"expression"===e?t="ƒ":"aggregate"===e?t="AGG":e===r.Z.STRING?t="ABC":e===r.Z.NUMERIC?t="#":e===r.Z.BOOLEAN?t="T/F":e===r.Z.TEMPORAL&&(t="time");const i="time"===t?(0,n.tZ)("i",{className:"fa fa-clock-o type-label"}):(0,n.tZ)("div",{className:"type-label"},t);return(0,n.tZ)("span",null,i)}const a=o},51384:(e,t,i)=>{i.d(t,{m:()=>p});var r=i(67294),n=i(51995),o=i(78186),a=i(9882),l=i(45737),s=i(61819),c=i(51776),d=i(71963),u=i(11965);const m=n.iK.div`
  align-items: center;
  display: flex;

  > svg {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`;function p({metric:e,labelRef:t,openInNewWindow:i=!1,showFormula:n=!0,showType:p=!1,url:h=""}){const g=e.verbose_name||e.metric_name||e.label,f=h?(0,u.tZ)("a",{href:h,target:i?"_blank":"",rel:"noreferrer"},g):g,b=e.warning_markdown||e.warning_text,[y,v]=(0,r.useState)(e.metric_name);return(0,r.useLayoutEffect)((()=>{v((0,d.Lk)(e,t))}),[t,e]),(0,u.tZ)(m,{className:"metric-option"},p&&(0,u.tZ)(l.j,{type:"expression"}),e.is_certified&&(0,u.tZ)(s.Z,{metricName:e.metric_name,certifiedBy:e.certified_by,details:e.certification_details}),(0,u.tZ)(c.Z,{id:"metric-name-tooltip",title:y},(0,u.tZ)("span",{className:"option-label metric-option-label",ref:t},f)),n&&(0,u.tZ)(a.Z,{className:"text-muted",icon:"question-circle-o",tooltip:e.expression,label:`expr-${e.metric_name}`}),b&&(0,u.tZ)(a.Z,{className:"text-warning",icon:"warning",tooltip:(0,u.tZ)(o.Z,{source:b}),label:`warn-${e.metric_name}`}))}},71963:(e,t,i)=>{i.d(t,{ok:()=>u,ZK:()=>m,Lk:()=>p});var r=i(67294),n=i(51995),o=i(11965),a=i(61988);const l=n.iK.div`
  ${({theme:e})=>o.iv`
    display: flex;
    flex-direction: column;
    font-size: ${e.typography.sizes.s}px;
    line-height: 1.2;

    &:not(:last-of-type) {
      margin-bottom: ${2*e.gridUnit}px;
    }
  `}
`,s=n.iK.span`
  ${({theme:e})=>o.iv`
    font-weight: ${e.typography.weights.bold};
  `}
`,c=({label:e,text:t})=>(0,o.tZ)(l,null,(0,o.tZ)(s,null,e),(0,o.tZ)("span",null,t)),d=e=>!!(e&&e.current&&e.current.scrollWidth>e.current.clientWidth),u=e=>e.verbose_name||e.column_name,m=(e,t)=>e.verbose_name||e.description||d(t)?(0,o.tZ)(r.Fragment,null,(0,o.tZ)(c,{label:(0,a.t)("Column name"),text:e.column_name}),e.verbose_name&&(0,o.tZ)(c,{label:(0,a.t)("Label"),text:e.verbose_name}),e.description&&(0,o.tZ)(c,{label:(0,a.t)("Description"),text:e.description})):null,p=(e,t)=>e.verbose_name||e.description||e.label||d(t)?(0,o.tZ)(r.Fragment,null,(0,o.tZ)(c,{label:(0,a.t)("Metric name"),text:e.metric_name}),(e.label||e.verbose_name)&&(0,o.tZ)(c,{label:(0,a.t)("Label"),text:e.label||e.verbose_name}),e.description&&(0,o.tZ)(c,{label:(0,a.t)("Description"),text:e.description})):null},35622:(e,t,i)=>{i.d(t,{m_:()=>l,DS:()=>s,Au:()=>c,cm:()=>d});var r=i(61988),n=i(5364),o=i(88889),a=i(20620);const l={time_range:(0,r.t)("Time Range"),granularity_sqla:(0,r.t)("Time Column"),time_grain_sqla:(0,r.t)("Time Grain"),druid_time_origin:(0,r.t)("Origin"),granularity:(0,r.t)("Time Granularity")},s={[n.W3]:(0,r.t)("Time")},c={verbose_name:s[n.W3],column_name:n.W3,type_generic:o.Z.TEMPORAL,description:(0,r.t)("A reference to the [Time] configuration, taking granularity into account")},d={[a.nJ.aggregate]:(0,r.t)("Aggregate"),[a.nJ.raw]:(0,r.t)("Raw records")}},356:(e,t,i)=>{i.d(t,{M:()=>j,Z:()=>K});var r=i(11965),n=i(67294),o=i(51995),a=i(61988),l=i(9882),s=i(51776);function c({name:e,description:t,label:i,tooltipOnClick:n,onClick:o,warning:c,danger:d,leftNode:u,rightNode:m,validationErrors:p=[],renderTrigger:h=!1,hovered:g=!1,required:f=!1}){if(!i)return null;const b=p.length>0?"text-danger":"";return(0,r.tZ)("div",{className:"ControlHeader"},(0,r.tZ)("div",{className:"pull-left"},(0,r.tZ)("label",{className:"control-label",htmlFor:e},u&&(0,r.tZ)("span",null,u),(0,r.tZ)("span",{role:"button",tabIndex:0,onClick:o,className:b,style:{cursor:o?"pointer":""}},i)," ",c&&(0,r.tZ)("span",null,(0,r.tZ)(s.u,{id:"error-tooltip",placement:"top",title:c},(0,r.tZ)("i",{className:"fa fa-exclamation-circle text-warning"}))," "),d&&(0,r.tZ)("span",null,(0,r.tZ)(s.u,{id:"error-tooltip",placement:"top",title:d},(0,r.tZ)("i",{className:"fa fa-exclamation-circle text-danger"}))," "),p.length>0&&(0,r.tZ)("span",null,(0,r.tZ)(s.u,{id:"error-tooltip",placement:"top",title:p.join(" ")},(0,r.tZ)("i",{className:"fa fa-exclamation-circle text-danger"}))," "),g?(0,r.tZ)("span",null,t&&(0,r.tZ)("span",null,(0,r.tZ)(l.V,{label:(0,a.t)("description"),tooltip:t,placement:"top",onClick:n})," "),h&&(0,r.tZ)("span",null,(0,r.tZ)(l.V,{label:(0,a.t)("bolt"),tooltip:(0,a.t)("Changing this control takes effect instantly"),placement:"top",icon:"bolt"})," ")):null,f&&(0,r.tZ)("span",{className:"text-danger m-l-4"},(0,r.tZ)("strong",null,"*")))),m&&(0,r.tZ)("div",{className:"pull-right"},m),(0,r.tZ)("div",{className:"clearfix"}))}function d({value:e,options:t,onChange:i,...n}){const a=e||t[0][0],l=(0,o.Fg)();return(0,r.tZ)("div",{css:(0,r.iv)({".btn svg":{position:"relative",top:"0.2em"},".btn:focus":{outline:"none"},".control-label + .btn-group":{marginTop:1},".btn-group .btn.active":{background:l.colors.secondary.light5,fontWeight:l.typography.weights.bold,boxShadow:"none"}},"","")},(0,r.tZ)(c,n),(0,r.tZ)("div",{className:"btn-group btn-group-sm"},t.map((([e,t])=>(0,r.tZ)("button",{key:JSON.stringify(e),type:"button",className:"btn btn-default "+(e===a?"active":""),onClick:()=>{i(e)}},t)))))}var u=i(19181),m=i(45737),p=i(5872),h=i.n(p),g=i(88889),f=i(23279),b=i.n(f),y=i(68122);function v({children:e}){const{gridUnit:t}=(0,o.Fg)();return(0,r.tZ)("div",{css:(0,r.iv)({display:"flex",flexWrap:"nowrap",margin:-2*t,marginBottom:t},"","")},e)}function _({onChange:e,value:t,children:i}){const a=(0,o.Fg)(),l=(0,n.useMemo)((()=>({0:e,[y.o]:b()(e,y.o)})),[e]),s=n.Children.map(i,(i=>{if("children"in i.props){const r=Array.isArray(i.props.children)?100/i.props.children.length+"%":void 0;return n.cloneElement(i,{children:n.Children.map(i.props.children,(i=>{const{name:o,width:a,debounceDelay:s=y.o,onChange:c}=i.props;return n.cloneElement(i,{width:a||r,value:null==t?void 0:t[o],debounceDelay:void 0,onChange(i){c&&c(i),s in l||(l[s]=b()(e,s)),l[s]({...t,[o]:i})}})}))})}return i}));return(0,r.tZ)("div",{css:(0,r.iv)({label:{textTransform:"uppercase",color:a.colors.text.label,fontSize:a.typography.sizes.s}},"","")},s)}var Z=i(31955),E=i(21888),x=i(4107),T=i(31059),C=i(64749);const{Option:S}=C.Z;function A({creatable:e,onSearch:t,dropdownMatchSelectWidth:i=!1,minWidth:o="100%",showSearch:a=!0,onChange:l,options:s,children:c,value:d,...u}){const[m,p]=(0,n.useState)(),g=a||e,f=g?i=>{e&&p(i),t&&t(i)}:void 0,b=null==s?void 0:s.some((([e])=>e===m)),y=null==s?void 0:s.some((([e])=>e===d)),v=g?(e,t)=>{p(""),l&&l(e,t)}:l;return(0,r.tZ)(C.Z,h()({dropdownMatchSelectWidth:i,showSearch:g,onSearch:f,onChange:v,value:d},u,{css:(0,r.iv)({minWidth:o},"","")}),null==s?void 0:s.map((([e,t])=>(0,r.tZ)(S,{value:e},t))),c,d&&!y&&(0,r.tZ)(S,{key:d,value:d},d),m&&!b&&(0,r.tZ)(S,{key:m,value:m},m))}A.Option=S;const w={Slider:Z.Z,InputNumber:E.Z,Input:x.Z,Select:A,Checkbox:T.Z,RadioButtonControl:d};function N({name:e,label:t,description:i,width:a,validators:s,required:d,onChange:u,value:m,defaultValue:p,controlType:g,...f}){const{gridUnit:b}=(0,o.Fg)(),[y,v]=(0,n.useState)(!1),[_,Z]=(0,n.useState)(void 0===m?p:m),[E,x]=(0,n.useState)(),T=e=>{const t=e&&"object"==typeof e&&"target"in e?"checkbox"===e.target.type||"radio"===e.target.type?e.target.checked:e.target.value:e,i=(null==s?void 0:s.map((e=>!(!d&&function(e){return null==e||""===e}(t))&&e(t))).filter((e=>!!e)))||[];x(i),Z(t),0===i.length&&u&&u(t)},C=w[g];return(0,r.tZ)("div",{css:(0,r.iv)({margin:2*b,width:a},"",""),onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1)},"Checkbox"===g?(0,r.tZ)(w.Checkbox,{checked:_,onChange:T},t," ",y&&i&&(0,r.tZ)(l.Z,{tooltip:i})):(0,r.tZ)(n.Fragment,null,t&&(0,r.tZ)(c,{name:e,label:t,description:i,validationErrors:E,hovered:y,required:d}),(0,r.tZ)(C,h()({},f,{value:_,onChange:T}))))}var M=i(872),k=i(61437),R=i(38798),D=i(14031),O=i(58842);const L={controlType:"Input",label:(0,a.t)("Emit Target"),description:(0,a.t)("If you wish to specify a different target column than the original column, it can be entered here"),defaultValue:"",debounceDelay:500,validators:void 0},P={controlType:"Select",label:(0,a.t)("D3 format"),description:O.YD,options:O.F6,defaultValue:O.F6[0][0],creatable:!0,minWidth:"14em",debounceDelay:500},$={controlType:"Select",label:(0,a.t)("D3 format"),description:O.oq,options:O.HC,defaultValue:O.HC[0][0],creatable:!0,minWidth:"10em",debounceDelay:500},F={controlType:"Slider",label:(0,a.t)("Fraction digits"),description:(0,a.t)("Number of decimal digits to round numbers to"),min:0,step:1,max:100,defaultValue:100},I={controlType:"InputNumber",label:(0,a.t)("Min Width"),description:(0,a.t)("Default minimal column width in pixels, actual width may still be larger than this if other columns don't need much space"),width:120,placeholder:"auto",debounceDelay:400,validators:[M.Z]},U={controlType:"RadioButtonControl",label:(0,a.t)("Text align"),description:(0,a.t)("Horizontal alignment"),width:130,debounceDelay:50,defaultValue:"left",options:[["left",(0,r.tZ)(k.E,{title:(0,a.t)("Left")})],["center",(0,r.tZ)(D.X,{title:(0,a.t)("Center")})],["right",(0,r.tZ)(R.l,{title:(0,a.t)("Right")})]]},z={controlType:"Checkbox",label:(0,a.t)("Show cell bars"),description:(0,a.t)("Whether to display a bar chart background in table columns"),defaultValue:!0,debounceDelay:200},B={controlType:"Checkbox",label:(0,a.t)("Align +/-"),description:(0,a.t)("Whether to align positive and negative values in cell bar chart at 0"),defaultValue:!1,debounceDelay:200},H={controlType:"Checkbox",label:(0,a.t)("Color +/-"),description:(0,a.t)("Whether to colorize numeric values by if they are positive or negative"),defaultValue:!1,debounceDelay:200},G={d3NumberFormat:P,emitTarget:L,d3SmallNumberFormat:{...P,label:(0,a.t)("Small number format"),description:(0,a.t)("D3 number format for numbers between -1.0 and 1.0, useful when you want to have different siginificant digits for small and large numbers")},d3TimeFormat:$,fractionDigits:F,columnWidth:I,horizontalAlign:U,showCellBars:z,alignPositiveNegative:B,colorPositiveNegative:H},W={[g.Z.STRING]:[["columnWidth",{name:"horizontalAlign",override:{defaultValue:"left"}}]],[g.Z.NUMERIC]:[["columnWidth",{name:"horizontalAlign",override:{defaultValue:"right"}}],["d3NumberFormat"],["d3SmallNumberFormat"],["alignPositiveNegative","colorPositiveNegative"],["showCellBars"]],[g.Z.TEMPORAL]:[["columnWidth",{name:"horizontalAlign",override:{defaultValue:"left"}}],["d3TimeFormat"]],[g.Z.BOOLEAN]:[["columnWidth",{name:"horizontalAlign",override:{defaultValue:"left"}}]]};function Y({column:e,configFormLayout:t,onChange:i}){return(0,r.tZ)(_,{onChange:i,value:e.config},t[void 0===e.type?g.Z.STRING:e.type].map(((e,t)=>(0,r.tZ)(v,{key:t},e.map((e=>{const t="string"==typeof e?e:e.name,i="string"==typeof e?{}:"override"in e?e.override:e.config,n={...t in G?G[t]:void 0,...i};return(0,r.tZ)(N,h()({key:t,name:t},n))}))))))}const V=n.memo((function({column:e,onChange:t,configFormLayout:i}){const{colors:n,gridUnit:a}=(0,o.Fg)(),l=6*a;return(0,r.tZ)(u.Z,{title:e.name,content:()=>(0,r.tZ)(Y,{column:e,onChange:t,configFormLayout:i}),trigger:"click",placement:"right"},(0,r.tZ)("div",{css:(0,r.iv)({display:"flex",alignItems:"center",cursor:"pointer",padding:`${a}px ${2*a}px`,borderBottom:`1px solid ${n.grayscale.light2}`,position:"relative",paddingRight:l,"&:last-child":{borderBottom:"none"},"&:hover":{background:n.grayscale.light4},"> .fa":{color:n.grayscale.light2},"&:hover > .fa":{color:n.grayscale.light1}},"")},(0,r.tZ)(m.Z,{type:e.type}),e.name,(0,r.tZ)("i",{className:"fa fa-caret-right",css:(0,r.iv)({position:"absolute",right:3*a,top:3*a},"")})))}));var q=i(35622);const j={},K={RadioButtonControl:d,ColumnConfigControl:function({queryResponse:e,appliedColumnNames:t=[],value:i,onChange:l,configFormLayout:s=W,emitFilter:d,...u}){d?Object.values(s).forEach((e=>{e.some((e=>e.includes("emitTarget")))||e.push(["emitTarget"])})):Object.values(s).forEach((e=>{const t=e.findIndex((e=>e.includes("emitTarget")));t>-1&&e.splice(t,1)}));const{colnames:m,coltypes:p}=e||{};let h=[],g=[];if(0===t.length)h=m||[],g=p||[];else{const e=new Set(t);null==m||m.forEach(((t,i)=>{e.has(t)&&(h.push(t),g.push(null==p?void 0:p[i]))}))}const f=(0,o.Fg)(),b=(0,n.useMemo)((()=>{var e;const t={};return null==(e=h)||e.forEach(((e,r)=>{var n;t[e]={name:q.DS[e]||e,type:null==(n=g)?void 0:n[r],config:(null==i?void 0:i[e])||{}}})),t}),[i,h,g]),[y,v]=(0,n.useState)(!1),_=e=>b[e]||{};if(!h||0===h.length)return null;const Z=h.length>12,E=Z&&!y?h.slice(0,10):h;return(0,r.tZ)(n.Fragment,null,(0,r.tZ)(c,u),(0,r.tZ)("div",{css:(0,r.iv)({border:`1px solid ${f.colors.grayscale.light2}`,borderRadius:f.gridUnit},"","")},E.map((e=>(0,r.tZ)(V,{key:e,column:_(e),onChange:t=>((e,t)=>{if(l){const r=h&&i?Object.fromEntries(Object.entries(i).filter((([e])=>h.includes(e)))):{...i};l({...r,[e]:t})}})(e,t),configFormLayout:s}))),Z&&(0,r.tZ)("div",{role:"button",tabIndex:-1,css:(0,r.iv)({padding:2*f.gridUnit,textAlign:"center",cursor:"pointer",textTransform:"uppercase",fontSize:f.typography.sizes.xs,color:f.colors.text.label,":hover":{backgroundColor:f.colors.grayscale.light4}},"",""),onClick:()=>v(!y)},y?(0,r.tZ)(n.Fragment,null,(0,r.tZ)("i",{className:"fa fa-angle-up"}),"   ",(0,a.t)("Show less columns")):(0,r.tZ)(n.Fragment,null,(0,r.tZ)("i",{className:"fa fa-angle-down"}),"  ",(0,a.t)("Show all columns")))))}}},53769:(e,t,i)=>{i.d(t,{xM:()=>l,lC:()=>s,A3:()=>c,zo:()=>d,ZC:()=>u,dN:()=>m,$m:()=>p,SE:()=>h,z3:()=>g,Ju:()=>f,h1:()=>b,ov:()=>y,M4:()=>v,GA:()=>_});var r=i(61988),n=i(95826),o=i(93185),a=i(35622);const l={type:"DndColumnSelect",label:(0,r.t)("Group by"),default:[],description:(0,r.t)("One or many columns to group by. High cardinality groupings should include a series limit to limit the number of fetched and rendered series."),mapStateToProps(e,{includeTime:t}){const i={};if(e.datasource){const r=e.datasource.columns.filter((e=>e.groupby));t&&r.unshift(a.Au),i.options=Object.fromEntries(r.map((e=>[e.column_name,e]))),i.savedMetrics=e.datasource.metrics||[]}return i}},s={...l,label:(0,r.t)("Columns"),description:(0,r.t)("One or many columns to pivot as columns")},c={...l,label:(0,r.t)("Series"),multi:!1,default:null,description:(0,r.t)("Defines the grouping of entities. Each series is shown as a specific color on the chart and has a legend toggle")},d={...l,label:(0,r.t)("Entity"),default:null,multi:!1,validators:[n.Z],description:(0,r.t)("This defines the element to be plotted on the chart")},u={type:"DndFilterSelect",label:(0,r.t)("Filters"),default:[],description:"",mapStateToProps:({datasource:e,form_data:t})=>({columns:(null==e?void 0:e.columns.filter((e=>e.filterable)))||[],savedMetrics:(null==e?void 0:e.metrics)||[],selectedMetrics:t.metrics||(t.metric?[t.metric]:[]),datasource:e}),provideFormDataToProps:!0},m={type:"DndMetricSelect",multi:!0,label:(0,r.t)("Metrics"),validators:[n.Z],mapStateToProps:({datasource:e})=>({columns:e?e.columns:[],savedMetrics:e?e.metrics:[],datasource:e,datasourceType:null==e?void 0:e.type}),description:(0,r.t)("One or many metrics to display")},p={...m,multi:!1,label:(0,r.t)("Metric"),description:(0,r.t)("Metric")},h={...p,label:(0,r.t)("Right Axis Metric"),description:(0,r.t)("Choose a metric for right axis")},g={type:"DndMetricSelect",label:(0,r.t)("Sort by"),default:null,description:(0,r.t)("Metric used to define how the top series are sorted if a series or row limit is present. If undefined reverts to the first metric (where appropriate)."),mapStateToProps:({datasource:e})=>({columns:(null==e?void 0:e.columns)||[],savedMetrics:(null==e?void 0:e.metrics)||[],datasource:e,datasourceType:null==e?void 0:e.type})},f={...p,label:(0,r.t)("Bubble Size"),description:(0,r.t)("Metric used to calculate bubble size")},b={...p,label:(0,r.t)("X Axis"),description:(0,r.t)("Metric assigned to the [X] axis")},y={...p,label:(0,r.t)("Y Axis"),description:(0,r.t)("Metric assigned to the [Y] axis")},v={...p,label:(0,r.t)("Color Metric"),validators:[],description:(0,r.t)("A metric to use for color")},_={...c,label:a.m_.granularity_sqla,description:(0,r.t)("The time column for the visualization. Note that you can define arbitrary expression that return a DATETIME column in the table. Also note that the filter below is applied against this column or expression"),canDelete:!1,ghostButtonText:(0,r.t)((0,o.c)(o.T.ENABLE_DND_WITH_CLICK_UX)?"Drop a temporal column here or click":"Drop temporal column here"),mapStateToProps:({datasource:e})=>{var t,i;const r=null!=(t=null==e?void 0:e.columns.filter((e=>e.is_dttm)))?t:[];return{options:Object.fromEntries(r.map((e=>[e.column_name,e]))),default:(null==e?void 0:e.main_dttm_col)||(null==(i=r[0])?void 0:i.column_name)||null,isTemporal:!0}}}},16522:(e,t,i)=>{i.d(t,{Hq:()=>X}),i(67294);var r=i(81545),n=i(45511),o=i(61988),a=i(95826),l=i(75294),s=i(62363),c=i(93185),d=i(6126),u=i(58842),m=i(35622),p=i(65634),h=i(53769),g=i(11965);const f=(0,r.Z)(),b=(0,n.Z)(),y=[5,10,25,50,100,500],v=document.getElementById("app"),{user:_}=JSON.parse((null==v?void 0:v.getAttribute("data-bootstrap"))||"{}"),Z={type:"SelectControl",label:(0,o.t)("Group by"),multi:!0,freeForm:!0,clearable:!0,default:[],includeTime:!1,description:(0,o.t)("One or many columns to group by. High cardinality groupings should include a sort by metric and series limit to limit the number of fetched and rendered series."),optionRenderer:e=>(0,g.tZ)(p.E,{showType:!0,column:e}),valueRenderer:e=>(0,g.tZ)(p.E,{column:e}),valueKey:"column_name",allowAll:!0,filterOption:({data:e},t)=>e.column_name&&e.column_name.toLowerCase().includes(t.toLowerCase())||e.verbose_name&&e.verbose_name.toLowerCase().includes(t.toLowerCase())||!1,promptTextCreator:e=>e,mapStateToProps(e,{includeTime:t}){const i={};if(e.datasource){const r=e.datasource.columns.filter((e=>e.groupby));t&&r.unshift(m.Au),i.options=r}return i},commaChoosesOption:!1},E={type:"MetricsControl",multi:!0,label:(0,o.t)("Metrics"),validators:[a.Z],mapStateToProps:({datasource:e})=>({columns:e?e.columns:[],savedMetrics:e?e.metrics:[],datasource:e,datasourceType:null==e?void 0:e.type}),description:(0,o.t)("One or many metrics to display")},x={...E,multi:!1,label:(0,o.t)("Metric"),description:(0,o.t)("Metric")},T={type:"DatasourceControl",label:(0,o.t)("Datasource"),default:null,description:null,mapStateToProps:({datasource:e,form_data:t})=>({datasource:e,form_data:t,user:_})},C={type:"VizTypeControl",label:(0,o.t)("Visualization Type"),default:"table",description:(0,o.t)("The type of visualization to display")},S={type:"ColorPickerControl",label:(0,o.t)("Fixed Color"),description:(0,o.t)("Use this to define a static color for all circles"),default:{r:0,g:122,b:135,a:1},renderTrigger:!0},A={...x,label:(0,o.t)("Right Axis Metric"),clearable:!0,description:(0,o.t)("Choose a metric for right axis")},w={type:"ColorSchemeControl",label:(0,o.t)("Linear Color Scheme"),choices:()=>b.values().map((e=>[e.id,e.label])),default:b.getDefaultKey(),clearable:!1,description:"",renderTrigger:!0,schemes:()=>b.getMap(),isLinear:!0,mapStateToProps:e=>{var t;return{dashboardId:null==e||null==(t=e.form_data)?void 0:t.dashboardId}}},N={...x,label:(0,o.t)("Color Metric"),default:null,validators:[],description:(0,o.t)("A metric to use for color")},M={...Z,label:(0,o.t)("Columns"),description:(0,o.t)("One or many columns to pivot as columns")},k={type:"SelectControl",freeForm:!0,label:m.m_.druid_time_origin,choices:[["","default"],["now","now"]],default:null,description:(0,o.t)("Defines the origin where time buckets start, accepts natural dates as in `now`, `sunday` or `1970-01-01`")},R={type:"SelectControl",freeForm:!0,label:m.m_.granularity,default:"one day",choices:[[null,"all"],["PT5S","5 seconds"],["PT30S","30 seconds"],["PT1M","1 minute"],["PT5M","5 minutes"],["PT30M","30 minutes"],["PT1H","1 hour"],["PT6H","6 hour"],["P1D","1 day"],["P7D","7 days"],["P1W","week"],["week_starting_sunday","week starting Sunday"],["week_ending_saturday","week ending Saturday"],["P1M","month"],["P3M","quarter"],["P1Y","year"]],description:(0,o.t)("The time granularity for the visualization. Note that you can type and use simple natural language as in `10 seconds`, `1 day` or `56 weeks`")},D={type:"SelectControl",label:m.m_.granularity_sqla,description:(0,o.t)("The time column for the visualization. Note that you can define arbitrary expression that return a DATETIME column in the table. Also note that the filter below is applied against this column or expression"),default:e=>e.default,clearable:!1,optionRenderer:e=>(0,g.tZ)(p.E,{showType:!0,column:e}),valueRenderer:e=>(0,g.tZ)(p.E,{column:e}),valueKey:"column_name",mapStateToProps:e=>{const t={};return e.datasource&&(t.options=e.datasource.columns.filter((e=>e.is_dttm)),t.default=null,e.datasource.main_dttm_col?t.default=e.datasource.main_dttm_col:t.options&&t.options.length>0&&(t.default=t.options[0].column_name)),t}},O={type:"SelectControl",label:m.m_.time_grain_sqla,default:"P1D",description:(0,o.t)("The time granularity for the visualization. This applies a date transformation to alter your time column and defines a new time granularity. The options here are defined on a per database engine basis in the Superset source code."),mapStateToProps:({datasource:e})=>({choices:(null==e?void 0:e.time_grain_sqla)||null})},L={type:"DateFilterControl",freeForm:!0,label:m.m_.time_range,default:(0,o.t)("No filter"),description:(0,o.t)('The time range for the visualization. All relative times, e.g. "Last month", "Last 7 days", "now", etc. are evaluated on the server using the server\'s local time (sans timezone). All tooltips and placeholder times are expressed in UTC (sans timezone). The timestamps are then evaluated by the database using the engine\'s local timezone. Note one can explicitly set the timezone per the ISO 8601 format if specifying either the start and/or end time.'),mapStateToProps:({datasource:e,form_data:t})=>({datasource:e,endpoints:(null==t?void 0:t.time_range_endpoints)||null})},P={type:"SelectControl",freeForm:!0,label:(0,o.t)("Row limit"),validators:[l.Z],default:1e4,choices:(0,d.m)([10,50,100,250,500,1e3,5e3,1e4,5e4]),description:(0,o.t)("Limits the number of rows that get displayed.")},$={type:"CheckboxControl",label:(0,o.t)("Sort Descending"),default:!0,description:(0,o.t)("Whether to sort descending or ascending"),visibility:({controls:e})=>Boolean((null==e?void 0:e.timeseries_limit_metric.value)&&(null==e?void 0:e.timeseries_limit_metric.value.length))},F={type:"SelectControl",freeForm:!0,label:(0,o.t)("Series limit"),validators:[l.Z],choices:(0,d.m)(y),clearable:!0,description:(0,o.t)("Limits the number of series that get displayed. A joined subquery (or an extra phase where subqueries are not supported) is applied to limit the number of series that get fetched and rendered. This feature is useful when grouping by high cardinality column(s) though does increase the query complexity and cost.")},I={type:"SelectControl",freeForm:!0,label:(0,o.t)("Series limit"),validators:[l.Z],choices:(0,d.m)(y),description:(0,o.t)("Limits the number of series that get displayed. A joined subquery (or an extra phase where subqueries are not supported) is applied to limit the number of series that get fetched and rendered. This feature is useful when grouping by high cardinality column(s) though does increase the query complexity and cost.")},U={type:"MetricsControl",label:(0,o.t)("Sort by"),default:null,description:(0,o.t)("Metric used to define how the top series are sorted if a series or row limit is present. If undefined reverts to the first metric (where appropriate)."),mapStateToProps:({datasource:e})=>({columns:(null==e?void 0:e.columns)||[],savedMetrics:(null==e?void 0:e.metrics)||[],datasource:e,datasourceType:null==e?void 0:e.type})},z={...Z,label:(0,o.t)("Series"),multi:!1,default:null,description:(0,o.t)("Defines the grouping of entities. Each series is shown as a specific color on the chart and has a legend toggle")},B={...Z,label:(0,o.t)("Entity"),default:null,multi:!1,validators:[a.Z],description:(0,o.t)("This defines the element to be plotted on the chart")},H={...x,label:(0,o.t)("X Axis"),description:(0,o.t)("Metric assigned to the [X] axis"),default:null},G={...x,label:(0,o.t)("Y Axis"),default:null,description:(0,o.t)("Metric assigned to the [Y] axis")},W={...x,label:(0,o.t)("Bubble Size"),description:(0,o.t)("Metric used to calculate bubble size"),default:null},Y={type:"SelectControl",freeForm:!0,label:(0,o.t)("Y Axis Format"),renderTrigger:!0,default:u.Ul,choices:u.F6,description:u.YD,tokenSeparators:["\n","\t",";"],filterOption:({data:e},t)=>e.label.includes(t)||e.value.includes(t),mapStateToProps:e=>{var t,i;return{choices:(null==(t=e.controls)||null==(i=t.comparison_type)?void 0:i.value)===s.pF.Percentage?u.F6.filter((e=>e[0].includes("%"))):u.F6}}},V={type:"SelectControl",freeForm:!0,label:(0,o.t)("Time format"),renderTrigger:!0,default:u._r,choices:u.HC,description:u.oq,filterOption:({data:e},t)=>e.label.includes(t)||e.value.includes(t)},q={type:"AdhocFilterControl",label:(0,o.t)("Filters"),default:[],description:"",mapStateToProps:({datasource:e,form_data:t})=>({columns:(null==e?void 0:e.columns.filter((e=>e.filterable)))||[],savedMetrics:(null==e?void 0:e.metrics)||[],selectedMetrics:t.metrics||(t.metric?[t.metric]:[]),datasource:e})},j={type:"ColorSchemeControl",label:(0,o.t)("Color Scheme"),default:f.getDefaultKey(),renderTrigger:!0,choices:()=>f.keys().map((e=>[e,e])),description:(0,o.t)("The color scheme for rendering chart"),schemes:()=>f.getMap(),mapStateToProps:e=>{var t;return{dashboardId:null==e||null==(t=e.form_data)?void 0:t.dashboardId}}},K=(0,c.c)(c.T.ENABLE_EXPLORE_DRAG_AND_DROP),X={metrics:K?h.dN:E,metric:K?h.$m:x,datasource:T,viz_type:C,color_picker:S,metric_2:K?h.SE:A,linear_color_scheme:w,secondary_metric:K?h.M4:N,groupby:K?h.xM:Z,columns:K?h.lC:M,druid_time_origin:k,granularity:R,granularity_sqla:K?h.GA:D,time_grain_sqla:O,time_range:L,row_limit:P,limit:F,timeseries_limit_metric:K?h.z3:U,orderby:K?h.z3:U,order_desc:$,series:K?h.A3:z,entity:K?h.zo:B,x:K?h.h1:H,y:K?h.ov:G,size:K?h.Ju:W,y_axis_format:Y,x_axis_time_format:V,adhoc_filters:K?h.ZC:q,color_scheme:j,series_columns:K?h.lC:M,series_limit:I,series_limit_metric:K?h.z3:U,legacy_order_by:K?h.z3:U}},38575:(e,t,i)=>{var r;i.d(t,{O9:()=>r,vD:()=>n,xN:()=>o,zy:()=>a,GA:()=>l}),function(e){e.NONE="None",e.GREATER_THAN=">",e.LESS_THAN="<",e.GREATER_OR_EQUAL="≥",e.LESS_OR_EQUAL="≤",e.EQUAL="=",e.NOT_EQUAL="≠",e.BETWEEN="< x <",e.BETWEEN_OR_EQUAL="≤ x ≤",e.BETWEEN_OR_LEFT_EQUAL="≤ x <",e.BETWEEN_OR_RIGHT_EQUAL="< x ≤"}(r||(r={}));const n=[r.BETWEEN,r.BETWEEN_OR_EQUAL,r.BETWEEN_OR_LEFT_EQUAL,r.BETWEEN_OR_RIGHT_EQUAL];function o(e){return"column_name"in e}function a(e){return"column_name"in e&&"expression"in e&&!!e.expression}function l(e){return"label"in e&&"sqlExpression"in e}},58842:(e,t,i)=>{i.d(t,{YD:()=>a,F6:()=>l,oq:()=>s,HC:()=>c,Ul:()=>d,_r:()=>u});var r=i(61988),n=i(45636),o=i(78900);const a=(0,r.t)("D3 format syntax: https://github.com/d3/d3-format"),l=[[n.Z.SMART_NUMBER,(0,r.t)("Adaptive formatting")],["~g",(0,r.t)("Original value")],[",d",",d (12345.432 => 12,345)"],[".1s",".1s (12345.432 => 10k)"],[".3s",".3s (12345.432 => 12.3k)"],[",.1%",",.1% (12345.432 => 1,234,543.2%)"],[".2%",".2% (12345.432 => 1234543.20%)"],[".3%",".3% (12345.432 => 1234543.200%)"],[".4r",".4r (12345.432 => 12350)"],[",.1f",",.1f (12345.432 => 12,345.4)"],[",.2f",",.2f (12345.432 => 12,345.43)"],[",.3f",",.3f (12345.432 => 12,345.432)"],["+,","+, (12345.432 => +12,345.432)"],["$,.2f","$,.2f (12345.432 => $12,345.43)"],["DURATION",(0,r.t)("Duration in ms (66000 => 1m 6s)")],["DURATION_SUB",(0,r.t)("Duration in ms (1.40008 => 1ms 400µs 80ns)")]],s=(0,r.t)("D3 time format syntax: https://github.com/d3/d3-time-format"),c=[[o.Z.id,(0,r.t)("Adaptive formatting")],["%d/%m/%Y","%d/%m/%Y | 14/01/2019"],["%m/%d/%Y","%m/%d/%Y | 01/14/2019"],["%Y-%m-%d","%Y-%m-%d | 2019-01-14"],["%Y-%m-%d %H:%M:%S","%Y-%m-%d %H:%M:%S | 2019-01-14 01:32:10"],["%d-%m-%Y %H:%M:%S","%d-%m-%Y %H:%M:%S | 14-01-2019 01:32:10"],["%H:%M:%S","%H:%M:%S | 01:32:10"]],d=l[0][0],u=c[0][0]},89368:(e,t,i)=>{i.d(t,{$:()=>a,q:()=>l});var r=i(67294),n=i(16522),o=i(356);function a(e){return"string"==typeof e&&e in o.Z?o.Z[e]:e}function l(e,t={}){if("string"==typeof e&&e in n.Hq){const i=e;return{name:i,config:{...n.Hq[i],...t[i]}}}if(!e||"string"==typeof e||r.isValidElement(e))return e;if("name"in e&&"config"in e)return{...e,config:{...e.config,type:a(e.config.type)}};if("override"in e&&e.name in n.Hq){const{name:t,override:i}=e;return{name:t,config:{...n.Hq[t],...i}}}return null}},6126:(e,t,i)=>{function r(e){return e.map((e=>Array.isArray(e)?e:[e,e.toString()]))}function n(e,t){const i=[];for(let r=e;r<=t;r+=1)i.push([r,r.toString()]);return i}i.d(t,{m:()=>r,B:()=>n})},37687:(e,t,i)=>{i.d(t,{Z:()=>a});var r=i(90537),n=i(1875);class o extends r.Z{constructor(){super({name:"ChartControlPanel"})}}const a=(0,n.Z)(o)},16355:(e,t,i)=>{var r,n,o;i.d(t,{cg:()=>r,Tr:()=>n,Df:()=>o,t$:()=>a,eH:()=>l,ZP:()=>s}),function(e){e.INTERACTIVE_CHART="INTERACTIVE_CHART",e.NATIVE_FILTER="NATIVE_FILTER"}(r||(r={})),function(e){e.EXPLORE="EXPLORE",e.DASHBOARD="DASHBOARD",e.FILTER_BAR="FILTER_BAR",e.FILTER_CONFIG_MODAL="FILTER_CONFIG_MODAL",e.EMBEDDED="EMBEDDED"}(n||(n={})),function(e){e.DEPRECATED="DEPRECATED",e.FEATURED="FEATURED"}(o||(o={}));const a={[o.DEPRECATED]:"This chart uses features or modules which are no longer actively maintained. It will eventually be replaced or removed.",[o.FEATURED]:"This chart was tested and verified, so the overall experience should be stable."},l={[o.DEPRECATED]:{weight:-.1},[o.FEATURED]:{weight:.1}},s={}},28062:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a,DEFAULT_NAMESPACE:()=>s,getNamespace:()=>c,getColor:()=>d,getScale:()=>u});var r=i(97466),n=i(81545),o=i(86041);class a{constructor(e){this.name=void 0,this.forcedItems=void 0,this.scales=void 0,this.name=e,this.scales={},this.forcedItems={}}getScale(e){var t,i;const o=null!=(t=null!=e?e:(0,n.Z)().getDefaultKey())?t:"",a=(0,n.Z)().get(o);return new r.Z(null!=(i=null==a?void 0:a.colors)?i:[],this.forcedItems)}setColor(e,t){return this.forcedItems[(0,o.Z)(e)]=t,this}resetColors(){this.forcedItems={}}}const l={},s="GLOBAL";function c(e=s){const t=l[e];if(t)return t;const i=new a(e);return l[e]=i,i}function d(e,t,i){return c(i).getScale(t).getColor(e)}function u(e,t){return c(t).getScale(e)}},97466:(e,t,i)=>{i.d(t,{Z:()=>s});var r=i(99481),n=i(54732),o=i(86041),a=i(78161);class l extends n.Z{constructor(e,t){super(((e,t)=>this.getColor(e,t))),this.colors=void 0,this.scale=void 0,this.parentForcedColors=void 0,this.forcedColors=void 0,this.colors=e,this.scale=(0,r.Z)(),this.scale.range(e),this.parentForcedColors=t,this.forcedColors={}}getColor(e,t){const i=(0,o.Z)(e),r=(0,a.Z)(),n=this.parentForcedColors&&this.parentForcedColors[i];if(n)return r.addSlice(i,n,t),n;const l=this.forcedColors[i];if(l)return r.addSlice(i,l,t),l;const s=this.scale(i);return r.addSlice(i,s,t),s}setColor(e,t){return this.forcedColors[(0,o.Z)(e)]=t,this}getColorMap(){const e={};return this.scale.domain().forEach((t=>{e[t.toString()]=this.scale(t)})),{...e,...this.forcedColors,...this.parentForcedColors}}copy(){const e=new l(this.scale.range(),this.parentForcedColors);return e.forcedColors={...this.forcedColors},e.domain(this.domain()),e.unknown(this.unknown()),e}domain(e){return void 0===e?this.scale.domain():(this.scale.domain(e),this)}range(e){return void 0===e?this.scale.range():(this.colors=e,this.scale.range(e),this)}unknown(e){return void 0===e?this.scale.unknown():(this.scale.unknown(e),this)}}const s=l},78161:(e,t,i)=>{i.d(t,{X:()=>l,Z:()=>s});var r=i(17621),n=i.n(r),o=i(28062),a=i(1875);class l{constructor(){this.sliceLabelColorMap=void 0,this.sliceLabelColorMap={}}getColorMap(e,t,i){if(t){const a=o.getNamespace(e),l=a.getScale(t).range(),s=this.getSharedLabels(),c=[];let d;if(s.length){const e=Math.ceil(s.length/l.length),t=5,i=l.map((i=>n()(i).analogous(e+t).slice(t)));for(;null!=(r=i[i.length-1])&&r.length;){var r;i.forEach((e=>c.push(e.shift())))}d=s.reduce(((e,t,i)=>{var r;return{...e,[t.toString()]:null==(r=c[i])?void 0:r.toHexString()}}),{})}return{...Object.keys(this.sliceLabelColorMap).reduce(((e,r)=>{const n=a.getScale(t);return{...e,...Object.keys(this.sliceLabelColorMap[r]).reduce(((e,t)=>({...e,[t]:i?n(t):this.sliceLabelColorMap[r][t]})),{})}}),{}),...d}}}addSlice(e,t,i){i&&(this.sliceLabelColorMap[i]={...this.sliceLabelColorMap[i],[e]:t})}removeSlice(e){delete this.sliceLabelColorMap[e]}clear(){this.sliceLabelColorMap={}}getSharedLabels(){const e=new Set,t=new Set;return Object.keys(this.sliceLabelColorMap).forEach((i=>{const r=this.sliceLabelColorMap[i];Object.keys(r).forEach((i=>{e.has(i)&&!t.has(i)?t.add(i):e.add(i)}))})),[...t]}}const s=(0,a.Z)(l)},86041:(e,t,i)=>{function r(e){return String(e).trim()}i.d(t,{Z:()=>r})},68122:(e,t,i)=>{i.d(t,{o:()=>r,M:()=>n});const r=250,n=500},81847:(e,t,i)=>{i.d(t,{vO:()=>o,YW:()=>a,mc:()=>l});const r={},n=e=>`__superset__/${e}`;async function o(e,t){const i=n(e);if(!window[i]&&!r[e]){const n=t();r[e]=n,window[i]=await n}return r[e]}async function a(e){return Promise.all(Object.entries(e).map((([e,t])=>o(e,t))))}function l(){Object.keys(r).forEach((e=>{delete window[n(e)],delete r[e]}))}},62363:(e,t,i)=>{var r,n;i.d(t,{su:()=>r,pF:()=>n,ZP:()=>o}),function(e){e.Mean="mean",e.Sum="sum",e.Std="std",e.Cumsum="cumsum"}(r||(r={})),function(e){e.Values="values",e.Difference="difference",e.Percentage="percentage",e.Ratio="ratio"}(n||(n={}));const o={}},88889:(e,t,i)=>{var r;i.d(t,{Z:()=>r,C:()=>n}),function(e){e[e.NUMERIC=0]="NUMERIC",e[e.STRING=1]="STRING",e[e.TEMPORAL=2]="TEMPORAL",e[e.BOOLEAN=3]="BOOLEAN"}(r||(r={}));const n={}},1111:(e,t,i)=>{function r(e,t){return e===t||!e&&!t||!!(e&&t&&e.length===t.length&&e.every(((e,i)=>e===t[i])))}i.d(t,{Z:()=>r})},75294:(e,t,i)=>{i.d(t,{Z:()=>n});var r=i(61988);function n(e){return!(!e||!Number.isNaN(Number(e))&&parseInt(e,10)===Number(e))&&(0,r.t)("is expected to be an integer")}},99298:(e,t,i)=>{i.d(t,{Z:()=>n});var r=i(61988);function n(e){return!(!e||!Number.isNaN(Number(e)))&&(0,r.t)("is expected to be a number")}},95826:(e,t,i)=>{i.d(t,{Z:()=>n});var r=i(61988);function n(e){return!!(null==e||""===e||Array.isArray(e)&&0===e.length)&&(0,r.t)("cannot be empty")}},872:(e,t,i)=>{i.d(t,{Z:()=>n});var r=i(61988);function n(e){return!("string"==typeof e&&e.trim().length>0&&Number.isFinite(Number(e.trim()))||"number"==typeof e&&Number.isFinite(e))&&(0,r.t)("is expected to be a number")}},14278:(e,t,i)=>{i.d(t,{Zn:()=>g,gp:()=>f,EM:()=>Z});var r=i(14176),n=i.n(r),o=i(67294),a=i(11064),l=i(22102),s=i(81847),c=i(68492),d=i(91877),u=i(93185),m=i(11965);const p=(0,a.Z)(),h={loading:!0,dynamicPlugins:{},keys:[],mountedPluginMetadata:{},fetchAll:()=>{}},g=o.createContext(h),f=()=>(0,o.useContext)(g);function b(){return{keys:p.keys(),mountedPluginMetadata:n()(p.getMap(),(e=>void 0===e))}}function y(e,t){switch(t.type){case"begin":{const i={...e.dynamicPlugins};return t.keys.forEach((e=>{i[e]={key:e,error:null,mounting:!0}})),{...e,loading:t.keys.length>0,dynamicPlugins:i}}case"complete":return{...e,loading:Object.values(e.dynamicPlugins).some((e=>e.mounting&&e.key!==t.key)),dynamicPlugins:{...e.dynamicPlugins,[t.key]:{key:t.key,mounting:!1,error:t.error}}};case"changed keys":return{...e,...b()};default:return e}}const v=(0,l.Z)({method:"GET",endpoint:"/dynamic-plugins/api/read"}),_={react:()=>Promise.resolve().then(i.t.bind(i,67294,19)),lodash:()=>i.e(6486).then(i.t.bind(i,96486,23)),"react-dom":()=>Promise.resolve().then(i.t.bind(i,90731,19)),"@superset-ui/chart-controls":()=>i.e(5289).then(i.bind(i,75289)),"@superset-ui/core":()=>Promise.all([i.e(1216),i.e(2087),i.e(2671),i.e(6377),i.e(5175),i.e(435)]).then(i.bind(i,67546))},Z=({children:e})=>{const[t,i]=(0,o.useReducer)(y,h,(e=>({...e,...b(),fetchAll:r,loading:(0,d.cr)(u.T.DYNAMIC_PLUGINS)})));async function r(){try{await(0,s.YW)(_);const{result:e}=await v({});i({type:"begin",keys:e.map((e=>e.key))}),await Promise.all(e.map((async e=>{let t=null;try{await import(e.bundle_url)}catch(i){c.Z.error(`Failed to load plugin ${e.key} with the following error:`,i.stack),t=i}i({type:"complete",key:e.key,error:t})})))}catch(e){c.Z.error("Failed to load dynamic plugins",e.stack||e)}}return(0,o.useEffect)((()=>{(0,d.cr)(u.T.DYNAMIC_PLUGINS)&&r();const e=()=>{i({type:"changed keys"})};return p.addListener(e),()=>{p.removeListener(e)}}),[]),(0,m.tZ)(g.Provider,{value:t},e)}},1510:(e,t,i)=>{i.d(t,{zi:()=>d,on:()=>u,vk:()=>m,X3:()=>p,Rz:()=>f});var r=i(5364),n=i(16355),o=i(93185),a=i(70400),l=i(91877),s=i(81255),c=i(80621);const d=({datasetId:e,dependencies:t={},groupby:i,defaultDataMask:r,controlValues:n,filterType:o,sortMetric:l,adhoc_filters:s,time_range:c,granularity_sqla:d,type:u})=>{var m;const p={};return e&&(p.datasource=`${e}__table`),i&&(p.groupby=[i]),l&&(p.sortMetric=l),{...n,...p,adhoc_filters:null!=s?s:[],extra_filters:[],extra_form_data:t,granularity_sqla:d,metrics:["count"],row_limit:1e3,showSearch:!0,defaultValue:null==r||null==(m=r.filterState)?void 0:m.value,time_range:c,time_range_endpoints:["inclusive","exclusive"],url_params:(0,a.Z)("regular"),inView:!0,viz_type:o,type:u}};function u(e={},t={}){const i={};return r.Ci.forEach((r=>{const n=[...e[r]||[],...t[r]||[]];n.length&&(i[r]=n)})),r.Ay.forEach((r=>{const n=e[r];void 0!==n&&(i[r]=n);const o=t[r];void 0!==o&&(i[r]=o)})),i}function m(e,t,i){let r={};return i.forEach((t=>{var i,n;r=u(r,null!=(i=null==(n=e[t])?void 0:n.extraFormData)?i:{})})),r}function p(e){return!e.includes(n.cg.NATIVE_FILTER)||(0,l.cr)(o.T.DASHBOARD_FILTERS_EXPERIMENTAL)&&(0,l.cr)(o.T.DASHBOARD_CROSS_FILTERS)&&e.includes(n.cg.INTERACTIVE_CHART)}const h=(e,t)=>e[t].type===s.gn,g=(e,t,i,r,n)=>{e[i].type===s.dW&&t.includes(e[i].meta.chartId)&&r.forEach(n.add,n),0===e[i].children.length||h(e,i)&&n.has(i)||e[i].children.forEach((i=>g(e,t,i,h(e,i)?[...r,i]:r,n)))},f=(e,t)=>{const i=e[c._4].children[0],r=i!==c.PV,n=new Set;var o;return r?null==(o=e[i].children)||o.forEach((i=>g(e,t,i,[i],n))):Object.values(e).filter((e=>e.type===s.gn)).forEach((i=>g(e,t,i.id,[i.id],n))),n}},81255:(e,t,i)=>{i.d(t,{dW:()=>r,BA:()=>n,Vl:()=>o,BG:()=>a,U0:()=>l,hE:()=>s,Nc:()=>c,xh:()=>d,F0:()=>u,Os:()=>m,yR:()=>p,gn:()=>h,t:()=>g,ZP:()=>f});const r="CHART",n="COLUMN",o="HEADER",a="GRID",l="ROOT",s="DIVIDER",c="HEADER",d="MARKDOWN",u="NEW_COMPONENT_SOURCE",m="ROW",p="TABS",h="TAB",g="DYNAMIC",f={CHART_TYPE:r,COLUMN_TYPE:n,DASHBOARD_HEADER_TYPE:o,DASHBOARD_GRID_TYPE:a,DASHBOARD_ROOT_TYPE:l,DIVIDER_TYPE:s,HEADER_TYPE:c,MARKDOWN_TYPE:d,NEW_COMPONENT_SOURCE_TYPE:u,ROW_TYPE:m,TABS_TYPE:p,TAB_TYPE:h,DYNAMIC_TYPE:g}},70400:(e,t,i)=>{i.d(t,{Z:()=>o});var r=i(17563);const n=new Set(["standalone","edit"]);function o(e){const t=r.parse(window.location.search);return Object.entries(t).reduce(((t,[i,r])=>"regular"===e&&n.has(i)||"reserved"===e&&!n.has(i)?t:Array.isArray(r)?{...t,[i]:r[0]}:{...t,[i]:r}),{})}},13284:(e,t,i)=>{i.d(t,{UB:()=>T,ZP:()=>j});var r,n=i(5872),o=i.n(n),a=i(67294),l=i(74221),s=i(94184),c=i.n(s),d=i(61988),u=i(51995),m=i(11965),p=i(16355),h=i(4715),g=i(58593),f=i(9875),b=i(37921),y=i(14278),v=i(70163),_=i(1510),Z=i(64239);!function(e){e.ALL_CHARTS="ALL_CHARTS",e.CATEGORY="CATEGORY",e.TAGS="TAGS",e.RECOMMENDED_TAGS="RECOMMENDED_TAGS"}(r||(r={}));const E=["line","big_number","big_number_total","table","pivot_table_v2","echarts_timeseries_line","echarts_area","echarts_timeseries_bar","echarts_timeseries_scatter","pie","mixed_timeseries","filter_box","dist_bar","area","bar","deck_polygon","time_table","histogram","deck_scatter","deck_hex","time_pivot","deck_arc","heatmap","deck_grid","dual_line","deck_screengrid","line_multi","treemap","box_plot","sunburst","sankey","word_cloud","mapbox","kepler","cal_heatmap","rose","bubble","deck_geojson","horizon","deck_multi","compare","partition","event_flow","deck_path","graph_chart","world_map","paired_ttest","para","country_map"],x=new Set(E),T=1090,C=(0,d.t)("Other"),S=(0,d.t)("All charts"),A=[(0,d.t)("Popular"),(0,d.t)("ECharts"),(0,d.t)("Advanced-Analytics")],w=u.iK.div`
  ${({isSelectedVizMetadata:e})=>`\n    display: grid;\n    grid-template-rows: ${e?"auto minmax(100px, 1fr) minmax(200px, 35%)":"auto minmax(100px, 1fr)"};\n    // em is used here because the sidebar should be sized to fit the longest standard tag\n    grid-template-columns: minmax(14em, auto) 5fr;\n    grid-template-areas:\n      'sidebar search'\n      'sidebar main'\n      'details details';\n    height: 70vh;\n    overflow: auto;\n  `}
`,N=u.iK.h3`
  margin-top: 0;
  margin-bottom: ${({theme:e})=>2*e.gridUnit}px;
  font-size: ${({theme:e})=>e.typography.sizes.l}px;
  font-weight: ${({theme:e})=>e.typography.weights.bold};
  line-height: ${({theme:e})=>6*e.gridUnit}px;
`,M=u.iK.div`
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  border-right: 1px solid ${({theme:e})=>e.colors.grayscale.light2};
  overflow: auto;

  .ant-collapse .ant-collapse-item {
    .ant-collapse-header {
      font-size: ${({theme:e})=>e.typography.sizes.s}px;
      color: ${({theme:e})=>e.colors.grayscale.base};
      padding-left: ${({theme:e})=>2*e.gridUnit}px;
      padding-bottom: ${({theme:e})=>e.gridUnit}px;
    }
    .ant-collapse-content .ant-collapse-content-box {
      display: flex;
      flex-direction: column;
      padding: 0 ${({theme:e})=>2*e.gridUnit}px;
    }
  }
`,k=u.iK.div`
  grid-area: main;
  overflow-y: auto;
`,R=u.iK.div`
  ${({theme:e})=>`\n    grid-area: search;\n    margin-top: ${3*e.gridUnit}px;\n    margin-bottom: ${e.gridUnit}px;\n    margin-left: ${3*e.gridUnit}px;\n    margin-right: ${3*e.gridUnit}px;\n    .ant-input-affix-wrapper {\n      padding-left: ${2*e.gridUnit}px;\n    }\n  `}
`,D=u.iK.div`
  display: flex;
  justify-content: center;
  align-items: center;
  color: ${({theme:e})=>e.colors.grayscale.base};
`,O=u.iK.button`
  ${({theme:e})=>`\n    all: unset; // remove default button styles\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n    cursor: pointer;\n    margin: ${e.gridUnit}px 0;\n    padding: 0 ${e.gridUnit}px;\n    border-radius: ${e.borderRadius}px;\n    line-height: 2em;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    position: relative;\n\n    &:focus {\n      outline: initial;\n    }\n\n    &.selected {\n      background-color: ${e.colors.primary.dark1};\n      color: ${e.colors.primary.light5};\n\n      svg {\n        color: ${e.colors.primary.light5};\n      }\n\n      &:hover {\n        .cancel {\n          visibility: visible;\n        }\n      }\n    }\n\n    & span:first-of-type svg {\n      margin-top: ${1.5*e.gridUnit}px;\n    }\n\n    .cancel {\n      visibility: hidden;\n    }\n  `}
`,L=u.iK.div`
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    ${({theme:e})=>24*e.gridUnit}px
  );
  grid-auto-rows: max-content;
  justify-content: space-evenly;
  grid-gap: ${({theme:e})=>2*e.gridUnit}px;
  justify-items: center;
  // for some reason this padding doesn't seem to apply at the bottom of the container. Why is a mystery.
  padding: ${({theme:e})=>2*e.gridUnit}px;
`,P=e=>m.iv`
  grid-area: details;
  border-top: 1px solid ${e.colors.grayscale.light2};
`,$=e=>m.iv`
  padding: ${4*e.gridUnit}px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    'viz-name examples-header'
    'viz-tags examples'
    'description examples';
`,F=u.iK.div`
  grid-area: viz-tags;
  width: ${({theme:e})=>120*e.gridUnit}px;
  padding-right: ${({theme:e})=>14*e.gridUnit}px;
  padding-bottom: ${({theme:e})=>2*e.gridUnit}px;
`,I=u.iK.p`
  grid-area: description;
  overflow: auto;
  padding-right: ${({theme:e})=>14*e.gridUnit}px;
  margin: 0;
`,U=u.iK.div`
  grid-area: examples;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: auto;
  gap: ${({theme:e})=>4*e.gridUnit}px;

  img {
    height: 100%;
    border-radius: ${({theme:e})=>e.gridUnit}px;
    border: 1px solid ${({theme:e})=>e.colors.grayscale.light2};
  }
`,z=e=>m.iv`
  cursor: pointer;
  width: ${24*e.gridUnit}px;
  position: relative;

  img {
    min-width: ${24*e.gridUnit}px;
    min-height: ${24*e.gridUnit}px;
    border: 1px solid ${e.colors.grayscale.light2};
    border-radius: ${e.gridUnit}px;
    transition: border-color ${e.transitionTiming};
  }

  &.selected img {
    border: 2px solid ${e.colors.primary.light2};
  }

  &:hover:not(.selected) img {
    border: 1px solid ${e.colors.grayscale.light1};
  }

  .viztype-label {
    margin-top: ${2*e.gridUnit}px;
    text-align: center;
  }
`,B=u.iK.div`
  ${({theme:e})=>`\n    border: 1px solid ${e.colors.primary.dark1};\n    box-sizing: border-box;\n    border-radius: ${e.gridUnit}px;\n    background: ${e.colors.grayscale.light5};\n    line-height: ${2.5*e.gridUnit}px;\n    color: ${e.colors.primary.dark1};\n    font-size: ${e.typography.sizes.s}px;\n    font-weight: ${e.typography.weights.bold};\n    text-align: center;\n    padding: ${.5*e.gridUnit}px ${e.gridUnit}px;\n    text-transform: uppercase;\n    cursor: pointer;\n\n    div {\n      transform: scale(0.83,0.83);\n    }\n  `}
`,H=u.iK.div`
  position: absolute;
  right: ${({theme:e})=>e.gridUnit}px;
  top: ${({theme:e})=>19*e.gridUnit}px;
`,G=u.iK.div`
  display: inline-block !important;
  margin-left: ${({theme:e})=>2*e.gridUnit}px;
`;function W(e){return x.has(e.key)?E.indexOf(e.key):E.length}const Y=({entry:e,selectedViz:t,setSelectedViz:i})=>{const r=(0,u.Fg)(),{key:n,value:o}=e,a=t===e.key;return(0,m.tZ)("div",{role:"button",css:z(r),tabIndex:0,className:a?"selected":"",onClick:()=>i(n)},(0,m.tZ)("img",{alt:o.name,width:"100%",className:"viztype-selector "+(a?"selected":""),src:o.thumbnail}),(0,m.tZ)("div",{className:"viztype-label"},o.name),o.label&&(0,m.tZ)(H,null,(0,m.tZ)(B,null,(0,m.tZ)("div",null,(0,d.t)(o.label)))))},V=({vizEntries:e,...t})=>(0,m.tZ)(L,null,e.map((e=>(0,m.tZ)(Y,o()({key:e.key},t,{entry:e}))))),q=({selector:e,sectionId:t,icon:i,isSelected:r,onClick:n,className:o})=>{const l=(0,a.useRef)(null);return(0,a.useEffect)((()=>{r&&queueMicrotask((()=>(0,Z.default)(l.current,{behavior:"smooth",scrollMode:"if-needed"})))}),[]),(0,m.tZ)(O,{ref:l,key:e,name:e,className:c()(o,r&&"selected"),onClick:()=>n(e,t)},i,e)};function j(e){var t,i;const{selectedViz:n,onChange:o,className:s}=e,{mountedPluginMetadata:c}=(0,y.gp)(),u=(0,a.useRef)(),[Z,E]=(0,a.useState)(""),[x,T]=(0,a.useState)(!0),O=x&&!!Z,L=n?c[n]:null,z=(0,a.useMemo)((()=>{const e=Object.entries(c).map((([e,t])=>({key:e,value:t}))).filter((({value:e})=>(0,_.X3)(e.behaviors||[])&&!e.deprecated));return e.sort(((e,t)=>W(e)-W(t))),e}),[c]),H=(0,a.useMemo)((()=>{const e={};return z.forEach((t=>{const i=t.value.category||C;e[i]||(e[i]=[]),e[i].push(t)})),e}),[z]),Y=(0,a.useMemo)((()=>Object.keys(H).sort(((e,t)=>e===C?1:t===C?-1:e.localeCompare(t)))),[H]),j=(0,a.useMemo)((()=>{const e={};return z.forEach((t=>{(t.value.tags||[]).forEach((i=>{e[i]||(e[i]=[]),e[i].push(t)}))})),e}),[z]),K=(0,a.useMemo)((()=>Object.keys(j).sort(((e,t)=>e.localeCompare(t))).filter((e=>-1===A.indexOf(e)))),[j]),X=(0,a.useMemo)((()=>z.sort(((e,t)=>e.key.localeCompare(t.key)))),[z]),[Q,J]=(0,a.useState)((()=>(null==L?void 0:L.category)||A[0])),[ee,te]=(0,a.useState)((()=>null!=L&&L.category?r.CATEGORY:r.RECOMMENDED_TAGS)),ie=(0,a.useMemo)((()=>new l.Z(z,{ignoreLocation:!0,threshold:.3,keys:["value.name","value.tags","value.description"]})),[z]),re=(0,a.useMemo)((()=>""===Z.trim()?[]:ie.search(Z).map((e=>e.item)).sort(((e,t)=>{var i,r;const n=null==(i=e.value)?void 0:i.label,o=null==(r=t.value)?void 0:r.label,a=n&&p.eH[n]?p.eH[n].weight:0;return(o&&p.eH[o]?p.eH[o].weight:0)-a}))),[Z,ie]),ne=(0,a.useCallback)((()=>{T(!0)}),[]),oe=(0,a.useCallback)((e=>E(e.target.value)),[]),ae=(0,a.useCallback)((()=>{T(!1),E(""),u.current.blur()}),[]),le=(0,a.useCallback)(((e,t)=>{x&&ae(),J(e),te(t);const i=L&&((e,t)=>t===e.category||t===C&&null==e.category||(e.tags||[]).indexOf(t)>-1)(L,e);e===Q||i||o(null)}),[ae,x,Q,L,o]),se=(0,a.useMemo)((()=>({[r.RECOMMENDED_TAGS]:{title:(0,d.t)("Recommended tags"),icon:(0,m.tZ)(v.Z.Tags,null),selectors:A},[r.CATEGORY]:{title:(0,d.t)("Category"),icon:(0,m.tZ)(v.Z.Category,null),selectors:Y},[r.TAGS]:{title:(0,d.t)("Tags"),icon:(0,m.tZ)(v.Z.Tags,null),selectors:K}})),[Y,K]);return(0,m.tZ)(w,{className:s,isSelectedVizMetadata:Boolean(L)},(0,m.tZ)(M,null,(0,m.tZ)(q,{css:({gridUnit:e})=>m.iv`
              margin: ${2*e}px;
              margin-bottom: 0;
            `,sectionId:r.ALL_CHARTS,selector:S,icon:(0,m.tZ)(v.Z.Ballot,null),isSelected:!O&&S===Q&&r.ALL_CHARTS===ee,onClick:le}),(0,m.tZ)(h.Ol,{expandIconPosition:"right",ghost:!0,defaultActiveKey:Object.keys(se)},Object.keys(se).map((e=>{const t=se[e];return(0,m.tZ)(h.Ol.Panel,{header:(0,m.tZ)("span",{className:"header"},t.title),key:e},t.selectors.map((i=>(0,m.tZ)(q,{key:i,selector:i,sectionId:e,icon:t.icon,isSelected:!O&&i===Q&&e===ee,onClick:le}))))})))),(0,m.tZ)(R,null,(0,m.tZ)(f.II,{type:"text",ref:u,value:Z,placeholder:(0,d.t)("Search all charts"),onChange:oe,onFocus:ne,prefix:(0,m.tZ)(D,null,(0,m.tZ)(v.Z.Search,{iconSize:"m"})),suffix:(0,m.tZ)(D,null,Z&&(0,m.tZ)(v.Z.XLarge,{iconSize:"m",onClick:ae}))})),(0,m.tZ)(k,null,(0,m.tZ)(V,{vizEntries:O?re:Q===S&&ee===r.ALL_CHARTS?X:ee===r.CATEGORY&&H[Q]?H[Q]:ee!==r.TAGS&&ee!==r.RECOMMENDED_TAGS||!j[Q]?[]:j[Q],selectedViz:n,setSelectedViz:o})),L?(0,m.tZ)("div",{css:e=>[P(e),$(e)]},(0,m.tZ)(a.Fragment,null,(0,m.tZ)(N,{css:m.iv`
                grid-area: viz-name;
                position: relative;
              `},null==L?void 0:L.name,(null==L?void 0:L.label)&&(0,m.tZ)(g.u,{id:"viz-badge-tooltip",placement:"top",title:null!=(t=L.labelExplanation)?t:p.t$[L.label]},(0,m.tZ)(G,null,(0,m.tZ)(B,null,(0,m.tZ)("div",null,(0,d.t)(L.label)))))),(0,m.tZ)(F,null,null==L?void 0:L.tags.map((e=>(0,m.tZ)(b.Z,{key:e},e)))),(0,m.tZ)(I,null,(null==L?void 0:L.description)||(0,d.t)("No description available.")),(0,m.tZ)(N,{css:m.iv`
                grid-area: examples-header;
              `},!(null==L||null==(i=L.exampleGallery)||!i.length)&&(0,d.t)("Examples")),(0,m.tZ)(U,null,((null==L?void 0:L.exampleGallery)||[]).map((e=>(0,m.tZ)("img",{src:e.url,alt:e.caption,title:e.caption})))))):null)}}}]);