@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
45
|
-
let {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
}, qe =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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 (
|
|
64
|
-
|
|
87
|
+
if (B) {
|
|
88
|
+
U(!0);
|
|
65
89
|
try {
|
|
66
|
-
await
|
|
67
|
-
id:
|
|
68
|
-
name:
|
|
69
|
-
variety:
|
|
70
|
-
category:
|
|
71
|
-
season:
|
|
72
|
-
plantingDate:
|
|
73
|
-
expectedHarvestDate:
|
|
74
|
-
fieldId:
|
|
75
|
-
yieldEstimate:
|
|
76
|
-
imageIds:
|
|
77
|
-
}),
|
|
78
|
-
title:
|
|
79
|
-
description:
|
|
80
|
-
name:
|
|
81
|
-
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
|
-
}),
|
|
108
|
+
}), L(!1), z(T), V(null);
|
|
85
109
|
} catch (e) {
|
|
86
|
-
|
|
87
|
-
title:
|
|
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
|
-
|
|
116
|
+
U(!1);
|
|
93
117
|
}
|
|
94
118
|
return;
|
|
95
119
|
}
|
|
96
|
-
let
|
|
97
|
-
if (!
|
|
98
|
-
|
|
99
|
-
title:
|
|
100
|
-
description:
|
|
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
|
-
|
|
129
|
+
U(!0);
|
|
106
130
|
try {
|
|
107
|
-
await
|
|
108
|
-
name:
|
|
109
|
-
variety:
|
|
110
|
-
category:
|
|
111
|
-
season:
|
|
112
|
-
plantingDate:
|
|
113
|
-
expectedHarvestDate:
|
|
114
|
-
fieldId:
|
|
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:
|
|
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:
|
|
124
|
-
}),
|
|
125
|
-
title:
|
|
126
|
-
description:
|
|
127
|
-
name:
|
|
128
|
-
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
|
-
}),
|
|
155
|
+
}), L(!1), z(T), V(null);
|
|
132
156
|
} catch (e) {
|
|
133
|
-
|
|
134
|
-
title:
|
|
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
|
-
|
|
163
|
+
U(!1);
|
|
140
164
|
}
|
|
141
|
-
},
|
|
142
|
-
if (await
|
|
143
|
-
title:
|
|
144
|
-
message:
|
|
145
|
-
okButtonTitle:
|
|
146
|
-
cancelButtonTitle:
|
|
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
|
-
|
|
172
|
+
U(!0);
|
|
149
173
|
try {
|
|
150
|
-
await
|
|
151
|
-
title:
|
|
152
|
-
description:
|
|
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() && (
|
|
178
|
+
}), i() && (de(q("healthybowl.crops.list.toast.deleted.title", "Crop deleted")), ue("success"));
|
|
155
179
|
} catch (e) {
|
|
156
|
-
|
|
157
|
-
title:
|
|
180
|
+
K({
|
|
181
|
+
title: q("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed"),
|
|
158
182
|
description: String(e),
|
|
159
183
|
variant: "error"
|
|
160
|
-
}), i() && (
|
|
184
|
+
}), i() && (de(q("healthybowl.crops.list.toast.deleteFailed.title", "Delete failed")), ue("error"));
|
|
161
185
|
} finally {
|
|
162
|
-
|
|
186
|
+
U(!1);
|
|
163
187
|
}
|
|
164
188
|
}
|
|
165
|
-
},
|
|
166
|
-
|
|
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
|
-
}),
|
|
177
|
-
}, $ = (e, t) =>
|
|
200
|
+
}), L(!0);
|
|
201
|
+
}, $ = (e, t) => z((n) => ({
|
|
178
202
|
...n,
|
|
179
203
|
[e]: t
|
|
180
204
|
}));
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
title:
|
|
184
|
-
description:
|
|
185
|
-
breadcrumb: [{ label:
|
|
186
|
-
actions: /* @__PURE__ */
|
|
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
|
-
|
|
212
|
+
V(null), z(T), L(!0);
|
|
189
213
|
},
|
|
190
214
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ p(l, { className: "h-4 w-4" }),
|
|
192
216
|
" ",
|
|
193
|
-
|
|
217
|
+
q("healthybowl.crops.list.actions.addCrop", "Add New Crop")
|
|
194
218
|
]
|
|
195
219
|
})] })
|
|
196
220
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
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__ */
|
|
225
|
+
/* @__PURE__ */ p("div", {
|
|
202
226
|
className: "flex flex-wrap gap-3",
|
|
203
227
|
children: [
|
|
204
228
|
{
|
|
205
229
|
key: "fields",
|
|
206
|
-
label:
|
|
207
|
-
icon:
|
|
208
|
-
path:
|
|
209
|
-
desc:
|
|
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:
|
|
214
|
-
icon:
|
|
215
|
-
path:
|
|
216
|
-
desc:
|
|
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:
|
|
221
|
-
icon:
|
|
222
|
-
path:
|
|
223
|
-
desc:
|
|
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__ */
|
|
249
|
+
].map((e) => /* @__PURE__ */ m("button", {
|
|
226
250
|
type: "button",
|
|
227
|
-
onClick: () =>
|
|
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__ */
|
|
231
|
-
/* @__PURE__ */
|
|
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__ */
|
|
258
|
+
}), /* @__PURE__ */ p("p", {
|
|
235
259
|
className: "text-xs text-text-secondary",
|
|
236
260
|
children: e.desc
|
|
237
261
|
})] }),
|
|
238
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ p(he, { className: "ms-2 h-4 w-4 text-text-secondary" })
|
|
239
263
|
]
|
|
240
264
|
}, e.key))
|
|
241
265
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
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__ */
|
|
269
|
+
/* @__PURE__ */ p(Oe, {
|
|
246
270
|
className: "p-4",
|
|
247
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ m("div", {
|
|
248
272
|
className: "flex items-center justify-between",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
250
274
|
className: "text-xs font-medium text-text-secondary",
|
|
251
|
-
children:
|
|
252
|
-
}), /* @__PURE__ */
|
|
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:
|
|
255
|
-
})] }), /* @__PURE__ */
|
|
278
|
+
children: Q ? I.total : "—"
|
|
279
|
+
})] }), /* @__PURE__ */ p(u, { className: "h-6 w-6 text-primary" })]
|
|
256
280
|
})
|
|
257
281
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ p("div", {
|
|
259
283
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
260
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ m("div", {
|
|
261
285
|
className: "flex items-center justify-between",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
263
287
|
className: "text-xs font-medium text-text-secondary",
|
|
264
|
-
children:
|
|
265
|
-
}), /* @__PURE__ */
|
|
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:
|
|
268
|
-
})] }), /* @__PURE__ */
|
|
291
|
+
children: e.length
|
|
292
|
+
})] }), /* @__PURE__ */ p(c, { className: "h-6 w-6 text-text-secondary" })]
|
|
269
293
|
})
|
|
270
294
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ p("div", {
|
|
272
296
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
273
|
-
children: /* @__PURE__ */
|
|
297
|
+
children: /* @__PURE__ */ m("div", {
|
|
274
298
|
className: "flex items-center justify-between",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
276
300
|
className: "text-xs font-medium text-text-secondary",
|
|
277
|
-
children:
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
-
className: "mt-1 text-2xl font-bold tabular-nums text-
|
|
280
|
-
children:
|
|
281
|
-
})] }), /* @__PURE__ */
|
|
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__ */
|
|
308
|
+
/* @__PURE__ */ p("div", {
|
|
285
309
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
286
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ m("div", {
|
|
287
311
|
className: "flex items-center justify-between",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
289
313
|
className: "text-xs font-medium text-text-secondary",
|
|
290
|
-
children:
|
|
291
|
-
}), /* @__PURE__ */
|
|
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:
|
|
294
|
-
})] }), /* @__PURE__ */
|
|
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__ */
|
|
300
|
-
className: "mt-4
|
|
301
|
-
children: [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
/* @__PURE__ */ y
|
|
315
|
-
value:
|
|
316
|
-
onValueChange: (e) =>
|
|
317
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
320
|
-
}), /* @__PURE__ */
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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__ */
|
|
349
|
-
}), /* @__PURE__ */
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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__ */
|
|
420
|
-
|
|
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__ */
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
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__ */
|
|
471
|
-
|
|
472
|
-
children:
|
|
473
|
-
|
|
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__ */
|
|
499
|
+
/* @__PURE__ */ p(s, { className: "h-3.5 w-3.5" }),
|
|
476
500
|
" ",
|
|
477
|
-
|
|
501
|
+
q("healthybowl.common.view", "View")
|
|
478
502
|
]
|
|
479
|
-
}),
|
|
480
|
-
|
|
481
|
-
|
|
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__ */
|
|
507
|
+
/* @__PURE__ */ p(ge, { className: "h-3.5 w-3.5" }),
|
|
490
508
|
" ",
|
|
491
|
-
|
|
509
|
+
q("healthybowl.common.edit", "Edit")
|
|
492
510
|
]
|
|
493
|
-
}),
|
|
494
|
-
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ m(_, {
|
|
513
|
+
onClick: () => st(e),
|
|
514
|
+
disabled: H,
|
|
515
|
+
className: "text-status-error-text",
|
|
495
516
|
children: [
|
|
496
|
-
|
|
517
|
+
/* @__PURE__ */ p(d, { className: "h-3.5 w-3.5" }),
|
|
497
518
|
" ",
|
|
498
|
-
|
|
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
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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__ */
|
|
525
|
-
variant:
|
|
526
|
-
children:
|
|
527
|
-
}),
|
|
530
|
+
children: [/* @__PURE__ */ p(h, {
|
|
531
|
+
variant: He(e.status ?? "unknown"),
|
|
532
|
+
children: e.growthStage
|
|
533
|
+
}), /* @__PURE__ */ p(h, {
|
|
528
534
|
variant: "secondary",
|
|
529
|
-
|
|
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
|
-
}),
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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__ */
|
|
586
|
-
}) :
|
|
587
|
-
icon: /* @__PURE__ */
|
|
588
|
-
title:
|
|
589
|
-
description:
|
|
590
|
-
action: /* @__PURE__ */
|
|
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:
|
|
593
|
-
children:
|
|
678
|
+
onClick: () => void I.refetch().catch(() => void 0),
|
|
679
|
+
children: q("healthybowl.crops.list.errorState.retry", "Retry")
|
|
594
680
|
})
|
|
595
|
-
}) : /* @__PURE__ */
|
|
596
|
-
illustration:
|
|
597
|
-
title:
|
|
598
|
-
description:
|
|
599
|
-
action: !
|
|
600
|
-
onClick: () =>
|
|
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__ */
|
|
688
|
+
/* @__PURE__ */ p(l, { className: "h-4 w-4" }),
|
|
603
689
|
" ",
|
|
604
|
-
|
|
690
|
+
q("healthybowl.crops.list.emptyState.addFirstCrop", "Add Your First Crop")
|
|
605
691
|
]
|
|
606
692
|
}) : void 0
|
|
607
693
|
})),
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
|
|
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 ||
|
|
707
|
+
e || at();
|
|
612
708
|
},
|
|
613
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ m(Fe, {
|
|
614
710
|
className: "sm:max-w-2xl",
|
|
615
711
|
children: [
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */
|
|
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__ */
|
|
716
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
621
717
|
className: "text-sm font-medium text-text-primary",
|
|
622
|
-
children:
|
|
623
|
-
}), /* @__PURE__ */ v
|
|
718
|
+
children: q("healthybowl.crops.list.form.name.label", "Crop Name *")
|
|
719
|
+
}), /* @__PURE__ */ p(v, {
|
|
624
720
|
type: "text",
|
|
625
|
-
value:
|
|
721
|
+
value: R.name,
|
|
626
722
|
onChange: (e) => $("name", e.target.value),
|
|
627
|
-
placeholder:
|
|
723
|
+
placeholder: q("healthybowl.crops.list.form.name.placeholder", "e.g., Tomatoes"),
|
|
628
724
|
className: "mt-1"
|
|
629
725
|
})] }),
|
|
630
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
631
727
|
className: "text-sm font-medium text-text-primary",
|
|
632
|
-
children:
|
|
633
|
-
}), /* @__PURE__ */ v
|
|
728
|
+
children: q("healthybowl.crops.list.form.variety.label", "Variety *")
|
|
729
|
+
}), /* @__PURE__ */ p(v, {
|
|
634
730
|
type: "text",
|
|
635
|
-
value:
|
|
731
|
+
value: R.variety,
|
|
636
732
|
onChange: (e) => $("variety", e.target.value),
|
|
637
|
-
placeholder:
|
|
733
|
+
placeholder: q("healthybowl.crops.list.form.variety.placeholder", "e.g., Roma"),
|
|
638
734
|
className: "mt-1"
|
|
639
735
|
})] }),
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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
|
-
|
|
649
|
-
}),
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
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:
|
|
679
|
-
}), /* @__PURE__ */ y
|
|
680
|
-
value:
|
|
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__ */
|
|
773
|
+
children: [/* @__PURE__ */ p(S, {
|
|
683
774
|
className: "mt-1",
|
|
684
|
-
children: /* @__PURE__ */
|
|
685
|
-
}), /* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
775
|
+
children: /* @__PURE__ */ p(C, {})
|
|
776
|
+
}), /* @__PURE__ */ m(b, { children: [
|
|
777
|
+
/* @__PURE__ */ p(x, {
|
|
687
778
|
value: "kharif",
|
|
688
|
-
children:
|
|
779
|
+
children: q("healthybowl.crops.list.form.season.kharif", "Kharif (Summer)")
|
|
689
780
|
}),
|
|
690
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ p(x, {
|
|
691
782
|
value: "rabi",
|
|
692
|
-
children:
|
|
783
|
+
children: q("healthybowl.crops.list.form.season.rabi", "Rabi (Winter)")
|
|
693
784
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ p(x, {
|
|
695
786
|
value: "zaid",
|
|
696
|
-
children:
|
|
787
|
+
children: q("healthybowl.crops.list.form.season.zaid", "Zaid (Spring)")
|
|
697
788
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ p(x, {
|
|
699
790
|
value: "perennial",
|
|
700
|
-
children:
|
|
791
|
+
children: q("healthybowl.crops.list.form.season.perennial", "Perennial")
|
|
701
792
|
})
|
|
702
793
|
] })]
|
|
703
794
|
})] }),
|
|
704
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
705
796
|
className: "text-sm font-medium text-text-primary",
|
|
706
|
-
children:
|
|
707
|
-
}), /* @__PURE__ */ y
|
|
708
|
-
value:
|
|
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__ */
|
|
801
|
+
children: [/* @__PURE__ */ p(S, {
|
|
711
802
|
className: "mt-1",
|
|
712
|
-
children: /* @__PURE__ */
|
|
713
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
816
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
726
817
|
className: "text-sm font-medium text-text-primary",
|
|
727
|
-
children:
|
|
728
|
-
}), /* @__PURE__ */ v
|
|
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:
|
|
822
|
+
value: R.yieldEstimate || "",
|
|
732
823
|
onChange: (e) => $("yieldEstimate", Number(e.target.value)),
|
|
733
|
-
placeholder:
|
|
824
|
+
placeholder: q("healthybowl.crops.list.form.yieldEstimate.placeholder", "e.g., 2500"),
|
|
734
825
|
className: "mt-1 tabular-nums"
|
|
735
826
|
})] }),
|
|
736
|
-
/* @__PURE__ */
|
|
827
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
737
828
|
className: "text-sm font-medium text-text-primary",
|
|
738
|
-
children:
|
|
739
|
-
}), /* @__PURE__ */ v
|
|
829
|
+
children: q("healthybowl.crops.list.form.plantingDate.label", "Planting Date")
|
|
830
|
+
}), /* @__PURE__ */ p(v, {
|
|
740
831
|
type: "date",
|
|
741
|
-
value:
|
|
832
|
+
value: R.plantingDate,
|
|
742
833
|
onChange: (e) => $("plantingDate", e.target.value),
|
|
743
834
|
className: "mt-1 tabular-nums"
|
|
744
835
|
})] }),
|
|
745
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
746
837
|
className: "text-sm font-medium text-text-primary",
|
|
747
|
-
children:
|
|
748
|
-
}), /* @__PURE__ */ v
|
|
838
|
+
children: q("healthybowl.crops.list.form.expectedHarvestDate.label", "Expected Harvest Date")
|
|
839
|
+
}), /* @__PURE__ */ p(v, {
|
|
749
840
|
type: "date",
|
|
750
|
-
value:
|
|
841
|
+
value: R.expectedHarvestDate,
|
|
751
842
|
onChange: (e) => $("expectedHarvestDate", e.target.value),
|
|
752
843
|
className: "mt-1 tabular-nums"
|
|
753
844
|
})] }),
|
|
754
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ m("div", {
|
|
755
846
|
className: "sm:col-span-2",
|
|
756
|
-
children: [/* @__PURE__ */
|
|
847
|
+
children: [/* @__PURE__ */ p("label", {
|
|
757
848
|
className: "text-sm font-medium text-text-primary",
|
|
758
|
-
children:
|
|
759
|
-
}), /* @__PURE__ */
|
|
849
|
+
children: q("healthybowl.crops.list.form.photos.label", "Photos")
|
|
850
|
+
}), /* @__PURE__ */ p("div", {
|
|
760
851
|
className: "mt-1",
|
|
761
|
-
children: /* @__PURE__ */
|
|
852
|
+
children: /* @__PURE__ */ p(ae, {
|
|
762
853
|
entity: "Crop",
|
|
763
|
-
imageIds:
|
|
854
|
+
imageIds: R.imageIds,
|
|
764
855
|
onChange: (e) => $("imageIds", e)
|
|
765
856
|
})
|
|
766
857
|
})]
|
|
767
858
|
})
|
|
768
859
|
]
|
|
769
860
|
}),
|
|
770
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ m(Le, { children: [/* @__PURE__ */ p(g, {
|
|
771
862
|
variant: "outline",
|
|
772
|
-
onClick:
|
|
773
|
-
children:
|
|
774
|
-
}), /* @__PURE__ */
|
|
775
|
-
onClick:
|
|
776
|
-
disabled:
|
|
777
|
-
children: [
|
|
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__ */
|
|
783
|
-
toasts:
|
|
784
|
-
onDismiss:
|
|
873
|
+
/* @__PURE__ */ p(re, {
|
|
874
|
+
toasts: Qe,
|
|
875
|
+
onDismiss: $e
|
|
785
876
|
})
|
|
786
877
|
] });
|
|
787
878
|
};
|
|
788
879
|
//#endregion
|
|
789
|
-
export {
|
|
880
|
+
export { E as CropsPage };
|
|
790
881
|
|
|
791
882
|
//# sourceMappingURL=CropsPage.js.map
|