1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[49636],{33762:function(e,t,l){l.r(t),l.d(t,{default:function(){return k}});var r=l(57437),o=l(2265),i=l(35791),n=l(79507),a=l(95576),c=l(77468),s=l(21170),d=l(12713),u=l(46387),p=l(89051),h=l(91991),g=l(9026),y=l(5778),x=l(48421),f=l(24495),m=l(27251);l(64982),l(13789);var b=l(51901),v=l(12969);let w="pk.eyJ1IjoiY29ucmFkNDUiLCJhIjoiY21peWYwanEzMGRvYTNsczY4NGVic2N3eiJ9.YNo0uOCnU_XuEoUR-aHTEA",j={longitude:-98.5556,latitude:39.8097,zoom:3.5};function k(e){let{open:t,onClose:l,onSave:k}=e,[C,Z]=(0,o.useState)(""),[F,S]=(0,o.useState)(!1),[E,P]=(0,o.useState)(j),[R,_]=(0,o.useState)(null),[I,D]=(0,o.useState)(null),[M,A]=(0,o.useState)(!1),[N,z]=(0,o.useState)(0),[O,T]=(0,o.useState)(!1),[W,$]=(0,o.useState)(!1),[B,H]=(0,o.useState)(0),Y=(0,o.useRef)(null),L=!!w,U=(0,o.useMemo)(()=>(0,m.k)({maxVertices:13,onVertexCountChange:H}),[13]);(0,o.useEffect)(()=>{if(t&&(Z(""),_(null),D(null),z(0),S(!1),T(!1),$(!1),H(0),A(!1),P(j),Y.current))try{Y.current.deleteAll()}catch(e){console.error("Error clearing drawn features:",e)}},[t]);let X=(0,o.useCallback)(()=>{if(Y.current){try{Y.current.deleteAll()}catch(e){console.error("Error clearing existing polygons:",e)}_(null),D(null),z(0),T(!1),$(!1),H(0);try{Y.current.changeMode("draw_polygon"),A(!0)}catch(e){console.error("Error starting draw mode:",e)}}},[]),V=(0,o.useCallback)(()=>{if(Y.current){try{Y.current.deleteAll()}catch(e){console.error("Error clearing polygon:",e)}_(null),D(null),z(0),T(!1),$(!1),H(0),A(!1)}},[]),G=(0,o.useCallback)(e=>{Y.current=e},[]);(0,o.useEffect)(()=>{if(R&&R.id&&Y.current&&!M){let e=setTimeout(()=>{try{var e;null===(e=Y.current)||void 0===e||e.changeMode("direct_select",{featureId:R.id})}catch(e){console.error("Error selecting feature:",e)}},50);return()=>clearTimeout(e)}},[R,M]);let J=(0,o.useCallback)(e=>{let t=e.features[0];if(_(t),A(!1),t){let e=(0,b.Z)(t),l=(0,v.hX)(e,"meters","miles");D(l),T(l>25);let r=t.geometry.coordinates[0].length-1;z(r),$(r>13)}if(Y.current&&e.features.length>0){try{let e=Y.current.getAll();e.features.length>1&&e.features.slice(0,-1).forEach(e=>{try{var t;null===(t=Y.current)||void 0===t||t.delete(e.id)}catch(e){console.error("Error deleting feature:",e)}})}catch(e){console.error("Error getting all features:",e)}setTimeout(()=>{try{var e;null===(e=Y.current)||void 0===e||e.changeMode("direct_select",{featureId:t.id})}catch(e){console.error("Error enabling direct_select mode:",e)}},100)}},[25,13]),q=(0,o.useCallback)(e=>{let t=e.features[0];if(_(t),t){let e=(0,b.Z)(t),l=(0,v.hX)(e,"meters","miles");D(l),T(l>25);let r=t.geometry.coordinates[0].length-1;z(r),$(r>13)}},[25,13]);(0,o.useCallback)(e=>{_(null),D(null),z(0),T(!1),$(!1),A(!1)},[]);let K=()=>{if(Z(""),_(null),D(null),z(0),S(!1),T(!1),$(!1),H(0),A(!1),Y.current)try{Y.current.deleteAll()}catch(e){console.error("Error clearing drawn features on close:",e)}l()};return(0,r.jsxs)(i.Z,{open:t,onClose:K,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:"90vh",maxHeight:"900px"}},children:[(0,r.jsxs)(n.Z,{sx:{m:0,p:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:["Draw New Polygon",(0,r.jsx)(a.Z,{onClick:K,sx:{color:"text.primary"},children:(0,r.jsx)(y.Ir,{icon:"eva:close-fill"})})]}),(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(s.Z,{sx:{mb:2},children:[(0,r.jsx)(d.Z,{autoFocus:!0,margin:"dense",label:"Polygon Name",type:"text",fullWidth:!0,value:C,onChange:e=>{Z(e.target.value),S(!1)},error:F,helperText:F?"Please enter a name for the polygon":"",sx:{mb:2}}),R&&(W||O)&&(0,r.jsxs)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:.5,mb:2},children:[W&&(0,r.jsxs)(u.Z,{variant:"body2",color:"error",children:["Max ",13," points exceeded"]}),O&&(0,r.jsxs)(u.Z,{variant:"body2",color:"error",children:["Max Area ",25," sq miles exceeded"]})]})]}),(0,r.jsx)(s.Z,{sx:{height:"calc(90vh - 280px)",minHeight:"450px",width:"100%",border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",position:"relative"},children:L?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(x.default,{...E,onMove:e=>P(e.viewState),mapboxAccessToken:w,style:{width:"100%",height:"100%"},mapStyle:"mapbox://styles/mapbox/light-v11",projection:"mercator",children:[(0,r.jsx)(f.Z,{position:"top-left",onControlChange:G,onDrawCreate:J,onDrawUpdate:q,polygonMode:U}),(0,r.jsx)(x.GeolocateControl,{position:"bottom-right"}),(0,r.jsx)(x.FullscreenControl,{position:"bottom-right"})]}),(0,r.jsxs)(s.Z,{sx:{position:"absolute",top:10,left:10,display:"flex",flexDirection:"column",gap:1,zIndex:1},children:[!R&&(0,r.jsx)(p.Z,{title:M?"Drawing in progress - drag to draw polygon":"Click to start drawing a polygon",placement:"right",children:(0,r.jsx)(h.Z,{variant:"contained",startIcon:(0,r.jsx)(y.Ir,{icon:"material-symbols:draw"}),onClick:X,disabled:M,color:M?"success":"primary",sx:{boxShadow:3,bgcolor:M?"success.main":"primary.main","&:hover":{boxShadow:4}},children:M?"Drawing...":"Draw Polygon"})}),R&&(0,r.jsx)(p.Z,{title:"Clear the drawn polygon and start over",placement:"right",children:(0,r.jsx)(h.Z,{variant:"contained",color:"error",startIcon:(0,r.jsx)(y.Ir,{icon:"material-symbols:delete-outline"}),onClick:V,sx:{boxShadow:3},children:"Clear"})})]}),(M||R)&&(0,r.jsx)(s.Z,{sx:{position:"absolute",top:80,left:10,bgcolor:"rgba(0, 0, 0, 0.75)",color:"white",px:2,py:1,borderRadius:1,zIndex:1,maxWidth:"300px"},children:M?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{variant:"body2",color:"inherit",sx:{fontSize:"0.875rem",lineHeight:1.5},children:"Click and drag on the map to draw your polygon"}),B>
1=10&&(0,r.jsxs)(u.Z,{variant:"body2",sx:{display:"inline-block",fontSize:"0.75rem",fontWeight:700,lineHeight:1.5,mt:.75,px:1,py:.25,borderRadius:"10px",bgcolor:"#ECBF2B",color:"#0D2430"},children:["â ",B,"/",13," points â polygon will auto-close at ",13]})]}):(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(u.Z,{variant:"body2",color:"inherit",sx:{fontSize:"0.75rem",lineHeight:1.5,mb:.5},children:"⢠Drag vertices (white dots) to reshape"}),(0,r.jsx)(u.Z,{variant:"body2",color:"inherit",sx:{fontSize:"0.75rem",lineHeight:1.5,mb:.5},children:"⢠Click vertex â press Backspace to delete"}),(0,r.jsx)(u.Z,{variant:"body2",color:"inherit",sx:{fontSize:"0.75rem",lineHeight:1.5},children:"⢠Drag midpoints to add vertices"})]})})]}):(0,r.jsxs)(s.Z,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:3,textAlign:"center"},children:[(0,r.jsx)(u.Z,{variant:"h6",children:"Map unavailable"}),(0,r.jsx)(u.Z,{variant:"body2",color:"text.primary",children:"Mapbox token is missing. Please set NEXT_PUBLIC_MAPBOX_TOKEN and reload to draw polygons."})]})})]}),(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(h.Z,{onClick:K,variant:"outlined",children:"Cancel"}),(0,r.jsx)(h.Z,{onClick:()=>{if(!C.trim()){S(!0);return}if(!R||O||W)return;let e=R.geometry.coordinates;k(C.trim(),e),K()},variant:"contained",disabled:!L||!R||!C.trim()||O||W,children:"Save Polygon"})]})]})}},51705:function(e,t,l){l.d(t,{L3:function(){return a},V1:function(){return c},be:function(){return r},e_:function(){return i},fZ:function(){return o}});let r={fill:"#007BFF",fillRgb:[0,123,255],stroke:"#007BFF",strokeRgb:[0,123,255],fillWithOpacity:e=>"rgba(0, 123, 255, ".concat(e,")"),fillRgba:e=>[0,123,255,Math.round(255*e)],fillOpacity:.25,strokeOpacity:1,strokeWidth:2},o={vertex:"#FF9800",vertexRgb:[255,152,0],midpoint:"#FFA726",midpointRgb:[255,167,38],halo:"#FFFFFF",haloRgb:[255,255,255],selected:"#9C27B0",selectedRgb:[156,39,176]},i={fill:"#FF9800",fillRgb:[255,152,0],stroke:"#FF9800",strokeRgb:[255,152,0],fillOpacity:.35},n=[.2,2],a=[{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":r.stroke,"line-dasharray":n,"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","draw_polygon"]],paint:{"fill-color":r.fill,"fill-outline-color":r.stroke,"fill-opacity":r.fillOpacity}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":4,"circle-color":o.midpoint}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":r.stroke,"line-dasharray":n,"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-halo-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":6,"circle-color":o.halo}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":4,"circle-color":o.vertex}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","$type","LineString"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":r.stroke,"line-width":3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","draw_polygon"]],paint:{"fill-color":r.fill,"fill-outline-color":r.stroke,"fill-opacity":0}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","$type","Polygon"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":r.stroke,"line-width":3}}],c={fill:{"fill-color":r.fill,"fill-opacity":r.fillOpacity},outline:{"line-color":r.stroke,"line-width":r.strokeWidth}}}}]); 2//# sourceMappingURL=49636.e6c89a4f247ba17a.js.map
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.