@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
  2. package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
  3. package/dist/healthybowl/components/CropPicker.js +37 -0
  4. package/dist/healthybowl/components/CropPicker.js.map +1 -0
  5. package/dist/healthybowl/components/DataTable.js +125 -108
  6. package/dist/healthybowl/components/DataTable.js.map +1 -1
  7. package/dist/healthybowl/components/FilterBar.js +9 -6
  8. package/dist/healthybowl/components/FilterBar.js.map +1 -1
  9. package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
  10. package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
  11. package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
  12. package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
  13. package/dist/healthybowl/components/index.js +3 -1
  14. package/dist/healthybowl/hooks/useCropPage.js +71 -0
  15. package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
  16. package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
  17. package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
  18. package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
  19. package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
  20. package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
  21. package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
  22. package/dist/healthybowl/pages/HomePage.js +143 -142
  23. package/dist/healthybowl/pages/HomePage.js.map +1 -1
  24. package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
  25. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
  26. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
  27. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
  28. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
  29. package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
  30. package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
  31. package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
  32. package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
  33. package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
  34. package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
  35. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  36. package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
  37. package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
  38. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
  39. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  40. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
  41. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
  42. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
  43. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
  44. package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
  45. package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
  46. package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
  47. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  48. package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
  49. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
  50. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
  51. package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
  52. package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
  53. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
  54. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
  55. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
  56. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
  57. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
  58. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
  59. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
  60. package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
  61. package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
  62. package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
  63. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
  64. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
  65. package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
  66. package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
  67. package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
  68. package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
  69. package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
  70. package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
  71. package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
  72. package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
  73. package/dist/healthybowl/pages/network/EventsPage.js +16 -16
  74. package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
  75. package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
  76. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  77. package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
  78. package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
  79. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
  80. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
  81. package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
  82. package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
  83. package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
  84. package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
  85. package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
  86. package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
  87. package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
  88. package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
  89. package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
  90. package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
  91. package/dist/healthybowl/utils/cropComparison.js +1 -1
  92. package/dist/healthybowl/utils/cropComparison.js.map +1 -1
  93. package/dist/healthybowl/utils/cropPicker.js +35 -0
  94. package/dist/healthybowl/utils/cropPicker.js.map +1 -0
  95. package/dist/healthybowl/utils/plantingCapacity.js +2 -2
  96. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  97. package/dist/healthybowl/utils/quotaLabels.js +8 -0
  98. package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
  99. package/dist/healthybowl/utils/seedRate.js +1 -8
  100. package/dist/healthybowl/utils/seedRate.js.map +1 -1
  101. package/package.json +1 -1
@@ -1,29 +1,35 @@
1
- import { formatDate as e } from "../../utils/helpers.js";
2
- import { GetHelpButton as t } from "../../components/GetHelpButton.js";
3
- import { useBasePath as n } from "../../hooks/useBasePath.js";
4
- import { ToastContainer as r } from "../../components/Toast.js";
5
- import { useConfirm as ee } from "../../components/ConfirmDialog.js";
6
- import { HBEntityImages as te } from "../../components/HBEntityImages.js";
7
- import { useToast as ne } from "../../hooks/useToast.js";
1
+ import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
2
+ import { formatDate as t } from "../../utils/helpers.js";
3
+ import { GetHelpButton as n } from "../../components/GetHelpButton.js";
4
+ import { PageLayout as ee } from "../../components/PageLayout.js";
5
+ import { useBasePath as te } from "../../hooks/useBasePath.js";
6
+ import { useCropPage as ne } from "../../hooks/useCropPage.js";
7
+ import { groupPickerRecords as r } from "../../utils/cropPicker.js";
8
+ import { ToastContainer as re } from "../../components/Toast.js";
9
+ import { useConfirm as ie } from "../../components/ConfirmDialog.js";
10
+ import { HBEntityImages as ae } from "../../components/HBEntityImages.js";
11
+ import { useToast as oe } from "../../hooks/useToast.js";
8
12
  import "../../components/index.js";
9
- import { useHealthyBowlData as re } from "../../hooks/useHealthyBowlData.js";
10
- import { isNative as i, nativeNotify as a, nativeToast as o } from "../../../utils/nativeBridge.js";
11
- import { useEffect as ie, useState as s } from "react";
12
- import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
- import { AlertTriangle as ae, ArrowRight as oe, Calendar as l, Edit as u, Eye as d, MapPin as f, MoreVertical as se, Plus as p, Scissors as ce, Search as m, Sprout as h, Sun as le, Trash2 as g, TrendingUp as _ } from "lucide-react";
14
- import { useNavigate as ue } from "react-router";
15
- import { Fragment as de, jsx as v, jsxs as y } from "react/jsx-runtime";
16
- import { Badge as b, Button as x, Card as fe, CardContent as pe, CardHeader as me, DropdownMenu as he, DropdownMenuContent as ge, DropdownMenuItem as S, DropdownMenuTrigger as _e, EmphasisPanel as ve, EmptyState as ye, IllustratedEmptyState as be, Input as C, PageContainer as xe, PagePurpose as Se, ResponsiveDialog as Ce, ResponsiveDialogContent as we, ResponsiveDialogDescription as Te, ResponsiveDialogFooter as Ee, ResponsiveDialogHeader as De, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Spinner as A } from "@burdenoff/fe-libs/ui";
17
- import { PageHeader as Oe } from "@burdenoff/fe-libs/chrome";
13
+ import { useHealthyBowlData as se } from "../../hooks/useHealthyBowlData.js";
14
+ import { WorkspaceBrowseFilters as ce } from "../catalog/WorkspaceBrowseFilters.js";
15
+ import { useClampBrowseOffset as le } from "../catalog/browsePagination.js";
16
+ import { isNative as i, nativeNotify as ue, nativeToast as de } from "../../../utils/nativeBridge.js";
17
+ import { useMemo as fe, useState as a } from "react";
18
+ import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
+ import { AlertTriangle as me, ArrowRight as he, Calendar as o, Edit as ge, Eye as s, MapPin as c, MoreVertical as _e, Plus as l, Scissors as ve, Sprout as u, Sun as ye, Trash2 as d, TrendingUp as f } from "lucide-react";
20
+ import { useNavigate as be } from "react-router";
21
+ import { Fragment as xe, jsx as p, jsxs as m } from "react/jsx-runtime";
22
+ import { Badge as h, Button as g, Card as Se, CardContent as Ce, CardHeader as we, DropdownMenu as Te, DropdownMenuContent as Ee, DropdownMenuItem as _, DropdownMenuTrigger as De, EmphasisPanel as Oe, EmptyState as ke, IllustratedEmptyState as Ae, Input as v, PageContainer as je, PagePurpose as Me, Pagination as Ne, ResponsiveDialog as Pe, ResponsiveDialogContent as Fe, ResponsiveDialogDescription as Ie, ResponsiveDialogFooter as Le, ResponsiveDialogHeader as Re, ResponsiveDialogTitle as ze, Select as y, SelectContent as b, SelectItem as x, SelectTrigger as S, SelectValue as C, Spinner as w } from "@burdenoff/fe-libs/ui";
23
+ import { PageHeader as Be } from "@burdenoff/fe-libs/chrome";
18
24
  //#region src/healthybowl/pages/crops/CropsPage.tsx
19
- var ke = (e) => {
25
+ var Ve = (e) => {
20
26
  switch (e) {
21
27
  case "excellent": return "success";
22
28
  case "good": return "info";
23
29
  case "fair": return "warning";
24
30
  default: return "destructive";
25
31
  }
26
- }, Ae = (e) => {
32
+ }, He = (e) => {
27
33
  switch (e) {
28
34
  case "harvest_ready": return "success";
29
35
  case "growing":
@@ -31,7 +37,7 @@ var ke = (e) => {
31
37
  case "planted": return "secondary";
32
38
  default: return "default";
33
39
  }
34
- }, j = {
40
+ }, T = {
35
41
  name: "",
36
42
  variety: "",
37
43
  category: "Vegetables",
@@ -41,129 +47,147 @@ var ke = (e) => {
41
47
  field: "",
42
48
  yieldEstimate: 0,
43
49
  imageIds: []
44
- }, M = () => {
45
- let { crops: M, fields: N, errors: je, loadings: Me, createCrop: Ne, updateCrop: Pe, deleteCrop: Fe, refetch: Ie } = re(), [P, Le] = s(M), [F, Re] = s(""), [I, ze] = s("all"), [L, Be] = s("all"), [Ve, R] = s(!1), [z, B] = s(j), [V, H] = s(null), [U, W] = s(!1), G = ue(), { buildPath: K } = n(), { toasts: He, toast: q, dismiss: Ue } = ne(), { t: J } = c(), We = ee();
46
- ie(() => {
47
- Le(M);
48
- }, [M]);
49
- let Y = P.filter((e) => {
50
- let t = (e.name ?? "").toLowerCase().includes(F.toLowerCase()) || (e.variety ?? "").toLowerCase().includes(F.toLowerCase()) || (e.fieldName ?? "").toLowerCase().includes(F.toLowerCase()), n = I === "all" || e.season === I, r = L === "all" || e.healthStatus === L;
51
- return t && n && r;
52
- }), Ge = P.filter((e) => e.healthStatus === "excellent" || e.healthStatus === "good").length, Ke = P.reduce((e, t) => e + t.yieldEstimate, 0), X = () => {
53
- R(!1), B(j), H(null);
54
- }, qe = async () => {
55
- if (!z.name || !z.variety || !z.field) {
56
- q({
57
- title: J("healthybowl.crops.list.toast.missingFields.title", "Missing required fields"),
58
- description: J("healthybowl.crops.list.toast.missingFields.message", "Please fill in name, variety, and field."),
50
+ }, E = () => {
51
+ let { workspaceId: t } = e();
52
+ return t ? /* @__PURE__ */ p(D, {}, t) : /* @__PURE__ */ p(ee, {
53
+ title: "Crop Management",
54
+ children: /* @__PURE__ */ p("p", {
55
+ className: "text-sm text-text-secondary",
56
+ children: "Choose a workspace to browse its crops."
57
+ })
58
+ });
59
+ }, D = () => {
60
+ let { fields: e, createCrop: ee, updateCrop: E, deleteCrop: D } = se(), [O, Ue] = a(""), [k, We] = a(""), [A, Ge] = a(!1), [Ke, j] = a(0), [M, qe] = a("all"), [N, Je] = a("all"), [P, Ye] = a("all"), [F, Xe] = a("all"), I = ne({
61
+ search: O || void 0,
62
+ category: A ? void 0 : k || void 0,
63
+ uncategorized: A || void 0,
64
+ status: M === "all" ? void 0 : M,
65
+ growthStage: N === "all" ? void 0 : N,
66
+ limit: 50,
67
+ offset: Ke
68
+ });
69
+ le(I, j);
70
+ let [Ze, L] = a(!1), [R, z] = a(T), [B, V] = a(null), [H, U] = a(!1), W = be(), { buildPath: G } = te(), { toasts: Qe, toast: K, dismiss: $e } = oe(), { t: q } = pe(), et = ie(), J = fe(() => I.items.filter((e) => (P === "all" || e.season === P) && (F === "all" || e.healthStatus === F)), [
71
+ I.items,
72
+ P,
73
+ F
74
+ ]), tt = fe(() => r(J), [J]), nt = r(I.items).flatMap((e) => e.category === null ? [] : [e.category]), Y = !!(O || k || A || M !== "all" || N !== "all"), X = P !== "all" || F !== "all", Z = (e, t) => {
75
+ e(t), j(0);
76
+ }, rt = J.filter((e) => e.healthStatus === "excellent" || e.healthStatus === "good").length, it = J.reduce((e, t) => e + t.yieldEstimate, 0), Q = !I.loading && !I.error, at = () => {
77
+ L(!1), z(T), V(null);
78
+ }, ot = async () => {
79
+ if (!R.name || !R.variety || !R.field) {
80
+ K({
81
+ title: q("healthybowl.crops.list.toast.missingFields.title", "Missing required fields"),
82
+ description: q("healthybowl.crops.list.toast.missingFields.message", "Please fill in name, variety, and field."),
59
83
  variant: "warning"
60
84
  });
61
85
  return;
62
86
  }
63
- if (V) {
64
- W(!0);
87
+ if (B) {
88
+ U(!0);
65
89
  try {
66
- await Pe({
67
- id: V.id,
68
- name: z.name,
69
- variety: z.variety,
70
- category: z.category,
71
- season: z.season,
72
- plantingDate: z.plantingDate || void 0,
73
- expectedHarvestDate: z.expectedHarvestDate || void 0,
74
- fieldId: z.field || void 0,
75
- yieldEstimate: z.yieldEstimate ? Number(z.yieldEstimate) : void 0,
76
- imageIds: z.imageIds
77
- }), q({
78
- title: J("healthybowl.crops.list.toast.updated.title", "Crop updated"),
79
- description: J("healthybowl.crops.list.toast.updated.message", "{{name}} ({{variety}}) has been updated.", {
80
- name: z.name,
81
- variety: z.variety
90
+ await E({
91
+ id: B.id,
92
+ name: R.name,
93
+ variety: R.variety,
94
+ category: R.category,
95
+ season: R.season,
96
+ plantingDate: R.plantingDate || void 0,
97
+ expectedHarvestDate: R.expectedHarvestDate || void 0,
98
+ fieldId: R.field || void 0,
99
+ yieldEstimate: R.yieldEstimate ? Number(R.yieldEstimate) : void 0,
100
+ imageIds: R.imageIds
101
+ }), await I.refetch(), K({
102
+ title: q("healthybowl.crops.list.toast.updated.title", "Crop updated"),
103
+ description: q("healthybowl.crops.list.toast.updated.message", "{{name}} ({{variety}}) has been updated.", {
104
+ name: R.name,
105
+ variety: R.variety
82
106
  }),
83
107
  variant: "success"
84
- }), R(!1), B(j), H(null);
108
+ }), L(!1), z(T), V(null);
85
109
  } catch (e) {
86
- q({
87
- title: J("healthybowl.crops.list.toast.updateFailed.title", "Update failed"),
110
+ K({
111
+ title: q("healthybowl.crops.list.toast.updateFailed.title", "Update failed"),
88
112
  description: String(e),
89
113
  variant: "error"
90
114
  });
91
115
  } finally {
92
- W(!1);
116
+ U(!1);
93
117
  }
94
118
  return;
95
119
  }
96
- let e = z.field || N[0]?.id;
97
- if (!e) {
98
- q({
99
- title: J("healthybowl.crops.list.toast.noField.title", "No field available"),
100
- description: J("healthybowl.crops.list.toast.noField.message", "Please create a field before adding a crop."),
120
+ let t = R.field || e[0]?.id;
121
+ if (!t) {
122
+ K({
123
+ title: q("healthybowl.crops.list.toast.noField.title", "No field available"),
124
+ description: q("healthybowl.crops.list.toast.noField.message", "Please create a field before adding a crop."),
101
125
  variant: "warning"
102
126
  });
103
127
  return;
104
128
  }
105
- W(!0);
129
+ U(!0);
106
130
  try {
107
- await Ne({
108
- name: z.name,
109
- variety: z.variety,
110
- category: z.category || "vegetable",
111
- season: z.season || "kharif",
112
- plantingDate: z.plantingDate || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
113
- expectedHarvestDate: z.expectedHarvestDate || new Date(Date.now() + 90 * 864e5).toISOString().split("T")[0],
114
- fieldId: e,
131
+ await ee({
132
+ name: R.name,
133
+ variety: R.variety,
134
+ category: R.category || "vegetable",
135
+ season: R.season || "kharif",
136
+ plantingDate: R.plantingDate || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
137
+ expectedHarvestDate: R.expectedHarvestDate || new Date(Date.now() + 90 * 864e5).toISOString().split("T")[0],
138
+ fieldId: t,
115
139
  status: "planted",
116
140
  growthStage: "Seedling",
117
141
  healthStatus: "good",
118
- yieldEstimate: z.yieldEstimate ? Number(z.yieldEstimate) : 100,
142
+ yieldEstimate: R.yieldEstimate ? Number(R.yieldEstimate) : 100,
119
143
  yieldUnit: "kg",
120
144
  organicCertified: !1,
121
145
  daysToHarvest: 90,
122
146
  progress: 0,
123
- imageIds: z.imageIds
124
- }), q({
125
- title: J("healthybowl.crops.list.toast.created.title", "Crop added successfully"),
126
- description: J("healthybowl.crops.list.toast.created.message", "{{name}} ({{variety}}) has been created.", {
127
- name: z.name,
128
- variety: z.variety
147
+ imageIds: R.imageIds
148
+ }), await I.refetch(), K({
149
+ title: q("healthybowl.crops.list.toast.created.title", "Crop added successfully"),
150
+ description: q("healthybowl.crops.list.toast.created.message", "{{name}} ({{variety}}) has been created.", {
151
+ name: R.name,
152
+ variety: R.variety
129
153
  }),
130
154
  variant: "success"
131
- }), R(!1), B(j), H(null);
155
+ }), L(!1), z(T), V(null);
132
156
  } catch (e) {
133
- q({
134
- title: J("healthybowl.crops.list.toast.createFailed.title", "Create failed"),
157
+ K({
158
+ title: q("healthybowl.crops.list.toast.createFailed.title", "Create failed"),
135
159
  description: String(e),
136
160
  variant: "error"
137
161
  });
138
162
  } finally {
139
- W(!1);
163
+ U(!1);
140
164
  }
141
- }, Z = async (e) => {
142
- if (await We({
143
- title: J("healthybowl.crops.list.delete.confirm.title", "Delete crop?"),
144
- message: J("healthybowl.crops.list.delete.confirm.message", "{{name}} will be permanently removed.", { name: e.name ?? J("healthybowl.crops.list.delete.confirm.fallbackName", "This crop") }),
145
- okButtonTitle: J("healthybowl.common.delete", "Delete"),
146
- cancelButtonTitle: J("healthybowl.common.cancel", "Cancel")
165
+ }, st = async (e) => {
166
+ if (await et({
167
+ title: q("healthybowl.crops.list.delete.confirm.title", "Delete crop?"),
168
+ message: q("healthybowl.crops.list.delete.confirm.message", "{{name}} will be permanently removed.", { name: e.name ?? q("healthybowl.crops.list.delete.confirm.fallbackName", "This crop") }),
169
+ okButtonTitle: q("healthybowl.common.delete", "Delete"),
170
+ cancelButtonTitle: q("healthybowl.common.cancel", "Cancel")
147
171
  }) !== !1) {
148
- W(!0);
172
+ U(!0);
149
173
  try {
150
- await Fe(e.id), q({
151
- title: J("healthybowl.crops.list.toast.deleted.title", "Crop deleted"),
152
- description: J("healthybowl.crops.list.toast.deleted.message", "{{name}} has been removed.", { name: e.name ?? J("healthybowl.crops.list.toast.deleted.fallbackName", "Crop") }),
174
+ await D(e.id), await I.refetch(), K({
175
+ title: q("healthybowl.crops.list.toast.deleted.title", "Crop deleted"),
176
+ description: q("healthybowl.crops.list.toast.deleted.message", "{{name}} has been removed.", { name: e.name ?? q("healthybowl.crops.list.toast.deleted.fallbackName", "Crop") }),
153
177
  variant: "success"
154
- }), i() && (o(J("healthybowl.crops.list.toast.deleted.title", "Crop deleted")), a("success"));
178
+ }), i() && (de(q("healthybowl.crops.list.toast.deleted.title", "Crop deleted")), ue("success"));
155
179
  } catch (e) {
156
- q({
157
- title: J("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed"),
180
+ K({
181
+ title: q("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed"),
158
182
  description: String(e),
159
183
  variant: "error"
160
- }), i() && (o(J("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed")), a("error"));
184
+ }), i() && (de(q("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed")), ue("error"));
161
185
  } finally {
162
- W(!1);
186
+ U(!1);
163
187
  }
164
188
  }
165
- }, Q = (e) => {
166
- H(e), B({
189
+ }, ct = (e) => {
190
+ V(e), z({
167
191
  name: e.name,
168
192
  variety: e.variety,
169
193
  category: e.category,
@@ -173,544 +197,611 @@ var ke = (e) => {
173
197
  field: e.field,
174
198
  yieldEstimate: e.yieldEstimate,
175
199
  imageIds: e.imageIds ?? []
176
- }), R(!0);
177
- }, $ = (e, t) => B((n) => ({
200
+ }), L(!0);
201
+ }, $ = (e, t) => z((n) => ({
178
202
  ...n,
179
203
  [e]: t
180
204
  }));
181
- return /* @__PURE__ */ y(xe, { children: [
182
- /* @__PURE__ */ v(Oe, {
183
- title: J("healthybowl.crops.list.title", "Crop Management"),
184
- description: J("healthybowl.crops.list.subtitle", "Manage and monitor all your crops in one place"),
185
- breadcrumb: [{ label: J("healthybowl.crops.list.breadcrumb.crops", "Crops") }],
186
- actions: /* @__PURE__ */ y(de, { children: [/* @__PURE__ */ v(t, { prompt: "What is the Crop Management page for, and how do I use it?" }), /* @__PURE__ */ y(x, {
205
+ return /* @__PURE__ */ m(je, { children: [
206
+ /* @__PURE__ */ p(Be, {
207
+ title: q("healthybowl.crops.list.title", "Crop Management"),
208
+ description: q("healthybowl.crops.list.subtitle", "Manage and monitor all your crops in one place"),
209
+ breadcrumb: [{ label: q("healthybowl.crops.list.breadcrumb.crops", "Crops") }],
210
+ actions: /* @__PURE__ */ m(xe, { children: [/* @__PURE__ */ p(n, { prompt: "What is the Crop Management page for, and how do I use it?" }), /* @__PURE__ */ m(g, {
187
211
  onClick: () => {
188
- H(null), B(j), R(!0);
212
+ V(null), z(T), L(!0);
189
213
  },
190
214
  children: [
191
- /* @__PURE__ */ v(p, { className: "h-4 w-4" }),
215
+ /* @__PURE__ */ p(l, { className: "h-4 w-4" }),
192
216
  " ",
193
- J("healthybowl.crops.list.actions.addCrop", "Add New Crop")
217
+ q("healthybowl.crops.list.actions.addCrop", "Add New Crop")
194
218
  ]
195
219
  })] })
196
220
  }),
197
- /* @__PURE__ */ v(Se, {
221
+ /* @__PURE__ */ p(Me, {
198
222
  className: "mt-2",
199
223
  children: "Your crops, all in one place. Register what you’re growing, track each crop’s health and progress toward harvest, and jump into fields, planting plans and harvest records — everything that turns a seed into a sale starts here."
200
224
  }),
201
- /* @__PURE__ */ v("div", {
225
+ /* @__PURE__ */ p("div", {
202
226
  className: "flex flex-wrap gap-3",
203
227
  children: [
204
228
  {
205
229
  key: "fields",
206
- label: J("healthybowl.crops.list.nav.fields.label", "Fields"),
207
- icon: f,
208
- path: K("crops/fields"),
209
- desc: J("healthybowl.crops.list.nav.fields.desc", "Manage farm fields")
230
+ label: q("healthybowl.crops.list.nav.fields.label", "Fields"),
231
+ icon: c,
232
+ path: G("crops/fields"),
233
+ desc: q("healthybowl.crops.list.nav.fields.desc", "Manage farm fields")
210
234
  },
211
235
  {
212
236
  key: "planning",
213
- label: J("healthybowl.crops.list.nav.planning.label", "Planning"),
214
- icon: l,
215
- path: K("crops/planning"),
216
- desc: J("healthybowl.crops.list.nav.planning.desc", "Planting plans")
237
+ label: q("healthybowl.crops.list.nav.planning.label", "Planning"),
238
+ icon: o,
239
+ path: G("crops/planning"),
240
+ desc: q("healthybowl.crops.list.nav.planning.desc", "Planting plans")
217
241
  },
218
242
  {
219
243
  key: "harvest",
220
- label: J("healthybowl.crops.list.nav.harvest.label", "Harvest"),
221
- icon: ce,
222
- path: K("crops/harvest"),
223
- desc: J("healthybowl.crops.list.nav.harvest.desc", "Harvest records")
244
+ label: q("healthybowl.crops.list.nav.harvest.label", "Harvest"),
245
+ icon: ve,
246
+ path: G("crops/harvest"),
247
+ desc: q("healthybowl.crops.list.nav.harvest.desc", "Harvest records")
224
248
  }
225
- ].map((e) => /* @__PURE__ */ y("button", {
249
+ ].map((e) => /* @__PURE__ */ m("button", {
226
250
  type: "button",
227
- onClick: () => G(e.path),
251
+ onClick: () => W(e.path),
228
252
  className: "flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface px-4 py-3 text-start shadow-sm transition-colors hover:border-primary/30 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
229
253
  children: [
230
- /* @__PURE__ */ v(e.icon, { className: "h-5 w-5 text-text-secondary" }),
231
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
254
+ /* @__PURE__ */ p(e.icon, { className: "h-5 w-5 text-text-secondary" }),
255
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
232
256
  className: "text-sm font-medium text-text-primary",
233
257
  children: e.label
234
- }), /* @__PURE__ */ v("p", {
258
+ }), /* @__PURE__ */ p("p", {
235
259
  className: "text-xs text-text-secondary",
236
260
  children: e.desc
237
261
  })] }),
238
- /* @__PURE__ */ v(oe, { className: "ms-2 h-4 w-4 text-text-secondary" })
262
+ /* @__PURE__ */ p(he, { className: "ms-2 h-4 w-4 text-text-secondary" })
239
263
  ]
240
264
  }, e.key))
241
265
  }),
242
- /* @__PURE__ */ y("div", {
266
+ /* @__PURE__ */ m("div", {
243
267
  className: "mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
244
268
  children: [
245
- /* @__PURE__ */ v(ve, {
269
+ /* @__PURE__ */ p(Oe, {
246
270
  className: "p-4",
247
- children: /* @__PURE__ */ y("div", {
271
+ children: /* @__PURE__ */ m("div", {
248
272
  className: "flex items-center justify-between",
249
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
273
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
250
274
  className: "text-xs font-medium text-text-secondary",
251
- children: J("healthybowl.crops.list.stats.totalCrops.label", "Total Crops")
252
- }), /* @__PURE__ */ v("p", {
275
+ children: q("healthybowl.crops.list.stats.matchingWorkspaceCrops", "Matching workspace crops")
276
+ }), /* @__PURE__ */ p("p", {
253
277
  className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
254
- children: P.length
255
- })] }), /* @__PURE__ */ v(h, { className: "h-6 w-6 text-primary" })]
278
+ children: Q ? I.total : "—"
279
+ })] }), /* @__PURE__ */ p(u, { className: "h-6 w-6 text-primary" })]
256
280
  })
257
281
  }),
258
- /* @__PURE__ */ v("div", {
282
+ /* @__PURE__ */ p("div", {
259
283
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
260
- children: /* @__PURE__ */ y("div", {
284
+ children: /* @__PURE__ */ m("div", {
261
285
  className: "flex items-center justify-between",
262
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
286
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
263
287
  className: "text-xs font-medium text-text-secondary",
264
- children: J("healthybowl.crops.list.stats.totalFields.label", "Total Fields")
265
- }), /* @__PURE__ */ v("p", {
288
+ children: q("healthybowl.crops.list.stats.loadedFields", "Loaded fields")
289
+ }), /* @__PURE__ */ p("p", {
266
290
  className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
267
- children: N.length
268
- })] }), /* @__PURE__ */ v(f, { className: "h-6 w-6 text-text-secondary" })]
291
+ children: e.length
292
+ })] }), /* @__PURE__ */ p(c, { className: "h-6 w-6 text-text-secondary" })]
269
293
  })
270
294
  }),
271
- /* @__PURE__ */ v("div", {
295
+ /* @__PURE__ */ p("div", {
272
296
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
273
- children: /* @__PURE__ */ y("div", {
297
+ children: /* @__PURE__ */ m("div", {
274
298
  className: "flex items-center justify-between",
275
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
299
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
276
300
  className: "text-xs font-medium text-text-secondary",
277
- children: J("healthybowl.crops.list.stats.healthyCrops.label", "Healthy Crops")
278
- }), /* @__PURE__ */ v("p", {
279
- className: "mt-1 text-2xl font-bold tabular-nums text-success",
280
- children: Ge
281
- })] }), /* @__PURE__ */ v(le, { className: "h-6 w-6 text-text-secondary" })]
301
+ children: q("healthybowl.crops.list.stats.healthyOnPage", "Healthy crops shown on this page")
302
+ }), /* @__PURE__ */ p("p", {
303
+ className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
304
+ children: Q ? rt : "—"
305
+ })] }), /* @__PURE__ */ p(ye, { className: "h-6 w-6 text-text-secondary" })]
282
306
  })
283
307
  }),
284
- /* @__PURE__ */ v("div", {
308
+ /* @__PURE__ */ p("div", {
285
309
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
286
- children: /* @__PURE__ */ y("div", {
310
+ children: /* @__PURE__ */ m("div", {
287
311
  className: "flex items-center justify-between",
288
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
312
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
289
313
  className: "text-xs font-medium text-text-secondary",
290
- children: J("healthybowl.crops.list.stats.estYield.label", "Est. Yield")
291
- }), /* @__PURE__ */ y("p", {
314
+ children: q("healthybowl.crops.list.stats.yieldOnPage", "Est. yield shown on this page")
315
+ }), /* @__PURE__ */ p("p", {
292
316
  className: "mt-1 text-2xl font-bold tabular-nums text-text-primary",
293
- children: [(Ke / 1e3).toFixed(1), "t"]
294
- })] }), /* @__PURE__ */ v(_, { className: "h-6 w-6 text-text-secondary" })]
317
+ children: Q ? `${(it / 1e3).toFixed(1)}t` : "—"
318
+ })] }), /* @__PURE__ */ p(f, { className: "h-6 w-6 text-text-secondary" })]
295
319
  })
296
320
  })
297
321
  ]
298
322
  }),
299
- /* @__PURE__ */ y("div", {
300
- className: "mt-4 flex flex-col gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
301
- children: [/* @__PURE__ */ y("div", {
302
- className: "flex flex-wrap items-center gap-3",
303
- children: [
304
- /* @__PURE__ */ y("div", {
305
- className: "relative",
306
- children: [/* @__PURE__ */ v(m, { className: "absolute start-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ v(C, {
307
- type: "text",
308
- placeholder: J("healthybowl.crops.list.filters.search.placeholder", "Search crops, varieties, or fields..."),
309
- value: F,
310
- onChange: (e) => Re(e.target.value),
311
- className: "w-64 ps-10"
312
- })]
313
- }),
314
- /* @__PURE__ */ y(T, {
315
- value: I,
316
- onValueChange: (e) => ze(e),
317
- children: [/* @__PURE__ */ v(O, {
323
+ /* @__PURE__ */ m("div", {
324
+ className: "mt-4 space-y-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
325
+ children: [
326
+ /* @__PURE__ */ m(ce, {
327
+ id: "crop-browse",
328
+ search: O,
329
+ category: k,
330
+ uncategorized: A,
331
+ onSearchChange: (e) => Z(Ue, e),
332
+ onCategoryChange: (e) => Z(We, e),
333
+ onUncategorizedChange: (e) => {
334
+ Ge(e), j(0);
335
+ },
336
+ categorySuggestions: nt,
337
+ searchLabel: "Search workspace crops",
338
+ children: [/* @__PURE__ */ m(y, {
339
+ value: M,
340
+ onValueChange: (e) => Z(qe, e),
341
+ children: [/* @__PURE__ */ p(S, {
342
+ "aria-label": "Crop status",
318
343
  className: "w-auto min-w-[10rem]",
319
- children: /* @__PURE__ */ v(k, {})
320
- }), /* @__PURE__ */ y(E, { children: [
321
- /* @__PURE__ */ v(D, {
322
- value: "all",
323
- children: J("healthybowl.crops.list.filters.season.all", "All Seasons")
324
- }),
325
- /* @__PURE__ */ v(D, {
326
- value: "kharif",
327
- children: J("healthybowl.crops.list.filters.season.kharif", "Kharif")
328
- }),
329
- /* @__PURE__ */ v(D, {
330
- value: "rabi",
331
- children: J("healthybowl.crops.list.filters.season.rabi", "Rabi")
332
- }),
333
- /* @__PURE__ */ v(D, {
334
- value: "zaid",
335
- children: J("healthybowl.crops.list.filters.season.zaid", "Zaid")
336
- }),
337
- /* @__PURE__ */ v(D, {
338
- value: "perennial",
339
- children: J("healthybowl.crops.list.filters.season.perennial", "Perennial")
340
- })
341
- ] })]
342
- }),
343
- /* @__PURE__ */ y(T, {
344
- value: L,
345
- onValueChange: (e) => Be(e),
346
- children: [/* @__PURE__ */ v(O, {
344
+ children: /* @__PURE__ */ p(C, {})
345
+ }), /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ p(x, {
346
+ value: "all",
347
+ children: "All crop statuses"
348
+ }), [
349
+ "planning",
350
+ "planted",
351
+ "growing",
352
+ "flowering",
353
+ "fruiting",
354
+ "harvest_ready",
355
+ "harvested"
356
+ ].map((e) => /* @__PURE__ */ p(x, {
357
+ value: e,
358
+ children: e.replace(/_/g, " ")
359
+ }, e))] })]
360
+ }), /* @__PURE__ */ m(y, {
361
+ value: N,
362
+ onValueChange: (e) => Z(Je, e),
363
+ children: [/* @__PURE__ */ p(S, {
364
+ "aria-label": "Growth stage",
347
365
  className: "w-auto min-w-[10rem]",
348
- children: /* @__PURE__ */ v(k, {})
349
- }), /* @__PURE__ */ y(E, { children: [
350
- /* @__PURE__ */ v(D, {
351
- value: "all",
352
- children: J("healthybowl.crops.list.filters.health.all", "All Health")
353
- }),
354
- /* @__PURE__ */ v(D, {
355
- value: "excellent",
356
- children: J("healthybowl.crops.list.filters.health.excellent", "Excellent")
357
- }),
358
- /* @__PURE__ */ v(D, {
359
- value: "good",
360
- children: J("healthybowl.crops.list.filters.health.good", "Good")
361
- }),
362
- /* @__PURE__ */ v(D, {
363
- value: "fair",
364
- children: J("healthybowl.crops.list.filters.health.fair", "Fair")
365
- }),
366
- /* @__PURE__ */ v(D, {
367
- value: "poor",
368
- children: J("healthybowl.crops.list.filters.health.poor", "Poor")
369
- })
370
- ] })]
371
- })
372
- ]
373
- }), /* @__PURE__ */ v("span", {
374
- className: "text-xs text-text-secondary",
375
- children: J("healthybowl.crops.list.filters.resultCount", "Showing {{shown}} of {{total}} crops", {
376
- shown: Y.length,
377
- total: P.length
378
- })
379
- })]
380
- }),
381
- /* @__PURE__ */ v("div", {
382
- className: "mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
383
- children: Y.map((t) => /* @__PURE__ */ y(fe, {
384
- className: "bg-bg-surface",
385
- children: [/* @__PURE__ */ v(me, {
386
- className: "space-y-0 p-4",
387
- children: /* @__PURE__ */ y("div", {
388
- className: "flex items-start justify-between",
389
- children: [/* @__PURE__ */ y("div", {
390
- className: "flex items-center gap-2",
391
- children: [/* @__PURE__ */ v(h, { className: "h-5 w-5 text-primary" }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
392
- className: "font-medium text-text-primary",
393
- children: t.name
394
- }), /* @__PURE__ */ v("p", {
395
- className: "text-xs text-text-secondary",
396
- children: t.variety
397
- })] })]
398
- }), /* @__PURE__ */ y(he, { children: [/* @__PURE__ */ v(_e, {
399
- asChild: !0,
400
- children: /* @__PURE__ */ v(x, {
401
- variant: "ghost",
402
- size: "icon-sm",
403
- className: "text-text-secondary",
404
- "aria-label": J("healthybowl.crops.list.card.menu.label", "Crop actions"),
405
- children: /* @__PURE__ */ v(se, { className: "h-4 w-4" })
406
- })
407
- }), /* @__PURE__ */ y(ge, {
408
- align: "end",
409
- className: "w-36",
410
- children: [
411
- /* @__PURE__ */ y(S, {
412
- onClick: () => G(K(`crops/${t.id}`)),
413
- children: [
414
- /* @__PURE__ */ v(d, { className: "h-3.5 w-3.5" }),
415
- " ",
416
- J("healthybowl.common.view", "View")
417
- ]
366
+ children: /* @__PURE__ */ p(C, {})
367
+ }), /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ p(x, {
368
+ value: "all",
369
+ children: "All growth stages"
370
+ }), [
371
+ "Seedling",
372
+ "Vegetative",
373
+ "Flowering",
374
+ "Fruiting",
375
+ "Mature"
376
+ ].map((e) => /* @__PURE__ */ p(x, {
377
+ value: e,
378
+ children: e
379
+ }, e))] })]
380
+ })]
381
+ }),
382
+ /* @__PURE__ */ m("div", {
383
+ className: "flex flex-wrap items-center gap-3",
384
+ children: [
385
+ /* @__PURE__ */ p("span", {
386
+ className: "text-xs text-text-secondary",
387
+ children: "View within this server page only:"
388
+ }),
389
+ /* @__PURE__ */ m(y, {
390
+ value: P,
391
+ onValueChange: (e) => Z(Ye, e),
392
+ children: [/* @__PURE__ */ p(S, {
393
+ "aria-label": "Season on this page",
394
+ className: "w-auto min-w-[10rem]",
395
+ children: /* @__PURE__ */ p(C, {})
396
+ }), /* @__PURE__ */ m(b, { children: [
397
+ /* @__PURE__ */ p(x, {
398
+ value: "all",
399
+ children: "All seasons on this page"
418
400
  }),
419
- /* @__PURE__ */ y(S, {
420
- onClick: () => Q(t),
421
- children: [
422
- /* @__PURE__ */ v(u, { className: "h-3.5 w-3.5" }),
423
- " ",
424
- J("healthybowl.common.edit", "Edit")
425
- ]
401
+ /* @__PURE__ */ p(x, {
402
+ value: "kharif",
403
+ children: "Kharif"
426
404
  }),
427
- /* @__PURE__ */ y(S, {
428
- onClick: () => Z(t),
429
- disabled: U,
430
- className: "text-status-error-text",
431
- children: [
432
- /* @__PURE__ */ v(g, { className: "h-3.5 w-3.5" }),
433
- " ",
434
- J("healthybowl.common.delete", "Delete")
435
- ]
405
+ /* @__PURE__ */ p(x, {
406
+ value: "rabi",
407
+ children: "Rabi"
408
+ }),
409
+ /* @__PURE__ */ p(x, {
410
+ value: "zaid",
411
+ children: "Zaid"
412
+ }),
413
+ /* @__PURE__ */ p(x, {
414
+ value: "perennial",
415
+ children: "Perennial"
436
416
  })
437
- ]
438
- })] })]
439
- })
440
- }), /* @__PURE__ */ y(pe, {
441
- className: "p-4 pt-0",
442
- children: [
443
- /* @__PURE__ */ y("div", {
444
- className: "flex items-center gap-2",
445
- children: [/* @__PURE__ */ v(b, {
446
- variant: Ae(t.status ?? "unknown"),
447
- children: t.growthStage
448
- }), /* @__PURE__ */ v(b, {
449
- variant: "secondary",
450
- children: t.season
451
- })]
417
+ ] })]
452
418
  }),
453
- /* @__PURE__ */ y("div", {
454
- className: "mt-3 space-y-2 text-xs",
455
- children: [
456
- /* @__PURE__ */ y("div", {
457
- className: "flex items-center justify-between",
458
- children: [/* @__PURE__ */ y("span", {
459
- className: "flex items-center gap-1 text-text-secondary",
460
- children: [
461
- /* @__PURE__ */ v(f, { className: "h-3.5 w-3.5" }),
462
- " ",
463
- t.fieldName
464
- ]
465
- }), /* @__PURE__ */ v("span", {
466
- className: "font-medium text-text-primary",
467
- children: t.category
468
- })]
419
+ /* @__PURE__ */ m(y, {
420
+ value: F,
421
+ onValueChange: (e) => Z(Xe, e),
422
+ children: [/* @__PURE__ */ p(S, {
423
+ "aria-label": "Health on this page",
424
+ className: "w-auto min-w-[10rem]",
425
+ children: /* @__PURE__ */ p(C, {})
426
+ }), /* @__PURE__ */ m(b, { children: [
427
+ /* @__PURE__ */ p(x, {
428
+ value: "all",
429
+ children: "All health on this page"
469
430
  }),
470
- /* @__PURE__ */ y("div", {
471
- className: "flex items-center justify-between",
472
- children: [/* @__PURE__ */ y("span", {
473
- className: "flex items-center gap-1 text-text-secondary",
431
+ /* @__PURE__ */ p(x, {
432
+ value: "excellent",
433
+ children: "Excellent"
434
+ }),
435
+ /* @__PURE__ */ p(x, {
436
+ value: "good",
437
+ children: "Good"
438
+ }),
439
+ /* @__PURE__ */ p(x, {
440
+ value: "fair",
441
+ children: "Fair"
442
+ }),
443
+ /* @__PURE__ */ p(x, {
444
+ value: "poor",
445
+ children: "Poor"
446
+ })
447
+ ] })]
448
+ })
449
+ ]
450
+ }),
451
+ /* @__PURE__ */ p("p", {
452
+ role: "status",
453
+ className: "text-xs text-text-secondary",
454
+ children: I.loading ? "Loading workspace crops…" : I.error ? "Workspace crop totals are unavailable." : `${I.total} server matches · ${I.items.length} on this server page · ${J.length} shown`
455
+ })
456
+ ]
457
+ }),
458
+ Q && tt.map((e) => /* @__PURE__ */ m("section", {
459
+ className: "mt-4 space-y-3",
460
+ children: [/* @__PURE__ */ m("h2", {
461
+ className: "flex flex-wrap items-center gap-2 text-sm font-semibold text-text-primary",
462
+ children: [e.label, /* @__PURE__ */ m("span", {
463
+ className: "text-xs font-normal text-text-secondary",
464
+ children: [e.items.length, " shown on this page"]
465
+ })]
466
+ }), /* @__PURE__ */ p("div", {
467
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
468
+ children: e.items.map((e) => /* @__PURE__ */ m(Se, {
469
+ className: "bg-bg-surface",
470
+ children: [/* @__PURE__ */ p(we, {
471
+ className: "space-y-0 p-4",
472
+ children: /* @__PURE__ */ m("div", {
473
+ className: "flex items-start justify-between",
474
+ children: [/* @__PURE__ */ m("div", {
475
+ className: "flex items-center gap-2",
476
+ children: [/* @__PURE__ */ p(u, { className: "h-5 w-5 text-primary" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h3", {
477
+ className: "font-medium text-text-primary",
478
+ children: e.name
479
+ }), /* @__PURE__ */ p("p", {
480
+ className: "text-xs text-text-secondary",
481
+ children: e.variety
482
+ })] })]
483
+ }), /* @__PURE__ */ m(Te, { children: [/* @__PURE__ */ p(De, {
484
+ asChild: !0,
485
+ children: /* @__PURE__ */ p(g, {
486
+ variant: "ghost",
487
+ size: "icon-sm",
488
+ className: "text-text-secondary",
489
+ "aria-label": q("healthybowl.crops.list.card.menu.label", "Crop actions"),
490
+ children: /* @__PURE__ */ p(_e, { className: "h-4 w-4" })
491
+ })
492
+ }), /* @__PURE__ */ m(Ee, {
493
+ align: "end",
494
+ className: "w-36",
495
+ children: [
496
+ /* @__PURE__ */ m(_, {
497
+ onClick: () => W(G(`crops/${e.id}`)),
474
498
  children: [
475
- /* @__PURE__ */ v(l, { className: "h-3.5 w-3.5" }),
499
+ /* @__PURE__ */ p(s, { className: "h-3.5 w-3.5" }),
476
500
  " ",
477
- J("healthybowl.crops.list.card.planted", "Planted")
501
+ q("healthybowl.common.view", "View")
478
502
  ]
479
- }), /* @__PURE__ */ v("span", {
480
- className: "font-medium tabular-nums text-text-primary",
481
- children: e(t.plantingDate)
482
- })]
483
- }),
484
- /* @__PURE__ */ y("div", {
485
- className: "flex items-center justify-between",
486
- children: [/* @__PURE__ */ y("span", {
487
- className: "flex items-center gap-1 text-text-secondary",
503
+ }),
504
+ /* @__PURE__ */ m(_, {
505
+ onClick: () => ct(e),
488
506
  children: [
489
- /* @__PURE__ */ v(_, { className: "h-3.5 w-3.5" }),
507
+ /* @__PURE__ */ p(ge, { className: "h-3.5 w-3.5" }),
490
508
  " ",
491
- J("healthybowl.crops.list.card.estYield", "Est. Yield")
509
+ q("healthybowl.common.edit", "Edit")
492
510
  ]
493
- }), /* @__PURE__ */ y("span", {
494
- className: "font-medium tabular-nums text-text-primary",
511
+ }),
512
+ /* @__PURE__ */ m(_, {
513
+ onClick: () => st(e),
514
+ disabled: H,
515
+ className: "text-status-error-text",
495
516
  children: [
496
- t.yieldEstimate,
517
+ /* @__PURE__ */ p(d, { className: "h-3.5 w-3.5" }),
497
518
  " ",
498
- t.yieldUnit
519
+ q("healthybowl.common.delete", "Delete")
499
520
  ]
500
- })]
501
- })
502
- ]
503
- }),
504
- /* @__PURE__ */ v("div", {
505
- className: "mt-3",
506
- children: /* @__PURE__ */ y("div", {
507
- className: "flex items-center gap-2",
508
- children: [/* @__PURE__ */ v("div", {
509
- className: "h-2 flex-1 rounded-full bg-bg-sunken",
510
- children: /* @__PURE__ */ v("div", {
511
- className: "h-2 rounded-full bg-action-primary-bg",
512
- style: { width: `${t.progress}%` }
513
521
  })
514
- }), /* @__PURE__ */ y("span", {
515
- className: "text-xs font-medium tabular-nums text-text-secondary",
516
- children: [t.progress, "%"]
517
- })]
518
- })
519
- }),
520
- /* @__PURE__ */ y("div", {
521
- className: "mt-3 flex items-center justify-between",
522
- children: [/* @__PURE__ */ y("div", {
522
+ ]
523
+ })] })]
524
+ })
525
+ }), /* @__PURE__ */ m(Ce, {
526
+ className: "p-4 pt-0",
527
+ children: [
528
+ /* @__PURE__ */ m("div", {
523
529
  className: "flex items-center gap-2",
524
- children: [/* @__PURE__ */ v(b, {
525
- variant: ke(t.healthStatus),
526
- children: t.healthStatus
527
- }), typeof t.healthScore == "number" ? /* @__PURE__ */ v(b, {
530
+ children: [/* @__PURE__ */ p(h, {
531
+ variant: He(e.status ?? "unknown"),
532
+ children: e.growthStage
533
+ }), /* @__PURE__ */ p(h, {
528
534
  variant: "secondary",
529
- title: J("healthybowl.crops.list.card.healthScoreTitle", "Satellite (NDVI) health score"),
530
- children: J("healthybowl.crops.list.card.healthScore", "{{score}}/100 · {{source}}", {
531
- score: t.healthScore,
532
- source: t.healthScoreSource ?? "NDVI"
533
- })
534
- }) : /* @__PURE__ */ v("span", {
535
- className: "text-xs text-text-secondary",
536
- children: "—"
535
+ children: e.season
537
536
  })]
538
- }), /* @__PURE__ */ v("span", {
539
- className: "text-xs tabular-nums text-text-secondary",
540
- children: J("healthybowl.crops.list.card.daysToHarvest", "{{days}}d to harvest", { days: t.daysToHarvest })
541
- })]
542
- }),
543
- /* @__PURE__ */ y("div", {
544
- className: "mt-3 flex gap-2",
545
- children: [
546
- /* @__PURE__ */ y(x, {
547
- variant: "outline",
548
- size: "sm",
549
- className: "flex-1",
550
- onClick: () => G(K(`crops/${t.id}`)),
551
- children: [
552
- /* @__PURE__ */ v(d, { className: "h-3.5 w-3.5" }),
553
- " ",
554
- J("healthybowl.common.view", "View")
555
- ]
556
- }),
557
- /* @__PURE__ */ y(x, {
558
- variant: "outline",
559
- size: "sm",
560
- className: "flex-1",
561
- onClick: () => Q(t),
562
- children: [
563
- /* @__PURE__ */ v(u, { className: "h-3.5 w-3.5" }),
564
- " ",
565
- J("healthybowl.common.edit", "Edit")
566
- ]
567
- }),
568
- /* @__PURE__ */ v(x, {
569
- variant: "ghost",
570
- size: "icon-sm",
571
- onClick: () => Z(t),
572
- disabled: U,
573
- "aria-label": J("healthybowl.common.delete", "Delete"),
574
- className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
575
- children: /* @__PURE__ */ v(g, { className: "h-3.5 w-3.5" })
537
+ }),
538
+ /* @__PURE__ */ m("div", {
539
+ className: "mt-3 space-y-2 text-xs",
540
+ children: [
541
+ /* @__PURE__ */ m("div", {
542
+ className: "flex items-center justify-between",
543
+ children: [/* @__PURE__ */ m("span", {
544
+ className: "flex items-center gap-1 text-text-secondary",
545
+ children: [
546
+ /* @__PURE__ */ p(c, { className: "h-3.5 w-3.5" }),
547
+ " ",
548
+ e.fieldName
549
+ ]
550
+ }), /* @__PURE__ */ p("span", {
551
+ className: "font-medium text-text-primary",
552
+ children: e.category
553
+ })]
554
+ }),
555
+ /* @__PURE__ */ m("div", {
556
+ className: "flex items-center justify-between",
557
+ children: [/* @__PURE__ */ m("span", {
558
+ className: "flex items-center gap-1 text-text-secondary",
559
+ children: [
560
+ /* @__PURE__ */ p(o, { className: "h-3.5 w-3.5" }),
561
+ " ",
562
+ q("healthybowl.crops.list.card.planted", "Planted")
563
+ ]
564
+ }), /* @__PURE__ */ p("span", {
565
+ className: "font-medium tabular-nums text-text-primary",
566
+ children: t(e.plantingDate)
567
+ })]
568
+ }),
569
+ /* @__PURE__ */ m("div", {
570
+ className: "flex items-center justify-between",
571
+ children: [/* @__PURE__ */ m("span", {
572
+ className: "flex items-center gap-1 text-text-secondary",
573
+ children: [
574
+ /* @__PURE__ */ p(f, { className: "h-3.5 w-3.5" }),
575
+ " ",
576
+ q("healthybowl.crops.list.card.estYield", "Est. Yield")
577
+ ]
578
+ }), /* @__PURE__ */ m("span", {
579
+ className: "font-medium tabular-nums text-text-primary",
580
+ children: [
581
+ e.yieldEstimate,
582
+ " ",
583
+ e.yieldUnit
584
+ ]
585
+ })]
586
+ })
587
+ ]
588
+ }),
589
+ /* @__PURE__ */ p("div", {
590
+ className: "mt-3",
591
+ children: /* @__PURE__ */ m("div", {
592
+ className: "flex items-center gap-2",
593
+ children: [/* @__PURE__ */ p("div", {
594
+ className: "h-2 flex-1 rounded-full bg-bg-sunken",
595
+ children: /* @__PURE__ */ p("div", {
596
+ className: "h-2 rounded-full bg-action-primary-bg",
597
+ style: { width: `${e.progress}%` }
598
+ })
599
+ }), /* @__PURE__ */ m("span", {
600
+ className: "text-xs font-medium tabular-nums text-text-secondary",
601
+ children: [e.progress, "%"]
602
+ })]
576
603
  })
577
- ]
578
- })
579
- ]
580
- })]
581
- }, t.id))
582
- }),
583
- Y.length === 0 && (Me.crops ? /* @__PURE__ */ v("div", {
604
+ }),
605
+ /* @__PURE__ */ m("div", {
606
+ className: "mt-3 flex items-center justify-between",
607
+ children: [/* @__PURE__ */ m("div", {
608
+ className: "flex items-center gap-2",
609
+ children: [/* @__PURE__ */ p(h, {
610
+ variant: Ve(e.healthStatus),
611
+ children: e.healthStatus
612
+ }), typeof e.healthScore == "number" ? /* @__PURE__ */ p(h, {
613
+ variant: "secondary",
614
+ title: q("healthybowl.crops.list.card.healthScoreTitle", "Satellite (NDVI) health score"),
615
+ children: q("healthybowl.crops.list.card.healthScore", "{{score}}/100 · {{source}}", {
616
+ score: e.healthScore,
617
+ source: e.healthScoreSource ?? "NDVI"
618
+ })
619
+ }) : /* @__PURE__ */ p("span", {
620
+ className: "text-xs text-text-secondary",
621
+ children: "—"
622
+ })]
623
+ }), /* @__PURE__ */ p("span", {
624
+ className: "text-xs tabular-nums text-text-secondary",
625
+ children: q("healthybowl.crops.list.card.daysToHarvest", "{{days}}d to harvest", { days: e.daysToHarvest })
626
+ })]
627
+ }),
628
+ /* @__PURE__ */ m("div", {
629
+ className: "mt-3 flex gap-2",
630
+ children: [
631
+ /* @__PURE__ */ m(g, {
632
+ variant: "outline",
633
+ size: "sm",
634
+ className: "flex-1",
635
+ onClick: () => W(G(`crops/${e.id}`)),
636
+ children: [
637
+ /* @__PURE__ */ p(s, { className: "h-3.5 w-3.5" }),
638
+ " ",
639
+ q("healthybowl.common.view", "View")
640
+ ]
641
+ }),
642
+ /* @__PURE__ */ m(g, {
643
+ variant: "outline",
644
+ size: "sm",
645
+ className: "flex-1",
646
+ onClick: () => ct(e),
647
+ children: [
648
+ /* @__PURE__ */ p(ge, { className: "h-3.5 w-3.5" }),
649
+ " ",
650
+ q("healthybowl.common.edit", "Edit")
651
+ ]
652
+ }),
653
+ /* @__PURE__ */ p(g, {
654
+ variant: "ghost",
655
+ size: "icon-sm",
656
+ onClick: () => st(e),
657
+ disabled: H,
658
+ "aria-label": q("healthybowl.common.delete", "Delete"),
659
+ className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
660
+ children: /* @__PURE__ */ p(d, { className: "h-3.5 w-3.5" })
661
+ })
662
+ ]
663
+ })
664
+ ]
665
+ })]
666
+ }, e.id))
667
+ })]
668
+ }, e.category === null ? "missing-category" : `category:${e.category}`)),
669
+ (I.loading || I.error || J.length === 0) && (I.loading ? /* @__PURE__ */ p("div", {
584
670
  className: "flex justify-center py-12",
585
- children: /* @__PURE__ */ v(A, {})
586
- }) : je.crops ? /* @__PURE__ */ v(ye, {
587
- icon: /* @__PURE__ */ v(ae, { className: "h-12 w-12 text-status-error-text" }),
588
- title: J("healthybowl.crops.list.errorState.title", "Couldn't load crops"),
589
- description: J("healthybowl.crops.list.errorState.message", "Something went wrong while loading your crops."),
590
- action: /* @__PURE__ */ v(x, {
671
+ children: /* @__PURE__ */ p(w, {})
672
+ }) : I.error ? /* @__PURE__ */ p(ke, {
673
+ icon: /* @__PURE__ */ p(me, { className: "h-12 w-12 text-status-error-text" }),
674
+ title: q("healthybowl.crops.list.errorState.title", "Couldn't load crops"),
675
+ description: q("healthybowl.crops.list.errorState.message", "Something went wrong while loading your crops."),
676
+ action: /* @__PURE__ */ p(g, {
591
677
  variant: "outline",
592
- onClick: Ie,
593
- children: J("healthybowl.crops.list.errorState.retry", "Retry")
678
+ onClick: () => void I.refetch().catch(() => void 0),
679
+ children: q("healthybowl.crops.list.errorState.retry", "Retry")
594
680
  })
595
- }) : /* @__PURE__ */ v(be, {
596
- illustration: F || I !== "all" || L !== "all" ? "empty-search" : "onboarding",
597
- title: J("healthybowl.crops.list.emptyState.title", "No crops found"),
598
- description: F || I !== "all" || L !== "all" ? J("healthybowl.crops.list.emptyState.filtered", "Try adjusting your filters") : J("healthybowl.crops.list.emptyState.message", "Get started by adding your first crop"),
599
- action: !F && I === "all" && L === "all" ? /* @__PURE__ */ y(x, {
600
- onClick: () => R(!0),
681
+ }) : /* @__PURE__ */ p(Ae, {
682
+ illustration: Y || X || I.total > 0 ? "empty-search" : "onboarding",
683
+ title: I.total > 0 ? "No crops shown on this page" : q("healthybowl.crops.list.emptyState.title", "No crops found"),
684
+ description: Y || X || I.total > 0 ? "Adjust your filters or browse another server page." : q("healthybowl.crops.list.emptyState.message", "Get started by adding your first crop"),
685
+ action: !Y && !X && I.total === 0 ? /* @__PURE__ */ m(g, {
686
+ onClick: () => L(!0),
601
687
  children: [
602
- /* @__PURE__ */ v(p, { className: "h-4 w-4" }),
688
+ /* @__PURE__ */ p(l, { className: "h-4 w-4" }),
603
689
  " ",
604
- J("healthybowl.crops.list.emptyState.addFirstCrop", "Add Your First Crop")
690
+ q("healthybowl.crops.list.emptyState.addFirstCrop", "Add Your First Crop")
605
691
  ]
606
692
  }) : void 0
607
693
  })),
608
- /* @__PURE__ */ v(Ce, {
609
- open: Ve,
694
+ (I.total > 0 || I.offset > 0) && !I.error && /* @__PURE__ */ p(Ne, {
695
+ page: Math.floor(I.offset / I.limit) + 1,
696
+ pageSize: I.limit,
697
+ totalItems: Q && I.offset < I.total ? I.total : void 0,
698
+ totalPages: Math.max(1, Math.ceil(I.total / I.limit)),
699
+ hasPreviousPage: I.offset > 0,
700
+ hasNextPage: I.hasMore,
701
+ loading: I.loading,
702
+ onPageChange: (e) => j(Math.max(0, (e - 1) * I.limit))
703
+ }),
704
+ /* @__PURE__ */ p(Pe, {
705
+ open: Ze,
610
706
  onOpenChange: (e) => {
611
- e || X();
707
+ e || at();
612
708
  },
613
- children: /* @__PURE__ */ y(we, {
709
+ children: /* @__PURE__ */ m(Fe, {
614
710
  className: "sm:max-w-2xl",
615
711
  children: [
616
- /* @__PURE__ */ y(De, { children: [/* @__PURE__ */ v(w, { children: V ? J("healthybowl.crops.list.modal.editTitle", "Edit {{name}}", { name: V.name }) : J("healthybowl.crops.list.modal.addTitle", "Add New Crop") }), /* @__PURE__ */ v(Te, { children: V ? J("healthybowl.crops.list.modal.editDescription", "Update the crop details.") : J("healthybowl.crops.list.modal.addDescription", "Fill in the details to register a new crop on your farm.") })] }),
617
- /* @__PURE__ */ y("div", {
712
+ /* @__PURE__ */ m(Re, { children: [/* @__PURE__ */ p(ze, { children: B ? q("healthybowl.crops.list.modal.editTitle", "Edit {{name}}", { name: B.name }) : q("healthybowl.crops.list.modal.addTitle", "Add New Crop") }), /* @__PURE__ */ p(Ie, { children: B ? q("healthybowl.crops.list.modal.editDescription", "Update the crop details.") : q("healthybowl.crops.list.modal.addDescription", "Fill in the details to register a new crop on your farm.") })] }),
713
+ /* @__PURE__ */ m("div", {
618
714
  className: "grid gap-4 sm:grid-cols-2",
619
715
  children: [
620
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
716
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
621
717
  className: "text-sm font-medium text-text-primary",
622
- children: J("healthybowl.crops.list.form.name.label", "Crop Name *")
623
- }), /* @__PURE__ */ v(C, {
718
+ children: q("healthybowl.crops.list.form.name.label", "Crop Name *")
719
+ }), /* @__PURE__ */ p(v, {
624
720
  type: "text",
625
- value: z.name,
721
+ value: R.name,
626
722
  onChange: (e) => $("name", e.target.value),
627
- placeholder: J("healthybowl.crops.list.form.name.placeholder", "e.g., Tomatoes"),
723
+ placeholder: q("healthybowl.crops.list.form.name.placeholder", "e.g., Tomatoes"),
628
724
  className: "mt-1"
629
725
  })] }),
630
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
726
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
631
727
  className: "text-sm font-medium text-text-primary",
632
- children: J("healthybowl.crops.list.form.variety.label", "Variety *")
633
- }), /* @__PURE__ */ v(C, {
728
+ children: q("healthybowl.crops.list.form.variety.label", "Variety *")
729
+ }), /* @__PURE__ */ p(v, {
634
730
  type: "text",
635
- value: z.variety,
731
+ value: R.variety,
636
732
  onChange: (e) => $("variety", e.target.value),
637
- placeholder: J("healthybowl.crops.list.form.variety.placeholder", "e.g., Roma"),
733
+ placeholder: q("healthybowl.crops.list.form.variety.placeholder", "e.g., Roma"),
638
734
  className: "mt-1"
639
735
  })] }),
640
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
641
- className: "text-sm font-medium text-text-primary",
642
- children: J("healthybowl.crops.list.form.category.label", "Category")
643
- }), /* @__PURE__ */ y(T, {
644
- value: z.category,
645
- onValueChange: (e) => $("category", e),
646
- children: [/* @__PURE__ */ v(O, {
736
+ /* @__PURE__ */ m("div", { children: [
737
+ /* @__PURE__ */ p("label", {
738
+ htmlFor: "crop-form-category",
739
+ className: "text-sm font-medium text-text-primary",
740
+ children: q("healthybowl.crops.list.form.category.label", "Category")
741
+ }),
742
+ /* @__PURE__ */ p(v, {
743
+ id: "crop-form-category",
744
+ type: "text",
745
+ value: R.category,
746
+ onChange: (e) => $("category", e.target.value),
747
+ list: "crop-form-category-suggestions",
647
748
  className: "mt-1",
648
- children: /* @__PURE__ */ v(k, {})
649
- }), /* @__PURE__ */ y(E, { children: [
650
- /* @__PURE__ */ v(D, {
651
- value: "Vegetables",
652
- children: J("healthybowl.crops.list.form.category.vegetables", "Vegetables")
653
- }),
654
- /* @__PURE__ */ v(D, {
655
- value: "Fruits",
656
- children: J("healthybowl.crops.list.form.category.fruits", "Fruits")
657
- }),
658
- /* @__PURE__ */ v(D, {
659
- value: "Herbs",
660
- children: J("healthybowl.crops.list.form.category.herbs", "Herbs")
661
- }),
662
- /* @__PURE__ */ v(D, {
663
- value: "Leafy Greens",
664
- children: J("healthybowl.crops.list.form.category.leafyGreens", "Leafy Greens")
665
- }),
666
- /* @__PURE__ */ v(D, {
667
- value: "Grains",
668
- children: J("healthybowl.crops.list.form.category.grains", "Grains")
669
- }),
670
- /* @__PURE__ */ v(D, {
671
- value: "Legumes",
672
- children: J("healthybowl.crops.list.form.category.legumes", "Legumes")
673
- })
674
- ] })]
675
- })] }),
676
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
749
+ placeholder: "Type any category"
750
+ }),
751
+ /* @__PURE__ */ p("datalist", {
752
+ id: "crop-form-category-suggestions",
753
+ children: [
754
+ "Vegetables",
755
+ "Fruits",
756
+ "Herbs",
757
+ "Leafy Greens",
758
+ "Grains",
759
+ "Legumes"
760
+ ].map((e) => /* @__PURE__ */ p("option", { value: e }, e))
761
+ }),
762
+ /* @__PURE__ */ p("p", {
763
+ className: "mt-1 text-xs text-text-secondary",
764
+ children: "Common labels are suggestions; custom categories remain editable."
765
+ })
766
+ ] }),
767
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
677
768
  className: "text-sm font-medium text-text-primary",
678
- children: J("healthybowl.crops.list.form.season.label", "Season")
679
- }), /* @__PURE__ */ y(T, {
680
- value: z.season,
769
+ children: q("healthybowl.crops.list.form.season.label", "Season")
770
+ }), /* @__PURE__ */ m(y, {
771
+ value: R.season,
681
772
  onValueChange: (e) => $("season", e),
682
- children: [/* @__PURE__ */ v(O, {
773
+ children: [/* @__PURE__ */ p(S, {
683
774
  className: "mt-1",
684
- children: /* @__PURE__ */ v(k, {})
685
- }), /* @__PURE__ */ y(E, { children: [
686
- /* @__PURE__ */ v(D, {
775
+ children: /* @__PURE__ */ p(C, {})
776
+ }), /* @__PURE__ */ m(b, { children: [
777
+ /* @__PURE__ */ p(x, {
687
778
  value: "kharif",
688
- children: J("healthybowl.crops.list.form.season.kharif", "Kharif (Summer)")
779
+ children: q("healthybowl.crops.list.form.season.kharif", "Kharif (Summer)")
689
780
  }),
690
- /* @__PURE__ */ v(D, {
781
+ /* @__PURE__ */ p(x, {
691
782
  value: "rabi",
692
- children: J("healthybowl.crops.list.form.season.rabi", "Rabi (Winter)")
783
+ children: q("healthybowl.crops.list.form.season.rabi", "Rabi (Winter)")
693
784
  }),
694
- /* @__PURE__ */ v(D, {
785
+ /* @__PURE__ */ p(x, {
695
786
  value: "zaid",
696
- children: J("healthybowl.crops.list.form.season.zaid", "Zaid (Spring)")
787
+ children: q("healthybowl.crops.list.form.season.zaid", "Zaid (Spring)")
697
788
  }),
698
- /* @__PURE__ */ v(D, {
789
+ /* @__PURE__ */ p(x, {
699
790
  value: "perennial",
700
- children: J("healthybowl.crops.list.form.season.perennial", "Perennial")
791
+ children: q("healthybowl.crops.list.form.season.perennial", "Perennial")
701
792
  })
702
793
  ] })]
703
794
  })] }),
704
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
795
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
705
796
  className: "text-sm font-medium text-text-primary",
706
- children: J("healthybowl.crops.list.form.field.label", "Field *")
707
- }), /* @__PURE__ */ y(T, {
708
- value: z.field,
797
+ children: q("healthybowl.crops.list.form.field.label", "Field *")
798
+ }), /* @__PURE__ */ m(y, {
799
+ value: R.field,
709
800
  onValueChange: (e) => $("field", e),
710
- children: [/* @__PURE__ */ v(O, {
801
+ children: [/* @__PURE__ */ p(S, {
711
802
  className: "mt-1",
712
- children: /* @__PURE__ */ v(k, { placeholder: J("healthybowl.crops.list.form.field.placeholder", "Select a field") })
713
- }), /* @__PURE__ */ v(E, { children: N.map((e) => /* @__PURE__ */ y(D, {
803
+ children: /* @__PURE__ */ p(C, { placeholder: q("healthybowl.crops.list.form.field.placeholder", "Select a field") })
804
+ }), /* @__PURE__ */ p(b, { children: e.map((e) => /* @__PURE__ */ m(x, {
714
805
  value: e.id,
715
806
  children: [
716
807
  e.name,
@@ -722,70 +813,70 @@ var ke = (e) => {
722
813
  ]
723
814
  }, e.id)) })]
724
815
  })] }),
725
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
816
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
726
817
  className: "text-sm font-medium text-text-primary",
727
- children: J("healthybowl.crops.list.form.yieldEstimate.label", "Yield Estimate (kg)")
728
- }), /* @__PURE__ */ v(C, {
818
+ children: q("healthybowl.crops.list.form.yieldEstimate.label", "Yield Estimate (kg)")
819
+ }), /* @__PURE__ */ p(v, {
729
820
  type: "number",
730
821
  min: 0,
731
- value: z.yieldEstimate || "",
822
+ value: R.yieldEstimate || "",
732
823
  onChange: (e) => $("yieldEstimate", Number(e.target.value)),
733
- placeholder: J("healthybowl.crops.list.form.yieldEstimate.placeholder", "e.g., 2500"),
824
+ placeholder: q("healthybowl.crops.list.form.yieldEstimate.placeholder", "e.g., 2500"),
734
825
  className: "mt-1 tabular-nums"
735
826
  })] }),
736
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
827
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
737
828
  className: "text-sm font-medium text-text-primary",
738
- children: J("healthybowl.crops.list.form.plantingDate.label", "Planting Date")
739
- }), /* @__PURE__ */ v(C, {
829
+ children: q("healthybowl.crops.list.form.plantingDate.label", "Planting Date")
830
+ }), /* @__PURE__ */ p(v, {
740
831
  type: "date",
741
- value: z.plantingDate,
832
+ value: R.plantingDate,
742
833
  onChange: (e) => $("plantingDate", e.target.value),
743
834
  className: "mt-1 tabular-nums"
744
835
  })] }),
745
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
836
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
746
837
  className: "text-sm font-medium text-text-primary",
747
- children: J("healthybowl.crops.list.form.expectedHarvestDate.label", "Expected Harvest Date")
748
- }), /* @__PURE__ */ v(C, {
838
+ children: q("healthybowl.crops.list.form.expectedHarvestDate.label", "Expected Harvest Date")
839
+ }), /* @__PURE__ */ p(v, {
749
840
  type: "date",
750
- value: z.expectedHarvestDate,
841
+ value: R.expectedHarvestDate,
751
842
  onChange: (e) => $("expectedHarvestDate", e.target.value),
752
843
  className: "mt-1 tabular-nums"
753
844
  })] }),
754
- /* @__PURE__ */ y("div", {
845
+ /* @__PURE__ */ m("div", {
755
846
  className: "sm:col-span-2",
756
- children: [/* @__PURE__ */ v("label", {
847
+ children: [/* @__PURE__ */ p("label", {
757
848
  className: "text-sm font-medium text-text-primary",
758
- children: J("healthybowl.crops.list.form.photos.label", "Photos")
759
- }), /* @__PURE__ */ v("div", {
849
+ children: q("healthybowl.crops.list.form.photos.label", "Photos")
850
+ }), /* @__PURE__ */ p("div", {
760
851
  className: "mt-1",
761
- children: /* @__PURE__ */ v(te, {
852
+ children: /* @__PURE__ */ p(ae, {
762
853
  entity: "Crop",
763
- imageIds: z.imageIds,
854
+ imageIds: R.imageIds,
764
855
  onChange: (e) => $("imageIds", e)
765
856
  })
766
857
  })]
767
858
  })
768
859
  ]
769
860
  }),
770
- /* @__PURE__ */ y(Ee, { children: [/* @__PURE__ */ v(x, {
861
+ /* @__PURE__ */ m(Le, { children: [/* @__PURE__ */ p(g, {
771
862
  variant: "outline",
772
- onClick: X,
773
- children: J("healthybowl.common.cancel", "Cancel")
774
- }), /* @__PURE__ */ y(x, {
775
- onClick: qe,
776
- disabled: U,
777
- children: [U ? /* @__PURE__ */ v(A, { size: "sm" }) : null, U ? J("healthybowl.crops.list.modal.saving", "Saving...") : V ? J("healthybowl.crops.list.modal.saveChanges", "Save Changes") : J("healthybowl.crops.list.modal.addCrop", "Add Crop")]
863
+ onClick: at,
864
+ children: q("healthybowl.common.cancel", "Cancel")
865
+ }), /* @__PURE__ */ m(g, {
866
+ onClick: ot,
867
+ disabled: H,
868
+ children: [H ? /* @__PURE__ */ p(w, { size: "sm" }) : null, H ? q("healthybowl.crops.list.modal.saving", "Saving...") : B ? q("healthybowl.crops.list.modal.saveChanges", "Save Changes") : q("healthybowl.crops.list.modal.addCrop", "Add Crop")]
778
869
  })] })
779
870
  ]
780
871
  })
781
872
  }),
782
- /* @__PURE__ */ v(r, {
783
- toasts: He,
784
- onDismiss: Ue
873
+ /* @__PURE__ */ p(re, {
874
+ toasts: Qe,
875
+ onDismiss: $e
785
876
  })
786
877
  ] });
787
878
  };
788
879
  //#endregion
789
- export { M as CropsPage };
880
+ export { E as CropsPage };
790
881
 
791
882
  //# sourceMappingURL=CropsPage.js.map