"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[3403],{336750:(e,t,o)=>{o.d(t,{Z:()=>a});var r=o(204942),n=o(905259),i=o(911482),s=o(77552),l=o(33230);class a extends n.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((e=>e.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(e){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){const{object:t}=e;return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id?(e.object=t.__source.object,e.index=t.__source.index,e):e}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){const{_subLayerProps:o}=this.props;return o&&o[e]&&o[e].type||t}getSubLayerRow(e,t,o){return e.__source={parent:this,object:t,index:o},e}getSubLayerAccessor(e){if("function"==typeof e){const t={index:-1,data:this.props.data,target:[]};return(o,r)=>o&&o.__source?(t.index=o.__source.index,e(o.__source.object,t)):e(o,r)}return e}getSubLayerProps(e={}){var t;const{opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:c,highlightColor:u,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:h,positionFormat:g,modelMatrix:f,extensions:y,fetch:b,operation:v,_subLayerProps:m}=this.props,x={id:"",updateTriggers:{},opacity:o,pickable:r,visible:n,parameters:i,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:c,highlightColor:u,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:h,positionFormat:g,modelMatrix:f,extensions:y,fetch:b,operation:v},_=m&&e.id&&m[e.id],k=_&&_.updateTriggers,w=e.id||"sublayer";if(_){const t=this.props[l.Wb],o=e.type?e.type._propTypes:{};for(const e in _){const r=o[e]||t[e];r&&"accessor"===r.type&&(_[e]=this.getSubLayerAccessor(_[e]))}}Object.assign(x,e,_),x.id="".concat(this.props.id,"-").concat(w),x.updateTriggers={all:null===(t=this.props.updateTriggers)||void 0===t?void 0:t.all,...e.updateTriggers,...k};for(const e of y){const t=e.getSubLayerProps.call(this,e);t&&Object.assign(x,t,{updateTriggers:Object.assign(x.updateTriggers,t.updateTriggers)})}return x}_updateAutoHighlight(e){for(const t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_postUpdate(e,t){let o=this.internalState.subLayers;const r=!o||this.needsUpdate();if(r){const e=this.renderLayers();o=(0,s.x)(e,Boolean),this.internalState.subLayers=o}(0,i.Z)("compositeLayer.renderLayers",this,r,o);for(const e of o)e.parent=this}}(0,r.Z)(a,"layerName","CompositeLayer")},334634:(e,t,o)=>{o.d(t,{F:()=>f});var r=o(618446),n=o.n(r),i=o(667294),s=o(490530),l=o(516145),a=o(785716),c=o(751995),u=o(332103),p=o(135944);const d=c.iK.div`
  ${({theme:e,top:t,left:o})=>`\n    position: absolute;\n    top: ${t}px;\n    left: ${o}px;\n    padding: ${2*e.gridUnit}px;\n    margin: ${2*e.gridUnit}px;\n    background: ${e.colors.grayscale.dark2};\n    color: ${e.colors.grayscale.light5};\n    maxWidth: 300px;\n    fontSize: ${e.typography.sizes.s}px;\n    zIndex: 9;\n    pointerEvents: none;\n  `}
`;function h(e){const{tooltip:t}=e;if(null==t)return null;const{x:o,y:r,content:n}=t,i="string"==typeof n?(0,u.Ul)(n):n;return(0,p.tZ)(d,{top:r,left:o,children:i})}const g=(0,i.memo)((0,i.forwardRef)(((e,t)=>{const[o,r]=(0,i.useState)(null),[c,u]=(0,i.useState)(null),[d,g]=(0,i.useState)(e.viewport),f=(0,a.D)(e.viewport);(0,i.useImperativeHandle)(t,(()=>({setTooltip:r})),[]);const y=(0,i.useCallback)((()=>{if(c&&Date.now()-c>250){const t=e.setControlValue;t&&t("viewport",d),u(null)}}),[c,e.setControlValue,d]);(0,i.useEffect)((()=>{const e=setInterval(y,250);return clearInterval(e)}),[y]),(0,i.useEffect)((()=>{n()(e.viewport,f)||g(e.viewport)}),[f,e.viewport]);const b=(0,i.useCallback)((({viewState:e})=>{g(e),u(Date.now())}),[]),v=(0,i.useCallback)((()=>e.layers.some((e=>"function"==typeof e))?e.layers.map((e=>"function"==typeof e?e():e)):e.layers),[e.layers]),{children:m=null,height:x,width:_}=e;return(0,p.BX)(p.HY,{children:[(0,p.BX)("div",{style:{position:"relative",width:_,height:x},children:[(0,p.tZ)(l.Z,{controller:!0,width:_,height:x,layers:v(),viewState:d,glOptions:{preserveDrawingBuffer:!0},onViewStateChange:b,children:(0,p.tZ)(s.Z3,{preserveDrawingBuffer:!0,mapStyle:e.mapStyle||"light",mapboxApiAccessToken:e.mapboxApiAccessToken})}),m]}),(0,p.tZ)(h,{tooltip:o})]})}))),f=(0,c.iK)(g)`
  .deckgl-tooltip > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
`},51805:(e,t,o)=>{o.d(t,{Z:()=>n});var r=o(135944);const n=({label:e,value:t})=>(0,r.BX)("div",{children:[e,(0,r.tZ)("strong",{children:t})]})},1262:(e,t,o)=>{o.r(t),o.d(t,{default:()=>w,getLayer:()=>_});var r=o(667294),n=o(763521),i=o(629319),s=o.n(i),l=o(334634),a=o(889503),c=o(363241),u=o(58371),p=o(51805),d=o(340461),h=o(135944);const g={fillColor:"fillColor",color:"fillColor",fill:"fillColor","fill-color":"fillColor",strokeColor:"strokeColor","stroke-color":"strokeColor","stroke-width":"strokeWidth"},f=(e,t)=>{const o={};return Object.keys(e).forEach((t=>{t in g?o[g[t]]=e[t]:o[t]=e[t]})),"string"==typeof e.fillColor&&(o.fillColor=(0,a.hexToRGB)(e.fillColor)),"string"==typeof e.strokeColor&&(o.strokeColor=(0,a.hexToRGB)(e.strokeColor)),{...o,...t}};let y;const b=(e,t,o)=>{if(null!=e&&e.features&&e.features.forEach((r=>{b(r,t,e.extraProps||o)})),null!=e&&e.geometry){const r={...e,properties:f(e.properties,t)};r.extraProps||(r.extraProps=o),y.push(r)}};function v(e){var t;return(null==(t=e.object)?void 0:t.extraProps)&&(0,h.tZ)("div",{className:"deckgl-tooltip",children:Object.keys(e.object.extraProps).map(((t,o)=>{var r;return(0,h.tZ)(p.Z,{label:`${t}: `,value:`${null==(r=e.object.extraProps)?void 0:r[t]}`},`prop-${o}`)}))})}const m=e=>{var t;return null==e||null==(t=e.properties)?void 0:t.fillColor},x=e=>{var t;return null==e||null==(t=e.properties)?void 0:t.strokeColor};function _(e,t,o,r){const i=e,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(t.data,d),i.js_data_mutator&&(h=(0,c.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:m,getLineColor:x,getLineWidth:i.line_width||1,pointRadiusScale:i.point_radius_scale,lineWidthUnits:i.line_width_unit,...(0,u.N)(i,r,v)})}const k=e=>{var t;const o=(0,r.useRef)(),n=(0,r.useCallback)((e=>{const{current:t}=o;t&&t.setTooltip(e)}),[]),{formData:i,payload:a,setControlValue:c,onAddFilter:u,height:p,width:g}=e,f=(0,r.useMemo)((()=>{if(i.autozoom){var t,o;const r=(null==a||null==(t=a.data)||null==(o=t.features)||null==o.reduce?void 0:o.reduce(((e,t)=>{const o=s()(t);return o?[...e,[o[0],o[1]],[o[2],o[3]]]:e}),[]))||[];if(r.length)return(0,d.Z)(e.viewport,{width:g,height:p,points:r})}return e.viewport}),[i.autozoom,p,null==a||null==(t=a.data)?void 0:t.features,e.viewport,g]),y=_(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:c,height:p,width:g})},w=(0,r.memo)(k)},58371:(e,t,o)=>{o.d(t,{N:()=>i,Z:()=>l});var r=o(804065),n=o(363241);function i(e,t,o,r){const i=e;let s,l,a=o;return i.js_tooltip&&(a=(0,n.Z)(i.js_tooltip)),a&&(s=e=>(e.picked?t({content:a(e),x:e.x,y:e.y}):t(null),!0)),i.js_onclick_href?l=e=>{const t=(0,n.Z)(i.js_onclick_href)(e);return window.open(t),!0}:i.table_filter&&void 0!==r&&(l=e=>(r(e.object[i.line_column]),!0)),{onClick:l,onHover:s,pickable:Boolean(s)}}const s={p1:.01,p5:.05,p95:.95,p99:.99};function l(e="sum",t=null){if("count"===e)return e=>e.length;let o;return o=e in s?(o,n)=>{let i;return i=t?o.sort(((e,o)=>r.ascending(t(e),t(o)))):o.sort(r.ascending),r.quantile(i,s[e],n)}:r[e],t?e=>o(e.map((e=>t(e)))):e=>o(e)}},889503:(e,t,o)=>{o.r(t),o.d(t,{hexToRGB:()=>n});var r=o(250667);function n(e,t=255){if(!e)return[0,0,0,t];const{r:o,g:n,b:i}=(0,r.B8)(e);return[o,n,i,t]}},340461:(e,t,o)=>{o.d(t,{Z:()=>a});var r=o(517013),n=o(804065);const i=[-90,90],s=[-180,180];function l([e,t],[o,r],n=.25){return e<t?[e,t]:[Math.max(o,e-n),Math.min(r,t+n)]}function a(e,{points:t,width:o,height:a,minExtent:c,maxZoom:u,offset:p,padding:d=20}){const{bearing:h,pitch:g}=e,f=function(e){const t=l((0,n.extent)(e,(e=>e[1])),i),o=l((0,n.extent)(e,(e=>e[0])),s);return[[o[0],t[0]],[o[1],t[1]]]}(t);try{return{...(0,r.Xg)({bounds:f,width:o,height:a,minExtent:c,maxZoom:u,offset:p,padding:d}),bearing:h,pitch:g}}catch(e){console.error("Could not fit viewport",e)}return e}},363241:(e,t,o)=>{o.d(t,{Z:()=>c});var r=o(455140),n=o.n(r),i=o(59050),s=o(804065),l=o(889503);const a={console,_:i.ZP,colors:l,d3array:s};function c(e,t,o){const r={},i=`SAFE_EVAL_${Math.floor(1e6*Math.random())}`;r[i]={};const s=`${i}=${e}`,l={...a,...t};Object.keys(l).forEach((e=>{r[e]=l[e]}));try{return n().runInNewContext(s,r,o),r[i]}catch(e){return()=>e}}}}]);
//# sourceMappingURL=a2fd68e11e66304dec46.chunk.js.map