@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,34 +3,38 @@ import { geocodePlace as t } from "../../utils/geocode.js";
|
|
|
3
3
|
import { useHealthyBowl as n } from "../../context/HealthyBowlContext.js";
|
|
4
4
|
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
5
5
|
import { useBasePath as i } from "../../hooks/useBasePath.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import { useCropDetail as a } from "../../hooks/useCropPage.js";
|
|
7
|
+
import { deduplicatePickerRecords as o, pickerRecordLabel as ee } from "../../utils/cropPicker.js";
|
|
8
|
+
import { CropPicker as te } from "../../components/CropPicker.js";
|
|
9
|
+
import { EmptyState as ne } from "../../components/EmptyState.js";
|
|
10
|
+
import { ErrorState as re } from "../../components/ErrorState.js";
|
|
11
|
+
import { ToastContainer as ie } from "../../components/Toast.js";
|
|
12
|
+
import { useConfirm as ae } from "../../components/ConfirmDialog.js";
|
|
13
|
+
import { Modal as oe } from "../../components/Modal.js";
|
|
14
|
+
import { extractPolygon as s, isValidPolygon as se, polygonAreaInUnit as ce, polygonAreaSqMeters as le, polygonCentroid as ue, ringToPolygon as de } from "../../utils/geo.js";
|
|
15
|
+
import { require_leaflet_src as c } from "../../../node_modules/leaflet/dist/leaflet-src.js";
|
|
16
|
+
import { useToast as fe } from "../../hooks/useToast.js";
|
|
17
|
+
import { ensureLeafletCss as pe } from "../../utils/leaflet.js";
|
|
18
|
+
import { SOIL_PALETTE as me, soilColor as he, soilLegendFor as ge } from "../../utils/soil.js";
|
|
19
|
+
import { elevationColor as _e, fetchElevations as ve } from "../../utils/elevation.js";
|
|
20
|
+
import { bedPlantCount as ye, generateBeds as be } from "../../utils/bedLayout.js";
|
|
18
21
|
import "../../utils/index.js";
|
|
19
22
|
import "../../components/index.js";
|
|
20
|
-
import { useHealthyBowlData as
|
|
21
|
-
import { BED_GEOMETRY_NOTICE as
|
|
22
|
-
import { GrowGeometryInputs as
|
|
23
|
-
import { DEFAULT_BED_WIDTH_M as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
23
|
+
import { useHealthyBowlData as xe } from "../../hooks/useHealthyBowlData.js";
|
|
24
|
+
import { BED_GEOMETRY_NOTICE as Se, DEFAULT_GROW_LOCATION_TYPE as Ce, GROW_LOCATION_TYPE_OPTIONS as we, MAP_FEATURE_PROMOTABLE_HINT as l, growLocationTypeLabel as u, normalizeGrowLocationType as Te, usesBedGeometry as Ee } from "../../utils/growLocationType.js";
|
|
25
|
+
import { GrowGeometryInputs as De, geometryForType as Oe } from "../../components/GrowGeometryInputs.js";
|
|
26
|
+
import { DEFAULT_BED_WIDTH_M as ke, DEFAULT_PATH_WIDTH_M as Ae, getCropSpacingPreset as je } from "../../utils/plantingCapacity.js";
|
|
27
|
+
import { cropMatchesField as Me } from "../crops/planningEdit.js";
|
|
28
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
29
|
+
import { useI18n as Ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
30
|
+
import { Check as Pe, Droplet as g, Fence as Fe, Layers as Ie, LayoutGrid as Le, LocateFixed as Re, MapPinned as ze, Pencil as Be, Plus as Ve, Ruler as He, Save as Ue, Search as We, Shapes as Ge, Spline as Ke, Sprout as _, Square as v, Trash2 as qe, TriangleAlert as Je, Undo2 as Ye, Warehouse as Xe, Waypoints as y, X as Ze } from "lucide-react";
|
|
31
|
+
import { useNavigate as Qe } from "react-router";
|
|
32
|
+
import { Fragment as $e, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
33
|
+
import { Button as S, Select as et, SelectContent as tt, SelectItem as C, SelectTrigger as nt, SelectValue as rt } from "@burdenoff/fe-libs/ui";
|
|
34
|
+
import { gql as w } from "@apollo/client";
|
|
35
|
+
import { useMutation as it, useQuery as at } from "@apollo/client/react";
|
|
32
36
|
//#region src/healthybowl/pages/fields/FieldMapPage.tsx
|
|
33
|
-
var
|
|
37
|
+
var T = /* @__PURE__ */ e(c(), 1), ot = w`
|
|
34
38
|
mutation UpdateHealthyBowlFieldBoundaryOnMapPage($input: UpdateHealthyBowlFieldInput!) {
|
|
35
39
|
updateHealthyBowlField(input: $input) {
|
|
36
40
|
id
|
|
@@ -39,7 +43,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
39
43
|
location
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
`,
|
|
46
|
+
`, st = w`
|
|
43
47
|
query HealthyBowlBedsOnMapPage($context: ContextInput!, $fieldId: ID) {
|
|
44
48
|
healthyBowlBeds(context: $context, fieldId: $fieldId) {
|
|
45
49
|
id
|
|
@@ -55,13 +59,13 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
55
59
|
status
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
`,
|
|
62
|
+
`, ct = w`
|
|
59
63
|
mutation CreateHealthyBowlBedOnMapPage($input: CreateHealthyBowlBedInput!) {
|
|
60
64
|
createHealthyBowlBed(input: $input) {
|
|
61
65
|
id
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
|
-
`,
|
|
68
|
+
`, lt = w`
|
|
65
69
|
mutation UpdateHealthyBowlBedOnMapPage($input: UpdateHealthyBowlBedInput!) {
|
|
66
70
|
updateHealthyBowlBed(input: $input) {
|
|
67
71
|
id
|
|
@@ -69,11 +73,11 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
69
73
|
plantCount
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
|
-
`,
|
|
76
|
+
`, ut = w`
|
|
73
77
|
mutation DeleteHealthyBowlBedOnMapPage($id: ID!, $context: ContextInput!) {
|
|
74
78
|
deleteHealthyBowlBed(id: $id, context: $context)
|
|
75
79
|
}
|
|
76
|
-
`,
|
|
80
|
+
`, dt = w`
|
|
77
81
|
query HealthyBowlMapFeaturesOnMapPage($context: ContextInput!) {
|
|
78
82
|
healthyBowlMapFeatures(context: $context) {
|
|
79
83
|
id
|
|
@@ -84,17 +88,17 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
84
88
|
color
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
|
-
`,
|
|
91
|
+
`, ft = w`
|
|
88
92
|
mutation CreateHealthyBowlMapFeatureOnMapPage($input: CreateHealthyBowlMapFeatureInput!) {
|
|
89
93
|
createHealthyBowlMapFeature(input: $input) {
|
|
90
94
|
id
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
|
-
`,
|
|
97
|
+
`, pt = w`
|
|
94
98
|
mutation DeleteHealthyBowlMapFeatureOnMapPage($id: ID!, $context: ContextInput!) {
|
|
95
99
|
deleteHealthyBowlMapFeature(id: $id, context: $context)
|
|
96
100
|
}
|
|
97
|
-
`,
|
|
101
|
+
`, mt = [
|
|
98
102
|
{
|
|
99
103
|
type: "BUFFER_ZONE",
|
|
100
104
|
kind: "polygon",
|
|
@@ -108,7 +112,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
108
112
|
fillColor: "#f59e0b",
|
|
109
113
|
fillOpacity: .15
|
|
110
114
|
},
|
|
111
|
-
icon:
|
|
115
|
+
icon: v
|
|
112
116
|
},
|
|
113
117
|
{
|
|
114
118
|
type: "GREENHOUSE",
|
|
@@ -122,8 +126,8 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
122
126
|
fillColor: "#14b8a6",
|
|
123
127
|
fillOpacity: .3
|
|
124
128
|
},
|
|
125
|
-
icon:
|
|
126
|
-
hint:
|
|
129
|
+
icon: _,
|
|
130
|
+
hint: l,
|
|
127
131
|
promotesTo: "GREENHOUSE"
|
|
128
132
|
},
|
|
129
133
|
{
|
|
@@ -138,7 +142,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
138
142
|
fillColor: "#6b7280",
|
|
139
143
|
fillOpacity: .4
|
|
140
144
|
},
|
|
141
|
-
icon:
|
|
145
|
+
icon: Xe
|
|
142
146
|
},
|
|
143
147
|
{
|
|
144
148
|
type: "ENCLOSURE",
|
|
@@ -153,7 +157,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
153
157
|
fillColor: "#92400e",
|
|
154
158
|
fillOpacity: .2
|
|
155
159
|
},
|
|
156
|
-
icon:
|
|
160
|
+
icon: Fe
|
|
157
161
|
},
|
|
158
162
|
{
|
|
159
163
|
type: "CUSTOM",
|
|
@@ -167,7 +171,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
167
171
|
fillColor: "#8b5cf6",
|
|
168
172
|
fillOpacity: .25
|
|
169
173
|
},
|
|
170
|
-
icon:
|
|
174
|
+
icon: Ge
|
|
171
175
|
},
|
|
172
176
|
{
|
|
173
177
|
type: "IRRIGATION_LINE",
|
|
@@ -179,7 +183,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
179
183
|
color: "#3b82f6",
|
|
180
184
|
weight: 3
|
|
181
185
|
},
|
|
182
|
-
icon:
|
|
186
|
+
icon: y
|
|
183
187
|
},
|
|
184
188
|
{
|
|
185
189
|
type: "WATER_SOURCE",
|
|
@@ -193,7 +197,7 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
193
197
|
fillColor: "#3b82f6",
|
|
194
198
|
fillOpacity: 1
|
|
195
199
|
},
|
|
196
|
-
icon:
|
|
200
|
+
icon: g
|
|
197
201
|
},
|
|
198
202
|
{
|
|
199
203
|
type: "HAZARD",
|
|
@@ -207,79 +211,88 @@ var w = /* @__PURE__ */ e(s(), 1), nt = C`
|
|
|
207
211
|
fillColor: "#dc2626",
|
|
208
212
|
fillOpacity: 1
|
|
209
213
|
},
|
|
210
|
-
icon:
|
|
214
|
+
icon: Je
|
|
211
215
|
}
|
|
212
|
-
],
|
|
213
|
-
async function
|
|
216
|
+
], E = new Map(mt.map((e) => [e.type, e])), ht = (e) => e === "polygon" ? "Area" : e === "line" ? "Line" : "Point", gt = 250, _t = 20;
|
|
217
|
+
async function vt(e, t, n) {
|
|
214
218
|
for (let r = 0; r < e.length; r += t) await Promise.all(e.slice(r, r + t).map(n));
|
|
215
219
|
}
|
|
216
|
-
var
|
|
220
|
+
var yt = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", bt = "Esri, Maxar, Earthstar Geographics", xt = "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", St = "© OpenTopoMap (CC-BY-SA) · © OpenStreetMap contributors", Ct = 21, wt = 16, Tt = 2.47105, Et = "#16a34a", Dt = {
|
|
217
221
|
color: "#f59e0b",
|
|
218
222
|
weight: 2,
|
|
219
223
|
dashArray: "6 4",
|
|
220
224
|
fillColor: "#f59e0b",
|
|
221
225
|
fillOpacity: .15
|
|
222
|
-
},
|
|
226
|
+
}, Ot = {
|
|
223
227
|
color: "#ffffff",
|
|
224
228
|
weight: 2,
|
|
225
229
|
dashArray: "6 4",
|
|
226
230
|
fillColor: "#22c55e",
|
|
227
231
|
fillOpacity: .2
|
|
228
|
-
},
|
|
232
|
+
}, kt = {
|
|
229
233
|
color: "#38bdf8",
|
|
230
234
|
weight: 3,
|
|
231
235
|
dashArray: "6 6"
|
|
232
|
-
},
|
|
236
|
+
}, At = {
|
|
233
237
|
color: "#b45309",
|
|
234
238
|
weight: 1,
|
|
235
239
|
dashArray: "4 3",
|
|
236
240
|
fillColor: "#f59e0b",
|
|
237
241
|
fillOpacity: .25
|
|
238
|
-
},
|
|
242
|
+
}, jt = {
|
|
239
243
|
color: "#065f46",
|
|
240
244
|
weight: 2,
|
|
241
245
|
fillColor: "#34d399",
|
|
242
246
|
fillOpacity: .5
|
|
243
|
-
},
|
|
247
|
+
}, Mt = {
|
|
244
248
|
color: "#065f46",
|
|
245
249
|
weight: 2,
|
|
246
250
|
fillColor: "#059669",
|
|
247
251
|
fillOpacity: .6
|
|
248
|
-
},
|
|
252
|
+
}, Nt = {
|
|
249
253
|
color: "#f8fafc",
|
|
250
254
|
weight: 2,
|
|
251
255
|
dashArray: "8 6",
|
|
252
256
|
fillColor: "#f8fafc",
|
|
253
257
|
fillOpacity: .06
|
|
254
|
-
},
|
|
255
|
-
let t =
|
|
256
|
-
return t &&
|
|
257
|
-
},
|
|
258
|
+
}, Pt = (e) => !!(e && Number.isFinite(e.lat) && Number.isFinite(e.lng) && e.lat >= -90 && e.lat <= 90 && e.lng >= -180 && e.lng <= 180 && (e.lat !== 0 || e.lng !== 0)), Ft = (e) => /hect|(^|[^a-z])ha([^a-z]|$)/i.test(e ?? ""), It = (e) => Ft(e.unit) ? e.area * Tt : e.area, Lt = (e) => `${e.area.toFixed(1)} ${Ft(e.unit) ? "ha" : "ac"}`, D = (e) => {
|
|
259
|
+
let t = s(e.boundary);
|
|
260
|
+
return t && se(t) ? t : null;
|
|
261
|
+
}, Rt = T.default.divIcon({
|
|
258
262
|
className: "",
|
|
259
263
|
html: "<span style=\"display:block;width:12px;height:12px;background:#22c55e;border:2px solid #fff;border-radius:2px;box-shadow:0 0 3px rgba(0,0,0,.6)\"></span>",
|
|
260
264
|
iconSize: [16, 16],
|
|
261
265
|
iconAnchor: [8, 8]
|
|
262
|
-
}),
|
|
263
|
-
let {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}, [
|
|
266
|
+
}), O = () => {
|
|
267
|
+
let { workspaceId: e } = n();
|
|
268
|
+
return e ? /* @__PURE__ */ b(zt, {}, e) : /* @__PURE__ */ b(r, {
|
|
269
|
+
title: "Field Map",
|
|
270
|
+
children: /* @__PURE__ */ b("p", {
|
|
271
|
+
className: "text-sm text-text-secondary",
|
|
272
|
+
children: "Choose a workspace to view its fields and beds."
|
|
273
|
+
})
|
|
274
|
+
});
|
|
275
|
+
}, zt = () => {
|
|
276
|
+
let { t: e } = Ne(), { workspaceId: c } = n(), l = ae(), { fields: g, crops: _, farm: v, loadings: Je, errors: Xe, refetch: y, createField: w, updateFarm: Tt } = xe(), { toasts: Ft, toast: O, dismiss: zt } = fe(), Bt = Qe(), { buildPath: Vt } = i(), Ht = !!v?.id, [Ut] = it(ot), [Wt] = it(ct), [Gt] = it(lt), [Kt] = it(ut), [qt] = it(ft), [Jt] = it(pt), [k, Yt] = h("loading"), [A, j] = h("view"), [M, N] = h(null), [Xt, Zt] = h(!1), [Qt, $t] = h(!0), [en, tn] = h(!1), [P, nn] = h({}), [rn, an] = h(""), [on, sn] = h(""), [cn, ln] = h(!1), [un, dn] = h(0), [fn, pn] = h(null), [mn, hn] = h(!1), [gn, _n] = h(!1), [F, vn] = h(null), [yn, bn] = h(!1), [I, xn] = h(ke), [Sn, Cn] = h(Ae), [wn, Tn] = h(0), [L, En] = h(""), [Dn, On] = h(null), [kn, An] = h(!1), [jn, Mn] = h(!1), [R, Nn] = h(null), [z, Pn] = h(""), [Fn, In] = h(!1), [Ln, Rn] = h(!0), [zn, Bn] = h(!0), [Vn, Hn] = h(!1), [Un, Wn] = h(!1), [Gn, Kn] = h(null), [qn, Jn] = h(0), [B, Yn] = h(null), [Xn, Zn] = h(""), [Qn, $n] = h(""), [er, tr] = h(!1), [V, nr] = h(null), [rr, ir] = h(!1), [H, ar] = h(null), [or, sr] = h(!1), [cr, lr] = h(""), [ur, dr] = h("Clay loam"), [fr, pr] = h("Drip"), [mr, hr] = h("active"), [gr, _r] = h(Ce), [vr, yr] = h({}), [br, xr] = h(null), Sr = m(null), U = m(null), Cr = m(null), wr = m(null), Tr = m(null), Er = m(null), Dr = m(null), Or = m(null), kr = m(null), Ar = m(null), jr = m(null), Mr = m(null), Nr = m([]), Pr = m(null), Fr = m(null), Ir = m([]), Lr = m(null), Rr = m([]), zr = m(null), Br = m([]), W = m("view"), Vr = m(!1);
|
|
277
|
+
f(() => {
|
|
278
|
+
W.current = A;
|
|
279
|
+
}, [A]), f(() => {
|
|
280
|
+
Fr.current = Gn;
|
|
281
|
+
}, [Gn]), f(() => {
|
|
282
|
+
A !== "element" && (Mr.current?.clearLayers(), Nr.current = [], Pr.current = null);
|
|
283
|
+
}, [A]);
|
|
284
|
+
let Hr = p(() => g.filter((e) => D(e) !== null).length, [g]), Ur = p(() => g.reduce((e, t) => e + It(t), 0), [g]), Wr = p(() => ge(g.map((e) => e.soilType)), [g]), G = p(() => g.find((e) => e.id === M) ?? null, [g, M]), Gr = p(() => {
|
|
285
|
+
let e = s(v?.boundary);
|
|
286
|
+
return e && se(e) ? e : null;
|
|
287
|
+
}, [v]), Kr = p(() => {
|
|
288
|
+
let e = rn.trim().toLowerCase();
|
|
289
|
+
return e ? g.filter((t) => t.name.toLowerCase().includes(e) || (t.soilType ?? "").toLowerCase().includes(e)) : g;
|
|
290
|
+
}, [g, rn]), qr = p(() => {
|
|
278
291
|
let e = [];
|
|
279
|
-
for (let t of
|
|
280
|
-
let n =
|
|
292
|
+
for (let t of g) {
|
|
293
|
+
let n = D(t);
|
|
281
294
|
if (n) {
|
|
282
|
-
let r =
|
|
295
|
+
let r = ue(n);
|
|
283
296
|
if (r) {
|
|
284
297
|
e.push({
|
|
285
298
|
id: t.id,
|
|
@@ -289,80 +302,88 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
289
302
|
continue;
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
|
-
|
|
305
|
+
Pt(t.location) && e.push({
|
|
293
306
|
id: t.id,
|
|
294
307
|
lat: t.location.lat,
|
|
295
308
|
lng: t.location.lng
|
|
296
309
|
});
|
|
297
310
|
}
|
|
298
311
|
return e;
|
|
299
|
-
}, [
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
312
|
+
}, [g]);
|
|
313
|
+
f(() => {
|
|
314
|
+
if (qr.length === 0) {
|
|
315
|
+
nn({});
|
|
303
316
|
return;
|
|
304
317
|
}
|
|
305
318
|
let e = new AbortController(), t = !1;
|
|
306
|
-
return
|
|
319
|
+
return ve(qr.map((e) => ({
|
|
307
320
|
lat: e.lat,
|
|
308
321
|
lng: e.lng
|
|
309
322
|
})), e.signal).then((e) => {
|
|
310
323
|
if (t) return;
|
|
311
324
|
let n = {};
|
|
312
|
-
|
|
325
|
+
qr.forEach((t, r) => {
|
|
313
326
|
n[t.id] = e[r] ?? null;
|
|
314
|
-
}),
|
|
327
|
+
}), nn(n);
|
|
315
328
|
}), () => {
|
|
316
329
|
t = !0, e.abort();
|
|
317
330
|
};
|
|
318
|
-
}, [
|
|
319
|
-
let [
|
|
320
|
-
let e = Object.values(
|
|
331
|
+
}, [p(() => qr.map((e) => `${e.id}:${e.lat.toFixed(5)},${e.lng.toFixed(5)}`).join("|"), [qr])]);
|
|
332
|
+
let [Jr, Yr] = p(() => {
|
|
333
|
+
let e = Object.values(P).filter((e) => e != null && Number.isFinite(e));
|
|
321
334
|
return e.length === 0 ? [0, 0] : [Math.min(...e), Math.max(...e)];
|
|
322
|
-
}, [
|
|
335
|
+
}, [P]), Xr = p(() => Object.values(P).some((e) => e != null && Number.isFinite(e)), [P]), Zr = d((e) => {
|
|
323
336
|
if (!e) return "";
|
|
324
|
-
let t =
|
|
337
|
+
let t = _.find((t) => Me(t, e));
|
|
325
338
|
return t ? t.name : (e.crops ?? []).join(", ");
|
|
326
|
-
}, [
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}, [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
339
|
+
}, [_]), Qr = p(() => G ? D(G) : null, [G]), $r = p(() => G ? _.find((e) => Me(e, G)) ?? null : null, [_, G]), ei = a(L), ti = Dn?.workspaceId === c && Dn.crop.id === L ? Dn.crop : null, ni = L ? ei.crop ?? ti : $r, K = !!(L && !ni), ri = ei.loading && !ei.error ? e("healthybowl.fieldMapPage.beds.cropLoading", "Loading selected crop spacing… Your selection is kept.") : e("healthybowl.fieldMapPage.beds.cropUnavailable", "Selected crop spacing is unavailable. Your selection is kept; resolve it before replacing the layout.");
|
|
340
|
+
f(() => {
|
|
341
|
+
ei.crop && On({
|
|
342
|
+
workspaceId: c,
|
|
343
|
+
crop: ei.crop
|
|
344
|
+
});
|
|
345
|
+
}, [ei.crop, c]);
|
|
346
|
+
let ii = p(() => o([..._.filter((e) => G && Me(e, G)), ..._]), [_, G]), ai = a(z, { skip: !R }), oi = ai.crop, si = z === (R?.cropId ?? ""), q = p(() => je(ni), [ni]);
|
|
347
|
+
f(() => {
|
|
348
|
+
En(""), On(null);
|
|
349
|
+
}, [M]);
|
|
350
|
+
let J = Ee(G?.type), ci = u(e, G?.type), Y = p(() => !Qr || !J ? null : be(Qr, {
|
|
351
|
+
bedWidthM: I,
|
|
352
|
+
pathWidthM: Sn,
|
|
353
|
+
orientationDeg: wn
|
|
338
354
|
}), [
|
|
339
|
-
|
|
340
|
-
q,
|
|
341
|
-
F,
|
|
342
|
-
vn,
|
|
343
|
-
bn
|
|
344
|
-
]), Yr = f(() => J ? J.beds.reduce((e, t) => e + ge(oe(t), F, K.plantSpacingCm, K.rowSpacingCm), 0) : 0, [
|
|
355
|
+
Qr,
|
|
345
356
|
J,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
357
|
+
I,
|
|
358
|
+
Sn,
|
|
359
|
+
wn
|
|
360
|
+
]), li = p(() => K ? null : Y ? Y.beds.reduce((e, t) => e + ye(le(t), I, q.plantSpacingCm, q.rowSpacingCm), 0) : 0, [
|
|
361
|
+
K,
|
|
362
|
+
Y,
|
|
363
|
+
I,
|
|
364
|
+
q
|
|
365
|
+
]), { data: ui, loading: di, refetch: fi } = at(st, {
|
|
349
366
|
variables: {
|
|
350
|
-
context: { workspaceId:
|
|
351
|
-
fieldId:
|
|
367
|
+
context: { workspaceId: c },
|
|
368
|
+
fieldId: M ?? void 0
|
|
352
369
|
},
|
|
353
|
-
skip: !
|
|
370
|
+
skip: !M,
|
|
354
371
|
fetchPolicy: "cache-and-network"
|
|
355
|
-
}),
|
|
356
|
-
variables: { context: { workspaceId:
|
|
372
|
+
}), X = p(() => ui?.healthyBowlBeds ?? [], [ui]), { data: pi, refetch: mi } = at(dt, {
|
|
373
|
+
variables: { context: { workspaceId: c } },
|
|
357
374
|
fetchPolicy: "cache-and-network"
|
|
358
|
-
}),
|
|
359
|
-
|
|
360
|
-
let t =
|
|
361
|
-
t
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
375
|
+
}), hi = p(() => pi?.healthyBowlMapFeatures ?? [], [pi]), gi = p(() => E.get(Gn ?? "") ?? null, [Gn]), _i = d((e) => {
|
|
376
|
+
if (!e) return null;
|
|
377
|
+
let t = _.find((t) => t.id === e);
|
|
378
|
+
return t ? ee(t) : `Recorded crop ID ${e} (unavailable)`;
|
|
379
|
+
}, [_]);
|
|
380
|
+
f(() => {
|
|
381
|
+
let t = Ar.current;
|
|
382
|
+
t && (t.clearLayers(), A === "view" && (X.forEach((n) => {
|
|
383
|
+
let r = s(n.boundary);
|
|
384
|
+
if (!r || !se(r)) return;
|
|
385
|
+
let i = _i(n.cropId), a = T.default.geoJSON(r, { style: () => n.cropId ? Mt : jt });
|
|
386
|
+
a.bindTooltip(J ? e("healthybowl.fieldMapPage.beds.savedTooltip", "{{name}}{{crop}} · {{plants}} plants", {
|
|
366
387
|
name: n.name,
|
|
367
388
|
crop: i ? ` · ${i}` : "",
|
|
368
389
|
plants: String(n.plantCount ?? 0)
|
|
@@ -373,41 +394,43 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
373
394
|
sticky: !0,
|
|
374
395
|
direction: "top"
|
|
375
396
|
}), a.on("click", (e) => {
|
|
376
|
-
|
|
397
|
+
T.default.DomEvent.stopPropagation(e), Nn(n), Pn(n.cropId ?? "");
|
|
377
398
|
}), a.addTo(t);
|
|
378
|
-
}),
|
|
379
|
-
let r =
|
|
380
|
-
|
|
381
|
-
plants: String(
|
|
399
|
+
}), yn && Y && Y.beds.forEach((n) => {
|
|
400
|
+
let r = le(n), i = T.default.geoJSON(n, { style: () => At });
|
|
401
|
+
i.bindTooltip(K ? ri : e("healthybowl.fieldMapPage.beds.bedTooltip", "{{plants}} plants · {{area}} m²", {
|
|
402
|
+
plants: String(ye(r, I, q.plantSpacingCm, q.rowSpacingCm)),
|
|
382
403
|
area: r.toFixed(0)
|
|
383
404
|
}), {
|
|
384
405
|
sticky: !0,
|
|
385
406
|
direction: "top"
|
|
386
|
-
}),
|
|
407
|
+
}), i.addTo(t);
|
|
387
408
|
})));
|
|
388
409
|
}, [
|
|
389
|
-
|
|
390
|
-
q,
|
|
410
|
+
yn,
|
|
391
411
|
J,
|
|
392
|
-
F,
|
|
393
|
-
K,
|
|
394
|
-
k,
|
|
395
412
|
Y,
|
|
413
|
+
I,
|
|
414
|
+
q,
|
|
415
|
+
K,
|
|
396
416
|
ri,
|
|
417
|
+
A,
|
|
418
|
+
X,
|
|
419
|
+
_i,
|
|
397
420
|
e
|
|
398
|
-
]),
|
|
399
|
-
let t =
|
|
400
|
-
t && (t.clearLayers(),
|
|
401
|
-
let r =
|
|
421
|
+
]), f(() => {
|
|
422
|
+
let t = jr.current;
|
|
423
|
+
t && (t.clearLayers(), Ln && hi.forEach((n) => {
|
|
424
|
+
let r = E.get(n.type), i = n.color || r?.color || "#8b5cf6", a = r?.style ?? {
|
|
402
425
|
color: i,
|
|
403
426
|
weight: 2,
|
|
404
427
|
fillColor: i,
|
|
405
428
|
fillOpacity: .25
|
|
406
429
|
}, o = null;
|
|
407
430
|
try {
|
|
408
|
-
o =
|
|
431
|
+
o = T.default.geoJSON(n.geometry, {
|
|
409
432
|
style: () => a,
|
|
410
|
-
pointToLayer: (e, t) =>
|
|
433
|
+
pointToLayer: (e, t) => T.default.circleMarker(t, {
|
|
411
434
|
radius: 7,
|
|
412
435
|
color: "#fff",
|
|
413
436
|
weight: 2,
|
|
@@ -424,65 +447,73 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
424
447
|
sticky: !0,
|
|
425
448
|
direction: "top"
|
|
426
449
|
}), o.on("click", (e) => {
|
|
427
|
-
|
|
450
|
+
T.default.DomEvent.stopPropagation(e), W.current === "view" && nr(n);
|
|
428
451
|
}), o.addTo(t);
|
|
429
452
|
}));
|
|
430
453
|
}, [
|
|
431
|
-
|
|
432
|
-
|
|
454
|
+
hi,
|
|
455
|
+
Ln,
|
|
433
456
|
e
|
|
434
|
-
]),
|
|
435
|
-
let t =
|
|
436
|
-
if (!t || (t.clearLayers(), !
|
|
437
|
-
let n =
|
|
438
|
-
n.bindTooltip(e("healthybowl.fieldMapPage.farmBoundary.tooltip", "{{name}} · Farm boundary", { name:
|
|
457
|
+
]), f(() => {
|
|
458
|
+
let t = Er.current;
|
|
459
|
+
if (!t || (t.clearLayers(), !zn || !Gr)) return;
|
|
460
|
+
let n = T.default.geoJSON(Gr, { style: () => Nt });
|
|
461
|
+
n.bindTooltip(e("healthybowl.fieldMapPage.farmBoundary.tooltip", "{{name}} · Farm boundary", { name: v?.name ?? "" }), {
|
|
439
462
|
sticky: !0,
|
|
440
463
|
direction: "top"
|
|
441
464
|
}), n.addTo(t);
|
|
442
465
|
}, [
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
466
|
+
Gr,
|
|
467
|
+
zn,
|
|
468
|
+
v?.name,
|
|
446
469
|
e
|
|
447
470
|
]);
|
|
448
|
-
let
|
|
449
|
-
if (!(!G || !
|
|
450
|
-
if (
|
|
451
|
-
|
|
471
|
+
let vi = d(async () => {
|
|
472
|
+
if (!(!G || !Y || Y.beds.length === 0)) {
|
|
473
|
+
if (K) {
|
|
474
|
+
O({
|
|
475
|
+
title: e("healthybowl.fieldMapPage.beds.saveFailed.title", "Could not save beds"),
|
|
476
|
+
description: ri,
|
|
477
|
+
variant: "warning"
|
|
478
|
+
});
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (Y.bedCount > gt) {
|
|
482
|
+
O({
|
|
452
483
|
title: e("healthybowl.fieldMapPage.beds.tooMany.title", "Too many beds to save"),
|
|
453
484
|
description: e("healthybowl.fieldMapPage.beds.tooMany.description", "This layout has {{count}} beds (max {{max}}). Increase the bed width to reduce the count, then save.", {
|
|
454
|
-
count: String(
|
|
455
|
-
max: String(
|
|
485
|
+
count: String(Y.bedCount),
|
|
486
|
+
max: String(gt)
|
|
456
487
|
}),
|
|
457
488
|
variant: "warning"
|
|
458
489
|
});
|
|
459
490
|
return;
|
|
460
491
|
}
|
|
461
|
-
|
|
492
|
+
An(!0);
|
|
462
493
|
try {
|
|
463
|
-
await
|
|
494
|
+
await vt(X, _t, (e) => Kt({ variables: {
|
|
464
495
|
id: e.id,
|
|
465
|
-
context: { workspaceId:
|
|
496
|
+
context: { workspaceId: c }
|
|
466
497
|
} }));
|
|
467
|
-
let t =
|
|
468
|
-
await
|
|
498
|
+
let t = Y.beds;
|
|
499
|
+
await vt(t.map((e, t) => ({
|
|
469
500
|
bed: e,
|
|
470
501
|
index: t
|
|
471
|
-
})),
|
|
472
|
-
let r =
|
|
473
|
-
return
|
|
502
|
+
})), _t, ({ bed: t, index: n }) => {
|
|
503
|
+
let r = le(t), i = ye(r, I, q.plantSpacingCm, q.rowSpacingCm);
|
|
504
|
+
return Wt({ variables: { input: {
|
|
474
505
|
fieldId: G.id,
|
|
475
506
|
name: e("healthybowl.fieldMapPage.beds.bedName", "Bed {{n}}", { n: String(n + 1) }),
|
|
476
507
|
boundary: t,
|
|
477
508
|
area: r,
|
|
478
509
|
unit: "sqm",
|
|
479
|
-
widthM:
|
|
480
|
-
orientationDeg:
|
|
481
|
-
cropId:
|
|
510
|
+
widthM: I,
|
|
511
|
+
orientationDeg: wn,
|
|
512
|
+
cropId: L || ni?.id || void 0,
|
|
482
513
|
plantCount: i,
|
|
483
|
-
context: { workspaceId:
|
|
514
|
+
context: { workspaceId: c }
|
|
484
515
|
} } });
|
|
485
|
-
}), await
|
|
516
|
+
}), await fi(), O({
|
|
486
517
|
title: e("healthybowl.fieldMapPage.beds.saved.title", "Bed layout saved"),
|
|
487
518
|
description: e("healthybowl.fieldMapPage.beds.saved.description", "Saved {{count}} beds for {{name}}.", {
|
|
488
519
|
count: String(t.length),
|
|
@@ -491,115 +522,121 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
491
522
|
variant: "success"
|
|
492
523
|
});
|
|
493
524
|
} catch (t) {
|
|
494
|
-
|
|
525
|
+
O({
|
|
495
526
|
title: e("healthybowl.fieldMapPage.beds.saveFailed.title", "Could not save beds"),
|
|
496
527
|
description: String(t),
|
|
497
528
|
variant: "error"
|
|
498
529
|
});
|
|
499
530
|
} finally {
|
|
500
|
-
|
|
531
|
+
An(!1);
|
|
501
532
|
}
|
|
502
533
|
}
|
|
503
534
|
}, [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
bn,
|
|
535
|
+
ni,
|
|
536
|
+
L,
|
|
507
537
|
K,
|
|
508
|
-
|
|
509
|
-
Bt,
|
|
510
|
-
Ht,
|
|
511
|
-
Qr,
|
|
538
|
+
ri,
|
|
512
539
|
Y,
|
|
540
|
+
wn,
|
|
541
|
+
q,
|
|
542
|
+
I,
|
|
543
|
+
Wt,
|
|
544
|
+
Kt,
|
|
545
|
+
fi,
|
|
546
|
+
X,
|
|
513
547
|
G,
|
|
514
548
|
e,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
]),
|
|
518
|
-
if (!(!G ||
|
|
549
|
+
O,
|
|
550
|
+
c
|
|
551
|
+
]), yi = d(async () => {
|
|
552
|
+
if (!(!G || X.length === 0) && await l({
|
|
519
553
|
title: e("healthybowl.fieldMapPage.beds.clearConfirm.title", "Clear saved beds?"),
|
|
520
554
|
message: e("healthybowl.fieldMapPage.beds.clearConfirm.description", "This deletes all {{count}} saved beds for {{name}}. You can re-generate and save again.", {
|
|
521
|
-
count: String(
|
|
555
|
+
count: String(X.length),
|
|
522
556
|
name: G.name
|
|
523
557
|
}),
|
|
524
558
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
525
559
|
})) {
|
|
526
|
-
|
|
560
|
+
Mn(!0);
|
|
527
561
|
try {
|
|
528
|
-
await
|
|
562
|
+
await vt(X, _t, (e) => Kt({ variables: {
|
|
529
563
|
id: e.id,
|
|
530
|
-
context: { workspaceId:
|
|
531
|
-
} })), await
|
|
564
|
+
context: { workspaceId: c }
|
|
565
|
+
} })), await fi(), O({
|
|
532
566
|
title: e("healthybowl.fieldMapPage.beds.cleared.title", "Saved beds cleared"),
|
|
533
567
|
description: e("healthybowl.fieldMapPage.beds.cleared.description", "Removed the saved layout."),
|
|
534
568
|
variant: "success"
|
|
535
569
|
});
|
|
536
570
|
} catch (t) {
|
|
537
|
-
|
|
571
|
+
O({
|
|
538
572
|
title: e("healthybowl.fieldMapPage.beds.saveFailed.title", "Could not save beds"),
|
|
539
573
|
description: String(t),
|
|
540
574
|
variant: "error"
|
|
541
575
|
});
|
|
542
576
|
} finally {
|
|
543
|
-
|
|
577
|
+
Mn(!1);
|
|
544
578
|
}
|
|
545
579
|
}
|
|
546
580
|
}, [
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
581
|
+
l,
|
|
582
|
+
Kt,
|
|
583
|
+
fi,
|
|
584
|
+
X,
|
|
551
585
|
G,
|
|
552
586
|
e,
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
]),
|
|
556
|
-
if (!
|
|
557
|
-
let t =
|
|
558
|
-
|
|
587
|
+
O,
|
|
588
|
+
c
|
|
589
|
+
]), bi = d(async () => {
|
|
590
|
+
if (!R) return;
|
|
591
|
+
let t = oi;
|
|
592
|
+
if (z && !t && !si) return;
|
|
593
|
+
let n = je(t), r = s(R.boundary), i = R.area ?? (r ? le(r) : 0), a = R.widthM ?? I, o = z && !t ? R.plantCount : J ? ye(i, a, n.plantSpacingCm, n.rowSpacingCm) : null;
|
|
594
|
+
In(!0);
|
|
559
595
|
try {
|
|
560
|
-
await
|
|
561
|
-
id:
|
|
562
|
-
cropId:
|
|
596
|
+
await Gt({ variables: { input: {
|
|
597
|
+
id: R.id,
|
|
598
|
+
cropId: z || null,
|
|
563
599
|
plantCount: o,
|
|
564
|
-
context: { workspaceId:
|
|
565
|
-
} } }), await
|
|
600
|
+
context: { workspaceId: c }
|
|
601
|
+
} } }), await fi(), Nn(null), O({
|
|
566
602
|
title: e("healthybowl.fieldMapPage.beds.assigned.title", "Crop assigned"),
|
|
567
|
-
description: t ? o == null ? e("healthybowl.fieldMapPage.beds.assigned.noPlants", "{{bed}}: {{crop}}.", {
|
|
568
|
-
bed:
|
|
603
|
+
description: z && !t ? `${R.name}: recorded crop ID ${z} and plant count retained.` : t ? o == null ? e("healthybowl.fieldMapPage.beds.assigned.noPlants", "{{bed}}: {{crop}}.", {
|
|
604
|
+
bed: R.name,
|
|
569
605
|
crop: t.name
|
|
570
606
|
}) : e("healthybowl.fieldMapPage.beds.assigned.description", "{{bed}}: {{crop}} · {{plants}} plants.", {
|
|
571
|
-
bed:
|
|
607
|
+
bed: R.name,
|
|
572
608
|
crop: t.name,
|
|
573
609
|
plants: String(o)
|
|
574
|
-
}) : e("healthybowl.fieldMapPage.beds.assigned.cleared", "{{bed}}: crop cleared.", { bed:
|
|
610
|
+
}) : e("healthybowl.fieldMapPage.beds.assigned.cleared", "{{bed}}: crop cleared.", { bed: R.name }),
|
|
575
611
|
variant: "success"
|
|
576
612
|
});
|
|
577
613
|
} catch (t) {
|
|
578
|
-
|
|
614
|
+
O({
|
|
579
615
|
title: e("healthybowl.fieldMapPage.beds.assignFailed.title", "Could not assign crop"),
|
|
580
616
|
description: String(t),
|
|
581
617
|
variant: "error"
|
|
582
618
|
});
|
|
583
619
|
} finally {
|
|
584
|
-
|
|
620
|
+
In(!1);
|
|
585
621
|
}
|
|
586
622
|
}, [
|
|
623
|
+
R,
|
|
624
|
+
z,
|
|
625
|
+
oi,
|
|
626
|
+
si,
|
|
627
|
+
J,
|
|
587
628
|
I,
|
|
588
|
-
|
|
589
|
-
q,
|
|
590
|
-
F,
|
|
591
|
-
g,
|
|
592
|
-
Qr,
|
|
629
|
+
fi,
|
|
593
630
|
e,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
]),
|
|
598
|
-
let t =
|
|
631
|
+
O,
|
|
632
|
+
Gt,
|
|
633
|
+
c
|
|
634
|
+
]), xi = d((e) => {
|
|
635
|
+
let t = U.current;
|
|
599
636
|
if (!t) return;
|
|
600
|
-
let n =
|
|
637
|
+
let n = D(e);
|
|
601
638
|
if (n) try {
|
|
602
|
-
let e =
|
|
639
|
+
let e = T.default.geoJSON(n).getBounds();
|
|
603
640
|
if (e.isValid()) {
|
|
604
641
|
t.fitBounds(e, {
|
|
605
642
|
padding: [40, 40],
|
|
@@ -608,30 +645,30 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
608
645
|
return;
|
|
609
646
|
}
|
|
610
647
|
} catch {}
|
|
611
|
-
|
|
612
|
-
}, []),
|
|
613
|
-
W.current === "draw" || W.current === "measure" || (
|
|
614
|
-
}, [
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}, [
|
|
618
|
-
let
|
|
619
|
-
let t =
|
|
648
|
+
Pt(e.location) && t.flyTo([e.location.lat, e.location.lng], wt, { duration: .6 });
|
|
649
|
+
}, []), Si = d((e) => {
|
|
650
|
+
W.current === "draw" || W.current === "measure" || (N(e.id), xi(e));
|
|
651
|
+
}, [xi]);
|
|
652
|
+
f(() => {
|
|
653
|
+
M && document.querySelector(`[data-field-id="${M}"]`)?.scrollIntoView({ block: "nearest" });
|
|
654
|
+
}, [M]);
|
|
655
|
+
let Ci = d(() => {
|
|
656
|
+
let t = U.current, n = Tr.current;
|
|
620
657
|
if (!t || !n) return;
|
|
621
658
|
n.clearLayers();
|
|
622
659
|
let r = [];
|
|
623
|
-
for (let t of
|
|
624
|
-
if (
|
|
625
|
-
let i = t.id ===
|
|
660
|
+
for (let t of g) {
|
|
661
|
+
if (A === "edit" && t.id === M) continue;
|
|
662
|
+
let i = t.id === M, a = P[t.id], o = en && a != null ? _e(a, Jr, Yr) : Qt ? he(t.soilType) : Et, ee = Te(t.type) === "OPEN_FIELD" ? null : u(e, t.type), te = ee ? `${t.name} — ${Lt(t)} · ${ee}` : `${t.name} — ${Lt(t)}`, ne = D(t);
|
|
626
663
|
if (ne) {
|
|
627
|
-
let e =
|
|
664
|
+
let e = T.default.geoJSON(ne, { style: () => ({
|
|
628
665
|
color: i ? "#ffffff" : o,
|
|
629
666
|
weight: i ? 5 : 2,
|
|
630
667
|
opacity: 1,
|
|
631
668
|
fillColor: o,
|
|
632
669
|
fillOpacity: i ? .62 : .5
|
|
633
670
|
}) });
|
|
634
|
-
e.on("click", () =>
|
|
671
|
+
e.on("click", () => N(t.id)), e.bindTooltip(te, {
|
|
635
672
|
permanent: !0,
|
|
636
673
|
direction: "center",
|
|
637
674
|
className: "hb-field-label"
|
|
@@ -640,117 +677,117 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
640
677
|
let t = e.getBounds();
|
|
641
678
|
t.isValid() && r.push(t);
|
|
642
679
|
} catch {}
|
|
643
|
-
} else if (
|
|
644
|
-
let a =
|
|
680
|
+
} else if (Pt(t.location)) {
|
|
681
|
+
let a = T.default.circleMarker([t.location.lat, t.location.lng], {
|
|
645
682
|
radius: i ? 9 : 7,
|
|
646
683
|
color: i ? "#ffffff" : "#fff",
|
|
647
684
|
weight: i ? 3 : 2,
|
|
648
685
|
fillColor: o,
|
|
649
686
|
fillOpacity: 1
|
|
650
687
|
});
|
|
651
|
-
a.on("click", () =>
|
|
688
|
+
a.on("click", () => N(t.id)), a.bindTooltip(`${t.name} (${e("healthybowl.fieldMapPage.unmapped", "no boundary")})`, {
|
|
652
689
|
permanent: !1,
|
|
653
690
|
direction: "top"
|
|
654
|
-
}), a.addTo(n), r.push(
|
|
691
|
+
}), a.addTo(n), r.push(T.default.latLngBounds([t.location.lat, t.location.lng], [t.location.lat, t.location.lng]));
|
|
655
692
|
}
|
|
656
693
|
}
|
|
657
|
-
if (!
|
|
694
|
+
if (!Vr.current) {
|
|
658
695
|
let e = null;
|
|
659
|
-
if (r.length > 0) e = r.reduce((e, t) => e.extend(t),
|
|
660
|
-
else if (
|
|
661
|
-
let t =
|
|
696
|
+
if (r.length > 0) e = r.reduce((e, t) => e.extend(t), T.default.latLngBounds(r[0].getSouthWest(), r[0].getNorthEast()));
|
|
697
|
+
else if (Gr) try {
|
|
698
|
+
let t = T.default.geoJSON(Gr).getBounds();
|
|
662
699
|
t.isValid() && (e = t);
|
|
663
700
|
} catch {}
|
|
664
701
|
if (e) try {
|
|
665
702
|
t.fitBounds(e, {
|
|
666
703
|
padding: [40, 40],
|
|
667
704
|
maxZoom: 17
|
|
668
|
-
}),
|
|
705
|
+
}), Vr.current = !0;
|
|
669
706
|
} catch {}
|
|
670
707
|
}
|
|
671
708
|
}, [
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
709
|
+
g,
|
|
710
|
+
A,
|
|
711
|
+
M,
|
|
712
|
+
Qt,
|
|
713
|
+
en,
|
|
714
|
+
P,
|
|
715
|
+
Jr,
|
|
716
|
+
Yr,
|
|
717
|
+
Gr,
|
|
681
718
|
e
|
|
682
719
|
]);
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}, [
|
|
686
|
-
let
|
|
687
|
-
|
|
688
|
-
}, []),
|
|
689
|
-
let e =
|
|
720
|
+
f(() => {
|
|
721
|
+
k === "ready" && Ci();
|
|
722
|
+
}, [Ci, k]);
|
|
723
|
+
let Z = d(() => {
|
|
724
|
+
Dr.current?.clearLayers(), Lr.current = null, Ir.current = [], dn(0);
|
|
725
|
+
}, []), wi = d(() => {
|
|
726
|
+
let e = Dr.current;
|
|
690
727
|
if (!e) return;
|
|
691
|
-
|
|
692
|
-
let t =
|
|
693
|
-
t.length >= 2 && (
|
|
694
|
-
}, []),
|
|
695
|
-
let t =
|
|
728
|
+
Lr.current &&= (e.removeLayer(Lr.current), null);
|
|
729
|
+
let t = Ir.current;
|
|
730
|
+
t.length >= 2 && (Lr.current = T.default.polygon(t, Dt).addTo(e));
|
|
731
|
+
}, []), Ti = d(() => {
|
|
732
|
+
let t = Ir.current;
|
|
696
733
|
if (t.length < 3) {
|
|
697
|
-
|
|
734
|
+
O({
|
|
698
735
|
title: e("healthybowl.fieldMapPage.toast.needPoints.title", "Need at least 3 points"),
|
|
699
736
|
description: e("healthybowl.fieldMapPage.toast.needPoints.description", "Click the map to add more corners."),
|
|
700
737
|
variant: "warning"
|
|
701
738
|
});
|
|
702
739
|
return;
|
|
703
740
|
}
|
|
704
|
-
let n = W.current === "farm", r =
|
|
741
|
+
let n = W.current === "farm", r = de(t.map((e) => ({
|
|
705
742
|
lat: e.lat,
|
|
706
743
|
lng: e.lng
|
|
707
744
|
})));
|
|
708
|
-
if (
|
|
745
|
+
if (Z(), W.current = "view", j("view"), r) {
|
|
709
746
|
if (n) {
|
|
710
|
-
if (!
|
|
711
|
-
|
|
712
|
-
id:
|
|
747
|
+
if (!v?.id) return;
|
|
748
|
+
Hn(!0), Tt({
|
|
749
|
+
id: v.id,
|
|
713
750
|
boundary: r
|
|
714
751
|
}).then(() => {
|
|
715
|
-
|
|
752
|
+
O({
|
|
716
753
|
title: e("healthybowl.fieldMapPage.toast.farmBoundarySaved.title", "Farm outline saved"),
|
|
717
754
|
description: e("healthybowl.fieldMapPage.toast.farmBoundarySaved.description", "The dashed ring now wraps your fields on the map."),
|
|
718
755
|
variant: "success"
|
|
719
756
|
});
|
|
720
757
|
}).catch((t) => {
|
|
721
|
-
|
|
758
|
+
O({
|
|
722
759
|
title: e("healthybowl.fieldMapPage.toast.farmBoundarySaveFailed.title", "Could not save the farm outline"),
|
|
723
760
|
description: t instanceof Error ? t.message : String(t),
|
|
724
761
|
variant: "error"
|
|
725
762
|
});
|
|
726
|
-
}).finally(() =>
|
|
763
|
+
}).finally(() => Hn(!1));
|
|
727
764
|
return;
|
|
728
765
|
}
|
|
729
|
-
|
|
766
|
+
ar({
|
|
730
767
|
boundary: r,
|
|
731
|
-
area:
|
|
732
|
-
centroid:
|
|
733
|
-
}),
|
|
768
|
+
area: ce(r, "acres"),
|
|
769
|
+
centroid: ue(r) ?? [0, 0]
|
|
770
|
+
}), lr(""), dr("Clay loam"), pr("Drip"), hr("active"), _r(Ce), xr(null);
|
|
734
771
|
}
|
|
735
772
|
}, [
|
|
736
|
-
|
|
737
|
-
|
|
773
|
+
Z,
|
|
774
|
+
v?.id,
|
|
738
775
|
e,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
]),
|
|
742
|
-
|
|
743
|
-
}, [
|
|
744
|
-
|
|
745
|
-
}, [
|
|
746
|
-
|
|
747
|
-
}, [
|
|
748
|
-
let e =
|
|
776
|
+
O,
|
|
777
|
+
Tt
|
|
778
|
+
]), Ei = d(() => {
|
|
779
|
+
N(null), Z(), W.current = "draw", j("draw");
|
|
780
|
+
}, [Z]), Di = d(() => {
|
|
781
|
+
N(null), Z(), W.current = "farm", j("farm");
|
|
782
|
+
}, [Z]), Oi = d(() => {
|
|
783
|
+
Z(), W.current = "view", j("view");
|
|
784
|
+
}, [Z]), ki = d(() => {
|
|
785
|
+
let e = Ir.current;
|
|
749
786
|
if (e.length === 0) return;
|
|
750
787
|
e.pop();
|
|
751
|
-
let t =
|
|
752
|
-
t && (t.clearLayers(),
|
|
753
|
-
let r = n === 0, i =
|
|
788
|
+
let t = Dr.current;
|
|
789
|
+
t && (t.clearLayers(), Lr.current = null, e.forEach((e, n) => {
|
|
790
|
+
let r = n === 0, i = T.default.circleMarker(e, {
|
|
754
791
|
radius: r ? 7 : 5,
|
|
755
792
|
color: "#fff",
|
|
756
793
|
weight: 2,
|
|
@@ -758,38 +795,38 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
758
795
|
fillOpacity: 1
|
|
759
796
|
}).addTo(t);
|
|
760
797
|
r && i.on("click", (e) => {
|
|
761
|
-
|
|
798
|
+
T.default.DomEvent.stopPropagation(e), Ti();
|
|
762
799
|
});
|
|
763
|
-
}),
|
|
764
|
-
}, [
|
|
765
|
-
|
|
766
|
-
if (
|
|
800
|
+
}), wi()), dn(e.length);
|
|
801
|
+
}, [Ti, wi]);
|
|
802
|
+
f(() => {
|
|
803
|
+
if (A !== "draw") return;
|
|
767
804
|
let e = (e) => {
|
|
768
805
|
let t = e.target;
|
|
769
|
-
t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable) || (e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(),
|
|
806
|
+
t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable) || (e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(), ki()) : e.key === "Escape" && (e.preventDefault(), Oi()));
|
|
770
807
|
};
|
|
771
808
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
772
809
|
}, [
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
810
|
+
A,
|
|
811
|
+
ki,
|
|
812
|
+
Oi
|
|
776
813
|
]);
|
|
777
|
-
let
|
|
778
|
-
|
|
779
|
-
}, []),
|
|
780
|
-
if (!
|
|
781
|
-
|
|
782
|
-
let e =
|
|
814
|
+
let Ai = d(() => {
|
|
815
|
+
Or.current?.clearLayers(), zr.current = null, Rr.current = [], pn(null), hn(!1);
|
|
816
|
+
}, []), ji = d(() => {
|
|
817
|
+
if (!Or.current || !zr.current) return;
|
|
818
|
+
zr.current.setLatLngs(Rr.current);
|
|
819
|
+
let e = de(Rr.current.map((e) => ({
|
|
783
820
|
lat: e.lat,
|
|
784
821
|
lng: e.lng
|
|
785
822
|
})));
|
|
786
|
-
e &&
|
|
787
|
-
}, [G]),
|
|
788
|
-
let t =
|
|
823
|
+
e && pn(ce(e, G?.unit ?? "acres"));
|
|
824
|
+
}, [G]), Mi = d(() => {
|
|
825
|
+
let t = U.current, n = Or.current;
|
|
789
826
|
if (!t || !n || !G) return;
|
|
790
|
-
let r =
|
|
827
|
+
let r = D(G);
|
|
791
828
|
if (!r) {
|
|
792
|
-
|
|
829
|
+
O({
|
|
793
830
|
title: e("healthybowl.fieldMapPage.toast.noBoundary.title", "No boundary to edit"),
|
|
794
831
|
description: e("healthybowl.fieldMapPage.toast.noBoundary.description", "Draw a boundary for this field first."),
|
|
795
832
|
variant: "warning"
|
|
@@ -797,38 +834,38 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
797
834
|
return;
|
|
798
835
|
}
|
|
799
836
|
n.clearLayers();
|
|
800
|
-
let i = r.coordinates[0].slice(0, -1).map(([e, t]) =>
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
icon:
|
|
837
|
+
let i = r.coordinates[0].slice(0, -1).map(([e, t]) => T.default.latLng(t, e));
|
|
838
|
+
Rr.current = i, zr.current = T.default.polygon(i, Ot).addTo(n), i.forEach((e, t) => {
|
|
839
|
+
T.default.marker(i[t], {
|
|
840
|
+
icon: Rt,
|
|
804
841
|
draggable: !0
|
|
805
842
|
}).addTo(n).on("drag", (e) => {
|
|
806
|
-
|
|
843
|
+
Rr.current[t] = e.target.getLatLng(), ji(), hn(!0);
|
|
807
844
|
});
|
|
808
|
-
}), W.current = "edit",
|
|
845
|
+
}), W.current = "edit", j("edit"), hn(!1), pn(ce(r, G.unit));
|
|
809
846
|
}, [
|
|
810
|
-
|
|
847
|
+
ji,
|
|
811
848
|
G,
|
|
812
849
|
e,
|
|
813
|
-
|
|
814
|
-
]),
|
|
815
|
-
|
|
816
|
-
}, [
|
|
850
|
+
O
|
|
851
|
+
]), Ni = d(() => {
|
|
852
|
+
Ai(), W.current = "view", j("view"), Ci();
|
|
853
|
+
}, [Ai, Ci]), Pi = d(async () => {
|
|
817
854
|
if (!G) return;
|
|
818
|
-
let t =
|
|
855
|
+
let t = de(Rr.current.map((e) => ({
|
|
819
856
|
lat: e.lat,
|
|
820
857
|
lng: e.lng
|
|
821
858
|
})));
|
|
822
859
|
if (t) {
|
|
823
|
-
|
|
860
|
+
_n(!0);
|
|
824
861
|
try {
|
|
825
|
-
let n =
|
|
826
|
-
await
|
|
862
|
+
let n = ce(t, G.unit);
|
|
863
|
+
await Ut({ variables: { input: {
|
|
827
864
|
id: G.id,
|
|
828
865
|
boundary: t,
|
|
829
866
|
area: n,
|
|
830
|
-
context: { workspaceId:
|
|
831
|
-
} } }), await
|
|
867
|
+
context: { workspaceId: c }
|
|
868
|
+
} } }), await y(), Ai(), W.current = "view", j("view"), O({
|
|
832
869
|
title: e("healthybowl.fieldMapPage.toast.saved.title", "Boundary saved"),
|
|
833
870
|
description: e("healthybowl.fieldMapPage.toast.saved.description", "Area updated to {{area}} {{unit}}.", {
|
|
834
871
|
area: String(n),
|
|
@@ -837,49 +874,49 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
837
874
|
variant: "success"
|
|
838
875
|
});
|
|
839
876
|
} catch (t) {
|
|
840
|
-
|
|
877
|
+
O({
|
|
841
878
|
title: e("healthybowl.fieldMapPage.toast.saveFailed.title", "Save failed"),
|
|
842
879
|
description: String(t),
|
|
843
880
|
variant: "error"
|
|
844
881
|
});
|
|
845
882
|
} finally {
|
|
846
|
-
|
|
883
|
+
_n(!1);
|
|
847
884
|
}
|
|
848
885
|
}
|
|
849
886
|
}, [
|
|
850
|
-
|
|
851
|
-
|
|
887
|
+
Ai,
|
|
888
|
+
y,
|
|
852
889
|
G,
|
|
853
890
|
e,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
]),
|
|
891
|
+
O,
|
|
892
|
+
Ut,
|
|
893
|
+
c
|
|
894
|
+
]), Fi = d(async () => {
|
|
858
895
|
if (G) {
|
|
859
|
-
if (!
|
|
860
|
-
|
|
896
|
+
if (!D(G)) {
|
|
897
|
+
O({
|
|
861
898
|
title: e("healthybowl.fieldMapPage.toast.noBoundary.title", "No boundary to edit"),
|
|
862
899
|
description: e("healthybowl.fieldMapPage.toast.deleteNone.description", "This field has no boundary to delete."),
|
|
863
900
|
variant: "warning"
|
|
864
901
|
});
|
|
865
902
|
return;
|
|
866
903
|
}
|
|
867
|
-
if (await
|
|
904
|
+
if (await l({
|
|
868
905
|
title: e("healthybowl.fieldMapPage.confirmDelete.title", "Delete boundary?"),
|
|
869
906
|
message: e("healthybowl.fieldMapPage.confirmDelete.description", "This removes the drawn shape from {{name}}. The field record is kept.", { name: G.name }),
|
|
870
907
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
871
908
|
})) try {
|
|
872
|
-
await
|
|
909
|
+
await Ut({ variables: { input: {
|
|
873
910
|
id: G.id,
|
|
874
911
|
boundary: null,
|
|
875
|
-
context: { workspaceId:
|
|
876
|
-
} } }), await
|
|
912
|
+
context: { workspaceId: c }
|
|
913
|
+
} } }), await y(), O({
|
|
877
914
|
title: e("healthybowl.fieldMapPage.toast.boundaryDeleted.title", "Boundary removed"),
|
|
878
915
|
description: e("healthybowl.fieldMapPage.toast.boundaryDeleted.description", "The drawn shape was cleared."),
|
|
879
916
|
variant: "success"
|
|
880
917
|
});
|
|
881
918
|
} catch (t) {
|
|
882
|
-
|
|
919
|
+
O({
|
|
883
920
|
title: e("healthybowl.fieldMapPage.toast.saveFailed.title", "Save failed"),
|
|
884
921
|
description: String(t),
|
|
885
922
|
variant: "error"
|
|
@@ -887,90 +924,90 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
887
924
|
}
|
|
888
925
|
}
|
|
889
926
|
}, [
|
|
890
|
-
|
|
891
|
-
|
|
927
|
+
l,
|
|
928
|
+
y,
|
|
892
929
|
G,
|
|
893
930
|
e,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
]),
|
|
898
|
-
|
|
899
|
-
}, []),
|
|
900
|
-
let e =
|
|
931
|
+
O,
|
|
932
|
+
Ut,
|
|
933
|
+
c
|
|
934
|
+
]), Ii = d(() => {
|
|
935
|
+
kr.current?.clearLayers(), Br.current = [], vn(null);
|
|
936
|
+
}, []), Li = d(() => {
|
|
937
|
+
let e = kr.current;
|
|
901
938
|
if (!e) return;
|
|
902
939
|
e.clearLayers();
|
|
903
|
-
let t =
|
|
940
|
+
let t = Br.current;
|
|
904
941
|
t.forEach((t) => {
|
|
905
|
-
|
|
942
|
+
T.default.circleMarker(t, {
|
|
906
943
|
radius: 4,
|
|
907
944
|
color: "#38bdf8",
|
|
908
945
|
weight: 2,
|
|
909
946
|
fillColor: "#fff",
|
|
910
947
|
fillOpacity: 1
|
|
911
948
|
}).addTo(e);
|
|
912
|
-
}), t.length >= 2 &&
|
|
949
|
+
}), t.length >= 2 && T.default.polyline(t, kt).addTo(e);
|
|
913
950
|
let n = 0;
|
|
914
951
|
for (let e = 1; e < t.length; e++) n += t[e - 1].distanceTo(t[e]);
|
|
915
952
|
let r = null;
|
|
916
953
|
if (t.length >= 3) {
|
|
917
|
-
let e =
|
|
954
|
+
let e = de(t.map((e) => ({
|
|
918
955
|
lat: e.lat,
|
|
919
956
|
lng: e.lng
|
|
920
957
|
})));
|
|
921
|
-
e && (r =
|
|
958
|
+
e && (r = le(e));
|
|
922
959
|
}
|
|
923
|
-
|
|
960
|
+
vn({
|
|
924
961
|
distance: n,
|
|
925
962
|
area: r
|
|
926
963
|
});
|
|
927
|
-
}, []),
|
|
928
|
-
|
|
964
|
+
}, []), Ri = d(() => {
|
|
965
|
+
N(null), Ii(), W.current = "measure", j("measure"), vn({
|
|
929
966
|
distance: 0,
|
|
930
967
|
area: null
|
|
931
968
|
});
|
|
932
|
-
}, [
|
|
933
|
-
|
|
934
|
-
}, [
|
|
935
|
-
|
|
936
|
-
}, []),
|
|
937
|
-
let e =
|
|
969
|
+
}, [Ii]), zi = d(() => {
|
|
970
|
+
Ii(), W.current = "view", j("view");
|
|
971
|
+
}, [Ii]), Bi = d(() => {
|
|
972
|
+
Mr.current?.clearLayers(), Pr.current = null, Nr.current = [], Jn(0);
|
|
973
|
+
}, []), Vi = d(() => {
|
|
974
|
+
let e = Mr.current, t = E.get(Fr.current ?? "");
|
|
938
975
|
if (!e || !t) return;
|
|
939
|
-
|
|
940
|
-
let n =
|
|
941
|
-
t.kind === "polygon" && n.length >= 2 ?
|
|
976
|
+
Pr.current &&= (e.removeLayer(Pr.current), null);
|
|
977
|
+
let n = Nr.current;
|
|
978
|
+
t.kind === "polygon" && n.length >= 2 ? Pr.current = T.default.polygon(n, {
|
|
942
979
|
...t.style,
|
|
943
980
|
dashArray: "6 4"
|
|
944
|
-
}).addTo(e) : t.kind === "line" && n.length >= 2 && (
|
|
981
|
+
}).addTo(e) : t.kind === "line" && n.length >= 2 && (Pr.current = T.default.polyline(n, {
|
|
945
982
|
...t.style,
|
|
946
983
|
dashArray: "6 4"
|
|
947
984
|
}).addTo(e));
|
|
948
|
-
}, []),
|
|
949
|
-
|
|
985
|
+
}, []), Hi = d((e, t) => {
|
|
986
|
+
Bi(), Kn(null), Fr.current = null, W.current = "view", j("view"), Zn(""), $n(""), Yn({
|
|
950
987
|
type: e,
|
|
951
988
|
geometry: t
|
|
952
989
|
});
|
|
953
|
-
}, [
|
|
954
|
-
let t =
|
|
990
|
+
}, [Bi]), Ui = d(() => {
|
|
991
|
+
let t = E.get(Fr.current ?? "");
|
|
955
992
|
if (!t) return;
|
|
956
|
-
let n =
|
|
993
|
+
let n = Nr.current;
|
|
957
994
|
if (t.kind === "polygon") {
|
|
958
995
|
if (n.length < 3) {
|
|
959
|
-
|
|
996
|
+
O({
|
|
960
997
|
title: e("healthybowl.fieldMapPage.toast.needPoints.title", "Need at least 3 points"),
|
|
961
998
|
description: e("healthybowl.fieldMapPage.toast.needPoints.description", "Click the map to add more corners."),
|
|
962
999
|
variant: "warning"
|
|
963
1000
|
});
|
|
964
1001
|
return;
|
|
965
1002
|
}
|
|
966
|
-
let r =
|
|
1003
|
+
let r = de(n.map((e) => ({
|
|
967
1004
|
lat: e.lat,
|
|
968
1005
|
lng: e.lng
|
|
969
1006
|
})));
|
|
970
|
-
r &&
|
|
1007
|
+
r && Hi(t.type, r);
|
|
971
1008
|
} else if (t.kind === "line") {
|
|
972
1009
|
if (n.length < 2) {
|
|
973
|
-
|
|
1010
|
+
O({
|
|
974
1011
|
title: e("healthybowl.fieldMapPage.toast.needLine.title", "Need at least 2 points"),
|
|
975
1012
|
description: e("healthybowl.fieldMapPage.toast.needLine.description", "Click the map to add more points."),
|
|
976
1013
|
variant: "warning"
|
|
@@ -981,314 +1018,314 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
981
1018
|
type: "LineString",
|
|
982
1019
|
coordinates: n.map((e) => [e.lng, e.lat])
|
|
983
1020
|
};
|
|
984
|
-
|
|
1021
|
+
Hi(t.type, r);
|
|
985
1022
|
}
|
|
986
1023
|
}, [
|
|
987
|
-
|
|
1024
|
+
Hi,
|
|
988
1025
|
e,
|
|
989
|
-
|
|
990
|
-
]),
|
|
991
|
-
|
|
1026
|
+
O
|
|
1027
|
+
]), Wi = d((e) => {
|
|
1028
|
+
Z(), Ai(), Ii(), Bi(), N(null), nr(null), Wn(!1), E.has(e) && (Kn(e), Fr.current = e, W.current = "element", j("element"));
|
|
992
1029
|
}, [
|
|
993
|
-
X,
|
|
994
|
-
gi,
|
|
995
1030
|
Z,
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1031
|
+
Ai,
|
|
1032
|
+
Ii,
|
|
1033
|
+
Bi
|
|
1034
|
+
]), Gi = d(() => {
|
|
1035
|
+
Bi(), Kn(null), Fr.current = null, W.current = "view", j("view");
|
|
1036
|
+
}, [Bi]), Ki = d((e) => {
|
|
1037
|
+
if (U.current) {
|
|
1001
1038
|
if (W.current === "element") {
|
|
1002
|
-
let t =
|
|
1039
|
+
let t = E.get(Fr.current ?? "");
|
|
1003
1040
|
if (!t) return;
|
|
1004
1041
|
if (t.kind === "point") {
|
|
1005
|
-
|
|
1042
|
+
Hi(t.type, {
|
|
1006
1043
|
type: "Point",
|
|
1007
1044
|
coordinates: [e.latlng.lng, e.latlng.lat]
|
|
1008
1045
|
});
|
|
1009
1046
|
return;
|
|
1010
1047
|
}
|
|
1011
|
-
|
|
1012
|
-
let n =
|
|
1048
|
+
Nr.current.push(e.latlng);
|
|
1049
|
+
let n = Nr.current.length === 1, r = T.default.circleMarker(e.latlng, {
|
|
1013
1050
|
radius: n ? 7 : 5,
|
|
1014
1051
|
color: "#fff",
|
|
1015
1052
|
weight: 2,
|
|
1016
1053
|
fillColor: t.color,
|
|
1017
1054
|
fillOpacity: 1
|
|
1018
|
-
}).addTo(
|
|
1055
|
+
}).addTo(Mr.current);
|
|
1019
1056
|
n && t.kind === "polygon" && r.on("click", (e) => {
|
|
1020
|
-
|
|
1021
|
-
}),
|
|
1057
|
+
T.default.DomEvent.stopPropagation(e), Ui();
|
|
1058
|
+
}), Jn(Nr.current.length), Vi();
|
|
1022
1059
|
return;
|
|
1023
1060
|
}
|
|
1024
1061
|
if (W.current === "draw" || W.current === "farm") {
|
|
1025
|
-
|
|
1026
|
-
let t =
|
|
1062
|
+
Ir.current.push(e.latlng);
|
|
1063
|
+
let t = Ir.current.length === 1, n = T.default.circleMarker(e.latlng, {
|
|
1027
1064
|
radius: t ? 7 : 5,
|
|
1028
1065
|
color: "#fff",
|
|
1029
1066
|
weight: 2,
|
|
1030
1067
|
fillColor: t ? "#16a34a" : "#f59e0b",
|
|
1031
1068
|
fillOpacity: 1
|
|
1032
|
-
}).addTo(
|
|
1069
|
+
}).addTo(Dr.current);
|
|
1033
1070
|
t && n.on("click", (e) => {
|
|
1034
|
-
|
|
1035
|
-
}),
|
|
1036
|
-
} else W.current === "measure" && (
|
|
1071
|
+
T.default.DomEvent.stopPropagation(e), Ti();
|
|
1072
|
+
}), dn(Ir.current.length), wi();
|
|
1073
|
+
} else W.current === "measure" && (Br.current.push(e.latlng), Li());
|
|
1037
1074
|
}
|
|
1038
1075
|
}, [
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
]),
|
|
1076
|
+
Ti,
|
|
1077
|
+
Li,
|
|
1078
|
+
wi,
|
|
1079
|
+
Hi,
|
|
1080
|
+
Ui,
|
|
1081
|
+
Vi
|
|
1082
|
+
]), qi = d(async (n) => {
|
|
1046
1083
|
n.preventDefault();
|
|
1047
|
-
let r =
|
|
1084
|
+
let r = U.current, i = on.trim();
|
|
1048
1085
|
if (!r || !i) return;
|
|
1049
1086
|
let a = i.match(/^(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)$/);
|
|
1050
1087
|
if (a) {
|
|
1051
|
-
r.flyTo([Number(a[1]), Number(a[2])],
|
|
1088
|
+
r.flyTo([Number(a[1]), Number(a[2])], wt, { duration: .6 });
|
|
1052
1089
|
return;
|
|
1053
1090
|
}
|
|
1054
|
-
|
|
1091
|
+
ln(!0);
|
|
1055
1092
|
try {
|
|
1056
1093
|
let n = await t(i);
|
|
1057
1094
|
if (!n) {
|
|
1058
|
-
|
|
1095
|
+
O({
|
|
1059
1096
|
title: e("healthybowl.fieldMapPage.toast.placeNotFound.title", "Place not found"),
|
|
1060
1097
|
description: e("healthybowl.fieldMapPage.toast.placeNotFound.description", "Try a more specific place name."),
|
|
1061
1098
|
variant: "warning"
|
|
1062
1099
|
});
|
|
1063
1100
|
return;
|
|
1064
1101
|
}
|
|
1065
|
-
r.flyTo([n.latitude, n.longitude],
|
|
1102
|
+
r.flyTo([n.latitude, n.longitude], wt, { duration: .6 });
|
|
1066
1103
|
} catch (t) {
|
|
1067
|
-
|
|
1104
|
+
O({
|
|
1068
1105
|
title: e("healthybowl.fieldMapPage.toast.searchFailed.title", "Search failed"),
|
|
1069
1106
|
description: t instanceof Error ? t.message : String(t),
|
|
1070
1107
|
variant: "error"
|
|
1071
1108
|
});
|
|
1072
1109
|
} finally {
|
|
1073
|
-
|
|
1110
|
+
ln(!1);
|
|
1074
1111
|
}
|
|
1075
1112
|
}, [
|
|
1076
|
-
|
|
1113
|
+
on,
|
|
1077
1114
|
e,
|
|
1078
|
-
|
|
1079
|
-
]),
|
|
1080
|
-
if (
|
|
1081
|
-
if (!
|
|
1082
|
-
|
|
1115
|
+
O
|
|
1116
|
+
]), Ji = d(async () => {
|
|
1117
|
+
if (H) {
|
|
1118
|
+
if (!cr.trim()) {
|
|
1119
|
+
O({
|
|
1083
1120
|
title: e("healthybowl.fieldMapPage.toast.nameRequired.title", "Name required"),
|
|
1084
1121
|
description: e("healthybowl.fieldMapPage.toast.nameRequired.description", "Give the new field a name."),
|
|
1085
1122
|
variant: "warning"
|
|
1086
1123
|
});
|
|
1087
1124
|
return;
|
|
1088
1125
|
}
|
|
1089
|
-
|
|
1126
|
+
sr(!0);
|
|
1090
1127
|
try {
|
|
1091
|
-
let [t, n] =
|
|
1092
|
-
name:
|
|
1093
|
-
area:
|
|
1128
|
+
let [t, n] = H.centroid, r = await w({
|
|
1129
|
+
name: cr.trim(),
|
|
1130
|
+
area: H.area,
|
|
1094
1131
|
unit: "acres",
|
|
1095
|
-
soilType:
|
|
1096
|
-
irrigationType:
|
|
1132
|
+
soilType: ur,
|
|
1133
|
+
irrigationType: fr,
|
|
1097
1134
|
organicCertified: !1,
|
|
1098
|
-
status:
|
|
1099
|
-
type:
|
|
1100
|
-
growGeometry:
|
|
1135
|
+
status: mr,
|
|
1136
|
+
type: gr,
|
|
1137
|
+
growGeometry: Oe(gr, vr),
|
|
1101
1138
|
crops: [],
|
|
1102
1139
|
location: {
|
|
1103
1140
|
lat: t,
|
|
1104
1141
|
lng: n
|
|
1105
1142
|
}
|
|
1106
1143
|
});
|
|
1107
|
-
r?.id && await
|
|
1144
|
+
r?.id && await Ut({ variables: { input: {
|
|
1108
1145
|
id: r.id,
|
|
1109
|
-
boundary:
|
|
1110
|
-
area:
|
|
1111
|
-
context: { workspaceId:
|
|
1112
|
-
} } }),
|
|
1113
|
-
id:
|
|
1114
|
-
context: { workspaceId:
|
|
1115
|
-
} }), await
|
|
1146
|
+
boundary: H.boundary,
|
|
1147
|
+
area: H.area,
|
|
1148
|
+
context: { workspaceId: c }
|
|
1149
|
+
} } }), br && (await Jt({ variables: {
|
|
1150
|
+
id: br.id,
|
|
1151
|
+
context: { workspaceId: c }
|
|
1152
|
+
} }), await mi()), await y(), ar(null), xr(null), r?.id && N(r.id), O({
|
|
1116
1153
|
title: e("healthybowl.fieldMapPage.toast.fieldCreated.title", "Field created"),
|
|
1117
1154
|
description: e("healthybowl.fieldMapPage.toast.fieldCreated.description", "{{name}} saved at {{area}} acres.", {
|
|
1118
|
-
name:
|
|
1119
|
-
area: String(
|
|
1155
|
+
name: cr.trim(),
|
|
1156
|
+
area: String(H.area)
|
|
1120
1157
|
}),
|
|
1121
1158
|
variant: "success"
|
|
1122
1159
|
});
|
|
1123
1160
|
} catch (t) {
|
|
1124
1161
|
let n = t instanceof Error ? t.message : String(t), r = /unexpected error/i.test(n) ? e("healthybowl.fieldMapPage.toast.createFailed.quotaHint", "This can happen when your workspace has reached its active-fields limit. Free up a field, or ask an admin to raise the quota, then try again.") : n;
|
|
1125
|
-
|
|
1162
|
+
O({
|
|
1126
1163
|
title: e("healthybowl.fieldMapPage.toast.createFailed.title", "Create failed"),
|
|
1127
1164
|
description: r,
|
|
1128
1165
|
variant: "error"
|
|
1129
1166
|
});
|
|
1130
1167
|
} finally {
|
|
1131
|
-
|
|
1168
|
+
sr(!1);
|
|
1132
1169
|
}
|
|
1133
1170
|
}
|
|
1134
1171
|
}, [
|
|
1135
|
-
|
|
1136
|
-
|
|
1172
|
+
w,
|
|
1173
|
+
Jt,
|
|
1174
|
+
fr,
|
|
1137
1175
|
cr,
|
|
1138
|
-
|
|
1139
|
-
mr,
|
|
1140
|
-
or,
|
|
1176
|
+
vr,
|
|
1141
1177
|
ur,
|
|
1142
|
-
|
|
1143
|
-
z,
|
|
1178
|
+
mr,
|
|
1144
1179
|
gr,
|
|
1145
|
-
|
|
1146
|
-
|
|
1180
|
+
H,
|
|
1181
|
+
br,
|
|
1182
|
+
y,
|
|
1183
|
+
mi,
|
|
1147
1184
|
e,
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
]),
|
|
1152
|
-
if (!
|
|
1153
|
-
if (!
|
|
1154
|
-
|
|
1185
|
+
O,
|
|
1186
|
+
Ut,
|
|
1187
|
+
c
|
|
1188
|
+
]), Yi = d(async () => {
|
|
1189
|
+
if (!B) return;
|
|
1190
|
+
if (!Xn.trim()) {
|
|
1191
|
+
O({
|
|
1155
1192
|
title: e("healthybowl.fieldMapPage.toast.nameRequired.title", "Name required"),
|
|
1156
1193
|
description: e("healthybowl.fieldMapPage.elements.nameRequired", "Give this map element a name."),
|
|
1157
1194
|
variant: "warning"
|
|
1158
1195
|
});
|
|
1159
1196
|
return;
|
|
1160
1197
|
}
|
|
1161
|
-
let t =
|
|
1162
|
-
|
|
1198
|
+
let t = E.get(B.type);
|
|
1199
|
+
tr(!0);
|
|
1163
1200
|
try {
|
|
1164
|
-
await
|
|
1165
|
-
name:
|
|
1166
|
-
type:
|
|
1167
|
-
geometry:
|
|
1168
|
-
notes:
|
|
1201
|
+
await qt({ variables: { input: {
|
|
1202
|
+
name: Xn.trim(),
|
|
1203
|
+
type: B.type,
|
|
1204
|
+
geometry: B.geometry,
|
|
1205
|
+
notes: Qn.trim() || void 0,
|
|
1169
1206
|
color: t?.color,
|
|
1170
|
-
context: { workspaceId:
|
|
1171
|
-
} } }), await
|
|
1207
|
+
context: { workspaceId: c }
|
|
1208
|
+
} } }), await mi(), Yn(null), O({
|
|
1172
1209
|
title: e("healthybowl.fieldMapPage.elements.saved.title", "Map element added"),
|
|
1173
|
-
description: e("healthybowl.fieldMapPage.elements.saved.description", "{{name}} saved to the map.", { name:
|
|
1210
|
+
description: e("healthybowl.fieldMapPage.elements.saved.description", "{{name}} saved to the map.", { name: Xn.trim() }),
|
|
1174
1211
|
variant: "success"
|
|
1175
1212
|
});
|
|
1176
1213
|
} catch (t) {
|
|
1177
|
-
|
|
1214
|
+
O({
|
|
1178
1215
|
title: e("healthybowl.fieldMapPage.elements.saveFailed.title", "Could not add element"),
|
|
1179
1216
|
description: String(t),
|
|
1180
1217
|
variant: "error"
|
|
1181
1218
|
});
|
|
1182
1219
|
} finally {
|
|
1183
|
-
|
|
1220
|
+
tr(!1);
|
|
1184
1221
|
}
|
|
1185
1222
|
}, [
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1223
|
+
qt,
|
|
1224
|
+
Xn,
|
|
1225
|
+
Qn,
|
|
1226
|
+
B,
|
|
1227
|
+
mi,
|
|
1191
1228
|
e,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
]),
|
|
1195
|
-
if (
|
|
1229
|
+
O,
|
|
1230
|
+
c
|
|
1231
|
+
]), Xi = d(async () => {
|
|
1232
|
+
if (V && await l({
|
|
1196
1233
|
title: e("healthybowl.fieldMapPage.elements.deleteConfirm.title", "Delete map element?"),
|
|
1197
|
-
message: e("healthybowl.fieldMapPage.elements.deleteConfirm.description", "This removes {{name}} from the map. This cannot be undone.", { name:
|
|
1234
|
+
message: e("healthybowl.fieldMapPage.elements.deleteConfirm.description", "This removes {{name}} from the map. This cannot be undone.", { name: V.name }),
|
|
1198
1235
|
okButtonTitle: e("healthybowl.common.delete", "Delete")
|
|
1199
1236
|
})) {
|
|
1200
|
-
|
|
1237
|
+
ir(!0);
|
|
1201
1238
|
try {
|
|
1202
|
-
await
|
|
1203
|
-
id:
|
|
1204
|
-
context: { workspaceId:
|
|
1205
|
-
} }), await
|
|
1239
|
+
await Jt({ variables: {
|
|
1240
|
+
id: V.id,
|
|
1241
|
+
context: { workspaceId: c }
|
|
1242
|
+
} }), await mi(), nr(null), O({
|
|
1206
1243
|
title: e("healthybowl.fieldMapPage.elements.deleted.title", "Map element removed"),
|
|
1207
1244
|
description: e("healthybowl.fieldMapPage.elements.deleted.description", "The element was deleted."),
|
|
1208
1245
|
variant: "success"
|
|
1209
1246
|
});
|
|
1210
1247
|
} catch (t) {
|
|
1211
|
-
|
|
1248
|
+
O({
|
|
1212
1249
|
title: e("healthybowl.fieldMapPage.elements.deleteFailed.title", "Could not delete element"),
|
|
1213
1250
|
description: String(t),
|
|
1214
1251
|
variant: "error"
|
|
1215
1252
|
});
|
|
1216
1253
|
} finally {
|
|
1217
|
-
|
|
1254
|
+
ir(!1);
|
|
1218
1255
|
}
|
|
1219
1256
|
}
|
|
1220
1257
|
}, [
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1258
|
+
l,
|
|
1259
|
+
Jt,
|
|
1260
|
+
mi,
|
|
1261
|
+
V,
|
|
1225
1262
|
e,
|
|
1226
|
-
|
|
1227
|
-
|
|
1263
|
+
O,
|
|
1264
|
+
c
|
|
1228
1265
|
]);
|
|
1229
|
-
|
|
1230
|
-
let e =
|
|
1266
|
+
f(() => {
|
|
1267
|
+
let e = Sr.current;
|
|
1231
1268
|
if (!e) return;
|
|
1232
|
-
|
|
1233
|
-
let t =
|
|
1234
|
-
attribution:
|
|
1235
|
-
maxZoom:
|
|
1269
|
+
pe();
|
|
1270
|
+
let t = T.default.tileLayer(yt, {
|
|
1271
|
+
attribution: bt,
|
|
1272
|
+
maxZoom: Ct,
|
|
1236
1273
|
maxNativeZoom: 18
|
|
1237
|
-
}), n =
|
|
1238
|
-
attribution:
|
|
1239
|
-
maxZoom:
|
|
1274
|
+
}), n = T.default.tileLayer(xt, {
|
|
1275
|
+
attribution: St,
|
|
1276
|
+
maxZoom: Ct,
|
|
1240
1277
|
maxNativeZoom: 17,
|
|
1241
1278
|
opacity: .65
|
|
1242
1279
|
});
|
|
1243
|
-
|
|
1244
|
-
let r =
|
|
1280
|
+
Cr.current = t, wr.current = n;
|
|
1281
|
+
let r = T.default.map(e, {
|
|
1245
1282
|
center: [20, 78],
|
|
1246
1283
|
zoom: 4,
|
|
1247
1284
|
scrollWheelZoom: !0,
|
|
1248
|
-
maxZoom:
|
|
1285
|
+
maxZoom: Ct,
|
|
1249
1286
|
layers: [t]
|
|
1250
1287
|
});
|
|
1251
|
-
return
|
|
1252
|
-
r.off("click",
|
|
1288
|
+
return U.current = r, Er.current = T.default.layerGroup().addTo(r), Tr.current = T.default.layerGroup().addTo(r), Ar.current = T.default.layerGroup().addTo(r), jr.current = T.default.layerGroup().addTo(r), Dr.current = T.default.layerGroup().addTo(r), Or.current = T.default.layerGroup().addTo(r), kr.current = T.default.layerGroup().addTo(r), Mr.current = T.default.layerGroup().addTo(r), r.on("click", Ki), Yt("ready"), window.setTimeout(() => r.invalidateSize(), 80), () => {
|
|
1289
|
+
r.off("click", Ki), r.remove(), U.current = null, Cr.current = null, wr.current = null, Er.current = null, Tr.current = null, Ar.current = null, jr.current = null, Dr.current = null, Or.current = null, kr.current = null, Mr.current = null;
|
|
1253
1290
|
};
|
|
1254
|
-
}, []),
|
|
1255
|
-
let e =
|
|
1256
|
-
!e || !t || (
|
|
1257
|
-
}, [
|
|
1258
|
-
let Q =
|
|
1259
|
-
if (!
|
|
1260
|
-
let e =
|
|
1261
|
-
e && (
|
|
1291
|
+
}, []), f(() => {
|
|
1292
|
+
let e = U.current, t = wr.current;
|
|
1293
|
+
!e || !t || (Xt ? t.addTo(e) : e.removeLayer(t));
|
|
1294
|
+
}, [Xt]);
|
|
1295
|
+
let Q = B ? E.get(B.type) ?? null : null, $ = V ? E.get(V.type) ?? null : null, Zi = V ? s(V.geometry) : null, Qi = !!($?.promotesTo && Zi), $i = d(() => {
|
|
1296
|
+
if (!V || !$?.promotesTo) return;
|
|
1297
|
+
let e = s(V.geometry);
|
|
1298
|
+
e && (ar({
|
|
1262
1299
|
boundary: e,
|
|
1263
|
-
area:
|
|
1264
|
-
centroid:
|
|
1265
|
-
}),
|
|
1266
|
-
}, [
|
|
1267
|
-
if (
|
|
1300
|
+
area: ce(e, "acres"),
|
|
1301
|
+
centroid: ue(e) ?? [0, 0]
|
|
1302
|
+
}), lr(V.name), dr("Clay loam"), pr("Drip"), hr("active"), _r($.promotesTo), xr(V), nr(null));
|
|
1303
|
+
}, [V, $]), ea = !Je.crops && g.length === 0, ta = F ? F.distance >= 1e3 ? `${(F.distance / 1e3).toFixed(2)} km` : `${F.distance.toFixed(0)} m` : "";
|
|
1304
|
+
if (Xe.crops && g.length === 0) return /* @__PURE__ */ b(r, {
|
|
1268
1305
|
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1269
1306
|
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1270
1307
|
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1308
|
+
children: /* @__PURE__ */ b(re, { onRetry: y })
|
|
1272
1309
|
});
|
|
1273
|
-
if (!
|
|
1310
|
+
if (!Je.dashboard && !Ht) return /* @__PURE__ */ b(r, {
|
|
1274
1311
|
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1275
1312
|
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1276
1313
|
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1277
|
-
children: /* @__PURE__ */
|
|
1314
|
+
children: /* @__PURE__ */ b(ne, {
|
|
1278
1315
|
illustration: "onboarding",
|
|
1279
1316
|
title: e("healthybowl.fieldMapPage.noFarm.title", "Set up your farm first"),
|
|
1280
1317
|
description: e("healthybowl.fieldMapPage.noFarm.description", "The Field Map attaches every boundary you draw to your farm. Create your farm, then come back to trace and save your fields on the satellite view."),
|
|
1281
|
-
action: /* @__PURE__ */
|
|
1282
|
-
onClick: () =>
|
|
1318
|
+
action: /* @__PURE__ */ x(S, {
|
|
1319
|
+
onClick: () => Bt(Vt("getting-started")),
|
|
1283
1320
|
children: [
|
|
1284
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ b(Ve, { className: "h-4 w-4" }),
|
|
1285
1322
|
" ",
|
|
1286
1323
|
e("healthybowl.fieldMapPage.noFarm.action", "Set up your farm")
|
|
1287
1324
|
]
|
|
1288
1325
|
})
|
|
1289
1326
|
})
|
|
1290
1327
|
});
|
|
1291
|
-
let
|
|
1328
|
+
let na = (e, t, n, r, i = !1) => /* @__PURE__ */ x("button", {
|
|
1292
1329
|
type: "button",
|
|
1293
1330
|
onClick: t,
|
|
1294
1331
|
"aria-pressed": e,
|
|
@@ -1296,277 +1333,277 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1296
1333
|
className: `flex flex-col items-center gap-1 rounded-md px-3 py-1.5 text-[11px] font-medium transition-colors ${e ? "bg-success text-white" : "text-text-primary hover:bg-bg-sunken"} ${i ? "cursor-not-allowed opacity-50" : ""}`,
|
|
1297
1334
|
children: [n, r]
|
|
1298
1335
|
});
|
|
1299
|
-
return /* @__PURE__ */
|
|
1336
|
+
return /* @__PURE__ */ x(r, {
|
|
1300
1337
|
title: e("healthybowl.fieldMapPage.title", "Field Map"),
|
|
1301
1338
|
titleAccent: e("healthybowl.fieldMapPage.titleAccent", "Map"),
|
|
1302
1339
|
hero: !0,
|
|
1303
1340
|
description: e("healthybowl.fieldMapPage.description", "Draw and manage your field boundaries on satellite imagery."),
|
|
1304
1341
|
purpose: "Trace each plot on the aerial view to auto-calculate its acreage, shade fields by soil type, overlay terrain, and see your whole holding at a glance. Click any field in the list to fly straight to it.",
|
|
1305
1342
|
children: [
|
|
1306
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ x("div", {
|
|
1307
1344
|
className: "flex flex-col gap-4 lg:flex-row",
|
|
1308
|
-
children: [/* @__PURE__ */
|
|
1345
|
+
children: [/* @__PURE__ */ x("div", {
|
|
1309
1346
|
className: "min-w-0 flex-1 space-y-3",
|
|
1310
1347
|
children: [
|
|
1311
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ x("form", {
|
|
1312
1349
|
className: "flex gap-2",
|
|
1313
|
-
onSubmit:
|
|
1314
|
-
children: [/* @__PURE__ */
|
|
1350
|
+
onSubmit: qi,
|
|
1351
|
+
children: [/* @__PURE__ */ x("div", {
|
|
1315
1352
|
className: "relative min-w-0 flex-1",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1353
|
+
children: [/* @__PURE__ */ b(We, { className: "pointer-events-none absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ b("input", {
|
|
1317
1354
|
type: "search",
|
|
1318
|
-
value:
|
|
1319
|
-
onChange: (e) =>
|
|
1355
|
+
value: on,
|
|
1356
|
+
onChange: (e) => sn(e.target.value),
|
|
1320
1357
|
placeholder: e("healthybowl.fieldMapPage.placeSearch.placeholder", "Find your farm — village, city, or lat,lng…"),
|
|
1321
1358
|
"aria-label": e("healthybowl.fieldMapPage.placeSearch.label", "Locate a place on the map"),
|
|
1322
1359
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface py-2 ps-9 pe-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1323
1360
|
})]
|
|
1324
|
-
}), /* @__PURE__ */
|
|
1361
|
+
}), /* @__PURE__ */ x(S, {
|
|
1325
1362
|
type: "submit",
|
|
1326
1363
|
variant: "outline",
|
|
1327
1364
|
size: "sm",
|
|
1328
|
-
disabled:
|
|
1365
|
+
disabled: k !== "ready" || cn,
|
|
1329
1366
|
children: [
|
|
1330
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ b(Re, { className: "h-4 w-4" }),
|
|
1331
1368
|
" ",
|
|
1332
|
-
|
|
1369
|
+
cn ? e("healthybowl.fieldMapPage.placeSearch.searching", "Locating…") : e("healthybowl.fieldMapPage.placeSearch.action", "Locate")
|
|
1333
1370
|
]
|
|
1334
1371
|
})]
|
|
1335
1372
|
}),
|
|
1336
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ x("div", {
|
|
1337
1374
|
className: "relative isolate",
|
|
1338
1375
|
children: [
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
ref:
|
|
1376
|
+
/* @__PURE__ */ b("div", {
|
|
1377
|
+
ref: Sr,
|
|
1341
1378
|
className: "h-[70vh] max-h-[640px] w-full overflow-hidden rounded-lg border border-border-subtle bg-bg-sunken"
|
|
1342
1379
|
}),
|
|
1343
|
-
|
|
1380
|
+
k === "ready" && /* @__PURE__ */ x("div", {
|
|
1344
1381
|
className: "absolute end-3 top-3 z-[1000] flex items-center gap-1 rounded-lg border border-border-subtle bg-bg-surface/95 p-1 shadow-md",
|
|
1345
1382
|
children: [
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
}, /* @__PURE__ */
|
|
1353
|
-
|
|
1383
|
+
na(A === "draw", () => A === "draw" ? Oi() : Ei(), /* @__PURE__ */ b(Be, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.polygon", "Polygon")),
|
|
1384
|
+
na(A === "edit", () => A === "edit" ? Ni() : Mi(), /* @__PURE__ */ b(Ke, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.vertices", "Vertices")),
|
|
1385
|
+
na(!1, Fi, /* @__PURE__ */ b(qe, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.delete", "Delete")),
|
|
1386
|
+
na(A === "measure", () => A === "measure" ? zi() : Ri(), /* @__PURE__ */ b(He, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.measure", "Measure")),
|
|
1387
|
+
na(A === "element" || Un, () => {
|
|
1388
|
+
A === "element" ? (Gi(), Wn(!1)) : Wn((e) => !e);
|
|
1389
|
+
}, /* @__PURE__ */ b(Ge, { className: "h-4 w-4" }), e("healthybowl.fieldMapPage.tools.elements", "Elements")),
|
|
1390
|
+
na(A === "farm", () => A === "farm" ? Oi() : Di(), /* @__PURE__ */ b(Fe, { className: "h-4 w-4" }), Vn ? e("healthybowl.fieldMapPage.saving", "Saving…") : e("healthybowl.fieldMapPage.tools.farmOutline", "Farm outline"), Vn)
|
|
1354
1391
|
]
|
|
1355
1392
|
}),
|
|
1356
|
-
|
|
1393
|
+
k === "ready" && Un && A !== "element" && /* @__PURE__ */ x("div", {
|
|
1357
1394
|
className: "absolute end-3 top-16 z-[1001] w-60 rounded-lg border border-border-subtle bg-bg-surface/95 p-2 shadow-lg",
|
|
1358
|
-
children: [/* @__PURE__ */
|
|
1395
|
+
children: [/* @__PURE__ */ b("p", {
|
|
1359
1396
|
className: "px-1.5 pb-1 text-[11px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
1360
1397
|
children: e("healthybowl.fieldMapPage.elements.menuTitle", "Add map element")
|
|
1361
|
-
}),
|
|
1398
|
+
}), mt.map((t) => {
|
|
1362
1399
|
let n = t.icon;
|
|
1363
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ x("button", {
|
|
1364
1401
|
type: "button",
|
|
1365
|
-
onClick: () =>
|
|
1402
|
+
onClick: () => Wi(t.type),
|
|
1366
1403
|
className: "flex w-full flex-col gap-0.5 rounded-md px-2 py-1.5 text-start text-sm text-text-primary transition-colors hover:bg-bg-sunken",
|
|
1367
|
-
children: [/* @__PURE__ */
|
|
1404
|
+
children: [/* @__PURE__ */ x("span", {
|
|
1368
1405
|
className: "flex w-full items-center gap-2",
|
|
1369
1406
|
children: [
|
|
1370
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ b(n, {
|
|
1371
1408
|
className: "h-4 w-4 shrink-0",
|
|
1372
1409
|
style: { color: t.color }
|
|
1373
1410
|
}),
|
|
1374
|
-
/* @__PURE__ */
|
|
1411
|
+
/* @__PURE__ */ b("span", {
|
|
1375
1412
|
className: "min-w-0 flex-1 truncate",
|
|
1376
1413
|
children: e(t.labelKey, t.label)
|
|
1377
1414
|
}),
|
|
1378
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ b("span", {
|
|
1379
1416
|
className: "shrink-0 text-[10px] uppercase tracking-wide text-text-secondary",
|
|
1380
|
-
children: e(`healthybowl.fieldMapPage.elements.kind.${t.kind}`,
|
|
1417
|
+
children: e(`healthybowl.fieldMapPage.elements.kind.${t.kind}`, ht(t.kind))
|
|
1381
1418
|
})
|
|
1382
1419
|
]
|
|
1383
|
-
}), t.hint && /* @__PURE__ */
|
|
1420
|
+
}), t.hint && /* @__PURE__ */ b("span", {
|
|
1384
1421
|
className: "ps-6 text-xs font-normal normal-case text-text-secondary",
|
|
1385
|
-
children: e(t.hint.key, t.hint.defaultValue, { type: t.promotesTo ?
|
|
1422
|
+
children: e(t.hint.key, t.hint.defaultValue, { type: t.promotesTo ? u(e, t.promotesTo) : "" })
|
|
1386
1423
|
})]
|
|
1387
1424
|
}, t.type);
|
|
1388
1425
|
})]
|
|
1389
1426
|
}),
|
|
1390
|
-
(
|
|
1427
|
+
(A === "draw" || A === "farm") && /* @__PURE__ */ x("div", {
|
|
1391
1428
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1392
1429
|
children: [
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
/* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ b("span", { children: A === "farm" ? e("healthybowl.fieldMapPage.farmDrawHint", "Click the map to trace the farm outline ({{count}}) — click the first point or Finish to save it.", { count: String(un) }) : e("healthybowl.fieldMapPage.drawHint", "Click the map to add corners ({{count}}) — click the first point or Finish.", { count: String(un) }) }),
|
|
1431
|
+
/* @__PURE__ */ x(S, {
|
|
1395
1432
|
size: "sm",
|
|
1396
1433
|
variant: "outline",
|
|
1397
|
-
onClick:
|
|
1398
|
-
disabled:
|
|
1434
|
+
onClick: ki,
|
|
1435
|
+
disabled: un === 0,
|
|
1399
1436
|
title: e("healthybowl.fieldMapPage.undoCorner", "Undo last corner"),
|
|
1400
1437
|
children: [
|
|
1401
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ b(Ye, { className: "h-3.5 w-3.5" }),
|
|
1402
1439
|
" ",
|
|
1403
1440
|
e("healthybowl.fieldMapPage.undo", "Undo")
|
|
1404
1441
|
]
|
|
1405
1442
|
}),
|
|
1406
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ x(S, {
|
|
1407
1444
|
size: "sm",
|
|
1408
1445
|
variant: "default",
|
|
1409
|
-
onClick:
|
|
1446
|
+
onClick: Ti,
|
|
1410
1447
|
children: [
|
|
1411
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ b(Pe, { className: "h-3.5 w-3.5" }),
|
|
1412
1449
|
" ",
|
|
1413
1450
|
e("healthybowl.fieldMapPage.finish", "Finish")
|
|
1414
1451
|
]
|
|
1415
1452
|
}),
|
|
1416
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ b(S, {
|
|
1417
1454
|
size: "sm",
|
|
1418
1455
|
variant: "outline",
|
|
1419
|
-
onClick:
|
|
1420
|
-
children: /* @__PURE__ */
|
|
1456
|
+
onClick: Oi,
|
|
1457
|
+
children: /* @__PURE__ */ b(Ze, { className: "h-3.5 w-3.5" })
|
|
1421
1458
|
})
|
|
1422
1459
|
]
|
|
1423
1460
|
}),
|
|
1424
|
-
|
|
1461
|
+
A === "edit" && /* @__PURE__ */ x("div", {
|
|
1425
1462
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1426
1463
|
children: [
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
area: String(
|
|
1464
|
+
/* @__PURE__ */ b("span", { children: e("healthybowl.fieldMapPage.editHint", "Drag handles to reshape · {{area}} {{unit}}", {
|
|
1465
|
+
area: String(fn ?? ""),
|
|
1429
1466
|
unit: G?.unit ?? "acres"
|
|
1430
1467
|
}) }),
|
|
1431
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ x(S, {
|
|
1432
1469
|
size: "sm",
|
|
1433
1470
|
variant: "default",
|
|
1434
|
-
onClick:
|
|
1435
|
-
disabled: !
|
|
1471
|
+
onClick: Pi,
|
|
1472
|
+
disabled: !mn || gn,
|
|
1436
1473
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ b(Ue, { className: "h-3.5 w-3.5" }),
|
|
1438
1475
|
" ",
|
|
1439
|
-
|
|
1476
|
+
gn ? e("healthybowl.fieldMapPage.saving", "Saving…") : e("healthybowl.fieldMapPage.save", "Save")
|
|
1440
1477
|
]
|
|
1441
1478
|
}),
|
|
1442
|
-
/* @__PURE__ */
|
|
1479
|
+
/* @__PURE__ */ b(S, {
|
|
1443
1480
|
size: "sm",
|
|
1444
1481
|
variant: "outline",
|
|
1445
|
-
onClick:
|
|
1446
|
-
children: /* @__PURE__ */
|
|
1482
|
+
onClick: Ni,
|
|
1483
|
+
children: /* @__PURE__ */ b(Ze, { className: "h-3.5 w-3.5" })
|
|
1447
1484
|
})
|
|
1448
1485
|
]
|
|
1449
1486
|
}),
|
|
1450
|
-
|
|
1487
|
+
A === "measure" && F && /* @__PURE__ */ x("div", {
|
|
1451
1488
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-3 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1452
1489
|
children: [
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ x("span", { children: [e("healthybowl.fieldMapPage.measure.distance", "Distance: {{d}}", { d: ta }), F.area != null && ` · ${e("healthybowl.fieldMapPage.measure.area", "Area: {{a}} ac", { a: (F.area / 4046.8564224).toFixed(2) })}`] }),
|
|
1491
|
+
/* @__PURE__ */ b(S, {
|
|
1455
1492
|
size: "sm",
|
|
1456
1493
|
variant: "outline",
|
|
1457
|
-
onClick:
|
|
1494
|
+
onClick: Ii,
|
|
1458
1495
|
children: e("healthybowl.fieldMapPage.measure.reset", "Reset")
|
|
1459
1496
|
}),
|
|
1460
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ b(S, {
|
|
1461
1498
|
size: "sm",
|
|
1462
1499
|
variant: "outline",
|
|
1463
|
-
onClick:
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1500
|
+
onClick: zi,
|
|
1501
|
+
children: /* @__PURE__ */ b(Ze, { className: "h-3.5 w-3.5" })
|
|
1465
1502
|
})
|
|
1466
1503
|
]
|
|
1467
1504
|
}),
|
|
1468
|
-
|
|
1505
|
+
A === "element" && gi && /* @__PURE__ */ x("div", {
|
|
1469
1506
|
className: "absolute left-1/2 top-3 z-[1000] flex -translate-x-1/2 items-center gap-2 rounded-full bg-bg-surface/95 px-3 py-1.5 text-xs text-text-primary shadow-md",
|
|
1470
1507
|
children: [
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
|
|
1508
|
+
/* @__PURE__ */ b("span", { children: gi.kind === "point" ? e("healthybowl.fieldMapPage.elements.hint.point", "Click the map to place {{label}}.", { label: e(gi.labelKey, gi.label) }) : gi.kind === "line" ? e("healthybowl.fieldMapPage.elements.hint.line", "Click to add points ({{count}}) — then Finish.", { count: String(qn) }) : e("healthybowl.fieldMapPage.elements.hint.polygon", "Click to add corners ({{count}}) — click the first point or Finish.", { count: String(qn) }) }),
|
|
1509
|
+
gi.kind !== "point" && /* @__PURE__ */ x(S, {
|
|
1473
1510
|
size: "sm",
|
|
1474
1511
|
variant: "default",
|
|
1475
|
-
onClick:
|
|
1512
|
+
onClick: Ui,
|
|
1476
1513
|
children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ b(Pe, { className: "h-3.5 w-3.5" }),
|
|
1478
1515
|
" ",
|
|
1479
1516
|
e("healthybowl.fieldMapPage.finish", "Finish")
|
|
1480
1517
|
]
|
|
1481
1518
|
}),
|
|
1482
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ b(S, {
|
|
1483
1520
|
size: "sm",
|
|
1484
1521
|
variant: "outline",
|
|
1485
|
-
onClick:
|
|
1486
|
-
children: /* @__PURE__ */
|
|
1522
|
+
onClick: Gi,
|
|
1523
|
+
children: /* @__PURE__ */ b(Ze, { className: "h-3.5 w-3.5" })
|
|
1487
1524
|
})
|
|
1488
1525
|
]
|
|
1489
1526
|
}),
|
|
1490
|
-
|
|
1527
|
+
k === "ready" && /* @__PURE__ */ x("div", {
|
|
1491
1528
|
className: "absolute bottom-3 start-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1492
1529
|
children: [
|
|
1493
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ x("div", {
|
|
1494
1531
|
className: "mb-1.5 flex items-center gap-1.5 font-semibold text-text-primary",
|
|
1495
1532
|
children: [
|
|
1496
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ b(Ie, { className: "h-3.5 w-3.5" }),
|
|
1497
1534
|
" ",
|
|
1498
1535
|
e("healthybowl.fieldMapPage.layers.title", "Layers")
|
|
1499
1536
|
]
|
|
1500
1537
|
}),
|
|
1501
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ x("label", {
|
|
1502
1539
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1503
|
-
children: [/* @__PURE__ */
|
|
1540
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1504
1541
|
type: "checkbox",
|
|
1505
1542
|
checked: !0,
|
|
1506
1543
|
readOnly: !0,
|
|
1507
1544
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1508
1545
|
}), e("healthybowl.fieldMapPage.layers.satellite", "Satellite")]
|
|
1509
1546
|
}),
|
|
1510
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ x("label", {
|
|
1511
1548
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1512
|
-
children: [/* @__PURE__ */
|
|
1549
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1513
1550
|
type: "checkbox",
|
|
1514
|
-
checked:
|
|
1515
|
-
onChange: (e) =>
|
|
1551
|
+
checked: Xt,
|
|
1552
|
+
onChange: (e) => Zt(e.target.checked),
|
|
1516
1553
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1517
1554
|
}), e("healthybowl.fieldMapPage.layers.terrain", "Terrain")]
|
|
1518
1555
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ x("label", {
|
|
1520
1557
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1521
|
-
children: [/* @__PURE__ */
|
|
1558
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1522
1559
|
type: "checkbox",
|
|
1523
|
-
checked:
|
|
1524
|
-
onChange: (e) =>
|
|
1560
|
+
checked: Qt,
|
|
1561
|
+
onChange: (e) => $t(e.target.checked),
|
|
1525
1562
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1526
1563
|
}), e("healthybowl.fieldMapPage.layers.soil", "Soil type")]
|
|
1527
1564
|
}),
|
|
1528
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ x("label", {
|
|
1529
1566
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1530
|
-
children: [/* @__PURE__ */
|
|
1567
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1531
1568
|
type: "checkbox",
|
|
1532
|
-
checked:
|
|
1533
|
-
onChange: (e) =>
|
|
1569
|
+
checked: en,
|
|
1570
|
+
onChange: (e) => tn(e.target.checked),
|
|
1534
1571
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1535
1572
|
}), e("healthybowl.fieldMapPage.layers.elevation", "Elevation")]
|
|
1536
1573
|
}),
|
|
1537
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ x("label", {
|
|
1538
1575
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1539
|
-
children: [/* @__PURE__ */
|
|
1576
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1540
1577
|
type: "checkbox",
|
|
1541
|
-
checked:
|
|
1542
|
-
onChange: (e) =>
|
|
1578
|
+
checked: Ln,
|
|
1579
|
+
onChange: (e) => Rn(e.target.checked),
|
|
1543
1580
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1544
1581
|
}), e("healthybowl.fieldMapPage.layers.elements", "Map elements")]
|
|
1545
1582
|
}),
|
|
1546
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ x("label", {
|
|
1547
1584
|
className: "flex cursor-pointer items-center gap-2 py-0.5 text-text-primary",
|
|
1548
|
-
children: [/* @__PURE__ */
|
|
1585
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1549
1586
|
type: "checkbox",
|
|
1550
|
-
checked:
|
|
1551
|
-
onChange: (e) =>
|
|
1587
|
+
checked: zn,
|
|
1588
|
+
onChange: (e) => Bn(e.target.checked),
|
|
1552
1589
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1553
1590
|
}), e("healthybowl.fieldMapPage.layers.farmBoundary", "Farm boundary")]
|
|
1554
1591
|
}),
|
|
1555
|
-
|
|
1592
|
+
Ln && /* @__PURE__ */ x("div", {
|
|
1556
1593
|
className: "mt-1.5 max-h-40 overflow-y-auto border-t border-border-subtle pt-1.5",
|
|
1557
|
-
children: [/* @__PURE__ */
|
|
1594
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1558
1595
|
className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
1559
1596
|
children: e("healthybowl.fieldMapPage.elements.legendTitle", "Element types")
|
|
1560
|
-
}),
|
|
1597
|
+
}), mt.map((t) => {
|
|
1561
1598
|
let n = t.icon;
|
|
1562
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ x("div", {
|
|
1563
1600
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1564
1601
|
children: [
|
|
1565
|
-
/* @__PURE__ */
|
|
1602
|
+
/* @__PURE__ */ b("span", {
|
|
1566
1603
|
className: `inline-block shrink-0 ${t.kind === "line" ? "h-0.5 w-3.5 rounded-full" : "h-3 w-3 rounded-sm"}`,
|
|
1567
1604
|
style: { backgroundColor: t.color }
|
|
1568
1605
|
}),
|
|
1569
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ b(n, {
|
|
1570
1607
|
className: "h-3 w-3 shrink-0",
|
|
1571
1608
|
style: { color: t.color }
|
|
1572
1609
|
}),
|
|
@@ -1577,71 +1614,71 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1577
1614
|
})
|
|
1578
1615
|
]
|
|
1579
1616
|
}),
|
|
1580
|
-
|
|
1617
|
+
k === "ready" && en && /* @__PURE__ */ x("div", {
|
|
1581
1618
|
className: "absolute bottom-3 end-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1582
|
-
children: [/* @__PURE__ */
|
|
1619
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1583
1620
|
className: "mb-1.5 font-semibold text-text-primary",
|
|
1584
1621
|
children: e("healthybowl.fieldMapPage.elevationLegend.title", "Elevation")
|
|
1585
|
-
}),
|
|
1622
|
+
}), Xr ? /* @__PURE__ */ x($e, { children: [/* @__PURE__ */ b("span", {
|
|
1586
1623
|
className: "block h-2 w-40 rounded-full",
|
|
1587
1624
|
style: { background: "linear-gradient(to right, #16a34a, #f59e0b, #dc2626)" }
|
|
1588
|
-
}), /* @__PURE__ */
|
|
1625
|
+
}), /* @__PURE__ */ x("div", {
|
|
1589
1626
|
className: "mt-1 flex justify-between gap-3 text-text-secondary",
|
|
1590
|
-
children: [/* @__PURE__ */
|
|
1591
|
-
})] }) : /* @__PURE__ */
|
|
1627
|
+
children: [/* @__PURE__ */ b("span", { children: e("healthybowl.fieldMapPage.elevationLegend.low", "{{value}} m Low", { value: String(Math.round(Jr)) }) }), /* @__PURE__ */ b("span", { children: e("healthybowl.fieldMapPage.elevationLegend.high", "{{value}} m High", { value: String(Math.round(Yr)) }) })]
|
|
1628
|
+
})] }) : /* @__PURE__ */ b("span", {
|
|
1592
1629
|
className: "text-text-secondary",
|
|
1593
1630
|
children: e("healthybowl.fieldMapPage.elevationLegend.loading", "Loading elevation…")
|
|
1594
1631
|
})]
|
|
1595
1632
|
}),
|
|
1596
|
-
|
|
1633
|
+
k === "ready" && Qt && !en && Wr.length > 0 && /* @__PURE__ */ x("div", {
|
|
1597
1634
|
className: "absolute bottom-3 end-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 p-3 text-xs shadow-md",
|
|
1598
|
-
children: [/* @__PURE__ */
|
|
1635
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1599
1636
|
className: "mb-1.5 font-semibold text-text-primary",
|
|
1600
1637
|
children: e("healthybowl.fieldMapPage.soilLegend.title", "Soil Legend")
|
|
1601
|
-
}),
|
|
1638
|
+
}), Wr.map((t) => /* @__PURE__ */ x("div", {
|
|
1602
1639
|
className: "flex items-center gap-2 py-0.5 text-text-secondary",
|
|
1603
|
-
children: [/* @__PURE__ */
|
|
1640
|
+
children: [/* @__PURE__ */ b("span", {
|
|
1604
1641
|
className: "inline-block h-3 w-3 rounded-sm",
|
|
1605
1642
|
style: { backgroundColor: t.color }
|
|
1606
1643
|
}), e(`healthybowl.fieldMapPage.soil.${t.key}`, t.label)]
|
|
1607
1644
|
}, t.key))]
|
|
1608
1645
|
}),
|
|
1609
|
-
|
|
1646
|
+
k === "ready" && Xt && /* @__PURE__ */ x("div", {
|
|
1610
1647
|
className: "absolute start-3 top-3 z-[1000] rounded-lg border border-border-subtle bg-bg-surface/95 px-3 py-2 text-[11px] text-text-secondary shadow-md",
|
|
1611
|
-
children: [/* @__PURE__ */
|
|
1648
|
+
children: [/* @__PURE__ */ b("div", {
|
|
1612
1649
|
className: "font-semibold text-text-primary",
|
|
1613
1650
|
children: e("healthybowl.fieldMapPage.terrainLegend.title", "Terrain / Elevation")
|
|
1614
|
-
}), /* @__PURE__ */
|
|
1651
|
+
}), /* @__PURE__ */ x("div", {
|
|
1615
1652
|
className: "mt-1 flex items-center gap-2",
|
|
1616
|
-
children: [/* @__PURE__ */
|
|
1653
|
+
children: [/* @__PURE__ */ b("span", { className: "inline-block h-2 w-16 rounded-full bg-gradient-to-r from-green-600 via-yellow-400 to-orange-500" }), /* @__PURE__ */ b("span", { children: e("healthybowl.fieldMapPage.terrainLegend.scale", "low → high (contours)") })]
|
|
1617
1654
|
})]
|
|
1618
1655
|
}),
|
|
1619
|
-
(
|
|
1656
|
+
(k === "loading" || Je.crops && g.length === 0) && /* @__PURE__ */ b("div", {
|
|
1620
1657
|
className: "pointer-events-none absolute inset-0 z-[900] flex items-center justify-center rounded-lg bg-bg-surface/60 text-sm text-text-secondary",
|
|
1621
1658
|
children: e("healthybowl.fieldMapPage.loading", "Loading map…")
|
|
1622
1659
|
}),
|
|
1623
|
-
|
|
1660
|
+
ea && k === "ready" && A === "view" && /* @__PURE__ */ b("div", {
|
|
1624
1661
|
className: "absolute inset-0 z-[950] flex items-center justify-center p-6",
|
|
1625
|
-
children: /* @__PURE__ */
|
|
1662
|
+
children: /* @__PURE__ */ x("div", {
|
|
1626
1663
|
className: "max-w-sm rounded-xl border border-border-subtle bg-bg-surface/95 p-6 text-center shadow-lg",
|
|
1627
1664
|
children: [
|
|
1628
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ b("div", {
|
|
1629
1666
|
className: "mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-success/15",
|
|
1630
|
-
children: /* @__PURE__ */
|
|
1667
|
+
children: /* @__PURE__ */ b(ze, { className: "h-6 w-6 text-success" })
|
|
1631
1668
|
}),
|
|
1632
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ b("h3", {
|
|
1633
1670
|
className: "text-lg font-semibold text-text-primary",
|
|
1634
1671
|
children: e("healthybowl.fieldMapPage.empty.title", "No field boundaries yet")
|
|
1635
1672
|
}),
|
|
1636
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ b("p", {
|
|
1637
1674
|
className: "mt-1 text-sm text-text-secondary",
|
|
1638
1675
|
children: e("healthybowl.fieldMapPage.empty.description", "Draw the shape of each field on the satellite view to auto-calculate its area and unlock soil & terrain overlays.")
|
|
1639
1676
|
}),
|
|
1640
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ x(S, {
|
|
1641
1678
|
className: "mt-4",
|
|
1642
|
-
onClick:
|
|
1679
|
+
onClick: Ei,
|
|
1643
1680
|
children: [
|
|
1644
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ b(Ve, { className: "h-4 w-4" }),
|
|
1645
1682
|
" ",
|
|
1646
1683
|
e("healthybowl.fieldMapPage.empty.action", "Draw Your First Field")
|
|
1647
1684
|
]
|
|
@@ -1651,110 +1688,110 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1651
1688
|
})
|
|
1652
1689
|
]
|
|
1653
1690
|
}),
|
|
1654
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ b("p", {
|
|
1655
1692
|
className: "text-xs text-text-secondary",
|
|
1656
1693
|
children: e("healthybowl.fieldMapPage.attribution", "Imagery © Esri, Maxar, Earthstar Geographics · terrain © OpenTopoMap / OpenStreetMap")
|
|
1657
1694
|
})
|
|
1658
1695
|
]
|
|
1659
|
-
}), /* @__PURE__ */
|
|
1696
|
+
}), /* @__PURE__ */ x("aside", {
|
|
1660
1697
|
className: "shrink-0 space-y-4 lg:w-80",
|
|
1661
1698
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1699
|
+
/* @__PURE__ */ x("div", {
|
|
1663
1700
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1664
1701
|
children: [
|
|
1665
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ b("h2", {
|
|
1666
1703
|
className: "text-base font-semibold text-text-primary",
|
|
1667
1704
|
children: e("healthybowl.fieldMapPage.panel.title", "Fields")
|
|
1668
1705
|
}),
|
|
1669
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ b("p", {
|
|
1670
1707
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
1671
1708
|
children: e("healthybowl.fieldMapPage.panel.summary", "{{acres}} acres · {{count}} fields · {{mapped}} mapped", {
|
|
1672
|
-
acres:
|
|
1673
|
-
count: String(
|
|
1674
|
-
mapped: String(
|
|
1709
|
+
acres: Ur.toFixed(1),
|
|
1710
|
+
count: String(g.length),
|
|
1711
|
+
mapped: String(Hr)
|
|
1675
1712
|
})
|
|
1676
1713
|
}),
|
|
1677
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ x("div", {
|
|
1678
1715
|
className: "relative mt-3",
|
|
1679
|
-
children: [/* @__PURE__ */
|
|
1716
|
+
children: [/* @__PURE__ */ b(We, { className: "pointer-events-none absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ b("input", {
|
|
1680
1717
|
type: "search",
|
|
1681
|
-
value:
|
|
1682
|
-
onChange: (e) =>
|
|
1718
|
+
value: rn,
|
|
1719
|
+
onChange: (e) => an(e.target.value),
|
|
1683
1720
|
placeholder: e("healthybowl.fieldMapPage.panel.search", "Search fields…"),
|
|
1684
1721
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface py-2 ps-9 pe-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1685
1722
|
})]
|
|
1686
1723
|
}),
|
|
1687
|
-
/* @__PURE__ */
|
|
1724
|
+
/* @__PURE__ */ x("div", {
|
|
1688
1725
|
className: "mt-3 max-h-[38vh] space-y-1 overflow-y-auto",
|
|
1689
|
-
children: [
|
|
1690
|
-
let n =
|
|
1691
|
-
return /* @__PURE__ */
|
|
1726
|
+
children: [Kr.map((t) => {
|
|
1727
|
+
let n = D(t) !== null;
|
|
1728
|
+
return /* @__PURE__ */ x("button", {
|
|
1692
1729
|
type: "button",
|
|
1693
1730
|
"data-field-id": t.id,
|
|
1694
|
-
onClick: () =>
|
|
1695
|
-
className: `flex w-full items-center gap-3 rounded-md border px-2.5 py-2 text-start transition-colors ${t.id ===
|
|
1731
|
+
onClick: () => Si(t),
|
|
1732
|
+
className: `flex w-full items-center gap-3 rounded-md border px-2.5 py-2 text-start transition-colors ${t.id === M ? "border-success bg-success/10" : "border-transparent hover:bg-bg-sunken"}`,
|
|
1696
1733
|
children: [
|
|
1697
|
-
/* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ b("span", {
|
|
1698
1735
|
className: "mt-0.5 inline-block h-4 w-4 shrink-0 rounded",
|
|
1699
|
-
style: { backgroundColor:
|
|
1736
|
+
style: { backgroundColor: he(t.soilType) }
|
|
1700
1737
|
}),
|
|
1701
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ x("span", {
|
|
1702
1739
|
className: "min-w-0 flex-1",
|
|
1703
|
-
children: [/* @__PURE__ */
|
|
1740
|
+
children: [/* @__PURE__ */ b("span", {
|
|
1704
1741
|
className: "block truncate text-sm font-medium text-text-primary",
|
|
1705
1742
|
children: t.name
|
|
1706
|
-
}), /* @__PURE__ */
|
|
1743
|
+
}), /* @__PURE__ */ x("span", {
|
|
1707
1744
|
className: "block truncate text-xs text-text-secondary",
|
|
1708
1745
|
children: [
|
|
1709
|
-
|
|
1746
|
+
Lt(t),
|
|
1710
1747
|
" · ",
|
|
1711
|
-
|
|
1748
|
+
u(e, t.type),
|
|
1712
1749
|
" ·",
|
|
1713
1750
|
" ",
|
|
1714
1751
|
t.soilType || e("healthybowl.fieldMapPage.unknownSoil", "Unknown soil"),
|
|
1715
|
-
|
|
1752
|
+
P[t.id] != null && ` · ${e("healthybowl.fieldMapPage.detail.elevationValue", "{{value}} m", { value: String(Math.round(P[t.id])) })}`
|
|
1716
1753
|
]
|
|
1717
1754
|
})]
|
|
1718
1755
|
}),
|
|
1719
|
-
!n && /* @__PURE__ */
|
|
1756
|
+
!n && /* @__PURE__ */ b("span", {
|
|
1720
1757
|
className: "shrink-0 rounded-full bg-warning/20 px-1.5 py-0.5 text-[10px] font-medium text-warning",
|
|
1721
1758
|
children: e("healthybowl.fieldMapPage.unmapped", "no boundary")
|
|
1722
1759
|
})
|
|
1723
1760
|
]
|
|
1724
1761
|
}, t.id);
|
|
1725
|
-
}),
|
|
1762
|
+
}), Kr.length === 0 && /* @__PURE__ */ b("p", {
|
|
1726
1763
|
className: "px-2 py-4 text-center text-xs text-text-secondary",
|
|
1727
1764
|
children: e("healthybowl.fieldMapPage.panel.none", "No fields match your search.")
|
|
1728
1765
|
})]
|
|
1729
1766
|
}),
|
|
1730
|
-
/* @__PURE__ */
|
|
1767
|
+
/* @__PURE__ */ x(S, {
|
|
1731
1768
|
className: "mt-3 w-full",
|
|
1732
|
-
onClick:
|
|
1733
|
-
disabled:
|
|
1769
|
+
onClick: Ei,
|
|
1770
|
+
disabled: A === "draw",
|
|
1734
1771
|
children: [
|
|
1735
|
-
/* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ b(Ve, { className: "h-4 w-4" }),
|
|
1736
1773
|
" ",
|
|
1737
1774
|
e("healthybowl.fieldMapPage.panel.drawNew", "Draw New Field")
|
|
1738
1775
|
]
|
|
1739
1776
|
})
|
|
1740
1777
|
]
|
|
1741
1778
|
}),
|
|
1742
|
-
G && /* @__PURE__ */
|
|
1779
|
+
G && /* @__PURE__ */ x("div", {
|
|
1743
1780
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1744
1781
|
children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ b("h3", {
|
|
1746
1783
|
className: "text-sm font-semibold text-text-primary",
|
|
1747
1784
|
children: e("healthybowl.fieldMapPage.detail.selected", "Selected: {{name}}", { name: G.name })
|
|
1748
1785
|
}),
|
|
1749
|
-
/* @__PURE__ */
|
|
1786
|
+
/* @__PURE__ */ x("dl", {
|
|
1750
1787
|
className: "mt-3 space-y-2 text-sm",
|
|
1751
1788
|
children: [
|
|
1752
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ x("div", {
|
|
1753
1790
|
className: "flex justify-between gap-3",
|
|
1754
|
-
children: [/* @__PURE__ */
|
|
1791
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1755
1792
|
className: "text-text-secondary",
|
|
1756
1793
|
children: e("healthybowl.fieldMapPage.detail.area", "Area")
|
|
1757
|
-
}), /* @__PURE__ */
|
|
1794
|
+
}), /* @__PURE__ */ x("dd", {
|
|
1758
1795
|
className: "font-medium text-text-primary",
|
|
1759
1796
|
children: [
|
|
1760
1797
|
G.area,
|
|
@@ -1763,88 +1800,88 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1763
1800
|
]
|
|
1764
1801
|
})]
|
|
1765
1802
|
}),
|
|
1766
|
-
/* @__PURE__ */
|
|
1803
|
+
/* @__PURE__ */ x("div", {
|
|
1767
1804
|
className: "flex justify-between gap-3",
|
|
1768
|
-
children: [/* @__PURE__ */
|
|
1805
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1769
1806
|
className: "text-text-secondary",
|
|
1770
1807
|
children: e("healthybowl.fieldMapPage.detail.elevation", "Elevation")
|
|
1771
|
-
}), /* @__PURE__ */
|
|
1808
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1772
1809
|
className: "font-medium text-text-primary",
|
|
1773
|
-
children:
|
|
1810
|
+
children: P[G.id] == null ? "—" : e("healthybowl.fieldMapPage.detail.elevationValue", "{{value}} m", { value: String(Math.round(P[G.id])) })
|
|
1774
1811
|
})]
|
|
1775
1812
|
}),
|
|
1776
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ x("div", {
|
|
1777
1814
|
className: "flex justify-between gap-3",
|
|
1778
|
-
children: [/* @__PURE__ */
|
|
1815
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1779
1816
|
className: "text-text-secondary",
|
|
1780
1817
|
children: e("healthybowl.fieldMapPage.detail.type", "Growing location")
|
|
1781
|
-
}), /* @__PURE__ */
|
|
1818
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1782
1819
|
className: "font-medium text-text-primary",
|
|
1783
|
-
children:
|
|
1820
|
+
children: ci
|
|
1784
1821
|
})]
|
|
1785
1822
|
}),
|
|
1786
|
-
/* @__PURE__ */
|
|
1823
|
+
/* @__PURE__ */ x("div", {
|
|
1787
1824
|
className: "flex justify-between gap-3",
|
|
1788
|
-
children: [/* @__PURE__ */
|
|
1825
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1789
1826
|
className: "text-text-secondary",
|
|
1790
1827
|
children: e("healthybowl.fieldMapPage.detail.soil", "Soil")
|
|
1791
|
-
}), /* @__PURE__ */
|
|
1828
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1792
1829
|
className: "font-medium text-text-primary",
|
|
1793
1830
|
children: G.soilType || e("healthybowl.fieldMapPage.unknownSoil", "Unknown soil")
|
|
1794
1831
|
})]
|
|
1795
1832
|
}),
|
|
1796
|
-
/* @__PURE__ */
|
|
1833
|
+
/* @__PURE__ */ x("div", {
|
|
1797
1834
|
className: "flex justify-between gap-3",
|
|
1798
|
-
children: [/* @__PURE__ */
|
|
1835
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1799
1836
|
className: "text-text-secondary",
|
|
1800
1837
|
children: e("healthybowl.fieldMapPage.detail.irrigation", "Irrigation")
|
|
1801
|
-
}), /* @__PURE__ */
|
|
1838
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1802
1839
|
className: "font-medium text-text-primary",
|
|
1803
1840
|
children: G.irrigationType || "—"
|
|
1804
1841
|
})]
|
|
1805
1842
|
}),
|
|
1806
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ x("div", {
|
|
1807
1844
|
className: "flex justify-between gap-3",
|
|
1808
|
-
children: [/* @__PURE__ */
|
|
1845
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1809
1846
|
className: "text-text-secondary",
|
|
1810
1847
|
children: e("healthybowl.fieldMapPage.detail.crop", "Crop")
|
|
1811
|
-
}), /* @__PURE__ */
|
|
1848
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1812
1849
|
className: "font-medium text-text-primary",
|
|
1813
|
-
children:
|
|
1850
|
+
children: Zr(G) || e("healthybowl.fieldMapPage.detail.noCrop", "None")
|
|
1814
1851
|
})]
|
|
1815
1852
|
}),
|
|
1816
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ x("div", {
|
|
1817
1854
|
className: "flex justify-between gap-3",
|
|
1818
|
-
children: [/* @__PURE__ */
|
|
1855
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
1819
1856
|
className: "text-text-secondary",
|
|
1820
1857
|
children: e("healthybowl.fieldMapPage.detail.status", "Status")
|
|
1821
|
-
}), /* @__PURE__ */
|
|
1858
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1822
1859
|
className: "font-medium capitalize text-text-primary",
|
|
1823
1860
|
children: G.status
|
|
1824
1861
|
})]
|
|
1825
1862
|
})
|
|
1826
1863
|
]
|
|
1827
1864
|
}),
|
|
1828
|
-
/* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ x("div", {
|
|
1829
1866
|
className: "mt-3 flex gap-2",
|
|
1830
|
-
children: [/* @__PURE__ */
|
|
1867
|
+
children: [/* @__PURE__ */ x(S, {
|
|
1831
1868
|
variant: "outline",
|
|
1832
1869
|
size: "sm",
|
|
1833
1870
|
className: "flex-1",
|
|
1834
|
-
onClick: () =>
|
|
1871
|
+
onClick: () => xi(G),
|
|
1835
1872
|
children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ b(ze, { className: "h-4 w-4" }),
|
|
1837
1874
|
" ",
|
|
1838
1875
|
e("healthybowl.fieldMapPage.detail.flyTo", "Fly to")
|
|
1839
1876
|
]
|
|
1840
|
-
}),
|
|
1877
|
+
}), D(G) && /* @__PURE__ */ x(S, {
|
|
1841
1878
|
variant: "outline",
|
|
1842
1879
|
size: "sm",
|
|
1843
1880
|
className: "flex-1",
|
|
1844
|
-
onClick:
|
|
1845
|
-
disabled:
|
|
1881
|
+
onClick: Mi,
|
|
1882
|
+
disabled: A === "edit",
|
|
1846
1883
|
children: [
|
|
1847
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ b(Ke, { className: "h-4 w-4" }),
|
|
1848
1885
|
" ",
|
|
1849
1886
|
e("healthybowl.fieldMapPage.detail.edit", "Edit")
|
|
1850
1887
|
]
|
|
@@ -1852,307 +1889,311 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
1852
1889
|
})
|
|
1853
1890
|
]
|
|
1854
1891
|
}),
|
|
1855
|
-
G &&
|
|
1892
|
+
G && Qr && /* @__PURE__ */ x("div", {
|
|
1856
1893
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1857
1894
|
children: [
|
|
1858
|
-
/* @__PURE__ */
|
|
1895
|
+
/* @__PURE__ */ x("div", {
|
|
1859
1896
|
className: "flex items-center justify-between gap-2",
|
|
1860
|
-
children: [/* @__PURE__ */
|
|
1897
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
1861
1898
|
className: "flex items-center gap-1.5 text-sm font-semibold text-text-primary",
|
|
1862
1899
|
children: [
|
|
1863
|
-
/* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ b(Le, { className: "h-4 w-4" }),
|
|
1864
1901
|
" ",
|
|
1865
1902
|
e("healthybowl.fieldMapPage.beds.title", "Bed layout")
|
|
1866
1903
|
]
|
|
1867
|
-
}),
|
|
1904
|
+
}), J && /* @__PURE__ */ x("label", {
|
|
1868
1905
|
className: "flex cursor-pointer items-center gap-2 text-xs font-medium text-text-primary",
|
|
1869
|
-
children: [/* @__PURE__ */
|
|
1906
|
+
children: [/* @__PURE__ */ b("input", {
|
|
1870
1907
|
type: "checkbox",
|
|
1871
|
-
checked:
|
|
1872
|
-
onChange: (e) =>
|
|
1908
|
+
checked: yn,
|
|
1909
|
+
onChange: (e) => bn(e.target.checked),
|
|
1873
1910
|
className: "h-3.5 w-3.5 accent-[var(--color-success)]"
|
|
1874
1911
|
}), e("healthybowl.fieldMapPage.beds.show", "Show beds")]
|
|
1875
1912
|
})]
|
|
1876
1913
|
}),
|
|
1877
|
-
|
|
1878
|
-
/* @__PURE__ */
|
|
1914
|
+
J ? /* @__PURE__ */ x($e, { children: [
|
|
1915
|
+
/* @__PURE__ */ b("p", {
|
|
1879
1916
|
className: "mt-1 text-xs text-text-secondary",
|
|
1880
1917
|
children: e("healthybowl.fieldMapPage.beds.hint", "Draw planting bed strips inside this field, then save the layout. Click a saved bed to assign a crop.")
|
|
1881
1918
|
}),
|
|
1882
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ x("div", {
|
|
1883
1920
|
className: "mt-3 grid grid-cols-2 gap-3",
|
|
1884
|
-
children: [/* @__PURE__ */
|
|
1921
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
1885
1922
|
className: "text-xs font-medium text-text-primary",
|
|
1886
1923
|
children: e("healthybowl.fieldMapPage.beds.bedWidth", "Bed width (m)")
|
|
1887
|
-
}), /* @__PURE__ */
|
|
1924
|
+
}), /* @__PURE__ */ b("input", {
|
|
1888
1925
|
type: "number",
|
|
1889
1926
|
min: .2,
|
|
1890
1927
|
step: .1,
|
|
1891
|
-
value:
|
|
1892
|
-
onChange: (e) =>
|
|
1928
|
+
value: I,
|
|
1929
|
+
onChange: (e) => xn(Math.max(.2, Number(e.target.value) || 0)),
|
|
1893
1930
|
className: "mt-1 h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1894
|
-
})] }), /* @__PURE__ */
|
|
1931
|
+
})] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
1895
1932
|
className: "text-xs font-medium text-text-primary",
|
|
1896
1933
|
children: e("healthybowl.fieldMapPage.beds.pathWidth", "Path width (m)")
|
|
1897
|
-
}), /* @__PURE__ */
|
|
1934
|
+
}), /* @__PURE__ */ b("input", {
|
|
1898
1935
|
type: "number",
|
|
1899
1936
|
min: 0,
|
|
1900
1937
|
step: .05,
|
|
1901
|
-
value:
|
|
1902
|
-
onChange: (e) =>
|
|
1938
|
+
value: Sn,
|
|
1939
|
+
onChange: (e) => Cn(Math.max(0, Number(e.target.value) || 0)),
|
|
1903
1940
|
className: "mt-1 h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1904
1941
|
})] })]
|
|
1905
1942
|
}),
|
|
1906
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ x("div", {
|
|
1907
1944
|
className: "mt-3",
|
|
1908
|
-
children: [/* @__PURE__ */
|
|
1945
|
+
children: [/* @__PURE__ */ x("div", {
|
|
1909
1946
|
className: "flex items-center justify-between",
|
|
1910
|
-
children: [/* @__PURE__ */
|
|
1947
|
+
children: [/* @__PURE__ */ b("label", {
|
|
1911
1948
|
className: "text-xs font-medium text-text-primary",
|
|
1912
1949
|
children: e("healthybowl.fieldMapPage.beds.orientation", "Orientation")
|
|
1913
|
-
}), /* @__PURE__ */
|
|
1950
|
+
}), /* @__PURE__ */ x("span", {
|
|
1914
1951
|
className: "text-xs text-text-secondary",
|
|
1915
|
-
children: [
|
|
1952
|
+
children: [wn, "°"]
|
|
1916
1953
|
})]
|
|
1917
|
-
}), /* @__PURE__ */
|
|
1954
|
+
}), /* @__PURE__ */ b("input", {
|
|
1918
1955
|
type: "range",
|
|
1919
1956
|
min: 0,
|
|
1920
1957
|
max: 180,
|
|
1921
1958
|
step: 1,
|
|
1922
|
-
value:
|
|
1923
|
-
onChange: (e) =>
|
|
1959
|
+
value: wn,
|
|
1960
|
+
onChange: (e) => Tn(Number(e.target.value)),
|
|
1924
1961
|
className: "mt-1 w-full accent-[var(--color-success)]",
|
|
1925
1962
|
"aria-label": e("healthybowl.fieldMapPage.beds.orientation", "Orientation")
|
|
1926
1963
|
})]
|
|
1927
1964
|
}),
|
|
1928
|
-
|
|
1965
|
+
/* @__PURE__ */ x("div", {
|
|
1929
1966
|
className: "mt-3",
|
|
1930
1967
|
children: [
|
|
1931
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ b("label", {
|
|
1969
|
+
htmlFor: "map-bed-spacing-crop",
|
|
1932
1970
|
className: "text-xs font-medium text-text-primary",
|
|
1933
1971
|
children: e("healthybowl.fieldMapPage.beds.crop", "Spacing for crop")
|
|
1934
1972
|
}),
|
|
1935
|
-
/* @__PURE__ */ b(
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1973
|
+
/* @__PURE__ */ b(te, {
|
|
1974
|
+
id: "map-bed-spacing-crop",
|
|
1975
|
+
value: L || $r?.id || "",
|
|
1976
|
+
onValueChange: (e, t) => {
|
|
1977
|
+
En(e), On(t?.id === e ? {
|
|
1978
|
+
workspaceId: c,
|
|
1979
|
+
crop: t
|
|
1980
|
+
} : null);
|
|
1981
|
+
},
|
|
1982
|
+
options: ii,
|
|
1983
|
+
placeholder: e("healthybowl.fieldMapPage.beds.cropPlaceholder", "Standard spacing"),
|
|
1984
|
+
className: "mt-1"
|
|
1945
1985
|
}),
|
|
1946
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ b("p", {
|
|
1987
|
+
role: K ? "status" : void 0,
|
|
1947
1988
|
className: "mt-1 text-[11px] text-text-secondary",
|
|
1948
|
-
children: e("healthybowl.fieldMapPage.beds.spacingLine", "{{preset}} · {{plant}}×{{row}} cm", {
|
|
1949
|
-
preset:
|
|
1950
|
-
plant: String(
|
|
1951
|
-
row: String(
|
|
1989
|
+
children: K ? ri : e("healthybowl.fieldMapPage.beds.spacingLine", "{{preset}} · {{plant}}×{{row}} cm", {
|
|
1990
|
+
preset: q.label,
|
|
1991
|
+
plant: String(q.plantSpacingCm),
|
|
1992
|
+
row: String(q.rowSpacingCm)
|
|
1952
1993
|
})
|
|
1953
1994
|
})
|
|
1954
1995
|
]
|
|
1955
1996
|
}),
|
|
1956
|
-
|
|
1997
|
+
Y && /* @__PURE__ */ x("div", {
|
|
1957
1998
|
className: "mt-3 rounded-md bg-warning/10 px-3 py-2 text-sm font-medium text-text-primary",
|
|
1958
|
-
children: [e("healthybowl.fieldMapPage.beds.readout", "{{beds}} beds · ~{{plants}} plants", {
|
|
1959
|
-
beds: String(
|
|
1960
|
-
plants:
|
|
1961
|
-
}), /* @__PURE__ */
|
|
1999
|
+
children: [li == null ? e("healthybowl.fieldMapPage.beds.unresolvedReadout", "{{beds}} beds · crop spacing unresolved", { beds: String(Y.bedCount) }) : e("healthybowl.fieldMapPage.beds.readout", "{{beds}} beds · ~{{plants}} plants", {
|
|
2000
|
+
beds: String(Y.bedCount),
|
|
2001
|
+
plants: li.toLocaleString()
|
|
2002
|
+
}), /* @__PURE__ */ b("span", {
|
|
1962
2003
|
className: "ms-1 text-xs font-normal text-text-secondary",
|
|
1963
2004
|
children: e("healthybowl.fieldMapPage.beds.previewTag", "(preview)")
|
|
1964
2005
|
})]
|
|
1965
2006
|
})
|
|
1966
|
-
] }) : /* @__PURE__ */
|
|
2007
|
+
] }) : /* @__PURE__ */ b("p", {
|
|
1967
2008
|
"data-testid": "bed-geometry-notice",
|
|
1968
2009
|
className: "mt-2 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary",
|
|
1969
|
-
children: e(
|
|
2010
|
+
children: e(Se.key, Se.defaultValue, { type: ci })
|
|
1970
2011
|
}),
|
|
1971
|
-
|
|
2012
|
+
X.length > 0 && /* @__PURE__ */ x("div", {
|
|
1972
2013
|
className: "mt-2 flex items-center gap-2 rounded-md bg-success/10 px-3 py-2 text-sm font-medium text-text-primary",
|
|
1973
|
-
children: [/* @__PURE__ */
|
|
2014
|
+
children: [/* @__PURE__ */ b("span", { className: "inline-block h-3 w-3 shrink-0 rounded-sm border border-[#065f46] bg-[#34d399]" }), e("healthybowl.fieldMapPage.beds.savedCount", "Saved ({{count}} beds)", { count: String(X.length) })]
|
|
1974
2015
|
}),
|
|
1975
|
-
|
|
2016
|
+
di && X.length === 0 && /* @__PURE__ */ b("p", {
|
|
1976
2017
|
className: "mt-2 text-xs text-text-secondary",
|
|
1977
2018
|
children: e("healthybowl.fieldMapPage.beds.loadingSaved", "Loading saved beds…")
|
|
1978
2019
|
}),
|
|
1979
|
-
(
|
|
2020
|
+
(J || X.length > 0) && /* @__PURE__ */ x("div", {
|
|
1980
2021
|
className: "mt-3 flex gap-2",
|
|
1981
|
-
children: [
|
|
2022
|
+
children: [J && /* @__PURE__ */ x(S, {
|
|
1982
2023
|
size: "sm",
|
|
1983
2024
|
className: "flex-1",
|
|
1984
|
-
onClick:
|
|
1985
|
-
disabled: !
|
|
2025
|
+
onClick: vi,
|
|
2026
|
+
disabled: !Y || Y.beds.length === 0 || kn || K,
|
|
1986
2027
|
children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ b(Ue, { className: "h-4 w-4" }),
|
|
1988
2029
|
" ",
|
|
1989
|
-
|
|
2030
|
+
kn ? e("healthybowl.fieldMapPage.beds.saving", "Saving…") : X.length > 0 ? e("healthybowl.fieldMapPage.beds.resave", "Save layout (replace)") : e("healthybowl.fieldMapPage.beds.save", "Save layout")
|
|
1990
2031
|
]
|
|
1991
|
-
}),
|
|
2032
|
+
}), X.length > 0 && /* @__PURE__ */ x(S, {
|
|
1992
2033
|
variant: "outline",
|
|
1993
2034
|
size: "sm",
|
|
1994
|
-
onClick:
|
|
1995
|
-
disabled:
|
|
2035
|
+
onClick: yi,
|
|
2036
|
+
disabled: jn,
|
|
1996
2037
|
children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ b(qe, { className: "h-4 w-4" }),
|
|
1998
2039
|
" ",
|
|
1999
|
-
|
|
2040
|
+
jn ? e("healthybowl.fieldMapPage.beds.clearing", "Clearing…") : e("healthybowl.fieldMapPage.beds.clear", "Clear")
|
|
2000
2041
|
]
|
|
2001
2042
|
})]
|
|
2002
2043
|
}),
|
|
2003
|
-
|
|
2044
|
+
Y && Y.bedCount > gt && /* @__PURE__ */ b("p", {
|
|
2004
2045
|
className: "mt-2 text-xs text-warning",
|
|
2005
|
-
children: e("healthybowl.fieldMapPage.beds.capHint", "Over the {{max}}-bed save limit — widen the beds to save this layout.", { max: String(
|
|
2046
|
+
children: e("healthybowl.fieldMapPage.beds.capHint", "Over the {{max}}-bed save limit — widen the beds to save this layout.", { max: String(gt) })
|
|
2006
2047
|
})
|
|
2007
2048
|
]
|
|
2008
2049
|
})
|
|
2009
2050
|
]
|
|
2010
2051
|
})]
|
|
2011
2052
|
}),
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
open:
|
|
2053
|
+
/* @__PURE__ */ b(oe, {
|
|
2054
|
+
open: H !== null,
|
|
2014
2055
|
onClose: () => {
|
|
2015
|
-
|
|
2056
|
+
ar(null), xr(null);
|
|
2016
2057
|
},
|
|
2017
2058
|
title: e("healthybowl.fieldMapPage.create.title", "Save New Field"),
|
|
2018
2059
|
description: e("healthybowl.fieldMapPage.create.description", "Name the field you just drew. Its area is auto-calculated."),
|
|
2019
|
-
footer: /* @__PURE__ */
|
|
2060
|
+
footer: /* @__PURE__ */ x($e, { children: [/* @__PURE__ */ b(S, {
|
|
2020
2061
|
variant: "outline",
|
|
2021
2062
|
onClick: () => {
|
|
2022
|
-
|
|
2063
|
+
ar(null), xr(null);
|
|
2023
2064
|
},
|
|
2024
2065
|
className: "text-text-secondary",
|
|
2025
2066
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
2026
|
-
}), /* @__PURE__ */
|
|
2027
|
-
onClick:
|
|
2028
|
-
disabled:
|
|
2029
|
-
children:
|
|
2067
|
+
}), /* @__PURE__ */ b(S, {
|
|
2068
|
+
onClick: Ji,
|
|
2069
|
+
disabled: or,
|
|
2070
|
+
children: or ? e("healthybowl.fieldMapPage.create.saving", "Saving…") : e("healthybowl.fieldMapPage.create.action", "Save Field")
|
|
2030
2071
|
})] }),
|
|
2031
|
-
children: /* @__PURE__ */
|
|
2072
|
+
children: /* @__PURE__ */ x("div", {
|
|
2032
2073
|
className: "space-y-4",
|
|
2033
2074
|
children: [
|
|
2034
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ b("div", {
|
|
2035
2076
|
className: "rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
2036
|
-
children: e("healthybowl.fieldMapPage.create.areaLine", "Auto-calculated area: {{area}} acres", { area: String(
|
|
2077
|
+
children: e("healthybowl.fieldMapPage.create.areaLine", "Auto-calculated area: {{area}} acres", { area: String(H?.area ?? 0) })
|
|
2037
2078
|
}),
|
|
2038
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2039
2080
|
className: "text-sm font-medium text-text-primary",
|
|
2040
2081
|
children: e("healthybowl.fieldMapPage.create.name", "Field name *")
|
|
2041
|
-
}), /* @__PURE__ */
|
|
2082
|
+
}), /* @__PURE__ */ b("input", {
|
|
2042
2083
|
type: "text",
|
|
2043
|
-
value:
|
|
2044
|
-
onChange: (e) =>
|
|
2084
|
+
value: cr,
|
|
2085
|
+
onChange: (e) => lr(e.target.value),
|
|
2045
2086
|
placeholder: e("healthybowl.fieldMapPage.create.namePlaceholder", "e.g., North Paddy"),
|
|
2046
2087
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
2047
2088
|
})] }),
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ x("div", { children: [
|
|
2090
|
+
/* @__PURE__ */ b("label", {
|
|
2050
2091
|
className: "text-sm font-medium text-text-primary",
|
|
2051
2092
|
children: e("healthybowl.fieldMapPage.create.type", "Growing location")
|
|
2052
2093
|
}),
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
value:
|
|
2055
|
-
onValueChange: (e) =>
|
|
2056
|
-
children: [/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ x(et, {
|
|
2095
|
+
value: gr,
|
|
2096
|
+
onValueChange: (e) => _r(e),
|
|
2097
|
+
children: [/* @__PURE__ */ b(nt, {
|
|
2057
2098
|
className: "mt-1 w-full",
|
|
2058
|
-
children: /* @__PURE__ */
|
|
2059
|
-
}), /* @__PURE__ */
|
|
2099
|
+
children: /* @__PURE__ */ b(rt, {})
|
|
2100
|
+
}), /* @__PURE__ */ b(tt, { children: we.map((t) => /* @__PURE__ */ b(C, {
|
|
2060
2101
|
value: t.value,
|
|
2061
2102
|
children: e(t.key, t.defaultValue)
|
|
2062
2103
|
}, t.value)) })]
|
|
2063
2104
|
}),
|
|
2064
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ b("p", {
|
|
2065
2106
|
className: "mt-1 text-xs text-text-secondary",
|
|
2066
2107
|
children: e("healthybowl.fieldMapPage.create.typeHint", "Bed layouts are drawn for open fields and raised beds. Other types are estimated from their own geometry below.")
|
|
2067
2108
|
}),
|
|
2068
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ b("div", {
|
|
2069
2110
|
className: "mt-3",
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2071
|
-
type:
|
|
2072
|
-
value:
|
|
2073
|
-
onChange:
|
|
2111
|
+
children: /* @__PURE__ */ b(De, {
|
|
2112
|
+
type: gr,
|
|
2113
|
+
value: vr,
|
|
2114
|
+
onChange: yr,
|
|
2074
2115
|
t: e,
|
|
2075
2116
|
testIdPrefix: "field-map-grow-geometry"
|
|
2076
2117
|
})
|
|
2077
2118
|
})
|
|
2078
2119
|
] }),
|
|
2079
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ x("div", {
|
|
2080
2121
|
className: "grid grid-cols-2 gap-3",
|
|
2081
|
-
children: [/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2122
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
2123
|
+
/* @__PURE__ */ b("label", {
|
|
2083
2124
|
className: "text-sm font-medium text-text-primary",
|
|
2084
2125
|
children: e("healthybowl.fieldMapPage.create.soil", "Soil type")
|
|
2085
2126
|
}),
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
value:
|
|
2088
|
-
onValueChange:
|
|
2089
|
-
children: [/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ x(et, {
|
|
2128
|
+
value: ur,
|
|
2129
|
+
onValueChange: dr,
|
|
2130
|
+
children: [/* @__PURE__ */ b(nt, {
|
|
2090
2131
|
className: "mt-1 w-full",
|
|
2091
|
-
children: /* @__PURE__ */
|
|
2092
|
-
}), /* @__PURE__ */
|
|
2132
|
+
children: /* @__PURE__ */ b(rt, {})
|
|
2133
|
+
}), /* @__PURE__ */ b(tt, { children: me.map((t) => /* @__PURE__ */ b(C, {
|
|
2093
2134
|
value: t.label,
|
|
2094
2135
|
children: e(`healthybowl.fieldMapPage.soil.${t.key}`, t.label)
|
|
2095
2136
|
}, t.key)) })]
|
|
2096
2137
|
}),
|
|
2097
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ x("p", {
|
|
2098
2139
|
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
2099
|
-
children: [/* @__PURE__ */
|
|
2140
|
+
children: [/* @__PURE__ */ b("span", {
|
|
2100
2141
|
className: "inline-block h-3 w-3 shrink-0 rounded-sm border border-border-subtle",
|
|
2101
|
-
style: { backgroundColor:
|
|
2142
|
+
style: { backgroundColor: he(ur) }
|
|
2102
2143
|
}), e("healthybowl.fieldMapPage.create.soilHint", "The map shades each field by its soil type — pick the right one so fields stand apart.")]
|
|
2103
2144
|
})
|
|
2104
|
-
] }), /* @__PURE__ */
|
|
2145
|
+
] }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2105
2146
|
className: "text-sm font-medium text-text-primary",
|
|
2106
2147
|
children: e("healthybowl.fieldMapPage.create.irrigation", "Irrigation")
|
|
2107
|
-
}), /* @__PURE__ */
|
|
2108
|
-
value:
|
|
2109
|
-
onValueChange:
|
|
2110
|
-
children: [/* @__PURE__ */
|
|
2148
|
+
}), /* @__PURE__ */ x(et, {
|
|
2149
|
+
value: fr,
|
|
2150
|
+
onValueChange: pr,
|
|
2151
|
+
children: [/* @__PURE__ */ b(nt, {
|
|
2111
2152
|
className: "mt-1 w-full",
|
|
2112
|
-
children: /* @__PURE__ */
|
|
2113
|
-
}), /* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ b(rt, {})
|
|
2154
|
+
}), /* @__PURE__ */ x(tt, { children: [
|
|
2155
|
+
/* @__PURE__ */ b(C, {
|
|
2115
2156
|
value: "Drip",
|
|
2116
2157
|
children: e("healthybowl.fieldMapPage.irrigation.drip", "Drip")
|
|
2117
2158
|
}),
|
|
2118
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ b(C, {
|
|
2119
2160
|
value: "Sprinkler",
|
|
2120
2161
|
children: e("healthybowl.fieldMapPage.irrigation.sprinkler", "Sprinkler")
|
|
2121
2162
|
}),
|
|
2122
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ b(C, {
|
|
2123
2164
|
value: "Flood",
|
|
2124
2165
|
children: e("healthybowl.fieldMapPage.irrigation.flood", "Flood")
|
|
2125
2166
|
}),
|
|
2126
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ b(C, {
|
|
2127
2168
|
value: "Rainfed",
|
|
2128
2169
|
children: e("healthybowl.fieldMapPage.irrigation.rainfed", "Rainfed")
|
|
2129
2170
|
}),
|
|
2130
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ b(C, {
|
|
2131
2172
|
value: "None",
|
|
2132
2173
|
children: e("healthybowl.fieldMapPage.irrigation.none", "None")
|
|
2133
2174
|
})
|
|
2134
2175
|
] })]
|
|
2135
2176
|
})] })]
|
|
2136
2177
|
}),
|
|
2137
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2138
2179
|
className: "text-sm font-medium text-text-primary",
|
|
2139
2180
|
children: e("healthybowl.fieldMapPage.create.status", "Status")
|
|
2140
|
-
}), /* @__PURE__ */
|
|
2141
|
-
value:
|
|
2142
|
-
onValueChange:
|
|
2143
|
-
children: [/* @__PURE__ */
|
|
2181
|
+
}), /* @__PURE__ */ x(et, {
|
|
2182
|
+
value: mr,
|
|
2183
|
+
onValueChange: hr,
|
|
2184
|
+
children: [/* @__PURE__ */ b(nt, {
|
|
2144
2185
|
className: "mt-1 w-full",
|
|
2145
|
-
children: /* @__PURE__ */
|
|
2146
|
-
}), /* @__PURE__ */
|
|
2147
|
-
/* @__PURE__ */
|
|
2186
|
+
children: /* @__PURE__ */ b(rt, {})
|
|
2187
|
+
}), /* @__PURE__ */ x(tt, { children: [
|
|
2188
|
+
/* @__PURE__ */ b(C, {
|
|
2148
2189
|
value: "active",
|
|
2149
2190
|
children: e("healthybowl.fieldMapPage.status.active", "Active")
|
|
2150
2191
|
}),
|
|
2151
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ b(C, {
|
|
2152
2193
|
value: "preparation",
|
|
2153
2194
|
children: e("healthybowl.fieldMapPage.status.preparation", "Preparation")
|
|
2154
2195
|
}),
|
|
2155
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ b(C, {
|
|
2156
2197
|
value: "fallow",
|
|
2157
2198
|
children: e("healthybowl.fieldMapPage.status.fallow", "Fallow")
|
|
2158
2199
|
})
|
|
@@ -2161,39 +2202,46 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
2161
2202
|
]
|
|
2162
2203
|
})
|
|
2163
2204
|
}),
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
open:
|
|
2166
|
-
onClose: () =>
|
|
2167
|
-
title: e("healthybowl.fieldMapPage.beds.assign.title", "Assign crop to {{bed}}", { bed:
|
|
2205
|
+
/* @__PURE__ */ b(oe, {
|
|
2206
|
+
open: R !== null,
|
|
2207
|
+
onClose: () => Nn(null),
|
|
2208
|
+
title: e("healthybowl.fieldMapPage.beds.assign.title", "Assign crop to {{bed}}", { bed: R?.name ?? "" }),
|
|
2168
2209
|
description: e("healthybowl.fieldMapPage.beds.assign.description", "Pick a crop for this bed. Its plant count is recomputed from the crop's spacing."),
|
|
2169
|
-
footer: /* @__PURE__ */
|
|
2210
|
+
footer: /* @__PURE__ */ x($e, { children: [/* @__PURE__ */ b(S, {
|
|
2170
2211
|
variant: "outline",
|
|
2171
|
-
onClick: () =>
|
|
2212
|
+
onClick: () => Nn(null),
|
|
2172
2213
|
className: "text-text-secondary",
|
|
2173
2214
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
2174
|
-
}), /* @__PURE__ */
|
|
2175
|
-
onClick:
|
|
2176
|
-
disabled:
|
|
2177
|
-
children:
|
|
2215
|
+
}), /* @__PURE__ */ b(S, {
|
|
2216
|
+
onClick: bi,
|
|
2217
|
+
disabled: Fn || !!(z && !oi && !si),
|
|
2218
|
+
children: Fn ? e("healthybowl.fieldMapPage.beds.assign.saving", "Saving…") : e("healthybowl.fieldMapPage.beds.assign.action", "Assign")
|
|
2178
2219
|
})] }),
|
|
2179
|
-
children: /* @__PURE__ */
|
|
2220
|
+
children: /* @__PURE__ */ x("div", {
|
|
2180
2221
|
className: "space-y-3",
|
|
2181
|
-
children: [/* @__PURE__ */
|
|
2222
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2223
|
+
htmlFor: "map-bed-assignment-crop",
|
|
2182
2224
|
className: "text-sm font-medium text-text-primary",
|
|
2183
2225
|
children: e("healthybowl.fieldMapPage.beds.assign.crop", "Crop")
|
|
2184
|
-
}), /* @__PURE__ */ b(
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2226
|
+
}), /* @__PURE__ */ b(te, {
|
|
2227
|
+
id: "map-bed-assignment-crop",
|
|
2228
|
+
value: z || "__no_crop__",
|
|
2229
|
+
onValueChange: (e) => Pn(e === "__no_crop__" ? "" : e),
|
|
2230
|
+
options: ii,
|
|
2231
|
+
emptyOption: {
|
|
2232
|
+
value: "__no_crop__",
|
|
2233
|
+
label: e("healthybowl.fieldMapPage.beds.assign.none", "No crop")
|
|
2234
|
+
},
|
|
2235
|
+
skip: !R,
|
|
2236
|
+
disabled: Fn,
|
|
2237
|
+
className: "mt-1"
|
|
2238
|
+
})] }), z && !oi ? /* @__PURE__ */ x("p", {
|
|
2239
|
+
role: "status",
|
|
2240
|
+
className: "rounded-md border border-border-subtle bg-bg-sunken/60 px-3 py-2 text-sm text-text-secondary",
|
|
2241
|
+
children: [ai.loading ? "Loading the recorded crop…" : `Recorded crop ID ${z} is unavailable.`, si ? ` Stored plant count: ${R?.plantCount ?? "—"}; retained unless you deliberately choose another crop.` : " Choose an available crop before saving."]
|
|
2242
|
+
}) : J ? (() => {
|
|
2243
|
+
let t = je(oi), n = R ? s(R.boundary) : null, r = ye(R?.area ?? (n ? le(n) : 0), R?.widthM ?? I, t.plantSpacingCm, t.rowSpacingCm);
|
|
2244
|
+
return /* @__PURE__ */ b("div", {
|
|
2197
2245
|
className: "rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
2198
2246
|
children: e("healthybowl.fieldMapPage.beds.assign.preview", "{{preset}} · {{plant}}×{{row}} cm · ~{{plants}} plants", {
|
|
2199
2247
|
preset: t.label,
|
|
@@ -2202,58 +2250,58 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
2202
2250
|
plants: r.toLocaleString()
|
|
2203
2251
|
})
|
|
2204
2252
|
});
|
|
2205
|
-
})() : /* @__PURE__ */
|
|
2253
|
+
})() : /* @__PURE__ */ b("p", {
|
|
2206
2254
|
"data-testid": "bed-geometry-notice-bed-layout",
|
|
2207
2255
|
className: "rounded-md border border-border-subtle bg-bg-sunken/60 px-3 py-2 text-xs text-text-secondary",
|
|
2208
|
-
children: e(
|
|
2256
|
+
children: e(Se.key, Se.defaultValue, { type: ci })
|
|
2209
2257
|
})]
|
|
2210
2258
|
})
|
|
2211
2259
|
}),
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
open:
|
|
2214
|
-
onClose: () =>
|
|
2260
|
+
/* @__PURE__ */ b(oe, {
|
|
2261
|
+
open: B !== null,
|
|
2262
|
+
onClose: () => Yn(null),
|
|
2215
2263
|
title: e("healthybowl.fieldMapPage.elements.save.title", "Save map element"),
|
|
2216
2264
|
description: e("healthybowl.fieldMapPage.elements.save.description", "Name the element you just drew. It will show on the map with its type styling."),
|
|
2217
|
-
footer: /* @__PURE__ */
|
|
2265
|
+
footer: /* @__PURE__ */ x($e, { children: [/* @__PURE__ */ b(S, {
|
|
2218
2266
|
variant: "outline",
|
|
2219
|
-
onClick: () =>
|
|
2267
|
+
onClick: () => Yn(null),
|
|
2220
2268
|
className: "text-text-secondary",
|
|
2221
2269
|
children: e("healthybowl.common.cancel", "Cancel")
|
|
2222
|
-
}), /* @__PURE__ */
|
|
2223
|
-
onClick:
|
|
2224
|
-
disabled:
|
|
2225
|
-
children:
|
|
2270
|
+
}), /* @__PURE__ */ b(S, {
|
|
2271
|
+
onClick: Yi,
|
|
2272
|
+
disabled: er,
|
|
2273
|
+
children: er ? e("healthybowl.fieldMapPage.elements.save.saving", "Saving…") : e("healthybowl.fieldMapPage.elements.save.action", "Save element")
|
|
2226
2274
|
})] }),
|
|
2227
|
-
children: /* @__PURE__ */
|
|
2275
|
+
children: /* @__PURE__ */ x("div", {
|
|
2228
2276
|
className: "space-y-4",
|
|
2229
2277
|
children: [
|
|
2230
|
-
Q && /* @__PURE__ */
|
|
2278
|
+
Q && /* @__PURE__ */ x("div", {
|
|
2231
2279
|
className: "flex items-center gap-2 rounded-md bg-success/10 px-3 py-2 text-sm text-text-primary",
|
|
2232
|
-
children: [/* @__PURE__ */
|
|
2280
|
+
children: [/* @__PURE__ */ b(Q.icon, {
|
|
2233
2281
|
className: "h-4 w-4 shrink-0",
|
|
2234
2282
|
style: { color: Q.color }
|
|
2235
2283
|
}), e("healthybowl.fieldMapPage.elements.save.typeLine", "Type: {{type}}", { type: e(Q.labelKey, Q.label) })]
|
|
2236
2284
|
}),
|
|
2237
|
-
Q?.hint && /* @__PURE__ */
|
|
2285
|
+
Q?.hint && /* @__PURE__ */ b("p", {
|
|
2238
2286
|
className: "text-xs text-text-secondary",
|
|
2239
|
-
children: e(Q.hint.key, Q.hint.defaultValue, { type: Q.promotesTo ?
|
|
2287
|
+
children: e(Q.hint.key, Q.hint.defaultValue, { type: Q.promotesTo ? u(e, Q.promotesTo) : "" })
|
|
2240
2288
|
}),
|
|
2241
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2242
2290
|
className: "text-sm font-medium text-text-primary",
|
|
2243
2291
|
children: e("healthybowl.fieldMapPage.elements.save.name", "Name *")
|
|
2244
|
-
}), /* @__PURE__ */
|
|
2292
|
+
}), /* @__PURE__ */ b("input", {
|
|
2245
2293
|
type: "text",
|
|
2246
|
-
value:
|
|
2247
|
-
onChange: (e) =>
|
|
2294
|
+
value: Xn,
|
|
2295
|
+
onChange: (e) => Zn(e.target.value),
|
|
2248
2296
|
placeholder: e("healthybowl.fieldMapPage.elements.save.namePlaceholder", "e.g., North buffer strip"),
|
|
2249
2297
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
2250
2298
|
})] }),
|
|
2251
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
2252
2300
|
className: "text-sm font-medium text-text-primary",
|
|
2253
2301
|
children: e("healthybowl.fieldMapPage.elements.save.notes", "Notes")
|
|
2254
|
-
}), /* @__PURE__ */
|
|
2255
|
-
value:
|
|
2256
|
-
onChange: (e) =>
|
|
2302
|
+
}), /* @__PURE__ */ b("textarea", {
|
|
2303
|
+
value: Qn,
|
|
2304
|
+
onChange: (e) => $n(e.target.value),
|
|
2257
2305
|
rows: 3,
|
|
2258
2306
|
placeholder: e("healthybowl.fieldMapPage.elements.save.notesPlaceholder", "Optional details…"),
|
|
2259
2307
|
className: "mt-1 w-full resize-y rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
@@ -2261,76 +2309,76 @@ var ht = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/Map
|
|
|
2261
2309
|
]
|
|
2262
2310
|
})
|
|
2263
2311
|
}),
|
|
2264
|
-
/* @__PURE__ */
|
|
2265
|
-
open:
|
|
2266
|
-
onClose: () =>
|
|
2267
|
-
title:
|
|
2268
|
-
description: $ ? e($.labelKey, $.label) :
|
|
2269
|
-
footer: /* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ b(oe, {
|
|
2313
|
+
open: V !== null,
|
|
2314
|
+
onClose: () => nr(null),
|
|
2315
|
+
title: V?.name ?? e("healthybowl.fieldMapPage.elements.detail.title", "Map element"),
|
|
2316
|
+
description: $ ? e($.labelKey, $.label) : V?.type ?? "",
|
|
2317
|
+
footer: /* @__PURE__ */ x($e, { children: [
|
|
2318
|
+
/* @__PURE__ */ b(S, {
|
|
2271
2319
|
variant: "outline",
|
|
2272
|
-
onClick: () =>
|
|
2320
|
+
onClick: () => nr(null),
|
|
2273
2321
|
className: "text-text-secondary",
|
|
2274
2322
|
children: e("healthybowl.common.close", "Close")
|
|
2275
2323
|
}),
|
|
2276
|
-
|
|
2324
|
+
Qi && $?.promotesTo && /* @__PURE__ */ x(S, {
|
|
2277
2325
|
variant: "default",
|
|
2278
|
-
onClick:
|
|
2326
|
+
onClick: $i,
|
|
2279
2327
|
children: [
|
|
2280
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ b(Ve, { className: "h-4 w-4" }),
|
|
2281
2329
|
" ",
|
|
2282
|
-
e("healthybowl.fieldMapPage.elements.detail.promote", "Create a {{type}} field", { type:
|
|
2330
|
+
e("healthybowl.fieldMapPage.elements.detail.promote", "Create a {{type}} field", { type: u(e, $.promotesTo).toLowerCase() })
|
|
2283
2331
|
]
|
|
2284
2332
|
}),
|
|
2285
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ x(S, {
|
|
2286
2334
|
variant: "destructive",
|
|
2287
|
-
onClick:
|
|
2288
|
-
disabled:
|
|
2335
|
+
onClick: Xi,
|
|
2336
|
+
disabled: rr,
|
|
2289
2337
|
children: [
|
|
2290
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ b(qe, { className: "h-4 w-4" }),
|
|
2291
2339
|
" ",
|
|
2292
|
-
|
|
2340
|
+
rr ? e("healthybowl.fieldMapPage.elements.detail.deleting", "Deleting…") : e("healthybowl.common.delete", "Delete")
|
|
2293
2341
|
]
|
|
2294
2342
|
})
|
|
2295
2343
|
] }),
|
|
2296
|
-
children: /* @__PURE__ */
|
|
2344
|
+
children: /* @__PURE__ */ x("div", {
|
|
2297
2345
|
className: "space-y-3 text-sm",
|
|
2298
2346
|
children: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ x("div", {
|
|
2300
2348
|
className: "flex justify-between gap-3",
|
|
2301
|
-
children: [/* @__PURE__ */
|
|
2349
|
+
children: [/* @__PURE__ */ b("span", {
|
|
2302
2350
|
className: "text-text-secondary",
|
|
2303
2351
|
children: e("healthybowl.fieldMapPage.elements.detail.type", "Type")
|
|
2304
|
-
}), /* @__PURE__ */
|
|
2352
|
+
}), /* @__PURE__ */ x("span", {
|
|
2305
2353
|
className: "flex items-center gap-1.5 font-medium text-text-primary",
|
|
2306
|
-
children: [$ && /* @__PURE__ */
|
|
2354
|
+
children: [$ && /* @__PURE__ */ b($.icon, {
|
|
2307
2355
|
className: "h-4 w-4",
|
|
2308
2356
|
style: { color: $.color }
|
|
2309
|
-
}), $ ? e($.labelKey, $.label) :
|
|
2357
|
+
}), $ ? e($.labelKey, $.label) : V?.type]
|
|
2310
2358
|
})]
|
|
2311
2359
|
}),
|
|
2312
|
-
$?.hint && /* @__PURE__ */
|
|
2360
|
+
$?.hint && /* @__PURE__ */ b("div", {
|
|
2313
2361
|
className: "rounded-md bg-warning/10 px-3 py-2 text-xs text-text-secondary",
|
|
2314
|
-
children: e($.hint.key, $.hint.defaultValue, { type: $.promotesTo ?
|
|
2362
|
+
children: e($.hint.key, $.hint.defaultValue, { type: $.promotesTo ? u(e, $.promotesTo) : "" })
|
|
2315
2363
|
}),
|
|
2316
|
-
|
|
2364
|
+
V?.notes && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
|
|
2317
2365
|
className: "text-text-secondary",
|
|
2318
2366
|
children: e("healthybowl.fieldMapPage.elements.detail.notes", "Notes")
|
|
2319
|
-
}), /* @__PURE__ */
|
|
2367
|
+
}), /* @__PURE__ */ b("p", {
|
|
2320
2368
|
className: "mt-1 whitespace-pre-wrap text-text-primary",
|
|
2321
|
-
children:
|
|
2369
|
+
children: V.notes
|
|
2322
2370
|
})] })
|
|
2323
2371
|
]
|
|
2324
2372
|
})
|
|
2325
2373
|
}),
|
|
2326
|
-
/* @__PURE__ */
|
|
2327
|
-
toasts:
|
|
2328
|
-
onDismiss:
|
|
2374
|
+
/* @__PURE__ */ b(ie, {
|
|
2375
|
+
toasts: Ft,
|
|
2376
|
+
onDismiss: zt
|
|
2329
2377
|
})
|
|
2330
2378
|
]
|
|
2331
2379
|
});
|
|
2332
2380
|
};
|
|
2333
2381
|
//#endregion
|
|
2334
|
-
export {
|
|
2382
|
+
export { O as FieldMapPage };
|
|
2335
2383
|
|
|
2336
2384
|
//# sourceMappingURL=FieldMapPage.js.map
|