@burdenoff/microfe-healthybowl 2026.822.1 → 2026.826.1
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/HealthyBowlRoot.js +117 -100
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +439 -396
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/carbonFeatureFlag.js +9 -0
- package/dist/healthybowl/carbonFeatureFlag.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlSentinel.js +75 -0
- package/dist/healthybowl/hooks/useHealthyBowlSentinel.js.map +1 -0
- package/dist/healthybowl/pages/ai/AiHubPage.js +99 -77
- package/dist/healthybowl/pages/ai/AiHubPage.js.map +1 -1
- package/dist/healthybowl/pages/ai/FarmAttentionPage.js +296 -0
- package/dist/healthybowl/pages/ai/FarmAttentionPage.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { HealthyBowlProvider as e } from "./context/HealthyBowlContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { HEALTHYBOWL_CARBON_FEATURE_FLAG as t, HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS as n, isHealthyBowlCarbonEnabled as ee } from "./carbonFeatureFlag.js";
|
|
3
|
+
import { normalizeBasePath as r, setHbFormatLocale as i } from "./utils/helpers.js";
|
|
4
|
+
import { ErrorBoundary as a } from "./components/ErrorBoundary.js";
|
|
5
|
+
import { ConfirmProvider as o } from "./components/ConfirmDialog.js";
|
|
6
|
+
import { HealthyBowlRoutes as s } from "./HealthyBowlRoutes.js";
|
|
7
|
+
import { OfflineSyncProvider as c } from "./offline/OfflineSyncProvider.js";
|
|
8
|
+
import { useCallback as te, useEffect as l } from "react";
|
|
9
|
+
import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { Award as re, Banknote as ie, BarChart3 as ae, Bug as oe, Cloud as u, CloudUpload as d, DollarSign as f, Factory as p, Fence as m, FlaskConical as h, Globe as g, Home as _, Landmark as v, Leaf as y, LineChart as b, ListChecks as x, Map as S, Package as C, PawPrint as w, Radio as T, RefreshCw as E, ScanLine as D, ScanSearch as O, ShieldAlert as k, ShieldCheck as se, ShoppingCart as A, Sprout as j, Stethoscope as M, Tractor as N, UserCheck as P, Users as F, Users2 as I, Wheat as L } from "lucide-react";
|
|
11
|
+
import { jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
12
|
+
import { FeatureFlagProvider as B, useFeatureFlags as V } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
12
13
|
//#region src/healthybowl/HealthyBowlRoot.tsx
|
|
13
|
-
var
|
|
14
|
+
var H = new Set(["ar"]), U = [
|
|
14
15
|
".lucide-arrow-right",
|
|
15
16
|
".lucide-arrow-left",
|
|
16
17
|
".lucide-chevron-right",
|
|
@@ -19,314 +20,330 @@ var U = new Set(["ar"]), W = [
|
|
|
19
20
|
".lucide-chevrons-left",
|
|
20
21
|
".lucide-move-right",
|
|
21
22
|
".lucide-move-left"
|
|
22
|
-
].map((e) => `[dir="rtl"] ${e}`).join(",").concat("{transform:scaleX(-1)}"),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
].map((e) => `[dir="rtl"] ${e}`).join(",").concat("{transform:scaleX(-1)}"), W = new Set([
|
|
24
|
+
"healthybowl-sustainability",
|
|
25
|
+
"healthybowl-sustainability-carbon",
|
|
26
|
+
"healthybowl-sustainability-soil",
|
|
27
|
+
"healthybowl-sustainability-credits",
|
|
28
|
+
"healthybowl-sustainability-eudr"
|
|
29
|
+
]);
|
|
30
|
+
function G(e, t) {
|
|
31
|
+
return t ? e : e.filter((e) => !W.has(e.id));
|
|
32
|
+
}
|
|
33
|
+
var K = (n) => {
|
|
34
|
+
let { registerNavItems: B, registerFooterItems: W, basePath: K = "/" } = n, { error: q, getEvaluation: ce, isLoading: le } = V(), J = ee(ce(t), le || q !== null), { t: Y, locale: X } = ne();
|
|
35
|
+
i(X);
|
|
36
|
+
let Z = H.has(X) ? "rtl" : "ltr";
|
|
37
|
+
l(() => {
|
|
27
38
|
let e = document.documentElement, t = e.getAttribute("dir");
|
|
28
39
|
return e.setAttribute("dir", Z), () => {
|
|
29
40
|
t === null ? e.removeAttribute("dir") : e.setAttribute("dir", t);
|
|
30
41
|
};
|
|
31
42
|
}, [Z]);
|
|
32
|
-
let Q =
|
|
43
|
+
let Q = te((e, t) => {
|
|
33
44
|
let n = Y(e);
|
|
34
45
|
return n === e ? t : n;
|
|
35
46
|
}, [Y]), $ = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
36
|
-
return
|
|
37
|
-
if (
|
|
47
|
+
return l(() => {
|
|
48
|
+
if (B) return B(G([
|
|
38
49
|
{
|
|
39
50
|
id: "healthybowl-dashboard",
|
|
40
51
|
label: Q("healthybowl.nav.dashboard", "Dashboard"),
|
|
41
|
-
path:
|
|
42
|
-
icon: /* @__PURE__ */
|
|
52
|
+
path: r(K),
|
|
53
|
+
icon: /* @__PURE__ */ R(_, { size: 20 }),
|
|
43
54
|
order: 1,
|
|
44
55
|
group: "main"
|
|
45
56
|
},
|
|
46
57
|
{
|
|
47
58
|
id: "healthybowl-farm",
|
|
48
59
|
label: Q("healthybowl.nav.farm", "My Farm"),
|
|
49
|
-
path: $(
|
|
50
|
-
icon: /* @__PURE__ */
|
|
60
|
+
path: $(K, "farm"),
|
|
61
|
+
icon: /* @__PURE__ */ R(N, { size: 20 }),
|
|
51
62
|
order: 2,
|
|
52
63
|
group: "main"
|
|
53
64
|
},
|
|
54
65
|
{
|
|
55
66
|
id: "healthybowl-tasks",
|
|
56
67
|
label: Q("healthybowl.nav.tasks", "Tasks"),
|
|
57
|
-
path: $(
|
|
58
|
-
icon: /* @__PURE__ */
|
|
68
|
+
path: $(K, "tasks"),
|
|
69
|
+
icon: /* @__PURE__ */ R(x, { size: 20 }),
|
|
59
70
|
order: 3,
|
|
60
71
|
group: "main"
|
|
61
72
|
},
|
|
62
73
|
{
|
|
63
74
|
id: "healthybowl-crops",
|
|
64
75
|
label: Q("healthybowl.nav.crops", "Crops"),
|
|
65
|
-
path: $(
|
|
66
|
-
icon: /* @__PURE__ */
|
|
76
|
+
path: $(K, "crops"),
|
|
77
|
+
icon: /* @__PURE__ */ R(L, { size: 20 }),
|
|
67
78
|
order: 10,
|
|
68
79
|
group: "farming"
|
|
69
80
|
},
|
|
70
81
|
{
|
|
71
82
|
id: "healthybowl-livestock",
|
|
72
83
|
label: Q("healthybowl.nav.livestock", "Livestock"),
|
|
73
|
-
path: $(
|
|
74
|
-
icon: /* @__PURE__ */
|
|
84
|
+
path: $(K, "livestock"),
|
|
85
|
+
icon: /* @__PURE__ */ R(w, { size: 20 }),
|
|
75
86
|
order: 11,
|
|
76
87
|
group: "farming"
|
|
77
88
|
},
|
|
78
89
|
{
|
|
79
90
|
id: "healthybowl-livestock-analytics",
|
|
80
91
|
label: Q("healthybowl.nav.livestockAnalytics", "Livestock Analytics"),
|
|
81
|
-
path: $(
|
|
82
|
-
icon: /* @__PURE__ */
|
|
92
|
+
path: $(K, "livestock/analytics"),
|
|
93
|
+
icon: /* @__PURE__ */ R(b, { size: 20 }),
|
|
83
94
|
order: 11.3,
|
|
84
95
|
group: "farming"
|
|
85
96
|
},
|
|
86
97
|
{
|
|
87
98
|
id: "healthybowl-grazing",
|
|
88
99
|
label: Q("healthybowl.nav.grazing", "Grazing"),
|
|
89
|
-
path: $(
|
|
90
|
-
icon: /* @__PURE__ */
|
|
100
|
+
path: $(K, "livestock/grazing"),
|
|
101
|
+
icon: /* @__PURE__ */ R(m, { size: 20 }),
|
|
91
102
|
order: 11.4,
|
|
92
103
|
group: "farming"
|
|
93
104
|
},
|
|
94
105
|
{
|
|
95
106
|
id: "healthybowl-withdrawal-alerts",
|
|
96
107
|
label: Q("healthybowl.nav.withdrawalAlerts", "Withdrawal Alerts"),
|
|
97
|
-
path: $(
|
|
98
|
-
icon: /* @__PURE__ */
|
|
108
|
+
path: $(K, "livestock/withdrawal-alerts"),
|
|
109
|
+
icon: /* @__PURE__ */ R(k, { size: 20 }),
|
|
99
110
|
order: 11.5,
|
|
100
111
|
group: "farming"
|
|
101
112
|
},
|
|
102
113
|
{
|
|
103
114
|
id: "healthybowl-weather",
|
|
104
115
|
label: Q("healthybowl.nav.weather", "Weather"),
|
|
105
|
-
path: $(
|
|
106
|
-
icon: /* @__PURE__ */
|
|
116
|
+
path: $(K, "weather"),
|
|
117
|
+
icon: /* @__PURE__ */ R(u, { size: 20 }),
|
|
107
118
|
order: 12,
|
|
108
119
|
group: "farming"
|
|
109
120
|
},
|
|
110
121
|
{
|
|
111
122
|
id: "healthybowl-field-map",
|
|
112
123
|
label: Q("healthybowl.nav.fieldMap", "Field Map"),
|
|
113
|
-
path: $(
|
|
114
|
-
icon: /* @__PURE__ */
|
|
124
|
+
path: $(K, "field-map"),
|
|
125
|
+
icon: /* @__PURE__ */ R(S, { size: 20 }),
|
|
115
126
|
order: 12.5,
|
|
116
127
|
group: "farming"
|
|
117
128
|
},
|
|
118
129
|
{
|
|
119
130
|
id: "healthybowl-field-capture",
|
|
120
131
|
label: Q("healthybowl.nav.fieldCapture", "Field Capture"),
|
|
121
|
-
path: $(
|
|
122
|
-
icon: /* @__PURE__ */
|
|
132
|
+
path: $(K, "field-capture"),
|
|
133
|
+
icon: /* @__PURE__ */ R(d, { size: 20 }),
|
|
123
134
|
order: 12.6,
|
|
124
135
|
group: "farming"
|
|
125
136
|
},
|
|
126
137
|
{
|
|
127
138
|
id: "healthybowl-pending-sync",
|
|
128
139
|
label: Q("healthybowl.nav.pendingSync", "Pending Sync"),
|
|
129
|
-
path: $(
|
|
130
|
-
icon: /* @__PURE__ */
|
|
140
|
+
path: $(K, "field-capture/pending"),
|
|
141
|
+
icon: /* @__PURE__ */ R(E, { size: 20 }),
|
|
131
142
|
order: 12.7,
|
|
132
143
|
group: "farming"
|
|
133
144
|
},
|
|
134
145
|
{
|
|
135
146
|
id: "healthybowl-field-sensors",
|
|
136
147
|
label: Q("healthybowl.nav.fieldSensors", "Field Sensors"),
|
|
137
|
-
path: $(
|
|
138
|
-
icon: /* @__PURE__ */
|
|
148
|
+
path: $(K, "field-sensors"),
|
|
149
|
+
icon: /* @__PURE__ */ R(T, { size: 20 }),
|
|
139
150
|
order: 12.75,
|
|
140
151
|
group: "farming"
|
|
141
152
|
},
|
|
142
153
|
{
|
|
143
154
|
id: "healthybowl-soil",
|
|
144
155
|
label: Q("healthybowl.nav.soilHealth", "Soil Health"),
|
|
145
|
-
path: $(
|
|
146
|
-
icon: /* @__PURE__ */
|
|
156
|
+
path: $(K, "soil"),
|
|
157
|
+
icon: /* @__PURE__ */ R(h, { size: 20 }),
|
|
147
158
|
order: 13,
|
|
148
159
|
group: "farming"
|
|
149
160
|
},
|
|
150
161
|
{
|
|
151
162
|
id: "healthybowl-pest",
|
|
152
163
|
label: Q("healthybowl.nav.pestManagement", "Pest Management"),
|
|
153
|
-
path: $(
|
|
154
|
-
icon: /* @__PURE__ */
|
|
164
|
+
path: $(K, "pest-management"),
|
|
165
|
+
icon: /* @__PURE__ */ R(oe, { size: 20 }),
|
|
155
166
|
order: 14,
|
|
156
167
|
group: "farming"
|
|
157
168
|
},
|
|
158
169
|
{
|
|
159
170
|
id: "healthybowl-pest-ai",
|
|
160
171
|
label: Q("healthybowl.nav.aiPestDetection", "AI Pest Detection"),
|
|
161
|
-
path: $(
|
|
162
|
-
icon: /* @__PURE__ */
|
|
172
|
+
path: $(K, "pest-management/ai-detection"),
|
|
173
|
+
icon: /* @__PURE__ */ R(O, { size: 20 }),
|
|
163
174
|
order: 14.5,
|
|
164
175
|
group: "farming"
|
|
165
176
|
},
|
|
166
177
|
{
|
|
167
178
|
id: "healthybowl-production",
|
|
168
179
|
label: Q("healthybowl.nav.production", "Production"),
|
|
169
|
-
path: $(
|
|
170
|
-
icon: /* @__PURE__ */
|
|
180
|
+
path: $(K, "production"),
|
|
181
|
+
icon: /* @__PURE__ */ R(p, { size: 20 }),
|
|
171
182
|
order: 20,
|
|
172
183
|
group: "business"
|
|
173
184
|
},
|
|
174
185
|
{
|
|
175
186
|
id: "healthybowl-products",
|
|
176
187
|
label: Q("healthybowl.nav.products", "Products"),
|
|
177
|
-
path: $(
|
|
178
|
-
icon: /* @__PURE__ */
|
|
188
|
+
path: $(K, "products"),
|
|
189
|
+
icon: /* @__PURE__ */ R(C, { size: 20 }),
|
|
179
190
|
order: 21,
|
|
180
191
|
group: "business"
|
|
181
192
|
},
|
|
182
193
|
{
|
|
183
194
|
id: "healthybowl-marketplace",
|
|
184
195
|
label: Q("healthybowl.nav.marketplace", "Marketplace"),
|
|
185
|
-
path: $(
|
|
186
|
-
icon: /* @__PURE__ */
|
|
196
|
+
path: $(K, "marketplace"),
|
|
197
|
+
icon: /* @__PURE__ */ R(A, { size: 20 }),
|
|
187
198
|
order: 22,
|
|
188
199
|
group: "business"
|
|
189
200
|
},
|
|
190
201
|
{
|
|
191
202
|
id: "healthybowl-coop",
|
|
192
203
|
label: Q("healthybowl.nav.coop", "Co-operative"),
|
|
193
|
-
path: $(
|
|
194
|
-
icon: /* @__PURE__ */
|
|
204
|
+
path: $(K, "coop"),
|
|
205
|
+
icon: /* @__PURE__ */ R(I, { size: 20 }),
|
|
195
206
|
order: 22.5,
|
|
196
207
|
group: "business"
|
|
197
208
|
},
|
|
198
209
|
{
|
|
199
210
|
id: "healthybowl-financial",
|
|
200
211
|
label: Q("healthybowl.nav.financial", "Financial"),
|
|
201
|
-
path: $(
|
|
202
|
-
icon: /* @__PURE__ */
|
|
212
|
+
path: $(K, "financial"),
|
|
213
|
+
icon: /* @__PURE__ */ R(f, { size: 20 }),
|
|
203
214
|
order: 23,
|
|
204
215
|
group: "business"
|
|
205
216
|
},
|
|
206
217
|
{
|
|
207
218
|
id: "healthybowl-financier",
|
|
208
219
|
label: Q("healthybowl.nav.financier", "Financier"),
|
|
209
|
-
path: $(
|
|
210
|
-
icon: /* @__PURE__ */
|
|
220
|
+
path: $(K, "financier"),
|
|
221
|
+
icon: /* @__PURE__ */ R(ie, { size: 20 }),
|
|
211
222
|
order: 24,
|
|
212
223
|
group: "business"
|
|
213
224
|
},
|
|
214
225
|
{
|
|
215
226
|
id: "healthybowl-compliance",
|
|
216
227
|
label: Q("healthybowl.nav.compliance", "Compliance"),
|
|
217
|
-
path: $(
|
|
218
|
-
icon: /* @__PURE__ */
|
|
228
|
+
path: $(K, "compliance"),
|
|
229
|
+
icon: /* @__PURE__ */ R(se, { size: 20 }),
|
|
219
230
|
order: 30,
|
|
220
231
|
group: "compliance"
|
|
221
232
|
},
|
|
222
233
|
{
|
|
223
234
|
id: "healthybowl-traceability",
|
|
224
235
|
label: Q("healthybowl.nav.traceability", "Traceability"),
|
|
225
|
-
path: $(
|
|
226
|
-
icon: /* @__PURE__ */
|
|
236
|
+
path: $(K, "traceability"),
|
|
237
|
+
icon: /* @__PURE__ */ R(D, { size: 20 }),
|
|
227
238
|
order: 31,
|
|
228
239
|
group: "compliance"
|
|
229
240
|
},
|
|
230
241
|
{
|
|
231
242
|
id: "healthybowl-sustainability",
|
|
232
243
|
label: Q("healthybowl.nav.sustainability", "Sustainability"),
|
|
233
|
-
path: $(
|
|
234
|
-
icon: /* @__PURE__ */
|
|
244
|
+
path: $(K, "sustainability"),
|
|
245
|
+
icon: /* @__PURE__ */ R(y, { size: 20 }),
|
|
235
246
|
order: 32,
|
|
236
247
|
group: "compliance"
|
|
237
248
|
},
|
|
238
249
|
{
|
|
239
250
|
id: "healthybowl-sustainability-carbon",
|
|
240
251
|
label: Q("healthybowl.nav.sustainabilityCarbon", "Carbon & GHG"),
|
|
241
|
-
path: $(
|
|
242
|
-
icon: /* @__PURE__ */
|
|
252
|
+
path: $(K, "sustainability/carbon"),
|
|
253
|
+
icon: /* @__PURE__ */ R(p, { size: 20 }),
|
|
243
254
|
order: 32.1,
|
|
244
255
|
group: "compliance"
|
|
245
256
|
},
|
|
246
257
|
{
|
|
247
258
|
id: "healthybowl-sustainability-soil",
|
|
248
259
|
label: Q("healthybowl.nav.sustainabilitySoil", "Soil Carbon"),
|
|
249
|
-
path: $(
|
|
250
|
-
icon: /* @__PURE__ */
|
|
260
|
+
path: $(K, "sustainability/soil-carbon"),
|
|
261
|
+
icon: /* @__PURE__ */ R(j, { size: 20 }),
|
|
251
262
|
order: 32.2,
|
|
252
263
|
group: "compliance"
|
|
253
264
|
},
|
|
254
265
|
{
|
|
255
266
|
id: "healthybowl-sustainability-credits",
|
|
256
267
|
label: Q("healthybowl.nav.sustainabilityCredits", "Carbon Credits"),
|
|
257
|
-
path: $(
|
|
258
|
-
icon: /* @__PURE__ */
|
|
268
|
+
path: $(K, "sustainability/credits"),
|
|
269
|
+
icon: /* @__PURE__ */ R(re, { size: 20 }),
|
|
259
270
|
order: 32.3,
|
|
260
271
|
group: "compliance"
|
|
261
272
|
},
|
|
262
273
|
{
|
|
263
274
|
id: "healthybowl-sustainability-eudr",
|
|
264
275
|
label: Q("healthybowl.nav.sustainabilityEudr", "EUDR Due-Diligence"),
|
|
265
|
-
path: $(
|
|
266
|
-
icon: /* @__PURE__ */
|
|
276
|
+
path: $(K, "sustainability/eudr"),
|
|
277
|
+
icon: /* @__PURE__ */ R(g, { size: 20 }),
|
|
267
278
|
order: 32.4,
|
|
268
279
|
group: "compliance"
|
|
269
280
|
},
|
|
270
281
|
{
|
|
271
282
|
id: "healthybowl-schemes",
|
|
272
283
|
label: Q("healthybowl.nav.governmentSchemes", "Gov. Schemes"),
|
|
273
|
-
path: $(
|
|
274
|
-
icon: /* @__PURE__ */
|
|
284
|
+
path: $(K, "government-schemes"),
|
|
285
|
+
icon: /* @__PURE__ */ R(v, { size: 20 }),
|
|
275
286
|
order: 40,
|
|
276
287
|
group: "support"
|
|
277
288
|
},
|
|
278
289
|
{
|
|
279
290
|
id: "healthybowl-network",
|
|
280
291
|
label: Q("healthybowl.nav.network", "Network"),
|
|
281
|
-
path: $(
|
|
282
|
-
icon: /* @__PURE__ */
|
|
292
|
+
path: $(K, "network"),
|
|
293
|
+
icon: /* @__PURE__ */ R(F, { size: 20 }),
|
|
283
294
|
order: 41,
|
|
284
295
|
group: "support"
|
|
285
296
|
},
|
|
286
297
|
{
|
|
287
298
|
id: "healthybowl-analytics",
|
|
288
299
|
label: Q("healthybowl.nav.analytics", "Analytics"),
|
|
289
|
-
path: $(
|
|
290
|
-
icon: /* @__PURE__ */
|
|
300
|
+
path: $(K, "analytics"),
|
|
301
|
+
icon: /* @__PURE__ */ R(ae, { size: 20 }),
|
|
291
302
|
order: 42,
|
|
292
303
|
group: "support"
|
|
293
304
|
},
|
|
294
305
|
{
|
|
295
306
|
id: "healthybowl-advisors",
|
|
296
307
|
label: Q("healthybowl.nav.advisors", "My Advisors"),
|
|
297
|
-
path: $(
|
|
298
|
-
icon: /* @__PURE__ */
|
|
308
|
+
path: $(K, "advisors"),
|
|
309
|
+
icon: /* @__PURE__ */ R(P, { size: 20 }),
|
|
299
310
|
order: 43,
|
|
300
311
|
group: "support"
|
|
301
312
|
},
|
|
302
313
|
{
|
|
303
314
|
id: "healthybowl-consultant",
|
|
304
315
|
label: Q("healthybowl.nav.consultant", "Consultant"),
|
|
305
|
-
path: $(
|
|
306
|
-
icon: /* @__PURE__ */
|
|
316
|
+
path: $(K, "consultant"),
|
|
317
|
+
icon: /* @__PURE__ */ R(M, { size: 20 }),
|
|
307
318
|
order: 44,
|
|
308
319
|
group: "support"
|
|
309
320
|
}
|
|
310
|
-
]);
|
|
311
|
-
}, [
|
|
312
|
-
|
|
321
|
+
], J));
|
|
322
|
+
}, [
|
|
323
|
+
B,
|
|
324
|
+
K,
|
|
325
|
+
J,
|
|
326
|
+
Q
|
|
327
|
+
]), l(() => {
|
|
328
|
+
if (W) return W([{
|
|
313
329
|
id: "healthybowl-status",
|
|
314
330
|
label: Q("healthybowl.footer.ready", "HealthyBowl Ready"),
|
|
315
331
|
type: "status",
|
|
316
332
|
order: 10,
|
|
317
333
|
section: "left"
|
|
318
334
|
}]);
|
|
319
|
-
}, [
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
defaultEnabled: !0,
|
|
323
|
-
children: /* @__PURE__ */ V(e, {
|
|
324
|
-
...G,
|
|
325
|
-
children: [/* @__PURE__ */ B("style", { children: W }), /* @__PURE__ */ B(r, { children: /* @__PURE__ */ B(i, { children: /* @__PURE__ */ B(te, { children: /* @__PURE__ */ B(ee, {}) }) }) })]
|
|
326
|
-
})
|
|
335
|
+
}, [W, Q]), /* @__PURE__ */ z(e, {
|
|
336
|
+
...n,
|
|
337
|
+
children: [/* @__PURE__ */ R("style", { children: U }), /* @__PURE__ */ R(a, { children: /* @__PURE__ */ R(o, { children: /* @__PURE__ */ R(c, { children: /* @__PURE__ */ R(s, {}) }) }) })]
|
|
327
338
|
});
|
|
328
|
-
}
|
|
339
|
+
}, q = (e) => /* @__PURE__ */ R(B, {
|
|
340
|
+
workspaceId: e.workspaceId ?? null,
|
|
341
|
+
gateway: "global",
|
|
342
|
+
flagKeys: n,
|
|
343
|
+
defaultEnabled: !0,
|
|
344
|
+
children: /* @__PURE__ */ R(K, { ...e })
|
|
345
|
+
}, e.workspaceId ?? "no-workspace");
|
|
329
346
|
//#endregion
|
|
330
|
-
export {
|
|
347
|
+
export { q as HealthyBowlRoot };
|
|
331
348
|
|
|
332
349
|
//# sourceMappingURL=HealthyBowlRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthyBowlRoot.js","names":[],"sources":["../../src/healthybowl/HealthyBowlRoot.tsx"],"sourcesContent":["/**\n * HealthyBowl Root Component\n * @module healthybowl\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Tractor,\n ListChecks,\n Wheat,\n PawPrint,\n Cloud,\n Map as MapIcon,\n ShoppingCart,\n DollarSign,\n BarChart3,\n FlaskConical,\n Bug,\n ScanSearch,\n Factory,\n Package,\n ScanLine,\n ShieldCheck,\n Landmark,\n Banknote,\n Stethoscope,\n UserCheck,\n Users,\n CloudUpload,\n RefreshCw,\n ShieldAlert,\n LineChart,\n Fence,\n Radio,\n Leaf,\n Sprout,\n Award,\n Globe,\n Users2,\n} from 'lucide-react';\nimport { HealthyBowlProvider } from './context/HealthyBowlContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { HealthyBowlRoutes } from './HealthyBowlRoutes';\nimport { ErrorBoundary } from './components/ErrorBoundary';\nimport { ConfirmProvider } from './components/ConfirmDialog';\nimport { OfflineSyncProvider } from './offline/OfflineSyncProvider';\nimport { normalizeBasePath, setHbFormatLocale } from './utils/helpers';\nimport type { HealthyBowlRootProps, NavItem } from './types';\n\n// Locales that render right-to-left. Arabic is the only RTL language in the shell's supported set\n// today; kept as a set so adding Hebrew/Farsi/Urdu later is a one-line change (BOFF-6119).\nconst RTL_LOCALES = new Set<string>(['ar']);\n\n// Horizontal directional lucide icons whose glyph must point the other way under RTL. lucide-react\n// tags every icon with a `lucide-<name>` class; scaleX(-1) mirrors the horizontal ones (vertical\n// chevrons up/down are unchanged by a horizontal flip). Kept off the LTR path via the [dir=rtl] scope.\nconst RTL_ICON_MIRROR_CSS = [\n '.lucide-arrow-right',\n '.lucide-arrow-left',\n '.lucide-chevron-right',\n '.lucide-chevron-left',\n '.lucide-chevrons-right',\n '.lucide-chevrons-left',\n '.lucide-move-right',\n '.lucide-move-left',\n]\n .map((c) => `[dir=\"rtl\"] ${c}`)\n .join(',')\n .concat('{transform:scaleX(-1)}');\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate, locale } = useI18n();\n\n // HealthyBowl's Intl.* formatters (utils/helpers.ts) are plain functions used\n // across ~490 call sites, so they can't call useI18n() themselves. Sync the\n // shell's active language into their ambient locale here — the product's\n // single I18n consumer that wraps every page — so number / currency / date\n // grouping tracks the chosen language (BOFF-6202). Done during render, not in\n // an effect, so children rendered in this same pass already format with the\n // current locale (no one-frame western-grouping flash on a language switch).\n setHbFormatLocale(locale);\n\n // BOFF-6119 — Arabic (and any future RTL locale) must render right-to-left. HealthyBowl's own\n // components are migrated to logical CSS utilities (physical ml-/pr-/left-/text-left/… → logical\n // ms-/pe-/start-/text-start/…), so setting `dir` makes the whole HB surface mirror correctly.\n const dir: 'rtl' | 'ltr' = RTL_LOCALES.has(locale) ? 'rtl' : 'ltr';\n\n // Set the direction on the document root, not just an in-flow wrapper: HB's overlays\n // (confirm/alert dialogs, dropdowns, tooltips) render through Radix portals attached to\n // document.body, so a subtree wrapper would leave them LTR. The shared fe-libs I18nProvider\n // deliberately leaves document.dir unset (the app shell and other products aren't migrated to\n // logical CSS yet — fleet ticket BOFF-5998), so HB owns it here and restores the previous value\n // on unmount, keeping the effect self-contained to when a HealthyBowl surface is mounted.\n useEffect(() => {\n const el = document.documentElement;\n const previous = el.getAttribute('dir');\n el.setAttribute('dir', dir);\n return () => {\n if (previous === null) el.removeAttribute('dir');\n else el.setAttribute('dir', previous);\n };\n }, [dir]);\n\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n // Dashboard\n {\n id: 'healthybowl-dashboard',\n label: t('healthybowl.nav.dashboard', 'Dashboard'),\n // The product index IS the dashboard. Normalize a trailing slash like\n // every sibling item (joinPath) so active-state highlighting matches if\n // the host ever passes '/healthybowl/'.\n path: normalizeBasePath(basePath),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n\n // My Farm\n {\n id: 'healthybowl-farm',\n label: t('healthybowl.nav.farm', 'My Farm'),\n path: joinPath(basePath, 'farm'),\n icon: <Tractor size={20} />,\n order: 2,\n group: 'main',\n },\n\n // Farm Tasks (PlanMagnet embed) — shared work-item board across the farm.\n {\n id: 'healthybowl-tasks',\n label: t('healthybowl.nav.tasks', 'Tasks'),\n path: joinPath(basePath, 'tasks'),\n icon: <ListChecks size={20} />,\n order: 3,\n group: 'main',\n },\n\n // Crops\n {\n id: 'healthybowl-crops',\n label: t('healthybowl.nav.crops', 'Crops'),\n path: joinPath(basePath, 'crops'),\n icon: <Wheat size={20} />,\n order: 10,\n group: 'farming',\n },\n\n // Livestock\n {\n id: 'healthybowl-livestock',\n label: t('healthybowl.nav.livestock', 'Livestock'),\n path: joinPath(basePath, 'livestock'),\n icon: <PawPrint size={20} />,\n order: 11,\n group: 'farming',\n },\n\n // Livestock — Analytics (BOFF-6126). The growth, feed and herd-stats charts (BOFF-5971) also\n // render inline on the livestock dashboard; this gives them a dedicated URL and full-width home.\n {\n id: 'healthybowl-livestock-analytics',\n label: t('healthybowl.nav.livestockAnalytics', 'Livestock Analytics'),\n path: joinPath(basePath, 'livestock/analytics'),\n icon: <LineChart size={20} />,\n order: 11.3,\n group: 'farming',\n },\n\n // Livestock — Grazing management (BOFF-5970). Sits next to Livestock rather than inside it\n // because rotational grazing is a daily decision about FIELDS, not a herd-record lookup.\n {\n id: 'healthybowl-grazing',\n label: t('healthybowl.nav.grazing', 'Grazing'),\n path: joinPath(basePath, 'livestock/grazing'),\n icon: <Fence size={20} />,\n order: 11.4,\n group: 'farming',\n },\n\n // Livestock — Medication Withdrawal Alerts (BOFF-2885)\n {\n id: 'healthybowl-withdrawal-alerts',\n label: t('healthybowl.nav.withdrawalAlerts', 'Withdrawal Alerts'),\n path: joinPath(basePath, 'livestock/withdrawal-alerts'),\n icon: <ShieldAlert size={20} />,\n order: 11.5,\n group: 'farming',\n },\n\n // Weather\n {\n id: 'healthybowl-weather',\n label: t('healthybowl.nav.weather', 'Weather'),\n path: joinPath(basePath, 'weather'),\n icon: <Cloud size={20} />,\n order: 12,\n group: 'farming',\n },\n\n // Field Map — draw & manage field boundaries on satellite imagery\n {\n id: 'healthybowl-field-map',\n label: t('healthybowl.nav.fieldMap', 'Field Map'),\n path: joinPath(basePath, 'field-map'),\n icon: <MapIcon size={20} />,\n order: 12.5,\n group: 'farming',\n },\n\n // Field Capture — offline-first observation capture (BOFF-2883)\n {\n id: 'healthybowl-field-capture',\n label: t('healthybowl.nav.fieldCapture', 'Field Capture'),\n path: joinPath(basePath, 'field-capture'),\n icon: <CloudUpload size={20} />,\n order: 12.6,\n group: 'farming',\n },\n\n // Pending Sync — the offline outbox / sync queue (BOFF-2883)\n {\n id: 'healthybowl-pending-sync',\n label: t('healthybowl.nav.pendingSync', 'Pending Sync'),\n path: joinPath(basePath, 'field-capture/pending'),\n icon: <RefreshCw size={20} />,\n order: 12.7,\n group: 'farming',\n },\n\n // Field Sensors — live probe monitoring (BOFF-2894)\n {\n id: 'healthybowl-field-sensors',\n label: t('healthybowl.nav.fieldSensors', 'Field Sensors'),\n path: joinPath(basePath, 'field-sensors'),\n icon: <Radio size={20} />,\n order: 12.75,\n group: 'farming',\n },\n\n // Soil Health\n {\n id: 'healthybowl-soil',\n label: t('healthybowl.nav.soilHealth', 'Soil Health'),\n path: joinPath(basePath, 'soil'),\n icon: <FlaskConical size={20} />,\n order: 13,\n group: 'farming',\n },\n\n // Pest Management\n {\n id: 'healthybowl-pest',\n label: t('healthybowl.nav.pestManagement', 'Pest Management'),\n path: joinPath(basePath, 'pest-management'),\n icon: <Bug size={20} />,\n order: 14,\n group: 'farming',\n },\n {\n id: 'healthybowl-pest-ai',\n label: t('healthybowl.nav.aiPestDetection', 'AI Pest Detection'),\n path: joinPath(basePath, 'pest-management/ai-detection'),\n icon: <ScanSearch size={20} />,\n order: 14.5,\n group: 'farming',\n },\n\n // Production\n {\n id: 'healthybowl-production',\n label: t('healthybowl.nav.production', 'Production'),\n path: joinPath(basePath, 'production'),\n icon: <Factory size={20} />,\n order: 20,\n group: 'business',\n },\n\n // Products\n {\n id: 'healthybowl-products',\n label: t('healthybowl.nav.products', 'Products'),\n path: joinPath(basePath, 'products'),\n icon: <Package size={20} />,\n order: 21,\n group: 'business',\n },\n\n // Marketplace\n {\n id: 'healthybowl-marketplace',\n label: t('healthybowl.nav.marketplace', 'Marketplace'),\n path: joinPath(basePath, 'marketplace'),\n icon: <ShoppingCart size={20} />,\n order: 22,\n group: 'business',\n },\n\n // Co-operative / FPO aggregation (BOFF-6023)\n {\n id: 'healthybowl-coop',\n label: t('healthybowl.nav.coop', 'Co-operative'),\n path: joinPath(basePath, 'coop'),\n icon: <Users2 size={20} />,\n order: 22.5,\n group: 'business',\n },\n\n // Financial\n {\n id: 'healthybowl-financial',\n label: t('healthybowl.nav.financial', 'Financial'),\n path: joinPath(basePath, 'financial'),\n icon: <DollarSign size={20} />,\n order: 23,\n group: 'business',\n },\n\n // Financier portfolio (B2B2C bridge)\n {\n id: 'healthybowl-financier',\n label: t('healthybowl.nav.financier', 'Financier'),\n path: joinPath(basePath, 'financier'),\n icon: <Banknote size={20} />,\n order: 24,\n group: 'business',\n },\n\n // Compliance\n {\n id: 'healthybowl-compliance',\n label: t('healthybowl.nav.compliance', 'Compliance'),\n path: joinPath(basePath, 'compliance'),\n icon: <ShieldCheck size={20} />,\n order: 30,\n group: 'compliance',\n },\n\n // Traceability\n {\n id: 'healthybowl-traceability',\n label: t('healthybowl.nav.traceability', 'Traceability'),\n path: joinPath(basePath, 'traceability'),\n icon: <ScanLine size={20} />,\n order: 31,\n group: 'compliance',\n },\n\n // Sustainability — Carbon & Climate (BOFF-2896)\n {\n id: 'healthybowl-sustainability',\n label: t('healthybowl.nav.sustainability', 'Sustainability'),\n path: joinPath(basePath, 'sustainability'),\n icon: <Leaf size={20} />,\n order: 32,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-carbon',\n label: t('healthybowl.nav.sustainabilityCarbon', 'Carbon & GHG'),\n path: joinPath(basePath, 'sustainability/carbon'),\n icon: <Factory size={20} />,\n order: 32.1,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-soil',\n label: t('healthybowl.nav.sustainabilitySoil', 'Soil Carbon'),\n path: joinPath(basePath, 'sustainability/soil-carbon'),\n icon: <Sprout size={20} />,\n order: 32.2,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-credits',\n label: t('healthybowl.nav.sustainabilityCredits', 'Carbon Credits'),\n path: joinPath(basePath, 'sustainability/credits'),\n icon: <Award size={20} />,\n order: 32.3,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-eudr',\n label: t('healthybowl.nav.sustainabilityEudr', 'EUDR Due-Diligence'),\n path: joinPath(basePath, 'sustainability/eudr'),\n icon: <Globe size={20} />,\n order: 32.4,\n group: 'compliance',\n },\n\n // Government Schemes\n {\n id: 'healthybowl-schemes',\n label: t('healthybowl.nav.governmentSchemes', 'Gov. Schemes'),\n path: joinPath(basePath, 'government-schemes'),\n icon: <Landmark size={20} />,\n order: 40,\n group: 'support',\n },\n\n // Network\n {\n id: 'healthybowl-network',\n label: t('healthybowl.nav.network', 'Network'),\n path: joinPath(basePath, 'network'),\n icon: <Users size={20} />,\n order: 41,\n group: 'support',\n },\n\n // Analytics\n {\n id: 'healthybowl-analytics',\n label: t('healthybowl.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 42,\n group: 'support',\n },\n\n // My Advisors (UC-16 — farmer side)\n {\n id: 'healthybowl-advisors',\n label: t('healthybowl.nav.advisors', 'My Advisors'),\n path: joinPath(basePath, 'advisors'),\n icon: <UserCheck size={20} />,\n order: 43,\n group: 'support',\n },\n\n // Consultant portfolio (UC-16 — consultant side)\n {\n id: 'healthybowl-consultant',\n label: t('healthybowl.nav.consultant', 'Consultant'),\n path: joinPath(basePath, 'consultant'),\n icon: <Stethoscope size={20} />,\n order: 44,\n group: 'support',\n },\n ];\n\n // All sections are reachable. Marketplace (UC-08), Network (UC-12) and\n // Traceability (UC-11) render real read data + their real create flows\n // (createMarketplaceProduct / createCommunityPost / createTraceBatch); the\n // few genuinely-unbacked actions (checkout, booking, QR resolution) show\n // honest \"not available yet\" states in-page rather than hiding the section.\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'healthybowl-status',\n label: t('healthybowl.footer.ready', 'HealthyBowl Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <HealthyBowlProvider {...props}>\n {/* Logical CSS utilities flip an icon's *position* under RTL, but not its glyph. Navigational\n arrows/chevrons must also point the other way, so mirror the horizontal ones. Vertical\n chevrons (up/down, e.g. accordions) are unaffected by scaleX. Scoped to [dir=rtl] so it is\n inert in LTR. See BOFF-6119. */}\n <style>{RTL_ICON_MIRROR_CSS}</style>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAsDA,IAAM,IAAc,IAAI,IAAY,CAAC,IAAI,CAAC,GAKpC,IAAsB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACG,KAAK,MAAM,eAAe,GAAG,EAC7B,KAAK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GAAkB,CAAQ,CAAC,GAG/B,QAAgB;EACT,OAaL,OADgB,EAAoB,CATlC;GACE,IAAI;GACJ,OAAO,EAAE,4BAA4B,mBAAmB;GACxD,MAAM;GACN,OAAO;GACP,SAAS;EACX,CAGkC,CAC7B;CACT,GAAG,CAAC,CAAmB,CAAC,GAGtB,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAqB,GAAI;aAAzB,CAKE,kBAAC,SAAD,EAAA,UAAQ,EAA2B,CAAA,GACnC,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,IAAD,EAAA,UACE,kBAAC,IAAD,CAAoB,CAAA,EACD,CAAA,EACN,CAAA,EACJ,CAAA,CACI;;CACF,CAAA;AAEzB"}
|
|
1
|
+
{"version":3,"file":"HealthyBowlRoot.js","names":[],"sources":["../../src/healthybowl/HealthyBowlRoot.tsx"],"sourcesContent":["/**\n * HealthyBowl Root Component\n * @module healthybowl\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Tractor,\n ListChecks,\n Wheat,\n PawPrint,\n Cloud,\n Map as MapIcon,\n ShoppingCart,\n DollarSign,\n BarChart3,\n FlaskConical,\n Bug,\n ScanSearch,\n Factory,\n Package,\n ScanLine,\n ShieldCheck,\n Landmark,\n Banknote,\n Stethoscope,\n UserCheck,\n Users,\n CloudUpload,\n RefreshCw,\n ShieldAlert,\n LineChart,\n Fence,\n Radio,\n Leaf,\n Sprout,\n Award,\n Globe,\n Users2,\n} from 'lucide-react';\nimport { HealthyBowlProvider } from './context/HealthyBowlContext';\nimport { FeatureFlagProvider, useFeatureFlags } from '@burdenoff/fe-libs/shared/feature-flags';\nimport {\n HEALTHYBOWL_CARBON_FEATURE_FLAG,\n HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS,\n isHealthyBowlCarbonEnabled,\n} from './carbonFeatureFlag';\nimport { HealthyBowlRoutes } from './HealthyBowlRoutes';\nimport { ErrorBoundary } from './components/ErrorBoundary';\nimport { ConfirmProvider } from './components/ConfirmDialog';\nimport { OfflineSyncProvider } from './offline/OfflineSyncProvider';\nimport { normalizeBasePath, setHbFormatLocale } from './utils/helpers';\nimport type { HealthyBowlRootProps, NavItem } from './types';\n\n// Locales that render right-to-left. Arabic is the only RTL language in the shell's supported set\n// today; kept as a set so adding Hebrew/Farsi/Urdu later is a one-line change (BOFF-6119).\nconst RTL_LOCALES = new Set<string>(['ar']);\n\n// Horizontal directional lucide icons whose glyph must point the other way under RTL. lucide-react\n// tags every icon with a `lucide-<name>` class; scaleX(-1) mirrors the horizontal ones (vertical\n// chevrons up/down are unchanged by a horizontal flip). Kept off the LTR path via the [dir=rtl] scope.\nconst RTL_ICON_MIRROR_CSS = [\n '.lucide-arrow-right',\n '.lucide-arrow-left',\n '.lucide-chevron-right',\n '.lucide-chevron-left',\n '.lucide-chevrons-right',\n '.lucide-chevrons-left',\n '.lucide-move-right',\n '.lucide-move-left',\n]\n .map((c) => `[dir=\"rtl\"] ${c}`)\n .join(',')\n .concat('{transform:scaleX(-1)}');\n\nconst SUSTAINABILITY_NAV_ITEM_IDS = new Set([\n 'healthybowl-sustainability',\n 'healthybowl-sustainability-carbon',\n 'healthybowl-sustainability-soil',\n 'healthybowl-sustainability-credits',\n 'healthybowl-sustainability-eudr',\n]);\n\nexport function filterHealthyBowlNavItemsForCarbon(navItems: NavItem[], carbonEnabled: boolean): NavItem[] {\n return carbonEnabled ? navItems : navItems.filter((item) => !SUSTAINABILITY_NAV_ITEM_IDS.has(item.id));\n}\n\nconst HealthyBowlRootContent: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { error, getEvaluation, isLoading } = useFeatureFlags();\n const carbonEnabled = isHealthyBowlCarbonEnabled(\n getEvaluation(HEALTHYBOWL_CARBON_FEATURE_FLAG),\n isLoading || error !== null\n );\n const { t: translate, locale } = useI18n();\n\n // HealthyBowl's Intl.* formatters (utils/helpers.ts) are plain functions used\n // across ~490 call sites, so they can't call useI18n() themselves. Sync the\n // shell's active language into their ambient locale here — the product's\n // single I18n consumer that wraps every page — so number / currency / date\n // grouping tracks the chosen language (BOFF-6202). Done during render, not in\n // an effect, so children rendered in this same pass already format with the\n // current locale (no one-frame western-grouping flash on a language switch).\n setHbFormatLocale(locale);\n\n // BOFF-6119 — Arabic (and any future RTL locale) must render right-to-left. HealthyBowl's own\n // components are migrated to logical CSS utilities (physical ml-/pr-/left-/text-left/… → logical\n // ms-/pe-/start-/text-start/…), so setting `dir` makes the whole HB surface mirror correctly.\n const dir: 'rtl' | 'ltr' = RTL_LOCALES.has(locale) ? 'rtl' : 'ltr';\n\n // Set the direction on the document root, not just an in-flow wrapper: HB's overlays\n // (confirm/alert dialogs, dropdowns, tooltips) render through Radix portals attached to\n // document.body, so a subtree wrapper would leave them LTR. The shared fe-libs I18nProvider\n // deliberately leaves document.dir unset (the app shell and other products aren't migrated to\n // logical CSS yet — fleet ticket BOFF-5998), so HB owns it here and restores the previous value\n // on unmount, keeping the effect self-contained to when a HealthyBowl surface is mounted.\n useEffect(() => {\n const el = document.documentElement;\n const previous = el.getAttribute('dir');\n el.setAttribute('dir', dir);\n return () => {\n if (previous === null) el.removeAttribute('dir');\n else el.setAttribute('dir', previous);\n };\n }, [dir]);\n\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const allNavItems: NavItem[] = [\n // Dashboard\n {\n id: 'healthybowl-dashboard',\n label: t('healthybowl.nav.dashboard', 'Dashboard'),\n // The product index IS the dashboard. Normalize a trailing slash like\n // every sibling item (joinPath) so active-state highlighting matches if\n // the host ever passes '/healthybowl/'.\n path: normalizeBasePath(basePath),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n\n // My Farm\n {\n id: 'healthybowl-farm',\n label: t('healthybowl.nav.farm', 'My Farm'),\n path: joinPath(basePath, 'farm'),\n icon: <Tractor size={20} />,\n order: 2,\n group: 'main',\n },\n\n // Farm Tasks (PlanMagnet embed) — shared work-item board across the farm.\n {\n id: 'healthybowl-tasks',\n label: t('healthybowl.nav.tasks', 'Tasks'),\n path: joinPath(basePath, 'tasks'),\n icon: <ListChecks size={20} />,\n order: 3,\n group: 'main',\n },\n\n // Crops\n {\n id: 'healthybowl-crops',\n label: t('healthybowl.nav.crops', 'Crops'),\n path: joinPath(basePath, 'crops'),\n icon: <Wheat size={20} />,\n order: 10,\n group: 'farming',\n },\n\n // Livestock\n {\n id: 'healthybowl-livestock',\n label: t('healthybowl.nav.livestock', 'Livestock'),\n path: joinPath(basePath, 'livestock'),\n icon: <PawPrint size={20} />,\n order: 11,\n group: 'farming',\n },\n\n // Livestock — Analytics (BOFF-6126). The growth, feed and herd-stats charts (BOFF-5971) also\n // render inline on the livestock dashboard; this gives them a dedicated URL and full-width home.\n {\n id: 'healthybowl-livestock-analytics',\n label: t('healthybowl.nav.livestockAnalytics', 'Livestock Analytics'),\n path: joinPath(basePath, 'livestock/analytics'),\n icon: <LineChart size={20} />,\n order: 11.3,\n group: 'farming',\n },\n\n // Livestock — Grazing management (BOFF-5970). Sits next to Livestock rather than inside it\n // because rotational grazing is a daily decision about FIELDS, not a herd-record lookup.\n {\n id: 'healthybowl-grazing',\n label: t('healthybowl.nav.grazing', 'Grazing'),\n path: joinPath(basePath, 'livestock/grazing'),\n icon: <Fence size={20} />,\n order: 11.4,\n group: 'farming',\n },\n\n // Livestock — Medication Withdrawal Alerts (BOFF-2885)\n {\n id: 'healthybowl-withdrawal-alerts',\n label: t('healthybowl.nav.withdrawalAlerts', 'Withdrawal Alerts'),\n path: joinPath(basePath, 'livestock/withdrawal-alerts'),\n icon: <ShieldAlert size={20} />,\n order: 11.5,\n group: 'farming',\n },\n\n // Weather\n {\n id: 'healthybowl-weather',\n label: t('healthybowl.nav.weather', 'Weather'),\n path: joinPath(basePath, 'weather'),\n icon: <Cloud size={20} />,\n order: 12,\n group: 'farming',\n },\n\n // Field Map — draw & manage field boundaries on satellite imagery\n {\n id: 'healthybowl-field-map',\n label: t('healthybowl.nav.fieldMap', 'Field Map'),\n path: joinPath(basePath, 'field-map'),\n icon: <MapIcon size={20} />,\n order: 12.5,\n group: 'farming',\n },\n\n // Field Capture — offline-first observation capture (BOFF-2883)\n {\n id: 'healthybowl-field-capture',\n label: t('healthybowl.nav.fieldCapture', 'Field Capture'),\n path: joinPath(basePath, 'field-capture'),\n icon: <CloudUpload size={20} />,\n order: 12.6,\n group: 'farming',\n },\n\n // Pending Sync — the offline outbox / sync queue (BOFF-2883)\n {\n id: 'healthybowl-pending-sync',\n label: t('healthybowl.nav.pendingSync', 'Pending Sync'),\n path: joinPath(basePath, 'field-capture/pending'),\n icon: <RefreshCw size={20} />,\n order: 12.7,\n group: 'farming',\n },\n\n // Field Sensors — live probe monitoring (BOFF-2894)\n {\n id: 'healthybowl-field-sensors',\n label: t('healthybowl.nav.fieldSensors', 'Field Sensors'),\n path: joinPath(basePath, 'field-sensors'),\n icon: <Radio size={20} />,\n order: 12.75,\n group: 'farming',\n },\n\n // Soil Health\n {\n id: 'healthybowl-soil',\n label: t('healthybowl.nav.soilHealth', 'Soil Health'),\n path: joinPath(basePath, 'soil'),\n icon: <FlaskConical size={20} />,\n order: 13,\n group: 'farming',\n },\n\n // Pest Management\n {\n id: 'healthybowl-pest',\n label: t('healthybowl.nav.pestManagement', 'Pest Management'),\n path: joinPath(basePath, 'pest-management'),\n icon: <Bug size={20} />,\n order: 14,\n group: 'farming',\n },\n {\n id: 'healthybowl-pest-ai',\n label: t('healthybowl.nav.aiPestDetection', 'AI Pest Detection'),\n path: joinPath(basePath, 'pest-management/ai-detection'),\n icon: <ScanSearch size={20} />,\n order: 14.5,\n group: 'farming',\n },\n\n // Production\n {\n id: 'healthybowl-production',\n label: t('healthybowl.nav.production', 'Production'),\n path: joinPath(basePath, 'production'),\n icon: <Factory size={20} />,\n order: 20,\n group: 'business',\n },\n\n // Products\n {\n id: 'healthybowl-products',\n label: t('healthybowl.nav.products', 'Products'),\n path: joinPath(basePath, 'products'),\n icon: <Package size={20} />,\n order: 21,\n group: 'business',\n },\n\n // Marketplace\n {\n id: 'healthybowl-marketplace',\n label: t('healthybowl.nav.marketplace', 'Marketplace'),\n path: joinPath(basePath, 'marketplace'),\n icon: <ShoppingCart size={20} />,\n order: 22,\n group: 'business',\n },\n\n // Co-operative / FPO aggregation (BOFF-6023)\n {\n id: 'healthybowl-coop',\n label: t('healthybowl.nav.coop', 'Co-operative'),\n path: joinPath(basePath, 'coop'),\n icon: <Users2 size={20} />,\n order: 22.5,\n group: 'business',\n },\n\n // Financial\n {\n id: 'healthybowl-financial',\n label: t('healthybowl.nav.financial', 'Financial'),\n path: joinPath(basePath, 'financial'),\n icon: <DollarSign size={20} />,\n order: 23,\n group: 'business',\n },\n\n // Financier portfolio (B2B2C bridge)\n {\n id: 'healthybowl-financier',\n label: t('healthybowl.nav.financier', 'Financier'),\n path: joinPath(basePath, 'financier'),\n icon: <Banknote size={20} />,\n order: 24,\n group: 'business',\n },\n\n // Compliance\n {\n id: 'healthybowl-compliance',\n label: t('healthybowl.nav.compliance', 'Compliance'),\n path: joinPath(basePath, 'compliance'),\n icon: <ShieldCheck size={20} />,\n order: 30,\n group: 'compliance',\n },\n\n // Traceability\n {\n id: 'healthybowl-traceability',\n label: t('healthybowl.nav.traceability', 'Traceability'),\n path: joinPath(basePath, 'traceability'),\n icon: <ScanLine size={20} />,\n order: 31,\n group: 'compliance',\n },\n\n // Sustainability — Carbon & Climate (BOFF-2896)\n {\n id: 'healthybowl-sustainability',\n label: t('healthybowl.nav.sustainability', 'Sustainability'),\n path: joinPath(basePath, 'sustainability'),\n icon: <Leaf size={20} />,\n order: 32,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-carbon',\n label: t('healthybowl.nav.sustainabilityCarbon', 'Carbon & GHG'),\n path: joinPath(basePath, 'sustainability/carbon'),\n icon: <Factory size={20} />,\n order: 32.1,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-soil',\n label: t('healthybowl.nav.sustainabilitySoil', 'Soil Carbon'),\n path: joinPath(basePath, 'sustainability/soil-carbon'),\n icon: <Sprout size={20} />,\n order: 32.2,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-credits',\n label: t('healthybowl.nav.sustainabilityCredits', 'Carbon Credits'),\n path: joinPath(basePath, 'sustainability/credits'),\n icon: <Award size={20} />,\n order: 32.3,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-eudr',\n label: t('healthybowl.nav.sustainabilityEudr', 'EUDR Due-Diligence'),\n path: joinPath(basePath, 'sustainability/eudr'),\n icon: <Globe size={20} />,\n order: 32.4,\n group: 'compliance',\n },\n\n // Government Schemes\n {\n id: 'healthybowl-schemes',\n label: t('healthybowl.nav.governmentSchemes', 'Gov. Schemes'),\n path: joinPath(basePath, 'government-schemes'),\n icon: <Landmark size={20} />,\n order: 40,\n group: 'support',\n },\n\n // Network\n {\n id: 'healthybowl-network',\n label: t('healthybowl.nav.network', 'Network'),\n path: joinPath(basePath, 'network'),\n icon: <Users size={20} />,\n order: 41,\n group: 'support',\n },\n\n // Analytics\n {\n id: 'healthybowl-analytics',\n label: t('healthybowl.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 42,\n group: 'support',\n },\n\n // My Advisors (UC-16 — farmer side)\n {\n id: 'healthybowl-advisors',\n label: t('healthybowl.nav.advisors', 'My Advisors'),\n path: joinPath(basePath, 'advisors'),\n icon: <UserCheck size={20} />,\n order: 43,\n group: 'support',\n },\n\n // Consultant portfolio (UC-16 — consultant side)\n {\n id: 'healthybowl-consultant',\n label: t('healthybowl.nav.consultant', 'Consultant'),\n path: joinPath(basePath, 'consultant'),\n icon: <Stethoscope size={20} />,\n order: 44,\n group: 'support',\n },\n ];\n\n // All sections are reachable. Marketplace (UC-08), Network (UC-12) and\n // Traceability (UC-11) render real read data + their real create flows\n // (createMarketplaceProduct / createCommunityPost / createTraceBatch); the\n // few genuinely-unbacked actions (checkout, booking, QR resolution) show\n // honest \"not available yet\" states in-page rather than hiding the section.\n // The operational carbon kill switch hides only Sustainability items;\n // Compliance and Traceability remain available.\n const navItems = filterHealthyBowlNavItemsForCarbon(allNavItems, carbonEnabled);\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, carbonEnabled, t]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'healthybowl-status',\n label: t('healthybowl.footer.ready', 'HealthyBowl Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, t]);\n\n return (\n <HealthyBowlProvider {...props}>\n {/* Logical CSS utilities flip an icon's *position* under RTL, but not its glyph. Navigational\n arrows/chevrons must also point the other way, so mirror the horizontal ones. Vertical\n chevrons (up/down, e.g. accordions) are unaffected by scaleX. Scoped to [dir=rtl] so it is\n inert in LTR. See BOFF-6119. */}\n <style>{RTL_ICON_MIRROR_CSS}</style>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n );\n};\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => (\n <FeatureFlagProvider\n key={props.workspaceId ?? 'no-workspace'}\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n flagKeys={HEALTHYBO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