@burdenoff/microfe-healthybowl 2026.813.21 → 2026.813.22
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/generated/wspace-operations.js +2 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/healthybowl/components/GrowGeometryInputs.js +109 -0
- package/dist/healthybowl/components/GrowGeometryInputs.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +63 -51
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +517 -432
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +813 -751
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/fields/FieldMapPage.js +549 -536
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/utils/growLocationType.js +19 -8
- package/dist/healthybowl/utils/growLocationType.js.map +1 -1
- package/dist/healthybowl/utils/plantingCapacity.js +73 -17
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,284 +3,299 @@ import { useBasePath as n } from "../../hooks/useBasePath.js";
|
|
|
3
3
|
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
4
4
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
6
|
-
import { ErrorState as
|
|
7
|
-
import { ToastContainer as
|
|
8
|
-
import { useConfirm as
|
|
9
|
-
import { Breadcrumbs as
|
|
10
|
-
import { PageLoader as
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { isUsableCoordinate as
|
|
13
|
-
import { useToast as
|
|
14
|
-
import { FieldMap as
|
|
15
|
-
import { CreateFarmTaskButton as
|
|
6
|
+
import { ErrorState as te } from "../../components/ErrorState.js";
|
|
7
|
+
import { ToastContainer as ne } from "../../components/Toast.js";
|
|
8
|
+
import { useConfirm as re } from "../../components/ConfirmDialog.js";
|
|
9
|
+
import { Breadcrumbs as ie } from "../../components/Breadcrumbs.js";
|
|
10
|
+
import { PageLoader as ae } from "../../components/PageLoader.js";
|
|
11
|
+
import { Modal as oe } from "../../components/Modal.js";
|
|
12
|
+
import { isUsableCoordinate as se } from "../../utils/geo.js";
|
|
13
|
+
import { useToast as ce } from "../../hooks/useToast.js";
|
|
14
|
+
import { FieldMap as le } from "../../components/FieldMap.js";
|
|
15
|
+
import { CreateFarmTaskButton as ue } from "../../components/CreateFarmTaskButton.js";
|
|
16
16
|
import "../../components/index.js";
|
|
17
|
-
import { useHealthyBowlData as
|
|
18
|
-
import { usePlantCatalog as
|
|
19
|
-
import { BED_GEOMETRY_NOTICE as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
17
|
+
import { useHealthyBowlData as de } from "../../hooks/useHealthyBowlData.js";
|
|
18
|
+
import { usePlantCatalog as fe } from "../../hooks/usePlantCatalog.js";
|
|
19
|
+
import { BED_GEOMETRY_NOTICE as pe, DEFAULT_GROW_LOCATION_TYPE as me, GROW_GEOMETRY_PROMPT as he, GROW_LOCATION_TYPE_OPTIONS as ge, capacityModelFor as _e, growLocationTypeLabel as ve, normalizeGrowLocationType as ye, usesBedGeometry as be } from "../../utils/growLocationType.js";
|
|
20
|
+
import { GrowGeometryInputs as xe, geometryForType as Se } from "../../components/GrowGeometryInputs.js";
|
|
21
|
+
import { DEFAULT_BED_WIDTH_M as Ce, DEFAULT_CROP_SPACING_PRESET as we, DEFAULT_PATH_WIDTH_M as Te, estimateGrowCapacity as Ee, estimatePlantingCapacity as De, getCropSpacingPreset as Oe } from "../../utils/plantingCapacity.js";
|
|
22
|
+
import { useSuccessionPlanning as ke } from "../../hooks/useSuccessionPlanning.js";
|
|
23
|
+
import { computeSeedRate as Ae } from "../../utils/seedRate.js";
|
|
24
|
+
import { buildCropComparison as je, sortCropComparison as Me } from "../../utils/cropComparison.js";
|
|
25
|
+
import { BedLayoutGrid as Ne } from "../../components/BedLayoutGrid.js";
|
|
26
|
+
import { useCallback as Pe, useEffect as Fe, useMemo as a, useState as o } from "react";
|
|
27
|
+
import { useI18n as Ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
|
+
import { Activity as Le, ArrowLeft as Re, BarChart3 as ze, Calendar as Be, ChevronDown as s, ChevronUp as Ve, CloudRain as He, Droplets as Ue, Edit as We, Eye as Ge, Leaf as Ke, Map as qe, Plus as Je, ScanSearch as Ye, Sprout as Xe, Sun as Ze, Table2 as Qe, Thermometer as $e, Trash2 as et, TrendingUp as tt, Wind as nt } from "lucide-react";
|
|
29
|
+
import { useNavigate as rt, useParams as it } from "react-router";
|
|
30
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
31
|
+
import { Button as d, GlassCard as at, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "@burdenoff/fe-libs/ui";
|
|
31
32
|
//#region src/healthybowl/pages/crops/FieldDetailsPage.tsx
|
|
32
|
-
var
|
|
33
|
+
var ot = (e) => {
|
|
33
34
|
switch (e) {
|
|
34
35
|
case "active": return "success";
|
|
35
36
|
case "fallow": return "muted";
|
|
36
37
|
case "preparation": return "warning";
|
|
37
38
|
default: return "default";
|
|
38
39
|
}
|
|
39
|
-
},
|
|
40
|
+
}, st = (e) => {
|
|
40
41
|
switch (e) {
|
|
41
42
|
case "optimal": return "success";
|
|
42
43
|
case "acceptable": return "info";
|
|
43
44
|
case "needs_attention": return "warning";
|
|
44
45
|
default: return "error";
|
|
45
46
|
}
|
|
46
|
-
},
|
|
47
|
+
}, _ = (e, t) => {
|
|
47
48
|
let n = Number(e);
|
|
48
49
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
49
|
-
},
|
|
50
|
+
}, ct = (e, t) => {
|
|
50
51
|
let n = Number(e);
|
|
51
52
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
52
|
-
},
|
|
53
|
-
let { t:
|
|
54
|
-
let e =
|
|
53
|
+
}, v = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), lt = () => {
|
|
54
|
+
let { t: s } = Ie(), Ve = re(), { fields: lt, crops: S, soilTests: ut, weatherData: dt, errors: ft, loadings: pt, updateField: mt, deleteField: ht, refetch: gt } = de(), { fieldId: _t } = it(), C = rt(), { buildPath: w } = n(), { toasts: vt, toast: T, dismiss: yt } = ce(), [bt, xt] = o(!1), [St, Ct] = o(!1), E = lt.find((e) => e.id === _t), wt = a(() => {
|
|
55
|
+
let e = E?.location, t = {
|
|
55
56
|
lat: Number(e?.lat),
|
|
56
57
|
lng: Number(e?.lng)
|
|
57
58
|
};
|
|
58
|
-
return
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
if (!
|
|
64
|
-
|
|
65
|
-
title:
|
|
66
|
-
description:
|
|
59
|
+
return se(t) ? t : null;
|
|
60
|
+
}, [E]), [D, Tt] = o(""), [Et, Dt] = o(""), [Ot, kt] = o("acres"), [At, jt] = o(""), [Mt, Nt] = o(""), [Pt, Ft] = o("active"), [O, It] = o(me), [Lt, Rt] = o(!1), [zt, Bt] = o({}), [k, Vt] = o(""), { entries: A } = fe(), [j, Ht] = o(""), [M, N] = o(String(we.plantSpacingCm)), [P, F] = o(String(we.rowSpacingCm)), [I, Ut] = o(String(Ce)), [L, Wt] = o(String(Te)), [R, Gt] = o(null), Kt = () => {
|
|
61
|
+
E && (Tt(E.name), Dt(String(E.area)), kt(E.unit ?? "acres"), jt(E.soilType), Nt(E.irrigationType), Ft(E.status), It(ye(E.type) ?? "OPEN_FIELD"), Rt(E.organicCertified), Bt(E.growGeometry ?? {}), xt(!0));
|
|
62
|
+
}, qt = async () => {
|
|
63
|
+
if (E) {
|
|
64
|
+
if (!D.trim() || !Et) {
|
|
65
|
+
T({
|
|
66
|
+
title: s("healthybowl.crops.fieldDetail.toast.missingFields.title", "Missing required fields"),
|
|
67
|
+
description: s("healthybowl.crops.fieldDetail.toast.missingFields.description", "Name and area are required."),
|
|
67
68
|
variant: "warning"
|
|
68
69
|
});
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
+
Ct(!0);
|
|
72
73
|
try {
|
|
73
|
-
await
|
|
74
|
-
id:
|
|
75
|
-
name:
|
|
76
|
-
area: Number(
|
|
77
|
-
unit:
|
|
78
|
-
soilType:
|
|
79
|
-
irrigationType:
|
|
80
|
-
status:
|
|
81
|
-
type:
|
|
82
|
-
organicCertified:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
await mt({
|
|
75
|
+
id: E.id,
|
|
76
|
+
name: D.trim(),
|
|
77
|
+
area: Number(Et),
|
|
78
|
+
unit: Ot,
|
|
79
|
+
soilType: At.trim() || "Unknown",
|
|
80
|
+
irrigationType: Mt.trim() || "None",
|
|
81
|
+
status: Pt,
|
|
82
|
+
type: O,
|
|
83
|
+
organicCertified: Lt,
|
|
84
|
+
growGeometry: Se(O, zt)
|
|
85
|
+
}), T({
|
|
86
|
+
title: s("healthybowl.crops.fieldDetail.toast.updated.title", "Field updated"),
|
|
87
|
+
description: s("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: D.trim() }),
|
|
86
88
|
variant: "success"
|
|
87
|
-
}),
|
|
89
|
+
}), xt(!1);
|
|
88
90
|
} catch (e) {
|
|
89
|
-
|
|
90
|
-
title:
|
|
91
|
+
T({
|
|
92
|
+
title: s("healthybowl.crops.fieldDetail.toast.updateFailed.title", "Update failed"),
|
|
91
93
|
description: String(e),
|
|
92
94
|
variant: "error"
|
|
93
95
|
});
|
|
94
96
|
} finally {
|
|
95
|
-
|
|
97
|
+
Ct(!1);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
},
|
|
99
|
-
if (
|
|
100
|
-
title:
|
|
101
|
-
message:
|
|
102
|
-
okButtonTitle:
|
|
103
|
-
cancelButtonTitle:
|
|
100
|
+
}, Jt = async () => {
|
|
101
|
+
if (E && await Ve({
|
|
102
|
+
title: s("healthybowl.crops.fieldDetail.deleteConfirm.title", "Delete field?"),
|
|
103
|
+
message: s("healthybowl.crops.fieldDetail.deleteConfirm.message", "{{name}} will be permanently removed.", { name: E.name }),
|
|
104
|
+
okButtonTitle: s("healthybowl.common.delete", "Delete"),
|
|
105
|
+
cancelButtonTitle: s("healthybowl.common.cancel", "Cancel")
|
|
104
106
|
}) !== !1) {
|
|
105
|
-
|
|
107
|
+
Ct(!0);
|
|
106
108
|
try {
|
|
107
|
-
await
|
|
108
|
-
title:
|
|
109
|
-
description:
|
|
109
|
+
await ht(E.id), T({
|
|
110
|
+
title: s("healthybowl.crops.fieldDetail.toast.deleted.title", "Field deleted"),
|
|
111
|
+
description: s("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: E.name }),
|
|
110
112
|
variant: "success"
|
|
111
|
-
}), w(
|
|
113
|
+
}), C(w("crops/fields"));
|
|
112
114
|
} catch (e) {
|
|
113
|
-
|
|
114
|
-
title:
|
|
115
|
+
T({
|
|
116
|
+
title: s("healthybowl.crops.fieldDetail.toast.deleteFailed.title", "Delete failed"),
|
|
115
117
|
description: String(e),
|
|
116
118
|
variant: "error"
|
|
117
|
-
}),
|
|
119
|
+
}), Ct(!1);
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
},
|
|
122
|
+
}, z = a(() => E ? S.filter((e) => e.field === E.id || e.fieldName === E.name) : [], [S, E]), Yt = E ? `${w("pest-management/ai-detection")}?${new URLSearchParams({ fieldId: E.id }).toString()}` : w("pest-management/ai-detection"), B = a(() => {
|
|
121
123
|
let e = /* @__PURE__ */ new Set();
|
|
122
|
-
return [...
|
|
123
|
-
}, [
|
|
124
|
-
j,
|
|
125
|
-
z,
|
|
126
|
-
Wt
|
|
127
|
-
]), V = o(() => Se(B), [B]), H = L != null && L > 0 ? L : k?.area ?? 0, Gt = L != null && L > 0, U = _e(k?.type), Kt = he(c, k?.type), W = o(() => !k || !U ? null : xe({
|
|
128
|
-
fieldArea: H,
|
|
129
|
-
fieldUnit: k.unit,
|
|
130
|
-
bedWidthM: v(F, ve),
|
|
131
|
-
pathWidthM: nt(I, be),
|
|
132
|
-
plantSpacingCm: v(Pt, V.plantSpacingCm),
|
|
133
|
-
rowSpacingCm: v(It, V.rowSpacingCm)
|
|
134
|
-
}), [
|
|
135
|
-
U,
|
|
136
|
-
F,
|
|
137
|
-
H,
|
|
124
|
+
return [...z, ...S].filter((t) => !e.has(t.id) && !!e.add(t.id));
|
|
125
|
+
}, [S, z]), Xt = a(() => z[0] ?? B[0] ?? null, [B, z]), V = a(() => B.find((e) => e.id === k) ?? Xt, [
|
|
138
126
|
k,
|
|
127
|
+
B,
|
|
128
|
+
Xt
|
|
129
|
+
]), H = a(() => Oe(V), [V]), U = R != null && R > 0 ? R : E?.area ?? 0, Zt = R != null && R > 0, W = be(E?.type), Qt = ve(s, E?.type), G = a(() => !E || !W ? null : De({
|
|
130
|
+
fieldArea: U,
|
|
131
|
+
fieldUnit: E.unit,
|
|
132
|
+
bedWidthM: _(I, Ce),
|
|
133
|
+
pathWidthM: ct(L, Te),
|
|
134
|
+
plantSpacingCm: _(M, H.plantSpacingCm),
|
|
135
|
+
rowSpacingCm: _(P, H.rowSpacingCm)
|
|
136
|
+
}), [
|
|
137
|
+
W,
|
|
139
138
|
I,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
139
|
+
U,
|
|
140
|
+
E,
|
|
141
|
+
L,
|
|
142
|
+
M,
|
|
143
|
+
P,
|
|
144
|
+
H
|
|
145
|
+
]), K = a(() => E ? Ee({
|
|
146
|
+
type: E.type,
|
|
147
|
+
geometry: E.growGeometry,
|
|
148
|
+
fieldArea: U,
|
|
149
|
+
fieldUnit: E.unit,
|
|
150
|
+
plantSpacingCm: _(M, H.plantSpacingCm),
|
|
151
|
+
rowSpacingCm: _(P, H.rowSpacingCm)
|
|
152
|
+
}) : null, [
|
|
153
|
+
E,
|
|
154
|
+
U,
|
|
155
|
+
M,
|
|
156
|
+
P,
|
|
157
|
+
H
|
|
158
|
+
]), $t = !W && _e(E?.type) !== "NONE" && K === null;
|
|
159
|
+
Fe(() => {
|
|
160
|
+
if (!V || k === V.id) return;
|
|
161
|
+
let e = Oe(V);
|
|
162
|
+
Vt(V.id), N(String(e.plantSpacingCm)), F(String(e.rowSpacingCm));
|
|
163
|
+
}, [k, V]);
|
|
164
|
+
let en = (e) => {
|
|
165
|
+
let t = B.find((t) => t.id === e);
|
|
166
|
+
Vt(e), Ht("");
|
|
167
|
+
let n = Oe(t);
|
|
168
|
+
N(String(n.plantSpacingCm)), F(String(n.rowSpacingCm));
|
|
169
|
+
}, tn = (e) => {
|
|
170
|
+
if (Ht(e), e === "none") {
|
|
171
|
+
Ht("");
|
|
157
172
|
return;
|
|
158
173
|
}
|
|
159
|
-
let t =
|
|
160
|
-
t && (t.plantSpacingCm != null &&
|
|
161
|
-
},
|
|
162
|
-
let e =
|
|
174
|
+
let t = A.find((t) => t.id === e);
|
|
175
|
+
t && (t.plantSpacingCm != null && N(String(t.plantSpacingCm)), t.rowSpacingCm != null && F(String(t.rowSpacingCm)));
|
|
176
|
+
}, q = a(() => {
|
|
177
|
+
let e = j ? A.find((e) => e.id === j) : void 0;
|
|
163
178
|
if (e) return e;
|
|
164
|
-
if (!
|
|
165
|
-
let t = (
|
|
179
|
+
if (!V) return;
|
|
180
|
+
let t = (V.name ?? "").trim().toLowerCase();
|
|
166
181
|
if (!t) return;
|
|
167
|
-
let n = (
|
|
168
|
-
return
|
|
182
|
+
let n = (V.variety ?? "").trim().toLowerCase();
|
|
183
|
+
return A.find((e) => (e.name ?? "").trim().toLowerCase() === t && (e.variety ?? "").trim().toLowerCase() === n) ?? A.find((e) => (e.name ?? "").trim().toLowerCase() === t);
|
|
169
184
|
}, [
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
]),
|
|
174
|
-
plantsNeeded:
|
|
175
|
-
seedsPerGram:
|
|
176
|
-
germinationRate:
|
|
177
|
-
seedsPerCell:
|
|
178
|
-
}) : null, [
|
|
179
|
-
fieldArea:
|
|
180
|
-
fieldUnit:
|
|
181
|
-
bedWidthM:
|
|
182
|
-
pathWidthM:
|
|
185
|
+
j,
|
|
186
|
+
A,
|
|
187
|
+
V
|
|
188
|
+
]), J = a(() => G ? Ae({
|
|
189
|
+
plantsNeeded: G.totalPlants,
|
|
190
|
+
seedsPerGram: q?.seedsPerGram,
|
|
191
|
+
germinationRate: q?.germinationRate,
|
|
192
|
+
seedsPerCell: q?.seedsPerCell
|
|
193
|
+
}) : null, [G, q]), [Y, nn] = o("label"), [X, rn] = o("asc"), an = a(() => !E || !W || A.length === 0 ? [] : je(A, {
|
|
194
|
+
fieldArea: U,
|
|
195
|
+
fieldUnit: E.unit,
|
|
196
|
+
bedWidthM: _(I, Ce),
|
|
197
|
+
pathWidthM: ct(L, Te)
|
|
183
198
|
}), [
|
|
184
|
-
|
|
185
|
-
F,
|
|
186
|
-
H,
|
|
187
|
-
k,
|
|
199
|
+
W,
|
|
188
200
|
I,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
U,
|
|
202
|
+
E,
|
|
203
|
+
L,
|
|
204
|
+
A
|
|
205
|
+
]), on = a(() => Me(an, Y, X), [
|
|
206
|
+
an,
|
|
207
|
+
Y,
|
|
208
|
+
X
|
|
209
|
+
]), Z = Pe((e) => {
|
|
210
|
+
if (e === Y) {
|
|
211
|
+
rn((e) => e === "asc" ? "desc" : "asc");
|
|
197
212
|
return;
|
|
198
213
|
}
|
|
199
|
-
|
|
200
|
-
}, [
|
|
214
|
+
nn(e), rn(e === "label" ? "asc" : "desc");
|
|
215
|
+
}, [Y]), { successionPlans: sn, beds: cn, createSuccession: ln, deletePlan: un } = ke(E?.id), [dn, fn] = o(() => (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [pn, mn] = o("14"), [hn, gn] = o("4"), [_n, vn] = o(""), [yn, bn] = o(!1), xn = a(() => {
|
|
201
216
|
let e = /* @__PURE__ */ new Map();
|
|
202
|
-
for (let t of
|
|
217
|
+
for (let t of sn) {
|
|
203
218
|
let n = String(t.successionGroupId), r = e.get(n);
|
|
204
219
|
r ? r.push(t) : e.set(n, [t]);
|
|
205
220
|
}
|
|
206
221
|
return Array.from(e.entries());
|
|
207
|
-
}, [
|
|
208
|
-
let t = e.cropId ?
|
|
222
|
+
}, [sn]), Sn = Pe((e) => {
|
|
223
|
+
let t = e.cropId ? S.find((t) => t.id === e.cropId) : void 0;
|
|
209
224
|
if (t) return t.variety ? `${t.name} - ${t.variety}` : t.name;
|
|
210
|
-
let n = e.plantCatalogId ?
|
|
225
|
+
let n = e.plantCatalogId ? A.find((t) => t.id === e.plantCatalogId) : void 0;
|
|
211
226
|
if (n?.name?.trim()) return n.variety ? `${n.name} - ${n.variety}` : n.name;
|
|
212
227
|
let r = e.cropName?.trim();
|
|
213
228
|
if (r && !/^unknown(\s+crop)?$/i.test(r)) return r;
|
|
214
|
-
let i =
|
|
229
|
+
let i = z[0];
|
|
215
230
|
return i ? i.variety ? `${i.name} - ${i.variety}` : i.name : "—";
|
|
216
231
|
}, [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
]),
|
|
221
|
-
if (!
|
|
222
|
-
let e = Number(
|
|
223
|
-
if (!
|
|
224
|
-
|
|
225
|
-
title:
|
|
226
|
-
description:
|
|
232
|
+
S,
|
|
233
|
+
A,
|
|
234
|
+
z
|
|
235
|
+
]), Cn = async () => {
|
|
236
|
+
if (!E) return;
|
|
237
|
+
let e = Number(pn), t = Number(hn);
|
|
238
|
+
if (!dn || !Number.isFinite(e) || e < 1 || !Number.isFinite(t) || t < 1) {
|
|
239
|
+
T({
|
|
240
|
+
title: s("healthybowl.crops.fieldDetail.succession.toast.invalid.title", "Check the schedule inputs"),
|
|
241
|
+
description: s("healthybowl.crops.fieldDetail.succession.toast.invalid.description", "A start date, an interval of at least 1 day and at least 1 sowing are required."),
|
|
227
242
|
variant: "warning"
|
|
228
243
|
});
|
|
229
244
|
return;
|
|
230
245
|
}
|
|
231
|
-
|
|
246
|
+
bn(!0);
|
|
232
247
|
try {
|
|
233
|
-
let n = await
|
|
234
|
-
fieldId:
|
|
235
|
-
bedId:
|
|
236
|
-
cropId:
|
|
237
|
-
plantCatalogId:
|
|
238
|
-
season:
|
|
239
|
-
year: new Date(
|
|
240
|
-
startDate:
|
|
248
|
+
let n = await ln({
|
|
249
|
+
fieldId: E.id,
|
|
250
|
+
bedId: _n || void 0,
|
|
251
|
+
cropId: V?.id ?? void 0,
|
|
252
|
+
plantCatalogId: j || void 0,
|
|
253
|
+
season: V?.season ? V.season.toUpperCase() : void 0,
|
|
254
|
+
year: new Date(dn).getFullYear(),
|
|
255
|
+
startDate: dn,
|
|
241
256
|
intervalDays: e,
|
|
242
257
|
count: t,
|
|
243
|
-
plantsNeeded:
|
|
244
|
-
seedGrams:
|
|
245
|
-
seedlingsToRaise:
|
|
246
|
-
density:
|
|
258
|
+
plantsNeeded: G?.totalPlants,
|
|
259
|
+
seedGrams: J?.seedGrams ?? void 0,
|
|
260
|
+
seedlingsToRaise: J?.seedlingsToRaise,
|
|
261
|
+
density: G?.densityPlantsPerSqm
|
|
247
262
|
});
|
|
248
|
-
|
|
249
|
-
title:
|
|
250
|
-
description:
|
|
263
|
+
T({
|
|
264
|
+
title: s("healthybowl.crops.fieldDetail.succession.toast.created.title", "Succession schedule created"),
|
|
265
|
+
description: s("healthybowl.crops.fieldDetail.succession.toast.created.description", "{{count}} sowings scheduled.", { count: n.length || t }),
|
|
251
266
|
variant: "success"
|
|
252
267
|
});
|
|
253
268
|
} catch (e) {
|
|
254
|
-
|
|
255
|
-
title:
|
|
269
|
+
T({
|
|
270
|
+
title: s("healthybowl.crops.fieldDetail.succession.toast.failed.title", "Could not create schedule"),
|
|
256
271
|
description: e instanceof Error ? e.message : String(e),
|
|
257
272
|
variant: "error"
|
|
258
273
|
});
|
|
259
274
|
} finally {
|
|
260
|
-
|
|
275
|
+
bn(!1);
|
|
261
276
|
}
|
|
262
|
-
},
|
|
263
|
-
if (await
|
|
264
|
-
title:
|
|
265
|
-
message:
|
|
266
|
-
okButtonTitle:
|
|
267
|
-
cancelButtonTitle:
|
|
277
|
+
}, wn = async (e) => {
|
|
278
|
+
if (await Ve({
|
|
279
|
+
title: s("healthybowl.crops.fieldDetail.succession.deleteConfirm.title", "Delete this sowing?"),
|
|
280
|
+
message: s("healthybowl.crops.fieldDetail.succession.deleteConfirm.message", "This sowing will be permanently removed from the schedule."),
|
|
281
|
+
okButtonTitle: s("healthybowl.common.delete", "Delete"),
|
|
282
|
+
cancelButtonTitle: s("healthybowl.common.cancel", "Cancel")
|
|
268
283
|
}) !== !1) try {
|
|
269
|
-
await
|
|
270
|
-
title:
|
|
271
|
-
description:
|
|
284
|
+
await un(e.id), T({
|
|
285
|
+
title: s("healthybowl.crops.fieldDetail.succession.toast.deleted.title", "Sowing removed"),
|
|
286
|
+
description: s("healthybowl.crops.fieldDetail.succession.toast.deleted.description", "The sowing was deleted."),
|
|
272
287
|
variant: "success"
|
|
273
288
|
});
|
|
274
289
|
} catch (e) {
|
|
275
|
-
|
|
276
|
-
title:
|
|
290
|
+
T({
|
|
291
|
+
title: s("healthybowl.crops.fieldDetail.succession.toast.deleteFailed.title", "Could not delete sowing"),
|
|
277
292
|
description: e instanceof Error ? e.message : String(e),
|
|
278
293
|
variant: "error"
|
|
279
294
|
});
|
|
280
295
|
}
|
|
281
|
-
}, Q =
|
|
282
|
-
location:
|
|
283
|
-
current:
|
|
296
|
+
}, Q = E ? ut.find((e) => e.fieldName === E.name) : void 0, $ = {
|
|
297
|
+
location: dt?.location ?? "",
|
|
298
|
+
current: dt?.current ?? {
|
|
284
299
|
temperature: 0,
|
|
285
300
|
condition: "N/A",
|
|
286
301
|
feelsLike: 0,
|
|
@@ -290,94 +305,94 @@ var et = (e) => {
|
|
|
290
305
|
pressure: 0,
|
|
291
306
|
visibility: 0
|
|
292
307
|
},
|
|
293
|
-
forecast:
|
|
294
|
-
},
|
|
308
|
+
forecast: dt?.forecast ?? []
|
|
309
|
+
}, Tn = a(() => {
|
|
295
310
|
let e = [];
|
|
296
|
-
return
|
|
311
|
+
return z.forEach((t) => {
|
|
297
312
|
t.plantingDate && e.push({
|
|
298
313
|
date: t.plantingDate,
|
|
299
|
-
action:
|
|
314
|
+
action: s("healthybowl.crops.fieldDetail.timeline.planted", "{{name}} ({{variety}}) planted", {
|
|
300
315
|
name: t.name,
|
|
301
316
|
variety: t.variety
|
|
302
317
|
}),
|
|
303
318
|
type: "planting"
|
|
304
319
|
}), t.expectedHarvestDate && e.push({
|
|
305
320
|
date: t.expectedHarvestDate,
|
|
306
|
-
action:
|
|
321
|
+
action: s("healthybowl.crops.fieldDetail.timeline.expectedHarvest", "{{name}} expected harvest", { name: t.name }),
|
|
307
322
|
type: "harvest"
|
|
308
323
|
});
|
|
309
324
|
}), Q && e.push({
|
|
310
325
|
date: Q.date,
|
|
311
|
-
action:
|
|
326
|
+
action: s("healthybowl.crops.fieldDetail.timeline.soilTestConducted", "Soil test conducted"),
|
|
312
327
|
type: "testing"
|
|
313
328
|
}), e.sort((e, t) => new Date(t.date).getTime() - new Date(e.date).getTime()), e.length === 0 ? [{
|
|
314
329
|
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
315
|
-
action:
|
|
330
|
+
action: s("healthybowl.crops.fieldDetail.timeline.noActivity", "No activity recorded yet"),
|
|
316
331
|
type: "info"
|
|
317
332
|
}] : e.slice(0, 5);
|
|
318
333
|
}, [
|
|
319
|
-
|
|
334
|
+
z,
|
|
320
335
|
Q,
|
|
321
|
-
|
|
322
|
-
]),
|
|
323
|
-
season:
|
|
324
|
-
crop:
|
|
336
|
+
s
|
|
337
|
+
]), En = a(() => z.length === 0 ? [{
|
|
338
|
+
season: s("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
|
|
339
|
+
crop: s("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
|
|
325
340
|
status: "fallow"
|
|
326
|
-
}] :
|
|
341
|
+
}] : z.map((e) => ({
|
|
327
342
|
season: `${e.season.charAt(0).toUpperCase() + e.season.slice(1)} - ${e.plantingDate ? new Date(e.plantingDate).getFullYear() : "N/A"}`,
|
|
328
343
|
crop: `${e.name} (${e.variety})`,
|
|
329
344
|
status: e.status === "harvested" ? "completed" : "active"
|
|
330
|
-
})), [
|
|
331
|
-
return
|
|
332
|
-
title:
|
|
333
|
-
description:
|
|
334
|
-
area:
|
|
335
|
-
unit:
|
|
336
|
-
soilType:
|
|
345
|
+
})), [z, s]);
|
|
346
|
+
return E ? /* @__PURE__ */ u(r, {
|
|
347
|
+
title: E.name,
|
|
348
|
+
description: s("healthybowl.crops.fieldDetail.header.description", "{{area}} {{unit}} - {{soilType}}", {
|
|
349
|
+
area: E.area,
|
|
350
|
+
unit: E.unit,
|
|
351
|
+
soilType: E.soilType
|
|
337
352
|
}),
|
|
338
|
-
actions: /* @__PURE__ */
|
|
353
|
+
actions: /* @__PURE__ */ u("div", {
|
|
339
354
|
className: "flex items-center gap-2",
|
|
340
355
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ l(ue, {
|
|
342
357
|
entityType: "FIELD",
|
|
343
|
-
entityId:
|
|
344
|
-
entityLabel:
|
|
358
|
+
entityId: E.id,
|
|
359
|
+
entityLabel: E.name
|
|
345
360
|
}),
|
|
346
|
-
/* @__PURE__ */ d
|
|
361
|
+
/* @__PURE__ */ u(d, {
|
|
347
362
|
variant: "outline",
|
|
348
|
-
onClick: () =>
|
|
363
|
+
onClick: () => C(Yt),
|
|
349
364
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ l(Ye, { className: "h-4 w-4" }),
|
|
351
366
|
" ",
|
|
352
|
-
|
|
367
|
+
s("healthybowl.crops.fieldDetail.actions.diagnose", "Diagnose")
|
|
353
368
|
]
|
|
354
369
|
}),
|
|
355
|
-
/* @__PURE__ */ d
|
|
370
|
+
/* @__PURE__ */ u(d, {
|
|
356
371
|
variant: "outline",
|
|
357
|
-
onClick: () => w(
|
|
372
|
+
onClick: () => C(w("crops/fields")),
|
|
358
373
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ l(Re, { className: "h-4 w-4" }),
|
|
360
375
|
" ",
|
|
361
|
-
|
|
376
|
+
s("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
362
377
|
]
|
|
363
378
|
}),
|
|
364
|
-
/* @__PURE__ */ d
|
|
379
|
+
/* @__PURE__ */ u(d, {
|
|
365
380
|
variant: "outline",
|
|
366
|
-
onClick:
|
|
381
|
+
onClick: Kt,
|
|
367
382
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ l(We, { className: "h-4 w-4" }),
|
|
369
384
|
" ",
|
|
370
|
-
|
|
385
|
+
s("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
|
|
371
386
|
]
|
|
372
387
|
}),
|
|
373
|
-
/* @__PURE__ */ d
|
|
388
|
+
/* @__PURE__ */ u(d, {
|
|
374
389
|
variant: "destructive",
|
|
375
|
-
onClick:
|
|
376
|
-
disabled:
|
|
390
|
+
onClick: Jt,
|
|
391
|
+
disabled: St,
|
|
377
392
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ l(et, { className: "h-4 w-4" }),
|
|
379
394
|
" ",
|
|
380
|
-
|
|
395
|
+
s("healthybowl.common.delete", "Delete")
|
|
381
396
|
]
|
|
382
397
|
})
|
|
383
398
|
]
|
|
@@ -386,455 +401,492 @@ var et = (e) => {
|
|
|
386
401
|
nextSteps: [
|
|
387
402
|
{
|
|
388
403
|
id: "diagnose",
|
|
389
|
-
label:
|
|
390
|
-
description:
|
|
391
|
-
href:
|
|
404
|
+
label: s("healthybowl.crops.fieldDetail.nextSteps.diagnose.label", "Diagnose a plant in this field"),
|
|
405
|
+
description: s("healthybowl.crops.fieldDetail.nextSteps.diagnose.desc", "Upload a plant photo and check for pest or disease symptoms in this field."),
|
|
406
|
+
href: Yt
|
|
392
407
|
},
|
|
393
408
|
{
|
|
394
409
|
id: "edit",
|
|
395
|
-
label:
|
|
396
|
-
description:
|
|
397
|
-
onClick:
|
|
410
|
+
label: s("healthybowl.crops.fieldDetail.nextSteps.edit.label", "Update field details"),
|
|
411
|
+
description: s("healthybowl.crops.fieldDetail.nextSteps.edit.desc", "Keep area, soil type and irrigation info current."),
|
|
412
|
+
onClick: Kt
|
|
398
413
|
},
|
|
399
414
|
{
|
|
400
415
|
id: "soil",
|
|
401
|
-
label:
|
|
402
|
-
description:
|
|
403
|
-
href:
|
|
416
|
+
label: s("healthybowl.crops.fieldDetail.nextSteps.soil.label", "Run a soil test"),
|
|
417
|
+
description: s("healthybowl.crops.fieldDetail.nextSteps.soil.desc", "Check fertility before you plant or fertilise this field."),
|
|
418
|
+
href: w("soil/tests")
|
|
404
419
|
},
|
|
405
420
|
{
|
|
406
421
|
id: "plan",
|
|
407
|
-
label:
|
|
408
|
-
description:
|
|
409
|
-
href:
|
|
422
|
+
label: s("healthybowl.crops.fieldDetail.nextSteps.plan.label", "Plan what to plant here"),
|
|
423
|
+
description: s("healthybowl.crops.fieldDetail.nextSteps.plan.desc", "Add a planting plan so this field is working toward your goals."),
|
|
424
|
+
href: w("crops/planning")
|
|
410
425
|
}
|
|
411
426
|
],
|
|
412
427
|
nextStepsKey: "healthybowl-field-detail",
|
|
413
428
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ l(ie, { items: [
|
|
415
430
|
{
|
|
416
|
-
label:
|
|
417
|
-
href:
|
|
431
|
+
label: s("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
|
|
432
|
+
href: w("crops")
|
|
418
433
|
},
|
|
419
434
|
{
|
|
420
|
-
label:
|
|
421
|
-
href:
|
|
435
|
+
label: s("healthybowl.crops.fieldDetail.breadcrumbs.fields", "Fields"),
|
|
436
|
+
href: w("crops/fields")
|
|
422
437
|
},
|
|
423
|
-
{ label:
|
|
438
|
+
{ label: E.name }
|
|
424
439
|
] }),
|
|
425
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ u("div", {
|
|
426
441
|
className: "flex flex-wrap items-center gap-3",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
428
|
-
label:
|
|
429
|
-
variant:
|
|
442
|
+
children: [/* @__PURE__ */ l(i, {
|
|
443
|
+
label: E.status,
|
|
444
|
+
variant: ot(E.status),
|
|
430
445
|
dot: !0
|
|
431
|
-
}),
|
|
432
|
-
label:
|
|
446
|
+
}), E.organicCertified ? /* @__PURE__ */ l(i, {
|
|
447
|
+
label: s("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
|
|
433
448
|
variant: "success"
|
|
434
|
-
}) : /* @__PURE__ */
|
|
435
|
-
label:
|
|
449
|
+
}) : /* @__PURE__ */ l(i, {
|
|
450
|
+
label: s("healthybowl.crops.fieldDetail.badges.notCertified", "Not Certified"),
|
|
436
451
|
variant: "muted"
|
|
437
452
|
})]
|
|
438
453
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
fieldId:
|
|
441
|
-
crops:
|
|
454
|
+
/* @__PURE__ */ l(Ne, {
|
|
455
|
+
fieldId: E.id,
|
|
456
|
+
crops: z
|
|
442
457
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ u("div", {
|
|
444
459
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
445
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ u("div", {
|
|
446
461
|
className: "space-y-6 lg:col-span-2",
|
|
447
462
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ u(at, {
|
|
449
464
|
treatment: "glass",
|
|
450
465
|
glow: !0,
|
|
451
466
|
className: "border-border-seam p-6",
|
|
452
467
|
children: [
|
|
453
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ l("h3", {
|
|
454
469
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
455
|
-
children:
|
|
470
|
+
children: s("healthybowl.crops.fieldDetail.info.heading", "Field Information")
|
|
456
471
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ u("div", {
|
|
458
473
|
className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
474
|
+
children: [/* @__PURE__ */ u("div", {
|
|
460
475
|
className: "space-y-4",
|
|
461
476
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
463
478
|
className: "text-xs text-text-secondary",
|
|
464
|
-
children:
|
|
465
|
-
}), /* @__PURE__ */
|
|
479
|
+
children: s("healthybowl.crops.fieldDetail.info.fieldName", "Field Name")
|
|
480
|
+
}), /* @__PURE__ */ l("p", {
|
|
466
481
|
className: "text-sm font-semibold text-text-primary",
|
|
467
|
-
children:
|
|
482
|
+
children: E.name
|
|
468
483
|
})] }),
|
|
469
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
470
485
|
className: "text-xs text-text-secondary",
|
|
471
|
-
children:
|
|
472
|
-
}), /* @__PURE__ */
|
|
486
|
+
children: s("healthybowl.crops.fieldDetail.info.area", "Area")
|
|
487
|
+
}), /* @__PURE__ */ u("p", {
|
|
473
488
|
className: "text-sm font-semibold text-text-primary",
|
|
474
489
|
children: [
|
|
475
|
-
|
|
490
|
+
E.area,
|
|
476
491
|
" ",
|
|
477
|
-
|
|
492
|
+
E.unit
|
|
478
493
|
]
|
|
479
494
|
})] }),
|
|
480
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
481
496
|
className: "text-xs text-text-secondary",
|
|
482
|
-
children:
|
|
483
|
-
}), /* @__PURE__ */
|
|
497
|
+
children: s("healthybowl.crops.fieldDetail.info.status", "Status")
|
|
498
|
+
}), /* @__PURE__ */ l("div", {
|
|
484
499
|
className: "mt-1",
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
-
label:
|
|
487
|
-
variant:
|
|
500
|
+
children: /* @__PURE__ */ l(i, {
|
|
501
|
+
label: E.status,
|
|
502
|
+
variant: ot(E.status)
|
|
488
503
|
})
|
|
489
504
|
})] }),
|
|
490
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
491
506
|
className: "text-xs text-text-secondary",
|
|
492
|
-
children:
|
|
493
|
-
}), /* @__PURE__ */
|
|
507
|
+
children: s("healthybowl.crops.fieldDetail.info.type", "Growing Location")
|
|
508
|
+
}), /* @__PURE__ */ l("p", {
|
|
494
509
|
className: "text-sm font-semibold text-text-primary",
|
|
495
|
-
children:
|
|
510
|
+
children: Qt
|
|
496
511
|
})] })
|
|
497
512
|
]
|
|
498
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ u("div", {
|
|
499
514
|
className: "space-y-4",
|
|
500
515
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
502
517
|
className: "text-xs text-text-secondary",
|
|
503
|
-
children:
|
|
504
|
-
}), /* @__PURE__ */
|
|
518
|
+
children: s("healthybowl.crops.fieldDetail.info.soilType", "Soil Type")
|
|
519
|
+
}), /* @__PURE__ */ l("p", {
|
|
505
520
|
className: "text-sm font-semibold text-text-primary",
|
|
506
|
-
children:
|
|
521
|
+
children: E.soilType
|
|
507
522
|
})] }),
|
|
508
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
509
524
|
className: "text-xs text-text-secondary",
|
|
510
|
-
children:
|
|
511
|
-
}), /* @__PURE__ */
|
|
525
|
+
children: s("healthybowl.crops.fieldDetail.info.irrigation", "Irrigation")
|
|
526
|
+
}), /* @__PURE__ */ l("p", {
|
|
512
527
|
className: "text-sm font-semibold text-text-primary",
|
|
513
|
-
children:
|
|
528
|
+
children: E.irrigationType
|
|
514
529
|
})] }),
|
|
515
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
516
531
|
className: "text-xs text-text-secondary",
|
|
517
|
-
children:
|
|
518
|
-
}), /* @__PURE__ */
|
|
532
|
+
children: s("healthybowl.crops.fieldDetail.info.currentCrops", "Current Crops")
|
|
533
|
+
}), /* @__PURE__ */ l("p", {
|
|
519
534
|
className: "text-sm font-semibold text-text-primary",
|
|
520
|
-
children: (
|
|
535
|
+
children: (E.crops ?? []).length > 0 ? (E.crops ?? []).join(", ") : s("healthybowl.crops.fieldDetail.info.noneValue", "None")
|
|
521
536
|
})] })
|
|
522
537
|
]
|
|
523
538
|
})]
|
|
524
539
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ u("div", {
|
|
526
541
|
className: "mt-6 border-t border-border-subtle pt-4",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ l("span", {
|
|
528
543
|
className: "text-xs text-text-secondary",
|
|
529
|
-
children:
|
|
530
|
-
}),
|
|
544
|
+
children: s("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
|
|
545
|
+
}), wt ? /* @__PURE__ */ u("div", {
|
|
531
546
|
className: "mt-1 flex items-center gap-4",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ u("span", {
|
|
533
548
|
className: "text-xs text-text-secondary",
|
|
534
549
|
children: [
|
|
535
|
-
|
|
550
|
+
s("healthybowl.crops.fieldDetail.info.latLabel", "Lat:"),
|
|
536
551
|
" ",
|
|
537
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ l("span", {
|
|
538
553
|
className: "font-mono text-sm text-text-primary",
|
|
539
|
-
children:
|
|
554
|
+
children: wt.lat
|
|
540
555
|
})
|
|
541
556
|
]
|
|
542
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ u("span", {
|
|
543
558
|
className: "text-xs text-text-secondary",
|
|
544
559
|
children: [
|
|
545
|
-
|
|
560
|
+
s("healthybowl.crops.fieldDetail.info.lngLabel", "Lng:"),
|
|
546
561
|
" ",
|
|
547
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ l("span", {
|
|
548
563
|
className: "font-mono text-sm text-text-primary",
|
|
549
|
-
children:
|
|
564
|
+
children: wt.lng
|
|
550
565
|
})
|
|
551
566
|
]
|
|
552
567
|
})]
|
|
553
|
-
}) : /* @__PURE__ */
|
|
568
|
+
}) : /* @__PURE__ */ l("p", {
|
|
554
569
|
className: "mt-1 text-xs text-text-secondary",
|
|
555
|
-
children:
|
|
570
|
+
children: s("healthybowl.crops.fieldDetail.info.noCoordinates", "Not set — draw or import this field’s boundary on the map below.")
|
|
556
571
|
})]
|
|
557
572
|
})
|
|
558
573
|
]
|
|
559
574
|
}),
|
|
560
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ u("div", {
|
|
561
576
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
562
577
|
children: [
|
|
563
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ u("div", {
|
|
564
579
|
className: "mb-4",
|
|
565
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
566
581
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
567
582
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ l(qe, { className: "h-4 w-4 text-success" }),
|
|
569
584
|
" ",
|
|
570
|
-
|
|
585
|
+
s("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
|
|
571
586
|
]
|
|
572
|
-
}), /* @__PURE__ */
|
|
587
|
+
}), /* @__PURE__ */ l("p", {
|
|
573
588
|
className: "mt-1 text-xs text-text-secondary",
|
|
574
|
-
children:
|
|
589
|
+
children: s("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
|
|
575
590
|
})]
|
|
576
591
|
}),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
fieldId:
|
|
579
|
-
unit:
|
|
580
|
-
center:
|
|
581
|
-
initialBoundary:
|
|
582
|
-
onSaved:
|
|
583
|
-
onAreaChange:
|
|
592
|
+
/* @__PURE__ */ l(le, {
|
|
593
|
+
fieldId: E.id,
|
|
594
|
+
unit: E.unit ?? "acres",
|
|
595
|
+
center: E.location,
|
|
596
|
+
initialBoundary: E.boundary,
|
|
597
|
+
onSaved: gt,
|
|
598
|
+
onAreaChange: Gt
|
|
584
599
|
}),
|
|
585
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ u("div", {
|
|
586
601
|
className: "mt-5 border-t border-border-subtle pt-5",
|
|
587
|
-
children: [/* @__PURE__ */
|
|
602
|
+
children: [/* @__PURE__ */ u("div", {
|
|
588
603
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
604
|
+
children: [/* @__PURE__ */ u("h4", {
|
|
590
605
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
591
|
-
children: [
|
|
606
|
+
children: [s("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"), W && Zt && /* @__PURE__ */ l("span", {
|
|
592
607
|
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",
|
|
593
|
-
children:
|
|
608
|
+
children: s("healthybowl.crops.fieldDetail.capacity.fromBoundary", "from drawn boundary")
|
|
594
609
|
})]
|
|
595
|
-
}), /* @__PURE__ */
|
|
596
|
-
label:
|
|
610
|
+
}), /* @__PURE__ */ l(i, {
|
|
611
|
+
label: W ? H.label : Qt,
|
|
597
612
|
variant: "muted"
|
|
598
613
|
})]
|
|
599
|
-
}),
|
|
614
|
+
}), K ? /* @__PURE__ */ u("div", {
|
|
615
|
+
className: "mt-4",
|
|
616
|
+
"data-testid": "grow-capacity-panel",
|
|
617
|
+
"data-model": K.model,
|
|
618
|
+
children: [/* @__PURE__ */ u("div", {
|
|
619
|
+
className: "grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5",
|
|
620
|
+
children: [
|
|
621
|
+
/* @__PURE__ */ l(b, {
|
|
622
|
+
label: K.model === "TREE" ? s("healthybowl.crops.fieldDetail.capacity.metrics.block", "Block") : K.model === "RACK" ? s("healthybowl.crops.fieldDetail.capacity.metrics.racks", "Racks") : s("healthybowl.crops.fieldDetail.capacity.metrics.benches", "Benches"),
|
|
623
|
+
value: t(K.unitCount)
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ l(b, {
|
|
626
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerUnit", "Plants / unit"),
|
|
627
|
+
value: t(K.plantsPerUnit)
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ l(b, {
|
|
630
|
+
label: K.model === "TREE" ? s("healthybowl.crops.fieldDetail.capacity.metrics.totalTrees", "Total trees") : s("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
|
|
631
|
+
value: t(K.totalPlants)
|
|
632
|
+
}),
|
|
633
|
+
K.seedlingTarget != null && /* @__PURE__ */ l(b, {
|
|
634
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
635
|
+
value: t(K.seedlingTarget)
|
|
636
|
+
}),
|
|
637
|
+
/* @__PURE__ */ l(b, {
|
|
638
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.growingArea", "Growing area"),
|
|
639
|
+
value: v(K.usableAreaSqm, 1),
|
|
640
|
+
unit: "m²"
|
|
641
|
+
})
|
|
642
|
+
]
|
|
643
|
+
}), !K.usesSeed && /* @__PURE__ */ l("p", {
|
|
644
|
+
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
645
|
+
children: s("healthybowl.crops.fieldDetail.capacity.saplingsOnly", "Planted from saplings — seed weight and nursery trays do not apply to an orchard.")
|
|
646
|
+
})]
|
|
647
|
+
}) : $t ? /* @__PURE__ */ l("p", {
|
|
648
|
+
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
649
|
+
"data-testid": "grow-geometry-prompt",
|
|
650
|
+
children: s(he.key, he.defaultValue, { type: Qt })
|
|
651
|
+
}) : W ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
|
|
600
652
|
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
601
653
|
children: [
|
|
602
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ u("div", {
|
|
603
655
|
className: "xl:col-span-2",
|
|
604
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ l("label", {
|
|
605
657
|
className: "text-xs font-medium text-text-secondary",
|
|
606
|
-
children:
|
|
607
|
-
}), /* @__PURE__ */
|
|
608
|
-
value:
|
|
609
|
-
onValueChange:
|
|
610
|
-
children: [/* @__PURE__ */
|
|
658
|
+
children: s("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
|
|
659
|
+
}), /* @__PURE__ */ u(f, {
|
|
660
|
+
value: k,
|
|
661
|
+
onValueChange: en,
|
|
662
|
+
children: [/* @__PURE__ */ l(h, {
|
|
611
663
|
className: "mt-1 w-full",
|
|
612
|
-
children: /* @__PURE__ */
|
|
613
|
-
}), /* @__PURE__ */
|
|
664
|
+
children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
|
|
665
|
+
}), /* @__PURE__ */ l(p, { children: B.map((e) => /* @__PURE__ */ l(m, {
|
|
614
666
|
value: e.id,
|
|
615
667
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
616
668
|
}, e.id)) })]
|
|
617
669
|
})]
|
|
618
670
|
}),
|
|
619
|
-
|
|
671
|
+
A.length > 0 && /* @__PURE__ */ u("div", {
|
|
620
672
|
className: "xl:col-span-2",
|
|
621
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ l("label", {
|
|
622
674
|
className: "text-xs font-medium text-text-secondary",
|
|
623
|
-
children:
|
|
624
|
-
}), /* @__PURE__ */
|
|
625
|
-
value:
|
|
626
|
-
onValueChange:
|
|
627
|
-
children: [/* @__PURE__ */
|
|
675
|
+
children: s("healthybowl.crops.fieldDetail.capacity.catalog", "Master Plant List")
|
|
676
|
+
}), /* @__PURE__ */ u(f, {
|
|
677
|
+
value: j || "none",
|
|
678
|
+
onValueChange: tn,
|
|
679
|
+
children: [/* @__PURE__ */ l(h, {
|
|
628
680
|
className: "mt-1 w-full",
|
|
629
|
-
children: /* @__PURE__ */
|
|
630
|
-
}), /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.capacity.catalogPlaceholder", "Fill spacing from catalog") })
|
|
682
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
631
683
|
value: "none",
|
|
632
|
-
children:
|
|
633
|
-
}),
|
|
684
|
+
children: s("healthybowl.crops.fieldDetail.capacity.catalogNone", "None")
|
|
685
|
+
}), A.map((e) => /* @__PURE__ */ l(m, {
|
|
634
686
|
value: e.id,
|
|
635
687
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
636
688
|
}, e.id))] })]
|
|
637
689
|
})]
|
|
638
690
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
label:
|
|
691
|
+
/* @__PURE__ */ l(y, {
|
|
692
|
+
label: s("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
|
|
641
693
|
unit: "cm",
|
|
642
|
-
value:
|
|
694
|
+
value: M,
|
|
643
695
|
min: "1",
|
|
644
696
|
step: "1",
|
|
645
|
-
onChange:
|
|
697
|
+
onChange: N
|
|
646
698
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
label:
|
|
699
|
+
/* @__PURE__ */ l(y, {
|
|
700
|
+
label: s("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
|
|
649
701
|
unit: "cm",
|
|
650
|
-
value:
|
|
702
|
+
value: P,
|
|
651
703
|
min: "1",
|
|
652
704
|
step: "1",
|
|
653
|
-
onChange:
|
|
705
|
+
onChange: F
|
|
654
706
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
label:
|
|
707
|
+
/* @__PURE__ */ l(y, {
|
|
708
|
+
label: s("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
|
|
657
709
|
unit: "m",
|
|
658
|
-
value:
|
|
710
|
+
value: I,
|
|
659
711
|
min: "0.1",
|
|
660
712
|
step: "0.1",
|
|
661
|
-
onChange:
|
|
713
|
+
onChange: Ut
|
|
662
714
|
}),
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
label:
|
|
715
|
+
/* @__PURE__ */ l(y, {
|
|
716
|
+
label: s("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
|
|
665
717
|
unit: "m",
|
|
666
|
-
value:
|
|
718
|
+
value: L,
|
|
667
719
|
min: "0",
|
|
668
720
|
step: "0.05",
|
|
669
|
-
onChange:
|
|
721
|
+
onChange: Wt
|
|
670
722
|
})
|
|
671
723
|
]
|
|
672
|
-
}),
|
|
673
|
-
/* @__PURE__ */
|
|
724
|
+
}), G ? /* @__PURE__ */ u(c, { children: [
|
|
725
|
+
/* @__PURE__ */ u("div", {
|
|
674
726
|
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
|
|
675
727
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
label:
|
|
678
|
-
value: t(
|
|
728
|
+
/* @__PURE__ */ l(b, {
|
|
729
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
|
|
730
|
+
value: t(G.bedCount)
|
|
679
731
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
label:
|
|
682
|
-
value: t(
|
|
732
|
+
/* @__PURE__ */ l(b, {
|
|
733
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
|
|
734
|
+
value: t(G.rowsPerBed)
|
|
683
735
|
}),
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
label:
|
|
686
|
-
value: t(
|
|
736
|
+
/* @__PURE__ */ l(b, {
|
|
737
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
738
|
+
value: t(G.plantsPerBed)
|
|
687
739
|
}),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
label:
|
|
690
|
-
value: t(
|
|
740
|
+
/* @__PURE__ */ l(b, {
|
|
741
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
|
|
742
|
+
value: t(G.totalPlants)
|
|
691
743
|
}),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
label:
|
|
694
|
-
value: t(
|
|
744
|
+
/* @__PURE__ */ l(b, {
|
|
745
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
746
|
+
value: t(G.seedlingTarget)
|
|
695
747
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
label:
|
|
698
|
-
value:
|
|
748
|
+
/* @__PURE__ */ l(b, {
|
|
749
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
|
|
750
|
+
value: v(G.bedLengthM),
|
|
699
751
|
unit: "m"
|
|
700
752
|
}),
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
label:
|
|
703
|
-
value:
|
|
704
|
-
unit:
|
|
753
|
+
/* @__PURE__ */ l(b, {
|
|
754
|
+
label: s("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
|
|
755
|
+
value: v(G.densityPlantsPerSqm, 2),
|
|
756
|
+
unit: s("healthybowl.crops.fieldDetail.capacity.metrics.densityUnit", "plants/m²")
|
|
705
757
|
})
|
|
706
758
|
]
|
|
707
759
|
}),
|
|
708
|
-
|
|
760
|
+
J && /* @__PURE__ */ u("div", {
|
|
709
761
|
className: "mt-5 border-t border-border-subtle pt-4",
|
|
710
762
|
children: [
|
|
711
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ u("h5", {
|
|
712
764
|
className: "mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
713
765
|
children: [
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
|
|
716
|
-
|
|
766
|
+
/* @__PURE__ */ l(Xe, { className: "h-3.5 w-3.5 text-success" }),
|
|
767
|
+
s("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
|
|
768
|
+
q && /* @__PURE__ */ l("span", {
|
|
717
769
|
className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium normal-case text-success",
|
|
718
|
-
children:
|
|
770
|
+
children: s("healthybowl.crops.fieldDetail.seedRate.fromCatalog", "from catalog")
|
|
719
771
|
})
|
|
720
772
|
]
|
|
721
773
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ u("div", {
|
|
723
775
|
className: "grid grid-cols-2 gap-3 md:grid-cols-3",
|
|
724
776
|
children: [
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
label:
|
|
727
|
-
value:
|
|
728
|
-
unit:
|
|
777
|
+
/* @__PURE__ */ l(b, {
|
|
778
|
+
label: s("healthybowl.crops.fieldDetail.seedRate.seedNeeded", "Seed needed"),
|
|
779
|
+
value: J.seedGrams == null ? "—" : v(J.seedGrams, 2),
|
|
780
|
+
unit: J.seedGrams == null ? void 0 : "g"
|
|
729
781
|
}),
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
label:
|
|
732
|
-
value: t(
|
|
782
|
+
/* @__PURE__ */ l(b, {
|
|
783
|
+
label: s("healthybowl.crops.fieldDetail.seedRate.seedlings", "Seedlings to raise"),
|
|
784
|
+
value: t(J.seedlingsToRaise)
|
|
733
785
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
label:
|
|
736
|
-
value:
|
|
786
|
+
/* @__PURE__ */ l(b, {
|
|
787
|
+
label: s("healthybowl.crops.fieldDetail.seedRate.trays", "Trays"),
|
|
788
|
+
value: J.trays == null ? "—" : t(J.trays)
|
|
737
789
|
})
|
|
738
790
|
]
|
|
739
791
|
}),
|
|
740
|
-
|
|
792
|
+
J.seedGrams == null && /* @__PURE__ */ l("p", {
|
|
741
793
|
className: "mt-3 text-xs text-text-secondary",
|
|
742
|
-
children:
|
|
794
|
+
children: s("healthybowl.crops.fieldDetail.seedRate.noSeedsPerGram", "Set “seeds per gram” for this variety in the Master Plant List to calculate seed weight in grams.")
|
|
743
795
|
})
|
|
744
796
|
]
|
|
745
797
|
}),
|
|
746
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ u("div", {
|
|
747
799
|
className: "mt-5 border-t border-border-subtle pt-4",
|
|
748
|
-
children: [/* @__PURE__ */
|
|
800
|
+
children: [/* @__PURE__ */ u("div", {
|
|
749
801
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
750
|
-
children: [/* @__PURE__ */
|
|
802
|
+
children: [/* @__PURE__ */ u("h5", {
|
|
751
803
|
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
752
|
-
children: [/* @__PURE__ */
|
|
753
|
-
}),
|
|
804
|
+
children: [/* @__PURE__ */ l(Qe, { className: "h-3.5 w-3.5 text-success" }), s("healthybowl.crops.fieldDetail.compare.heading", "Compare crops for this field")]
|
|
805
|
+
}), on.length > 0 && /* @__PURE__ */ u("span", {
|
|
754
806
|
className: "text-xs text-text-secondary",
|
|
755
807
|
children: [
|
|
756
|
-
t(
|
|
808
|
+
t(on.length),
|
|
757
809
|
" ",
|
|
758
|
-
|
|
810
|
+
s("healthybowl.crops.fieldDetail.compare.varieties", "varieties")
|
|
759
811
|
]
|
|
760
812
|
})]
|
|
761
|
-
}),
|
|
762
|
-
/* @__PURE__ */
|
|
813
|
+
}), on.length > 0 ? /* @__PURE__ */ u(c, { children: [
|
|
814
|
+
/* @__PURE__ */ l("p", {
|
|
763
815
|
className: "mt-1 text-xs text-text-secondary",
|
|
764
|
-
children:
|
|
816
|
+
children: s("healthybowl.crops.fieldDetail.compare.description", "What each variety in your Master Plant List would need on this field, at the bed and path widths above.")
|
|
765
817
|
}),
|
|
766
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ l("div", {
|
|
767
819
|
className: "mt-3 overflow-x-auto rounded-md border border-border-subtle",
|
|
768
|
-
children: /* @__PURE__ */
|
|
820
|
+
children: /* @__PURE__ */ u("table", {
|
|
769
821
|
className: "w-full min-w-[680px] border-collapse text-sm",
|
|
770
|
-
children: [/* @__PURE__ */
|
|
822
|
+
children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", {
|
|
771
823
|
className: "border-b border-border-subtle bg-bg-sunken/60",
|
|
772
824
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
label:
|
|
825
|
+
/* @__PURE__ */ l(x, {
|
|
826
|
+
label: s("healthybowl.crops.fieldDetail.compare.crop", "Crop"),
|
|
775
827
|
sortKey: "label",
|
|
776
|
-
activeKey:
|
|
777
|
-
direction:
|
|
778
|
-
onSort:
|
|
828
|
+
activeKey: Y,
|
|
829
|
+
direction: X,
|
|
830
|
+
onSort: Z
|
|
779
831
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ l("th", {
|
|
781
833
|
scope: "col",
|
|
782
834
|
className: "whitespace-nowrap px-3 py-2 text-end text-xs font-medium text-text-secondary",
|
|
783
|
-
children:
|
|
835
|
+
children: s("healthybowl.crops.fieldDetail.compare.spacing", "Spacing")
|
|
784
836
|
}),
|
|
785
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ l("th", {
|
|
786
838
|
scope: "col",
|
|
787
839
|
className: "whitespace-nowrap px-3 py-2 text-end text-xs font-medium text-text-secondary",
|
|
788
|
-
children:
|
|
840
|
+
children: s("healthybowl.crops.fieldDetail.compare.beds", "Beds")
|
|
789
841
|
}),
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
label:
|
|
842
|
+
/* @__PURE__ */ l(x, {
|
|
843
|
+
label: s("healthybowl.crops.fieldDetail.compare.totalPlants", "Total plants"),
|
|
792
844
|
sortKey: "totalPlants",
|
|
793
|
-
activeKey:
|
|
794
|
-
direction:
|
|
795
|
-
onSort:
|
|
845
|
+
activeKey: Y,
|
|
846
|
+
direction: X,
|
|
847
|
+
onSort: Z,
|
|
796
848
|
align: "right"
|
|
797
849
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
label:
|
|
850
|
+
/* @__PURE__ */ l(x, {
|
|
851
|
+
label: s("healthybowl.crops.fieldDetail.compare.seed", "Seed needed"),
|
|
800
852
|
sortKey: "seedGrams",
|
|
801
|
-
activeKey:
|
|
802
|
-
direction:
|
|
803
|
-
onSort:
|
|
853
|
+
activeKey: Y,
|
|
854
|
+
direction: X,
|
|
855
|
+
onSort: Z,
|
|
804
856
|
align: "right"
|
|
805
857
|
}),
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
label:
|
|
858
|
+
/* @__PURE__ */ l(x, {
|
|
859
|
+
label: s("healthybowl.crops.fieldDetail.compare.trays", "Trays"),
|
|
808
860
|
sortKey: "trays",
|
|
809
|
-
activeKey:
|
|
810
|
-
direction:
|
|
811
|
-
onSort:
|
|
861
|
+
activeKey: Y,
|
|
862
|
+
direction: X,
|
|
863
|
+
onSort: Z,
|
|
812
864
|
align: "right"
|
|
813
865
|
}),
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
label:
|
|
866
|
+
/* @__PURE__ */ l(x, {
|
|
867
|
+
label: s("healthybowl.crops.fieldDetail.compare.maturity", "Days to maturity"),
|
|
816
868
|
sortKey: "daysToMaturity",
|
|
817
|
-
activeKey:
|
|
818
|
-
direction:
|
|
819
|
-
onSort:
|
|
869
|
+
activeKey: Y,
|
|
870
|
+
direction: X,
|
|
871
|
+
onSort: Z,
|
|
820
872
|
align: "right"
|
|
821
873
|
})
|
|
822
874
|
]
|
|
823
|
-
}) }), /* @__PURE__ */
|
|
824
|
-
className: `border-b border-border-subtle last:border-b-0 ${
|
|
875
|
+
}) }), /* @__PURE__ */ l("tbody", { children: on.map((e) => /* @__PURE__ */ u("tr", {
|
|
876
|
+
className: `border-b border-border-subtle last:border-b-0 ${q?.id === e.id ? "bg-success/5" : ""}`,
|
|
825
877
|
children: [
|
|
826
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ u("td", {
|
|
827
879
|
className: "px-3 py-2",
|
|
828
|
-
children: [/* @__PURE__ */
|
|
880
|
+
children: [/* @__PURE__ */ l("span", {
|
|
829
881
|
className: "font-medium text-text-primary",
|
|
830
882
|
children: e.label
|
|
831
|
-
}), !e.spacingFromCatalog && /* @__PURE__ */
|
|
883
|
+
}), !e.spacingFromCatalog && /* @__PURE__ */ l("span", {
|
|
832
884
|
className: "ms-2 whitespace-nowrap rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] text-text-secondary",
|
|
833
885
|
title: e.presetLabel,
|
|
834
|
-
children:
|
|
886
|
+
children: s("healthybowl.crops.fieldDetail.compare.presetSpacing", "preset spacing")
|
|
835
887
|
})]
|
|
836
888
|
}),
|
|
837
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ u("td", {
|
|
838
890
|
className: "whitespace-nowrap px-3 py-2 text-end tabular-nums text-text-secondary",
|
|
839
891
|
children: [
|
|
840
892
|
e.plantSpacingCm,
|
|
@@ -843,23 +895,23 @@ var et = (e) => {
|
|
|
843
895
|
" cm"
|
|
844
896
|
]
|
|
845
897
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ l("td", {
|
|
847
899
|
className: "px-3 py-2 text-end tabular-nums text-text-secondary",
|
|
848
900
|
children: t(e.capacity.bedCount)
|
|
849
901
|
}),
|
|
850
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ l("td", {
|
|
851
903
|
className: "px-3 py-2 text-end font-medium tabular-nums text-text-primary",
|
|
852
904
|
children: t(e.capacity.totalPlants)
|
|
853
905
|
}),
|
|
854
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ l("td", {
|
|
855
907
|
className: "whitespace-nowrap px-3 py-2 text-end tabular-nums text-text-secondary",
|
|
856
|
-
children: e.seed.seedGrams == null ? "—" : `${
|
|
908
|
+
children: e.seed.seedGrams == null ? "—" : `${v(e.seed.seedGrams, 2)} g`
|
|
857
909
|
}),
|
|
858
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ l("td", {
|
|
859
911
|
className: "px-3 py-2 text-end tabular-nums text-text-secondary",
|
|
860
912
|
children: e.seed.trays == null ? "—" : t(e.seed.trays)
|
|
861
913
|
}),
|
|
862
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ l("td", {
|
|
863
915
|
className: "px-3 py-2 text-end tabular-nums text-text-secondary",
|
|
864
916
|
children: e.daysToMaturity == null ? "—" : t(e.daysToMaturity)
|
|
865
917
|
})
|
|
@@ -867,278 +919,278 @@ var et = (e) => {
|
|
|
867
919
|
}, e.id)) })]
|
|
868
920
|
})
|
|
869
921
|
}),
|
|
870
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ l("p", {
|
|
871
923
|
className: "mt-2 text-xs text-text-secondary",
|
|
872
|
-
children:
|
|
924
|
+
children: s("healthybowl.crops.fieldDetail.compare.footnote", "A dash means the variety has no seeds-per-gram recorded yet. “Preset spacing” means the figures use a crop-family default rather than spacing you have recorded.")
|
|
873
925
|
})
|
|
874
|
-
] }) : /* @__PURE__ */
|
|
926
|
+
] }) : /* @__PURE__ */ l("p", {
|
|
875
927
|
className: "mt-3 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary",
|
|
876
|
-
children:
|
|
928
|
+
children: s("healthybowl.crops.fieldDetail.compare.empty", "Add varieties to your Master Plant List to compare beds and seed across crops for this field.")
|
|
877
929
|
})]
|
|
878
930
|
})
|
|
879
|
-
] }) : /* @__PURE__ */
|
|
931
|
+
] }) : /* @__PURE__ */ l("p", {
|
|
880
932
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
881
|
-
children:
|
|
882
|
-
})] }) : /* @__PURE__ */
|
|
933
|
+
children: s("healthybowl.crops.fieldDetail.capacity.empty", "Draw a boundary on the map above, or set this field’s area, to calculate beds and plants.")
|
|
934
|
+
})] }) : /* @__PURE__ */ l("p", {
|
|
883
935
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
884
|
-
children:
|
|
936
|
+
children: s(pe.key, pe.defaultValue, { type: Qt })
|
|
885
937
|
})]
|
|
886
938
|
})
|
|
887
939
|
]
|
|
888
940
|
}),
|
|
889
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ u("div", {
|
|
890
942
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
891
943
|
children: [
|
|
892
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ u("div", {
|
|
893
945
|
className: "mb-4",
|
|
894
|
-
children: [/* @__PURE__ */
|
|
946
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
895
947
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
896
948
|
children: [
|
|
897
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ l(Xe, { className: "h-4 w-4 text-success" }),
|
|
898
950
|
" ",
|
|
899
|
-
|
|
951
|
+
s("healthybowl.crops.fieldDetail.succession.heading", "Succession planting")
|
|
900
952
|
]
|
|
901
|
-
}), /* @__PURE__ */
|
|
953
|
+
}), /* @__PURE__ */ l("p", {
|
|
902
954
|
className: "mt-1 text-xs text-text-secondary",
|
|
903
|
-
children:
|
|
955
|
+
children: s("healthybowl.crops.fieldDetail.succession.description", "Generate a series of staggered sowings for a steady, continuous harvest. Uses the crop and seed-rate above.")
|
|
904
956
|
})]
|
|
905
957
|
}),
|
|
906
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ u("div", {
|
|
907
959
|
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
908
960
|
children: [
|
|
909
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
910
962
|
className: "text-xs font-medium text-text-secondary",
|
|
911
|
-
children:
|
|
912
|
-
}), /* @__PURE__ */
|
|
963
|
+
children: s("healthybowl.crops.fieldDetail.succession.startDate", "Start date")
|
|
964
|
+
}), /* @__PURE__ */ l("input", {
|
|
913
965
|
type: "date",
|
|
914
|
-
value:
|
|
915
|
-
onChange: (e) =>
|
|
966
|
+
value: dn,
|
|
967
|
+
onChange: (e) => fn(e.target.value),
|
|
916
968
|
className: "mt-1 h-10 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)]"
|
|
917
969
|
})] }),
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
label:
|
|
920
|
-
unit:
|
|
921
|
-
value:
|
|
970
|
+
/* @__PURE__ */ l(y, {
|
|
971
|
+
label: s("healthybowl.crops.fieldDetail.succession.interval", "Interval"),
|
|
972
|
+
unit: s("healthybowl.crops.fieldDetail.succession.days", "days"),
|
|
973
|
+
value: pn,
|
|
922
974
|
min: "1",
|
|
923
975
|
step: "1",
|
|
924
|
-
onChange:
|
|
976
|
+
onChange: mn
|
|
925
977
|
}),
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
label:
|
|
928
|
-
unit:
|
|
929
|
-
value:
|
|
978
|
+
/* @__PURE__ */ l(y, {
|
|
979
|
+
label: s("healthybowl.crops.fieldDetail.succession.count", "Number of sowings"),
|
|
980
|
+
unit: s("healthybowl.crops.fieldDetail.succession.sowings", "sowings"),
|
|
981
|
+
value: hn,
|
|
930
982
|
min: "1",
|
|
931
983
|
step: "1",
|
|
932
|
-
onChange:
|
|
984
|
+
onChange: gn
|
|
933
985
|
}),
|
|
934
|
-
|
|
986
|
+
cn.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
935
987
|
className: "text-xs font-medium text-text-secondary",
|
|
936
|
-
children:
|
|
937
|
-
}), /* @__PURE__ */
|
|
938
|
-
value:
|
|
939
|
-
onValueChange: (e) =>
|
|
940
|
-
children: [/* @__PURE__ */
|
|
988
|
+
children: s("healthybowl.crops.fieldDetail.succession.bed", "Bed (optional)")
|
|
989
|
+
}), /* @__PURE__ */ u(f, {
|
|
990
|
+
value: _n || "none",
|
|
991
|
+
onValueChange: (e) => vn(e === "none" ? "" : e),
|
|
992
|
+
children: [/* @__PURE__ */ l(h, {
|
|
941
993
|
className: "mt-1 w-full",
|
|
942
|
-
children: /* @__PURE__ */
|
|
943
|
-
}), /* @__PURE__ */
|
|
994
|
+
children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.succession.bedPlaceholder", "No specific bed") })
|
|
995
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
944
996
|
value: "none",
|
|
945
|
-
children:
|
|
946
|
-
}),
|
|
997
|
+
children: s("healthybowl.crops.fieldDetail.succession.bedNone", "No specific bed")
|
|
998
|
+
}), cn.map((e) => /* @__PURE__ */ l(m, {
|
|
947
999
|
value: e.id,
|
|
948
1000
|
children: e.name
|
|
949
1001
|
}, e.id))] })]
|
|
950
1002
|
})] })
|
|
951
1003
|
]
|
|
952
1004
|
}),
|
|
953
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ u("div", {
|
|
954
1006
|
className: "mt-4 flex flex-wrap items-center justify-between gap-3",
|
|
955
|
-
children: [/* @__PURE__ */
|
|
1007
|
+
children: [/* @__PURE__ */ l("p", {
|
|
956
1008
|
className: "text-xs text-text-secondary",
|
|
957
|
-
children:
|
|
958
|
-
}), /* @__PURE__ */ d
|
|
959
|
-
onClick:
|
|
960
|
-
disabled:
|
|
961
|
-
children: [/* @__PURE__ */
|
|
1009
|
+
children: V ? s("healthybowl.crops.fieldDetail.succession.forCrop", "For: {{crop}}", { crop: V.variety ? `${V.name} - ${V.variety}` : V.name }) : s("healthybowl.crops.fieldDetail.succession.noCrop", "Select a crop in the capacity planner above.")
|
|
1010
|
+
}), /* @__PURE__ */ u(d, {
|
|
1011
|
+
onClick: Cn,
|
|
1012
|
+
disabled: yn,
|
|
1013
|
+
children: [/* @__PURE__ */ l(Je, { className: "h-4 w-4" }), yn ? s("healthybowl.crops.fieldDetail.succession.generating", "Generating...") : s("healthybowl.crops.fieldDetail.succession.generate", "Generate schedule")]
|
|
962
1014
|
})]
|
|
963
1015
|
}),
|
|
964
|
-
|
|
1016
|
+
xn.length > 0 ? /* @__PURE__ */ l("div", {
|
|
965
1017
|
className: "mt-5 space-y-5 border-t border-border-subtle pt-5",
|
|
966
|
-
children:
|
|
1018
|
+
children: xn.map(([n, r]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
|
|
967
1019
|
className: "mb-2 flex items-center justify-between",
|
|
968
|
-
children: [/* @__PURE__ */
|
|
1020
|
+
children: [/* @__PURE__ */ l("h4", {
|
|
969
1021
|
className: "text-sm font-semibold text-text-primary",
|
|
970
|
-
children: r[0] ?
|
|
971
|
-
}), /* @__PURE__ */
|
|
1022
|
+
children: r[0] ? Sn(r[0]) : s("healthybowl.crops.fieldDetail.succession.series", "Succession series")
|
|
1023
|
+
}), /* @__PURE__ */ l("span", {
|
|
972
1024
|
className: "text-xs text-text-secondary",
|
|
973
|
-
children:
|
|
1025
|
+
children: s("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: r.length })
|
|
974
1026
|
})]
|
|
975
|
-
}), /* @__PURE__ */
|
|
1027
|
+
}), /* @__PURE__ */ l("div", {
|
|
976
1028
|
className: "space-y-2",
|
|
977
|
-
children: r.map((n, r) => /* @__PURE__ */
|
|
1029
|
+
children: r.map((n, r) => /* @__PURE__ */ u("div", {
|
|
978
1030
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
979
|
-
children: [/* @__PURE__ */
|
|
1031
|
+
children: [/* @__PURE__ */ u("div", {
|
|
980
1032
|
className: "flex items-center gap-3",
|
|
981
|
-
children: [/* @__PURE__ */
|
|
1033
|
+
children: [/* @__PURE__ */ l("div", {
|
|
982
1034
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-success/10 text-xs font-semibold text-success",
|
|
983
1035
|
children: (n.successionIndex ?? r) + 1
|
|
984
|
-
}), /* @__PURE__ */
|
|
1036
|
+
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
|
|
985
1037
|
className: "text-sm font-medium text-text-primary",
|
|
986
1038
|
children: [
|
|
987
|
-
|
|
1039
|
+
s("healthybowl.crops.fieldDetail.succession.sowingLabel", "Sowing {{n}}", { n: (n.successionIndex ?? r) + 1 }),
|
|
988
1040
|
" ",
|
|
989
1041
|
"— ",
|
|
990
1042
|
e(n.sowDate ?? n.startDate)
|
|
991
1043
|
]
|
|
992
|
-
}), n.seedlingsToRaise != null && /* @__PURE__ */
|
|
1044
|
+
}), n.seedlingsToRaise != null && /* @__PURE__ */ l("p", {
|
|
993
1045
|
className: "text-xs text-text-secondary",
|
|
994
|
-
children:
|
|
1046
|
+
children: s("healthybowl.crops.fieldDetail.succession.sowingMeta", "{{seedlings}} seedlings{{grams}}", {
|
|
995
1047
|
seedlings: t(n.seedlingsToRaise),
|
|
996
|
-
grams: n.seedGrams == null ? "" : ` · ${
|
|
1048
|
+
grams: n.seedGrams == null ? "" : ` · ${v(n.seedGrams, 2)} g seed`
|
|
997
1049
|
})
|
|
998
1050
|
})] })]
|
|
999
|
-
}), /* @__PURE__ */
|
|
1051
|
+
}), /* @__PURE__ */ l(d, {
|
|
1000
1052
|
variant: "ghost",
|
|
1001
1053
|
size: "icon-sm",
|
|
1002
|
-
onClick: () => void
|
|
1003
|
-
"aria-label":
|
|
1054
|
+
onClick: () => void wn(n),
|
|
1055
|
+
"aria-label": s("healthybowl.common.delete", "Delete"),
|
|
1004
1056
|
className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
1005
|
-
children: /* @__PURE__ */
|
|
1057
|
+
children: /* @__PURE__ */ l(et, { className: "h-4 w-4" })
|
|
1006
1058
|
})]
|
|
1007
1059
|
}, n.id))
|
|
1008
1060
|
})] }, n))
|
|
1009
|
-
}) : /* @__PURE__ */
|
|
1061
|
+
}) : /* @__PURE__ */ l("p", {
|
|
1010
1062
|
className: "mt-5 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
1011
|
-
children:
|
|
1063
|
+
children: s("healthybowl.crops.fieldDetail.succession.empty", "No succession schedules yet. Set a start date, interval and number of sowings, then generate a series.")
|
|
1012
1064
|
})
|
|
1013
1065
|
]
|
|
1014
1066
|
}),
|
|
1015
|
-
/* @__PURE__ */
|
|
1067
|
+
/* @__PURE__ */ u("div", {
|
|
1016
1068
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1017
|
-
children: [/* @__PURE__ */
|
|
1069
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
1018
1070
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1019
1071
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
1072
|
+
/* @__PURE__ */ l(Ke, { className: "h-4 w-4 text-success" }),
|
|
1021
1073
|
" ",
|
|
1022
|
-
|
|
1074
|
+
s("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
|
|
1023
1075
|
]
|
|
1024
|
-
}),
|
|
1076
|
+
}), z.length > 0 ? /* @__PURE__ */ l("div", {
|
|
1025
1077
|
className: "flex flex-col gap-3",
|
|
1026
|
-
children:
|
|
1027
|
-
onClick: () => w(
|
|
1078
|
+
children: z.map((e) => /* @__PURE__ */ u("div", {
|
|
1079
|
+
onClick: () => C(w(`crops/${e.id}`)),
|
|
1028
1080
|
className: "flex cursor-pointer items-center justify-between rounded-md border border-border-subtle p-3 transition-colors hover:bg-bg-sunken/50",
|
|
1029
|
-
children: [/* @__PURE__ */
|
|
1030
|
-
/* @__PURE__ */
|
|
1081
|
+
children: [/* @__PURE__ */ u("div", { children: [
|
|
1082
|
+
/* @__PURE__ */ l("span", {
|
|
1031
1083
|
className: "text-sm font-medium text-text-primary",
|
|
1032
1084
|
children: e.name
|
|
1033
1085
|
}),
|
|
1034
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ l("span", {
|
|
1035
1087
|
className: "ms-2 text-xs text-text-secondary",
|
|
1036
1088
|
children: e.variety
|
|
1037
1089
|
}),
|
|
1038
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ u("div", {
|
|
1039
1091
|
className: "mt-1 flex items-center gap-2",
|
|
1040
|
-
children: [/* @__PURE__ */
|
|
1092
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1041
1093
|
className: "h-1.5 w-24 rounded-full bg-bg-sunken",
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1094
|
+
children: /* @__PURE__ */ l("div", {
|
|
1043
1095
|
className: "h-1.5 rounded-full bg-action-primary-bg",
|
|
1044
1096
|
style: { width: `${e.progress}%` }
|
|
1045
1097
|
})
|
|
1046
|
-
}), /* @__PURE__ */
|
|
1098
|
+
}), /* @__PURE__ */ u("span", {
|
|
1047
1099
|
className: "text-xs text-text-secondary",
|
|
1048
1100
|
children: [e.progress, "%"]
|
|
1049
1101
|
})]
|
|
1050
1102
|
})
|
|
1051
|
-
] }), /* @__PURE__ */
|
|
1103
|
+
] }), /* @__PURE__ */ u("div", {
|
|
1052
1104
|
className: "flex items-center gap-2",
|
|
1053
|
-
children: [/* @__PURE__ */
|
|
1105
|
+
children: [/* @__PURE__ */ l(i, {
|
|
1054
1106
|
label: e.growthStage,
|
|
1055
1107
|
variant: "info"
|
|
1056
|
-
}), /* @__PURE__ */
|
|
1108
|
+
}), /* @__PURE__ */ u("span", {
|
|
1057
1109
|
className: "text-xs text-text-secondary",
|
|
1058
1110
|
children: [e.daysToHarvest, "d"]
|
|
1059
1111
|
})]
|
|
1060
1112
|
})]
|
|
1061
1113
|
}, e.id))
|
|
1062
|
-
}) : /* @__PURE__ */
|
|
1114
|
+
}) : /* @__PURE__ */ l("p", {
|
|
1063
1115
|
className: "text-sm text-text-secondary",
|
|
1064
|
-
children:
|
|
1116
|
+
children: s("healthybowl.crops.fieldDetail.currentCrops.empty", "No crops currently planted.")
|
|
1065
1117
|
})]
|
|
1066
1118
|
}),
|
|
1067
|
-
Q && /* @__PURE__ */
|
|
1119
|
+
Q && /* @__PURE__ */ u("div", {
|
|
1068
1120
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1069
1121
|
children: [
|
|
1070
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ u("div", {
|
|
1071
1123
|
className: "mb-4 flex items-center justify-between",
|
|
1072
|
-
children: [/* @__PURE__ */
|
|
1124
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
1073
1125
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1074
1126
|
children: [
|
|
1075
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ l(Le, { className: "h-4 w-4 text-warning" }),
|
|
1076
1128
|
" ",
|
|
1077
|
-
|
|
1129
|
+
s("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
|
|
1078
1130
|
]
|
|
1079
|
-
}), /* @__PURE__ */
|
|
1131
|
+
}), /* @__PURE__ */ l(i, {
|
|
1080
1132
|
label: (Q.status ?? "unknown").replace("_", " "),
|
|
1081
|
-
variant:
|
|
1133
|
+
variant: st(Q.status ?? "unknown")
|
|
1082
1134
|
})]
|
|
1083
1135
|
}),
|
|
1084
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ l("div", {
|
|
1085
1137
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6",
|
|
1086
1138
|
children: [
|
|
1087
1139
|
{
|
|
1088
1140
|
key: "pH",
|
|
1089
|
-
label:
|
|
1141
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.ph", "pH"),
|
|
1090
1142
|
value: Q.ph.toString(),
|
|
1091
1143
|
good: Q.ph >= 6 && Q.ph <= 7.5
|
|
1092
1144
|
},
|
|
1093
1145
|
{
|
|
1094
1146
|
key: "Nitrogen",
|
|
1095
|
-
label:
|
|
1147
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.nitrogen", "Nitrogen"),
|
|
1096
1148
|
value: `${Q.nitrogen} ppm`,
|
|
1097
1149
|
good: Q.nitrogen >= 30
|
|
1098
1150
|
},
|
|
1099
1151
|
{
|
|
1100
1152
|
key: "Phosphorus",
|
|
1101
|
-
label:
|
|
1153
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.phosphorus", "Phosphorus"),
|
|
1102
1154
|
value: `${Q.phosphorus} ppm`,
|
|
1103
1155
|
good: Q.phosphorus >= 25
|
|
1104
1156
|
},
|
|
1105
1157
|
{
|
|
1106
1158
|
key: "Potassium",
|
|
1107
|
-
label:
|
|
1159
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.potassium", "Potassium"),
|
|
1108
1160
|
value: `${Q.potassium} ppm`,
|
|
1109
1161
|
good: Q.potassium >= 150
|
|
1110
1162
|
},
|
|
1111
1163
|
{
|
|
1112
1164
|
key: "Organic Matter",
|
|
1113
|
-
label:
|
|
1165
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.organicMatter", "Organic Matter"),
|
|
1114
1166
|
value: `${Q.organicMatter}%`,
|
|
1115
1167
|
good: Q.organicMatter >= 3
|
|
1116
1168
|
},
|
|
1117
1169
|
{
|
|
1118
1170
|
key: "Moisture",
|
|
1119
|
-
label:
|
|
1171
|
+
label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.moisture", "Moisture"),
|
|
1120
1172
|
value: `${Q.moisture}%`,
|
|
1121
1173
|
good: Q.moisture >= 20 && Q.moisture <= 40
|
|
1122
1174
|
}
|
|
1123
|
-
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */
|
|
1175
|
+
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ u("div", {
|
|
1124
1176
|
className: "text-center",
|
|
1125
|
-
children: [/* @__PURE__ */
|
|
1177
|
+
children: [/* @__PURE__ */ l("span", {
|
|
1126
1178
|
className: "text-xs text-text-secondary",
|
|
1127
1179
|
children: t
|
|
1128
|
-
}), /* @__PURE__ */
|
|
1180
|
+
}), /* @__PURE__ */ l("p", {
|
|
1129
1181
|
className: `text-sm font-semibold ${r ? "text-success" : "text-warning"}`,
|
|
1130
1182
|
children: n
|
|
1131
1183
|
})]
|
|
1132
1184
|
}, e))
|
|
1133
1185
|
}),
|
|
1134
|
-
Q.recommendations.length > 0 && /* @__PURE__ */
|
|
1186
|
+
Q.recommendations.length > 0 && /* @__PURE__ */ u("div", {
|
|
1135
1187
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
1136
|
-
children: [/* @__PURE__ */
|
|
1188
|
+
children: [/* @__PURE__ */ l("h4", {
|
|
1137
1189
|
className: "mb-2 text-xs font-medium text-text-secondary",
|
|
1138
|
-
children:
|
|
1139
|
-
}), /* @__PURE__ */
|
|
1190
|
+
children: s("healthybowl.crops.fieldDetail.soilHealth.recommendations", "Recommendations")
|
|
1191
|
+
}), /* @__PURE__ */ l("ul", {
|
|
1140
1192
|
className: "space-y-1",
|
|
1141
|
-
children: Q.recommendations.map((e, t) => /* @__PURE__ */
|
|
1193
|
+
children: Q.recommendations.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1142
1194
|
className: "text-xs text-text-primary",
|
|
1143
1195
|
children: ["- ", e]
|
|
1144
1196
|
}, t))
|
|
@@ -1146,26 +1198,26 @@ var et = (e) => {
|
|
|
1146
1198
|
})
|
|
1147
1199
|
]
|
|
1148
1200
|
}),
|
|
1149
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ u("div", {
|
|
1150
1202
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1151
|
-
children: [/* @__PURE__ */
|
|
1203
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
1152
1204
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1153
1205
|
children: [
|
|
1154
|
-
/* @__PURE__ */
|
|
1206
|
+
/* @__PURE__ */ l(Be, { className: "h-4 w-4 text-info" }),
|
|
1155
1207
|
" ",
|
|
1156
|
-
|
|
1208
|
+
s("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
|
|
1157
1209
|
]
|
|
1158
|
-
}), /* @__PURE__ */
|
|
1210
|
+
}), /* @__PURE__ */ l("div", {
|
|
1159
1211
|
className: "space-y-3",
|
|
1160
|
-
children:
|
|
1212
|
+
children: En.map((e, t) => /* @__PURE__ */ u("div", {
|
|
1161
1213
|
className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
|
|
1162
|
-
children: [/* @__PURE__ */
|
|
1214
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
|
|
1163
1215
|
className: "text-sm font-medium text-text-primary",
|
|
1164
1216
|
children: e.crop
|
|
1165
|
-
}), /* @__PURE__ */
|
|
1217
|
+
}), /* @__PURE__ */ l("p", {
|
|
1166
1218
|
className: "text-xs text-text-secondary",
|
|
1167
1219
|
children: e.season
|
|
1168
|
-
})] }), /* @__PURE__ */
|
|
1220
|
+
})] }), /* @__PURE__ */ l(i, {
|
|
1169
1221
|
label: e.status,
|
|
1170
1222
|
variant: e.status === "active" ? "success" : "muted"
|
|
1171
1223
|
})]
|
|
@@ -1173,87 +1225,87 @@ var et = (e) => {
|
|
|
1173
1225
|
})]
|
|
1174
1226
|
})
|
|
1175
1227
|
]
|
|
1176
|
-
}), /* @__PURE__ */
|
|
1228
|
+
}), /* @__PURE__ */ u("div", {
|
|
1177
1229
|
className: "space-y-6",
|
|
1178
1230
|
children: [
|
|
1179
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ u("div", {
|
|
1180
1232
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1181
|
-
children: [/* @__PURE__ */
|
|
1233
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
1182
1234
|
className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1183
1235
|
children: [
|
|
1184
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ l(He, { className: "h-4 w-4 text-info" }),
|
|
1185
1237
|
" ",
|
|
1186
|
-
|
|
1238
|
+
s("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
|
|
1187
1239
|
]
|
|
1188
|
-
}), /* @__PURE__ */
|
|
1240
|
+
}), /* @__PURE__ */ u("div", {
|
|
1189
1241
|
className: "space-y-3",
|
|
1190
1242
|
children: [
|
|
1191
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ u("div", {
|
|
1192
1244
|
className: "flex items-center justify-between",
|
|
1193
|
-
children: [/* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1194
1246
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1195
1247
|
children: [
|
|
1196
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ l($e, { className: "h-3.5 w-3.5" }),
|
|
1197
1249
|
" ",
|
|
1198
|
-
|
|
1250
|
+
s("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
|
|
1199
1251
|
]
|
|
1200
|
-
}), /* @__PURE__ */
|
|
1252
|
+
}), /* @__PURE__ */ u("span", {
|
|
1201
1253
|
className: "text-sm font-medium text-text-primary",
|
|
1202
1254
|
children: [$.current.temperature, "°C"]
|
|
1203
1255
|
})]
|
|
1204
1256
|
}),
|
|
1205
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ u("div", {
|
|
1206
1258
|
className: "flex items-center justify-between",
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
1259
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1208
1260
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1209
1261
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ l(Ue, { className: "h-3.5 w-3.5" }),
|
|
1211
1263
|
" ",
|
|
1212
|
-
|
|
1264
|
+
s("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
|
|
1213
1265
|
]
|
|
1214
|
-
}), /* @__PURE__ */
|
|
1266
|
+
}), /* @__PURE__ */ u("span", {
|
|
1215
1267
|
className: "text-sm font-medium text-text-primary",
|
|
1216
1268
|
children: [$.current.humidity, "%"]
|
|
1217
1269
|
})]
|
|
1218
1270
|
}),
|
|
1219
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ u("div", {
|
|
1220
1272
|
className: "flex items-center justify-between",
|
|
1221
|
-
children: [/* @__PURE__ */
|
|
1273
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1222
1274
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1223
1275
|
children: [
|
|
1224
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ l(nt, { className: "h-3.5 w-3.5" }),
|
|
1225
1277
|
" ",
|
|
1226
|
-
|
|
1278
|
+
s("healthybowl.crops.fieldDetail.weather.wind", "Wind")
|
|
1227
1279
|
]
|
|
1228
|
-
}), /* @__PURE__ */
|
|
1280
|
+
}), /* @__PURE__ */ u("span", {
|
|
1229
1281
|
className: "text-sm font-medium text-text-primary",
|
|
1230
1282
|
children: [$.current.windSpeed, " km/h"]
|
|
1231
1283
|
})]
|
|
1232
1284
|
}),
|
|
1233
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ u("div", {
|
|
1234
1286
|
className: "flex items-center justify-between",
|
|
1235
|
-
children: [/* @__PURE__ */
|
|
1287
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1236
1288
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1237
1289
|
children: [
|
|
1238
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ l(Ze, { className: "h-3.5 w-3.5" }),
|
|
1239
1291
|
" ",
|
|
1240
|
-
|
|
1292
|
+
s("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
|
|
1241
1293
|
]
|
|
1242
|
-
}), /* @__PURE__ */
|
|
1294
|
+
}), /* @__PURE__ */ l("span", {
|
|
1243
1295
|
className: "text-sm font-medium text-text-primary",
|
|
1244
1296
|
children: $.current.uvIndex
|
|
1245
1297
|
})]
|
|
1246
1298
|
}),
|
|
1247
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ u("div", {
|
|
1248
1300
|
className: "flex items-center justify-between",
|
|
1249
|
-
children: [/* @__PURE__ */
|
|
1301
|
+
children: [/* @__PURE__ */ u("span", {
|
|
1250
1302
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1251
1303
|
children: [
|
|
1252
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ l(Ge, { className: "h-3.5 w-3.5" }),
|
|
1253
1305
|
" ",
|
|
1254
|
-
|
|
1306
|
+
s("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
|
|
1255
1307
|
]
|
|
1256
|
-
}), /* @__PURE__ */
|
|
1308
|
+
}), /* @__PURE__ */ u("span", {
|
|
1257
1309
|
className: "text-sm font-medium text-text-primary",
|
|
1258
1310
|
children: [$.current.visibility, " km"]
|
|
1259
1311
|
})]
|
|
@@ -1261,75 +1313,75 @@ var et = (e) => {
|
|
|
1261
1313
|
]
|
|
1262
1314
|
})]
|
|
1263
1315
|
}),
|
|
1264
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ u("div", {
|
|
1265
1317
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1266
|
-
children: [/* @__PURE__ */
|
|
1318
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
1267
1319
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
1268
|
-
children:
|
|
1269
|
-
}), /* @__PURE__ */
|
|
1320
|
+
children: s("healthybowl.crops.fieldDetail.quickActions.heading", "Quick Actions")
|
|
1321
|
+
}), /* @__PURE__ */ u("div", {
|
|
1270
1322
|
className: "space-y-2",
|
|
1271
1323
|
children: [
|
|
1272
|
-
/* @__PURE__ */ d
|
|
1324
|
+
/* @__PURE__ */ u(d, {
|
|
1273
1325
|
variant: "outline",
|
|
1274
|
-
onClick: () => w(
|
|
1326
|
+
onClick: () => C(w("weather")),
|
|
1275
1327
|
className: "w-full justify-start",
|
|
1276
1328
|
children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ l(Ze, { className: "h-4 w-4 text-text-secondary" }),
|
|
1278
1330
|
" ",
|
|
1279
|
-
|
|
1331
|
+
s("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
|
|
1280
1332
|
]
|
|
1281
1333
|
}),
|
|
1282
|
-
/* @__PURE__ */ d
|
|
1334
|
+
/* @__PURE__ */ u(d, {
|
|
1283
1335
|
variant: "outline",
|
|
1284
|
-
onClick: () => w(
|
|
1336
|
+
onClick: () => C(w("soil-health")),
|
|
1285
1337
|
className: "w-full justify-start",
|
|
1286
1338
|
children: [
|
|
1287
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ l(ze, { className: "h-4 w-4 text-text-secondary" }),
|
|
1288
1340
|
" ",
|
|
1289
|
-
|
|
1341
|
+
s("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
|
|
1290
1342
|
]
|
|
1291
1343
|
}),
|
|
1292
|
-
/* @__PURE__ */ d
|
|
1344
|
+
/* @__PURE__ */ u(d, {
|
|
1293
1345
|
variant: "outline",
|
|
1294
|
-
onClick: () => w(
|
|
1346
|
+
onClick: () => C(w("crops")),
|
|
1295
1347
|
className: "w-full justify-start",
|
|
1296
1348
|
children: [
|
|
1297
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ l(tt, { className: "h-4 w-4 text-text-secondary" }),
|
|
1298
1350
|
" ",
|
|
1299
|
-
|
|
1351
|
+
s("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
|
|
1300
1352
|
]
|
|
1301
1353
|
}),
|
|
1302
|
-
/* @__PURE__ */ d
|
|
1354
|
+
/* @__PURE__ */ u(d, {
|
|
1303
1355
|
variant: "outline",
|
|
1304
|
-
onClick: () => w(
|
|
1356
|
+
onClick: () => C(w("analytics")),
|
|
1305
1357
|
className: "w-full justify-start",
|
|
1306
1358
|
children: [
|
|
1307
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ l(Le, { className: "h-4 w-4 text-text-secondary" }),
|
|
1308
1360
|
" ",
|
|
1309
|
-
|
|
1361
|
+
s("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
|
|
1310
1362
|
]
|
|
1311
1363
|
})
|
|
1312
1364
|
]
|
|
1313
1365
|
})]
|
|
1314
1366
|
}),
|
|
1315
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ u("div", {
|
|
1316
1368
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1369
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
1318
1370
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
1319
|
-
children:
|
|
1320
|
-
}), /* @__PURE__ */
|
|
1371
|
+
children: s("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
|
|
1372
|
+
}), /* @__PURE__ */ l("div", {
|
|
1321
1373
|
className: "space-y-4",
|
|
1322
|
-
children:
|
|
1374
|
+
children: Tn.map((t, n) => /* @__PURE__ */ u("div", {
|
|
1323
1375
|
className: "flex gap-3",
|
|
1324
|
-
children: [/* @__PURE__ */
|
|
1376
|
+
children: [/* @__PURE__ */ u("div", {
|
|
1325
1377
|
className: "relative flex flex-col items-center",
|
|
1326
|
-
children: [/* @__PURE__ */
|
|
1327
|
-
}), /* @__PURE__ */
|
|
1378
|
+
children: [/* @__PURE__ */ l("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < Tn.length - 1 && /* @__PURE__ */ l("div", { className: "w-0.5 flex-1 bg-border" })]
|
|
1379
|
+
}), /* @__PURE__ */ u("div", {
|
|
1328
1380
|
className: "pb-4",
|
|
1329
|
-
children: [/* @__PURE__ */
|
|
1381
|
+
children: [/* @__PURE__ */ l("p", {
|
|
1330
1382
|
className: "text-sm text-text-primary",
|
|
1331
1383
|
children: t.action
|
|
1332
|
-
}), /* @__PURE__ */
|
|
1384
|
+
}), /* @__PURE__ */ l("p", {
|
|
1333
1385
|
className: "text-xs text-text-secondary",
|
|
1334
1386
|
children: e(t.date)
|
|
1335
1387
|
})]
|
|
@@ -1340,193 +1392,203 @@ var et = (e) => {
|
|
|
1340
1392
|
]
|
|
1341
1393
|
})]
|
|
1342
1394
|
}),
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
open:
|
|
1345
|
-
onClose: () =>
|
|
1346
|
-
title:
|
|
1347
|
-
description:
|
|
1395
|
+
/* @__PURE__ */ l(oe, {
|
|
1396
|
+
open: bt,
|
|
1397
|
+
onClose: () => xt(!1),
|
|
1398
|
+
title: s("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
|
|
1399
|
+
description: s("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: E.name }),
|
|
1348
1400
|
size: "lg",
|
|
1349
|
-
footer: /* @__PURE__ */
|
|
1401
|
+
footer: /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(d, {
|
|
1350
1402
|
variant: "outline",
|
|
1351
|
-
onClick: () =>
|
|
1352
|
-
children:
|
|
1353
|
-
}), /* @__PURE__ */
|
|
1354
|
-
onClick:
|
|
1355
|
-
disabled:
|
|
1356
|
-
children:
|
|
1403
|
+
onClick: () => xt(!1),
|
|
1404
|
+
children: s("healthybowl.common.cancel", "Cancel")
|
|
1405
|
+
}), /* @__PURE__ */ l(d, {
|
|
1406
|
+
onClick: qt,
|
|
1407
|
+
disabled: St,
|
|
1408
|
+
children: St ? s("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : s("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
|
|
1357
1409
|
})] }),
|
|
1358
|
-
children: /* @__PURE__ */
|
|
1410
|
+
children: /* @__PURE__ */ u("div", {
|
|
1359
1411
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
1360
1412
|
children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1413
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1362
1414
|
className: "text-sm font-medium text-text-primary",
|
|
1363
|
-
children:
|
|
1364
|
-
}), /* @__PURE__ */
|
|
1415
|
+
children: s("healthybowl.crops.fieldDetail.form.fieldName.label", "Field Name *")
|
|
1416
|
+
}), /* @__PURE__ */ l("input", {
|
|
1365
1417
|
type: "text",
|
|
1366
|
-
value:
|
|
1367
|
-
onChange: (e) =>
|
|
1418
|
+
value: D,
|
|
1419
|
+
onChange: (e) => Tt(e.target.value),
|
|
1368
1420
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1369
1421
|
})] }),
|
|
1370
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1371
1423
|
className: "text-sm font-medium text-text-primary",
|
|
1372
|
-
children:
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1424
|
+
children: s("healthybowl.crops.fieldDetail.form.area.label", "Area *")
|
|
1425
|
+
}), /* @__PURE__ */ l("input", {
|
|
1374
1426
|
type: "number",
|
|
1375
1427
|
min: 0,
|
|
1376
|
-
value:
|
|
1377
|
-
onChange: (e) =>
|
|
1428
|
+
value: Et,
|
|
1429
|
+
onChange: (e) => Dt(e.target.value),
|
|
1378
1430
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1379
1431
|
})] }),
|
|
1380
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1381
1433
|
className: "text-sm font-medium text-text-primary",
|
|
1382
|
-
children:
|
|
1383
|
-
}), /* @__PURE__ */
|
|
1384
|
-
value:
|
|
1385
|
-
onValueChange: (e) =>
|
|
1386
|
-
children: [/* @__PURE__ */
|
|
1434
|
+
children: s("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
|
|
1435
|
+
}), /* @__PURE__ */ u(f, {
|
|
1436
|
+
value: Ot,
|
|
1437
|
+
onValueChange: (e) => kt(e),
|
|
1438
|
+
children: [/* @__PURE__ */ l(h, {
|
|
1387
1439
|
className: "mt-1 w-full",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1389
|
-
}), /* @__PURE__ */
|
|
1440
|
+
children: /* @__PURE__ */ l(g, {})
|
|
1441
|
+
}), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
|
|
1390
1442
|
value: "acres",
|
|
1391
|
-
children:
|
|
1392
|
-
}), /* @__PURE__ */
|
|
1443
|
+
children: s("healthybowl.crops.fieldDetail.form.unit.options.acres", "Acres")
|
|
1444
|
+
}), /* @__PURE__ */ l(m, {
|
|
1393
1445
|
value: "hectares",
|
|
1394
|
-
children:
|
|
1446
|
+
children: s("healthybowl.crops.fieldDetail.form.unit.options.hectares", "Hectares")
|
|
1395
1447
|
})] })]
|
|
1396
1448
|
})] }),
|
|
1397
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1398
1450
|
className: "text-sm font-medium text-text-primary",
|
|
1399
|
-
children:
|
|
1400
|
-
}), /* @__PURE__ */
|
|
1401
|
-
value:
|
|
1402
|
-
onValueChange:
|
|
1403
|
-
children: [/* @__PURE__ */
|
|
1451
|
+
children: s("healthybowl.crops.fieldDetail.form.status.label", "Status")
|
|
1452
|
+
}), /* @__PURE__ */ u(f, {
|
|
1453
|
+
value: Pt,
|
|
1454
|
+
onValueChange: Ft,
|
|
1455
|
+
children: [/* @__PURE__ */ l(h, {
|
|
1404
1456
|
className: "mt-1 w-full",
|
|
1405
|
-
children: /* @__PURE__ */
|
|
1406
|
-
}), /* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1457
|
+
children: /* @__PURE__ */ l(g, {})
|
|
1458
|
+
}), /* @__PURE__ */ u(p, { children: [
|
|
1459
|
+
/* @__PURE__ */ l(m, {
|
|
1408
1460
|
value: "active",
|
|
1409
|
-
children:
|
|
1461
|
+
children: s("healthybowl.crops.fieldDetail.form.status.options.active", "Active")
|
|
1410
1462
|
}),
|
|
1411
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ l(m, {
|
|
1412
1464
|
value: "preparation",
|
|
1413
|
-
children:
|
|
1465
|
+
children: s("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
|
|
1414
1466
|
}),
|
|
1415
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ l(m, {
|
|
1416
1468
|
value: "fallow",
|
|
1417
|
-
children:
|
|
1469
|
+
children: s("healthybowl.crops.fieldDetail.form.status.options.fallow", "Fallow")
|
|
1418
1470
|
})
|
|
1419
1471
|
] })]
|
|
1420
1472
|
})] }),
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ u("div", { children: [
|
|
1474
|
+
/* @__PURE__ */ l("label", {
|
|
1423
1475
|
className: "text-sm font-medium text-text-primary",
|
|
1424
|
-
children:
|
|
1476
|
+
children: s("healthybowl.crops.fieldDetail.form.type.label", "Growing Location")
|
|
1425
1477
|
}),
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
value:
|
|
1428
|
-
onValueChange: (e) =>
|
|
1429
|
-
children: [/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ u(f, {
|
|
1479
|
+
value: O,
|
|
1480
|
+
onValueChange: (e) => It(e),
|
|
1481
|
+
children: [/* @__PURE__ */ l(h, {
|
|
1430
1482
|
className: "mt-1 w-full",
|
|
1431
|
-
children: /* @__PURE__ */
|
|
1432
|
-
}), /* @__PURE__ */
|
|
1483
|
+
children: /* @__PURE__ */ l(g, {})
|
|
1484
|
+
}), /* @__PURE__ */ l(p, { children: ge.map((e) => /* @__PURE__ */ l(m, {
|
|
1433
1485
|
value: e.value,
|
|
1434
|
-
children:
|
|
1486
|
+
children: s(e.key, e.defaultValue)
|
|
1435
1487
|
}, e.value)) })]
|
|
1436
1488
|
}),
|
|
1437
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ l("p", {
|
|
1438
1490
|
className: "mt-1 text-xs text-text-secondary",
|
|
1439
|
-
children:
|
|
1491
|
+
children: s("healthybowl.crops.fieldDetail.form.type.hint", "Estimates follow the type: bed geometry for open fields and raised beds, bench, tree or rack geometry for the rest.")
|
|
1492
|
+
}),
|
|
1493
|
+
/* @__PURE__ */ l("div", {
|
|
1494
|
+
className: "mt-3",
|
|
1495
|
+
children: /* @__PURE__ */ l(xe, {
|
|
1496
|
+
type: O,
|
|
1497
|
+
value: zt,
|
|
1498
|
+
onChange: Bt,
|
|
1499
|
+
t: s,
|
|
1500
|
+
testIdPrefix: "field-detail-grow-geometry"
|
|
1501
|
+
})
|
|
1440
1502
|
})
|
|
1441
1503
|
] }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1443
1505
|
className: "text-sm font-medium text-text-primary",
|
|
1444
|
-
children:
|
|
1445
|
-
}), /* @__PURE__ */
|
|
1506
|
+
children: s("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
|
|
1507
|
+
}), /* @__PURE__ */ l("input", {
|
|
1446
1508
|
type: "text",
|
|
1447
|
-
value:
|
|
1448
|
-
onChange: (e) =>
|
|
1509
|
+
value: At,
|
|
1510
|
+
onChange: (e) => jt(e.target.value),
|
|
1449
1511
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1450
1512
|
})] }),
|
|
1451
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1452
1514
|
className: "text-sm font-medium text-text-primary",
|
|
1453
|
-
children:
|
|
1454
|
-
}), /* @__PURE__ */
|
|
1515
|
+
children: s("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
|
|
1516
|
+
}), /* @__PURE__ */ l("input", {
|
|
1455
1517
|
type: "text",
|
|
1456
|
-
value:
|
|
1457
|
-
onChange: (e) =>
|
|
1518
|
+
value: Mt,
|
|
1519
|
+
onChange: (e) => Nt(e.target.value),
|
|
1458
1520
|
className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
1459
1521
|
})] }),
|
|
1460
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ l("div", {
|
|
1461
1523
|
className: "sm:col-span-2",
|
|
1462
|
-
children: /* @__PURE__ */
|
|
1524
|
+
children: /* @__PURE__ */ u("label", {
|
|
1463
1525
|
className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
|
|
1464
|
-
children: [/* @__PURE__ */
|
|
1526
|
+
children: [/* @__PURE__ */ l("input", {
|
|
1465
1527
|
type: "checkbox",
|
|
1466
|
-
checked:
|
|
1467
|
-
onChange: (e) =>
|
|
1528
|
+
checked: Lt,
|
|
1529
|
+
onChange: (e) => Rt(e.target.checked),
|
|
1468
1530
|
className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
|
|
1469
|
-
}),
|
|
1531
|
+
}), s("healthybowl.crops.fieldDetail.form.organicCertified.label", "Organic Certified")]
|
|
1470
1532
|
})
|
|
1471
1533
|
})
|
|
1472
1534
|
]
|
|
1473
1535
|
})
|
|
1474
1536
|
}),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
toasts:
|
|
1477
|
-
onDismiss:
|
|
1537
|
+
/* @__PURE__ */ l(ne, {
|
|
1538
|
+
toasts: vt,
|
|
1539
|
+
onDismiss: yt
|
|
1478
1540
|
})
|
|
1479
1541
|
]
|
|
1480
|
-
}) : /* @__PURE__ */
|
|
1481
|
-
title:
|
|
1482
|
-
children:
|
|
1483
|
-
title:
|
|
1484
|
-
description:
|
|
1485
|
-
action: /* @__PURE__ */
|
|
1486
|
-
onClick: () => w(
|
|
1487
|
-
children:
|
|
1542
|
+
}) : /* @__PURE__ */ l(r, {
|
|
1543
|
+
title: s("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
|
|
1544
|
+
children: pt.crops ? /* @__PURE__ */ l(ae, {}) : ft.crops ? /* @__PURE__ */ l(te, { onRetry: gt }) : /* @__PURE__ */ l(ee, {
|
|
1545
|
+
title: s("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
|
|
1546
|
+
description: s("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
|
|
1547
|
+
action: /* @__PURE__ */ l(d, {
|
|
1548
|
+
onClick: () => C(w("crops/fields")),
|
|
1549
|
+
children: s("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
|
|
1488
1550
|
})
|
|
1489
1551
|
})
|
|
1490
1552
|
});
|
|
1491
|
-
},
|
|
1553
|
+
}, y = ({ label: e, unit: t, value: n, min: r, step: i, onChange: ee }) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
1492
1554
|
className: "text-xs font-medium text-text-secondary",
|
|
1493
1555
|
children: e
|
|
1494
|
-
}), /* @__PURE__ */
|
|
1556
|
+
}), /* @__PURE__ */ u("div", {
|
|
1495
1557
|
className: "relative mt-1",
|
|
1496
|
-
children: [/* @__PURE__ */
|
|
1558
|
+
children: [/* @__PURE__ */ l("input", {
|
|
1497
1559
|
type: "number",
|
|
1498
1560
|
value: n,
|
|
1499
1561
|
min: r,
|
|
1500
1562
|
step: i,
|
|
1501
1563
|
onChange: (e) => ee(e.target.value),
|
|
1502
1564
|
className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pe-8 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] [appearance:textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none"
|
|
1503
|
-
}), /* @__PURE__ */
|
|
1565
|
+
}), /* @__PURE__ */ l("span", {
|
|
1504
1566
|
className: "pointer-events-none absolute end-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
|
|
1505
1567
|
children: t
|
|
1506
1568
|
})]
|
|
1507
|
-
})] }),
|
|
1569
|
+
})] }), b = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ u("div", {
|
|
1508
1570
|
className: "flex min-w-0 flex-col rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
1509
|
-
children: [/* @__PURE__ */
|
|
1571
|
+
children: [/* @__PURE__ */ l("span", {
|
|
1510
1572
|
className: "block text-xs leading-tight text-text-secondary",
|
|
1511
1573
|
children: e
|
|
1512
|
-
}), /* @__PURE__ */
|
|
1574
|
+
}), /* @__PURE__ */ u("p", {
|
|
1513
1575
|
className: "mt-auto pt-1 text-lg font-semibold text-text-primary",
|
|
1514
|
-
children: [t, n && /* @__PURE__ */
|
|
1576
|
+
children: [t, n && /* @__PURE__ */ l("span", {
|
|
1515
1577
|
className: "ms-1 text-xs font-medium text-text-secondary",
|
|
1516
1578
|
children: n
|
|
1517
1579
|
})]
|
|
1518
1580
|
})]
|
|
1519
|
-
}),
|
|
1520
|
-
let
|
|
1521
|
-
return /* @__PURE__ */
|
|
1581
|
+
}), x = ({ label: e, sortKey: t, activeKey: n, direction: r, onSort: i, align: ee = "left" }) => {
|
|
1582
|
+
let te = n === t;
|
|
1583
|
+
return /* @__PURE__ */ l("th", {
|
|
1522
1584
|
scope: "col",
|
|
1523
|
-
"aria-sort":
|
|
1585
|
+
"aria-sort": te ? r === "asc" ? "ascending" : "descending" : "none",
|
|
1524
1586
|
className: `whitespace-nowrap px-3 py-2 text-xs font-medium ${ee === "right" ? "text-end" : "text-start"}`,
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1587
|
+
children: /* @__PURE__ */ u("button", {
|
|
1526
1588
|
type: "button",
|
|
1527
1589
|
onClick: () => i(t),
|
|
1528
|
-
className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${
|
|
1529
|
-
children: [e,
|
|
1590
|
+
className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${te ? "text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
1591
|
+
children: [e, te && l(r === "asc" ? Ve : s, {
|
|
1530
1592
|
className: "h-3 w-3",
|
|
1531
1593
|
"aria-hidden": "true"
|
|
1532
1594
|
})]
|
|
@@ -1534,6 +1596,6 @@ var et = (e) => {
|
|
|
1534
1596
|
});
|
|
1535
1597
|
};
|
|
1536
1598
|
//#endregion
|
|
1537
|
-
export {
|
|
1599
|
+
export { lt as FieldDetailsPage };
|
|
1538
1600
|
|
|
1539
1601
|
//# sourceMappingURL=FieldDetailsPage.js.map
|