text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rdeck=t():e.rdeck=t()}(self,(function(){return(()=>{var e,t={6153:(e,t,n)=>{"use strict";n.r(t),n.d(t,{VERSION:()=>ut,Widget:()=>ot,binding:()=>at,getWidgetById:()=>lt,getWidgets:()=>ct});var r={};n.r(r),n.d(r,{AGGREGATION_OPERATION:()=>c.KM,ArcLayer:()=>l.zv,BitmapLayer:()=>l.hz,CPUGridLayer:()=>c.ab,ColumnLayer:()=>l.eJ,ContourLayer:()=>c.YY,GPUGridLayer:()=>c.ML,GeoJsonLayer:()=>l.UW,GreatCircleLayer:()=>u.GJ,GridCellLayer:()=>l.cJ,GridLayer:()=>c.mU,H3ClusterLayer:()=>u.cH,H3HexagonLayer:()=>u.bW,HeatmapLayer:()=>c.zP,HexagonLayer:()=>c.dX,IconLayer:()=>l.eE,LineLayer:()=>l.Ie,MVTLayer:()=>u.i3,PathLayer:()=>l.nr,PointCloudLayer:()=>l.U5,PolygonLayer:()=>l.dW,S2Layer:()=>u.jJ,ScatterplotLayer:()=>l.pU,ScenegraphLayer:()=>d.S,ScreenGridLayer:()=>c.p3,SimpleMeshLayer:()=>d.L,SolidPolygonLayer:()=>l.PJ,TerrainLayer:()=>u.tr,TextLayer:()=>l.AB,Tile3DLayer:()=>u.cY,TileLayer:()=>u.Im,TripsLayer:()=>u.Fw,_AggregationLayer:()=>c.Di,_BinSorter:()=>c.l0,_CPUAggregator:()=>c.oA,_GPUGridAggregator:()=>c.Wc,_MultiIconLayer:()=>l.vb,_binaryToFeature:()=>l.ip,_findIndexBinary:()=>l.Ex});n(8559);var i=n(5893),s=n(3935),a=n(7294),o=n(3286),l=n(3810),c=n(3580),u=n(4898),d=n(1864),p=n(5736);const h=[0,0,0,255];function f([e,t,n,r=255]){return`rgba(${e}, ${t}, ${n}, ${r/255})`}function g(e,t){return Array.isArray(e)?t||4!==e.length?((t=null!=t?t:[])[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=3===e.length?e[3]:255,t):e:"string"==typeof e?(function(e,t){if(7===e.length){const n=parseInt(e.substring(1),16);t[0]=Math.floor(n/65536),t[1]=Math.floor(n/256%256),t[2]=n%256,t[3]=255}else if(9===e.length){const n=parseInt(e.substring(1),16);t[0]=Math.floor(n/16777216),t[1]=Math.floor(n/65536%256),t[2]=Math.floor(n/256%256),t[3]=n%256}}(e,t=null!=t?t:[]),t):h}var m=n(4884),y=n(5128),v=n(3446),b=n(6297),j=n(7603),x=n(6602);function w(e){return null!==e&&"object"==typeof e&&"accessor"===e.type}function O(e,t){const n=function({col:e,dataType:t},n){if("highlightColor"===n)switch(t){case"table":return function(e){return({index:t,layer:n})=>g(n.props.data.frame[e][t])}(e);case"object":return function(e){return({object:t})=>g(t[e])}(e);case"geojson":return function(e){return({object:t})=>g(t.properties[e])}(e);default:throw TypeError(`${t} not supported`)}if(n.endsWith("Color"))switch(t){case"table":return function(e){return(t,{index:n,data:r,target:i})=>g(r.frame[e][n],i)}(e);case"object":return function(e){return(t,{target:n})=>g(t[e],n)}(e);case"geojson":return function(e){return(t,{target:n})=>g(t.properties[e],n)}(e);default:throw TypeError(`${t} not supported`)}switch(t){case"table":return function(e){return(t,{index:n,data:r})=>r.frame[e][n]}(e);case"object":return function(e){return t=>t[e]}(e);case"geojson":return function(e){return t=>t.properties[e]}(e);default:throw TypeError(`${t} not supported`)}}(e,t);return{...e,getData:n}}function L(e){return w(e)&&"scale"in e}function N(e,t){"palette"in e&&(e.range=e.palette.map((e=>g(e))),e.unknown=g(e.unknown));const n=function(e){switch(e.scale){case"linear":return(0,m.Z)().domain(e.domain).range(e.range).unknown(e.unknown).clamp(!0);case"power":return(0,y.ZP)().exponent(e.exponent).domain(e.domain).range(e.range).unknown(e.unknown).clamp(!0);case"log":return(0,v.Z)().base(e.base).domain(e.domain).range(e.range).unknown(e.unknown).clamp(!0);case"threshold":case"quantile":return(0,b.Z)().domain(e.domain).range(e.range).unknown(e.unknown);case"category":return(0,j.Z)().domain(e.domain).range(e.range).unknown(e.unknown);case"quantize":return(0,x.Z)().domain(e.domain).range(e.range).unknown(e.unknown);default:throw TypeError(`scale ${e.scale} not supported`)}}(e),r="highlightColor"===t?function({col:e,dataType:t},n){switch(t){case"table":return function(e,t){return({index:n,layer:r})=>{var i;return t(null!==(i=r.props.data.frame[e][n])&&void 0!==i?i:void 0)}}(e,n);case"object":return function(e,t){return({object:n})=>{var r;return t(null!==(r=n[e])&&void 0!==r?r:void 0)}}(e,n);case"geojson":return function(e,t){return({object:n})=>{var r;return t(null!==(r=n.properties[e])&&void 0!==r?r:void 0)}}(e,n);default:throw TypeError(`${t} not supported`)}}(e,n):function({col:e,dataType:t},n){switch(t){case"table":return function(e,t){return(n,{index:r,data:i})=>{var s;return t(null!==(s=i.frame[e][r])&&void 0!==s?s:void 0)}}(e,n);case"object":return function(e,t){return n=>{var r;return t(null!==(r=n[e])&&void 0!==r?r:void 0)}}(e,n);case"geojson":return function(e,t){return n=>{var r;return t(null!==(r=n.properties[e])&&void 0!==r?r:void 0)}}(e,n);default:throw TypeError(`${t} not supported`)}}(e,n);return{...e,name:t,getData:r,scaleData:n}}var S=n(9757);function k(e="normal"){switch(e){case"additive":return{[S.Z.BLEND]:!0,blendFunc:[S.Z.SRC_ALPHA,S.Z.DST_ALPHA],blendEquation:S.Z.FUNC_ADD};case"subtractive":return{[S.Z.BLEND]:!0,blendFunc:[S.Z.ONE,S.Z.ONE_MINUS_DST_COLOR,S.Z.SRC_ALPHA,S.Z.DST_ALPHA],blendEquation:[S.Z.FUNC_SUBTRACT,S.Z.FUNC_ADD]};case"normal":default:return{[S.Z.BLEND]:!0,blendFunc:[S.Z.SRC_ALPHA,S.Z.ONE_MINUS_SRC_ALPHA,S.Z.ONE,S.Z.ONE_MINUS_SRC_ALPHA],blendEquation:[S.Z.FUNC_ADD,S.Z.FUNC_ADD]}}}function A(e){return null!==e&&"object"==typeof e&&"frame"in e}function T(e){const t=function(e){return Object.entries(e.geometry).filter((([,e])=>/MULTI/.test(e))).map((([e,t])=>({name:e,type:t})))}(e);return 0===t.length?e:t.reduce(C,e)}function C(e,{name:t,type:n}){var r,i,s,a;const o=e.frame,l=Object.fromEntries(Object.entries(o).map((([e])=>[e,[]]))),c=Object.keys(e.frame).filter((e=>e!==t)),u=o[t],d=function(e){switch(e){case"MULTIPOINT":return _;case"MULTILINESTRING":return E;case"MULTIPOLYGON":return Z;default:throw TypeError(`${e} not supported`)}}(n),p=e=>{for(const t of c)l[t].push(o[t][e])},h=[];for(let n=0;n<e.length;n++){const o=u[n];if(d(o)){l[t].push(...o);for(let t=0;t<o.length;t++)p(n),h.push(null!==(i=null===(r=e.indices)||void 0===r?void 0:r[n])&&void 0!==i?i:n)}else l[t].push(o),p(n),h.push(null!==(a=null===(s=e.indices)||void 0===s?void 0:s[n])&&void 0!==a?a:n)}return{length:l[t].length,geometry:{...e.geometry,[t]:n.replace("MULTI","")},indices:h,frame:l}}function _(e){return Array.isArray(e[0])}function E(e){return Array.isArray(e[0][0])}function Z(e){return Array.isArray(e[0][0][0])}var M=n(1118),P=n(1614),z=n(8988),R=n(2734),D=n(8261),I=n(3767),U=n(6305),H=n(7180);class F extends M.Z{initializeState(){if(!function(e){return G.some((t=>e instanceof t))}(this))return;const e=this,t=e.getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:S.Z.UNSIGNED_BYTE,size:3,accessor:(t,{index:n,data:r,target:i})=>e.encodePickingColor(A(r)&&Array.isArray(r.indices)?r.indices.indexOf(r.indices[n]):n,i)}})}}const G=[P.Z,z.Z,R.Z,D.Z,I.Z,U.Z,H.Z];class q{constructor({type:e,...t}){var n;const r=Object.entries(t),i=function(e){const t=e.filter(V).map((([e,t])=>[e,g(t)])),n=e.find((([e])=>"colorRange"===e));n&&t.push([n[0],n[1].map((e=>g(e)))]);return t}(r),s=function(e){return e.filter((([,e])=>w(e))).map((([e,t])=>[e,L(t)?N(t,e):O(t,e)]))}(r);this.type=e;const a=Object.fromEntries([...r,...i,...s.map((([e,t])=>[e,t.getData])),...$(r),["updateTriggers",W(s)],["parameters",(o=t.parameters,l=t.blendingMode,{...o,...k(l)})]]);var o,l;A(a.data)&&(a.data=T(a.data),a.extensions=[new F,...null!==(n=a.extensions)&&void 0!==n?n:[]]),"TileLayer"===e&&(a.renderSubLayers=e=>{const{bbox:{west:t,south:n,east:r,north:i},x:s,y:a,z:o}=e.tile;return new p.Z({...e,data:[{z:o,x:s,y:a}],image:e.data,bounds:[t,n,r,i]})}),this.props=a,this.scales=s.filter((([,e])=>L(e))).map((([,e])=>e)),"TextLayer"===e&&"fonts"in document&&document.fonts.load(`16px ${t.fontFamily}`)}static create(e){return new q(e)}renderLayer(e){if("TripsLayer"===this.type&&void 0!==e){const t=this.props,{loopLength:n,animationSpeed:r}=t,i=n/r,s=e/1e3%i/i;t.currentTime=s*n}return new r[this.type]({...this.props})}renderLegend(){const e=this.scales.filter((e=>e.legend));return{id:this.props.id,name:this.props.name,scales:e}}renderSelector(){var e;return{id:this.props.id,groupName:this.props.groupName,name:this.props.name,visible:null===(e=this.props.visible)||void 0===e||e}}}function V([e,t]){return e.endsWith("Color")&&(Array.isArray(t)||"string"==typeof t)}function W(e){const t=e=>{const{getData:t,scaleData:n,palette:r,...i}=e;return i},n=e.map((([e,n])=>[e,t(n)]));return Object.fromEntries(n)}function $(e){return e.filter((([e])=>"getColorWeight"===e||"getElevationWeight"===e)).filter((([,e])=>null!==e&&"function"!=typeof e&&!w(e))).map((([e,t])=>[e,()=>t]))}n(6158);var B=n(7590),K=n(170);const Q="_GD3I1KfvugIcRB1bxk2",X="gPNuvSSiQ_VU04P1Zaf5",Y="SjYHy15uVlXQrqR8QKQm",J="MJyqmdie06yUxaZQqKe_",ee="FZXrI_GzheUe9ZTI347H";function te({info:e}){if(null==e)return null;const{index:t,layer:n,x:r,y:s}=e,{name:a,tooltip:o}=n.props,l=function(e){switch(e){case"table":return(e,{index:t,data:n})=>{const r=Object.entries(n.frame).map((([e,n])=>[e,n[t]]));return Object.fromEntries(r)};case"object":return e=>null!=e?e:{};case"geojson":return e=>{var t;return null!==(t=null==e?void 0:e.properties)&&void 0!==t?t:{}};default:throw TypeError(`${e} not supported`)}}(o.dataType)(e.object,{index:t,data:n.props.data}),c=!0===o.cols?Object.keys(l):o.cols;return(0,i.jsxs)("div",Object.assign({className:Q,style:{transform:`translate(${r}px, ${s}px)`}},{children:[(0,i.jsx)("div",Object.assign({className:X},{children:a}),void 0),(0,i.jsx)("table",Object.assign({className:Y},{children:(0,i.jsx)("tbody",{children:c.map((e=>{var t;return(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",Object.assign({className:J},{children:e}),void 0),(0,i.jsx)("td",Object.assign({className:ee},{children:String(null!==(t=l[e])&&void 0!==t?t:null)}),void 0)]},e)}))},void 0)}),void 0)]}),void 0)}var ne=n(4975);function re({props:e,layers:t}){const n=(0,a.useRef)(null),[r,s]=ie(),{mapboxApiAccessToken:l,mapStyle:c,mapOptions:u,controller:d,parameters:p,blendingMode:h,...f}=e,g={...p,...k(h)},[m,y]=(0,a.useState)(0),v=0!==t.filter((e=>"TripsLayer"===e.type)).length;se(v,(e=>y(e)));const b=t.map((e=>e.renderLayer(m)));return(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(K.Z,Object.assign({ref:n},f,{parameters:g,layers:b,onHover:s},{children:(0,i.jsx)(B.Z,Object.assign({id:"map",controller:d,repeat:!0},{children:c&&(0,i.jsx)(o.Z3,Object.assign({reuseMaps:!0},{mapboxApiAccessToken:l,mapStyle:c,mapOptions:u}),void 0)}),void 0)}),void 0),(0,i.jsx)(te,{info:r},void 0)]},void 0)}const ie=()=>{const[e,t]=(0,a.useState)(null);return[e,(0,a.useCallback)((e=>{if(!e.picked||!e.layer.props.tooltip||e.layer instanceof ne.Z)return t(null);t(e)}),[])]},se=(e,t)=>{const n=(0,a.useRef)(0),r=(0,a.useRef)(Date.now()),i=()=>{t(Date.now()-r.current),n.current=window.requestAnimationFrame(i)};(0,a.useEffect)((()=>{if(e)return n.current=window.requestAnimationFrame(i),()=>window.cancelAnimationFrame(n.current)}),[e])};function ae(e){return e.clientHeight>0&&e.clientHeight>0?e:e.parentElement?ae(e.parentElement):null}function oe(e){const t=ae(e);if(e===t||null==t)return[e.clientWidth,e.clientHeight];const{width:n,height:r}=getComputedStyle(e),i=document.createElement("div");Object.assign(i.style,{width:n,height:r,display:"hidden"}),t.appendChild(i);const s=[i.clientWidth,i.clientHeight];return t.removeChild(i),s}function le(e,t){const n=new Map;for(const r of e){const e=t(r);n.has(e)?n.get(e).push(r):n.set(e,[r])}return n}function ce(...e){return e.filter((e=>null!=e)).join(" ")}const ue="_y_jKzxaUIuz2inlqGmE",de="vm8PFbSR_MiUt2Qe20wX",pe="UvyNjumZdYyNCNKz9B1o",he="EZzm0QRIPi88FWcZMG7O",fe="LvqP2Ukz_ksW8iDy2h1F",ge="_nqoYnfPRX3K58Iz_XPD",me="qlF41UerDOHW8S2GzVQ_",ye="UT8PFMcUHavyvZuANCDN",ve="kMLTSzfSH0qMKbA_lzPg",be="yfVvuQS3fl9y7bcsdCl1",je=16;function xe({layers:e}){return 0===e.length?null:(0,i.jsx)("div",Object.assign({className:ue},{children:e.map((e=>(0,i.jsx)(we,Object.assign({},e),e.id)))}),void 0)}function we({name:e,scales:t}){return 0===t.length?null:(0,i.jsxs)("div",Object.assign({className:de},{children:[(0,i.jsx)("div",Object.assign({className:pe,title:e},{children:e}),void 0),t.map((e=>(0,i.jsx)(Oe,Object.assign({},e),e.name)))]}),void 0)}function Oe(e){const t=e.name.replace(/^get/,"").replace(/([A-Z])/g," $1").toLowerCase();const n="palette"in e;const r=function(e){return"linear"===e.scale||"power"===e.scale||"log"===e.scale}(e),s=function(e){return"threshold"===e.scale||"quantile"===e.scale||"quantize"===e.scale}(e);return(0,i.jsxs)("div",Object.assign({className:he},{children:[(0,i.jsx)("div",Object.assign({className:fe},{children:t}),void 0),(0,i.jsx)("span",Object.assign({className:ge},{children:"by "}),void 0),(0,i.jsx)("span",Object.assign({className:me,title:e.col},{children:e.col}),void 0),n&&r&&(0,i.jsx)(Le,Object.assign({},e),void 0),n&&s&&(0,i.jsx)(Ne,Object.assign({},e),void 0),n&&"category"===e.scale&&(0,i.jsx)(Se,Object.assign({},e),void 0)]}),void 0)}const Le=({ticks:e,scaleData:t})=>{const n=e.map(((e,t)=>t)).slice(1,-1),r=je*(e.length-1),s=r+11+1;return(0,i.jsxs)("svg",Object.assign({className:ye,height:s,shapeRendering:"crispEdges"},{children:[(0,i.jsxs)("svg",Object.assign({y:5},{children:[(0,i.jsx)("image",{width:20,height:r,href:Ae(t),preserveAspectRatio:"none"},void 0),n.map((e=>(0,i.jsx)("line",{className:be,x2:20,y1:je*e,y2:je*e},e)))]}),void 0),(0,i.jsx)(ke,{ticks:e,y:-2},void 0)]}),void 0)},Ne=({ticks:e,range:t})=>{const n=t.map(f),r=je*(e.length-1)+11+1;return(0,i.jsxs)("svg",Object.assign({className:ye,height:r,shapeRendering:"crispEdges"},{children:[(0,i.jsx)("svg",Object.assign({y:5},{children:n.map(((e,t)=>(0,i.jsx)("rect",{width:20,height:je,y:t*je,fill:e},t)))}),void 0),(0,i.jsx)(ke,{ticks:e,y:-2},void 0)]}),void 0)};function Se({ticks:e,range:t,unknownTick:n,unknown:r}){const s=n?[...t,r]:t,a=n?[...e,n]:e,o=s.map(f),l=je*a.length;return(0,i.jsxs)("svg",Object.assign({className:ye,height:l},{children:[(0,i.jsx)("svg",{children:o.map(((e,t)=>(0,i.jsx)("rect",{width:20,height:14,y:1+t*je,fill:e},t)))},void 0),(0,i.jsx)(ke,{ticks:a},void 0)]}),void 0)}function ke({ticks:e,x:t=28,y:n=0}){return(0,i.jsx)("svg",Object.assign({},{x:t,y:n},{children:e.map(((e,t)=>(0,i.jsx)("text",Object.assign({className:ve,y:je*t,dy:11},{children:String(e)}),t)))}),void 0)}function Ae(e,t=200){const n=e.range().length,r=[...Array(n).keys()].map((e=>e/(n-1))),i=e.copy().range(r).invert,s=document.createElement("canvas"),a=s.getContext("2d");s.width=1,s.height=t;for(let n=0;n<t;n++)a.fillStyle=f(e(i(n/t))),a.fillRect(0,n,1,1);return s.toDataURL()}const Te="rdeck",Ce="FnH7AefwYSGXXoWC_69x",_e="oCpKRzgzR0DnEEgcuFBj",Ee="AXIGXgp0XeWDLXqni97t";var Ze=n(148),Me=n(9816),Pe=n(9826),ze=n(6218);const Re="_8Q0cb2fO_N_Hdo_ffEc",De="zNOoGL9zMPGYjLL7fRXK",Ie="BMefRE98WYc323FMORCG",Ue="U0EBvYHG_0eTZQ2G11Vk",He="nvRBVaa9dpychdkgkaSb",Fe="T2nX2JkCviAqM8D4FK2K",Ge="nh7C2o_1ONGSRHu18Nj8",qe="qKV_Ce_KakpIz_ZKAEZw",Ve="Il7vHVcZkqkscqQprrHj",We="d6zHogLwKNQvMiRjKpM_",$e="E_QeRQlqR_xUUzNQZjFN",Be=Date.now();function Ke({className:e,tooltip:t,onClick:n,children:r}){return(0,i.jsx)("button",Object.assign({className:e,type:"button",onClick:n,title:t},{children:r}),void 0)}function Qe({layers:e,onVisibilityChange:t}){const n=le(e,(e=>{var t;return null!==(t=e.groupName)&&void 0!==t?t:`${e.name}-${Be}`})),r=(n,r,i)=>{if(i){const i=!e.filter((e=>!n.includes(e))).some((e=>e.visible));return t(e.map((e=>({...e,visible:n.includes(e)?r:i}))))}t(n.map((e=>({...e,visible:r}))))},[s,o]=(0,a.useState)(!1),l=()=>o((e=>!e));return s?(0,i.jsxs)("div",Object.assign({className:De},{children:[(0,i.jsx)("div",Object.assign({className:Ie},{children:(0,i.jsxs)(Ke,Object.assign({className:Ue,onClick:l,tooltip:"Close"},{children:[(0,i.jsx)(Ze.Z,{className:$e,fontSize:"small"},void 0),(0,i.jsx)("span",Object.assign({className:He},{children:"Layers"}),void 0)]}),void 0)}),void 0),(0,i.jsx)("div",Object.assign({className:Fe},{children:Array.from(n.entries(),(([e,t,[{groupName:n}]=t])=>(0,i.jsx)(Xe,Object.assign({},{group:n,layers:t,onChange:r}),e)))}),void 0)]}),void 0):(0,i.jsx)(Ke,Object.assign({className:Re,tooltip:"Layer selector",onClick:l},{children:(0,i.jsx)(Ze.Z,{className:$e,fontSize:"small"},void 0)}),void 0)}function Xe({group:e,layers:t,onChange:n}){const r=Array.from(le(t,(e=>e.name)),(([e,t])=>(0,i.jsx)(Ye,Object.assign({},{name:e,layers:t,onChange:n}),e)));return e?(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(Ye,Object.assign({},{name:e,layers:t,onChange:n}),void 0),(0,i.jsx)("div",Object.assign({className:Ge},{children:r}),void 0)]},void 0):(0,i.jsx)(a.Fragment,{children:r},void 0)}function Ye({name:e,layers:t,onChange:n}){const r=function(e){let t=e[0].visible;for(const n of e)if(n.visible!==t)return null;return t}(t),s=null===r,o=(0,a.useRef)(null);(0,a.useEffect)((()=>{o.current&&(o.current.indeterminate=s)}),[s]);const l=(0,a.useRef)((()=>!1)),c=r?Me.Z:s?Pe.Z:ze.Z,u=ce(qe,r||s?Ve:null);return(0,i.jsxs)("label",Object.assign({className:u},{children:[(0,i.jsx)("input",{ref:o,className:We,type:"checkbox",onChange:()=>{l.current()?n(t,!0,!0):l.current=Je((()=>n(t,!r,!1)),200)},checked:null==r||r},void 0),(0,i.jsx)(c,{fontSize:"small",className:$e},void 0),(0,i.jsx)("span",Object.assign({className:He},{children:e}),void 0)]}),void 0)}const Je=(e,t=200)=>{const n={current:0};let r=0;const i=s=>{if(r||(r=s),s-r>t)return n.current=0,void e();n.current=globalThis.requestAnimationFrame(i)};return n.current=globalThis.requestAnimationFrame(i),()=>0!==n.current&&(globalThis.cancelAnimationFrame(n.current),n.current=0,!0)};function et({props:e,layers:t,theme:n,lazyLoad:r,layerSelector:s,onLayerVisibilityChange:l,width:c,height:u}){const{initialBounds:d,initialViewState:p,...h}=e,f=function(e,t,n,r){return(0,a.useMemo)((()=>{if(!Array.isArray(n))return r;const[i,s,a,l]=n,c=[[Math.max(-180,i),Math.max(s,-85.051129)],[Math.min(180,a),Math.min(l,85.051129)]],u=new o.DW({width:e,height:t}),{longitude:d,latitude:p,zoom:h}=u.fitBounds(c);return{...r,longitude:d,latitude:p,zoom:h}}),[n,r,e,t])}(c,u,d,p),g=t.map(q.create),m=(0,a.useRef)(null),y=function(e,t){const[n,r]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if(t&&e.current){const t=new IntersectionObserver((e=>{r(e[0].isIntersecting)}),{threshold:0});return t.observe(e.current),()=>t.disconnect()}}),[t,e]),n}(m,r),v=!r||y;return(0,i.jsxs)("div",Object.assign({ref:m,className:ce(Te,n)},{children:[(0,i.jsx)("div",Object.assign({className:ce(Ce,_e)},{children:s&&(0,i.jsx)(Qe,{layers:g.filter((e=>e.props.visibilityToggle)).map((e=>e.renderSelector())).reverse(),onVisibilityChange:l},void 0)}),void 0),v&&(0,i.jsx)(re,{props:{...h,initialViewState:f},layers:g},void 0),(0,i.jsx)("div",Object.assign({className:ce(Ce,Ee)},{children:(0,i.jsx)(xe,{layers:g.filter((e=>e.props.visible)).map((e=>e.renderLegend())).reverse()},void 0)}),void 0)]}),void 0)}var tt,nt,rt,it=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n},st=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const at={name:"rdeck",type:"output",factory:(e,t,n)=>(0!==t&&0!==n||([t,n]=oe(e)),new ot(e,t,n))};class ot{constructor(e,t,n){tt.set(this,void 0),nt.set(this,void 0),rt.set(this,void 0),this.props={blendingMode:"normal"},this.layers=[],this.theme="kepler",this.layerSelector=!0,this.lazyLoad=!1,it(this,tt,e,"f"),it(this,nt,t,"f"),it(this,rt,n,"f"),HTMLWidgets.shinyMode&&(Shiny.addCustomMessageHandler(`${e.id}:layer`,(e=>{var t;const n=this.layers.find((t=>t.id===e.id));if(!n)return this.renderValue({layers:[...this.layers,e]});const r=this.layerSelector&&n.visibilityToggle?n.visible:e.visible,i=null!==(t=e.data)&&void 0!==t?t:n.data,s={...n,...e,visible:r,data:i},a=this.layers.map((e=>e===n?s:e));this.renderValue({layers:a})})),Shiny.addCustomMessageHandler(`${e.id}:deck`,(({props:e,theme:t,lazyLoad:n})=>{this.renderValue({props:{...this.props,...e},theme:t,lazyLoad:n})}))),this.setLayerVisibility=this.setLayerVisibility.bind(this)}renderValue({props:e,layers:t,theme:n,layerSelector:r,lazyLoad:a}){const o={props:null!=e?e:this.props,layers:null!=t?t:this.layers,theme:null!=n?n:this.theme,layerSelector:null!=r?r:this.layerSelector,lazyLoad:null!=a?a:this.lazyLoad};Object.assign(this,o),s.render((0,i.jsx)(et,Object.assign({},o,{onLayerVisibilityChange:this.setLayerVisibility,width:st(this,nt,"f"),height:st(this,rt,"f")}),void 0),st(this,tt,"f"))}resize(e,t){}get id(){return st(this,tt,"f").id}setLayerVisibility(e){if(0===e.length)return;const t=this.layers.map((t=>{const n=e.find((e=>((e,t)=>{const n=e.name===t.name,r=e.groupName===t.groupName;return n&&r||null==e.name&&null!=e.groupName&&r})(e,t)&&e.visible!==t.visible));return n?{...t,visible:n.visible}:t}));this.renderValue({layers:t})}}function lt(e){var t;const n=document.getElementById(e);return null!==(t=null==n?void 0:n.htmlwidget_data_init_result)&&void 0!==t?t:null}function ct(){return[...document.querySelectorAll(".rdeck.html-widget")].map((e=>e.htmlwidget_data_init_result)).filter((e=>e instanceof ot))}tt=new WeakMap,nt=new WeakMap,rt=new WeakMap,HTMLWidgets.widget(at);const ut="0.4.0-dev"},842:()=>{},5440:()=>{},5307:()=>{}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var s=n[e]={exports:{}};return t[e].call(s.exports,s,s.exports,r),s.exports}r.m=t,e=[],r.O=(t,n,i,s)=>{if(!n){var a=1/0;for(u=0;u<e.length;u++){for(var[n,i,s]=e[u],o=!0,l=0;l<n.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(o=!1,s<a&&(a=s));if(o){e.splice(u--,1);var c=i();void 0!==c&&(t=c)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[n,i,s]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={472:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var i,s,[a,o,l]=n,c=0;for(i in o)r.o(o,i)&&(r.m[i]=o[i]);if(l)var u=l(r);for(t&&t(n);c<a.length;c++)s=a[c],r.o(e,s)&&e[s]&&e[s][0](),e[a[c]]=0;return r.O(u)},n=self.webpackChunkrdeck=self.webpackChunkrdeck||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=r.O(void 0,[486,474,619,568,627,688,811,784,899,42,324,134,667,535,745,528,378,877,596,816,485,650,394,706,683,67,14,645,806,836,96,813,451,912,261,247,590,355,953,44,538,49,639,360,825],(()=>r(6153)));return i=r.O(i)})()}));