1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5389],{55389:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(37876),r=s(14232),a=s(59548);class n extends a.internal.EventEmitter{constructor(e,t,s,i,r){let n;super(),this.hideSpiderCluster=e=>{this._clusterLayer.setOptions({visible:!0}),this._unclusteredLayer.setOptions({visible:!0}),this._countLayer.setOptions({filter:["has","point_count"]}),(!e||this._options.closeWebOnPointClick||!this._options.closeWebOnPointClick&&e.shapes&&e.shapes.length>0&&e.shapes[0]instanceof a.Shape&&e.shapes[0].dataSource&&e.shapes[0].dataSource.id!==this._spiderDataSource.getId())&&this._spiderDataSource.clear()},this._layerClickEvent=e=>{if(e&&e.shapes&&e.shapes.length>0){let t,s,i,r;e.shapes[0]instanceof a.Shape?(t=(i=e.shapes[0]).getProperties(),s=i.getCoordinates()):(t=(r=e.shapes[0]).properties,s=r.geometry.coordinates),r&&t.cluster?(this._invokeEvent("featureUnselected",null),this._currentCluster=e.shapes[0],t.point_count>this._options.maxFeaturesInWeb?this._datasource.getClusterExpansionZoom(t.cluster_id).then(e=>{this._map.setCamera({center:s,zoom:e})}):this.showSpiderCluster(r)):(void 0!==t._parentId?i=this._datasource.getShapeById(t._parentId):this._currentCluster=null,i&&this._invokeEvent("featureSelected",{cluster:this._currentCluster,shape:i}),this._options.closeWebOnPointClick&&this.hideSpiderCluster()),e.preventDefault()}},this._highlightStick=e=>{if(e&&e.shapes&&e.shapes.length>0){let t;t=e.shapes[0]instanceof a.Shape?e.shapes[0].getProperties()._stickId:e.shapes[0].properties._stickId;let s={source:this._spiderDatasourceId,id:this._hoverStateId};this._hoverStateId&&this._map.map.setFeatureState(s,{hover:!1}),this._hoverStateId=t,s.id=t,this._map.map.setFeatureState(s,{hover:!0}),this._map.getCanvasContainer().style.cursor="pointer"}},this._unhighlightStick=e=>{this._hoverStateId&&(this._map.map.setFeatureState({source:this._spiderDatasourceId,id:this._hoverStateId},{hover:!1}),this._hoverStateId=null,this._map.getCanvasContainer().style.cursor="grab")},this._hoverStateId=null,this._hoveredId=null,this._options={circleSpiralSwitchover:6,minCircleLength:30,minSpiralAngleSeperation:25,spiralDistanceFactor:5,maxFeaturesInWeb:100,closeWebOnPointClick:!0,stickLayerOptions:{strokeColor:["case",["boolean",["feature-state","hover"],!1],"red","black"]},radiusInPixels:0};const o=a.layer;this._map=e,this._clusterLayer=t,this._clusterLayerOptions=t.getOptions(),this._countLayer=s;let l=t.getSource();if("string"==typeof l&&(l=e.sources.getById(l)),l instanceof a.source.DataSource)this._datasource=l;else throw"Data source on cluster layer is not supported.";r=r||{};const d=new a.source.DataSource;this._spiderDataSource=d,e.sources.add(d),this._spiderDatasourceId=d.getId(),this._spiderLineLayer=new o.LineLayer(d,null,this._options.stickLayerOptions),e.layers.add(this._spiderLineLayer,t.id),this._unclusteredLayerOptions=Object.assign({},i.getOptions()),this._unclusteredLayerOptions.source=void 0,this._unclusteredLayerOptions.filter=["all",this._unclusteredLayerOptions.filter,["any",["==",["geometry-type"],"Point"],["==",["geometry-type"],"MultiPoint"]]],this._unclusteredLayerOptions.iconOptions={...this._unclusteredLayerOptions.iconOptions,size:["case",["==",["get","hover"],!0],1.1,1]},this._unclusteredLayer=i,i instanceof o.BubbleLayer?n=new o.BubbleLayer(d,null,this._unclusteredLayerOptions):(this._unclusteredLayerOptions.iconOptions=this._unclusteredLayerOptions.iconOptions||{},Object.assign(this._unclusteredLayerOptions.iconOptions,{allowOverlap:!0,ignorePlacement:!0}),n=new o.SymbolLayer(d,null,this._unclusteredLayerOptions)),this._spiderFeatureLayer=n,e.layers.add(n),this.setOptions(r),this._expandedClusterBubbleLayer=new a.layer.BubbleLayer(this._spiderDataSource,null,this._clusterLayerOptions),e.layers.add(this._expandedClusterBubbleLayer,this._clusterLayer.getId());const u=e.events;u.add("click",this.hideSpiderCluster),u.add("movestart",this.hideSpiderCluster),u.add("mouseleave",n,this._unhighlightStick),u.add("mousemove",n,this._highlightStick),u.add("click",t,this._layerClickEvent),u.add("click",n,this._layerClickEvent),u.add("click",i,this._layerClickEvent),u.add("mousemove",n,e=>{if(e.shapes&&e.shapes.length>0){let t=e.shapes[0];if("function"!=typeof e.shapes[0].getType)return;if(this._hoveredShape&&this._hoveredShape!==t){let e=this._hoveredShape.getProperties();e.hover=!1,this._hoveredShape.setProperties(e)}let s=t.getProperties();s.hover=!0,t.setProperties(s),this._hoveredShape=t}}),u.add("mouseleave",n,()=>{if(this._hoveredShape){let e=this._hoveredShape.getProperties();e.hover=!1,this._hoveredShape.setProperties(e),this._hoveredShape=null}})}dispose(){let e=this._map,t=e.events,s=this._spiderFeatureLayer,i=this._layerClickEvent,r=this.hideSpiderCluster;t.remove("click",r),t.remove("movestart",r),t.remove("click",this._clusterLayer,i),t.remove("mouseleave",s,this._unhighlightStick),t.remove("mousemove",s,this._highlightStick),t.remove("click",
1s,i),t.remove("click",this._unclustedLayer,i),e.layers.remove(s),this._spiderFeatureLayer=null,e.layers.remove(this._spiderLineLayer),this._spiderLineLayer=null,this._spiderDataSource.clear(),e.sources.remove(this._spiderDataSource),this._spiderDataSource=null}getOptions(){return JSON.parse(JSON.stringify(this._options))}getLayers(){return{clusterLayer:this._clusterLayer,unclustedLayer:this._unclustedLayer,spiderFeatureLayer:this._spiderFeatureLayer,spiderLineLayer:this._spiderLineLayer}}setOptions(e){let t=this._options;this.hideSpiderCluster(),e&&("number"==typeof e.circleSpiralSwitchover&&(t.circleSpiralSwitchover=e.circleSpiralSwitchover),"number"==typeof e.maxFeaturesInWeb&&(t.maxFeaturesInWeb=e.maxFeaturesInWeb),"number"==typeof e.minSpiralAngleSeperation&&(t.minSpiralAngleSeperation=e.minSpiralAngleSeperation),"number"==typeof e.spiralDistanceFactor&&(t.spiralDistanceFactor=e.spiralDistanceFactor),"number"==typeof e.minCircleLength&&(t.minCircleLength=e.minCircleLength),"boolean"==typeof e.closeWebOnPointClick&&(t.closeWebOnPointClick=e.closeWebOnPointClick),e.stickLayerOptions&&(t.stickLayerOptions=e.stickLayerOptions,this._spiderLineLayer.setOptions(e.stickLayerOptions)),"boolean"==typeof e.visible&&t.visible!==e.visible&&(t.visible=e.visible,this._spiderLineLayer.setOptions({visible:e.visible}),this._spiderFeatureLayer.setOptions({visible:e.visible})),"number"==typeof e.radiusInPixels&&(t.radiusInPixels=e.radiusInPixels))}showSpiderCluster(e){let t=this,s=t._options,i=t._spiderDataSource.getShapes();if(e&&e.properties.cluster){let r=e.properties.cluster_id;if(this._invokeEvent("spiderClusterOpened",{cluster:e,shape:null}),i.length>0&&i[0].getProperties().cluster_id===r)return;t.hideSpiderCluster();let o=new a.data.Feature(new a.data.Point(e.geometry.coordinates),{...e.properties});return this._spiderDataSource.add(o),this._countLayer.setOptions({filter:["==",["get","cluster_id"],r]}),this._clusterLayer.setOptions({visible:!1}),this._unclusteredLayer.setOptions({visible:!1}),t._datasource.getClusterLeaves(r,s.maxFeaturesInWeb,0).then(function(i){let n,o,l,d=e.geometry.coordinates,u=t._map.positionsToPixels([d])[0],c=0,p=i.length>s.circleSpiralSwitchover,h=s.radiusInPixels||0;p?(n=(h+50)/Math.PI,l=s.spiralDistanceFactor):(o=2*Math.PI/i.length,n=s.minCircleLength);let m=[];for(let e=0,d=i.length;e<d;e++){p?(c+=s.minSpiralAngleSeperation/n+5e-4*e,n+=l/c):c=o*e;var g=t._map.pixelsToPositions([[u[0]+n*Math.cos(c),u[1]+n*Math.sin(c)]])[0];let d=[u[0]+h*Math.cos(c),u[1]+h*Math.sin(c)],_=t._map.pixelsToPositions([d])[0];m.push(new a.data.Feature(new a.data.LineString([_,g]),null,e+""));let y=i[e],v=y instanceof a.Shape?y.getId():y.id,f=Object.assign({},y instanceof a.Shape?y.getProperties():y.properties);f._stickId=e+"",f._parentId=v,f._cluster=r,f._isSpiderCluster=!0,m.push(new a.data.Feature(new a.data.Point(g),f))}t._spiderDataSource.add(m)}),n}}}a.SpiderClusterManager=n;var o=s(78023),l=s(54142),d=s(26746),u=s(92374),c=s(15878),p=s(78944),h=s(48230),m=s.n(h),g=s(31777),_=s(98786);let y=c.Ay.div.withConfig({componentId:"sc-849e9ed8-0"})(["width:calc(100vw - 100px);max-width:350px;padding:20px;border-left:10px solid #6eafed;background-color:white;h2{margin-top:0;white-space:pre-wrap;}p{margin:0;}.button-link{margin-right:0;margin-left:auto;align-self:center;}.detail-container{display:flex;flex-wrap:wrap;}.details{padding-right:30px;line-height:1rem;}"]),v=(0,c.Ay)(y).withConfig({componentId:"sc-849e9ed8-1"})(["width:auto;height:auto;padding:2px 5px;border-left:5px solid #6eafed;h5{margin:0;max-width:200px;text-wrap:wrap;line-height:1.5;}"]);function f(e){return"coordinates"in e||"fullAddress"in e}function S(e){return e.every(e=>"Name"in e)}let b=({location:e})=>f(e)?(0,i.jsxs)(i.Fragment,{children:[e.coordinates&&(0,i.jsxs)("p",{children:["Coordinates: ",e.coordinates[0],", ",e.coordinates[1]]}),e.fullAddress&&(0,i.jsxs)("p",{children:["Address: ",e.fullAddress]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h2",{children:e.Name}),(0,i.jsxs)("div",{className:"detail-container",children:[(0,i.jsxs)("div",{className:"details",children:[e?.Address&&(0,i.jsx)("p",{children:e.Address}),e.Address2&&(0,i.jsx)("p",{children:e.Address2}),e?.City&&e?.State&&e?.ZipCode&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{children:[e.City,", ",e.State," ",e.ZipCode]}),(0,i.jsx)("p",{children:(0,i.jsxs)("a",{href:`tel:${(0,_.bA)(e.PhoneNumber)}`,children:[" ",e.PhoneNumber]})})]})]}),(0,i.jsx)(m(),{className:"button-link",href:(0,_.n5)(e),target:"_blank",passHref:!0,children:(0,i.jsx)(o.A,{variant:"contained",sx:{width:"125px",height:"40px",backgroundColor:"#3c93df",borderRadius:"40px"},children:"More Info"})})]})]}),x=r.memo(({locations:e,options:t,enablePopup:s=!0,showResultsCount:o=!0,noLocationsMessage:c="No locations foun
1d. Try adjusting the filters above.",PopupContentRenderer:h=b})=>{let m=(0,r.useRef)(null),_=(0,r.useRef)(null),[x,L]=(0,r.useState)(),[C,w]=(0,r.useState)(!1),[O,k]=(0,r.useState)(null),[I,P]=(0,r.useState)(null),[j,F]=(0,r.useState)(null),M=(0,r.useRef)(j),A=(0,g.d4)(e=>e.locations.filteredLocationIndices),[D,E]=(0,r.useState)([]),B=(0,r.useRef)(D);(0,r.useEffect)(()=>{B.current=D},[D]),(0,r.useEffect)(()=>{S(e)?E(A.map(t=>e[t]).filter(e=>e.latitude&&e.longitude)):E(e.filter(e=>e.coordinates||e.fullAddress))},[A,e]),(0,r.useEffect)(()=>{null!==O&&O?.data?.id!==I?z(O?.data?.geometry?.coordinates,[0,-18],O):J()},[O,I]);let N={},W=async e=>{if(N[e])return N[e];let t=`?query=${encodeURIComponent(e)}`,s=`https://${a.getDomain()}/search/address/json${t}&api-version=1.0`,i=_.current.authentication.signRequest({url:s}),r=new Headers(Object.entries(i.headers||"")),n=await fetch(i.url,{headers:r}),o=await n.json();if(o.results.length>0){let t=o.results[0].position;return N[e]=[t.lon,t.lat],[t.lon,t.lat]}return null},R=async e=>{let t=await Promise.all(e.map(async(e,t)=>{let s=e.coordinates||e.fullAddress&&await W(e.fullAddress);return s?new a.Shape(new a.data.Point(s),void 0,{locationIndex:t}):null}));x&&x.add(t.filter(e=>null!==e))},T=(0,r.useCallback)((e,t,r)=>{if(!_.current||!s)return;let a=_.current.popups.getPopups()[0],n=_.current.popups.getPopups()[1];if(!a)return;let o=r.getProperties().locationIndex,l=B.current[o];if(l){let s;P(r.getId()),k(null),_.current.setCamera({maxBounds:M.current,center:e,duration:200,type:"ease"}),a.setOptions({content:(s=document.createElement("div"),(0,p.createRoot)(s).render((0,i.jsx)(y,{children:(0,i.jsx)(h,{location:l})})),s),position:e,pixelOffset:t}),n.close(),a.open(_.current)}else P(null),a.close()},[]),z=(0,r.useCallback)((e,t,r)=>{if(!_.current||!s)return;let a=_.current.popups.getPopups()[1];if(!a)return;let n=r?.data?.properties?.locationIndex,o=B.current[n];if(o){let s;a.setOptions({content:(s=document.createElement("div"),(0,p.createRoot)(s).render((0,i.jsx)(v,{children:f(o)?(0,i.jsx)("h5",{children:o.fullAddress}):(0,i.jsx)("h5",{children:o.Name})})),s),position:e,pixelOffset:t}),a.open(_.current)}else a.close()},[]);function Z(e){let t=Math.sin(e*Math.PI/180);return Math.max(Math.min(Math.log((1+t)/(1-t))/2,Math.PI),-Math.PI)/2}function U(e,t){return Math.min(Math.floor(Math.log(e/t)/Math.LN2),21)}function $(e,t,s,i,r,n){return new a.data.BoundingBox([t-n,e-r],[i+n,s+r])}(0,r.useEffect)(()=>{async function e(){let e=new a.Map(m.current,t);e.events.add("ready",()=>{let t=new a.source.DataSource(void 0,{cluster:!0,clusterRadius:30,clusterMaxZoom:15});e.sources.add(t),L(t),e.imageSprite.createFromTemplate("meritus-map-pin","pin","#3c92df","white",1),e.imageSprite.createFromTemplate("meritus-map-pin-round","pin-round","#3c92df","white",1);let s=new a.layer.BubbleLayer(t,"bubbleLayer",{createIndicators:!0,radius:20,color:"rgba(60, 146, 223,0.6)",filter:["has","point_count"]}),i=new a.layer.SymbolLayer(t,void 0,{filter:["!",["has","point_count"]],iconOptions:{image:["case",["==",["get","_isSpiderCluster"],!0],"meritus-map-pin-round","meritus-map-pin"],anchor:["case",["==",["get","_isSpiderCluster"],!0],"center","bottom"],size:1}}),r=new a.layer.SymbolLayer(t,void 0,{iconOptions:{image:"none"},textOptions:{textField:"{point_count_abbreviated}",color:"white",font:["SegoeUi-Bold"]}});e.layers.add([s,r,i]);let n=new a.Popup({closeButton:!1});e.popups.add(n),e.events.add("click",q),e.events.add("zoom",q),n.getOptions();let o=new a.Popup({closeButton:!1});e.popups.add(o);let l=new a.SpiderClusterManager(e,s,r,i,{stickLayerOptions:{strokeColor:["case",["boolean",["feature-state","hover"],!1],"#3c92df","gray"]},radiusInPixels:22,minCircleLength:50,minSpiralAngleSeperation:26,spiralDistanceFactor:16,circleSpiralSwitchover:10});e.events.add("featureSelected",l,e=>{e.cluster?T(e.cluster.geometry.coordinates,[0,0],e.shape):T(e.shape?.getCoordinates(),[0,-18],e.shape)}),e.events.add("featureUnselected",l,q),e.events.add("spiderClusterOpened",l,e=>{let t=e.cluster;_.current.setCamera({maxBounds:M.current,center:t._geometry.coordinates,duration:200,type:"ease"})}),e.events.add("mouseleave",i,J),e.events.add("mousemove",i,H);let d=l.getLayers().spiderFeatureLayer;e.events.add("mouseleave",d,J),e.events.add("mousemove",d,H),_.current=e})}_.current||e()},[n]);let H=(0,r.useCallback)(e=>{if(k(null),e.shapes&&e.shapes.length>0){let t=e.shapes[0];t?.data?.id!==null&&k({...t})}},[O,k]),q=()=>{P(null),_.current.popups.getPopups()[0].close()},J=()=>{k(null);let e=_.current?.popups?.getPopups()[1];e?.close()};return(0,r.useEffect)(()=>{async function e(){if(x?.clear(),S(D)){for(let[e,t]of D.entries())if(t.latitude&&t.longitude){let s=new a.Shape(new a.data.Point([t.longitude,t.latitude]),void 0,{locationIndex:e});x?.add(s)}}else await R(D);_.current&&(x?.getShapes()?.length===0?w(!0):(w(!1),((e,t)=>{if(t.length>0){let s=t.map(e=>Number(e.getCoordinates()[1].valueOf())),i=t.map(e=>Number(e.getCoordinates()[0].valueOf())),r=Math.min(...s),a=Math.max(...s),n=Math.min(...i),o=Math.max(...i),l=(r+a)/2,d=(n+o)/2,u=o-n,c=e.getCanvasContainer(),p=c.clientHeight,h=c.clientWidth,m=Math.min(U(p,(Z(a)-Z(r))/Math.PI),U(h,u<0?(u+360)/360:u/360)),g=50/Math.pow(2,m)*360/128,_=50/Math.pow(2,m)*360/128,y=$(r,n,a,o,g+.05,_+.1),v=$(r,
1n,a,o,g+.6,_+1);F(v),e.setCamera({center:[d,l],zoom:m,maxZoom:15,duration:500,type:"fly",bounds:y,maxBounds:v})}})(_.current,x.getShapes())))}x&&_.current&&e()},[D,x,_.current]),(0,r.useEffect)(()=>{M.current=j},[j]),(0,i.jsxs)("div",{style:{position:"relative",height:"100%"},children:[o&&(0,i.jsxs)(l.A,{style:{marginBottom:"8px"},children:[D.length," results"]}),(0,i.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:2,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(2px)"},open:C,children:(0,i.jsx)(u.A,{sx:{backgroundColor:"white",padding:"20px",borderRadius:2,maxWidth:"95%"},children:(0,i.jsx)("h3",{children:c})})}),(0,i.jsx)("div",{ref:m,style:{height:"100%"}})]})})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.