@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,41 +1,41 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/helpers.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { StatCard as n } from "../../components/StatCard.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useConfirm as
|
|
8
|
-
import { PageLoader as
|
|
9
|
-
import { useToast as
|
|
4
|
+
import { FilterBar as r } from "../../components/FilterBar.js";
|
|
5
|
+
import { ErrorState as i } from "../../components/ErrorState.js";
|
|
6
|
+
import { ChartCard as a } from "../../components/ChartCard.js";
|
|
7
|
+
import { useConfirm as ee } from "../../components/ConfirmDialog.js";
|
|
8
|
+
import { PageLoader as te } from "../../components/PageLoader.js";
|
|
9
|
+
import { useToast as ne } from "../../hooks/useToast.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
|
-
import { Legend as
|
|
12
|
-
import { Tooltip as
|
|
13
|
-
import { ResponsiveContainer as
|
|
14
|
-
import { CartesianGrid as
|
|
15
|
-
import { Line as
|
|
16
|
-
import { XAxis as
|
|
17
|
-
import { YAxis as
|
|
18
|
-
import { LineChart as
|
|
19
|
-
import { buildMandiFilter as
|
|
20
|
-
import { useHealthyBowlMandiPriceTrend as
|
|
21
|
-
import { PriceAlertRuleModal as
|
|
22
|
-
import { AddWatchModal as
|
|
23
|
-
import { useCallback as
|
|
24
|
-
import { useI18n as
|
|
25
|
-
import { AlertTriangle as
|
|
26
|
-
import { Fragment as
|
|
27
|
-
import { Badge as
|
|
11
|
+
import { Legend as re } from "../../../node_modules/recharts/es6/component/Legend.js";
|
|
12
|
+
import { Tooltip as ie } from "../../../node_modules/recharts/es6/component/Tooltip.js";
|
|
13
|
+
import { ResponsiveContainer as ae } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
14
|
+
import { CartesianGrid as oe } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
15
|
+
import { Line as o } from "../../../node_modules/recharts/es6/cartesian/Line.js";
|
|
16
|
+
import { XAxis as se } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
17
|
+
import { YAxis as ce } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
18
|
+
import { LineChart as le } from "../../../node_modules/recharts/es6/chart/LineChart.js";
|
|
19
|
+
import { buildMandiFilter as ue, buildTrendRows as de, changeToneClass as s, comparatorSymbol as fe, districtsReporting as pe, formatQty as me, formatRupee as c, latestPriceDateOf as he, severityBadgeVariant as ge, severityBarClass as _e, sourceFreshnessLabel as l, statesReporting as ve } from "../../utils/mandiPrices.js";
|
|
20
|
+
import { useHealthyBowlMandiPriceTrend as ye, useHealthyBowlMandiPrices as be } from "../../hooks/useHealthyBowlMandiPrices.js";
|
|
21
|
+
import { PriceAlertRuleModal as xe } from "./market-prices/PriceAlertRuleModal.js";
|
|
22
|
+
import { AddWatchModal as Se } from "./market-prices/AddWatchModal.js";
|
|
23
|
+
import { useCallback as Ce, useMemo as u, useState as d } from "react";
|
|
24
|
+
import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
25
|
+
import { AlertTriangle as Te, BellPlus as f, Check as Ee, LineChart as p, Minus as m, Pencil as De, Plus as h, Sprout as Oe, Star as g, Store as _, Trash2 as v, TrendingDown as ke, TrendingUp as y } from "lucide-react";
|
|
26
|
+
import { Fragment as Ae, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
27
|
+
import { Badge as je, Button as S, Select as C, SelectContent as Me, SelectItem as w, SelectTrigger as Ne, SelectValue as Pe, Switch as Fe } from "@burdenoff/fe-libs/ui";
|
|
28
28
|
//#region src/healthybowl/pages/market/MarketPricesPage.tsx
|
|
29
|
-
var
|
|
29
|
+
var Ie = {
|
|
30
30
|
backgroundColor: "var(--color-card)",
|
|
31
31
|
border: "1px solid var(--color-border)",
|
|
32
32
|
borderRadius: "8px"
|
|
33
|
-
},
|
|
33
|
+
}, T = [
|
|
34
34
|
"var(--color-primary)",
|
|
35
35
|
"var(--color-info)",
|
|
36
36
|
"var(--color-warning)"
|
|
37
37
|
];
|
|
38
|
-
function
|
|
38
|
+
function Le(e) {
|
|
39
39
|
let t = Date.parse(e);
|
|
40
40
|
if (!Number.isFinite(t)) return "";
|
|
41
41
|
let n = Date.now() - t, r = Math.round(n / 6e4);
|
|
@@ -44,79 +44,79 @@ function Re(e) {
|
|
|
44
44
|
let i = Math.round(r / 60);
|
|
45
45
|
return i < 24 ? `${i}h ago` : `${Math.round(i / 24)}d ago`;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
if (t.changeDir == null || t.changePct == null) return /* @__PURE__ */
|
|
47
|
+
function Re({ row: t }) {
|
|
48
|
+
if (t.changeDir == null || t.changePct == null) return /* @__PURE__ */ b("span", {
|
|
49
49
|
className: "text-xs text-text-secondary",
|
|
50
50
|
children: "—"
|
|
51
51
|
});
|
|
52
|
-
let n = t.changeDir === "up" ?
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
className: e("inline-flex items-center gap-1 text-xs font-medium tabular-nums",
|
|
52
|
+
let n = t.changeDir === "up" ? y : t.changeDir === "down" ? ke : m, r = t.changePct > 0 ? "+" : "";
|
|
53
|
+
return /* @__PURE__ */ x("span", {
|
|
54
|
+
className: e("inline-flex items-center gap-1 text-xs font-medium tabular-nums", s(t.changeDir)),
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ b(n, { className: "h-3.5 w-3.5" }),
|
|
57
57
|
r,
|
|
58
58
|
t.changePct.toFixed(1),
|
|
59
59
|
"%"
|
|
60
60
|
]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
var
|
|
64
|
-
function
|
|
65
|
-
let { t:
|
|
66
|
-
state:
|
|
67
|
-
district:
|
|
68
|
-
from:
|
|
69
|
-
to:
|
|
63
|
+
var E = "__all__";
|
|
64
|
+
function D() {
|
|
65
|
+
let { t: s } = we(), { toast: m } = ne(), ke = ee(), [y, D] = d(""), [k, A] = d(""), [j, M] = d(""), [N, ze] = d(""), { commodities: P, prices: F, facetPrices: I, watches: L, alertRules: R, alerts: z, loading: B, error: Be, refetchAll: Ve, createWatch: He, deleteWatch: Ue, createRule: We, updateRule: V, deleteRule: Ge, acknowledgeAlert: Ke } = be({ filter: u(() => ue({
|
|
66
|
+
state: y,
|
|
67
|
+
district: k,
|
|
68
|
+
from: j,
|
|
69
|
+
to: N
|
|
70
70
|
}), [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]) }), [
|
|
76
|
-
|
|
77
|
-
}, []),
|
|
78
|
-
|
|
79
|
-
}, []),
|
|
80
|
-
let e =
|
|
81
|
-
return e ?
|
|
82
|
-
}, [
|
|
83
|
-
commodity:
|
|
84
|
-
marketName:
|
|
71
|
+
y,
|
|
72
|
+
k,
|
|
73
|
+
j,
|
|
74
|
+
N
|
|
75
|
+
]) }), [H, qe] = d(""), [U, Je] = d(null), [Ye, W] = d(!1), [Xe, Ze] = d(void 0), [Qe, G] = d(!1), [$e, et] = d(null), K = u(() => [...new Set(I.map((e) => e.commodity).filter(Boolean))].sort((e, t) => e.localeCompare(t)), [I]), q = u(() => [...new Set(I.map((e) => e.marketName).filter(Boolean))], [I]), tt = u(() => ve(I), [I]), nt = u(() => pe(I, y || null), [I, y]), rt = Ce((e) => {
|
|
76
|
+
D(e), A("");
|
|
77
|
+
}, []), it = !!(y || k || j || N), at = Ce(() => {
|
|
78
|
+
D(""), A(""), M(""), ze("");
|
|
79
|
+
}, []), J = u(() => he(F), [F]), ot = u(() => l(J, F[0]?.source ?? null), [J, F]), st = u(() => {
|
|
80
|
+
let e = H.trim().toLowerCase();
|
|
81
|
+
return e ? P.filter((t) => t.commodity.toLowerCase().includes(e) || (t.representativeMarket ?? "").toLowerCase().includes(e)) : P;
|
|
82
|
+
}, [P, H]), Y = ye({
|
|
83
|
+
commodity: U?.commodity,
|
|
84
|
+
marketName: U?.representativeMarket ?? null,
|
|
85
85
|
days: 30,
|
|
86
|
-
skip: !
|
|
87
|
-
}), X =
|
|
88
|
-
|
|
86
|
+
skip: !U
|
|
87
|
+
}), X = u(() => de(Y.points), [Y.points]), ct = (e) => P.find((t) => t.commodity.toLowerCase() === e.commodity.toLowerCase()), Z = (e) => {
|
|
88
|
+
Ze(e), W(!0);
|
|
89
89
|
}, Q = (e) => {
|
|
90
|
-
|
|
91
|
-
}, lt = (e) =>
|
|
92
|
-
await
|
|
93
|
-
title:
|
|
90
|
+
et(e ?? null), G(!0);
|
|
91
|
+
}, lt = (e) => Je((t) => t?.commodity === e.commodity ? null : e), ut = async (e) => {
|
|
92
|
+
await He(e), m({
|
|
93
|
+
title: s("healthybowl.mandi.toast.watched", "Added to watchlist"),
|
|
94
94
|
variant: "success"
|
|
95
95
|
});
|
|
96
96
|
}, dt = async (e) => {
|
|
97
97
|
try {
|
|
98
|
-
await
|
|
99
|
-
title:
|
|
98
|
+
await Ue(e.id), m({
|
|
99
|
+
title: s("healthybowl.mandi.toast.unwatched", "Removed from watchlist"),
|
|
100
100
|
variant: "success"
|
|
101
101
|
});
|
|
102
102
|
} catch (e) {
|
|
103
|
-
|
|
104
|
-
title:
|
|
103
|
+
m({
|
|
104
|
+
title: s("healthybowl.common.error", "Something went wrong"),
|
|
105
105
|
description: e instanceof Error ? e.message : void 0,
|
|
106
106
|
variant: "error"
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
}, ft = async (e, t) => {
|
|
110
|
-
t ? (await
|
|
111
|
-
title:
|
|
110
|
+
t ? (await V(e), m({
|
|
111
|
+
title: s("healthybowl.mandi.toast.ruleUpdated", "Alert updated"),
|
|
112
112
|
variant: "success"
|
|
113
|
-
})) : (await
|
|
114
|
-
title:
|
|
113
|
+
})) : (await We(e), m({
|
|
114
|
+
title: s("healthybowl.mandi.toast.ruleCreated", "Alert created"),
|
|
115
115
|
variant: "success"
|
|
116
116
|
}));
|
|
117
117
|
}, pt = async (e) => {
|
|
118
118
|
try {
|
|
119
|
-
await
|
|
119
|
+
await V({
|
|
120
120
|
id: e.id,
|
|
121
121
|
commodity: e.commodity,
|
|
122
122
|
marketName: e.marketName,
|
|
@@ -125,291 +125,291 @@ function E() {
|
|
|
125
125
|
enabled: !e.enabled
|
|
126
126
|
});
|
|
127
127
|
} catch (e) {
|
|
128
|
-
|
|
129
|
-
title:
|
|
128
|
+
m({
|
|
129
|
+
title: s("healthybowl.common.error", "Something went wrong"),
|
|
130
130
|
description: e instanceof Error ? e.message : void 0,
|
|
131
131
|
variant: "error"
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}, mt = async (e) => {
|
|
135
|
-
if (await
|
|
136
|
-
title:
|
|
137
|
-
message:
|
|
138
|
-
okButtonTitle:
|
|
135
|
+
if (await ke({
|
|
136
|
+
title: s("healthybowl.mandi.rule.deleteTitle", "Delete price alert?"),
|
|
137
|
+
message: s("healthybowl.mandi.rule.deleteBody", "You will stop getting alerts for {{c}}.", { c: e.commodity }),
|
|
138
|
+
okButtonTitle: s("healthybowl.common.remove", "Remove"),
|
|
139
139
|
destructive: !0
|
|
140
140
|
})) try {
|
|
141
|
-
await
|
|
142
|
-
title:
|
|
141
|
+
await Ge(e.id), m({
|
|
142
|
+
title: s("healthybowl.mandi.toast.ruleRemoved", "Alert removed"),
|
|
143
143
|
variant: "success"
|
|
144
144
|
});
|
|
145
145
|
} catch (e) {
|
|
146
|
-
|
|
147
|
-
title:
|
|
146
|
+
m({
|
|
147
|
+
title: s("healthybowl.common.error", "Something went wrong"),
|
|
148
148
|
description: e instanceof Error ? e.message : void 0,
|
|
149
149
|
variant: "error"
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
}, $ =
|
|
152
|
+
}, $ = u(() => z.filter((e) => e.status === "ACTIVE"), [z]), ht = async (e) => {
|
|
153
153
|
try {
|
|
154
|
-
await
|
|
155
|
-
title:
|
|
154
|
+
await Ke(e.id), m({
|
|
155
|
+
title: s("healthybowl.mandi.toast.alertAcknowledged", "Alert acknowledged"),
|
|
156
156
|
variant: "success"
|
|
157
157
|
});
|
|
158
158
|
} catch (e) {
|
|
159
|
-
|
|
160
|
-
title:
|
|
159
|
+
m({
|
|
160
|
+
title: s("healthybowl.common.error", "Something went wrong"),
|
|
161
161
|
description: e instanceof Error ? e.message : void 0,
|
|
162
162
|
variant: "error"
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
}, gt =
|
|
165
|
+
}, gt = u(() => new Set(F.map((e) => e.marketName).filter(Boolean)).size, [F]), _t = $.length, vt = /* @__PURE__ */ x("div", {
|
|
166
166
|
className: "flex items-center gap-2",
|
|
167
167
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ x("span", {
|
|
169
169
|
className: "hidden items-center gap-1.5 rounded-full border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-secondary sm:inline-flex",
|
|
170
|
-
title:
|
|
171
|
-
children: [/* @__PURE__ */
|
|
170
|
+
title: s("healthybowl.mandi.sourceTitle", "Agmarknet — Directorate of Marketing & Inspection, Govt. of India"),
|
|
171
|
+
children: [/* @__PURE__ */ b("span", { className: "h-2 w-2 rounded-full bg-success" }), ot]
|
|
172
172
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ x(S, {
|
|
174
174
|
variant: "outline",
|
|
175
175
|
size: "sm",
|
|
176
176
|
onClick: () => Z(),
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ b(g, { className: "h-3.5 w-3.5" }), s("healthybowl.mandi.watchCta", "Watch")]
|
|
178
178
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ x(S, {
|
|
180
180
|
size: "sm",
|
|
181
181
|
onClick: () => Q(),
|
|
182
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ b(f, { className: "h-3.5 w-3.5" }), s("healthybowl.mandi.newAlert", "New alert")]
|
|
183
183
|
})
|
|
184
184
|
]
|
|
185
|
-
}), yt = /* @__PURE__ */
|
|
186
|
-
open:
|
|
187
|
-
onClose: () => U(!1),
|
|
188
|
-
commodities: G,
|
|
189
|
-
markets: K,
|
|
190
|
-
initialCommodity: Ze,
|
|
191
|
-
onSubmit: ut
|
|
192
|
-
}), /* @__PURE__ */ v(Se, {
|
|
193
|
-
open: $e,
|
|
185
|
+
}), yt = /* @__PURE__ */ x(Ae, { children: [/* @__PURE__ */ b(Se, {
|
|
186
|
+
open: Ye,
|
|
194
187
|
onClose: () => W(!1),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
188
|
+
commodities: K,
|
|
189
|
+
markets: q,
|
|
190
|
+
initialCommodity: Xe,
|
|
191
|
+
onSubmit: ut
|
|
192
|
+
}), /* @__PURE__ */ b(xe, {
|
|
193
|
+
open: Qe,
|
|
194
|
+
onClose: () => G(!1),
|
|
195
|
+
editing: $e,
|
|
196
|
+
commodities: K,
|
|
197
|
+
markets: q,
|
|
198
198
|
onSubmit: ft
|
|
199
|
-
})] }), bt = !
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
title:
|
|
202
|
-
description:
|
|
199
|
+
})] }), bt = !B && I.length === 0 && L.length === 0 && R.length === 0 && z.length === 0;
|
|
200
|
+
return /* @__PURE__ */ b(t, {
|
|
201
|
+
title: s("healthybowl.mandi.title", "Market Prices"),
|
|
202
|
+
description: s("healthybowl.mandi.subtitle", "Mandi price intelligence"),
|
|
203
203
|
purpose: "See the latest mandi (wholesale market) prices for your crops — the modal rate, the day's low–high band and how it moved since yesterday — so you can decide when and where to sell. Pin the commodities you care about to your watchlist and set price alerts that ping you when a crop crosses your target rate. Prices come from Agmarknet (Govt. of India); the badge above shows the date of the latest available prices.",
|
|
204
204
|
actions: vt,
|
|
205
|
-
children:
|
|
205
|
+
children: B && P.length === 0 ? /* @__PURE__ */ b(te, {}) : Be && P.length === 0 ? /* @__PURE__ */ b(i, { onRetry: Ve }) : bt ? /* @__PURE__ */ x("div", {
|
|
206
206
|
className: "mx-auto max-w-xl py-10 text-center",
|
|
207
207
|
"data-testid": "mandi-empty-state",
|
|
208
208
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ b("div", {
|
|
210
210
|
className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-[var(--color-accent-soft)]",
|
|
211
|
-
children: /* @__PURE__ */
|
|
211
|
+
children: /* @__PURE__ */ b(_, { className: "h-8 w-8 text-success" })
|
|
212
212
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ b("h2", {
|
|
214
214
|
className: "text-xl font-semibold text-text-primary",
|
|
215
|
-
children:
|
|
215
|
+
children: s("healthybowl.mandi.empty.title", "No mandi prices yet")
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ b("p", {
|
|
218
218
|
className: "mt-2 text-sm text-text-secondary",
|
|
219
|
-
children:
|
|
219
|
+
children: s("healthybowl.mandi.empty.description", "Wholesale mandi prices from Agmarknet will appear here once the price feed has synced for your region. In the meantime you can pin commodities to watch and set price alerts.")
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ x("div", {
|
|
222
222
|
className: "mt-6 flex items-center justify-center gap-3",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ x(S, {
|
|
224
224
|
variant: "outline",
|
|
225
225
|
onClick: () => Z(),
|
|
226
|
-
children: [/* @__PURE__ */
|
|
227
|
-
}), /* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), s("healthybowl.mandi.watchCta", "Watch")]
|
|
227
|
+
}), /* @__PURE__ */ x(S, {
|
|
228
228
|
onClick: () => Q(),
|
|
229
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ b(f, { className: "h-4 w-4" }), s("healthybowl.mandi.newAlert", "New alert")]
|
|
230
230
|
})]
|
|
231
231
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ b("p", {
|
|
233
233
|
className: "mt-6 text-xs text-text-secondary",
|
|
234
|
-
children:
|
|
234
|
+
children: s("healthybowl.mandi.sourceNote", "Source: Agmarknet (agmarknet.gov.in), Govt. of India.")
|
|
235
235
|
}),
|
|
236
236
|
yt
|
|
237
237
|
]
|
|
238
|
-
}) : /* @__PURE__ */
|
|
238
|
+
}) : /* @__PURE__ */ x("div", {
|
|
239
239
|
className: "space-y-4",
|
|
240
240
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ x("div", {
|
|
242
242
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
243
243
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ b(n, {
|
|
245
245
|
hero: !0,
|
|
246
|
-
label:
|
|
247
|
-
value:
|
|
248
|
-
icon: /* @__PURE__ */
|
|
246
|
+
label: s("healthybowl.mandi.kpi.commodities", "Commodities tracked"),
|
|
247
|
+
value: P.length,
|
|
248
|
+
icon: /* @__PURE__ */ b(Oe, { className: "h-4 w-4" })
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
label:
|
|
250
|
+
/* @__PURE__ */ b(n, {
|
|
251
|
+
label: s("healthybowl.mandi.kpi.markets", "Markets reporting"),
|
|
252
252
|
value: gt,
|
|
253
|
-
icon: /* @__PURE__ */
|
|
253
|
+
icon: /* @__PURE__ */ b(_, { className: "h-4 w-4" })
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ b(n, {
|
|
256
256
|
"data-testid": "mandi-kpi-watchlist",
|
|
257
|
-
"data-value":
|
|
258
|
-
label:
|
|
259
|
-
value:
|
|
260
|
-
icon: /* @__PURE__ */
|
|
257
|
+
"data-value": L.length,
|
|
258
|
+
label: s("healthybowl.mandi.kpi.watchlist", "On watchlist"),
|
|
259
|
+
value: L.length,
|
|
260
|
+
icon: /* @__PURE__ */ b(g, { className: "h-4 w-4" })
|
|
261
261
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ b(n, {
|
|
263
263
|
"data-testid": "mandi-kpi-alerts",
|
|
264
264
|
"data-value": _t,
|
|
265
|
-
label:
|
|
265
|
+
label: s("healthybowl.mandi.kpi.alerts", "Active alerts"),
|
|
266
266
|
value: _t,
|
|
267
|
-
icon: /* @__PURE__ */
|
|
267
|
+
icon: /* @__PURE__ */ b(Te, { className: "h-4 w-4" })
|
|
268
268
|
})
|
|
269
269
|
]
|
|
270
270
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ x("div", {
|
|
272
272
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ x("div", {
|
|
274
274
|
className: "space-y-4 lg:col-span-2",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
276
|
-
title:
|
|
277
|
-
description: `${
|
|
278
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: [/* @__PURE__ */ x(a, {
|
|
276
|
+
title: s("healthybowl.mandi.prices.title", "Latest prices by commodity"),
|
|
277
|
+
description: `${s("healthybowl.mandi.prices.caption", "Modal ₹/unit")} · ${ot}`,
|
|
278
|
+
children: [/* @__PURE__ */ b("div", {
|
|
279
279
|
className: "mb-3",
|
|
280
|
-
children: /* @__PURE__ */
|
|
281
|
-
searchValue:
|
|
282
|
-
onSearchChange:
|
|
283
|
-
searchPlaceholder:
|
|
284
|
-
filters: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ b(r, {
|
|
281
|
+
searchValue: H,
|
|
282
|
+
onSearchChange: qe,
|
|
283
|
+
searchPlaceholder: s("healthybowl.mandi.prices.search", "Search commodity or market"),
|
|
284
|
+
filters: /* @__PURE__ */ x("div", {
|
|
285
285
|
className: "flex flex-wrap items-center gap-2",
|
|
286
286
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
value:
|
|
289
|
-
onValueChange: (e) =>
|
|
290
|
-
children: [/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ x(C, {
|
|
288
|
+
value: y || E,
|
|
289
|
+
onValueChange: (e) => rt(e === E ? "" : e),
|
|
290
|
+
children: [/* @__PURE__ */ b(Ne, {
|
|
291
291
|
className: "w-44",
|
|
292
|
-
children: /* @__PURE__ */
|
|
293
|
-
}), /* @__PURE__ */
|
|
294
|
-
value:
|
|
295
|
-
children:
|
|
296
|
-
}),
|
|
292
|
+
children: /* @__PURE__ */ b(Pe, { placeholder: s("healthybowl.mandi.prices.filters.allStates", "All states") })
|
|
293
|
+
}), /* @__PURE__ */ x(Me, { children: [/* @__PURE__ */ b(w, {
|
|
294
|
+
value: E,
|
|
295
|
+
children: s("healthybowl.mandi.prices.filters.allStates", "All states")
|
|
296
|
+
}), tt.map((e) => /* @__PURE__ */ b(w, {
|
|
297
297
|
value: e,
|
|
298
298
|
children: e
|
|
299
299
|
}, e))] })]
|
|
300
300
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
value:
|
|
303
|
-
onValueChange: (e) =>
|
|
304
|
-
children: [/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ x(C, {
|
|
302
|
+
value: k || E,
|
|
303
|
+
onValueChange: (e) => A(e === E ? "" : e),
|
|
304
|
+
children: [/* @__PURE__ */ b(Ne, {
|
|
305
305
|
className: "w-44",
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
-
value:
|
|
309
|
-
children:
|
|
310
|
-
}),
|
|
306
|
+
children: /* @__PURE__ */ b(Pe, { placeholder: s("healthybowl.mandi.prices.filters.allDistricts", "All districts") })
|
|
307
|
+
}), /* @__PURE__ */ x(Me, { children: [/* @__PURE__ */ b(w, {
|
|
308
|
+
value: E,
|
|
309
|
+
children: s("healthybowl.mandi.prices.filters.allDistricts", "All districts")
|
|
310
|
+
}), nt.map((e) => /* @__PURE__ */ b(w, {
|
|
311
311
|
value: e,
|
|
312
312
|
children: e
|
|
313
313
|
}, e))] })]
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ b("input", {
|
|
316
316
|
type: "date",
|
|
317
|
-
value:
|
|
318
|
-
max:
|
|
319
|
-
onChange: (e) =>
|
|
320
|
-
"aria-label":
|
|
317
|
+
value: j,
|
|
318
|
+
max: N || void 0,
|
|
319
|
+
onChange: (e) => M(e.target.value),
|
|
320
|
+
"aria-label": s("healthybowl.mandi.prices.filters.from", "From date"),
|
|
321
321
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary"
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ b("input", {
|
|
324
324
|
type: "date",
|
|
325
|
-
value:
|
|
326
|
-
min:
|
|
327
|
-
onChange: (e) =>
|
|
328
|
-
"aria-label":
|
|
325
|
+
value: N,
|
|
326
|
+
min: j || void 0,
|
|
327
|
+
onChange: (e) => ze(e.target.value),
|
|
328
|
+
"aria-label": s("healthybowl.mandi.prices.filters.to", "To date"),
|
|
329
329
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm text-text-primary"
|
|
330
330
|
}),
|
|
331
|
-
|
|
331
|
+
it && /* @__PURE__ */ b(S, {
|
|
332
332
|
variant: "ghost",
|
|
333
333
|
size: "sm",
|
|
334
|
-
onClick:
|
|
335
|
-
children:
|
|
334
|
+
onClick: at,
|
|
335
|
+
children: s("healthybowl.mandi.prices.filters.clear", "Clear filters")
|
|
336
336
|
})
|
|
337
337
|
]
|
|
338
338
|
})
|
|
339
339
|
})
|
|
340
|
-
}), st.length === 0 ? /* @__PURE__ */
|
|
340
|
+
}), st.length === 0 ? /* @__PURE__ */ b("p", {
|
|
341
341
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
342
|
-
children:
|
|
343
|
-
}) : /* @__PURE__ */
|
|
342
|
+
children: s("healthybowl.mandi.prices.noMatch", "No commodities match your search.")
|
|
343
|
+
}) : /* @__PURE__ */ b("div", {
|
|
344
344
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
345
|
-
children: st.map((t) => /* @__PURE__ */
|
|
345
|
+
children: st.map((t) => /* @__PURE__ */ x("button", {
|
|
346
346
|
type: "button",
|
|
347
347
|
onClick: () => lt(t),
|
|
348
|
-
className: e("rounded-lg border p-3 text-start transition-colors",
|
|
348
|
+
className: e("rounded-lg border p-3 text-start transition-colors", U?.commodity === t.commodity ? "border-primary bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface hover:border-border"),
|
|
349
349
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ x("div", {
|
|
351
351
|
className: "flex items-start justify-between gap-2",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ x("div", {
|
|
353
353
|
className: "min-w-0",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ b("div", {
|
|
355
355
|
className: "truncate font-medium text-text-primary",
|
|
356
356
|
children: t.commodity
|
|
357
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ b("div", {
|
|
358
358
|
className: "truncate text-xs text-text-secondary",
|
|
359
|
-
children: t.representativeMarket ??
|
|
359
|
+
children: t.representativeMarket ?? s("healthybowl.mandi.prices.markets", "{{n}} markets", { n: t.marketsCount })
|
|
360
360
|
})]
|
|
361
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ b(Re, { row: t })]
|
|
362
362
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ x("div", {
|
|
364
364
|
className: "mt-2 flex items-baseline gap-1",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ b("span", {
|
|
366
366
|
className: "text-lg font-semibold tabular-nums text-text-primary",
|
|
367
|
-
children:
|
|
368
|
-
}), t.unit ? /* @__PURE__ */
|
|
367
|
+
children: c(t.modalPrice)
|
|
368
|
+
}), t.unit ? /* @__PURE__ */ x("span", {
|
|
369
369
|
className: "text-xs text-text-secondary",
|
|
370
370
|
children: ["/", t.unit]
|
|
371
371
|
}) : null]
|
|
372
372
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ x("div", {
|
|
374
374
|
className: "mt-1 flex items-center justify-between text-xs text-text-secondary",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ x("span", {
|
|
376
376
|
className: "tabular-nums",
|
|
377
377
|
children: [
|
|
378
|
-
|
|
378
|
+
c(t.minPrice),
|
|
379
379
|
" – ",
|
|
380
|
-
|
|
380
|
+
c(t.maxPrice)
|
|
381
381
|
]
|
|
382
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ b("span", {
|
|
383
383
|
className: "tabular-nums",
|
|
384
|
-
children:
|
|
384
|
+
children: s("healthybowl.mandi.prices.arrivals", "Arr. {{q}}", { q: me(t.arrivalQty, t.unit) })
|
|
385
385
|
})]
|
|
386
386
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ x("div", {
|
|
388
388
|
className: "mt-1.5 flex items-center justify-between border-t border-border-subtle pt-1.5",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ b("span", {
|
|
390
390
|
className: "text-[11px] text-text-secondary",
|
|
391
|
-
children:
|
|
392
|
-
}), /* @__PURE__ */
|
|
391
|
+
children: l(t.priceDate, t.source)
|
|
392
|
+
}), /* @__PURE__ */ b("span", {
|
|
393
393
|
className: "text-[11px] font-medium text-primary hover:underline",
|
|
394
394
|
onClick: (e) => {
|
|
395
395
|
e.stopPropagation(), Z(t.commodity);
|
|
396
396
|
},
|
|
397
|
-
children:
|
|
397
|
+
children: s("healthybowl.mandi.prices.watch", "Watch")
|
|
398
398
|
})]
|
|
399
399
|
})
|
|
400
400
|
]
|
|
401
401
|
}, t.commodity))
|
|
402
402
|
})]
|
|
403
|
-
}), /* @__PURE__ */
|
|
404
|
-
title:
|
|
405
|
-
description:
|
|
406
|
-
children:
|
|
407
|
-
icon: /* @__PURE__ */
|
|
408
|
-
label:
|
|
409
|
-
}) : /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ b(a, {
|
|
404
|
+
title: U ? s("healthybowl.mandi.trend.titleFor", "{{c}} — 30-day trend", { c: U.commodity }) : s("healthybowl.mandi.trend.title", "Price trend"),
|
|
405
|
+
description: s("healthybowl.mandi.trend.caption", "Modal price · last 30 days"),
|
|
406
|
+
children: U ? Y.loading && X.length === 0 ? /* @__PURE__ */ b(O, { label: s("healthybowl.mandi.trend.loading", "Loading trend…") }) : X.length === 0 ? /* @__PURE__ */ b(O, {
|
|
407
|
+
icon: /* @__PURE__ */ b(p, { className: "h-6 w-6" }),
|
|
408
|
+
label: s("healthybowl.mandi.trend.none", "No trend history available for this commodity yet.")
|
|
409
|
+
}) : /* @__PURE__ */ b(ae, {
|
|
410
410
|
width: "100%",
|
|
411
411
|
height: 240,
|
|
412
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ x(le, {
|
|
413
413
|
data: X,
|
|
414
414
|
margin: {
|
|
415
415
|
top: 6,
|
|
@@ -418,51 +418,51 @@ function E() {
|
|
|
418
418
|
bottom: 4
|
|
419
419
|
},
|
|
420
420
|
children: [
|
|
421
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ b(oe, {
|
|
422
422
|
strokeDasharray: "3 3",
|
|
423
423
|
className: "stroke-border"
|
|
424
424
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ b(se, {
|
|
426
426
|
dataKey: "label",
|
|
427
427
|
className: "text-xs",
|
|
428
428
|
tick: { fill: "currentColor" }
|
|
429
429
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ b(ce, {
|
|
431
431
|
className: "text-xs",
|
|
432
432
|
tick: { fill: "currentColor" },
|
|
433
|
-
tickFormatter: (e) =>
|
|
433
|
+
tickFormatter: (e) => c(e),
|
|
434
434
|
width: 70
|
|
435
435
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
contentStyle:
|
|
436
|
+
/* @__PURE__ */ b(ie, {
|
|
437
|
+
contentStyle: Ie,
|
|
438
438
|
labelStyle: { color: "var(--color-foreground)" },
|
|
439
|
-
formatter: (e) =>
|
|
439
|
+
formatter: (e) => c(e)
|
|
440
440
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ b(re, {}),
|
|
442
|
+
/* @__PURE__ */ b(o, {
|
|
443
443
|
type: "monotone",
|
|
444
444
|
dataKey: "modal",
|
|
445
|
-
name:
|
|
446
|
-
stroke:
|
|
445
|
+
name: s("healthybowl.mandi.trend.modal", "Modal"),
|
|
446
|
+
stroke: T[0],
|
|
447
447
|
strokeWidth: 2,
|
|
448
448
|
dot: { r: 2 },
|
|
449
449
|
connectNulls: !0
|
|
450
450
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ b(o, {
|
|
452
452
|
type: "monotone",
|
|
453
453
|
dataKey: "min",
|
|
454
|
-
name:
|
|
455
|
-
stroke:
|
|
454
|
+
name: s("healthybowl.mandi.trend.min", "Min"),
|
|
455
|
+
stroke: T[1],
|
|
456
456
|
strokeWidth: 1.5,
|
|
457
457
|
strokeDasharray: "4 3",
|
|
458
458
|
dot: !1,
|
|
459
459
|
connectNulls: !0
|
|
460
460
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ b(o, {
|
|
462
462
|
type: "monotone",
|
|
463
463
|
dataKey: "max",
|
|
464
|
-
name:
|
|
465
|
-
stroke:
|
|
464
|
+
name: s("healthybowl.mandi.trend.max", "Max"),
|
|
465
|
+
stroke: T[2],
|
|
466
466
|
strokeWidth: 1.5,
|
|
467
467
|
strokeDasharray: "4 3",
|
|
468
468
|
dot: !1,
|
|
@@ -470,158 +470,158 @@ function E() {
|
|
|
470
470
|
})
|
|
471
471
|
]
|
|
472
472
|
})
|
|
473
|
-
}) : /* @__PURE__ */
|
|
474
|
-
icon: /* @__PURE__ */
|
|
475
|
-
label:
|
|
473
|
+
}) : /* @__PURE__ */ b(O, {
|
|
474
|
+
icon: /* @__PURE__ */ b(p, { className: "h-6 w-6" }),
|
|
475
|
+
label: s("healthybowl.mandi.trend.pick", "Select a commodity above to see its price trend.")
|
|
476
476
|
})
|
|
477
477
|
})]
|
|
478
|
-
}), /* @__PURE__ */
|
|
478
|
+
}), /* @__PURE__ */ x("div", {
|
|
479
479
|
className: "space-y-4 lg:col-span-1",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
481
|
-
title:
|
|
482
|
-
actions: /* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ b(a, {
|
|
481
|
+
title: s("healthybowl.mandi.watchlist.title", "Watchlist"),
|
|
482
|
+
actions: /* @__PURE__ */ x(S, {
|
|
483
483
|
variant: "ghost",
|
|
484
484
|
size: "sm",
|
|
485
485
|
onClick: () => Z(),
|
|
486
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ b(h, { className: "h-3.5 w-3.5" }), s("healthybowl.mandi.watchlist.add", "Add")]
|
|
487
487
|
}),
|
|
488
|
-
children:
|
|
488
|
+
children: L.length === 0 ? /* @__PURE__ */ b("p", {
|
|
489
489
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
490
|
-
children:
|
|
491
|
-
}) : /* @__PURE__ */
|
|
490
|
+
children: s("healthybowl.mandi.watchlist.empty", "Pin commodities to keep their latest price handy.")
|
|
491
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
492
492
|
className: "space-y-2",
|
|
493
|
-
children:
|
|
493
|
+
children: L.map((e) => {
|
|
494
494
|
let t = ct(e);
|
|
495
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ x("li", {
|
|
496
496
|
className: "flex items-center justify-between gap-2 rounded-lg border border-border-subtle bg-bg-surface p-2.5",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ x("div", {
|
|
498
498
|
className: "min-w-0",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ b("div", {
|
|
500
500
|
className: "truncate text-sm font-medium text-text-primary",
|
|
501
501
|
children: e.commodity
|
|
502
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ b("div", {
|
|
503
503
|
className: "truncate text-xs text-text-secondary",
|
|
504
|
-
children: e.marketName ??
|
|
504
|
+
children: e.marketName ?? s("healthybowl.mandi.watchlist.anyMarket", "Any market")
|
|
505
505
|
})]
|
|
506
|
-
}), /* @__PURE__ */
|
|
506
|
+
}), /* @__PURE__ */ x("div", {
|
|
507
507
|
className: "flex items-center gap-2",
|
|
508
|
-
children: [/* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ b("span", {
|
|
509
509
|
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
510
|
-
children: t ?
|
|
511
|
-
}), /* @__PURE__ */
|
|
510
|
+
children: t ? c(t.modalPrice) : "—"
|
|
511
|
+
}), /* @__PURE__ */ b("button", {
|
|
512
512
|
type: "button",
|
|
513
513
|
onClick: () => dt(e),
|
|
514
514
|
className: "rounded-md p-1.5 text-text-secondary transition-colors hover:bg-status-error-bg hover:text-status-error-text",
|
|
515
|
-
"aria-label":
|
|
516
|
-
title:
|
|
517
|
-
children: /* @__PURE__ */ v
|
|
515
|
+
"aria-label": s("healthybowl.common.remove", "Remove"),
|
|
516
|
+
title: s("healthybowl.common.remove", "Remove"),
|
|
517
|
+
children: /* @__PURE__ */ b(v, { className: "h-4 w-4" })
|
|
518
518
|
})]
|
|
519
519
|
})]
|
|
520
520
|
}, e.id);
|
|
521
521
|
})
|
|
522
522
|
})
|
|
523
|
-
}), /* @__PURE__ */
|
|
524
|
-
title:
|
|
525
|
-
actions: /* @__PURE__ */
|
|
523
|
+
}), /* @__PURE__ */ x(a, {
|
|
524
|
+
title: s("healthybowl.mandi.alerts.title", "Price alerts"),
|
|
525
|
+
actions: /* @__PURE__ */ x(S, {
|
|
526
526
|
variant: "ghost",
|
|
527
527
|
size: "sm",
|
|
528
528
|
onClick: () => Q(),
|
|
529
|
-
children: [/* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ b(h, { className: "h-3.5 w-3.5" }), s("healthybowl.mandi.alerts.new", "New")]
|
|
530
530
|
}),
|
|
531
|
-
children: [$.length === 0 ? /* @__PURE__ */
|
|
531
|
+
children: [$.length === 0 ? /* @__PURE__ */ b("p", {
|
|
532
532
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
533
|
-
children:
|
|
534
|
-
}) : /* @__PURE__ */
|
|
533
|
+
children: s("healthybowl.mandi.alerts.none", "No price alerts triggered.")
|
|
534
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
535
535
|
className: "space-y-2",
|
|
536
|
-
children: $.slice(0, 5).map((t) => /* @__PURE__ */
|
|
536
|
+
children: $.slice(0, 5).map((t) => /* @__PURE__ */ x("li", {
|
|
537
537
|
"data-testid": "mandi-alert-row",
|
|
538
538
|
"data-alert-id": t.id,
|
|
539
539
|
className: "flex gap-2 rounded-lg border border-border-subtle bg-bg-surface p-2.5",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ b("span", { className: e("mt-0.5 w-1 shrink-0 rounded-full", _e(t.severity)) }), /* @__PURE__ */ x("div", {
|
|
541
541
|
className: "min-w-0 flex-1",
|
|
542
542
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ x("div", {
|
|
544
544
|
className: "flex items-center justify-between gap-2",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ b("span", {
|
|
546
546
|
className: "truncate text-sm font-medium text-text-primary",
|
|
547
547
|
children: t.title
|
|
548
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ x("div", {
|
|
549
549
|
className: "flex shrink-0 items-center gap-1.5",
|
|
550
|
-
children: [/* @__PURE__ */
|
|
551
|
-
variant:
|
|
550
|
+
children: [/* @__PURE__ */ b(je, {
|
|
551
|
+
variant: ge(t.severity),
|
|
552
552
|
children: t.severity
|
|
553
|
-
}), /* @__PURE__ */
|
|
553
|
+
}), /* @__PURE__ */ b(S, {
|
|
554
554
|
variant: "ghost",
|
|
555
555
|
size: "sm",
|
|
556
556
|
className: "h-6 px-1.5",
|
|
557
557
|
"data-testid": "mandi-alert-acknowledge",
|
|
558
558
|
onClick: () => ht(t),
|
|
559
|
-
"aria-label":
|
|
560
|
-
title:
|
|
561
|
-
children: /* @__PURE__ */
|
|
559
|
+
"aria-label": s("healthybowl.mandi.alerts.acknowledge", "Acknowledge alert"),
|
|
560
|
+
title: s("healthybowl.mandi.alerts.acknowledge", "Acknowledge alert"),
|
|
561
|
+
children: /* @__PURE__ */ b(Ee, { className: "h-3.5 w-3.5" })
|
|
562
562
|
})]
|
|
563
563
|
})]
|
|
564
564
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ b("p", {
|
|
566
566
|
className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
|
|
567
567
|
children: t.message
|
|
568
568
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ b("span", {
|
|
570
570
|
className: "mt-1 block text-[11px] text-text-secondary",
|
|
571
|
-
children:
|
|
571
|
+
children: Le(t.timestamp)
|
|
572
572
|
})
|
|
573
573
|
]
|
|
574
574
|
})]
|
|
575
575
|
}, t.id))
|
|
576
|
-
}), /* @__PURE__ */
|
|
576
|
+
}), /* @__PURE__ */ x("div", {
|
|
577
577
|
className: "mt-4 border-t border-border-subtle pt-3",
|
|
578
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ b("p", {
|
|
579
579
|
className: "text-sm font-semibold text-text-primary",
|
|
580
|
-
children:
|
|
581
|
-
}),
|
|
580
|
+
children: s("healthybowl.mandi.alerts.rules", "Alert rules")
|
|
581
|
+
}), R.length === 0 ? /* @__PURE__ */ b("p", {
|
|
582
582
|
className: "mt-1.5 text-xs text-text-secondary",
|
|
583
|
-
children:
|
|
584
|
-
}) : /* @__PURE__ */
|
|
583
|
+
children: s("healthybowl.mandi.alerts.noRules", "No rules yet — create one to get notified on price moves.")
|
|
584
|
+
}) : /* @__PURE__ */ b("ul", {
|
|
585
585
|
className: "mt-2 space-y-1.5",
|
|
586
|
-
children:
|
|
586
|
+
children: R.map((e) => /* @__PURE__ */ x("li", {
|
|
587
587
|
className: "flex items-center justify-between gap-2 text-xs",
|
|
588
|
-
children: [/* @__PURE__ */
|
|
588
|
+
children: [/* @__PURE__ */ x("div", {
|
|
589
589
|
className: "min-w-0",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ b("span", {
|
|
591
591
|
className: "font-medium text-text-primary",
|
|
592
592
|
children: e.commodity
|
|
593
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ x("span", {
|
|
594
594
|
className: "text-text-secondary",
|
|
595
595
|
children: [
|
|
596
596
|
" ",
|
|
597
|
-
|
|
597
|
+
fe(e.comparator),
|
|
598
598
|
" ",
|
|
599
|
-
|
|
599
|
+
c(e.threshold),
|
|
600
600
|
e.marketName ? ` · ${e.marketName}` : ""
|
|
601
601
|
]
|
|
602
602
|
})]
|
|
603
|
-
}), /* @__PURE__ */
|
|
603
|
+
}), /* @__PURE__ */ x("div", {
|
|
604
604
|
className: "flex shrink-0 items-center gap-1",
|
|
605
605
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ b(Fe, {
|
|
607
607
|
checked: e.enabled,
|
|
608
608
|
onCheckedChange: () => pt(e)
|
|
609
609
|
}),
|
|
610
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ b("button", {
|
|
611
611
|
type: "button",
|
|
612
612
|
onClick: () => Q(e),
|
|
613
613
|
className: "rounded-md p-1 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
614
|
-
"aria-label":
|
|
615
|
-
title:
|
|
616
|
-
children: /* @__PURE__ */
|
|
614
|
+
"aria-label": s("healthybowl.common.edit", "Edit"),
|
|
615
|
+
title: s("healthybowl.common.edit", "Edit"),
|
|
616
|
+
children: /* @__PURE__ */ b(De, { className: "h-3.5 w-3.5" })
|
|
617
617
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ b("button", {
|
|
619
619
|
type: "button",
|
|
620
620
|
onClick: () => mt(e),
|
|
621
621
|
className: "rounded-md p-1 text-text-secondary transition-colors hover:bg-status-error-bg hover:text-status-error-text",
|
|
622
|
-
"aria-label":
|
|
623
|
-
title:
|
|
624
|
-
children: /* @__PURE__ */ v
|
|
622
|
+
"aria-label": s("healthybowl.common.remove", "Remove"),
|
|
623
|
+
title: s("healthybowl.common.remove", "Remove"),
|
|
624
|
+
children: /* @__PURE__ */ b(v, { className: "h-3.5 w-3.5" })
|
|
625
625
|
})
|
|
626
626
|
]
|
|
627
627
|
})]
|
|
@@ -631,25 +631,25 @@ function E() {
|
|
|
631
631
|
})]
|
|
632
632
|
})]
|
|
633
633
|
}),
|
|
634
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ b("p", {
|
|
635
635
|
className: "text-xs text-text-secondary",
|
|
636
|
-
children:
|
|
636
|
+
children: s("healthybowl.mandi.disclosure", "Prices sourced from Agmarknet (agmarknet.gov.in), Directorate of Marketing & Inspection, Govt. of India, and shown as indicative wholesale rates — confirm at your local mandi before trading.")
|
|
637
637
|
}),
|
|
638
638
|
yt
|
|
639
639
|
]
|
|
640
640
|
})
|
|
641
641
|
});
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
return /* @__PURE__ */
|
|
643
|
+
function O({ icon: e, label: t }) {
|
|
644
|
+
return /* @__PURE__ */ x("div", {
|
|
645
645
|
className: "flex h-[240px] flex-col items-center justify-center gap-2 text-sm text-text-secondary",
|
|
646
|
-
children: [e ? /* @__PURE__ */
|
|
646
|
+
children: [e ? /* @__PURE__ */ b("span", {
|
|
647
647
|
className: "text-text-secondary",
|
|
648
648
|
children: e
|
|
649
649
|
}) : null, t]
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
652
|
//#endregion
|
|
653
|
-
export {
|
|
653
|
+
export { D as MarketPricesPage };
|
|
654
654
|
|
|
655
655
|
//# sourceMappingURL=MarketPricesPage.js.map
|