@burdenoff/microfe-healthybowl 2026.810.7 → 2026.810.8

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.
@@ -8,29 +8,29 @@ import { ToastContainer as ne } from "../../components/Toast.js";
8
8
  import { useConfirm as re } from "../../components/ConfirmDialog.js";
9
9
  import { Breadcrumbs as ie } from "../../components/Breadcrumbs.js";
10
10
  import { PageLoader as ae } from "../../components/PageLoader.js";
11
- import { Modal as oe } from "../../components/Modal.js";
12
- import { HBEntityTags as se } from "../../components/HBEntityTags.js";
13
- import { HBEntityImages as i } from "../../components/HBEntityImages.js";
14
- import { useToast as ce } from "../../hooks/useToast.js";
15
- import { CreateFarmTaskButton as le } from "../../components/CreateFarmTaskButton.js";
11
+ import { Modal as i } from "../../components/Modal.js";
12
+ import { HBEntityTags as a } from "../../components/HBEntityTags.js";
13
+ import { HBEntityImages as o } from "../../components/HBEntityImages.js";
14
+ import { useToast as oe } from "../../hooks/useToast.js";
15
+ import { CreateFarmTaskButton as se } from "../../components/CreateFarmTaskButton.js";
16
16
  import "../../components/index.js";
17
- import { useHealthyBowlData as a } from "../../hooks/useHealthyBowlData.js";
18
- import { isNative as o, nativeNotify as s, nativeToast as c } from "../../../utils/nativeBridge.js";
19
- import { useEffect as ue, useState as l } from "react";
20
- import { useI18n as de } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
- import { AlertTriangle as fe, ArrowLeft as pe, Calendar as u, Droplets as me, Edit as he, Leaf as ge, MapPin as d, Sprout as f, Sun as _e, Trash2 as ve, TrendingUp as p } from "lucide-react";
22
- import { useNavigate as ye, useParams as be } from "react-router";
23
- import { Fragment as xe, jsx as m, jsxs as h } from "react/jsx-runtime";
24
- import { Button as g, GlassCard as Se, Select as Ce, SelectContent as we, SelectItem as _, SelectTrigger as Te, SelectValue as Ee } from "@burdenoff/fe-libs/ui";
17
+ import { useHealthyBowlData as ce } from "../../hooks/useHealthyBowlData.js";
18
+ import { isNative as le, nativeNotify as ue, nativeToast as de } from "../../../utils/nativeBridge.js";
19
+ import { useEffect as fe, useState as s } from "react";
20
+ import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
+ import { AlertTriangle as me, ArrowLeft as he, Calendar as c, Droplets as ge, Edit as l, Leaf as _e, MapPin as u, ScanSearch as ve, Sprout as d, Sun as ye, Trash2 as be, TrendingUp as f } from "lucide-react";
22
+ import { useNavigate as xe, useParams as Se } from "react-router";
23
+ import { Fragment as Ce, jsx as p, jsxs as m } from "react/jsx-runtime";
24
+ import { Button as h, GlassCard as we, Select as Te, SelectContent as Ee, SelectItem as g, SelectTrigger as De, SelectValue as Oe } from "@burdenoff/fe-libs/ui";
25
25
  //#region src/healthybowl/pages/crops/CropDetailsPage.tsx
26
- var v = (e) => {
26
+ var _ = (e) => {
27
27
  switch (e) {
28
28
  case "excellent": return "success";
29
29
  case "good": return "info";
30
30
  case "fair": return "warning";
31
31
  default: return "error";
32
32
  }
33
- }, y = (e) => {
33
+ }, v = (e) => {
34
34
  switch (e) {
35
35
  case "harvest_ready": return "success";
36
36
  case "growing":
@@ -38,367 +38,385 @@ var v = (e) => {
38
38
  case "planted": return "muted";
39
39
  default: return "default";
40
40
  }
41
- }, b = [
41
+ }, y = [
42
42
  "Seedling",
43
43
  "Vegetative",
44
44
  "Flowering",
45
45
  "Fruiting",
46
46
  "Mature"
47
- ], x = () => {
48
- let { t: x } = de(), S = re(), { crops: C, fields: w, errors: T, loadings: E, updateCrop: D, deleteCrop: De, refetch: Oe } = a(), ke = {
49
- Seedling: x("healthybowl.crops.detail.stages.seedling", "Seedling"),
50
- Vegetative: x("healthybowl.crops.detail.stages.vegetative", "Vegetative"),
51
- Flowering: x("healthybowl.crops.detail.stages.flowering", "Flowering"),
52
- Fruiting: x("healthybowl.crops.detail.stages.fruiting", "Fruiting"),
53
- Mature: x("healthybowl.crops.detail.stages.mature", "Mature")
54
- }, { cropId: O } = be(), k = ye(), { buildPath: A } = t(), { toasts: Ae, toast: j, dismiss: je } = ce(), [Me, M] = l(!1), [N, P] = l(!1), [F, Ne] = l(() => C.find((e) => e.id === O));
55
- ue(() => {
56
- let e = C.find((e) => e.id === O);
57
- e && Ne(e);
58
- }, [C, O]);
59
- let [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l(""), [W, G] = l(""), [K, q] = l("good"), [J, Y] = l([]), X = () => {
60
- F && (L(F.name), z(F.variety), V(F.category), U(String(F.yieldEstimate)), G(F.expectedHarvestDate), q(F.healthStatus), Y(F.imageIds ?? []), M(!0));
47
+ ], b = () => {
48
+ let { t: b } = pe(), x = re(), { crops: S, fields: C, errors: w, loadings: T, updateCrop: ke, deleteCrop: Ae, refetch: je } = ce(), Me = {
49
+ Seedling: b("healthybowl.crops.detail.stages.seedling", "Seedling"),
50
+ Vegetative: b("healthybowl.crops.detail.stages.vegetative", "Vegetative"),
51
+ Flowering: b("healthybowl.crops.detail.stages.flowering", "Flowering"),
52
+ Fruiting: b("healthybowl.crops.detail.stages.fruiting", "Fruiting"),
53
+ Mature: b("healthybowl.crops.detail.stages.mature", "Mature")
54
+ }, { cropId: E } = Se(), D = xe(), { buildPath: O } = t(), { toasts: Ne, toast: k, dismiss: Pe } = oe(), [A, j] = s(!1), [M, N] = s(!1), [P, Fe] = s(() => S.find((e) => e.id === E));
55
+ fe(() => {
56
+ let e = S.find((e) => e.id === E);
57
+ e && Fe(e);
58
+ }, [S, E]);
59
+ let [F, I] = s(""), [L, R] = s(""), [z, B] = s(""), [V, H] = s(""), [U, W] = s(""), [G, K] = s("good"), [q, J] = s([]), Y = () => {
60
+ P && (I(P.name), R(P.variety), B(P.category), H(String(P.yieldEstimate)), W(P.expectedHarvestDate), K(P.healthStatus), J(P.imageIds ?? []), j(!0));
61
61
  };
62
- if (!F) return /* @__PURE__ */ m(n, {
63
- title: x("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
64
- children: E.crops ? /* @__PURE__ */ m(ae, {}) : T.crops ? /* @__PURE__ */ m(te, { onRetry: Oe }) : /* @__PURE__ */ m(ee, {
65
- title: x("healthybowl.crops.detail.notFound.title", "Crop not found"),
66
- description: x("healthybowl.crops.detail.notFound.description", "The crop you are looking for does not exist."),
67
- action: /* @__PURE__ */ m(g, {
68
- onClick: () => k(A("crops")),
69
- children: x("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
62
+ if (!P) return /* @__PURE__ */ p(n, {
63
+ title: b("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
64
+ children: T.crops ? /* @__PURE__ */ p(ae, {}) : w.crops ? /* @__PURE__ */ p(te, { onRetry: je }) : /* @__PURE__ */ p(ee, {
65
+ title: b("healthybowl.crops.detail.notFound.title", "Crop not found"),
66
+ description: b("healthybowl.crops.detail.notFound.description", "The crop you are looking for does not exist."),
67
+ action: /* @__PURE__ */ p(h, {
68
+ onClick: () => D(O("crops")),
69
+ children: b("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
70
70
  })
71
71
  })
72
72
  });
73
- let Z = w.find((e) => e.id === F.field || e.name === F.fieldName), Q = b.indexOf(F.growthStage), $ = F.daysToHarvest, Pe = Z ? Math.round(F.yieldEstimate / Z.area) : F.yieldEstimate;
74
- return F ? /* @__PURE__ */ h(n, {
75
- title: F.name,
76
- description: x("healthybowl.crops.detail.headerSubtitle", "{{variety}} - {{category}}", {
77
- variety: F.variety,
78
- category: F.category
73
+ let X = C.find((e) => e.id === P.field || e.name === P.fieldName), Z = (() => {
74
+ let e = new URLSearchParams({ cropId: P.id });
75
+ return X?.id && e.set("fieldId", X.id), `${O("pest-management/ai-detection")}?${e.toString()}`;
76
+ })(), Q = y.indexOf(P.growthStage), $ = P.daysToHarvest, Ie = X ? Math.round(P.yieldEstimate / X.area) : P.yieldEstimate;
77
+ return P ? /* @__PURE__ */ m(n, {
78
+ title: P.name,
79
+ description: b("healthybowl.crops.detail.headerSubtitle", "{{variety}} - {{category}}", {
80
+ variety: P.variety,
81
+ category: P.category
79
82
  }),
80
- actions: /* @__PURE__ */ h("div", {
83
+ actions: /* @__PURE__ */ m("div", {
81
84
  className: "flex items-center gap-2",
82
85
  children: [
83
- /* @__PURE__ */ m(le, {
86
+ /* @__PURE__ */ p(se, {
84
87
  entityType: "CROP",
85
- entityId: F.id,
86
- entityLabel: F.name
88
+ entityId: P.id,
89
+ entityLabel: P.name
87
90
  }),
88
- /* @__PURE__ */ h(g, {
91
+ /* @__PURE__ */ m(h, {
89
92
  variant: "outline",
90
- onClick: X,
93
+ onClick: () => D(Z),
91
94
  children: [
92
- /* @__PURE__ */ m(he, { className: "h-4 w-4" }),
95
+ /* @__PURE__ */ p(ve, { className: "h-4 w-4" }),
93
96
  " ",
94
- x("healthybowl.common.edit", "Edit")
97
+ b("healthybowl.crops.detail.actions.diagnose", "Diagnose")
95
98
  ]
96
99
  }),
97
- /* @__PURE__ */ h(g, {
100
+ /* @__PURE__ */ m(h, {
101
+ variant: "outline",
102
+ onClick: Y,
103
+ children: [
104
+ /* @__PURE__ */ p(l, { className: "h-4 w-4" }),
105
+ " ",
106
+ b("healthybowl.common.edit", "Edit")
107
+ ]
108
+ }),
109
+ /* @__PURE__ */ m(h, {
98
110
  variant: "destructive",
99
111
  onClick: async () => {
100
- if (F && await S({
101
- title: x("healthybowl.crops.detail.delete.confirmTitle", "Delete crop?"),
102
- message: x("healthybowl.crops.detail.delete.confirmMessage", "{{name}} will be permanently removed.", { name: F.name }),
103
- okButtonTitle: x("healthybowl.common.delete", "Delete"),
104
- cancelButtonTitle: x("healthybowl.common.cancel", "Cancel")
112
+ if (P && await x({
113
+ title: b("healthybowl.crops.detail.delete.confirmTitle", "Delete crop?"),
114
+ message: b("healthybowl.crops.detail.delete.confirmMessage", "{{name}} will be permanently removed.", { name: P.name }),
115
+ okButtonTitle: b("healthybowl.common.delete", "Delete"),
116
+ cancelButtonTitle: b("healthybowl.common.cancel", "Cancel")
105
117
  }) !== !1) {
106
- P(!0);
118
+ N(!0);
107
119
  try {
108
- await De(F.id), j({
109
- title: x("healthybowl.crops.detail.toast.deleted.title", "Crop deleted"),
110
- description: x("healthybowl.crops.detail.toast.deleted.description", "{{name}} has been removed.", { name: F.name }),
120
+ await Ae(P.id), k({
121
+ title: b("healthybowl.crops.detail.toast.deleted.title", "Crop deleted"),
122
+ description: b("healthybowl.crops.detail.toast.deleted.description", "{{name}} has been removed.", { name: P.name }),
111
123
  variant: "success"
112
- }), o() && (c(x("healthybowl.crops.detail.toast.deleted.title", "Crop deleted")), s("success")), k(A("crops"));
124
+ }), le() && (de(b("healthybowl.crops.detail.toast.deleted.title", "Crop deleted")), ue("success")), D(O("crops"));
113
125
  } catch (e) {
114
- j({
115
- title: x("healthybowl.crops.detail.toast.deleteFailed.title", "Delete failed"),
126
+ k({
127
+ title: b("healthybowl.crops.detail.toast.deleteFailed.title", "Delete failed"),
116
128
  description: String(e),
117
129
  variant: "error"
118
- }), P(!1);
130
+ }), N(!1);
119
131
  }
120
132
  }
121
133
  },
122
- disabled: N,
134
+ disabled: M,
123
135
  children: [
124
- /* @__PURE__ */ m(ve, { className: "h-4 w-4" }),
136
+ /* @__PURE__ */ p(be, { className: "h-4 w-4" }),
125
137
  " ",
126
- x("healthybowl.common.delete", "Delete")
138
+ b("healthybowl.common.delete", "Delete")
127
139
  ]
128
140
  }),
129
- /* @__PURE__ */ h(g, {
141
+ /* @__PURE__ */ m(h, {
130
142
  variant: "outline",
131
- onClick: () => k(A("crops")),
143
+ onClick: () => D(O("crops")),
132
144
  children: [
133
- /* @__PURE__ */ m(pe, { className: "h-4 w-4" }),
145
+ /* @__PURE__ */ p(he, { className: "h-4 w-4" }),
134
146
  " ",
135
- x("healthybowl.common.back", "Back")
147
+ b("healthybowl.common.back", "Back")
136
148
  ]
137
149
  })
138
150
  ]
139
151
  }),
140
152
  purpose: "Everything about one crop in your fields — its variety, health, growth progress and the field it's planted in. Use this page to keep its details current and record what happens as it grows toward harvest.",
141
153
  nextSteps: [
154
+ {
155
+ id: "diagnose",
156
+ label: b("healthybowl.crops.detail.nextSteps.diagnose.label", "Diagnose this crop"),
157
+ description: b("healthybowl.crops.detail.nextSteps.diagnose.desc", "Upload a plant photo and check for pest or disease symptoms."),
158
+ href: Z
159
+ },
142
160
  {
143
161
  id: "edit",
144
- label: x("healthybowl.crops.detail.nextSteps.edit.label", "Update this crop"),
145
- description: x("healthybowl.crops.detail.nextSteps.edit.desc", "Keep its status, health and details accurate as it grows."),
146
- onClick: X
162
+ label: b("healthybowl.crops.detail.nextSteps.edit.label", "Update this crop"),
163
+ description: b("healthybowl.crops.detail.nextSteps.edit.desc", "Keep its status, health and details accurate as it grows."),
164
+ onClick: Y
147
165
  },
148
166
  {
149
167
  id: "fields",
150
- label: x("healthybowl.crops.detail.nextSteps.fields.label", "Check the field it grows in"),
151
- description: x("healthybowl.crops.detail.nextSteps.fields.desc", "Review soil, irrigation and conditions for this crop’s field."),
152
- href: A("crops/fields")
168
+ label: b("healthybowl.crops.detail.nextSteps.fields.label", "Check the field it grows in"),
169
+ description: b("healthybowl.crops.detail.nextSteps.fields.desc", "Review soil, irrigation and conditions for this crop’s field."),
170
+ href: O("crops/fields")
153
171
  },
154
172
  {
155
173
  id: "harvest",
156
- label: x("healthybowl.crops.detail.nextSteps.harvest.label", "Record a harvest"),
157
- description: x("healthybowl.crops.detail.nextSteps.harvest.desc", "Log yield and quality once this crop is ready to pick."),
158
- href: A("crops/harvest")
174
+ label: b("healthybowl.crops.detail.nextSteps.harvest.label", "Record a harvest"),
175
+ description: b("healthybowl.crops.detail.nextSteps.harvest.desc", "Log yield and quality once this crop is ready to pick."),
176
+ href: O("crops/harvest")
159
177
  }
160
178
  ],
161
179
  nextStepsKey: "healthybowl-crop-detail",
162
180
  children: [
163
- /* @__PURE__ */ m(ie, { items: [{
164
- label: x("healthybowl.crops.detail.breadcrumb.crops", "Crops"),
165
- href: A("crops")
166
- }, { label: F.name }] }),
167
- /* @__PURE__ */ h("div", {
181
+ /* @__PURE__ */ p(ie, { items: [{
182
+ label: b("healthybowl.crops.detail.breadcrumb.crops", "Crops"),
183
+ href: O("crops")
184
+ }, { label: P.name }] }),
185
+ /* @__PURE__ */ m("div", {
168
186
  className: "flex flex-wrap items-center gap-3",
169
187
  children: [
170
- /* @__PURE__ */ m(r, {
171
- label: (F.status ?? "unknown").replace("_", " "),
172
- variant: y(F.status ?? "unknown"),
188
+ /* @__PURE__ */ p(r, {
189
+ label: (P.status ?? "unknown").replace("_", " "),
190
+ variant: v(P.status ?? "unknown"),
173
191
  dot: !0
174
192
  }),
175
- /* @__PURE__ */ m(r, {
176
- label: F.healthStatus,
177
- variant: v(F.healthStatus),
193
+ /* @__PURE__ */ p(r, {
194
+ label: P.healthStatus,
195
+ variant: _(P.healthStatus),
178
196
  dot: !0
179
197
  }),
180
- F.organicCertified && /* @__PURE__ */ m(r, {
181
- label: x("healthybowl.crops.detail.badge.organicCertified", "Organic Certified"),
198
+ P.organicCertified && /* @__PURE__ */ p(r, {
199
+ label: b("healthybowl.crops.detail.badge.organicCertified", "Organic Certified"),
182
200
  variant: "success"
183
201
  }),
184
- /* @__PURE__ */ m(r, {
185
- label: F.season,
202
+ /* @__PURE__ */ p(r, {
203
+ label: P.season,
186
204
  variant: "muted"
187
205
  })
188
206
  ]
189
207
  }),
190
- /* @__PURE__ */ m(se, {
208
+ /* @__PURE__ */ p(a, {
191
209
  entityType: "CROP",
192
- entityId: F.id,
193
- tags: F.entityTags ?? [],
210
+ entityId: P.id,
211
+ tags: P.entityTags ?? [],
194
212
  className: "mt-1"
195
213
  }),
196
- (F.imageIds ?? []).length > 0 && /* @__PURE__ */ m(i, {
214
+ (P.imageIds ?? []).length > 0 && /* @__PURE__ */ p(o, {
197
215
  entity: "Crop",
198
- imageIds: F.imageIds ?? [],
216
+ imageIds: P.imageIds ?? [],
199
217
  onChange: () => {},
200
218
  readOnly: !0,
201
219
  className: "mt-1"
202
220
  }),
203
- /* @__PURE__ */ h("div", {
221
+ /* @__PURE__ */ m("div", {
204
222
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
205
- children: [/* @__PURE__ */ h("div", {
223
+ children: [/* @__PURE__ */ m("div", {
206
224
  className: "space-y-6 lg:col-span-2",
207
225
  children: [
208
- /* @__PURE__ */ h(Se, {
226
+ /* @__PURE__ */ m(we, {
209
227
  treatment: "glass",
210
228
  glow: !0,
211
229
  className: "border-border-seam p-6",
212
- children: [/* @__PURE__ */ h("h3", {
230
+ children: [/* @__PURE__ */ m("h3", {
213
231
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
214
232
  children: [
215
- /* @__PURE__ */ m(_e, { className: "h-4 w-4 text-warning" }),
233
+ /* @__PURE__ */ p(ye, { className: "h-4 w-4 text-warning" }),
216
234
  " ",
217
- x("healthybowl.crops.detail.overview.title", "Crop Overview")
235
+ b("healthybowl.crops.detail.overview.title", "Crop Overview")
218
236
  ]
219
- }), /* @__PURE__ */ m("div", {
237
+ }), /* @__PURE__ */ p("div", {
220
238
  className: "grid grid-cols-2 gap-4 md:grid-cols-4",
221
239
  children: [
222
240
  {
223
241
  key: "category",
224
- icon: f,
225
- label: x("healthybowl.crops.detail.overview.category", "Category"),
226
- value: F.category
242
+ icon: d,
243
+ label: b("healthybowl.crops.detail.overview.category", "Category"),
244
+ value: P.category
227
245
  },
228
246
  {
229
247
  key: "season",
230
- icon: u,
231
- label: x("healthybowl.crops.detail.overview.season", "Season"),
232
- value: F.season
248
+ icon: c,
249
+ label: b("healthybowl.crops.detail.overview.season", "Season"),
250
+ value: P.season
233
251
  },
234
252
  {
235
253
  key: "growthStage",
236
- icon: ge,
237
- label: x("healthybowl.crops.detail.overview.growthStage", "Growth Stage"),
238
- value: F.growthStage
254
+ icon: _e,
255
+ label: b("healthybowl.crops.detail.overview.growthStage", "Growth Stage"),
256
+ value: P.growthStage
239
257
  },
240
258
  {
241
259
  key: "field",
242
- icon: d,
243
- label: x("healthybowl.crops.detail.overview.field", "Field"),
244
- value: F.fieldName
260
+ icon: u,
261
+ label: b("healthybowl.crops.detail.overview.field", "Field"),
262
+ value: P.fieldName
245
263
  }
246
- ].map(({ key: e, icon: t, label: n, value: r }) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("div", {
264
+ ].map(({ key: e, icon: t, label: n, value: r }) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
247
265
  className: "flex items-center gap-1 text-text-secondary",
248
- children: [/* @__PURE__ */ m(t, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ m("span", {
266
+ children: [/* @__PURE__ */ p(t, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", {
249
267
  className: "text-xs",
250
268
  children: n
251
269
  })]
252
- }), /* @__PURE__ */ m("p", {
270
+ }), /* @__PURE__ */ p("p", {
253
271
  className: "mt-1 text-sm font-semibold capitalize text-text-primary",
254
272
  children: r
255
273
  })] }, e))
256
274
  })]
257
275
  }),
258
- Z && /* @__PURE__ */ h("div", {
276
+ X && /* @__PURE__ */ m("div", {
259
277
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
260
- children: [/* @__PURE__ */ h("h3", {
278
+ children: [/* @__PURE__ */ m("h3", {
261
279
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
262
280
  children: [
263
- /* @__PURE__ */ m(d, { className: "h-4 w-4 text-success" }),
281
+ /* @__PURE__ */ p(u, { className: "h-4 w-4 text-success" }),
264
282
  " ",
265
- x("healthybowl.crops.detail.fieldDetails.title", "Field Details")
283
+ b("healthybowl.crops.detail.fieldDetails.title", "Field Details")
266
284
  ]
267
- }), /* @__PURE__ */ h("div", {
285
+ }), /* @__PURE__ */ m("div", {
268
286
  className: "grid grid-cols-2 gap-4 md:grid-cols-4",
269
287
  children: [
270
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
288
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
271
289
  className: "text-xs text-text-secondary",
272
- children: x("healthybowl.crops.detail.fieldDetails.field", "Field")
273
- }), /* @__PURE__ */ m("p", {
290
+ children: b("healthybowl.crops.detail.fieldDetails.field", "Field")
291
+ }), /* @__PURE__ */ p("p", {
274
292
  className: "text-sm font-semibold text-text-primary",
275
- children: Z.name
293
+ children: X.name
276
294
  })] }),
277
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
295
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
278
296
  className: "text-xs text-text-secondary",
279
- children: x("healthybowl.crops.detail.fieldDetails.area", "Area")
280
- }), /* @__PURE__ */ h("p", {
297
+ children: b("healthybowl.crops.detail.fieldDetails.area", "Area")
298
+ }), /* @__PURE__ */ m("p", {
281
299
  className: "text-sm font-semibold text-text-primary",
282
300
  children: [
283
- Z.area,
301
+ X.area,
284
302
  " ",
285
- Z.unit
303
+ X.unit
286
304
  ]
287
305
  })] }),
288
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
306
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
289
307
  className: "text-xs text-text-secondary",
290
- children: x("healthybowl.crops.detail.fieldDetails.soilType", "Soil Type")
291
- }), /* @__PURE__ */ m("p", {
308
+ children: b("healthybowl.crops.detail.fieldDetails.soilType", "Soil Type")
309
+ }), /* @__PURE__ */ p("p", {
292
310
  className: "text-sm font-semibold text-text-primary",
293
- children: Z.soilType
311
+ children: X.soilType
294
312
  })] }),
295
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
313
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
296
314
  className: "text-xs text-text-secondary",
297
- children: x("healthybowl.crops.detail.fieldDetails.irrigation", "Irrigation")
298
- }), /* @__PURE__ */ m("p", {
315
+ children: b("healthybowl.crops.detail.fieldDetails.irrigation", "Irrigation")
316
+ }), /* @__PURE__ */ p("p", {
299
317
  className: "text-sm font-semibold text-text-primary",
300
- children: Z.irrigationType
318
+ children: X.irrigationType
301
319
  })] })
302
320
  ]
303
321
  })]
304
322
  }),
305
- /* @__PURE__ */ h("div", {
323
+ /* @__PURE__ */ m("div", {
306
324
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
307
325
  children: [
308
- /* @__PURE__ */ h("h3", {
326
+ /* @__PURE__ */ m("h3", {
309
327
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
310
328
  children: [
311
- /* @__PURE__ */ m(u, { className: "h-4 w-4 text-info" }),
329
+ /* @__PURE__ */ p(c, { className: "h-4 w-4 text-info" }),
312
330
  " ",
313
- x("healthybowl.crops.detail.timeline.title", "Timeline")
331
+ b("healthybowl.crops.detail.timeline.title", "Timeline")
314
332
  ]
315
333
  }),
316
- /* @__PURE__ */ h("div", {
334
+ /* @__PURE__ */ m("div", {
317
335
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
318
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
336
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
319
337
  className: "text-xs text-text-secondary",
320
- children: x("healthybowl.crops.detail.timeline.plantedOn", "Planted On")
321
- }), /* @__PURE__ */ m("p", {
338
+ children: b("healthybowl.crops.detail.timeline.plantedOn", "Planted On")
339
+ }), /* @__PURE__ */ p("p", {
322
340
  className: "text-sm font-semibold text-text-primary",
323
- children: e(F.plantingDate)
324
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
341
+ children: e(P.plantingDate)
342
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
325
343
  className: "text-xs text-text-secondary",
326
- children: x("healthybowl.crops.detail.timeline.expectedHarvest", "Expected Harvest")
327
- }), /* @__PURE__ */ m("p", {
344
+ children: b("healthybowl.crops.detail.timeline.expectedHarvest", "Expected Harvest")
345
+ }), /* @__PURE__ */ p("p", {
328
346
  className: "text-sm font-semibold text-text-primary",
329
- children: e(F.expectedHarvestDate)
347
+ children: e(P.expectedHarvestDate)
330
348
  })] })]
331
349
  }),
332
- /* @__PURE__ */ m("div", {
350
+ /* @__PURE__ */ p("div", {
333
351
  className: "mt-4",
334
- children: $ > 0 ? /* @__PURE__ */ m("div", {
352
+ children: $ > 0 ? /* @__PURE__ */ p("div", {
335
353
  className: "rounded-lg bg-info/10 p-3",
336
- children: /* @__PURE__ */ h("p", {
354
+ children: /* @__PURE__ */ m("p", {
337
355
  className: "text-sm text-info",
338
356
  children: [
339
- /* @__PURE__ */ m("span", {
357
+ /* @__PURE__ */ p("span", {
340
358
  className: "font-bold",
341
- children: x("healthybowl.crops.detail.timeline.daysCount", "{{count}} days", { count: $ })
359
+ children: b("healthybowl.crops.detail.timeline.daysCount", "{{count}} days", { count: $ })
342
360
  }),
343
361
  " ",
344
- x("healthybowl.crops.detail.timeline.untilHarvest", "until expected harvest")
362
+ b("healthybowl.crops.detail.timeline.untilHarvest", "until expected harvest")
345
363
  ]
346
364
  })
347
- }) : /* @__PURE__ */ m("div", {
365
+ }) : /* @__PURE__ */ p("div", {
348
366
  className: "rounded-lg bg-success-subtle p-3",
349
- children: /* @__PURE__ */ m("p", {
367
+ children: /* @__PURE__ */ p("p", {
350
368
  className: "text-sm font-bold text-success",
351
- children: x("healthybowl.crops.detail.timeline.readyForHarvest", "Ready for harvest!")
369
+ children: b("healthybowl.crops.detail.timeline.readyForHarvest", "Ready for harvest!")
352
370
  })
353
371
  })
354
372
  })
355
373
  ]
356
374
  }),
357
- /* @__PURE__ */ h("div", {
375
+ /* @__PURE__ */ m("div", {
358
376
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
359
377
  children: [
360
- /* @__PURE__ */ h("div", {
378
+ /* @__PURE__ */ m("div", {
361
379
  className: "flex items-center justify-between",
362
- children: [/* @__PURE__ */ m("h3", {
380
+ children: [/* @__PURE__ */ p("h3", {
363
381
  className: "text-sm font-semibold text-text-primary",
364
- children: x("healthybowl.crops.detail.growthProgress.title", "Growth Progress")
365
- }), /* @__PURE__ */ h("span", {
382
+ children: b("healthybowl.crops.detail.growthProgress.title", "Growth Progress")
383
+ }), /* @__PURE__ */ m("span", {
366
384
  className: "text-lg font-bold text-text-primary",
367
- children: [F.progress, "%"]
385
+ children: [P.progress, "%"]
368
386
  })]
369
387
  }),
370
- /* @__PURE__ */ m("div", {
388
+ /* @__PURE__ */ p("div", {
371
389
  className: "mt-3 h-4 rounded-full bg-bg-sunken",
372
- children: /* @__PURE__ */ m("div", {
390
+ children: /* @__PURE__ */ p("div", {
373
391
  className: "h-4 rounded-full bg-action-primary-bg transition-all",
374
- style: { width: `${F.progress}%` }
392
+ style: { width: `${P.progress}%` }
375
393
  })
376
394
  }),
377
- /* @__PURE__ */ h("div", {
395
+ /* @__PURE__ */ m("div", {
378
396
  className: "mt-6",
379
- children: [/* @__PURE__ */ m("h4", {
397
+ children: [/* @__PURE__ */ p("h4", {
380
398
  className: "mb-3 text-xs font-medium text-text-secondary",
381
- children: x("healthybowl.crops.detail.growthProgress.stageLabel", "Growth Stage")
382
- }), /* @__PURE__ */ m("div", {
399
+ children: b("healthybowl.crops.detail.growthProgress.stageLabel", "Growth Stage")
400
+ }), /* @__PURE__ */ p("div", {
383
401
  className: "flex items-center",
384
- children: b.map((e, t) => /* @__PURE__ */ h("div", {
402
+ children: y.map((e, t) => /* @__PURE__ */ m("div", {
385
403
  className: "flex flex-1 flex-col items-center gap-1.5",
386
- children: [/* @__PURE__ */ h("div", {
404
+ children: [/* @__PURE__ */ m("div", {
387
405
  className: "flex w-full items-center",
388
406
  children: [
389
- /* @__PURE__ */ m("div", { className: `h-0.5 flex-1 ${t === 0 ? "bg-transparent" : t <= Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` }),
390
- /* @__PURE__ */ m("div", {
407
+ /* @__PURE__ */ p("div", { className: `h-0.5 flex-1 ${t === 0 ? "bg-transparent" : t <= Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` }),
408
+ /* @__PURE__ */ p("div", {
391
409
  className: `h-4 w-4 shrink-0 rounded-full border-2 ${t <= Q ? "border-primary bg-action-primary-bg" : "border-muted bg-bg-surface"}`,
392
- children: t <= Q && /* @__PURE__ */ m("div", {
410
+ children: t <= Q && /* @__PURE__ */ p("div", {
393
411
  className: "flex h-full items-center justify-center",
394
- children: /* @__PURE__ */ m("div", { className: "h-1.5 w-1.5 rounded-full bg-primary-foreground" })
412
+ children: /* @__PURE__ */ p("div", { className: "h-1.5 w-1.5 rounded-full bg-primary-foreground" })
395
413
  })
396
414
  }),
397
- /* @__PURE__ */ m("div", { className: `h-0.5 flex-1 ${t === b.length - 1 ? "bg-transparent" : t < Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` })
415
+ /* @__PURE__ */ p("div", { className: `h-0.5 flex-1 ${t === y.length - 1 ? "bg-transparent" : t < Q ? "bg-action-primary-bg" : "bg-bg-sunken"}` })
398
416
  ]
399
- }), /* @__PURE__ */ m("span", {
417
+ }), /* @__PURE__ */ p("span", {
400
418
  className: `text-center text-xs ${t <= Q ? "font-medium text-text-primary" : "text-text-secondary"}`,
401
- children: ke[e] ?? e
419
+ children: Me[e] ?? e
402
420
  })]
403
421
  }, e))
404
422
  })]
@@ -406,140 +424,140 @@ var v = (e) => {
406
424
  ]
407
425
  })
408
426
  ]
409
- }), /* @__PURE__ */ h("div", {
427
+ }), /* @__PURE__ */ m("div", {
410
428
  className: "space-y-6",
411
429
  children: [
412
- /* @__PURE__ */ h("div", {
430
+ /* @__PURE__ */ m("div", {
413
431
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
414
432
  children: [
415
- /* @__PURE__ */ m("h3", {
433
+ /* @__PURE__ */ p("h3", {
416
434
  className: "mb-4 text-sm font-semibold text-text-primary",
417
- children: x("healthybowl.crops.detail.currentStatus.title", "Current Status")
435
+ children: b("healthybowl.crops.detail.currentStatus.title", "Current Status")
418
436
  }),
419
- /* @__PURE__ */ h("div", {
437
+ /* @__PURE__ */ m("div", {
420
438
  className: "space-y-3",
421
439
  children: [
422
- /* @__PURE__ */ h("div", {
440
+ /* @__PURE__ */ m("div", {
423
441
  className: "flex items-center justify-between",
424
- children: [/* @__PURE__ */ m("span", {
442
+ children: [/* @__PURE__ */ p("span", {
425
443
  className: "text-xs text-text-secondary",
426
- children: x("healthybowl.crops.detail.currentStatus.health", "Health")
427
- }), /* @__PURE__ */ m(r, {
428
- label: F.healthStatus,
429
- variant: v(F.healthStatus)
444
+ children: b("healthybowl.crops.detail.currentStatus.health", "Health")
445
+ }), /* @__PURE__ */ p(r, {
446
+ label: P.healthStatus,
447
+ variant: _(P.healthStatus)
430
448
  })]
431
449
  }),
432
- /* @__PURE__ */ h("div", {
450
+ /* @__PURE__ */ m("div", {
433
451
  className: "flex items-center justify-between",
434
- children: [/* @__PURE__ */ m("span", {
452
+ children: [/* @__PURE__ */ p("span", {
435
453
  className: "text-xs text-text-secondary",
436
- children: x("healthybowl.crops.detail.currentStatus.growthStage", "Growth Stage")
437
- }), /* @__PURE__ */ m("span", {
454
+ children: b("healthybowl.crops.detail.currentStatus.growthStage", "Growth Stage")
455
+ }), /* @__PURE__ */ p("span", {
438
456
  className: "text-xs font-medium text-text-primary",
439
- children: F.growthStage
457
+ children: P.growthStage
440
458
  })]
441
459
  }),
442
- /* @__PURE__ */ h("div", {
460
+ /* @__PURE__ */ m("div", {
443
461
  className: "flex items-center justify-between",
444
- children: [/* @__PURE__ */ m("span", {
462
+ children: [/* @__PURE__ */ p("span", {
445
463
  className: "text-xs text-text-secondary",
446
- children: x("healthybowl.crops.detail.currentStatus.organic", "Organic")
447
- }), /* @__PURE__ */ m("span", {
464
+ children: b("healthybowl.crops.detail.currentStatus.organic", "Organic")
465
+ }), /* @__PURE__ */ p("span", {
448
466
  className: "text-xs font-medium text-text-primary",
449
- children: F.organicCertified ? x("healthybowl.common.yes", "Yes") : x("healthybowl.common.no", "No")
467
+ children: P.organicCertified ? b("healthybowl.common.yes", "Yes") : b("healthybowl.common.no", "No")
450
468
  })]
451
469
  })
452
470
  ]
453
471
  }),
454
- F.healthStatus === "fair" && /* @__PURE__ */ m("div", {
472
+ P.healthStatus === "fair" && /* @__PURE__ */ p("div", {
455
473
  className: "mt-3 rounded-lg bg-warning/10 p-3",
456
- children: /* @__PURE__ */ h("div", {
474
+ children: /* @__PURE__ */ m("div", {
457
475
  className: "flex items-start gap-2",
458
- children: [/* @__PURE__ */ m(fe, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" }), /* @__PURE__ */ m("p", {
476
+ children: [/* @__PURE__ */ p(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-warning" }), /* @__PURE__ */ p("p", {
459
477
  className: "text-xs text-warning",
460
- children: x("healthybowl.crops.detail.currentStatus.attentionWarning", "This crop needs attention. Check for potential issues.")
478
+ children: b("healthybowl.crops.detail.currentStatus.attentionWarning", "This crop needs attention. Check for potential issues.")
461
479
  })]
462
480
  })
463
481
  })
464
482
  ]
465
483
  }),
466
- /* @__PURE__ */ h("div", {
484
+ /* @__PURE__ */ m("div", {
467
485
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
468
- children: [/* @__PURE__ */ h("h3", {
486
+ children: [/* @__PURE__ */ m("h3", {
469
487
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
470
488
  children: [
471
- /* @__PURE__ */ m(p, { className: "h-4 w-4 text-success" }),
489
+ /* @__PURE__ */ p(f, { className: "h-4 w-4 text-success" }),
472
490
  " ",
473
- x("healthybowl.crops.detail.yield.title", "Yield Estimation")
491
+ b("healthybowl.crops.detail.yield.title", "Yield Estimation")
474
492
  ]
475
- }), /* @__PURE__ */ h("div", {
493
+ }), /* @__PURE__ */ m("div", {
476
494
  className: "text-center",
477
495
  children: [
478
- /* @__PURE__ */ m("p", {
496
+ /* @__PURE__ */ p("p", {
479
497
  className: "text-3xl font-bold text-success",
480
- children: (F.yieldEstimate ?? 0).toLocaleString()
498
+ children: (P.yieldEstimate ?? 0).toLocaleString()
481
499
  }),
482
- /* @__PURE__ */ m("p", {
500
+ /* @__PURE__ */ p("p", {
483
501
  className: "text-xs text-text-secondary",
484
- children: x("healthybowl.crops.detail.yield.expected", "{{unit}} expected", { unit: F.yieldUnit ?? x("healthybowl.crops.detail.yield.unitsFallback", "units") })
502
+ children: b("healthybowl.crops.detail.yield.expected", "{{unit}} expected", { unit: P.yieldUnit ?? b("healthybowl.crops.detail.yield.unitsFallback", "units") })
485
503
  }),
486
- Z && /* @__PURE__ */ m("p", {
504
+ X && /* @__PURE__ */ p("p", {
487
505
  className: "mt-2 text-xs text-text-secondary",
488
- children: x("healthybowl.crops.detail.yield.perUnit", "~{{amount}} {{unit}} per {{denominator}}", {
489
- amount: Pe,
490
- unit: F.yieldUnit,
491
- denominator: (Z.unit ?? "").replace(/s$/, "")
506
+ children: b("healthybowl.crops.detail.yield.perUnit", "~{{amount}} {{unit}} per {{denominator}}", {
507
+ amount: Ie,
508
+ unit: P.yieldUnit,
509
+ denominator: (X.unit ?? "").replace(/s$/, "")
492
510
  })
493
511
  })
494
512
  ]
495
513
  })]
496
514
  }),
497
- /* @__PURE__ */ h("div", {
515
+ /* @__PURE__ */ m("div", {
498
516
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
499
- children: [/* @__PURE__ */ m("h3", {
517
+ children: [/* @__PURE__ */ p("h3", {
500
518
  className: "mb-4 text-sm font-semibold text-text-primary",
501
- children: x("healthybowl.crops.detail.quickActions.title", "Quick Actions")
502
- }), /* @__PURE__ */ h("div", {
519
+ children: b("healthybowl.crops.detail.quickActions.title", "Quick Actions")
520
+ }), /* @__PURE__ */ m("div", {
503
521
  className: "space-y-2",
504
522
  children: [
505
- /* @__PURE__ */ h(g, {
523
+ /* @__PURE__ */ m(h, {
506
524
  variant: "outline",
507
- onClick: () => k(A("analytics")),
525
+ onClick: () => D(O("analytics")),
508
526
  className: "w-full justify-start",
509
527
  children: [
510
- /* @__PURE__ */ m(p, { className: "h-4 w-4 text-text-secondary" }),
528
+ /* @__PURE__ */ p(f, { className: "h-4 w-4 text-text-secondary" }),
511
529
  " ",
512
- x("healthybowl.crops.detail.quickActions.viewAnalytics", "View Analytics")
530
+ b("healthybowl.crops.detail.quickActions.viewAnalytics", "View Analytics")
513
531
  ]
514
532
  }),
515
- /* @__PURE__ */ h(g, {
533
+ /* @__PURE__ */ m(h, {
516
534
  variant: "outline",
517
- onClick: () => k(A("weather")),
535
+ onClick: () => D(O("weather")),
518
536
  className: "w-full justify-start",
519
537
  children: [
520
- /* @__PURE__ */ m(me, { className: "h-4 w-4 text-text-secondary" }),
538
+ /* @__PURE__ */ p(ge, { className: "h-4 w-4 text-text-secondary" }),
521
539
  " ",
522
- x("healthybowl.crops.detail.quickActions.checkWeather", "Check Weather")
540
+ b("healthybowl.crops.detail.quickActions.checkWeather", "Check Weather")
523
541
  ]
524
542
  }),
525
- Z && /* @__PURE__ */ h(g, {
543
+ X && /* @__PURE__ */ m(h, {
526
544
  variant: "outline",
527
- onClick: () => k(A(`crops/fields/${Z.id}`)),
545
+ onClick: () => D(O(`crops/fields/${X.id}`)),
528
546
  className: "w-full justify-start",
529
547
  children: [
530
- /* @__PURE__ */ m(d, { className: "h-4 w-4 text-text-secondary" }),
548
+ /* @__PURE__ */ p(u, { className: "h-4 w-4 text-text-secondary" }),
531
549
  " ",
532
- x("healthybowl.crops.detail.quickActions.viewField", "View Field")
550
+ b("healthybowl.crops.detail.quickActions.viewField", "View Field")
533
551
  ]
534
552
  }),
535
- /* @__PURE__ */ h(g, {
553
+ /* @__PURE__ */ m(h, {
536
554
  variant: "outline",
537
- onClick: () => k(A("crops")),
555
+ onClick: () => D(O("crops")),
538
556
  className: "w-full justify-start",
539
557
  children: [
540
- /* @__PURE__ */ m(f, { className: "h-4 w-4 text-text-secondary" }),
558
+ /* @__PURE__ */ p(d, { className: "h-4 w-4 text-text-secondary" }),
541
559
  " ",
542
- x("healthybowl.crops.detail.quickActions.allCrops", "All Crops")
560
+ b("healthybowl.crops.detail.quickActions.allCrops", "All Crops")
543
561
  ]
544
562
  })
545
563
  ]
@@ -548,173 +566,173 @@ var v = (e) => {
548
566
  ]
549
567
  })]
550
568
  }),
551
- /* @__PURE__ */ m(oe, {
552
- open: Me,
553
- onClose: () => M(!1),
554
- title: x("healthybowl.crops.detail.editModal.title", "Edit {{name}}", { name: F.name }),
555
- description: x("healthybowl.crops.detail.editModal.description", "Update crop details"),
569
+ /* @__PURE__ */ p(i, {
570
+ open: A,
571
+ onClose: () => j(!1),
572
+ title: b("healthybowl.crops.detail.editModal.title", "Edit {{name}}", { name: P.name }),
573
+ description: b("healthybowl.crops.detail.editModal.description", "Update crop details"),
556
574
  size: "lg",
557
- footer: /* @__PURE__ */ h(xe, { children: [/* @__PURE__ */ m(g, {
575
+ footer: /* @__PURE__ */ m(Ce, { children: [/* @__PURE__ */ p(h, {
558
576
  variant: "outline",
559
- onClick: () => M(!1),
560
- children: x("healthybowl.common.cancel", "Cancel")
561
- }), /* @__PURE__ */ m(g, {
577
+ onClick: () => j(!1),
578
+ children: b("healthybowl.common.cancel", "Cancel")
579
+ }), /* @__PURE__ */ p(h, {
562
580
  onClick: async () => {
563
- if (F) {
564
- if (!I.trim()) {
565
- j({
566
- title: x("healthybowl.crops.detail.toast.missingFields.title", "Missing required fields"),
567
- description: x("healthybowl.crops.detail.toast.missingFields.description", "Crop name is required."),
581
+ if (P) {
582
+ if (!F.trim()) {
583
+ k({
584
+ title: b("healthybowl.crops.detail.toast.missingFields.title", "Missing required fields"),
585
+ description: b("healthybowl.crops.detail.toast.missingFields.description", "Crop name is required."),
568
586
  variant: "warning"
569
587
  });
570
588
  return;
571
589
  }
572
- P(!0);
590
+ N(!0);
573
591
  try {
574
- await D({
575
- id: F.id,
576
- name: I.trim(),
577
- variety: R,
578
- category: B,
579
- yieldEstimate: H ? Number(H) : void 0,
580
- expectedHarvestDate: W || void 0,
581
- healthStatus: K,
582
- imageIds: J
583
- }), j({
584
- title: x("healthybowl.crops.detail.toast.updated.title", "Crop updated"),
585
- description: x("healthybowl.crops.detail.toast.updated.description", "{{name}} details have been saved.", { name: I.trim() }),
592
+ await ke({
593
+ id: P.id,
594
+ name: F.trim(),
595
+ variety: L,
596
+ category: z,
597
+ yieldEstimate: V ? Number(V) : void 0,
598
+ expectedHarvestDate: U || void 0,
599
+ healthStatus: G,
600
+ imageIds: q
601
+ }), k({
602
+ title: b("healthybowl.crops.detail.toast.updated.title", "Crop updated"),
603
+ description: b("healthybowl.crops.detail.toast.updated.description", "{{name}} details have been saved.", { name: F.trim() }),
586
604
  variant: "success"
587
- }), M(!1);
605
+ }), j(!1);
588
606
  } catch (e) {
589
- j({
590
- title: x("healthybowl.crops.detail.toast.updateFailed.title", "Update failed"),
607
+ k({
608
+ title: b("healthybowl.crops.detail.toast.updateFailed.title", "Update failed"),
591
609
  description: String(e),
592
610
  variant: "error"
593
611
  });
594
612
  } finally {
595
- P(!1);
613
+ N(!1);
596
614
  }
597
615
  }
598
616
  },
599
- disabled: N,
600
- children: N ? x("healthybowl.crops.detail.editModal.saving", "Saving...") : x("healthybowl.crops.detail.editModal.saveChanges", "Save Changes")
617
+ disabled: M,
618
+ children: M ? b("healthybowl.crops.detail.editModal.saving", "Saving...") : b("healthybowl.crops.detail.editModal.saveChanges", "Save Changes")
601
619
  })] }),
602
- children: /* @__PURE__ */ h("div", {
620
+ children: /* @__PURE__ */ m("div", {
603
621
  className: "grid gap-4 sm:grid-cols-2",
604
622
  children: [
605
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
623
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
606
624
  className: "text-sm font-medium text-text-primary",
607
- children: x("healthybowl.crops.detail.form.cropName", "Crop Name")
608
- }), /* @__PURE__ */ m("input", {
609
- value: I,
610
- onChange: (e) => L(e.target.value),
625
+ children: b("healthybowl.crops.detail.form.cropName", "Crop Name")
626
+ }), /* @__PURE__ */ p("input", {
627
+ value: F,
628
+ onChange: (e) => I(e.target.value),
611
629
  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)]"
612
630
  })] }),
613
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
631
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
614
632
  className: "text-sm font-medium text-text-primary",
615
- children: x("healthybowl.crops.detail.form.variety", "Variety")
616
- }), /* @__PURE__ */ m("input", {
617
- value: R,
618
- onChange: (e) => z(e.target.value),
633
+ children: b("healthybowl.crops.detail.form.variety", "Variety")
634
+ }), /* @__PURE__ */ p("input", {
635
+ value: L,
636
+ onChange: (e) => R(e.target.value),
619
637
  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)]"
620
638
  })] }),
621
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
639
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
622
640
  className: "text-sm font-medium text-text-primary",
623
- children: x("healthybowl.crops.detail.form.category", "Category")
624
- }), /* @__PURE__ */ m("input", {
625
- value: B,
626
- onChange: (e) => V(e.target.value),
641
+ children: b("healthybowl.crops.detail.form.category", "Category")
642
+ }), /* @__PURE__ */ p("input", {
643
+ value: z,
644
+ onChange: (e) => B(e.target.value),
627
645
  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)]"
628
646
  })] }),
629
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
647
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
630
648
  className: "text-sm font-medium text-text-primary",
631
- children: x("healthybowl.crops.detail.form.yieldEstimate", "Yield Estimate ({{unit}})", { unit: F.yieldUnit })
632
- }), /* @__PURE__ */ m("input", {
649
+ children: b("healthybowl.crops.detail.form.yieldEstimate", "Yield Estimate ({{unit}})", { unit: P.yieldUnit })
650
+ }), /* @__PURE__ */ p("input", {
633
651
  type: "number",
634
- value: H,
635
- onChange: (e) => U(e.target.value),
652
+ value: V,
653
+ onChange: (e) => H(e.target.value),
636
654
  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)]"
637
655
  })] }),
638
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
656
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
639
657
  className: "text-sm font-medium text-text-primary",
640
- children: x("healthybowl.crops.detail.form.expectedHarvest", "Expected Harvest")
641
- }), /* @__PURE__ */ m("input", {
658
+ children: b("healthybowl.crops.detail.form.expectedHarvest", "Expected Harvest")
659
+ }), /* @__PURE__ */ p("input", {
642
660
  type: "date",
643
- value: W,
644
- onChange: (e) => G(e.target.value),
661
+ value: U,
662
+ onChange: (e) => W(e.target.value),
645
663
  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)]"
646
664
  })] }),
647
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
665
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
648
666
  className: "text-sm font-medium text-text-primary",
649
- children: x("healthybowl.crops.detail.form.healthStatus", "Health Status")
650
- }), /* @__PURE__ */ h(Ce, {
651
- value: K,
652
- onValueChange: (e) => q(e),
653
- children: [/* @__PURE__ */ m(Te, {
667
+ children: b("healthybowl.crops.detail.form.healthStatus", "Health Status")
668
+ }), /* @__PURE__ */ m(Te, {
669
+ value: G,
670
+ onValueChange: (e) => K(e),
671
+ children: [/* @__PURE__ */ p(De, {
654
672
  className: "mt-1 w-full",
655
- children: /* @__PURE__ */ m(Ee, {})
656
- }), /* @__PURE__ */ h(we, { children: [
657
- /* @__PURE__ */ m(_, {
673
+ children: /* @__PURE__ */ p(Oe, {})
674
+ }), /* @__PURE__ */ m(Ee, { children: [
675
+ /* @__PURE__ */ p(g, {
658
676
  value: "excellent",
659
- children: x("healthybowl.crops.detail.form.healthOptions.excellent", "Excellent")
677
+ children: b("healthybowl.crops.detail.form.healthOptions.excellent", "Excellent")
660
678
  }),
661
- /* @__PURE__ */ m(_, {
679
+ /* @__PURE__ */ p(g, {
662
680
  value: "good",
663
- children: x("healthybowl.crops.detail.form.healthOptions.good", "Good")
681
+ children: b("healthybowl.crops.detail.form.healthOptions.good", "Good")
664
682
  }),
665
- /* @__PURE__ */ m(_, {
683
+ /* @__PURE__ */ p(g, {
666
684
  value: "fair",
667
- children: x("healthybowl.crops.detail.form.healthOptions.fair", "Fair")
685
+ children: b("healthybowl.crops.detail.form.healthOptions.fair", "Fair")
668
686
  }),
669
- /* @__PURE__ */ m(_, {
687
+ /* @__PURE__ */ p(g, {
670
688
  value: "poor",
671
- children: x("healthybowl.crops.detail.form.healthOptions.poor", "Poor")
689
+ children: b("healthybowl.crops.detail.form.healthOptions.poor", "Poor")
672
690
  }),
673
- /* @__PURE__ */ m(_, {
691
+ /* @__PURE__ */ p(g, {
674
692
  value: "critical",
675
- children: x("healthybowl.crops.detail.form.healthOptions.critical", "Critical")
693
+ children: b("healthybowl.crops.detail.form.healthOptions.critical", "Critical")
676
694
  })
677
695
  ] })]
678
696
  })] }),
679
- /* @__PURE__ */ h("div", {
697
+ /* @__PURE__ */ m("div", {
680
698
  className: "sm:col-span-2",
681
- children: [/* @__PURE__ */ m("label", {
699
+ children: [/* @__PURE__ */ p("label", {
682
700
  className: "text-sm font-medium text-text-primary",
683
- children: x("healthybowl.crops.detail.form.photos", "Photos")
684
- }), /* @__PURE__ */ m("div", {
701
+ children: b("healthybowl.crops.detail.form.photos", "Photos")
702
+ }), /* @__PURE__ */ p("div", {
685
703
  className: "mt-1",
686
- children: /* @__PURE__ */ m(i, {
704
+ children: /* @__PURE__ */ p(o, {
687
705
  entity: "Crop",
688
- imageIds: J,
689
- onChange: Y
706
+ imageIds: q,
707
+ onChange: J
690
708
  })
691
709
  })]
692
710
  })
693
711
  ]
694
712
  })
695
713
  }),
696
- /* @__PURE__ */ m(ne, {
697
- toasts: Ae,
698
- onDismiss: je
714
+ /* @__PURE__ */ p(ne, {
715
+ toasts: Ne,
716
+ onDismiss: Pe
699
717
  })
700
718
  ]
701
- }) : /* @__PURE__ */ m(n, {
702
- title: x("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
703
- description: x("healthybowl.crops.detail.notFound.altDescription", "The requested crop could not be found."),
704
- children: /* @__PURE__ */ h("div", {
719
+ }) : /* @__PURE__ */ p(n, {
720
+ title: b("healthybowl.crops.detail.notFound.pageTitle", "Crop Not Found"),
721
+ description: b("healthybowl.crops.detail.notFound.altDescription", "The requested crop could not be found."),
722
+ children: /* @__PURE__ */ m("div", {
705
723
  className: "flex flex-col items-center justify-center py-12 text-center",
706
- children: [/* @__PURE__ */ m("p", {
724
+ children: [/* @__PURE__ */ p("p", {
707
725
  className: "text-text-secondary",
708
- children: x("healthybowl.crops.detail.notFound.altHint", "This crop may have been removed or the ID is invalid.")
709
- }), /* @__PURE__ */ m(g, {
710
- onClick: () => k(A("crops")),
726
+ children: b("healthybowl.crops.detail.notFound.altHint", "This crop may have been removed or the ID is invalid.")
727
+ }), /* @__PURE__ */ p(h, {
728
+ onClick: () => D(O("crops")),
711
729
  className: "mt-4",
712
- children: x("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
730
+ children: b("healthybowl.crops.detail.actions.backToCrops", "Back to Crops")
713
731
  })]
714
732
  })
715
733
  });
716
734
  };
717
735
  //#endregion
718
- export { x as CropDetailsPage };
736
+ export { b as CropDetailsPage };
719
737
 
720
738
  //# sourceMappingURL=CropDetailsPage.js.map