"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3403],{36750:(t,e,o)=>{o.d(e,{Z:()=>a});var r=o(4942),n=o(5259),i=o(11482),s=o(77552),l=o(33230);class a extends n.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}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}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:o}=this.props;return o&&o[t]&&o[t].type||e}getSubLayerRow(t,e,o){return t.__source={parent:this,object:e,index:o},t}getSubLayerAccessor(t){if("function"==typeof t){const e={index:-1,data:this.props.data,target:[]};return(o,r)=>o&&o.__source?(e.index=o.__source.index,t(o.__source.object,e)):t(o,r)}return t}getSubLayerProps(t={}){var e;const{opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:u,highlightColor:c,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:h,positionFormat:g,modelMatrix:f,extensions:y,fetch:b,operation:m,_subLayerProps:v}=this.props,_={id:"",updateTriggers:{},opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:u,highlightColor:c,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:h,positionFormat:g,modelMatrix:f,extensions:y,fetch:b,operation:m},x=v&&t.id&&v[t.id],w=x&&x.updateTriggers,k=t.id||"sublayer";if(x){const e=this.props[l.Wb],o=t.type?t.type._propTypes:{};for(const t in x){const r=o[t]||e[t];r&&"accessor"===r.type&&(x[t]=this.getSubLayerAccessor(x[t]))}}Object.assign(_,t,x),_.id="".concat(this.props.id,"-").concat(k),_.updateTriggers={all:null===(e=this.props.updateTriggers)||void 0===e?void 0:e.all,...t.updateTriggers,...w};for(const t of y){const e=t.getSubLayerProps.call(this,t);e&&Object.assign(_,e,{updateTriggers:Object.assign(_.updateTriggers,e.updateTriggers)})}return _}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let o=this.internalState.subLayers;const r=!o||this.needsUpdate();if(r){const t=this.renderLayers();o=(0,s.x)(t,Boolean),this.internalState.subLayers=o}(0,i.Z)("compositeLayer.renderLayers",this,r,o);for(const t of o)t.parent=this}}(0,r.Z)(a,"layerName","CompositeLayer")},32103:(t,e,o)=>{o.d(e,{Kv:()=>l,T4:()=>a,Ul:()=>u,Z6:()=>s,ZU:()=>c}),o(67294);var r=o(68924),n=o(11965);const i=new r.FilterXSS({whiteList:{...(0,r.getDefaultWhiteList)(),span:["style","class","title"],div:["style","class"],a:["style","class","href","title","target"],img:["style","class","src","alt","title","width","height"],video:["autoplay","controls","loop","preload","src","height","width","muted"]},stripIgnoreTag:!0,css:!1});function s(t){return i.process(t)}function l(t){return Array.from((new DOMParser).parseFromString(t,"text/html").body.childNodes).some((({nodeType:t})=>1===t))}function a(t){return l(t)?s(t):t}function u(t){return l(t)?(0,n.tZ)("span",{className:"safe-html-wrapper",dangerouslySetInnerHTML:{__html:s(t)}}):t}function c(t){return t.replace(/<[^>]*>/g,"")}},34634:(t,e,o)=>{o.d(e,{F:()=>f});var r=o(18446),n=o.n(r),i=o(67294),s=o(90530),l=o(10025),a=o(85716),u=o(51995),c=o(32103),p=o(11965);const d=u.iK.div`
  ${({theme:t,top:e,left:o})=>`\n    position: absolute;\n    top: ${e}px;\n    left: ${o}px;\n    padding: ${2*t.gridUnit}px;\n    margin: ${2*t.gridUnit}px;\n    background: ${t.colors.grayscale.dark2};\n    color: ${t.colors.grayscale.light5};\n    maxWidth: 300px;\n    fontSize: ${t.typography.sizes.s}px;\n    zIndex: 9;\n    pointerEvents: none;\n  `}
`;function h(t){const{tooltip:e}=t;if(null==e)return null;const{x:o,y:r,content:n}=e,i="string"==typeof n?(0,c.Ul)(n):n;return(0,p.tZ)(d,{top:r,left:o},i)}const g=(0,i.memo)((0,i.forwardRef)(((t,e)=>{const[o,r]=(0,i.useState)(null),[u,c]=(0,i.useState)(null),[d,g]=(0,i.useState)(t.viewport),f=(0,a.D)(t.viewport);(0,i.useImperativeHandle)(e,(()=>({setTooltip:r})),[]);const y=(0,i.useCallback)((()=>{if(u&&Date.now()-u>250){const e=t.setControlValue;e&&e("viewport",d),c(null)}}),[u,t.setControlValue,d]);(0,i.useEffect)((()=>{const t=setInterval(y,250);return clearInterval(t)}),[y]),(0,i.useEffect)((()=>{n()(t.viewport,f)||g(t.viewport)}),[f,t.viewport]);const b=(0,i.useCallback)((({viewState:t})=>{g(t),c(Date.now())}),[]),m=(0,i.useCallback)((()=>t.layers.some((t=>"function"==typeof t))?t.layers.map((t=>"function"==typeof t?t():t)):t.layers),[t.layers]),{children:v=null,height:_,width:x}=t;return(0,p.tZ)(i.Fragment,null,(0,p.tZ)("div",{style:{position:"relative",width:x,height:_}},(0,p.tZ)(l.Z,{controller:!0,width:x,height:_,layers:m(),viewState:d,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:b},(0,p.tZ)(s.Z3,{preserveDrawingBuffer:!0,mapStyle:t.mapStyle||"light",mapboxApiAccessToken:t.mapboxApiAccessToken})),v),(0,p.tZ)(h,{tooltip:o}))}))),f=(0,u.iK)(g)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},51805:(t,e,o)=>{o.d(e,{Z:()=>n}),o(67294);var r=o(11965);const n=({label:t,value:e})=>(0,r.tZ)("div",null,t,(0,r.tZ)("strong",null,e))},1262:(t,e,o)=>{o.r(e),o.d(e,{default:()=>k,getLayer:()=>x});var r=o(67294),n=o(69588),i=o(29319),s=o.n(i),l=o(34634),a=o(89503),u=o(63241),c=o(58371),p=o(51805),d=o(40461),h=o(11965);const g={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},f=(t,e)=>{const o={};return Object.keys(t).forEach((e=>{e in g?o[g[e]]=t[e]:o[e]=t[e]})),"string"==typeof t.fillColor&&(o.fillColor=(0,a.hexToRGB)(t.fillColor)),"string"==typeof t.strokeColor&&(o.strokeColor=(0,a.hexToRGB)(t.strokeColor)),{...o,...e}};let y;const b=(t,e,o)=>{if(null!=t&&t.features&&t.features.forEach((r=>{b(r,e,t.extraProps||o)})),null!=t&&t.geometry){const r={...t,properties:f(t.properties,e)};r.extraProps||(r.extraProps=o),y.push(r)}};function m(t){var e;return(null==(e=t.object)?void 0:e.extraProps)&&(0,h.tZ)("div",{className:"deckgl-tooltip"},Object.keys(t.object.extraProps).map(((e,o)=>{var r;return(0,h.tZ)(p.Z,{key:`prop-${o}`,label:`${e}: `,value:`${null==(r=t.object.extraProps)?void 0:r[e]}`})})))}const v=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.fillColor},_=t=>{var e;return null==t||null==(e=t.properties)?void 0:e.strokeColor};function x(t,e,o,r){const i=t,s=i.fill_color_picker,l=i.stroke_color_picker,a=[s.r,s.g,s.b,255*s.a],p=[l.r,l.g,l.b,255*l.a],d={};let h;return a[3]>0&&(d.fillColor=a),p[3]>0&&(d.strokeColor=p),y=[],b(e.data,d),i.js_data_mutator&&(h=(0,u.Z)(i.js_data_mutator),y=h(y)),new n.Z({id:`geojson-layer-${i.slice_id}`,data:y,extruded:i.extruded,filled:i.filled,stroked:i.stroked,getFillColor:v,getLineColor:_,getLineWidth:i.line_width||1,pointRadiusScale:i.point_radius_scale,lineWidthUnits:i.line_width_unit,...(0,c.N)(i,r,m)})}const w=t=>{var e;const o=(0,r.useRef)(),n=(0,r.useCallback)((t=>{const{current:e}=o;e&&e.setTooltip(t)}),[]),{formData:i,payload:a,setControlValue:u,onAddFilter:c,height:p,width:g}=t,f=(0,r.useMemo)((()=>{if(i.autozoom){var e,o;const r=(null==a||null==(e=a.data)||null==(o=e.features)||null==o.reduce?void 0:o.reduce(((t,e)=>{const o=s()(e);return o?[...t,[o[0],o[1]],[o[2],o[3]]]:t}),[]))||[];if(r.length)return(0,d.Z)(t.viewport,{width:g,height:p,points:r})}return t.viewport}),[i.autozoom,p,null==a||null==(e=a.data)?void 0:e.features,t.viewport,g]),y=x(i,a,0,n);return(0,h.tZ)(l.F,{ref:o,mapboxApiAccessToken:a.data.mapboxApiKey,viewport:f,layers:[y],mapStyle:i.mapbox_style,setControlValue:u,height:p,width:g})},k=(0,r.memo)(w)},58371:(t,e,o)=>{o.d(e,{N:()=>i,Z:()=>l});var r=o(4065),n=o(63241);function i(t,e,o,r){const i=t;let s,l,a=o;return i.js_tooltip&&(a=(0,n.Z)(i.js_tooltip)),a&&(s=t=>(t.picked?e({content:a(t),x:t.x,y:t.y}):e(null),!0)),i.js_onclick_href?l=t=>{const e=(0,n.Z)(i.js_onclick_href)(t);return window.open(e),!0}:i.table_filter&&void 0!==r&&(l=t=>(r(t.object[i.line_column]),!0)),{onClick:l,onHover:s,pickable:Boolean(s)}}const s={p1:.01,p5:.05,p95:.95,p99:.99};function l(t="sum",e=null){if("count"===t)return t=>t.length;let o;return o=t in s?(o,n)=>{let i;return i=e?o.sort(((t,o)=>r.ascending(e(t),e(o)))):o.sort(r.ascending),r.quantile(i,s[t],n)}:r[t],e?t=>o(t.map((t=>e(t)))):t=>o(t)}},89503:(t,e,o)=>{o.r(e),o.d(e,{hexToRGB:()=>n});var r=o(50667);function n(t,e=255){if(!t)return[0,0,0,e];const{r:o,g:n,b:i}=(0,r.B8)(t);return[o,n,i,e]}},40461:(t,e,o)=>{o.d(e,{Z:()=>a});var r=o(17013),n=o(4065);const i=[-90,90],s=[-180,180];function l([t,e],[o,r],n=.25){return t<e?[t,e]:[Math.max(o,t-n),Math.min(r,e+n)]}function a(t,{points:e,width:o,height:a,minExtent:u,maxZoom:c,offset:p,padding:d=20}){const{bearing:h,pitch:g}=t,f=function(t){const e=l((0,n.extent)(t,(t=>t[1])),i),o=l((0,n.extent)(t,(t=>t[0])),s);return[[o[0],e[0]],[o[1],e[1]]]}(e);try{return{...(0,r.Xg)({bounds:f,width:o,height:a,minExtent:u,maxZoom:c,offset:p,padding:d}),bearing:h,pitch:g}}catch(t){console.error("Could not fit viewport",t)}return t}},63241:(t,e,o)=>{o.d(e,{Z:()=>u});var r=o(55140),n=o.n(r),i=o(59050),s=o(4065),l=o(89503);const a={console,_:i.ZP,colors:l,d3array:s};function u(t,e,o){const r={},i=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;r[i]={};const s=`${i}=${t}`,l={...a,...e};Object.keys(l).forEach((t=>{r[t]=l[t]}));try{return n().runInNewContext(s,r,o),r[i]}catch(t){return()=>t}}}}]);
//# sourceMappingURL=5a0b263b3d851f310096.chunk.js.map