PageSourceSearch

https://fieldcalc.app/_next/static/chunks/4256.49fa661eae2dbe65.js

js fieldcalc.app collected 2026-10-02 00:26:48 UTC 5,775 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4256],{74256:function(e,t,r){r.r(t),r.d(t,{default:function(){return d}});var n=r(57437),o=r(2265),l=r(92735),s=r(70682),i=r(1592);function a(e,t){let[r,n,o,l]=t,s=Math.min(432/Math.max(o-r,1e-9),172/Math.max(l-n,1e-9));return e.map(e=>{let[t,o]=e;return"".concat((14+(t-r)*s).toFixed(1),",").concat((186-(o-n)*s).toFixed(1))}).join(" ")}function c(e){let{geom:t,bb:r}=e,o="#456EFE",l="rgba(69,110,254,0.14)";switch(t.type){case"Point":{let e=a([t.coordinates],r).split(",");return(0,n.jsx)("circle",{cx:parseFloat(e[0]),cy:parseFloat(e[1]),r:4,fill:o})}case"MultiPoint":return(0,n.jsx)(n.Fragment,{children:t.coordinates.map((e,t)=>{let l=a([e],r).split(",");return(0,n.jsx)("circle",{cx:parseFloat(l[0]),cy:parseFloat(l[1]),r:3,fill:o},t)})});case"LineString":return(0,n.jsx)("polyline",{points:a(t.coordinates,r),fill:"none",stroke:o,strokeWidth:1.5});case"MultiLineString":return(0,n.jsx)(n.Fragment,{children:t.coordinates.map((e,t)=>(0,n.jsx)("polyline",{points:a(e,r),fill:"none",stroke:o,strokeWidth:1.5},t))});case"Polygon":return(0,n.jsx)(n.Fragment,{children:t.coordinates.map((e,t)=>(0,n.jsx)("polygon",{points:a(e,r),fill:l,stroke:o,strokeWidth:1.2},t))});case"MultiPolygon":return(0,n.jsx)(n.Fragment,{children:t.coordinates.flatMap((e,t)=>e.map((e,s)=>(0,n.jsx)("polygon",{points:a(e,r),fill:l,stroke:o,strokeWidth:1.2},"".concat(t,"-").concat(s))))});case"GeometryCollection":return(0,n.jsx)(n.Fragment,{children:t.geometries.map((e,t)=>(0,n.jsx)(c,{geom:e,bb:r},t))});default:return null}}function u(e){let{fc:t}=e,{t:r}=(0,i.NT)(),l=(0,o.useMemo)(()=>(function(e){let[t,r,n,o]=[1/0,1/0,-1/0,-1/0];return e.forEach(e=>{e.geometry&&function e(l){if(Array.isArray(l)){if("number"==typeof l[0]&&"number"==typeof l[1]){let[e,s]=l;e<t&&(t=e),e>n&&(n=e),s<r&&(r=s),s>o&&(o=s)}else l.forEach(e)}}(e.geometry.coordinates)}),[t,r,n,o]})(t.features),[t]);return l[0]===1/0?null:(0,n.jsx)("svg",{viewBox:"0 0 ".concat(460," ").concat(200),className:"w-full rounded-xl border border-lp-line bg-[#0b1827]","aria-label":r("toolWidgets.geojsonViewer.previewAriaLabel"),children:t.features.map((e,t)=>e.geometry?(0,n.jsx)(c,{geom:e.geometry,bb:l},t):null)})}function d(){var e;let{t}=(0,i.NT)(),[r,a]=(0,o.useState)('{\n  "type": "FeatureCollection",\n  "features": [\n    {\n      "type": "Feature",\n      "properties": { "name": "Sample Field", "area_ha": 12.4 },\n      "geometry": {\n        "type": "Polygon",\n        "coordinates": [[\n          [-74.010, 40.710], [-73.980, 40.710],\n          [-73.980, 40.730], [-74.010, 40.730],\n          [-74.010, 40.710]\n        ]]\n      }\n    },\n    {\n      "type": "Feature",\n      "properties": { "name": "Waypoint A" },\n      "geometry": { "type": "Point", "coordinates": [-73.995, 40.720] }\n    }\n  ]\n}'),[c,d]=(0,o.useState)(""),p=(0,o.useMemo)(()=>{let e=r.trim();if(!e)return d(""),null;try{var n;let r=(null==(n=JSON.parse(e))?void 0:n.type)==="FeatureCollection"?n:(null==n?void 0:n.type)==="Feature"?{type:"FeatureCollection",features:[n]}:(null==n?void 0:n.type)?{type:"FeatureCollection",features:[{type:"Feature",properties:null,geometry:n}]}:null;if(!r)return d(t("toolWidgets.geojsonViewer.errorInvalidRoot")),null;return d(""),r}catch(e){return d(""),null}},[r,t]),x=(0,o.useMemo)(()=>{if(!p)return{};let e={};return p.features.forEach(t=>{var r,n,o;let l=null!==(n=null===(r=t.geometry)||void 0===r?void 0:r.type)&&void 0!==n?n:"Null";e[l]=(null!==(o=e[l])&&void 0!==o?o:0)+1}),e},[p]),g=null==p?void 0:null===(e=p.features[0])||void 0===e?void 0:e.properties,j=g&&Object.keys(g).length>0;async function m(e){try{a(await (0,s.ue)(e[0]))}catch(e){d(t("toolWidgets.geojsonViewer.errorReadFailed"))}}return(0,n.jsx)(s.tG,{children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(s.Yo,{accept:".geojson,.json",hint:t("toolWidgets.geojsonViewer.dropzoneHint"),onFiles:m}),(0,n.jsx)(s.Kx,{label:t("toolWidgets.geojsonViewer.pasteGeojsonLabel"),value:r,onChange:e=>a(e.target.value),rows:7,spellCheck:!1}),c&&(0,n.jsx)(s.qX,{tone:"error",children:c}),p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{fc:p}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(s.O0,{label:t("toolWidgets.geojsonViewer.totalFeatures"),value:String(p.features.length)}),Object.entries(x).map(e=>{let[t,r]=e;return(0,n.jsx)(s.O0,{label:t,value:String(r)},t)}
1)]}),j&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1.5 flex items-center justify-between",children:[(0,n.jsx)(s.eX,{children:t("toolWidgets.geojsonViewer.firstFeatureProperties")}),(0,n.jsx)(s.qi,{text:JSON.stringify(g,null,2),label:t("toolWidgets.geojsonViewer.copy")})]}),(0,n.jsx)("div",{className:"overflow-x-auto rounded-xl border border-lp-line",children:(0,n.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,n.jsx)("thead",{className:"bg-lp-bg",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-lp-slate",children:t("toolWidgets.geojsonViewer.tableKey")}),(0,n.jsx)("th",{className:"px-3 py-2 font-semibold text-lp-slate",children:t("toolWidgets.geojsonViewer.tableValue")})]})}),(0,n.jsx)("tbody",{children:Object.entries(g).map(e=>{let[t,r]=e;return(0,n.jsxs)("tr",{className:"border-t border-lp-line",children:[(0,n.jsx)("td",{className:"whitespace-nowrap px-3 py-2 font-semibold text-lp-blue",children:t}),(0,n.jsx)("td",{className:"max-w-xs truncate px-3 py-2 font-mono text-lp-ink",children:String(r)})]},t)})})]})})]}),(0,n.jsxs)(s.KM,{className:"w-full",onClick:()=>(0,s.Di)("export.geojson",JSON.stringify(p,null,2),"application/geo+json"),"data-track-cat":"tool_widget",children:[(0,n.jsx)(l.Z,{size:16}),t("toolWidgets.geojsonViewer.downloadButton")]})]})]})})}}}]);

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.