@burdenoff/microfe-healthybowl 2026.813.21 → 2026.813.23

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.
Files changed (25) hide show
  1. package/dist/generated/wspace-operations.js +6 -0
  2. package/dist/generated/wspace-operations.js.map +1 -1
  3. package/dist/generated/wspace-types.js.map +1 -1
  4. package/dist/healthybowl/components/GrowGeometryInputs.js +109 -0
  5. package/dist/healthybowl/components/GrowGeometryInputs.js.map +1 -0
  6. package/dist/healthybowl/hooks/useHealthyBowlData.js +1 -0
  7. package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
  8. package/dist/healthybowl/pages/crops/CropFieldsPage.js +63 -51
  9. package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
  10. package/dist/healthybowl/pages/crops/CropPlanningPage.js +517 -432
  11. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  12. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +813 -751
  13. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  14. package/dist/healthybowl/pages/farm/FarmProfilePage.js +242 -143
  15. package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
  16. package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
  17. package/dist/healthybowl/pages/fields/FieldMapPage.js +549 -536
  18. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  19. package/dist/healthybowl/utils/farmCoordinates.js +17 -0
  20. package/dist/healthybowl/utils/farmCoordinates.js.map +1 -0
  21. package/dist/healthybowl/utils/growLocationType.js +19 -8
  22. package/dist/healthybowl/utils/growLocationType.js.map +1 -1
  23. package/dist/healthybowl/utils/plantingCapacity.js +73 -17
  24. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  25. package/package.json +1 -1
@@ -6,22 +6,22 @@ import { StatusBadge as a } from "../../components/StatusBadge.js";
6
6
  import { EmptyState as o } from "../../components/EmptyState.js";
7
7
  import { ErrorState as s } from "../../components/ErrorState.js";
8
8
  import { ToastContainer as c } from "../../components/Toast.js";
9
- import { Breadcrumbs as ee } from "../../components/Breadcrumbs.js";
10
- import { PageLoader as l } from "../../components/PageLoader.js";
11
- import { Modal as u } from "../../components/Modal.js";
12
- import { useToast as d } from "../../hooks/useToast.js";
9
+ import { Breadcrumbs as l } from "../../components/Breadcrumbs.js";
10
+ import { PageLoader as u } from "../../components/PageLoader.js";
11
+ import { Modal as ee } from "../../components/Modal.js";
12
+ import { useToast as te } from "../../hooks/useToast.js";
13
13
  import "../../components/index.js";
14
- import { useHealthyBowlData as te } from "../../hooks/useHealthyBowlData.js";
15
- import { BED_GEOMETRY_NOTICE as ne, BED_GEOMETRY_NOTICE_SHORT as f, growLocationTypeLabel as p, usesBedGeometry as m } from "../../utils/growLocationType.js";
16
- import { DEFAULT_BED_WIDTH_M as h, DEFAULT_CROP_SPACING_PRESET as re, DEFAULT_PATH_WIDTH_M as g, estimatePlantingCapacity as ie, getCropSpacingPreset as _ } from "../../utils/plantingCapacity.js";
17
- import { useEffect as ae, useMemo as v, useState as y } from "react";
14
+ import { useHealthyBowlData as d } from "../../hooks/useHealthyBowlData.js";
15
+ import { BED_GEOMETRY_NOTICE as f, BED_GEOMETRY_NOTICE_SHORT as p, GROW_GEOMETRY_PROMPT as m, capacityModelFor as h, growLocationTypeLabel as g, usesBedGeometry as _ } from "../../utils/growLocationType.js";
16
+ import { DEFAULT_BED_WIDTH_M as v, DEFAULT_CROP_SPACING_PRESET as ne, DEFAULT_PATH_WIDTH_M as y, estimateGrowCapacity as re, estimatePlantingCapacity as ie, getCropSpacingPreset as b } from "../../utils/plantingCapacity.js";
17
+ import { useEffect as ae, useMemo as x, useState as S } from "react";
18
18
  import { useI18n as oe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
- import { ArrowRight as b, Beaker as x, Calendar as se, ClipboardList as ce, MapPin as le, Plus as ue, Search as de, Sprout as fe, Target as pe } from "lucide-react";
19
+ import { ArrowRight as C, Beaker as w, Calendar as se, ClipboardList as ce, MapPin as le, Plus as ue, Search as de, Sprout as fe, Target as pe } from "lucide-react";
20
20
  import { useNavigate as me } from "react-router";
21
- import { Fragment as he, jsx as S, jsxs as C } from "react/jsx-runtime";
22
- import { Button as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "@burdenoff/fe-libs/ui";
21
+ import { Fragment as he, jsx as T, jsxs as E } from "react/jsx-runtime";
22
+ import { Button as D, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M } from "@burdenoff/fe-libs/ui";
23
23
  //#region src/healthybowl/pages/crops/CropPlanningPage.tsx
24
- var A = (e) => {
24
+ var N = (e) => {
25
25
  switch (e) {
26
26
  case "active": return "success";
27
27
  case "approved": return "info";
@@ -49,670 +49,728 @@ var A = (e) => {
49
49
  case "perennial": return t("healthybowl.crops.planning.season.perennial", "Perennial");
50
50
  default: return e;
51
51
  }
52
- }, j = (e) => (e ?? "").trim().toLowerCase(), ye = (e, t) => t.find((t) => e.fieldId ? t.id === e.fieldId : j(t.name) === j(e.fieldName)), M = (e, t) => t.find((t) => t.id === e.field || j(t.name) === j(e.fieldName)), be = (e, t) => e.cropId ? e.cropId === t.id : j(e.cropName) === j(t.name), xe = (e, t) => {
52
+ }, P = (e) => (e ?? "").trim().toLowerCase(), ye = (e, t) => t.find((t) => e.fieldId ? t.id === e.fieldId : P(t.name) === P(e.fieldName)), F = (e, t) => t.find((t) => t.id === e.field || P(t.name) === P(e.fieldName)), be = (e, t) => e.cropId ? e.cropId === t.id : P(e.cropName) === P(t.name), I = (e, t) => {
53
53
  let n = Number(e);
54
54
  return Number.isFinite(n) && n > 0 ? n : t;
55
- }, Se = (e, t) => {
55
+ }, xe = (e, t) => {
56
56
  let n = Number(e);
57
57
  return Number.isFinite(n) && n >= 0 ? n : t;
58
- }, Ce = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), we = (e, t) => {
59
- if (!t || !m(t.type)) return null;
60
- let n = _(e);
58
+ }, Se = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), Ce = (e, t) => {
59
+ if (!t || !_(t.type)) return null;
60
+ let n = b(e);
61
61
  return ie({
62
62
  fieldArea: t.area,
63
63
  fieldUnit: t.unit,
64
- bedWidthM: h,
65
- pathWidthM: g,
64
+ bedWidthM: v,
65
+ pathWidthM: y,
66
66
  plantSpacingCm: n.plantSpacingCm,
67
67
  rowSpacingCm: n.rowSpacingCm
68
68
  });
69
- }, N = () => {
70
- let { plantingPlans: e, fields: b, crops: x, errors: se, loadings: A, createPlantingPlan: ge, refetch: _e } = te(), { t: j } = oe(), N = me(), { buildPath: I } = n(), { toasts: De, toast: L, dismiss: Oe } = d(), [R, ke] = y(""), [z, Ae] = y("all"), [B, je] = y("all"), [Me, V] = y(!1), [H, Ne] = y(""), [U, W] = y(""), [Pe, G] = y("kharif"), [Fe, Ie] = y("low"), [Le, Re] = y(""), [ze, Be] = y(""), [Ve, He] = y(""), [Ue, We] = y(""), [K, Ge] = y(""), [q, J] = y(""), [Ke, qe] = y(String(re.plantSpacingCm)), [Je, Ye] = y(String(re.rowSpacingCm)), [Xe, Ze] = y(String(h)), [Qe, $e] = y(String(g)), et = () => {
71
- Ne(""), W(""), G("kharif"), Ie("low"), Re(""), Be(""), He(""), We("");
72
- }, tt = v(() => x.find((e) => e.id === K) ?? null, [K, x]), Y = v(() => b.find((e) => e.id === q) ?? null, [q, b]), X = v(() => _(tt), [tt]), nt = m(Y?.type), Z = v(() => !Y || !m(Y.type) ? null : ie({
73
- fieldArea: Y.area,
74
- fieldUnit: Y.unit,
75
- bedWidthM: xe(Xe, h),
76
- pathWidthM: Se(Qe, g),
77
- plantSpacingCm: xe(Ke, X.plantSpacingCm),
78
- rowSpacingCm: xe(Je, X.rowSpacingCm)
69
+ }, we = (e, t) => {
70
+ if (!t) return null;
71
+ let n = b(e);
72
+ return re({
73
+ type: t.type,
74
+ geometry: t.growGeometry,
75
+ fieldArea: t.area,
76
+ fieldUnit: t.unit,
77
+ plantSpacingCm: n.plantSpacingCm,
78
+ rowSpacingCm: n.rowSpacingCm
79
+ });
80
+ }, L = () => {
81
+ let { plantingPlans: e, fields: C, crops: w, errors: se, loadings: N, createPlantingPlan: ge, refetch: _e } = d(), { t: P } = oe(), L = me(), { buildPath: De } = n(), { toasts: Oe, toast: ke, dismiss: Ae } = te(), [je, Me] = S(""), [Ne, Pe] = S("all"), [Fe, Ie] = S("all"), [Le, B] = S(!1), [V, Re] = S(""), [H, ze] = S(""), [Be, Ve] = S("kharif"), [He, Ue] = S("low"), [We, Ge] = S(""), [Ke, qe] = S(""), [Je, Ye] = S(""), [Xe, Ze] = S(""), [U, Qe] = S(""), [W, $e] = S(""), [G, et] = S(String(ne.plantSpacingCm)), [K, tt] = S(String(ne.rowSpacingCm)), [nt, rt] = S(String(v)), [it, at] = S(String(y)), ot = () => {
82
+ Re(""), ze(""), Ve("kharif"), Ue("low"), Ge(""), qe(""), Ye(""), Ze("");
83
+ }, st = x(() => w.find((e) => e.id === U) ?? null, [U, w]), q = x(() => C.find((e) => e.id === W) ?? null, [W, C]), J = x(() => b(st), [st]), Y = _(q?.type), X = x(() => !q || !_(q.type) ? null : ie({
84
+ fieldArea: q.area,
85
+ fieldUnit: q.unit,
86
+ bedWidthM: I(nt, v),
87
+ pathWidthM: xe(it, y),
88
+ plantSpacingCm: I(G, J.plantSpacingCm),
89
+ rowSpacingCm: I(K, J.rowSpacingCm)
79
90
  }), [
80
- Xe,
81
- Qe,
82
- Ke,
83
- Je,
84
- Y,
85
- X
86
- ]), rt = v(() => x.find((e) => e.id === H) ?? null, [x, H]), Q = v(() => b.find((e) => e.id === U) ?? null, [b, U]), it = m(Q?.type), $ = v(() => {
87
- if (!rt || !Q || !m(Q.type)) return null;
88
- let e = _(rt);
91
+ nt,
92
+ it,
93
+ G,
94
+ K,
95
+ q,
96
+ J
97
+ ]), Z = x(() => !q || !st ? null : re({
98
+ type: q.type,
99
+ geometry: q.growGeometry,
100
+ fieldArea: q.area,
101
+ fieldUnit: q.unit,
102
+ plantSpacingCm: I(G, J.plantSpacingCm),
103
+ rowSpacingCm: I(K, J.rowSpacingCm)
104
+ }), [
105
+ q,
106
+ st,
107
+ G,
108
+ K,
109
+ J
110
+ ]), ct = x(() => w.find((e) => e.id === V) ?? null, [w, V]), Q = x(() => C.find((e) => e.id === H) ?? null, [C, H]), lt = _(Q?.type), $ = x(() => {
111
+ if (!ct || !Q || !_(Q.type)) return null;
112
+ let e = b(ct);
89
113
  return ie({
90
114
  fieldArea: Q.area,
91
115
  fieldUnit: Q.unit,
92
- bedWidthM: h,
93
- pathWidthM: g,
116
+ bedWidthM: v,
117
+ pathWidthM: y,
94
118
  plantSpacingCm: e.plantSpacingCm,
95
119
  rowSpacingCm: e.rowSpacingCm
96
120
  });
97
- }, [rt, Q]);
121
+ }, [ct, Q]);
98
122
  ae(() => {
99
- if (K || x.length === 0) return;
100
- let e = x[0], t = _(e), n = M(e, b);
101
- Ge(e.id), qe(String(t.plantSpacingCm)), Ye(String(t.rowSpacingCm)), n && J(n.id);
123
+ if (U || w.length === 0) return;
124
+ let e = w[0], t = b(e), n = F(e, C);
125
+ Qe(e.id), et(String(t.plantSpacingCm)), tt(String(t.rowSpacingCm)), n && $e(n.id);
102
126
  }, [
103
- K,
104
- x,
105
- b
127
+ U,
128
+ w,
129
+ C
106
130
  ]), ae(() => {
107
- q || b.length === 0 || J(b[0].id);
108
- }, [q, b]);
109
- let at = e.filter((e) => {
110
- let t = (e.cropName ?? "").toLowerCase().includes(R.toLowerCase()) || (e.fieldName ?? "").toLowerCase().includes(R.toLowerCase()), n = z === "all" || e.status === z, r = B === "all" || e.season === B;
131
+ W || C.length === 0 || $e(C[0].id);
132
+ }, [W, C]);
133
+ let ut = e.filter((e) => {
134
+ let t = (e.cropName ?? "").toLowerCase().includes(je.toLowerCase()) || (e.fieldName ?? "").toLowerCase().includes(je.toLowerCase()), n = Ne === "all" || e.status === Ne, r = Fe === "all" || e.season === Fe;
111
135
  return t && n && r;
112
- }), ot = e.length, st = e.reduce((e, t) => e + t.expectedYield, 0), ct = e.filter((e) => e.status === "active" || e.status === "approved").length, lt = [...new Set(e.map((e) => e.season))], ut = [...new Set(e.map((e) => e.status))], dt = e.reduce((e, t) => {
113
- let n = ye(t, b);
136
+ }), dt = e.length, ft = e.reduce((e, t) => e + t.expectedYield, 0), pt = e.filter((e) => e.status === "active" || e.status === "approved").length, mt = [...new Set(e.map((e) => e.season))], ht = [...new Set(e.map((e) => e.status))], gt = e.reduce((e, t) => {
137
+ let n = ye(t, C);
114
138
  return e + (n ? n.area : 0);
115
- }, 0), ft = x.map((t) => {
116
- let n = e.filter((e) => be(e, t)), r = M(t, b);
139
+ }, 0), _t = w.map((t) => {
140
+ let n = e.filter((e) => be(e, t)), r = F(t, C);
117
141
  return {
118
142
  crop: t,
119
143
  plans: n,
120
144
  activePlan: n.find((e) => e.status !== "completed") ?? n[0],
121
- capacityEstimate: we(t, r),
122
- capacityNotApplicableFor: r && !m(r.type) ? r : null
145
+ capacityEstimate: Ce(t, r),
146
+ growCapacityEstimate: we(t, r),
147
+ capacityNotApplicableFor: r && !_(r.type) && h(r.type) === "NONE" ? r : null,
148
+ awaitingGeometryFor: r && !_(r.type) && h(r.type) !== "NONE" && we(t, r) === null ? r : null
123
149
  };
124
- }), pt = ft.filter((e) => e.plans.length > 0).length, mt = (e) => {
125
- let t = x.find((t) => t.id === e);
126
- if (Ge(e), !t) return;
127
- let n = _(t), r = M(t, b);
128
- qe(String(n.plantSpacingCm)), Ye(String(n.rowSpacingCm)), r && J(r.id);
129
- }, ht = (e) => {
130
- let t = x.find((t) => t.id === e);
131
- if (Ne(e), !t) return;
132
- let n = M(t, b);
133
- G(t.season), n && W(n.id);
134
- }, gt = (e) => {
135
- let t = M(e, b);
136
- Ne(e.id), W(t?.id ?? ""), G(e.season), Re(e.plantingDate || ""), Be(e.expectedHarvestDate || ""), He(e.yieldEstimate ? String(e.yieldEstimate) : ""), We(""), V(!0);
150
+ }), vt = _t.filter((e) => e.plans.length > 0).length, yt = (e) => {
151
+ let t = w.find((t) => t.id === e);
152
+ if (Qe(e), !t) return;
153
+ let n = b(t), r = F(t, C);
154
+ et(String(n.plantSpacingCm)), tt(String(n.rowSpacingCm)), r && $e(r.id);
155
+ }, bt = (e) => {
156
+ let t = w.find((t) => t.id === e);
157
+ if (Re(e), !t) return;
158
+ let n = F(t, C);
159
+ Ve(t.season), n && ze(n.id);
160
+ }, xt = (e) => {
161
+ let t = F(e, C);
162
+ Re(e.id), ze(t?.id ?? ""), Ve(e.season), Ge(e.plantingDate || ""), qe(e.expectedHarvestDate || ""), Ye(e.yieldEstimate ? String(e.yieldEstimate) : ""), Ze(""), B(!0);
137
163
  };
138
- return /* @__PURE__ */ C(r, {
139
- title: j("healthybowl.crops.planning.title", "Crop Planning"),
140
- description: j("healthybowl.crops.planning.subtitle", "Manage planting plans and schedules"),
164
+ return /* @__PURE__ */ E(r, {
165
+ title: P("healthybowl.crops.planning.title", "Crop Planning"),
166
+ description: P("healthybowl.crops.planning.subtitle", "Manage planting plans and schedules"),
141
167
  purpose: "Decide what to plant where and when, before the season starts. A good plan helps you rotate crops, stagger planting for steady harvests, and make sure every field is working toward your goals.",
142
- actions: /* @__PURE__ */ C(w, {
143
- onClick: () => V(!0),
168
+ actions: /* @__PURE__ */ E(D, {
169
+ onClick: () => B(!0),
144
170
  children: [
145
- /* @__PURE__ */ S(ue, { className: "h-4 w-4" }),
171
+ /* @__PURE__ */ T(ue, { className: "h-4 w-4" }),
146
172
  " ",
147
- j("healthybowl.crops.planning.actions.addPlan", "Add New Plan")
173
+ P("healthybowl.crops.planning.actions.addPlan", "Add New Plan")
148
174
  ]
149
175
  }),
150
176
  children: [
151
- /* @__PURE__ */ S(ee, { items: [{
152
- label: j("healthybowl.crops.planning.breadcrumbs.crops", "Crops"),
153
- href: I("crops")
154
- }, { label: j("healthybowl.crops.planning.breadcrumbs.planning", "Planning") }] }),
155
- /* @__PURE__ */ C("div", {
177
+ /* @__PURE__ */ T(l, { items: [{
178
+ label: P("healthybowl.crops.planning.breadcrumbs.crops", "Crops"),
179
+ href: De("crops")
180
+ }, { label: P("healthybowl.crops.planning.breadcrumbs.planning", "Planning") }] }),
181
+ /* @__PURE__ */ E("div", {
156
182
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
157
183
  children: [
158
- /* @__PURE__ */ S(i, {
184
+ /* @__PURE__ */ T(i, {
159
185
  hero: !0,
160
- label: j("healthybowl.crops.planning.stats.totalPlans.label", "Total Plans"),
161
- value: ot,
162
- icon: /* @__PURE__ */ S(ce, { className: "h-5 w-5" })
163
- }),
164
- /* @__PURE__ */ S(i, {
165
- label: j("healthybowl.crops.planning.stats.plannedArea.label", "Planned Area"),
186
+ label: P("healthybowl.crops.planning.stats.totalPlans.label", "Total Plans"),
166
187
  value: dt,
188
+ icon: /* @__PURE__ */ T(ce, { className: "h-5 w-5" })
189
+ }),
190
+ /* @__PURE__ */ T(i, {
191
+ label: P("healthybowl.crops.planning.stats.plannedArea.label", "Planned Area"),
192
+ value: gt,
167
193
  unit: "acres",
168
- icon: /* @__PURE__ */ S(le, { className: "h-5 w-5" })
194
+ icon: /* @__PURE__ */ T(le, { className: "h-5 w-5" })
169
195
  }),
170
- /* @__PURE__ */ S(i, {
171
- label: j("healthybowl.crops.planning.stats.expectedYield.label", "Expected Yield"),
172
- value: st,
196
+ /* @__PURE__ */ T(i, {
197
+ label: P("healthybowl.crops.planning.stats.expectedYield.label", "Expected Yield"),
198
+ value: ft,
173
199
  unit: "kg",
174
- icon: /* @__PURE__ */ S(pe, { className: "h-5 w-5" })
200
+ icon: /* @__PURE__ */ T(pe, { className: "h-5 w-5" })
175
201
  }),
176
- /* @__PURE__ */ S(i, {
177
- label: j("healthybowl.crops.planning.stats.activePlans.label", "Active Plans"),
178
- value: ct,
179
- icon: /* @__PURE__ */ S(fe, { className: "h-5 w-5" })
202
+ /* @__PURE__ */ T(i, {
203
+ label: P("healthybowl.crops.planning.stats.activePlans.label", "Active Plans"),
204
+ value: pt,
205
+ icon: /* @__PURE__ */ T(fe, { className: "h-5 w-5" })
180
206
  })
181
207
  ]
182
208
  }),
183
- /* @__PURE__ */ C("div", {
209
+ /* @__PURE__ */ E("div", {
184
210
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
185
211
  children: [
186
- /* @__PURE__ */ C("div", {
212
+ /* @__PURE__ */ E("div", {
187
213
  className: "relative flex-1",
188
- children: [/* @__PURE__ */ S(de, { className: "absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ S("input", {
214
+ children: [/* @__PURE__ */ T(de, { className: "absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ T("input", {
189
215
  type: "text",
190
- value: R,
191
- onChange: (e) => ke(e.target.value),
192
- placeholder: j("healthybowl.crops.planning.search.placeholder", "Search plans by crop or field..."),
216
+ value: je,
217
+ onChange: (e) => Me(e.target.value),
218
+ placeholder: P("healthybowl.crops.planning.search.placeholder", "Search plans by crop or field..."),
193
219
  className: "w-full rounded-md border border-border-subtle bg-bg-surface py-2 ps-10 pe-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
194
220
  })]
195
221
  }),
196
- /* @__PURE__ */ C(T, {
197
- value: z,
198
- onValueChange: Ae,
199
- children: [/* @__PURE__ */ S(O, {
222
+ /* @__PURE__ */ E(O, {
223
+ value: Ne,
224
+ onValueChange: Pe,
225
+ children: [/* @__PURE__ */ T(j, {
200
226
  className: "h-9 w-auto",
201
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.filters.allStatuses", "All Statuses") })
202
- }), /* @__PURE__ */ C(E, { children: [/* @__PURE__ */ S(D, {
227
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.filters.allStatuses", "All Statuses") })
228
+ }), /* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T(A, {
203
229
  value: "all",
204
- children: j("healthybowl.crops.planning.filters.allStatuses", "All Statuses")
205
- }), ut.map((e) => /* @__PURE__ */ S(D, {
230
+ children: P("healthybowl.crops.planning.filters.allStatuses", "All Statuses")
231
+ }), ht.map((e) => /* @__PURE__ */ T(A, {
206
232
  value: e,
207
233
  children: (e ?? "").charAt(0).toUpperCase() + (e ?? "").slice(1)
208
234
  }, e))] })]
209
235
  }),
210
- /* @__PURE__ */ C(T, {
211
- value: B,
212
- onValueChange: je,
213
- children: [/* @__PURE__ */ S(O, {
236
+ /* @__PURE__ */ E(O, {
237
+ value: Fe,
238
+ onValueChange: Ie,
239
+ children: [/* @__PURE__ */ T(j, {
214
240
  className: "h-9 w-auto",
215
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.filters.allSeasons", "All Seasons") })
216
- }), /* @__PURE__ */ C(E, { children: [/* @__PURE__ */ S(D, {
241
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.filters.allSeasons", "All Seasons") })
242
+ }), /* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T(A, {
217
243
  value: "all",
218
- children: j("healthybowl.crops.planning.filters.allSeasons", "All Seasons")
219
- }), lt.map((e) => /* @__PURE__ */ S(D, {
244
+ children: P("healthybowl.crops.planning.filters.allSeasons", "All Seasons")
245
+ }), mt.map((e) => /* @__PURE__ */ T(A, {
220
246
  value: e,
221
- children: ve(e, j)
247
+ children: ve(e, P)
222
248
  }, e))] })]
223
249
  })
224
250
  ]
225
251
  }),
226
- /* @__PURE__ */ C("div", {
252
+ /* @__PURE__ */ E("div", {
227
253
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
228
254
  children: [
229
- /* @__PURE__ */ C("div", {
255
+ /* @__PURE__ */ E("div", {
230
256
  className: "flex flex-wrap items-center justify-between gap-3",
231
- children: [/* @__PURE__ */ S("h2", {
257
+ children: [/* @__PURE__ */ T("h2", {
232
258
  className: "text-sm font-semibold text-text-primary",
233
- children: j("healthybowl.crops.planning.capacity.title", "Planting capacity")
234
- }), /* @__PURE__ */ S(a, {
235
- label: nt ? X.label : p(j, Y?.type),
259
+ children: P("healthybowl.crops.planning.capacity.title", "Planting capacity")
260
+ }), /* @__PURE__ */ T(a, {
261
+ label: Y ? J.label : g(P, q?.type),
236
262
  variant: "muted"
237
263
  })]
238
264
  }),
239
- /* @__PURE__ */ C("div", {
265
+ /* @__PURE__ */ E("div", {
240
266
  className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-6",
241
267
  children: [
242
- /* @__PURE__ */ C("div", {
268
+ /* @__PURE__ */ E("div", {
243
269
  className: "xl:col-span-2",
244
- children: [/* @__PURE__ */ S("label", {
270
+ children: [/* @__PURE__ */ T("label", {
245
271
  className: "text-xs font-medium text-text-secondary",
246
- children: j("healthybowl.crops.planning.capacity.crop", "Crop")
247
- }), /* @__PURE__ */ C(T, {
248
- value: K,
249
- onValueChange: mt,
250
- children: [/* @__PURE__ */ S(O, {
272
+ children: P("healthybowl.crops.planning.capacity.crop", "Crop")
273
+ }), /* @__PURE__ */ E(O, {
274
+ value: U,
275
+ onValueChange: yt,
276
+ children: [/* @__PURE__ */ T(j, {
251
277
  className: "mt-1 w-full",
252
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.capacity.cropPlaceholder", "Select crop") })
253
- }), /* @__PURE__ */ S(E, { children: x.map((e) => /* @__PURE__ */ S(D, {
278
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.capacity.cropPlaceholder", "Select crop") })
279
+ }), /* @__PURE__ */ T(k, { children: w.map((e) => /* @__PURE__ */ T(A, {
254
280
  value: e.id,
255
281
  children: e.variety ? `${e.name} - ${e.variety}` : e.name
256
282
  }, e.id)) })]
257
283
  })]
258
284
  }),
259
- /* @__PURE__ */ C("div", {
285
+ /* @__PURE__ */ E("div", {
260
286
  className: "xl:col-span-2",
261
- children: [/* @__PURE__ */ S("label", {
287
+ children: [/* @__PURE__ */ T("label", {
262
288
  className: "text-xs font-medium text-text-secondary",
263
- children: j("healthybowl.crops.planning.capacity.field", "Field")
264
- }), /* @__PURE__ */ C(T, {
265
- value: q,
266
- onValueChange: J,
267
- children: [/* @__PURE__ */ S(O, {
289
+ children: P("healthybowl.crops.planning.capacity.field", "Field")
290
+ }), /* @__PURE__ */ E(O, {
291
+ value: W,
292
+ onValueChange: $e,
293
+ children: [/* @__PURE__ */ T(j, {
268
294
  className: "mt-1 w-full",
269
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.capacity.fieldPlaceholder", "Select field") })
270
- }), /* @__PURE__ */ S(E, { children: b.map((e) => /* @__PURE__ */ S(D, {
295
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.capacity.fieldPlaceholder", "Select field") })
296
+ }), /* @__PURE__ */ T(k, { children: C.map((e) => /* @__PURE__ */ T(A, {
271
297
  value: e.id,
272
- children: `${e.name} · ${p(j, e.type)}`
298
+ children: `${e.name} · ${g(P, e.type)}`
273
299
  }, e.id)) })]
274
300
  })]
275
301
  }),
276
- nt && /* @__PURE__ */ C(he, { children: [
277
- /* @__PURE__ */ S(P, {
278
- label: j("healthybowl.crops.planning.capacity.plantSpacing", "Plant spacing"),
302
+ (Y || q != null && h(q.type) !== "NONE") && /* @__PURE__ */ E(he, { children: [
303
+ /* @__PURE__ */ T(R, {
304
+ label: P("healthybowl.crops.planning.capacity.plantSpacing", "Plant spacing"),
279
305
  unit: "cm",
280
- value: Ke,
306
+ value: G,
281
307
  min: "1",
282
308
  step: "1",
283
- onChange: qe
309
+ onChange: et
284
310
  }),
285
- /* @__PURE__ */ S(P, {
286
- label: j("healthybowl.crops.planning.capacity.rowSpacing", "Row spacing"),
311
+ /* @__PURE__ */ T(R, {
312
+ label: P("healthybowl.crops.planning.capacity.rowSpacing", "Row spacing"),
287
313
  unit: "cm",
288
- value: Je,
314
+ value: K,
289
315
  min: "1",
290
316
  step: "1",
291
- onChange: Ye
317
+ onChange: tt
292
318
  }),
293
- /* @__PURE__ */ S(P, {
294
- label: j("healthybowl.crops.planning.capacity.bedWidth", "Bed width"),
319
+ Y && /* @__PURE__ */ E(he, { children: [/* @__PURE__ */ T(R, {
320
+ label: P("healthybowl.crops.planning.capacity.bedWidth", "Bed width"),
295
321
  unit: "m",
296
- value: Xe,
322
+ value: nt,
297
323
  min: "0.1",
298
324
  step: "0.1",
299
- onChange: Ze
300
- }),
301
- /* @__PURE__ */ S(P, {
302
- label: j("healthybowl.crops.planning.capacity.pathWidth", "Path width"),
325
+ onChange: rt
326
+ }), /* @__PURE__ */ T(R, {
327
+ label: P("healthybowl.crops.planning.capacity.pathWidth", "Path width"),
303
328
  unit: "m",
304
- value: Qe,
329
+ value: it,
305
330
  min: "0",
306
331
  step: "0.05",
307
- onChange: $e
308
- })
332
+ onChange: at
333
+ })] })
309
334
  ] })
310
335
  ]
311
336
  }),
312
- !nt && Y ? /* @__PURE__ */ S("p", {
337
+ Z ? /* @__PURE__ */ E("div", {
338
+ className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5",
339
+ "data-testid": "planning-grow-capacity",
340
+ "data-model": Z.model,
341
+ children: [
342
+ /* @__PURE__ */ T(z, {
343
+ label: Z.model === "TREE" ? P("healthybowl.crops.planning.capacity.metrics.block", "Block") : Z.model === "RACK" ? P("healthybowl.crops.planning.capacity.metrics.racks", "Racks") : P("healthybowl.crops.planning.capacity.metrics.benches", "Benches"),
344
+ value: t(Z.unitCount)
345
+ }),
346
+ /* @__PURE__ */ T(z, {
347
+ label: P("healthybowl.crops.planning.capacity.metrics.plantsPerUnit", "Plants / unit"),
348
+ value: t(Z.plantsPerUnit)
349
+ }),
350
+ /* @__PURE__ */ T(z, {
351
+ label: Z.model === "TREE" ? P("healthybowl.crops.planning.capacity.metrics.totalTrees", "Total trees") : P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
352
+ value: t(Z.totalPlants)
353
+ }),
354
+ Z.seedlingTarget != null && /* @__PURE__ */ T(z, {
355
+ label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
356
+ value: t(Z.seedlingTarget)
357
+ }),
358
+ /* @__PURE__ */ T(z, {
359
+ label: P("healthybowl.crops.planning.capacity.metrics.growingArea", "Growing area"),
360
+ value: Se(Z.usableAreaSqm, 1),
361
+ unit: "m²"
362
+ })
363
+ ]
364
+ }) : q && !Y && h(q.type) !== "NONE" ? /* @__PURE__ */ T("p", {
313
365
  className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
314
- children: j(ne.key, ne.defaultValue, { type: p(j, Y.type) })
315
- }) : Z ? /* @__PURE__ */ C("div", {
366
+ "data-testid": "planning-grow-geometry-prompt",
367
+ children: P(m.key, m.defaultValue, { type: g(P, q.type) })
368
+ }) : !Y && q ? /* @__PURE__ */ T("p", {
369
+ className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
370
+ children: P(f.key, f.defaultValue, { type: g(P, q.type) })
371
+ }) : X ? /* @__PURE__ */ E("div", {
316
372
  className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
317
373
  children: [
318
- /* @__PURE__ */ S(F, {
319
- label: j("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
320
- value: t(Z.bedCount)
374
+ /* @__PURE__ */ T(z, {
375
+ label: P("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
376
+ value: t(X.bedCount)
321
377
  }),
322
- /* @__PURE__ */ S(F, {
323
- label: j("healthybowl.crops.planning.capacity.metrics.rowsPerBed", "Rows / bed"),
324
- value: t(Z.rowsPerBed)
378
+ /* @__PURE__ */ T(z, {
379
+ label: P("healthybowl.crops.planning.capacity.metrics.rowsPerBed", "Rows / bed"),
380
+ value: t(X.rowsPerBed)
325
381
  }),
326
- /* @__PURE__ */ S(F, {
327
- label: j("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
328
- value: t(Z.plantsPerBed)
382
+ /* @__PURE__ */ T(z, {
383
+ label: P("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
384
+ value: t(X.plantsPerBed)
329
385
  }),
330
- /* @__PURE__ */ S(F, {
331
- label: j("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
332
- value: t(Z.totalPlants)
386
+ /* @__PURE__ */ T(z, {
387
+ label: P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
388
+ value: t(X.totalPlants)
333
389
  }),
334
- /* @__PURE__ */ S(F, {
335
- label: j("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
336
- value: t(Z.seedlingTarget)
390
+ /* @__PURE__ */ T(z, {
391
+ label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
392
+ value: t(X.seedlingTarget)
337
393
  }),
338
- /* @__PURE__ */ S(F, {
339
- label: j("healthybowl.crops.planning.capacity.metrics.bedLength", "Bed length"),
340
- value: Ce(Z.bedLengthM),
394
+ /* @__PURE__ */ T(z, {
395
+ label: P("healthybowl.crops.planning.capacity.metrics.bedLength", "Bed length"),
396
+ value: Se(X.bedLengthM),
341
397
  unit: "m"
342
398
  })
343
399
  ]
344
- }) : /* @__PURE__ */ S("p", {
400
+ }) : /* @__PURE__ */ T("p", {
345
401
  className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
346
- children: j("healthybowl.crops.planning.capacity.empty", "Select a crop and field to calculate beds and plants.")
402
+ children: P("healthybowl.crops.planning.capacity.empty", "Select a crop and field to calculate beds and plants.")
347
403
  })
348
404
  ]
349
405
  }),
350
- /* @__PURE__ */ C("div", {
406
+ /* @__PURE__ */ E("div", {
351
407
  className: "space-y-3",
352
- children: [/* @__PURE__ */ C("div", {
408
+ children: [/* @__PURE__ */ E("div", {
353
409
  className: "flex flex-wrap items-center justify-between gap-3",
354
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
410
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
355
411
  className: "text-sm font-semibold text-text-primary",
356
- children: j("healthybowl.crops.planning.coverage.title", "Crop planning coverage")
357
- }), /* @__PURE__ */ S("p", {
412
+ children: P("healthybowl.crops.planning.coverage.title", "Crop planning coverage")
413
+ }), /* @__PURE__ */ T("p", {
358
414
  className: "mt-1 text-xs text-text-secondary",
359
- children: j("healthybowl.crops.planning.coverage.description", "Every crop is listed here so missing plans are easy to spot.")
360
- })] }), /* @__PURE__ */ S(a, {
361
- label: j("healthybowl.crops.planning.coverage.status", "{{planned}} / {{total}} planned", {
362
- planned: pt,
363
- total: x.length
415
+ children: P("healthybowl.crops.planning.coverage.description", "Every crop is listed here so missing plans are easy to spot.")
416
+ })] }), /* @__PURE__ */ T(a, {
417
+ label: P("healthybowl.crops.planning.coverage.status", "{{planned}} / {{total}} planned", {
418
+ planned: vt,
419
+ total: w.length
364
420
  }),
365
- variant: pt === x.length && x.length > 0 ? "success" : "warning"
421
+ variant: vt === w.length && w.length > 0 ? "success" : "warning"
366
422
  })]
367
- }), x.length > 0 ? /* @__PURE__ */ S("div", {
423
+ }), w.length > 0 ? /* @__PURE__ */ T("div", {
368
424
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",
369
- children: ft.map(({ crop: e, activePlan: t, plans: n, capacityEstimate: r, capacityNotApplicableFor: i }) => /* @__PURE__ */ S(Te, {
425
+ children: _t.map(({ crop: e, activePlan: t, plans: n, capacityEstimate: r, capacityNotApplicableFor: i, growCapacityEstimate: a, awaitingGeometryFor: o }) => /* @__PURE__ */ T(Te, {
370
426
  crop: e,
371
427
  plan: t,
372
428
  planCount: n.length,
373
429
  capacityEstimate: r,
374
430
  capacityNotApplicableFor: i,
375
- onPlan: () => gt(e),
376
- onViewCrop: () => N(I(`crops/${e.id}`)),
377
- onViewPlan: () => t && N(I(`crops/planning/${t.id}`))
431
+ growCapacityEstimate: a,
432
+ awaitingGeometryFor: o,
433
+ onPlan: () => xt(e),
434
+ onViewCrop: () => L(De(`crops/${e.id}`)),
435
+ onViewPlan: () => t && L(De(`crops/planning/${t.id}`))
378
436
  }, e.id))
379
- }) : A.crops ? /* @__PURE__ */ S(l, {}) : /* @__PURE__ */ S("p", {
437
+ }) : N.crops ? /* @__PURE__ */ T(u, {}) : /* @__PURE__ */ T("p", {
380
438
  className: "rounded-md border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary",
381
- children: j("healthybowl.crops.planning.coverage.empty", "No crops available yet. Add crops before planning.")
439
+ children: P("healthybowl.crops.planning.coverage.empty", "No crops available yet. Add crops before planning.")
382
440
  })]
383
441
  }),
384
- at.length > 0 ? /* @__PURE__ */ S("div", {
442
+ ut.length > 0 ? /* @__PURE__ */ T("div", {
385
443
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",
386
- children: at.map((e) => /* @__PURE__ */ S(Ee, {
444
+ children: ut.map((e) => /* @__PURE__ */ T(Ee, {
387
445
  plan: e,
388
- onClick: () => N(I(`crops/planning/${e.id}`))
446
+ onClick: () => L(De(`crops/planning/${e.id}`))
389
447
  }, e.id))
390
- }) : A.crops ? /* @__PURE__ */ S(l, {}) : se.crops ? /* @__PURE__ */ S(s, { onRetry: _e }) : /* @__PURE__ */ S(o, {
391
- title: j("healthybowl.crops.planning.emptyState.title", "No plans found"),
392
- description: R || z !== "all" || B !== "all" ? j("healthybowl.crops.planning.emptyState.filtered", "Try adjusting your search or filters.") : j("healthybowl.crops.planning.emptyState.message", "Get started by creating a new planting plan."),
393
- action: /* @__PURE__ */ S(w, {
394
- onClick: () => V(!0),
395
- children: j("healthybowl.crops.planning.actions.createPlan", "Create Plan")
448
+ }) : N.crops ? /* @__PURE__ */ T(u, {}) : se.crops ? /* @__PURE__ */ T(s, { onRetry: _e }) : /* @__PURE__ */ T(o, {
449
+ title: P("healthybowl.crops.planning.emptyState.title", "No plans found"),
450
+ description: je || Ne !== "all" || Fe !== "all" ? P("healthybowl.crops.planning.emptyState.filtered", "Try adjusting your search or filters.") : P("healthybowl.crops.planning.emptyState.message", "Get started by creating a new planting plan."),
451
+ action: /* @__PURE__ */ T(D, {
452
+ onClick: () => B(!0),
453
+ children: P("healthybowl.crops.planning.actions.createPlan", "Create Plan")
396
454
  })
397
455
  }),
398
- /* @__PURE__ */ S(u, {
399
- open: Me,
456
+ /* @__PURE__ */ T(ee, {
457
+ open: Le,
400
458
  onClose: () => {
401
- V(!1), et();
459
+ B(!1), ot();
402
460
  },
403
- title: j("healthybowl.crops.planning.modal.title", "Add New Planting Plan"),
404
- description: j("healthybowl.crops.planning.modal.description", "Create a new planting plan for your farm"),
461
+ title: P("healthybowl.crops.planning.modal.title", "Add New Planting Plan"),
462
+ description: P("healthybowl.crops.planning.modal.description", "Create a new planting plan for your farm"),
405
463
  size: "lg",
406
- footer: /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ S(w, {
464
+ footer: /* @__PURE__ */ E(he, { children: [/* @__PURE__ */ T(D, {
407
465
  variant: "outline",
408
466
  onClick: () => {
409
- V(!1), et();
467
+ B(!1), ot();
410
468
  },
411
- children: j("healthybowl.common.cancel", "Cancel")
412
- }), /* @__PURE__ */ S(w, {
469
+ children: P("healthybowl.common.cancel", "Cancel")
470
+ }), /* @__PURE__ */ T(D, {
413
471
  onClick: async () => {
414
- if (!H || !U) {
415
- L({
416
- title: j("healthybowl.crops.planning.toast.missingFields.title", "Missing required fields"),
417
- description: j("healthybowl.crops.planning.toast.missingFields.description", "Please select a crop and field."),
472
+ if (!V || !H) {
473
+ ke({
474
+ title: P("healthybowl.crops.planning.toast.missingFields.title", "Missing required fields"),
475
+ description: P("healthybowl.crops.planning.toast.missingFields.description", "Please select a crop and field."),
418
476
  variant: "warning"
419
477
  });
420
478
  return;
421
479
  }
422
480
  try {
423
- let e = x.find((e) => e.id === H);
481
+ let e = w.find((e) => e.id === V);
424
482
  if (!e) {
425
- L({
426
- title: j("healthybowl.crops.planning.toast.cropNotFound.title", "Crop not found"),
427
- description: j("healthybowl.crops.planning.toast.cropNotFound.description", "Please select a valid crop."),
483
+ ke({
484
+ title: P("healthybowl.crops.planning.toast.cropNotFound.title", "Crop not found"),
485
+ description: P("healthybowl.crops.planning.toast.cropNotFound.description", "Please select a valid crop."),
428
486
  variant: "warning"
429
487
  });
430
488
  return;
431
489
  }
432
490
  await ge({
433
491
  cropId: e.id,
434
- fieldId: U,
435
- season: Pe,
436
- startDate: Le || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
437
- endDate: ze || void 0,
438
- expectedYield: Number(Ve) || 0,
439
- seedRequired: Number(Ue) || 0,
492
+ fieldId: H,
493
+ season: Be,
494
+ startDate: We || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
495
+ endDate: Ke || void 0,
496
+ expectedYield: Number(Je) || 0,
497
+ seedRequired: Number(Xe) || 0,
440
498
  fertilizers: [],
441
- priority: Fe,
499
+ priority: He,
442
500
  weatherRisk: "low"
443
- }), L({
444
- title: j("healthybowl.crops.planning.toast.planCreated.title", "Plan created"),
445
- description: j("healthybowl.crops.planning.toast.planCreated.description", "New planting plan has been added."),
501
+ }), ke({
502
+ title: P("healthybowl.crops.planning.toast.planCreated.title", "Plan created"),
503
+ description: P("healthybowl.crops.planning.toast.planCreated.description", "New planting plan has been added."),
446
504
  variant: "success"
447
- }), V(!1), et();
505
+ }), B(!1), ot();
448
506
  } catch (e) {
449
- L({
450
- title: j("healthybowl.crops.planning.toast.error.title", "Error"),
451
- description: e instanceof Error ? e.message : j("healthybowl.crops.planning.toast.error.description", "Failed to create planting plan"),
507
+ ke({
508
+ title: P("healthybowl.crops.planning.toast.error.title", "Error"),
509
+ description: e instanceof Error ? e.message : P("healthybowl.crops.planning.toast.error.description", "Failed to create planting plan"),
452
510
  variant: "error"
453
511
  });
454
512
  }
455
513
  },
456
- children: j("healthybowl.crops.planning.actions.createPlan", "Create Plan")
514
+ children: P("healthybowl.crops.planning.actions.createPlan", "Create Plan")
457
515
  })] }),
458
- children: /* @__PURE__ */ C("div", {
516
+ children: /* @__PURE__ */ E("div", {
459
517
  className: "grid gap-4 sm:grid-cols-2",
460
518
  children: [
461
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
519
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
462
520
  className: "text-sm font-medium text-text-primary",
463
- children: j("healthybowl.crops.planning.form.fields.cropName.label", "Crop Name")
464
- }), /* @__PURE__ */ C(T, {
465
- value: H,
466
- onValueChange: ht,
467
- children: [/* @__PURE__ */ S(O, {
521
+ children: P("healthybowl.crops.planning.form.fields.cropName.label", "Crop Name")
522
+ }), /* @__PURE__ */ E(O, {
523
+ value: V,
524
+ onValueChange: bt,
525
+ children: [/* @__PURE__ */ T(j, {
468
526
  className: "mt-1 w-full",
469
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.form.fields.cropName.placeholder", "Select crop...") })
470
- }), /* @__PURE__ */ S(E, { children: x.map((e) => /* @__PURE__ */ S(D, {
527
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.form.fields.cropName.placeholder", "Select crop...") })
528
+ }), /* @__PURE__ */ T(k, { children: w.map((e) => /* @__PURE__ */ T(A, {
471
529
  value: e.id,
472
530
  children: e.variety ? `${e.name} - ${e.variety}` : e.name
473
531
  }, e.id)) })]
474
532
  })] }),
475
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
533
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
476
534
  className: "text-sm font-medium text-text-primary",
477
- children: j("healthybowl.crops.planning.form.fields.field.label", "Field")
478
- }), /* @__PURE__ */ C(T, {
479
- value: U,
480
- onValueChange: W,
481
- children: [/* @__PURE__ */ S(O, {
535
+ children: P("healthybowl.crops.planning.form.fields.field.label", "Field")
536
+ }), /* @__PURE__ */ E(O, {
537
+ value: H,
538
+ onValueChange: ze,
539
+ children: [/* @__PURE__ */ T(j, {
482
540
  className: "mt-1 w-full",
483
- children: /* @__PURE__ */ S(k, { placeholder: j("healthybowl.crops.planning.form.fields.field.placeholder", "Select field...") })
484
- }), /* @__PURE__ */ S(E, { children: b.map((e) => /* @__PURE__ */ S(D, {
541
+ children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.form.fields.field.placeholder", "Select field...") })
542
+ }), /* @__PURE__ */ T(k, { children: C.map((e) => /* @__PURE__ */ T(A, {
485
543
  value: e.id,
486
- children: `${e.name} · ${p(j, e.type)}`
544
+ children: `${e.name} · ${g(P, e.type)}`
487
545
  }, e.id)) })]
488
546
  })] }),
489
- Q && !it && /* @__PURE__ */ S("p", {
547
+ Q && !lt && h(Q.type) === "NONE" && /* @__PURE__ */ T("p", {
490
548
  className: "rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary sm:col-span-2",
491
- children: j(f.key, f.defaultValue, { type: p(j, Q.type) })
549
+ children: P(p.key, p.defaultValue, { type: g(P, Q.type) })
492
550
  }),
493
- $ && /* @__PURE__ */ S("div", {
551
+ $ && /* @__PURE__ */ T("div", {
494
552
  className: "rounded-md border border-border-subtle bg-bg-sunken/60 p-3 sm:col-span-2",
495
- children: /* @__PURE__ */ C("div", {
553
+ children: /* @__PURE__ */ E("div", {
496
554
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
497
555
  children: [
498
- /* @__PURE__ */ S(F, {
556
+ /* @__PURE__ */ T(z, {
499
557
  compact: !0,
500
- label: j("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
558
+ label: P("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
501
559
  value: t($.bedCount)
502
560
  }),
503
- /* @__PURE__ */ S(F, {
561
+ /* @__PURE__ */ T(z, {
504
562
  compact: !0,
505
- label: j("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
563
+ label: P("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
506
564
  value: t($.plantsPerBed)
507
565
  }),
508
- /* @__PURE__ */ S(F, {
566
+ /* @__PURE__ */ T(z, {
509
567
  compact: !0,
510
- label: j("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
568
+ label: P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
511
569
  value: t($.totalPlants)
512
570
  }),
513
- /* @__PURE__ */ S(F, {
571
+ /* @__PURE__ */ T(z, {
514
572
  compact: !0,
515
- label: j("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
573
+ label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
516
574
  value: t($.seedlingTarget)
517
575
  })
518
576
  ]
519
577
  })
520
578
  }),
521
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
579
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
522
580
  className: "text-sm font-medium text-text-primary",
523
- children: j("healthybowl.crops.planning.form.fields.season.label", "Season")
524
- }), /* @__PURE__ */ C(T, {
525
- value: Pe,
526
- onValueChange: (e) => G(e),
527
- children: [/* @__PURE__ */ S(O, {
581
+ children: P("healthybowl.crops.planning.form.fields.season.label", "Season")
582
+ }), /* @__PURE__ */ E(O, {
583
+ value: Be,
584
+ onValueChange: (e) => Ve(e),
585
+ children: [/* @__PURE__ */ T(j, {
528
586
  className: "mt-1 w-full",
529
- children: /* @__PURE__ */ S(k, {})
530
- }), /* @__PURE__ */ C(E, { children: [
531
- /* @__PURE__ */ S(D, {
587
+ children: /* @__PURE__ */ T(M, {})
588
+ }), /* @__PURE__ */ E(k, { children: [
589
+ /* @__PURE__ */ T(A, {
532
590
  value: "kharif",
533
- children: j("healthybowl.crops.planning.season.kharif", "Kharif")
591
+ children: P("healthybowl.crops.planning.season.kharif", "Kharif")
534
592
  }),
535
- /* @__PURE__ */ S(D, {
593
+ /* @__PURE__ */ T(A, {
536
594
  value: "rabi",
537
- children: j("healthybowl.crops.planning.season.rabi", "Rabi")
595
+ children: P("healthybowl.crops.planning.season.rabi", "Rabi")
538
596
  }),
539
- /* @__PURE__ */ S(D, {
597
+ /* @__PURE__ */ T(A, {
540
598
  value: "zaid",
541
- children: j("healthybowl.crops.planning.season.zaid", "Zaid")
599
+ children: P("healthybowl.crops.planning.season.zaid", "Zaid")
542
600
  }),
543
- /* @__PURE__ */ S(D, {
601
+ /* @__PURE__ */ T(A, {
544
602
  value: "perennial",
545
- children: j("healthybowl.crops.planning.season.perennial", "Perennial")
603
+ children: P("healthybowl.crops.planning.season.perennial", "Perennial")
546
604
  })
547
605
  ] })]
548
606
  })] }),
549
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
607
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
550
608
  className: "text-sm font-medium text-text-primary",
551
- children: j("healthybowl.crops.planning.form.fields.priority.label", "Priority")
552
- }), /* @__PURE__ */ C(T, {
553
- value: Fe,
554
- onValueChange: (e) => Ie(e),
555
- children: [/* @__PURE__ */ S(O, {
609
+ children: P("healthybowl.crops.planning.form.fields.priority.label", "Priority")
610
+ }), /* @__PURE__ */ E(O, {
611
+ value: He,
612
+ onValueChange: (e) => Ue(e),
613
+ children: [/* @__PURE__ */ T(j, {
556
614
  className: "mt-1 w-full",
557
- children: /* @__PURE__ */ S(k, {})
558
- }), /* @__PURE__ */ C(E, { children: [
559
- /* @__PURE__ */ S(D, {
615
+ children: /* @__PURE__ */ T(M, {})
616
+ }), /* @__PURE__ */ E(k, { children: [
617
+ /* @__PURE__ */ T(A, {
560
618
  value: "low",
561
- children: j("healthybowl.crops.planning.priority.low", "Low")
619
+ children: P("healthybowl.crops.planning.priority.low", "Low")
562
620
  }),
563
- /* @__PURE__ */ S(D, {
621
+ /* @__PURE__ */ T(A, {
564
622
  value: "medium",
565
- children: j("healthybowl.crops.planning.priority.medium", "Medium")
623
+ children: P("healthybowl.crops.planning.priority.medium", "Medium")
566
624
  }),
567
- /* @__PURE__ */ S(D, {
625
+ /* @__PURE__ */ T(A, {
568
626
  value: "high",
569
- children: j("healthybowl.crops.planning.priority.high", "High")
627
+ children: P("healthybowl.crops.planning.priority.high", "High")
570
628
  })
571
629
  ] })]
572
630
  })] }),
573
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
631
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
574
632
  className: "text-sm font-medium text-text-primary",
575
- children: j("healthybowl.crops.planning.form.fields.startDate.label", "Start Date")
576
- }), /* @__PURE__ */ S("input", {
633
+ children: P("healthybowl.crops.planning.form.fields.startDate.label", "Start Date")
634
+ }), /* @__PURE__ */ T("input", {
577
635
  type: "date",
578
- value: Le,
579
- onChange: (e) => Re(e.target.value),
636
+ value: We,
637
+ onChange: (e) => Ge(e.target.value),
580
638
  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)]"
581
639
  })] }),
582
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
640
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
583
641
  className: "text-sm font-medium text-text-primary",
584
- children: j("healthybowl.crops.planning.form.fields.endDate.label", "End Date")
585
- }), /* @__PURE__ */ S("input", {
642
+ children: P("healthybowl.crops.planning.form.fields.endDate.label", "End Date")
643
+ }), /* @__PURE__ */ T("input", {
586
644
  type: "date",
587
- value: ze,
588
- onChange: (e) => Be(e.target.value),
645
+ value: Ke,
646
+ onChange: (e) => qe(e.target.value),
589
647
  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)]"
590
648
  })] }),
591
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
649
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
592
650
  className: "text-sm font-medium text-text-primary",
593
- children: j("healthybowl.crops.planning.form.fields.expectedYield.label", "Expected Yield (kg)")
594
- }), /* @__PURE__ */ S("input", {
651
+ children: P("healthybowl.crops.planning.form.fields.expectedYield.label", "Expected Yield (kg)")
652
+ }), /* @__PURE__ */ T("input", {
595
653
  type: "number",
596
654
  placeholder: "0",
597
- value: Ve,
598
- onChange: (e) => He(e.target.value),
655
+ value: Je,
656
+ onChange: (e) => Ye(e.target.value),
599
657
  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)]"
600
658
  })] }),
601
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
659
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
602
660
  className: "text-sm font-medium text-text-primary",
603
- children: j("healthybowl.crops.planning.form.fields.seedRequired.label", "Seed Required (kg)")
604
- }), /* @__PURE__ */ S("input", {
661
+ children: P("healthybowl.crops.planning.form.fields.seedRequired.label", "Seed Required (kg)")
662
+ }), /* @__PURE__ */ T("input", {
605
663
  type: "number",
606
664
  placeholder: "0",
607
- value: Ue,
608
- onChange: (e) => We(e.target.value),
665
+ value: Xe,
666
+ onChange: (e) => Ze(e.target.value),
609
667
  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)]"
610
668
  })] })
611
669
  ]
612
670
  })
613
671
  }),
614
- /* @__PURE__ */ S(c, {
615
- toasts: De,
616
- onDismiss: Oe
672
+ /* @__PURE__ */ T(c, {
673
+ toasts: Oe,
674
+ onDismiss: Ae
617
675
  })
618
676
  ]
619
677
  });
620
- }, P = ({ label: e, unit: t, value: n, min: r, step: i, onChange: a }) => /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
678
+ }, R = ({ label: e, unit: t, value: n, min: r, step: i, onChange: a }) => /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
621
679
  className: "text-xs font-medium text-text-secondary",
622
680
  children: e
623
- }), /* @__PURE__ */ C("div", {
681
+ }), /* @__PURE__ */ E("div", {
624
682
  className: "relative mt-1",
625
- children: [/* @__PURE__ */ S("input", {
683
+ children: [/* @__PURE__ */ T("input", {
626
684
  type: "number",
627
685
  value: n,
628
686
  min: r,
629
687
  step: i,
630
688
  onChange: (e) => a(e.target.value),
631
689
  className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pe-10 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
632
- }), /* @__PURE__ */ S("span", {
690
+ }), /* @__PURE__ */ T("span", {
633
691
  className: "pointer-events-none absolute end-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
634
692
  children: t
635
693
  })]
636
- })] }), F = ({ label: e, value: t, unit: n, compact: r = !1 }) => /* @__PURE__ */ C("div", {
694
+ })] }), z = ({ label: e, value: t, unit: n, compact: r = !1 }) => /* @__PURE__ */ E("div", {
637
695
  className: r ? "min-w-0" : "min-w-0 rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
638
- children: [/* @__PURE__ */ S("span", {
696
+ children: [/* @__PURE__ */ T("span", {
639
697
  className: "block truncate text-xs text-text-secondary",
640
698
  children: e
641
- }), /* @__PURE__ */ C("p", {
699
+ }), /* @__PURE__ */ E("p", {
642
700
  className: r ? "mt-0.5 truncate text-sm font-semibold text-text-primary" : "mt-1 text-lg font-semibold text-text-primary",
643
- children: [t, n && /* @__PURE__ */ S("span", {
701
+ children: [t, n && /* @__PURE__ */ T("span", {
644
702
  className: "ms-1 text-xs font-medium text-text-secondary",
645
703
  children: n
646
704
  })]
647
705
  })]
648
- }), Te = ({ crop: n, plan: r, planCount: i, capacityEstimate: o, capacityNotApplicableFor: s, onPlan: c, onViewCrop: ee, onViewPlan: l }) => {
649
- let { t: u } = oe(), d = !!r;
650
- return /* @__PURE__ */ C("div", {
706
+ }), Te = ({ crop: n, plan: r, planCount: i, capacityEstimate: o, capacityNotApplicableFor: s, growCapacityEstimate: c, awaitingGeometryFor: l, onPlan: u, onViewCrop: ee, onViewPlan: te }) => {
707
+ let { t: d } = oe(), f = !!r;
708
+ return /* @__PURE__ */ E("div", {
651
709
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
652
710
  children: [
653
- /* @__PURE__ */ C("div", {
711
+ /* @__PURE__ */ E("div", {
654
712
  className: "flex items-start justify-between gap-3",
655
- children: [/* @__PURE__ */ C("div", {
713
+ children: [/* @__PURE__ */ E("div", {
656
714
  className: "min-w-0",
657
- children: [/* @__PURE__ */ S("h3", {
715
+ children: [/* @__PURE__ */ T("h3", {
658
716
  className: "truncate text-sm font-semibold text-text-primary",
659
717
  children: n.name
660
- }), /* @__PURE__ */ S("p", {
718
+ }), /* @__PURE__ */ T("p", {
661
719
  className: "mt-0.5 truncate text-xs text-text-secondary",
662
720
  children: n.variety || n.category
663
721
  })]
664
- }), /* @__PURE__ */ S(a, {
665
- label: d ? u("healthybowl.crops.planning.coverage.card.planned", "Planned") : u("healthybowl.crops.planning.coverage.card.missing", "Needs plan"),
666
- variant: d ? "success" : "warning"
722
+ }), /* @__PURE__ */ T(a, {
723
+ label: f ? d("healthybowl.crops.planning.coverage.card.planned", "Planned") : d("healthybowl.crops.planning.coverage.card.missing", "Needs plan"),
724
+ variant: f ? "success" : "warning"
667
725
  })]
668
726
  }),
669
- /* @__PURE__ */ C("div", {
727
+ /* @__PURE__ */ E("div", {
670
728
  className: "mt-3 grid grid-cols-2 gap-3 text-xs",
671
729
  children: [
672
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
730
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
673
731
  className: "text-text-secondary",
674
- children: u("healthybowl.crops.planning.coverage.card.field", "Field")
675
- }), /* @__PURE__ */ S("p", {
732
+ children: d("healthybowl.crops.planning.coverage.card.field", "Field")
733
+ }), /* @__PURE__ */ T("p", {
676
734
  className: "mt-0.5 truncate font-medium text-text-primary",
677
735
  children: n.fieldName
678
736
  })] }),
679
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
737
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
680
738
  className: "text-text-secondary",
681
- children: u("healthybowl.crops.planning.coverage.card.season", "Season")
682
- }), /* @__PURE__ */ S("p", {
739
+ children: d("healthybowl.crops.planning.coverage.card.season", "Season")
740
+ }), /* @__PURE__ */ T("p", {
683
741
  className: "mt-0.5 font-medium text-text-primary",
684
- children: ve(n.season, u)
742
+ children: ve(n.season, d)
685
743
  })] }),
686
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
744
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
687
745
  className: "text-text-secondary",
688
- children: u("healthybowl.crops.planning.coverage.card.status", "Crop")
689
- }), /* @__PURE__ */ S("p", {
746
+ children: d("healthybowl.crops.planning.coverage.card.status", "Crop")
747
+ }), /* @__PURE__ */ T("p", {
690
748
  className: "mt-0.5 capitalize font-medium text-text-primary",
691
749
  children: n.status.replace(/_/g, " ")
692
750
  })] }),
693
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
751
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
694
752
  className: "text-text-secondary",
695
- children: u("healthybowl.crops.planning.coverage.card.harvest", "Harvest")
696
- }), /* @__PURE__ */ S("p", {
753
+ children: d("healthybowl.crops.planning.coverage.card.harvest", "Harvest")
754
+ }), /* @__PURE__ */ T("p", {
697
755
  className: "mt-0.5 font-medium text-text-primary",
698
756
  children: e(n.expectedHarvestDate)
699
757
  })] })
700
758
  ]
701
759
  }),
702
- r && /* @__PURE__ */ C("div", {
760
+ r && /* @__PURE__ */ E("div", {
703
761
  className: "mt-3 rounded-md bg-bg-sunken/60 p-3",
704
762
  children: [
705
- /* @__PURE__ */ C("div", {
763
+ /* @__PURE__ */ E("div", {
706
764
  className: "flex items-center justify-between gap-2",
707
- children: [/* @__PURE__ */ S("span", {
765
+ children: [/* @__PURE__ */ T("span", {
708
766
  className: "text-xs text-text-secondary",
709
- children: u("healthybowl.crops.planning.coverage.card.currentPlan", "Current plan")
710
- }), /* @__PURE__ */ S(a, {
767
+ children: d("healthybowl.crops.planning.coverage.card.currentPlan", "Current plan")
768
+ }), /* @__PURE__ */ T(a, {
711
769
  label: r.status,
712
- variant: A(r.status ?? "unknown")
770
+ variant: N(r.status ?? "unknown")
713
771
  })]
714
772
  }),
715
- /* @__PURE__ */ C("p", {
773
+ /* @__PURE__ */ E("p", {
716
774
  className: "mt-1 text-xs font-medium text-text-primary",
717
775
  children: [
718
776
  e(r.startDate),
@@ -720,184 +778,211 @@ var A = (e) => {
720
778
  e(r.endDate)
721
779
  ]
722
780
  }),
723
- i > 1 && /* @__PURE__ */ S("p", {
781
+ i > 1 && /* @__PURE__ */ T("p", {
724
782
  className: "mt-1 text-xs text-text-secondary",
725
- children: u("healthybowl.crops.planning.coverage.card.planCount", "{{count}} plans total", { count: i })
783
+ children: d("healthybowl.crops.planning.coverage.card.planCount", "{{count}} plans total", { count: i })
726
784
  })
727
785
  ]
728
786
  }),
729
- s && /* @__PURE__ */ S("p", {
787
+ s && /* @__PURE__ */ T("p", {
788
+ className: "mt-3 rounded-md bg-bg-sunken/60 p-3 text-xs text-text-secondary",
789
+ children: d(p.key, p.defaultValue, { type: g(d, s.type) })
790
+ }),
791
+ l && /* @__PURE__ */ T("p", {
730
792
  className: "mt-3 rounded-md bg-bg-sunken/60 p-3 text-xs text-text-secondary",
731
- children: u(f.key, f.defaultValue, { type: p(u, s.type) })
793
+ "data-testid": "coverage-grow-geometry-prompt",
794
+ children: d(m.key, m.defaultValue, { type: g(d, l.type) })
795
+ }),
796
+ c && /* @__PURE__ */ E("div", {
797
+ className: "mt-3 grid grid-cols-3 gap-2 rounded-md bg-bg-sunken/60 p-3",
798
+ "data-testid": "coverage-grow-capacity",
799
+ "data-model": c.model,
800
+ children: [
801
+ /* @__PURE__ */ T(z, {
802
+ compact: !0,
803
+ label: c.model === "TREE" ? d("healthybowl.crops.planning.capacity.metrics.block", "Block") : c.model === "RACK" ? d("healthybowl.crops.planning.capacity.metrics.racks", "Racks") : d("healthybowl.crops.planning.capacity.metrics.benches", "Benches"),
804
+ value: t(c.unitCount)
805
+ }),
806
+ /* @__PURE__ */ T(z, {
807
+ compact: !0,
808
+ label: d("healthybowl.crops.planning.capacity.metrics.plantsPerUnit", "Plants / unit"),
809
+ value: t(c.plantsPerUnit)
810
+ }),
811
+ /* @__PURE__ */ T(z, {
812
+ compact: !0,
813
+ label: c.model === "TREE" ? d("healthybowl.crops.planning.capacity.metrics.totalTrees", "Total trees") : d("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
814
+ value: t(c.totalPlants)
815
+ })
816
+ ]
732
817
  }),
733
- o && /* @__PURE__ */ C("div", {
818
+ o && /* @__PURE__ */ E("div", {
734
819
  className: "mt-3 grid grid-cols-3 gap-2 rounded-md bg-bg-sunken/60 p-3",
735
820
  children: [
736
- /* @__PURE__ */ S(F, {
821
+ /* @__PURE__ */ T(z, {
737
822
  compact: !0,
738
- label: u("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
823
+ label: d("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
739
824
  value: t(o.bedCount)
740
825
  }),
741
- /* @__PURE__ */ S(F, {
826
+ /* @__PURE__ */ T(z, {
742
827
  compact: !0,
743
- label: u("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
828
+ label: d("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
744
829
  value: t(o.plantsPerBed)
745
830
  }),
746
- /* @__PURE__ */ S(F, {
831
+ /* @__PURE__ */ T(z, {
747
832
  compact: !0,
748
- label: u("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
833
+ label: d("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
749
834
  value: t(o.totalPlants)
750
835
  })
751
836
  ]
752
837
  }),
753
- /* @__PURE__ */ C("div", {
838
+ /* @__PURE__ */ E("div", {
754
839
  className: "mt-4 flex gap-2",
755
- children: [/* @__PURE__ */ C(w, {
840
+ children: [/* @__PURE__ */ E(D, {
756
841
  variant: "outline",
757
842
  size: "sm",
758
843
  onClick: ee,
759
844
  className: "min-w-0 flex-1",
760
845
  children: [
761
- /* @__PURE__ */ S(fe, { className: "h-4 w-4" }),
846
+ /* @__PURE__ */ T(fe, { className: "h-4 w-4" }),
762
847
  " ",
763
- u("healthybowl.crops.planning.coverage.card.cropAction", "Crop")
848
+ d("healthybowl.crops.planning.coverage.card.cropAction", "Crop")
764
849
  ]
765
- }), d ? /* @__PURE__ */ C(w, {
850
+ }), f ? /* @__PURE__ */ E(D, {
766
851
  variant: "default",
767
852
  size: "sm",
768
- onClick: l,
853
+ onClick: te,
769
854
  className: "min-w-0 flex-1",
770
855
  children: [
771
- /* @__PURE__ */ S(ce, { className: "h-4 w-4" }),
856
+ /* @__PURE__ */ T(ce, { className: "h-4 w-4" }),
772
857
  " ",
773
- u("healthybowl.crops.planning.coverage.card.planAction", "Plan")
858
+ d("healthybowl.crops.planning.coverage.card.planAction", "Plan")
774
859
  ]
775
- }) : /* @__PURE__ */ C(w, {
860
+ }) : /* @__PURE__ */ E(D, {
776
861
  variant: "default",
777
862
  size: "sm",
778
- onClick: c,
863
+ onClick: u,
779
864
  className: "min-w-0 flex-1",
780
865
  children: [
781
- /* @__PURE__ */ S(ue, { className: "h-4 w-4" }),
866
+ /* @__PURE__ */ T(ue, { className: "h-4 w-4" }),
782
867
  " ",
783
- u("healthybowl.crops.planning.coverage.card.createAction", "Plan crop")
868
+ d("healthybowl.crops.planning.coverage.card.createAction", "Plan crop")
784
869
  ]
785
870
  })]
786
871
  })
787
872
  ]
788
873
  });
789
874
  }, Ee = ({ plan: n, onClick: r }) => {
790
- let { t: i } = oe(), o = /* @__PURE__ */ new Date(), s = new Date(n.startDate), c = new Date(n.endDate).getTime() - s.getTime(), ee = o.getTime() - s.getTime(), l = c > 0 ? Math.max(0, Math.min(100, Math.round(ee / c * 100))) : 0;
791
- return /* @__PURE__ */ C("div", {
875
+ let { t: i } = oe(), o = /* @__PURE__ */ new Date(), s = new Date(n.startDate), c = new Date(n.endDate).getTime() - s.getTime(), l = o.getTime() - s.getTime(), u = c > 0 ? Math.max(0, Math.min(100, Math.round(l / c * 100))) : 0;
876
+ return /* @__PURE__ */ E("div", {
792
877
  onClick: r,
793
878
  className: "group cursor-pointer rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm transition-all hover:border-primary/30 hover:shadow-md",
794
879
  children: [
795
- /* @__PURE__ */ C("div", {
880
+ /* @__PURE__ */ E("div", {
796
881
  className: "flex items-start justify-between",
797
- children: [/* @__PURE__ */ C("div", {
882
+ children: [/* @__PURE__ */ E("div", {
798
883
  className: "min-w-0 flex-1",
799
- children: [/* @__PURE__ */ S("h3", {
884
+ children: [/* @__PURE__ */ T("h3", {
800
885
  className: "truncate text-sm font-semibold text-text-primary group-hover:text-primary",
801
886
  children: n.cropName
802
- }), /* @__PURE__ */ C("div", {
887
+ }), /* @__PURE__ */ E("div", {
803
888
  className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
804
- children: [/* @__PURE__ */ S(le, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ S("span", {
889
+ children: [/* @__PURE__ */ T(le, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ T("span", {
805
890
  className: "truncate",
806
891
  children: n.fieldName
807
892
  })]
808
893
  })]
809
- }), /* @__PURE__ */ S(a, {
894
+ }), /* @__PURE__ */ T(a, {
810
895
  label: n.status,
811
- variant: A(n.status ?? "unknown")
896
+ variant: N(n.status ?? "unknown")
812
897
  })]
813
898
  }),
814
- /* @__PURE__ */ C("div", {
899
+ /* @__PURE__ */ E("div", {
815
900
  className: "mt-3 flex flex-wrap items-center gap-2",
816
901
  children: [
817
- /* @__PURE__ */ S(a, {
902
+ /* @__PURE__ */ T(a, {
818
903
  label: i("healthybowl.crops.planning.card.priorityBadge", "Priority: {{priority}}", { priority: n.priority }),
819
904
  variant: ge(n.priority)
820
905
  }),
821
- /* @__PURE__ */ S(a, {
906
+ /* @__PURE__ */ T(a, {
822
907
  label: i("healthybowl.crops.planning.card.riskBadge", "Risk: {{risk}}", { risk: n.weatherRisk }),
823
908
  variant: _e(n.weatherRisk)
824
909
  }),
825
- /* @__PURE__ */ S(a, {
910
+ /* @__PURE__ */ T(a, {
826
911
  label: ve(n.season, i),
827
912
  variant: "muted"
828
913
  })
829
914
  ]
830
915
  }),
831
- /* @__PURE__ */ C("div", {
916
+ /* @__PURE__ */ E("div", {
832
917
  className: "mt-4 grid grid-cols-2 gap-3",
833
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
918
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
834
919
  className: "text-xs text-text-secondary",
835
920
  children: i("healthybowl.crops.planning.card.startDate", "Start Date")
836
- }), /* @__PURE__ */ C("p", {
921
+ }), /* @__PURE__ */ E("p", {
837
922
  className: "flex items-center gap-1 text-xs font-medium text-text-primary",
838
- children: [/* @__PURE__ */ S(se, { className: "h-3 w-3 text-text-secondary" }), e(n.startDate)]
839
- })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
923
+ children: [/* @__PURE__ */ T(se, { className: "h-3 w-3 text-text-secondary" }), e(n.startDate)]
924
+ })] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
840
925
  className: "text-xs text-text-secondary",
841
926
  children: i("healthybowl.crops.planning.card.endDate", "End Date")
842
- }), /* @__PURE__ */ C("p", {
927
+ }), /* @__PURE__ */ E("p", {
843
928
  className: "flex items-center gap-1 text-xs font-medium text-text-primary",
844
- children: [/* @__PURE__ */ S(se, { className: "h-3 w-3 text-text-secondary" }), e(n.endDate)]
929
+ children: [/* @__PURE__ */ T(se, { className: "h-3 w-3 text-text-secondary" }), e(n.endDate)]
845
930
  })] })]
846
931
  }),
847
- n.status === "active" && /* @__PURE__ */ C("div", {
932
+ n.status === "active" && /* @__PURE__ */ E("div", {
848
933
  className: "mt-3",
849
- children: [/* @__PURE__ */ C("div", {
934
+ children: [/* @__PURE__ */ E("div", {
850
935
  className: "flex items-center justify-between text-xs text-text-secondary",
851
- children: [/* @__PURE__ */ S("span", { children: i("healthybowl.crops.planning.card.progress", "Progress") }), /* @__PURE__ */ C("span", { children: [l, "%"] })]
852
- }), /* @__PURE__ */ S("div", {
936
+ children: [/* @__PURE__ */ T("span", { children: i("healthybowl.crops.planning.card.progress", "Progress") }), /* @__PURE__ */ E("span", { children: [u, "%"] })]
937
+ }), /* @__PURE__ */ T("div", {
853
938
  className: "mt-1 h-1.5 rounded-full bg-bg-sunken",
854
- children: /* @__PURE__ */ S("div", {
939
+ children: /* @__PURE__ */ T("div", {
855
940
  className: "h-1.5 rounded-full bg-action-primary-bg transition-all",
856
- style: { width: `${l}%` }
941
+ style: { width: `${u}%` }
857
942
  })
858
943
  })]
859
944
  }),
860
- /* @__PURE__ */ C("div", {
945
+ /* @__PURE__ */ E("div", {
861
946
  className: "mt-4 grid grid-cols-2 gap-3",
862
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
947
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
863
948
  className: "text-xs text-text-secondary",
864
949
  children: i("healthybowl.crops.planning.card.expectedYield", "Expected Yield")
865
- }), /* @__PURE__ */ C("p", {
950
+ }), /* @__PURE__ */ E("p", {
866
951
  className: "text-sm font-semibold text-text-primary",
867
952
  children: [t(n.expectedYield), " kg"]
868
- })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("span", {
953
+ })] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
869
954
  className: "text-xs text-text-secondary",
870
955
  children: i("healthybowl.crops.planning.card.seedRequired", "Seed Required")
871
- }), /* @__PURE__ */ C("p", {
956
+ }), /* @__PURE__ */ E("p", {
872
957
  className: "text-sm font-semibold text-text-primary",
873
958
  children: [t(n.seedRequired), " kg"]
874
959
  })] })]
875
960
  }),
876
- (n.fertilizers ?? []).length > 0 && /* @__PURE__ */ C("div", {
961
+ (n.fertilizers ?? []).length > 0 && /* @__PURE__ */ E("div", {
877
962
  className: "mt-3",
878
- children: [/* @__PURE__ */ S("span", {
963
+ children: [/* @__PURE__ */ T("span", {
879
964
  className: "text-xs text-text-secondary",
880
965
  children: i("healthybowl.crops.planning.card.fertilizers", "Fertilizers")
881
- }), /* @__PURE__ */ S("div", {
966
+ }), /* @__PURE__ */ T("div", {
882
967
  className: "mt-1 flex flex-wrap gap-1",
883
- children: (n.fertilizers ?? []).map((e) => /* @__PURE__ */ C("span", {
968
+ children: (n.fertilizers ?? []).map((e) => /* @__PURE__ */ E("span", {
884
969
  className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-primary",
885
- children: [/* @__PURE__ */ S(x, { className: "h-2.5 w-2.5" }), e]
970
+ children: [/* @__PURE__ */ T(w, { className: "h-2.5 w-2.5" }), e]
886
971
  }, e))
887
972
  })]
888
973
  }),
889
- /* @__PURE__ */ C("div", {
974
+ /* @__PURE__ */ E("div", {
890
975
  className: "mt-4 flex items-center justify-end text-xs font-medium text-primary opacity-0 transition-opacity group-hover:opacity-100",
891
976
  children: [
892
977
  i("healthybowl.crops.planning.card.viewDetails", "View Details"),
893
978
  " ",
894
- /* @__PURE__ */ S(b, { className: "ms-1 h-3 w-3" })
979
+ /* @__PURE__ */ T(C, { className: "ms-1 h-3 w-3" })
895
980
  ]
896
981
  })
897
982
  ]
898
983
  });
899
984
  };
900
985
  //#endregion
901
- export { N as CropPlanningPage };
986
+ export { L as CropPlanningPage };
902
987
 
903
988
  //# sourceMappingURL=CropPlanningPage.js.map