(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3745],{78918:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var o=r(95772),s=r(63803),i=r(61855);class n extends o.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id?(t.object=e.__source.object,t.index=e.__source.index,t):t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){const{_subLayerProps:r}=this.props;return e&&e.length||r&&r[t]}getSubLayerClass(t,e){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||e}getSubLayerRow(t,e,r){return t.__source={parent:this,object:e,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const e={data:this.props.data,target:[]};return(r,o)=>r&&r.__source?(e.index=r.__source.index,t(r.__source.object,e)):t(r,o)}return t}getSubLayerProps(t={}){const{opacity:e,pickable:r,visible:o,parameters:s,getPolygonOffset:i,highlightedObjectIndex:n,autoHighlight:a,highlightColor:l,coordinateSystem:p,coordinateOrigin:c,wrapLongitude:u,positionFormat:d,modelMatrix:h,extensions:g,fetch:f,_subLayerProps:y}=this.props,b={opacity:e,pickable:r,visible:o,parameters:s,getPolygonOffset:i,highlightedObjectIndex:n,autoHighlight:a,highlightColor:l,coordinateSystem:p,coordinateOrigin:c,wrapLongitude:u,positionFormat:d,modelMatrix:h,extensions:g,fetch:f},m=y&&y[t.id],_=m&&m.updateTriggers,S=t.id||"sublayer";if(m){const e=this.constructor._propTypes,r=t.type?t.type._propTypes:{};for(const t in m){const o=r[t]||e[t];o&&"accessor"===o.type&&(m[t]=this.getSubLayerAccessor(m[t]))}}Object.assign(b,t,m),b.id="".concat(this.props.id,"-").concat(S),b.updateTriggers={all:this.props.updateTriggers.all,...t.updateTriggers,..._};for(const t of g){const e=t.getSubLayerProps.call(this,t);e&&Object.assign(b,e,{updateTriggers:Object.assign(b.updateTriggers,e.updateTriggers)})}return b}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const e=!t||this.needsUpdate();e&&(t=this.renderLayers(),t=(0,i.x)(t,Boolean),this.internalState.subLayers=t),(0,s.Z)("compositeLayer.renderLayers",this,e,t);for(const e of t)e.parent=this}}n.layerName="CompositeLayer"},79362:(t,e,r)=>{"use strict";r.d(e,{F:()=>y});var o=r(18446),s=r.n(o),i=r(67294),n=r(45697),a=r.n(n),l=r(98601),p=r(65274),c=r(51995),u=r(68924),d=r(11965);function h(t){const{tooltip:e}=t;if(null==e)return null;const{x:r,y:o,content:s}=e,n=(0,i.useMemo)((()=>({position:"absolute",top:`${o}px`,left:`${r}px`,padding:"8px",margin:"8px",background:"rgba(0, 0, 0, 0.8)",color:"#fff",maxWidth:"300px",fontSize:"12px",zIndex:9,pointerEvents:"none"})),[r,o]);if("string"==typeof s){const t=(0,i.useMemo)((()=>({__html:(0,u.filterXSS)(s,{stripIgnoreTag:!0})})),[s]);return(0,d.tZ)("div",{style:n},(0,d.tZ)("div",{dangerouslySetInnerHTML:t}))}return(0,d.tZ)("div",{style:n},s)}const g={viewport:a().object.isRequired,layers:a().array.isRequired,setControlValue:a().func,mapStyle:a().string,mapboxApiAccessToken:a().string.isRequired,children:a().node,bottomMargin:a().number,width:a().number.isRequired,height:a().number.isRequired,onViewportChange:a().func};class f extends i.Component{constructor(t){super(t),this.setTooltip=t=>{this.setState({tooltip:t})},this.tick=this.tick.bind(this),this.onViewStateChange=this.onViewStateChange.bind(this),this.state={timer:setInterval(this.tick,250),tooltip:null,viewState:t.viewport}}UNSAFE_componentWillReceiveProps(t){s()(t.viewport,this.props.viewport)||this.setState({viewState:t.viewport})}componentWillUnmount(){clearInterval(this.state.timer)}onViewStateChange({viewState:t}){this.setState({viewState:t,lastUpdate:Date.now()})}tick(){const{lastUpdate:t}=this.state;if(t&&Date.now()-t>250){const t=this.props.setControlValue;t&&t("viewport",this.state.viewState),this.setState({lastUpdate:null})}}layers(){return this.props.layers.some((t=>"function"==typeof t))?this.props.layers.map((t=>"function"==typeof t?t():t)):this.props.layers}render(){const{children:t,bottomMargin:e,height:r,width:o}=this.props,{viewState:s,tooltip:n}=this.state,a=r-e,c=this.layers();return(0,d.tZ)(i.Fragment,null,(0,d.tZ)("div",{style:{position:"relative",width:o,height:a}},(0,d.tZ)(p.Z,{initWebGLParameters:!0,controller:!0,width:o,height:a,layers:c,viewState:s,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:this.onViewStateChange},(0,d.tZ)(l.Z3,{preserveDrawingBuffer:!0,mapStyle:this.props.mapStyle,mapboxApiAccessToken:this.props.mapboxApiAccessToken})),t),(0,d.tZ)(h,{tooltip:n}))}}f.propTypes=g,f.defaultProps={mapStyle:"light",setControlValue:()=>{},children:null,bottomMargin:0};const y=(0,c.iK)(f)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},1740:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var o=r(67294),s=r(45697),i=r.n(s),n=r(11965);const a={label:i().string.isRequired,value:i().string.isRequired};class l extends o.PureComponent{render(){const{label:t,value:e}=this.props;return(0,n.tZ)("div",null,t,(0,n.tZ)("strong",null,e))}}l.propTypes=a},3251:(t,e,r)=>{"use strict";r.r(e),r.d(e,{getLayer:()=>m,default:()=>x});var o=r(67294),s=r(45697),i=r.n(s),n=r(21497),a=r(79362),l=r(64106),p=r(21207),c=r(52154),u=r(1740),d=r(11965);const h={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},g=(t,e)=>{const r={};return Object.keys(t).forEach((e=>{e in h?r[h[e]]=t[e]:r[e]=t[e]})),"string"==typeof t.fillColor&&(r.fillColor=(0,l.hexToRGB)(t.fillColor)),"string"==typeof t.strokeColor&&(r.strokeColor=(0,l.hexToRGB)(t.strokeColor)),{...r,...e}};let f;const y=(t,e,r)=>{if(t&&t.features&&t.features.forEach((o=>{y(o,e,t.extraProps||r)})),t&&t.geometry){const o={...t,properties:g(t.properties,e)};o.extraProps||(o.extraProps=r),f.push(o)}};function b(t){return t.object.extraProps&&(0,d.tZ)("div",{className:"deckgl-tooltip"},Object.keys(t.object.extraProps).map(((e,r)=>(0,d.tZ)(u.Z,{key:`prop-${r}`,label:`${e}: `,value:`${t.object.extraProps[e]}`}))))}function m(t,e,r,o){const s=t,i=s.fill_color_picker,a=s.stroke_color_picker,l=[i.r,i.g,i.b,255*i.a],u=[a.r,a.g,a.b,255*a.a],d={};let h;return l[3]>0&&(d.fillColor=l),u[3]>0&&(d.strokeColor=u),f=[],y(e.data,d),s.js_data_mutator&&(h=(0,p.Z)(s.js_data_mutator),f=h(f)),new n.Z({id:`geojson-layer-${s.slice_id}`,filled:s.filled,data:f,stroked:s.stroked,extruded:s.extruded,pointRadiusScale:s.point_radius_scale,...(0,c.N)(s,o,b)})}const _={formData:i().object.isRequired,payload:i().object.isRequired,setControlValue:i().func.isRequired,viewport:i().object.isRequired,onAddFilter:i().func},S={onAddFilter(){}};class v extends o.Component{constructor(...t){super(...t),this.containerRef=o.createRef(),this.setTooltip=t=>{const{current:e}=this.containerRef;e&&e.setTooltip(t)}}render(){const{formData:t,payload:e,setControlValue:r,onAddFilter:o,viewport:s}=this.props,i=m(t,e,0,this.setTooltip);return(0,d.tZ)(a.F,{ref:this.containerRef,mapboxApiAccessToken:e.data.mapboxApiKey,viewport:s,layers:[i],mapStyle:t.mapbox_style,setControlValue:r})}}v.propTypes=_,v.defaultProps=S;const x=v},52154:(t,e,r)=>{"use strict";r.d(e,{N:()=>i,Z:()=>a});var o=r(4065),s=r(21207);function i(t,e,r,o){const i=t;let n,a,l=r;return i.js_tooltip&&(l=(0,s.Z)(i.js_tooltip)),l&&(n=t=>{t.picked?e({content:l(t),x:t.x,y:t.y}):e(null)}),i.js_onclick_href?a=t=>{const e=(0,s.Z)(i.js_onclick_href)(t);window.open(e)}:i.table_filter&&void 0!==o&&(a=t=>o(t.object[i.line_column])),{onClick:a,onHover:n,pickable:Boolean(n)}}const n={p1:.01,p5:.05,p95:.95,p99:.99};function a(t="sum",e=null){if("count"===t)return t=>t.length;let r;return r=t in n?(r,s)=>{let i;return i=e?r.sort(((t,r)=>o.ascending(e(t),e(r)))):r.sort(o.ascending),o.quantile(i,n[t],s)}:o[t],e?t=>r(t.map((t=>e(t)))):t=>r(t)}},64106:(t,e,r)=>{"use strict";r.r(e),r.d(e,{hexToRGB:()=>s});var o=r(16372);function s(t,e=255){if(!t)return[0,0,0,e];const{r,g:s,b:i}=(0,o.B8)(t);return[r,s,i,e]}},21207:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var o=r(55140),s=r.n(o),i=r(77963),n=r(4065),a=r(64106);const l={console,_:i.ZP,colors:a,d3array:n};function p(t,e,r){const o={},i=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;o[i]={};const n=`${i}=${t}`,a={...l,...e};Object.keys(a).forEach((t=>{o[t]=a[t]}));try{return s().runInNewContext(n,o,r),o[i]}catch(t){return()=>t}}},92540:()=>{},75307:()=>{}}]);