@burdenoff/microfe-healthybowl 2026.1007.1 → 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.
@@ -4,16 +4,17 @@ import { useBasePath as i } from "../hooks/useBasePath.js";
4
4
  import { StatusBadge as a } from "../components/StatusBadge.js";
5
5
  import { EmptyState as o } from "../components/EmptyState.js";
6
6
  import { ErrorState as s } from "../components/ErrorState.js";
7
- import { PageLoader as c } from "../components/PageLoader.js";
7
+ import { PageLoader as ee } from "../components/PageLoader.js";
8
8
  import "../components/index.js";
9
- import { useHealthyBowlData as l } from "../hooks/useHealthyBowlData.js";
10
- import { useHealthyBowlQuota as ee } from "../hooks/useHealthyBowlQuota.js";
11
- import { hasWeatherObservation as te } from "../utils/weatherPresence.js";
12
- import { useCallback as u, useMemo as d } from "react";
13
- import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
- import { AlertTriangle as p, ArrowUpRight as m, BarChart3 as ne, CalendarClock as re, CheckCircle2 as h, ChevronRight as g, ClipboardList as _, Cloud as ie, CloudOff as ae, Droplets as oe, Eye as v, MapPin as y, PawPrint as b, Plus as x, ShieldCheck as S, Sprout as C, Thermometer as w, Wallet as T, Wind as se } from "lucide-react";
15
- import { useNavigate as ce } from "react-router";
16
- import { Fragment as le, jsx as E, jsxs as D } from "react/jsx-runtime";
9
+ import { useHealthyBowlData as te } from "../hooks/useHealthyBowlData.js";
10
+ import { useHealthyBowlQuota as c } from "../hooks/useHealthyBowlQuota.js";
11
+ import { quotaLabelKey as ne } from "../utils/quotaLabels.js";
12
+ import { hasWeatherObservation as re } from "../utils/weatherPresence.js";
13
+ import { useCallback as l, useMemo as u } from "react";
14
+ import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { AlertTriangle as f, ArrowUpRight as p, BarChart3 as ie, CalendarClock as m, CheckCircle2 as h, ChevronRight as g, ClipboardList as _, Cloud as v, CloudOff as y, Droplets as ae, Eye as oe, MapPin as b, PawPrint as x, Plus as S, ShieldCheck as se, Sprout as C, Thermometer as w, Wallet as T, Wind as ce } from "lucide-react";
16
+ import { useNavigate as le } from "react-router";
17
+ import { Fragment as ue, jsx as E, jsxs as D } from "react/jsx-runtime";
17
18
  import { EmphasisPanel as O, GlassCard as k } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/healthybowl/pages/HomePage.tsx
19
20
  var A = {
@@ -66,7 +67,7 @@ var A = {
66
67
  }),
67
68
  /* @__PURE__ */ D("span", {
68
69
  className: "mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary",
69
- children: [o, /* @__PURE__ */ E(m, { className: "size-3.5" })]
70
+ children: [o, /* @__PURE__ */ E(p, { className: "size-3.5" })]
70
71
  })
71
72
  ]
72
73
  })
@@ -174,62 +175,62 @@ var A = {
174
175
  })
175
176
  ]
176
177
  }) }), B = () => {
177
- let { dashboardStats: a, alerts: m, crops: g, weatherData: A, markAlertRead: j, farm: N, loadings: P, errors: F, refetch: B } = l(), V = ce(), { t: H } = f(), U = u((e, t, n) => H(e, t, n), [H]), { buildPath: W } = i(), { quotas: G, loading: ue } = ee(), K = a, q = {
178
+ let { dashboardStats: a, alerts: p, crops: g, weatherData: A, markAlertRead: j, farm: N, loadings: P, errors: F, refetch: B } = te(), V = le(), { t: H, locale: U } = d(), W = l((e, t, n) => H(e, t, n), [H]), { buildPath: G } = i(), { quotas: K, loading: de } = c(), q = a, J = {
178
179
  location: A?.location ?? "",
179
180
  current: A?.current,
180
181
  forecast: A?.forecast ?? []
181
- }, J = te(q.current), Y = d(() => (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, {
182
+ }, fe = re(J.current), Y = u(() => (/* @__PURE__ */ new Date()).toLocaleDateString(U, {
182
183
  weekday: "long",
183
184
  day: "numeric",
184
185
  month: "long"
185
- }), []), X = d(() => [...m].sort((e, t) => M[e.severity] - M[t.severity]), [m]), de = X.slice(0, 5), Z = m.length, fe = d(() => [...g].sort((e, t) => (e.daysToHarvest ?? 2 ** 53 - 1) - (t.daysToHarvest ?? 2 ** 53 - 1)), [g]).slice(0, 6), Q = d(() => K.totalRevenue === 0 ? null : Math.round(K.totalExpenses / K.totalRevenue * 100 * 10) / 10, [K.totalExpenses, K.totalRevenue]), pe = u((e) => {
186
+ }), [U]), X = u(() => [...p].sort((e, t) => M[e.severity] - M[t.severity]), [p]), pe = X.slice(0, 5), Z = p.length, me = u(() => [...g].sort((e, t) => (e.daysToHarvest ?? 2 ** 53 - 1) - (t.daysToHarvest ?? 2 ** 53 - 1)), [g]).slice(0, 6), Q = u(() => q.totalRevenue === 0 ? null : Math.round(q.totalExpenses / q.totalRevenue * 100 * 10) / 10, [q.totalExpenses, q.totalRevenue]), he = l((e) => {
186
187
  let t = new Date(e).getTime();
187
188
  if (Number.isNaN(t)) return "";
188
189
  let n = Math.max(0, Math.floor((Date.now() - t) / 6e4));
189
- if (n < 1) return U("healthybowl.home.time.now", "just now");
190
- if (n < 60) return U("healthybowl.home.time.minutes", "{{n}}m ago", { n });
190
+ if (n < 1) return W("healthybowl.home.time.now", "just now");
191
+ if (n < 60) return W("healthybowl.home.time.minutes", "{{n}}m ago", { n });
191
192
  let r = Math.floor(n / 60);
192
- if (r < 24) return U("healthybowl.home.time.hours", "{{n}}h ago", { n: r });
193
+ if (r < 24) return W("healthybowl.home.time.hours", "{{n}}h ago", { n: r });
193
194
  let i = Math.floor(r / 24);
194
- return i < 7 ? U("healthybowl.home.time.days", "{{n}}d ago", { n: i }) : U("healthybowl.home.time.weeks", "{{n}}w ago", { n: Math.floor(i / 7) });
195
- }, [U]), me = u((e) => e === "critical" ? U("healthybowl.home.needsAttention.review", "Review") : e === "warning" ? U("healthybowl.home.needsAttention.open", "Open") : U("healthybowl.home.needsAttention.view", "View"), [U]), he = u((e) => {
195
+ return i < 7 ? W("healthybowl.home.time.days", "{{n}}d ago", { n: i }) : W("healthybowl.home.time.weeks", "{{n}}w ago", { n: Math.floor(i / 7) });
196
+ }, [W]), ge = l((e) => e === "critical" ? W("healthybowl.home.needsAttention.review", "Review") : e === "warning" ? W("healthybowl.home.needsAttention.open", "Open") : W("healthybowl.home.needsAttention.view", "View"), [W]), _e = l((e) => {
196
197
  j(e.id, !0), e.actionUrl && V(e.actionUrl);
197
- }, [j, V]), ge = K.netProfit > 0 ? "success" : K.netProfit < 0 ? "danger" : "neutral", _e = m.some((e) => e.severity === "critical"), ve = m.some((e) => e.severity === "warning"), $ = Z === 0 ? "success" : _e ? "danger" : ve ? "warning" : "neutral", ye = [
198
+ }, [j, V]), ve = q.netProfit > 0 ? "success" : q.netProfit < 0 ? "danger" : "neutral", ye = p.some((e) => e.severity === "critical"), be = p.some((e) => e.severity === "warning"), $ = Z === 0 ? "success" : ye ? "danger" : be ? "warning" : "neutral", xe = [
198
199
  {
199
- label: U("healthybowl.home.quickActions.addCrop.label", "Add crop"),
200
+ label: W("healthybowl.home.quickActions.addCrop.label", "Add crop"),
200
201
  icon: C,
201
- path: W("crops")
202
+ path: G("crops")
202
203
  },
203
204
  {
204
- label: U("healthybowl.home.quickActions.recordHarvest.label", "Record harvest"),
205
+ label: W("healthybowl.home.quickActions.recordHarvest.label", "Record harvest"),
205
206
  icon: _,
206
- path: W("crops/harvest")
207
+ path: G("crops/harvest")
207
208
  },
208
209
  {
209
- label: U("healthybowl.home.quickActions.viewFields.label", "View fields"),
210
- icon: y,
211
- path: W("crops/fields")
210
+ label: W("healthybowl.home.quickActions.viewFields.label", "View fields"),
211
+ icon: b,
212
+ path: G("crops/fields")
212
213
  },
213
214
  {
214
- label: U("healthybowl.home.quickActions.viewWeather.label", "View weather"),
215
+ label: W("healthybowl.home.quickActions.viewWeather.label", "View weather"),
215
216
  icon: w,
216
- path: W("weather")
217
+ path: G("weather")
217
218
  },
218
219
  {
219
- label: U("healthybowl.home.quickActions.analytics.label", "Analytics"),
220
- icon: ne,
221
- path: W("analytics")
220
+ label: W("healthybowl.home.quickActions.analytics.label", "Analytics"),
221
+ icon: ie,
222
+ path: G("analytics")
222
223
  }
223
- ], be = Z === 0 ? U("healthybowl.home.header.allClear", "You're all caught up") : Z === 1 ? U("healthybowl.home.header.needsAttentionOne", "1 item needs your attention") : U("healthybowl.home.header.needsAttentionOther", "{{count}} items need your attention", { count: Z }), xe = N?.name ? `${Y} · ${N.name}` : Y, Se = /* @__PURE__ */ D("button", {
224
+ ], Se = Z === 0 ? W("healthybowl.home.header.allClear", "You're all caught up") : Z === 1 ? W("healthybowl.home.header.needsAttentionOne", "1 item needs your attention") : W("healthybowl.home.header.needsAttentionOther", "{{count}} items need your attention", { count: Z }), Ce = N?.name ? `${Y} · ${N.name}` : Y, we = /* @__PURE__ */ D("button", {
224
225
  type: "button",
225
- onClick: () => V(W("crops")),
226
+ onClick: () => V(G("crops")),
226
227
  className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
227
- children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.primaryAction", "Add")]
228
+ children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.primaryAction", "Add")]
228
229
  });
229
230
  return /* @__PURE__ */ D(r, {
230
- title: U("healthybowl.home.title", "Farm Dashboard"),
231
- description: xe,
232
- actions: Se,
231
+ title: W("healthybowl.home.title", "Farm Dashboard"),
232
+ description: Ce,
233
+ actions: we,
233
234
  children: [/* @__PURE__ */ D("section", {
234
235
  "aria-labelledby": "healthy-bowl-quota-heading",
235
236
  className: "mb-6 rounded-xl border border-border-seam bg-bg-surface p-5",
@@ -238,22 +239,22 @@ var A = {
238
239
  children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
239
240
  id: "healthy-bowl-quota-heading",
240
241
  className: "text-base font-semibold text-text-primary",
241
- children: U("healthybowl.home.quotas.title", "Plan usage")
242
+ children: W("healthybowl.home.quotas.title", "Plan usage")
242
243
  }), /* @__PURE__ */ E("p", {
243
244
  className: "text-sm text-text-secondary",
244
- children: U("healthybowl.home.quotas.description", "See what your farm plan has used and what remains.")
245
+ children: W("healthybowl.home.quotas.description", "See what your farm plan has used and what remains.")
245
246
  })] }), /* @__PURE__ */ E("button", {
246
247
  type: "button",
247
248
  onClick: () => V("/billing"),
248
249
  className: "text-sm font-medium text-action-primary-text hover:underline",
249
- children: U("healthybowl.home.quotas.billing", "Manage plan")
250
+ children: W("healthybowl.home.quotas.billing", "Manage plan")
250
251
  })]
251
- }), ue && G.length === 0 ? /* @__PURE__ */ E("p", {
252
+ }), de && K.length === 0 ? /* @__PURE__ */ E("p", {
252
253
  className: "text-sm text-text-secondary",
253
- children: U("healthybowl.common.loading", "Loading…")
254
+ children: W("healthybowl.common.loading", "Loading…")
254
255
  }) : /* @__PURE__ */ E("div", {
255
256
  className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-5",
256
- children: G.map((e) => {
257
+ children: K.map((e) => {
257
258
  let t = e.noLimit || e.limit === null || e.limit === 0 ? 0 : Math.min(100, Math.round(e.used / e.limit * 100));
258
259
  return /* @__PURE__ */ D("div", {
259
260
  className: "rounded-lg border border-border-seam bg-bg-canvas p-3",
@@ -262,13 +263,13 @@ var A = {
262
263
  className: "flex items-start justify-between gap-2",
263
264
  children: [/* @__PURE__ */ E("span", {
264
265
  className: "text-sm font-medium text-text-primary",
265
- children: e.label
266
+ children: W(ne(e.quotaName), e.label)
266
267
  }), e.noLimit ? /* @__PURE__ */ E("span", {
267
268
  className: "text-xs text-text-secondary",
268
- children: U("healthybowl.home.quotas.unlimited", "Unlimited")
269
+ children: W("healthybowl.home.quotas.unlimited", "Unlimited")
269
270
  }) : e.provisioned ? null : /* @__PURE__ */ E("span", {
270
271
  className: "text-xs text-status-warning-text",
271
- children: U("healthybowl.home.quotas.unknown", "Not available")
272
+ children: W("healthybowl.home.quotas.unknown", "Not available")
272
273
  })]
273
274
  }),
274
275
  /* @__PURE__ */ D("p", {
@@ -284,37 +285,37 @@ var A = {
284
285
  }),
285
286
  /* @__PURE__ */ E("p", {
286
287
  className: `mt-1 text-xs ${e.exhausted ? "text-status-error-text" : e.provisioned ? "text-text-secondary" : "text-status-warning-text"}`,
287
- children: e.exhausted ? U("healthybowl.home.quotas.exhausted", "Limit reached") : e.provisioned ? e.remaining === null ? U("healthybowl.home.quotas.noLimitRemaining", "No limit") : U("healthybowl.home.quotas.remaining", "{{count}} remaining", { count: e.remaining }) : U("healthybowl.home.quotas.notProvisioned", "No plan limit found for this workspace — creating may be refused.")
288
+ children: e.exhausted ? W("healthybowl.home.quotas.exhausted", "Limit reached") : e.provisioned ? e.remaining === null ? W("healthybowl.home.quotas.noLimitRemaining", "No limit") : W("healthybowl.home.quotas.remaining", "{{count}} remaining", { count: e.remaining }) : W("healthybowl.home.quotas.notProvisioned", "No plan limit found for this workspace — creating may be refused.")
288
289
  })
289
290
  ]
290
291
  }, e.quotaName);
291
292
  })
292
293
  })]
293
- }), P.dashboard ? /* @__PURE__ */ E(c, {}) : F.dashboard ? /* @__PURE__ */ E(s, { onRetry: B }) : /* @__PURE__ */ D("div", {
294
+ }), P.dashboard ? /* @__PURE__ */ E(ee, {}) : F.dashboard ? /* @__PURE__ */ E(s, { onRetry: B }) : /* @__PURE__ */ D("div", {
294
295
  className: "space-y-6",
295
296
  children: [
296
297
  /* @__PURE__ */ D("div", {
297
298
  className: e("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium", Z === 0 ? "bg-status-success-bg text-status-success-text" : "bg-status-warning-bg text-status-warning-text"),
298
- children: [E(Z === 0 ? h : p, { className: "size-4" }), be]
299
+ children: [E(Z === 0 ? h : f, { className: "size-4" }), Se]
299
300
  }),
300
301
  !N?.id && /* @__PURE__ */ D(O, {
301
302
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
302
303
  children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
303
304
  className: "text-base font-semibold text-text-primary",
304
- children: U("healthybowl.home.onboarding.title", "Welcome to HealthyBowl")
305
+ children: W("healthybowl.home.onboarding.title", "Welcome to HealthyBowl")
305
306
  }), /* @__PURE__ */ E("p", {
306
307
  className: "text-sm text-text-secondary",
307
- children: U("healthybowl.home.onboarding.description", "Set up your farm to start tracking crops, livestock, finances, and more.")
308
+ children: W("healthybowl.home.onboarding.description", "Set up your farm to start tracking crops, livestock, finances, and more.")
308
309
  })] }), /* @__PURE__ */ D("button", {
309
310
  type: "button",
310
- onClick: () => V(W("getting-started")),
311
+ onClick: () => V(G("getting-started")),
311
312
  className: "inline-flex min-h-[44px] items-center gap-2 self-start rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas sm:self-auto",
312
- children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.onboarding.action", "Set up your farm")]
313
+ children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.onboarding.action", "Set up your farm")]
313
314
  })]
314
315
  }),
315
316
  /* @__PURE__ */ E("div", {
316
317
  className: "flex flex-wrap gap-2",
317
- children: ye.map(({ label: e, icon: t, path: n }) => /* @__PURE__ */ D("button", {
318
+ children: xe.map(({ label: e, icon: t, path: n }) => /* @__PURE__ */ D("button", {
318
319
  type: "button",
319
320
  onClick: () => V(n),
320
321
  className: "inline-flex min-h-[40px] items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3.5 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
@@ -327,35 +328,35 @@ var A = {
327
328
  className: "grid grid-cols-2 gap-4 lg:col-span-2",
328
329
  children: [
329
330
  /* @__PURE__ */ E(I, {
330
- label: U("healthybowl.home.kpi.activeCrops", "Active crops"),
331
- value: String(K.activeCrops),
331
+ label: W("healthybowl.home.kpi.activeCrops", "Active crops"),
332
+ value: String(q.activeCrops),
332
333
  icon: /* @__PURE__ */ E(C, {}),
333
- drillLabel: U("healthybowl.home.kpi.viewCrops", "View crops"),
334
- onClick: () => V(W("crops"))
334
+ drillLabel: W("healthybowl.home.kpi.viewCrops", "View crops"),
335
+ onClick: () => V(G("crops"))
335
336
  }),
336
337
  /* @__PURE__ */ E(I, {
337
- label: U("healthybowl.home.kpi.harvestDue", "Harvest due"),
338
- value: String(K.harvestDue),
339
- icon: /* @__PURE__ */ E(re, {}),
340
- drillLabel: U("healthybowl.home.kpi.viewHarvest", "View harvest"),
341
- onClick: () => V(W("crops/harvest"))
338
+ label: W("healthybowl.home.kpi.harvestDue", "Harvest due"),
339
+ value: String(q.harvestDue),
340
+ icon: /* @__PURE__ */ E(m, {}),
341
+ drillLabel: W("healthybowl.home.kpi.viewHarvest", "View harvest"),
342
+ onClick: () => V(G("crops/harvest"))
342
343
  }),
343
344
  /* @__PURE__ */ E(I, {
344
- label: U("healthybowl.home.kpi.netProfit", "Net profit"),
345
- value: t(K.netProfit, "INR"),
345
+ label: W("healthybowl.home.kpi.netProfit", "Net profit"),
346
+ value: t(q.netProfit, "INR"),
346
347
  icon: /* @__PURE__ */ E(T, {}),
347
- tone: ge,
348
- drillLabel: U("healthybowl.home.kpi.viewFinance", "View finances"),
349
- onClick: () => V(W("financial"))
348
+ tone: ve,
349
+ drillLabel: W("healthybowl.home.kpi.viewFinance", "View finances"),
350
+ onClick: () => V(G("financial"))
350
351
  }),
351
352
  /* @__PURE__ */ E(I, {
352
- label: U("healthybowl.home.kpi.needsAttention", "Needs attention"),
353
+ label: W("healthybowl.home.kpi.needsAttention", "Needs attention"),
353
354
  value: String(Z),
354
- icon: /* @__PURE__ */ E(p, {}),
355
+ icon: /* @__PURE__ */ E(f, {}),
355
356
  tone: $,
356
357
  glow: $ === "danger" || $ === "warning",
357
- drillLabel: U("healthybowl.home.kpi.viewAlerts", "View alerts"),
358
- onClick: () => V(W("weather/alerts"))
358
+ drillLabel: W("healthybowl.home.kpi.viewAlerts", "View alerts"),
359
+ onClick: () => V(G("weather/alerts"))
359
360
  })
360
361
  ]
361
362
  }), /* @__PURE__ */ D(k, {
@@ -364,32 +365,32 @@ var A = {
364
365
  className: "flex items-center justify-between px-4 pb-1 pt-4",
365
366
  children: [/* @__PURE__ */ E("h3", {
366
367
  className: "text-sm font-semibold text-text-primary",
367
- children: U("healthybowl.home.needsAttention.title", "Needs attention")
368
+ children: W("healthybowl.home.needsAttention.title", "Needs attention")
368
369
  }), X.length > 0 && /* @__PURE__ */ E("button", {
369
370
  type: "button",
370
- onClick: () => V(W("weather/alerts")),
371
+ onClick: () => V(G("weather/alerts")),
371
372
  className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
372
- children: U("healthybowl.home.needsAttention.viewAll", "View all")
373
+ children: W("healthybowl.home.needsAttention.viewAll", "View all")
373
374
  })]
374
375
  }), /* @__PURE__ */ E("div", {
375
376
  className: "flex-1 px-4 pb-4",
376
377
  children: X.length === 0 ? /* @__PURE__ */ E(o, {
377
378
  icon: /* @__PURE__ */ E(h, { className: "h-8 w-8 text-status-success-text" }),
378
- title: U("healthybowl.home.needsAttention.empty.title", "You're all caught up"),
379
- description: U("healthybowl.home.needsAttention.empty.description", "No urgent farm alerts right now."),
379
+ title: W("healthybowl.home.needsAttention.empty.title", "You're all caught up"),
380
+ description: W("healthybowl.home.needsAttention.empty.description", "No urgent farm alerts right now."),
380
381
  action: /* @__PURE__ */ E("button", {
381
382
  type: "button",
382
- onClick: () => V(W("weather/alert-rules")),
383
+ onClick: () => V(G("weather/alert-rules")),
383
384
  className: "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
384
- children: U("healthybowl.home.needsAttention.empty.action", "Manage alert rules")
385
+ children: W("healthybowl.home.needsAttention.empty.action", "Manage alert rules")
385
386
  })
386
387
  }) : /* @__PURE__ */ E("ul", {
387
388
  className: "divide-y divide-border-subtle",
388
- children: de.map((e) => /* @__PURE__ */ E(R, {
389
+ children: pe.map((e) => /* @__PURE__ */ E(R, {
389
390
  alert: e,
390
- ctaLabel: me(e.severity),
391
- relTime: pe(e.timestamp),
392
- onOpen: () => he(e)
391
+ ctaLabel: ge(e.severity),
392
+ relTime: he(e.timestamp),
393
+ onOpen: () => _e(e)
393
394
  }, e.id))
394
395
  })
395
396
  })]
@@ -409,40 +410,40 @@ var A = {
409
410
  children: /* @__PURE__ */ E(C, {})
410
411
  }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("h2", {
411
412
  className: "text-base font-semibold text-text-primary",
412
- children: U("healthybowl.home.cropsAnchor.title", "Crop overview")
413
+ children: W("healthybowl.home.cropsAnchor.title", "Crop overview")
413
414
  }), /* @__PURE__ */ E("p", {
414
415
  className: "text-xs text-text-secondary",
415
- children: g.length === 1 ? U("healthybowl.home.cropsAnchor.subtitleOne", "1 crop in progress") : U("healthybowl.home.cropsAnchor.subtitleOther", "{{count}} crops in progress", { count: g.length })
416
+ children: g.length === 1 ? W("healthybowl.home.cropsAnchor.subtitleOne", "1 crop in progress") : W("healthybowl.home.cropsAnchor.subtitleOther", "{{count}} crops in progress", { count: g.length })
416
417
  })] })]
417
418
  }), g.length > 0 && /* @__PURE__ */ E("button", {
418
419
  type: "button",
419
- onClick: () => V(W("crops")),
420
+ onClick: () => V(G("crops")),
420
421
  className: "text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none",
421
- children: U("healthybowl.home.cropsAnchor.viewAll", "View all crops")
422
+ children: W("healthybowl.home.cropsAnchor.viewAll", "View all crops")
422
423
  })]
423
424
  }), /* @__PURE__ */ E("div", {
424
425
  className: "flex-1 px-3 pb-3",
425
426
  children: g.length === 0 ? /* @__PURE__ */ E(o, {
426
427
  icon: /* @__PURE__ */ E(C, { className: "h-8 w-8 text-primary" }),
427
- title: U("healthybowl.home.cropsAnchor.empty.title", "No active crops"),
428
- description: U("healthybowl.home.cropsAnchor.empty.description", "Register your first crop to track growth, health and harvest here."),
428
+ title: W("healthybowl.home.cropsAnchor.empty.title", "No active crops"),
429
+ description: W("healthybowl.home.cropsAnchor.empty.description", "Register your first crop to track growth, health and harvest here."),
429
430
  action: /* @__PURE__ */ D("button", {
430
431
  type: "button",
431
- onClick: () => V(W("crops")),
432
+ onClick: () => V(G("crops")),
432
433
  className: "inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
433
- children: [/* @__PURE__ */ E(x, { className: "h-4 w-4" }), U("healthybowl.home.quickActions.addCrop.label", "Add crop")]
434
+ children: [/* @__PURE__ */ E(S, { className: "h-4 w-4" }), W("healthybowl.home.quickActions.addCrop.label", "Add crop")]
434
435
  })
435
436
  }) : /* @__PURE__ */ E("ul", {
436
437
  className: "divide-y divide-border-subtle",
437
- children: fe.map((e) => {
438
+ children: me.map((e) => {
438
439
  let t = (e.growthStage || e.status || "").replace(/_/g, " ").trim();
439
440
  return /* @__PURE__ */ E(z, {
440
441
  crop: e,
441
- metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") || U("healthybowl.home.cropsAnchor.noField", "Unassigned"),
442
+ metaLabel: [e.fieldName, t].filter(Boolean).join(" · ") || W("healthybowl.home.cropsAnchor.noField", "Unassigned"),
442
443
  healthLabel: (e.healthStatus || "unknown").replace(/_/g, " "),
443
- harvestLabel: e.expectedHarvestDate ? U("healthybowl.home.cropsAnchor.harvest", "Harvest {{date}}", { date: n(e.expectedHarvestDate) }) : U("healthybowl.home.cropsAnchor.harvestUnknown", "Harvest date TBD"),
444
- openLabel: U("healthybowl.home.cropsAnchor.open", "Open"),
445
- onOpen: () => V(W(`crops/${e.id}`))
444
+ harvestLabel: e.expectedHarvestDate ? W("healthybowl.home.cropsAnchor.harvest", "Harvest {{date}}", { date: n(e.expectedHarvestDate) }) : W("healthybowl.home.cropsAnchor.harvestUnknown", "Harvest date TBD"),
445
+ openLabel: W("healthybowl.home.cropsAnchor.open", "Open"),
446
+ onOpen: () => V(G(`crops/${e.id}`))
446
447
  }, e.id);
447
448
  })
448
449
  })
@@ -453,39 +454,39 @@ var A = {
453
454
  className: "px-4 pb-1 pt-4",
454
455
  children: [/* @__PURE__ */ E("h3", {
455
456
  className: "text-sm font-semibold text-text-primary",
456
- children: U("healthybowl.home.weatherCard.title", "Current weather")
457
- }), q.location && /* @__PURE__ */ E("p", {
457
+ children: W("healthybowl.home.weatherCard.title", "Current weather")
458
+ }), J.location && /* @__PURE__ */ E("p", {
458
459
  className: "text-xs text-text-secondary",
459
- children: q.location
460
+ children: J.location
460
461
  })]
461
462
  }), /* @__PURE__ */ D("div", {
462
463
  className: "flex flex-1 flex-col gap-4 px-4 pb-4",
463
464
  children: [
464
- J ? /* @__PURE__ */ D(le, { children: [/* @__PURE__ */ D("div", {
465
+ fe ? /* @__PURE__ */ D(ue, { children: [/* @__PURE__ */ D("div", {
465
466
  className: "flex items-center justify-between",
466
467
  children: [/* @__PURE__ */ D("div", { children: [
467
468
  /* @__PURE__ */ D("p", {
468
469
  className: "text-4xl font-bold text-text-primary",
469
- children: [q.current.temperature, "°C"]
470
+ children: [J.current.temperature, "°C"]
470
471
  }),
471
472
  /* @__PURE__ */ E("p", {
472
473
  className: "text-sm text-text-secondary",
473
- children: q.current.condition
474
+ children: J.current.condition
474
475
  }),
475
476
  /* @__PURE__ */ D("p", {
476
477
  className: "mt-1 text-xs text-text-secondary",
477
478
  children: [
478
- U("healthybowl.home.weatherCard.feelsLike", "Feels like"),
479
+ W("healthybowl.home.weatherCard.feelsLike", "Feels like"),
479
480
  " ",
480
- q.current.feelsLike,
481
+ J.current.feelsLike,
481
482
  "°C"
482
483
  ]
483
484
  })
484
485
  ] }), /* @__PURE__ */ D("div", {
485
486
  className: "flex flex-col items-center",
486
- children: [/* @__PURE__ */ E(ie, { className: "h-12 w-12 text-text-secondary" }), /* @__PURE__ */ D("span", {
487
+ children: [/* @__PURE__ */ E(v, { className: "h-12 w-12 text-text-secondary" }), /* @__PURE__ */ D("span", {
487
488
  className: "mt-1 text-xs text-text-secondary",
488
- children: ["UV ", q.current.uvIndex]
489
+ children: ["UV ", J.current.uvIndex]
489
490
  })]
490
491
  })]
491
492
  }), /* @__PURE__ */ D("div", {
@@ -493,44 +494,44 @@ var A = {
493
494
  children: [
494
495
  /* @__PURE__ */ D("div", {
495
496
  className: "flex items-center gap-2 text-sm text-text-secondary",
496
- children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [
497
- q.current.humidity,
497
+ children: [/* @__PURE__ */ E(ae, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [
498
+ J.current.humidity,
498
499
  "% ",
499
- U("healthybowl.home.weatherCard.humidity", "Humidity")
500
+ W("healthybowl.home.weatherCard.humidity", "Humidity")
500
501
  ] })]
501
502
  }),
502
503
  /* @__PURE__ */ D("div", {
503
504
  className: "flex items-center gap-2 text-sm text-text-secondary",
504
- children: [/* @__PURE__ */ E(se, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.windSpeed, " km/h"] })]
505
+ children: [/* @__PURE__ */ E(ce, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.windSpeed, " km/h"] })]
505
506
  }),
506
507
  /* @__PURE__ */ D("div", {
507
508
  className: "flex items-center gap-2 text-sm text-text-secondary",
508
- children: [/* @__PURE__ */ E(w, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.pressure, " hPa"] })]
509
+ children: [/* @__PURE__ */ E(w, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.pressure, " hPa"] })]
509
510
  }),
510
511
  /* @__PURE__ */ D("div", {
511
512
  className: "flex items-center gap-2 text-sm text-text-secondary",
512
- children: [/* @__PURE__ */ E(v, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [q.current.visibility, " km"] })]
513
+ children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4" }), /* @__PURE__ */ D("span", { children: [J.current.visibility, " km"] })]
513
514
  })
514
515
  ]
515
516
  })] }) : /* @__PURE__ */ E(o, {
516
- icon: /* @__PURE__ */ E(ae, { className: "h-8 w-8 text-text-muted" }),
517
- title: F.weather ? U("healthybowl.home.weatherCard.error.title", "Weather unavailable") : U("healthybowl.home.weatherCard.empty.title", "No weather yet"),
518
- description: F.weather ? U("healthybowl.home.weatherCard.error.description", "We couldn't load conditions for your farm just now.") : U("healthybowl.home.weatherCard.empty.description", "Set your farm location to see local conditions here."),
517
+ icon: /* @__PURE__ */ E(y, { className: "h-8 w-8 text-text-muted" }),
518
+ title: F.weather ? W("healthybowl.home.weatherCard.error.title", "Weather unavailable") : W("healthybowl.home.weatherCard.empty.title", "No weather yet"),
519
+ description: F.weather ? W("healthybowl.home.weatherCard.error.description", "We couldn't load conditions for your farm just now.") : W("healthybowl.home.weatherCard.empty.description", "Set your farm location to see local conditions here."),
519
520
  action: /* @__PURE__ */ E("button", {
520
521
  type: "button",
521
- onClick: () => F.weather ? B() : V(W("farm")),
522
+ onClick: () => F.weather ? B() : V(G("farm")),
522
523
  className: "inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
523
- children: F.weather ? U("healthybowl.home.weatherCard.error.retry", "Try again") : U("healthybowl.home.weatherCard.empty.action", "Set farm location")
524
+ children: F.weather ? W("healthybowl.home.weatherCard.error.retry", "Try again") : W("healthybowl.home.weatherCard.empty.action", "Set farm location")
524
525
  })
525
526
  }),
526
- q.forecast.length > 0 && /* @__PURE__ */ E("div", {
527
+ J.forecast.length > 0 && /* @__PURE__ */ E("div", {
527
528
  className: "grid grid-cols-4 gap-2 border-t border-border-subtle pt-3",
528
- children: q.forecast.slice(0, 4).map((e) => /* @__PURE__ */ D("div", {
529
+ children: J.forecast.slice(0, 4).map((e) => /* @__PURE__ */ D("div", {
529
530
  className: "rounded-md bg-bg-sunken/50 p-2 text-center",
530
531
  children: [
531
532
  /* @__PURE__ */ E("p", {
532
533
  className: "text-xs font-medium text-text-secondary",
533
- children: new Date(e.date).toLocaleDateString("en-US", { weekday: "short" })
534
+ children: new Date(e.date).toLocaleDateString(U, { weekday: "short" })
534
535
  }),
535
536
  /* @__PURE__ */ D("p", {
536
537
  className: "mt-1 text-sm font-semibold text-text-primary",
@@ -549,9 +550,9 @@ var A = {
549
550
  }),
550
551
  /* @__PURE__ */ E("button", {
551
552
  type: "button",
552
- onClick: () => V(W("weather")),
553
+ onClick: () => V(G("weather")),
553
554
  className: "mt-auto w-full rounded-md border border-border-subtle py-2 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
554
- children: U("healthybowl.home.weatherCard.viewForecast", "View full forecast")
555
+ children: W("healthybowl.home.weatherCard.viewForecast", "View full forecast")
555
556
  })
556
557
  ]
557
558
  })]
@@ -559,37 +560,37 @@ var A = {
559
560
  }),
560
561
  /* @__PURE__ */ D("section", { children: [/* @__PURE__ */ E("h3", {
561
562
  className: "mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary",
562
- children: U("healthybowl.home.glance.title", "At a glance")
563
+ children: W("healthybowl.home.glance.title", "At a glance")
563
564
  }), /* @__PURE__ */ D("div", {
564
565
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
565
566
  children: [
566
567
  /* @__PURE__ */ E(L, {
567
- label: U("healthybowl.home.glance.fields", "Fields"),
568
- value: String(K.totalFields),
569
- hint: K.totalFields > 0 ? U("healthybowl.home.glance.fieldsHint", "Monitored") : U("healthybowl.home.glance.fieldsEmpty", "No fields yet"),
570
- icon: /* @__PURE__ */ E(y, {}),
571
- onClick: () => V(W("crops/fields"))
568
+ label: W("healthybowl.home.glance.fields", "Fields"),
569
+ value: String(q.totalFields),
570
+ hint: q.totalFields > 0 ? W("healthybowl.home.glance.fieldsHint", "Monitored") : W("healthybowl.home.glance.fieldsEmpty", "No fields yet"),
571
+ icon: /* @__PURE__ */ E(b, {}),
572
+ onClick: () => V(G("crops/fields"))
572
573
  }),
573
574
  /* @__PURE__ */ E(L, {
574
- label: U("healthybowl.home.glance.livestock", "Livestock"),
575
- value: String(K.totalAnimals),
576
- hint: K.totalAnimals > 0 ? U("healthybowl.home.glance.livestockHint", "Under management") : U("healthybowl.home.glance.livestockEmpty", "No livestock added"),
577
- icon: /* @__PURE__ */ E(b, {}),
578
- onClick: () => V(W("livestock"))
575
+ label: W("healthybowl.home.glance.livestock", "Livestock"),
576
+ value: String(q.totalAnimals),
577
+ hint: q.totalAnimals > 0 ? W("healthybowl.home.glance.livestockHint", "Under management") : W("healthybowl.home.glance.livestockEmpty", "No livestock added"),
578
+ icon: /* @__PURE__ */ E(x, {}),
579
+ onClick: () => V(G("livestock"))
579
580
  }),
580
581
  /* @__PURE__ */ E(L, {
581
- label: U("healthybowl.home.glance.organic", "Organic score"),
582
- value: K.organicScore > 0 ? `${K.organicScore}%` : U("healthybowl.home.glance.organicEmpty", "Not configured"),
583
- hint: K.organicScore > 0 ? U("healthybowl.home.glance.organicHint", "Compliance") : void 0,
584
- icon: /* @__PURE__ */ E(S, {}),
585
- onClick: () => V(W("compliance"))
582
+ label: W("healthybowl.home.glance.organic", "Organic score"),
583
+ value: q.organicScore > 0 ? `${q.organicScore}%` : W("healthybowl.home.glance.organicEmpty", "Not configured"),
584
+ hint: q.organicScore > 0 ? W("healthybowl.home.glance.organicHint", "Compliance") : void 0,
585
+ icon: /* @__PURE__ */ E(se, {}),
586
+ onClick: () => V(G("compliance"))
586
587
  }),
587
588
  /* @__PURE__ */ E(L, {
588
- label: U("healthybowl.home.glance.expenses", "Expenses"),
589
- value: t(K.totalExpenses, "INR"),
590
- hint: Q == null ? U("healthybowl.home.glance.noRevenue", "No revenue yet") : U("healthybowl.home.glance.expensesRatio", "{{pct}}% of revenue", { pct: Q }),
589
+ label: W("healthybowl.home.glance.expenses", "Expenses"),
590
+ value: t(q.totalExpenses, "INR"),
591
+ hint: Q == null ? W("healthybowl.home.glance.noRevenue", "No revenue yet") : W("healthybowl.home.glance.expensesRatio", "{{pct}}% of revenue", { pct: Q }),
591
592
  icon: /* @__PURE__ */ E(T, {}),
592
- onClick: () => V(W("financial"))
593
+ onClick: () => V(G("financial"))
593
594
  })
594
595
  ]
595
596
  })] })
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.js","names":[],"sources":["../../../src/healthybowl/pages/HomePage.tsx"],"sourcesContent":["import { useMemo, useCallback, type FC, type ReactNode } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Sprout,\n CalendarClock,\n Wallet,\n AlertTriangle,\n Plus,\n ClipboardList,\n BarChart3,\n MapPin,\n Thermometer,\n ArrowUpRight,\n ChevronRight,\n CheckCircle2,\n Cloud,\n CloudOff,\n Droplets,\n Wind,\n Eye,\n PawPrint,\n ShieldCheck,\n} from 'lucide-react';\nimport { EmphasisPanel, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../components';\nimport { useHealthyBowlData } from '../hooks/useHealthyBowlData';\nimport { useHealthyBowlQuota } from '../hooks/useHealthyBowlQuota';\nimport { useBasePath } from '../hooks/useBasePath';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly } from '../utils/helpers';\nimport { hasWeatherObservation } from '../utils/weatherPresence';\nimport type { Alert, Crop } from '../types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Semantic maps — colour carries meaning, always paired with a label. Tokens only.\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype Tone = 'neutral' | 'success' | 'warning' | 'danger';\n\nconst toneValueClass: Record<Tone, string> = {\n neutral: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n danger: 'text-status-error-text',\n};\n\nconst toneChipClass: Record<Tone, string> = {\n neutral: 'bg-[var(--color-accent-soft)] text-text-primary',\n success: 'bg-status-success-bg text-status-success-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n danger: 'bg-status-error-bg text-status-error-text',\n};\n\nconst severityRank: Record<Alert['severity'], number> = { critical: 0, warning: 1, info: 2 };\n\nconst severityDotClass: Record<Alert['severity'], string> = {\n critical: 'bg-status-error-text',\n warning: 'bg-status-warning-text',\n info: 'bg-status-info-text',\n};\n\nconst healthVariant = (status: string) => {\n switch (status) {\n case 'excellent':\n return 'success' as const;\n case 'good':\n return 'info' as const;\n case 'fair':\n return 'warning' as const;\n default:\n return 'error' as const;\n }\n};\n\nconst clampPercent = (n: number) => Math.max(0, Math.min(100, Math.round(n)));\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Presentational sub-components (module-level so they don't remount each render)\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface KpiTileProps {\n label: string;\n value: string;\n icon: ReactNode;\n tone?: Tone;\n /** Featured accent glow — reserve for the single focal KPI (needs-attention). */\n glow?: boolean;\n drillLabel: string;\n onClick: () => void;\n}\n\n/** Primary KPI card — big real value + tone-coded chip + drill-down. No fabricated trend/sparkline. */\nconst KpiTile: FC<KpiTileProps> = ({ label, value, icon, tone = 'neutral', glow = false, drillLabel, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className=\"flex h-full flex-col gap-3 border-border-seam p-4 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\"\n >\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className={cn('flex size-8 items-center justify-center rounded-lg [&>svg]:size-4', toneChipClass[tone])}>\n {icon}\n </span>\n </div>\n <span className={cn('text-3xl font-semibold tabular-nums', toneValueClass[tone])}>{value}</span>\n <span className=\"mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary\">\n {drillLabel}\n <ArrowUpRight className=\"size-3.5\" />\n </span>\n </GlassCard>\n </button>\n);\n\ninterface MiniStatProps {\n label: string;\n value: string;\n hint?: string;\n icon: ReactNode;\n onClick: () => void;\n}\n\n/** Secondary \"at a glance\" tile — quieter than a KPI, honest zero-state hints. */\nconst MiniStat: FC<MiniStatProps> = ({ label, value, hint, icon, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard className=\"flex h-full items-center justify-between gap-3 border-border-seam p-3 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\">\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium text-text-secondary\">{label}</p>\n <p className=\"mt-0.5 truncate text-lg font-semibold tabular-nums text-text-primary\">{value}</p>\n {hint && <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{hint}</p>}\n </div>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-secondary [&>svg]:size-4\">\n {icon}\n </span>\n </GlassCard>\n </button>\n);\n\ninterface AlertRowProps {\n alert: Alert;\n ctaLabel: string;\n relTime: string;\n onOpen: () => void;\n}\n\n/** One needs-attention row: severity dot + title + message + relative time + CTA. */\nconst AlertRow: FC<AlertRowProps> = ({ alert, ctaLabel, relTime, onOpen }) => (\n <li className=\"flex items-start gap-3 py-3\">\n <span className={cn('mt-1.5 size-2.5 shrink-0 rounded-full', severityDotClass[alert.severity])} aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{alert.title}</p>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"shrink-0 text-xs font-medium text-action-primary-bg transition-colors hover:underline focus-visible:underline focus-visible:outline-none\"\n >\n {ctaLabel}\n </button>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{alert.message}</p>\n <p className=\"mt-0.5 text-xs text-text-muted\">{relTime}</p>\n </div>\n </li>\n);\n\ninterface CropRowProps {\n crop: Crop;\n metaLabel: string;\n healthLabel: string;\n harvestLabel: string;\n openLabel: string;\n onOpen: () => void;\n}\n\n/** Rich crop row — name, field · stage, health, progress bar, expected harvest, open. */\nconst CropRow: FC<CropRowProps> = ({ crop, metaLabel, healthLabel, harvestLabel, openLabel, onOpen }) => (\n <li>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"group block w-full rounded-lg p-3 text-start transition-colors hover:bg-bg-sunken/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{crop.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{metaLabel}</p>\n </div>\n <StatusBadge label={healthLabel} variant={healthVariant(crop.healthStatus)} dot />\n </div>\n <div className=\"mt-2 flex items-center gap-3\">\n <div className=\"h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-action-primary-bg\"\n style={{ width: `${clampPercent(crop.progress)}%` }}\n />\n </div>\n <span className=\"w-9 shrink-0 text-end text-xs font-medium tabular-nums text-text-secondary\">\n {clampPercent(crop.progress)}%\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"truncate\">{harvestLabel}</span>\n <span className=\"inline-flex shrink-0 items-center gap-0.5 font-medium transition-colors group-hover:text-text-primary\">\n {openLabel}\n <ChevronRight className=\"size-3.5\" />\n </span>\n </div>\n </button>\n </li>\n);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Dashboard\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const HomePage: FC = () => {\n const { dashboardStats, alerts, crops, weatherData, markAlertRead, farm, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const navigate = useNavigate();\n const { t: translate } = useI18n();\n // Local wrapper preserves the (key, fallback) call style used across HB pages\n // while forwarding interpolation params to the shared i18n `t` (for {{count}} etc.).\n const t = useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string =>\n translate(key, fallback, params),\n [translate]\n );\n const { buildPath } = useBasePath();\n const { quotas, loading: quotasLoading } = useHealthyBowlQuota();\n const stats = dashboardStats;\n\n const weather = {\n location: weatherData?.location ?? '',\n current: weatherData?.current,\n forecast: weatherData?.forecast ?? [],\n };\n // The data hook substitutes an all-zero EMPTY_WEATHER when there is nothing to\n // show, so presence has to come from a named condition — never from the\n // numbers, because 0 °C / 0 km/h / UV 0 is a real (and frost-relevant) reading.\n const hasWeather = hasWeatherObservation(weather.current);\n\n // Today's date, localised — \"Friday, 25 July\" style.\n const todayLabel = useMemo(\n () => new Date().toLocaleDateString(undefined, { weekday: 'long', day: 'numeric', month: 'long' }),\n []\n );\n\n // Alerts sorted by severity (critical → warning → info); capped for the panel.\n const sortedAlerts = useMemo(\n () => [...alerts].sort((a, b) => severityRank[a.severity] - severityRank[b.severity]),\n [alerts]\n );\n const visibleAlerts = sortedAlerts.slice(0, 5);\n const attentionCount = alerts.length;\n\n // Crops ordered by nearest harvest first; capped so the anchor stays scannable.\n const sortedCrops = useMemo(\n () =>\n [...crops].sort(\n (a, b) => (a.daysToHarvest ?? Number.MAX_SAFE_INTEGER) - (b.daysToHarvest ?? Number.MAX_SAFE_INTEGER)\n ),\n [crops]\n );\n const visibleCrops = sortedCrops.slice(0, 6);\n\n // Expenses as a share of revenue — honest ratio, null when there's no revenue to compare against.\n const expenseRatioPercent = useMemo(() => {\n if (stats.totalRevenue === 0) return null;\n return Math.round((stats.totalExpenses / stats.totalRevenue) * 100 * 10) / 10;\n }, [stats.totalExpenses, stats.totalRevenue]);\n\n // Compact relative-time (minutes/hours/days/weeks), i18n'd.\n const relTime = useCallback(\n (iso: string): string => {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) return '';\n const diffMin = Math.max(0, Math.floor((Date.now() - then) / 60000));\n if (diffMin < 1) return t('healthybowl.home.time.now', 'just now');\n if (diffMin < 60) return t('healthybowl.home.time.minutes', '{{n}}m ago', { n: diffMin });\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return t('healthybowl.home.time.hours', '{{n}}h ago', { n: diffHr });\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return t('healthybowl.home.time.days', '{{n}}d ago', { n: diffDay });\n return t('healthybowl.home.time.weeks', '{{n}}w ago', { n: Math.floor(diffDay / 7) });\n },\n [t]\n );\n\n // Per-alert CTA label by severity — mirrors Review / Open / View in the design.\n const alertCta = useCallback(\n (severity: Alert['severity']): string => {\n if (severity === 'critical') return t('healthybowl.home.needsAttention.review', 'Review');\n if (severity === 'warning') return t('healthybowl.home.needsAttention.open', 'Open');\n return t('healthybowl.home.needsAttention.view', 'View');\n },\n [t]\n );\n\n const openAlert = useCallback(\n (alert: Alert) => {\n void markAlertRead(alert.id, true);\n if (alert.actionUrl) navigate(alert.actionUrl);\n },\n [markAlertRead, navigate]\n );\n\n // ── Real-field-backed KPI derivations ──\n const netProfitTone: Tone = stats.netProfit > 0 ? 'success' : stats.netProfit < 0 ? 'danger' : 'neutral';\n const hasCritical = alerts.some((a) => a.severity === 'critical');\n const hasWarning = alerts.some((a) => a.severity === 'warning');\n const attentionTone: Tone =\n attentionCount === 0 ? 'success' : hasCritical ? 'danger' : hasWarning ? 'warning' : 'neutral';\n\n const quickActions = [\n {\n label: t('healthybowl.home.quickActions.addCrop.label', 'Add crop'),\n icon: Sprout,\n path: buildPath('crops'),\n },\n {\n label: t('healthybowl.home.quickActions.recordHarvest.label', 'Record harvest'),\n icon: ClipboardList,\n path: buildPath('crops/harvest'),\n },\n {\n label: t('healthybowl.home.quickActions.viewFields.label', 'View fields'),\n icon: MapPin,\n path: buildPath('crops/fields'),\n },\n {\n label: t('healthybowl.home.quickActions.viewWeather.label', 'View weather'),\n icon: Thermometer,\n path: buildPath('weather'),\n },\n {\n label: t('healthybowl.home.quickActions.analytics.label', 'Analytics'),\n icon: BarChart3,\n path: buildPath('analytics'),\n },\n ];\n\n // Compact header subline: date · farm + a live needs-attention summary.\n const attentionSummary =\n attentionCount === 0\n ? t('healthybowl.home.header.allClear', \"You're all caught up\")\n : attentionCount === 1\n ? t('healthybowl.home.header.needsAttentionOne', '1 item needs your attention')\n : t('healthybowl.home.header.needsAttentionOther', '{{count}} items need your attention', {\n count: attentionCount,\n });\n\n // PageLayout's `description` is a plain string; the date + farm reads as the subline.\n const headerSubline = farm?.name ? `${todayLabel} · ${farm.name}` : todayLabel;\n\n const headerActions = (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.primaryAction', 'Add')}\n </button>\n );\n\n return (\n <PageLayout\n title={t('healthybowl.home.title', 'Farm Dashboard')}\n description={headerSubline}\n actions={headerActions}\n >\n <section\n aria-labelledby=\"healthy-bowl-quota-heading\"\n className=\"mb-6 rounded-xl border border-border-seam bg-bg-surface p-5\"\n >\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <div>\n <h2 id=\"healthy-bowl-quota-heading\" className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.quotas.title', 'Plan usage')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.home.quotas.description', 'See what your farm plan has used and what remains.')}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate('/billing')}\n className=\"text-sm font-medium text-action-primary-text hover:underline\"\n >\n {t('healthybowl.home.quotas.billing', 'Manage plan')}\n </button>\n </div>\n {quotasLoading && quotas.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">{t('healthybowl.common.loading', 'Loading…')}</p>\n ) : (\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n {quotas.map((quota) => {\n const percent =\n quota.noLimit || quota.limit === null || quota.limit === 0\n ? 0\n : Math.min(100, Math.round((quota.used / quota.limit) * 100));\n return (\n <div key={quota.quotaName} className=\"rounded-lg border border-border-seam bg-bg-canvas p-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">{quota.label}</span>\n {/*\n \"Unlimited\" is only honest when billing actually said so. This tile\n used to render it whenever the limit lookup failed for any reason,\n including \"this workspace has no quota assignment\" — so a farmer\n whose every create was being refused was told they had no limit\n (BOFF-6302).\n */}\n {quota.noLimit ? (\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.home.quotas.unlimited', 'Unlimited')}\n </span>\n ) : !quota.provisioned ? (\n <span className=\"text-xs text-status-warning-text\">\n {t('healthybowl.home.quotas.unknown', 'Not available')}\n </span>\n ) : null}\n </div>\n <p className=\"mt-2 text-lg font-semibold text-text-primary\">\n {quota.used}\n {quota.limit === null ? '' : ` / ${quota.limit}`}\n </p>\n {quota.limit !== null ? (\n <div className=\"mt-2 h-2 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={`h-full ${quota.exhausted ? 'bg-status-error-bg' : 'bg-action-primary-bg'}`}\n style={{ width: `${percent}%` }}\n />\n </div>\n ) : null}\n <p\n className={`mt-1 text-xs ${\n quota.exhausted\n ? 'text-status-error-text'\n : !quota.provisioned\n ? 'text-status-warning-text'\n : 'text-text-secondary'\n }`}\n >\n {quota.exhausted\n ? t('healthybowl.home.quotas.exhausted', 'Limit reached')\n : !quota.provisioned\n ? t(\n 'healthybowl.home.quotas.notProvisioned',\n 'No plan limit found for this workspace — creating may be refused.'\n )\n : quota.remaining === null\n ? t('healthybowl.home.quotas.noLimitRemaining', 'No limit')\n : t('healthybowl.home.quotas.remaining', '{{count}} remaining', {\n count: quota.remaining,\n })}\n </p>\n </div>\n );\n })}\n </div>\n )}\n </section>\n {loadings.dashboard ? (\n <PageLoader />\n ) : errors.dashboard ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <div className=\"space-y-6\">\n {/* Live needs-attention summary — reads directly under the compact header */}\n <div\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium',\n attentionCount === 0\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n )}\n >\n {attentionCount === 0 ? <CheckCircle2 className=\"size-4\" /> : <AlertTriangle className=\"size-4\" />}\n {attentionSummary}\n </div>\n\n {/* First-run onboarding — only once data has settled and there's no farm yet */}\n {!farm?.id && (\n <EmphasisPanel className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <p className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.onboarding.title', 'Welcome to HealthyBowl')}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'healthybowl.home.onboarding.description',\n 'Set up your farm to start tracking crops, livestock, finances, and more.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('getting-started'))}\n className=\"inline-flex min-h-[44px] items-center gap-2 self-start rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas sm:self-auto\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.onboarding.action', 'Set up your farm')}\n </button>\n </EmphasisPanel>\n )}\n\n {/* Quick-action strip — compact row, existing wired targets */}\n <div className=\"flex flex-wrap gap-2\">\n {quickActions.map(({ label, icon: Icon, path }) => (\n <button\n key={label}\n type=\"button\"\n onClick={() => navigate(path)}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3.5 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas\"\n >\n <Icon className=\"size-4\" />\n {label}\n </button>\n ))}\n </div>\n\n {/* Primary row — 4 real-field KPIs + needs-attention panel above the fold */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <div className=\"grid grid-cols-2 gap-4 lg:col-span-2\">\n <KpiTile\n label={t('healthybowl.home.kpi.activeCrops', 'Active crops')}\n value={String(stats.activeCrops)}\n icon={<Sprout />}\n drillLabel={t('healthybowl.home.kpi.viewCrops', 'View crops')}\n onClick={() => navigate(buildPath('crops'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.harvestDue', 'Harvest due')}\n value={String(stats.harvestDue)}\n icon={<CalendarClock />}\n drillLabel={t('healthybowl.home.kpi.viewHarvest', 'View harvest')}\n onClick={() => navigate(buildPath('crops/harvest'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.netProfit', 'Net profit')}\n value={formatCurrency(stats.netProfit, HB_DEFAULT_CURRENCY)}\n icon={<Wallet />}\n tone={netProfitTone}\n drillLabel={t('healthybowl.home.kpi.viewFinance', 'View finances')}\n onClick={() => navigate(buildPath('financial'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.needsAttention', 'Needs attention')}\n value={String(attentionCount)}\n icon={<AlertTriangle />}\n tone={attentionTone}\n glow={attentionTone === 'danger' || attentionTone === 'warning'}\n drillLabel={t('healthybowl.home.kpi.viewAlerts', 'View alerts')}\n onClick={() => navigate(buildPath('weather/alerts'))}\n />\n </div>\n\n {/* Needs attention */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"flex items-center justify-between px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.needsAttention.title', 'Needs attention')}\n </h3>\n {sortedAlerts.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.needsAttention.viewAll', 'View all')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-4 pb-4\">\n {sortedAlerts.length === 0 ? (\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8 text-status-success-text\" />}\n title={t('healthybowl.home.needsAttention.empty.title', \"You're all caught up\")}\n description={t(\n 'healthybowl.home.needsAttention.empty.description',\n 'No urgent farm alerts right now.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alert-rules'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {t('healthybowl.home.needsAttention.empty.action', 'Manage alert rules')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleAlerts.map((alert) => (\n <AlertRow\n key={alert.id}\n alert={alert}\n ctaLabel={alertCta(alert.severity)}\n relTime={relTime(alert.timestamp)}\n onOpen={() => openAlert(alert)}\n />\n ))}\n </ul>\n )}\n </div>\n </GlassCard>\n </div>\n\n {/* Anchor row — crop overview (strongest) + compact weather */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Crop overview — the farm-specific anchor */}\n <GlassCard glow className=\"flex h-full flex-col border-border-seam p-0 lg:col-span-2\">\n <div className=\"flex items-center justify-between px-5 pb-2 pt-5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-primary [&>svg]:size-4\">\n <Sprout />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.cropsAnchor.title', 'Crop overview')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {crops.length === 1\n ? t('healthybowl.home.cropsAnchor.subtitleOne', '1 crop in progress')\n : t('healthybowl.home.cropsAnchor.subtitleOther', '{{count}} crops in progress', {\n count: crops.length,\n })}\n </p>\n </div>\n </div>\n {crops.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.cropsAnchor.viewAll', 'View all crops')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-3 pb-3\">\n {crops.length === 0 ? (\n <EmptyState\n icon={<Sprout className=\"h-8 w-8 text-primary\" />}\n title={t('healthybowl.home.cropsAnchor.empty.title', 'No active crops')}\n description={t(\n 'healthybowl.home.cropsAnchor.empty.description',\n 'Register your first crop to track growth, health and harvest here.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.quickActions.addCrop.label', 'Add crop')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleCrops.map((crop) => {\n const stage = (crop.growthStage || crop.status || '').replace(/_/g, ' ').trim();\n const metaLabel = [crop.fieldName, stage].filter(Boolean).join(' · ');\n return (\n <CropRow\n key={crop.id}\n crop={crop}\n metaLabel={metaLabel || t('healthybowl.home.cropsAnchor.noField', 'Unassigned')}\n healthLabel={(crop.healthStatus || 'unknown').replace(/_/g, ' ')}\n harvestLabel={\n crop.expectedHarvestDate\n ? t('healthybowl.home.cropsAnchor.harvest', 'Harvest {{date}}', {\n date: formatDateOnly(crop.expectedHarvestDate),\n })\n : t('healthybowl.home.cropsAnchor.harvestUnknown', 'Harvest date TBD')\n }\n openLabel={t('healthybowl.home.cropsAnchor.open', 'Open')}\n onOpen={() => navigate(buildPath(`crops/${crop.id}`))}\n />\n );\n })}\n </ul>\n )}\n </div>\n </GlassCard>\n\n {/* Weather — secondary */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.weatherCard.title', 'Current weather')}\n </h3>\n {weather.location && <p className=\"text-xs text-text-secondary\">{weather.location}</p>}\n </div>\n <div className=\"flex flex-1 flex-col gap-4 px-4 pb-4\">\n {!hasWeather ? (\n // No observation. Say so, rather than printing 0 °C / 0% / 0 hPa\n // — fabricated readings are worse than none on a farm dashboard.\n <EmptyState\n icon={<CloudOff className=\"h-8 w-8 text-text-muted\" />}\n title={\n errors.weather\n ? t('healthybowl.home.weatherCard.error.title', 'Weather unavailable')\n : t('healthybowl.home.weatherCard.empty.title', 'No weather yet')\n }\n description={\n errors.weather\n ? t(\n 'healthybowl.home.weatherCard.error.description',\n \"We couldn't load conditions for your farm just now.\"\n )\n : t(\n 'healthybowl.home.weatherCard.empty.description',\n 'Set your farm location to see local conditions here.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => (errors.weather ? refetch() : navigate(buildPath('farm')))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {errors.weather\n ? t('healthybowl.home.weatherCard.error.retry', 'Try again')\n : t('healthybowl.home.weatherCard.empty.action', 'Set farm location')}\n </button>\n }\n />\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-4xl font-bold text-text-primary\">{weather.current.temperature}&deg;C</p>\n <p className=\"text-sm text-text-secondary\">{weather.current.condition}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.home.weatherCard.feelsLike', 'Feels like')} {weather.current.feelsLike}&deg;C\n </p>\n </div>\n <div className=\"flex flex-col items-center\">\n <Cloud className=\"h-12 w-12 text-text-secondary\" />\n <span className=\"mt-1 text-xs text-text-secondary\">UV {weather.current.uvIndex}</span>\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Droplets className=\"h-4 w-4\" />\n <span>\n {weather.current.humidity}% {t('healthybowl.home.weatherCard.humidity', 'Humidity')}\n </span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Wind className=\"h-4 w-4\" />\n <span>{weather.current.windSpeed} km/h</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Thermometer className=\"h-4 w-4\" />\n <span>{weather.current.pressure} hPa</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Eye className=\"h-4 w-4\" />\n <span>{weather.current.visibility} km</span>\n </div>\n </div>\n </>\n )}\n\n {weather.forecast.length > 0 && (\n <div className=\"grid grid-cols-4 gap-2 border-t border-border-subtle pt-3\">\n {weather.forecast.slice(0, 4).map((day) => (\n <div key={day.date} className=\"rounded-md bg-bg-sunken/50 p-2 text-center\">\n <p className=\"text-xs font-medium text-text-secondary\">\n {new Date(day.date).toLocaleDateString('en-US', { weekday: 'short' })}\n </p>\n <p className=\"mt-1 text-sm font-semibold text-text-primary\">{day.high}&deg;</p>\n <p className=\"text-xs text-text-secondary\">{day.low}&deg;</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{day.precipitation}%</p>\n </div>\n ))}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather'))}\n className=\"mt-auto w-full rounded-md border border-border-subtle py-2 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {t('healthybowl.home.weatherCard.viewForecast', 'View full forecast')}\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* At a glance — demoted secondary metrics with honest zero-states */}\n <section>\n <h3 className=\"mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n {t('healthybowl.home.glance.title', 'At a glance')}\n </h3>\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <MiniStat\n label={t('healthybowl.home.glance.fields', 'Fields')}\n value={String(stats.totalFields)}\n hint={\n stats.totalFields > 0\n ? t('healthybowl.home.glance.fieldsHint', 'Monitored')\n : t('healthybowl.home.glance.fieldsEmpty', 'No fields yet')\n }\n icon={<MapPin />}\n onClick={() => navigate(buildPath('crops/fields'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.livestock', 'Livestock')}\n value={String(stats.totalAnimals)}\n hint={\n stats.totalAnimals > 0\n ? t('healthybowl.home.glance.livestockHint', 'Under management')\n : t('healthybowl.home.glance.livestockEmpty', 'No livestock added')\n }\n icon={<PawPrint />}\n onClick={() => navigate(buildPath('livestock'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.organic', 'Organic score')}\n value={\n stats.organicScore > 0\n ? `${stats.organicScore}%`\n : t('healthybowl.home.glance.organicEmpty', 'Not configured')\n }\n hint={stats.organicScore > 0 ? t('healthybowl.home.glance.organicHint', 'Compliance') : undefined}\n icon={<ShieldCheck />}\n onClick={() => navigate(buildPath('compliance'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.expenses', 'Expenses')}\n value={formatCurrency(stats.totalExpenses, HB_DEFAULT_CURRENCY)}\n hint={\n expenseRatioPercent != null\n ? t('healthybowl.home.glance.expensesRatio', '{{pct}}% of revenue', { pct: expenseRatioPercent })\n : t('healthybowl.home.glance.noRevenue', 'No revenue yet')\n }\n icon={<Wallet />}\n onClick={() => navigate(buildPath('financial'))}\n />\n </div>\n </section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IAAsC;CAC1C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IAAkD;CAAE,UAAU;CAAG,SAAS;CAAG,MAAM;AAAE,GAErF,IAAsD;CAC1D,UAAU;CACV,SAAS;CACT,MAAM;AACR,GAEM,KAAiB,MAAmB;CACxC,QAAQ,GAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF,GAEM,KAAgB,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,GAkBtE,KAA6B,EAAE,UAAO,UAAO,SAAM,UAAO,WAAW,UAAO,IAAO,eAAY,iBACnG,kBAAC,UAAD;CAAQ,MAAK;CAAkB;CAAS,WAAU;WAChD,kBAAC,GAAD;EACE,WAAU;EACJ;EACN,WAAU;YAHZ;GAKE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAA2C;IAAY,CAAA,GACvE,kBAAC,QAAD;KAAM,WAAW,EAAG,qEAAqE,EAAc,EAAK;eACzG;IACG,CAAA,CACH;;GACL,kBAAC,QAAD;IAAM,WAAW,EAAG,uCAAuC,EAAe,EAAK;cAAI;GAAY,CAAA;GAC/F,kBAAC,QAAD;IAA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O,OAAO,EAAM,WAAW;OAC/B,MACE,EAAM,cAAc,IAChB,EAAE,sCAAsC,WAAW,IACnD,EAAE,uCAAuC,eAAe;OAE9D,MAAM,kBAAC,GAAD,CAAS,CAAA;OACf,eAAe,EAAS,EAAU,cAAc,CAAC;MAClD,CAAA;MACD,kBAAC,GAAD;OACE,OAAO,EAAE,qCAAqC,WAAW;OACzD,OAAO,OAAO,EAAM,YAAY;OAChC,MACE,EAAM,eAAe,IACjB,EAAE,yCAAyC,kBAAkB,IAC7D,EAAE,0CAA0C,oBAAoB;OAEtE,MAAM,kBAAC,GAAD,CAAW,CAAA;OACjB,eAAe,EAAS,EAAU,WAAW,CAAC;MAC/C,CAAA;MACD,kBAAC,GAAD;OACE,OAAO,EAAE,mCAAmC,eAAe;OAC3D,OACE,EAAM,eAAe,IACjB,GAAG,EAAM,aAAa,KACtB,EAAE,wCAAwC,gBAAgB;OAEhE,MAAM,EAAM,eAAe,IAAI,EAAE,uCAAuC,YAAY,IAAI,KAAA;OACxF,MAAM,kBAAC,GAAD,CAAc,CAAA;OACpB,eAAe,EAAS,EAAU,YAAY,CAAC;MAChD,CAAA;MACD,kBAAC,GAAD;OACE,OAAO,EAAE,oCAAoC,UAAU;OACvD,OAAO,EAAe,EAAM,eAAA,KAAkC;OAC9D,MACE,KAAuB,OAEnB,EAAE,qCAAqC,gBAAgB,IADvD,EAAE,yCAAyC,uBAAuB,EAAE,KAAK,EAAoB,CAAC;OAGpG,MAAM,kBAAC,GAAD,CAAS,CAAA;OACf,eAAe,EAAS,EAAU,WAAW,CAAC;MAC/C,CAAA;KACE;MACE,EAAA,CAAA;GACN;IAEG;;AAEhB"}
1
+ {"version":3,"file":"HomePage.js","names":[],"sources":["../../../src/healthybowl/pages/HomePage.tsx"],"sourcesContent":["import { useMemo, useCallback, type FC, type ReactNode } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Sprout,\n CalendarClock,\n Wallet,\n AlertTriangle,\n Plus,\n ClipboardList,\n BarChart3,\n MapPin,\n Thermometer,\n ArrowUpRight,\n ChevronRight,\n CheckCircle2,\n Cloud,\n CloudOff,\n Droplets,\n Wind,\n Eye,\n PawPrint,\n ShieldCheck,\n} from 'lucide-react';\nimport { EmphasisPanel, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../components';\nimport { useHealthyBowlData } from '../hooks/useHealthyBowlData';\nimport { useHealthyBowlQuota } from '../hooks/useHealthyBowlQuota';\nimport { quotaLabelKey } from '../utils/quotaLabels';\nimport { useBasePath } from '../hooks/useBasePath';\nimport { cn, formatCurrency, HB_DEFAULT_CURRENCY, formatDateOnly } from '../utils/helpers';\nimport { hasWeatherObservation } from '../utils/weatherPresence';\nimport type { Alert, Crop } from '../types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Semantic maps — colour carries meaning, always paired with a label. Tokens only.\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype Tone = 'neutral' | 'success' | 'warning' | 'danger';\n\nconst toneValueClass: Record<Tone, string> = {\n neutral: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n danger: 'text-status-error-text',\n};\n\nconst toneChipClass: Record<Tone, string> = {\n neutral: 'bg-[var(--color-accent-soft)] text-text-primary',\n success: 'bg-status-success-bg text-status-success-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n danger: 'bg-status-error-bg text-status-error-text',\n};\n\nconst severityRank: Record<Alert['severity'], number> = { critical: 0, warning: 1, info: 2 };\n\nconst severityDotClass: Record<Alert['severity'], string> = {\n critical: 'bg-status-error-text',\n warning: 'bg-status-warning-text',\n info: 'bg-status-info-text',\n};\n\nconst healthVariant = (status: string) => {\n switch (status) {\n case 'excellent':\n return 'success' as const;\n case 'good':\n return 'info' as const;\n case 'fair':\n return 'warning' as const;\n default:\n return 'error' as const;\n }\n};\n\nconst clampPercent = (n: number) => Math.max(0, Math.min(100, Math.round(n)));\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Presentational sub-components (module-level so they don't remount each render)\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface KpiTileProps {\n label: string;\n value: string;\n icon: ReactNode;\n tone?: Tone;\n /** Featured accent glow — reserve for the single focal KPI (needs-attention). */\n glow?: boolean;\n drillLabel: string;\n onClick: () => void;\n}\n\n/** Primary KPI card — big real value + tone-coded chip + drill-down. No fabricated trend/sparkline. */\nconst KpiTile: FC<KpiTileProps> = ({ label, value, icon, tone = 'neutral', glow = false, drillLabel, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className=\"flex h-full flex-col gap-3 border-border-seam p-4 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\"\n >\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className={cn('flex size-8 items-center justify-center rounded-lg [&>svg]:size-4', toneChipClass[tone])}>\n {icon}\n </span>\n </div>\n <span className={cn('text-3xl font-semibold tabular-nums', toneValueClass[tone])}>{value}</span>\n <span className=\"mt-auto inline-flex items-center gap-1 text-xs font-medium text-text-secondary transition-colors group-hover:text-text-primary\">\n {drillLabel}\n <ArrowUpRight className=\"size-3.5\" />\n </span>\n </GlassCard>\n </button>\n);\n\ninterface MiniStatProps {\n label: string;\n value: string;\n hint?: string;\n icon: ReactNode;\n onClick: () => void;\n}\n\n/** Secondary \"at a glance\" tile — quieter than a KPI, honest zero-state hints. */\nconst MiniStat: FC<MiniStatProps> = ({ label, value, hint, icon, onClick }) => (\n <button type=\"button\" onClick={onClick} className=\"group block text-start focus-visible:outline-none\">\n <GlassCard className=\"flex h-full items-center justify-between gap-3 border-border-seam p-3 transition-shadow group-hover:shadow-pop group-focus-visible:ring-2 group-focus-visible:ring-border-focus group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-bg-canvas\">\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium text-text-secondary\">{label}</p>\n <p className=\"mt-0.5 truncate text-lg font-semibold tabular-nums text-text-primary\">{value}</p>\n {hint && <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{hint}</p>}\n </div>\n <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-secondary [&>svg]:size-4\">\n {icon}\n </span>\n </GlassCard>\n </button>\n);\n\ninterface AlertRowProps {\n alert: Alert;\n ctaLabel: string;\n relTime: string;\n onOpen: () => void;\n}\n\n/** One needs-attention row: severity dot + title + message + relative time + CTA. */\nconst AlertRow: FC<AlertRowProps> = ({ alert, ctaLabel, relTime, onOpen }) => (\n <li className=\"flex items-start gap-3 py-3\">\n <span className={cn('mt-1.5 size-2.5 shrink-0 rounded-full', severityDotClass[alert.severity])} aria-hidden />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{alert.title}</p>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"shrink-0 text-xs font-medium text-action-primary-bg transition-colors hover:underline focus-visible:underline focus-visible:outline-none\"\n >\n {ctaLabel}\n </button>\n </div>\n <p className=\"mt-0.5 truncate text-xs text-text-secondary\">{alert.message}</p>\n <p className=\"mt-0.5 text-xs text-text-muted\">{relTime}</p>\n </div>\n </li>\n);\n\ninterface CropRowProps {\n crop: Crop;\n metaLabel: string;\n healthLabel: string;\n harvestLabel: string;\n openLabel: string;\n onOpen: () => void;\n}\n\n/** Rich crop row — name, field · stage, health, progress bar, expected harvest, open. */\nconst CropRow: FC<CropRowProps> = ({ crop, metaLabel, healthLabel, harvestLabel, openLabel, onOpen }) => (\n <li>\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"group block w-full rounded-lg p-3 text-start transition-colors hover:bg-bg-sunken/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{crop.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{metaLabel}</p>\n </div>\n <StatusBadge label={healthLabel} variant={healthVariant(crop.healthStatus)} dot />\n </div>\n <div className=\"mt-2 flex items-center gap-3\">\n <div className=\"h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className=\"h-full rounded-full bg-action-primary-bg\"\n style={{ width: `${clampPercent(crop.progress)}%` }}\n />\n </div>\n <span className=\"w-9 shrink-0 text-end text-xs font-medium tabular-nums text-text-secondary\">\n {clampPercent(crop.progress)}%\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"truncate\">{harvestLabel}</span>\n <span className=\"inline-flex shrink-0 items-center gap-0.5 font-medium transition-colors group-hover:text-text-primary\">\n {openLabel}\n <ChevronRight className=\"size-3.5\" />\n </span>\n </div>\n </button>\n </li>\n);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Dashboard\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const HomePage: FC = () => {\n const { dashboardStats, alerts, crops, weatherData, markAlertRead, farm, loadings, errors, refetch } =\n useHealthyBowlData();\n\n const navigate = useNavigate();\n const { t: translate, locale } = useI18n();\n // Local wrapper preserves the (key, fallback) call style used across HB pages\n // while forwarding interpolation params to the shared i18n `t` (for {{count}} etc.).\n const t = useCallback(\n (key: string, fallback: string, params?: Record<string, string | number>): string =>\n translate(key, fallback, params),\n [translate]\n );\n const { buildPath } = useBasePath();\n const { quotas, loading: quotasLoading } = useHealthyBowlQuota();\n const stats = dashboardStats;\n\n const weather = {\n location: weatherData?.location ?? '',\n current: weatherData?.current,\n forecast: weatherData?.forecast ?? [],\n };\n // The data hook substitutes an all-zero EMPTY_WEATHER when there is nothing to\n // show, so presence has to come from a named condition — never from the\n // numbers, because 0 °C / 0 km/h / UV 0 is a real (and frost-relevant) reading.\n const hasWeather = hasWeatherObservation(weather.current);\n\n // Today's date in the app's chosen language (not the browser's) — \"Friday, 25 July\" style.\n const todayLabel = useMemo(\n () => new Date().toLocaleDateString(locale, { weekday: 'long', day: 'numeric', month: 'long' }),\n [locale]\n );\n\n // Alerts sorted by severity (critical → warning → info); capped for the panel.\n const sortedAlerts = useMemo(\n () => [...alerts].sort((a, b) => severityRank[a.severity] - severityRank[b.severity]),\n [alerts]\n );\n const visibleAlerts = sortedAlerts.slice(0, 5);\n const attentionCount = alerts.length;\n\n // Crops ordered by nearest harvest first; capped so the anchor stays scannable.\n const sortedCrops = useMemo(\n () =>\n [...crops].sort(\n (a, b) => (a.daysToHarvest ?? Number.MAX_SAFE_INTEGER) - (b.daysToHarvest ?? Number.MAX_SAFE_INTEGER)\n ),\n [crops]\n );\n const visibleCrops = sortedCrops.slice(0, 6);\n\n // Expenses as a share of revenue — honest ratio, null when there's no revenue to compare against.\n const expenseRatioPercent = useMemo(() => {\n if (stats.totalRevenue === 0) return null;\n return Math.round((stats.totalExpenses / stats.totalRevenue) * 100 * 10) / 10;\n }, [stats.totalExpenses, stats.totalRevenue]);\n\n // Compact relative-time (minutes/hours/days/weeks), i18n'd.\n const relTime = useCallback(\n (iso: string): string => {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) return '';\n const diffMin = Math.max(0, Math.floor((Date.now() - then) / 60000));\n if (diffMin < 1) return t('healthybowl.home.time.now', 'just now');\n if (diffMin < 60) return t('healthybowl.home.time.minutes', '{{n}}m ago', { n: diffMin });\n const diffHr = Math.floor(diffMin / 60);\n if (diffHr < 24) return t('healthybowl.home.time.hours', '{{n}}h ago', { n: diffHr });\n const diffDay = Math.floor(diffHr / 24);\n if (diffDay < 7) return t('healthybowl.home.time.days', '{{n}}d ago', { n: diffDay });\n return t('healthybowl.home.time.weeks', '{{n}}w ago', { n: Math.floor(diffDay / 7) });\n },\n [t]\n );\n\n // Per-alert CTA label by severity — mirrors Review / Open / View in the design.\n const alertCta = useCallback(\n (severity: Alert['severity']): string => {\n if (severity === 'critical') return t('healthybowl.home.needsAttention.review', 'Review');\n if (severity === 'warning') return t('healthybowl.home.needsAttention.open', 'Open');\n return t('healthybowl.home.needsAttention.view', 'View');\n },\n [t]\n );\n\n const openAlert = useCallback(\n (alert: Alert) => {\n void markAlertRead(alert.id, true);\n if (alert.actionUrl) navigate(alert.actionUrl);\n },\n [markAlertRead, navigate]\n );\n\n // ── Real-field-backed KPI derivations ──\n const netProfitTone: Tone = stats.netProfit > 0 ? 'success' : stats.netProfit < 0 ? 'danger' : 'neutral';\n const hasCritical = alerts.some((a) => a.severity === 'critical');\n const hasWarning = alerts.some((a) => a.severity === 'warning');\n const attentionTone: Tone =\n attentionCount === 0 ? 'success' : hasCritical ? 'danger' : hasWarning ? 'warning' : 'neutral';\n\n const quickActions = [\n {\n label: t('healthybowl.home.quickActions.addCrop.label', 'Add crop'),\n icon: Sprout,\n path: buildPath('crops'),\n },\n {\n label: t('healthybowl.home.quickActions.recordHarvest.label', 'Record harvest'),\n icon: ClipboardList,\n path: buildPath('crops/harvest'),\n },\n {\n label: t('healthybowl.home.quickActions.viewFields.label', 'View fields'),\n icon: MapPin,\n path: buildPath('crops/fields'),\n },\n {\n label: t('healthybowl.home.quickActions.viewWeather.label', 'View weather'),\n icon: Thermometer,\n path: buildPath('weather'),\n },\n {\n label: t('healthybowl.home.quickActions.analytics.label', 'Analytics'),\n icon: BarChart3,\n path: buildPath('analytics'),\n },\n ];\n\n // Compact header subline: date · farm + a live needs-attention summary.\n const attentionSummary =\n attentionCount === 0\n ? t('healthybowl.home.header.allClear', \"You're all caught up\")\n : attentionCount === 1\n ? t('healthybowl.home.header.needsAttentionOne', '1 item needs your attention')\n : t('healthybowl.home.header.needsAttentionOther', '{{count}} items need your attention', {\n count: attentionCount,\n });\n\n // PageLayout's `description` is a plain string; the date + farm reads as the subline.\n const headerSubline = farm?.name ? `${todayLabel} · ${farm.name}` : todayLabel;\n\n const headerActions = (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.primaryAction', 'Add')}\n </button>\n );\n\n return (\n <PageLayout\n title={t('healthybowl.home.title', 'Farm Dashboard')}\n description={headerSubline}\n actions={headerActions}\n >\n <section\n aria-labelledby=\"healthy-bowl-quota-heading\"\n className=\"mb-6 rounded-xl border border-border-seam bg-bg-surface p-5\"\n >\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <div>\n <h2 id=\"healthy-bowl-quota-heading\" className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.quotas.title', 'Plan usage')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {t('healthybowl.home.quotas.description', 'See what your farm plan has used and what remains.')}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate('/billing')}\n className=\"text-sm font-medium text-action-primary-text hover:underline\"\n >\n {t('healthybowl.home.quotas.billing', 'Manage plan')}\n </button>\n </div>\n {quotasLoading && quotas.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">{t('healthybowl.common.loading', 'Loading…')}</p>\n ) : (\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-5\">\n {quotas.map((quota) => {\n const percent =\n quota.noLimit || quota.limit === null || quota.limit === 0\n ? 0\n : Math.min(100, Math.round((quota.used / quota.limit) * 100));\n return (\n <div key={quota.quotaName} className=\"rounded-lg border border-border-seam bg-bg-canvas p-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">\n {t(quotaLabelKey(quota.quotaName), quota.label)}\n </span>\n {/*\n \"Unlimited\" is only honest when billing actually said so. This tile\n used to render it whenever the limit lookup failed for any reason,\n including \"this workspace has no quota assignment\" — so a farmer\n whose every create was being refused was told they had no limit\n (BOFF-6302).\n */}\n {quota.noLimit ? (\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.home.quotas.unlimited', 'Unlimited')}\n </span>\n ) : !quota.provisioned ? (\n <span className=\"text-xs text-status-warning-text\">\n {t('healthybowl.home.quotas.unknown', 'Not available')}\n </span>\n ) : null}\n </div>\n <p className=\"mt-2 text-lg font-semibold text-text-primary\">\n {quota.used}\n {quota.limit === null ? '' : ` / ${quota.limit}`}\n </p>\n {quota.limit !== null ? (\n <div className=\"mt-2 h-2 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={`h-full ${quota.exhausted ? 'bg-status-error-bg' : 'bg-action-primary-bg'}`}\n style={{ width: `${percent}%` }}\n />\n </div>\n ) : null}\n <p\n className={`mt-1 text-xs ${\n quota.exhausted\n ? 'text-status-error-text'\n : !quota.provisioned\n ? 'text-status-warning-text'\n : 'text-text-secondary'\n }`}\n >\n {quota.exhausted\n ? t('healthybowl.home.quotas.exhausted', 'Limit reached')\n : !quota.provisioned\n ? t(\n 'healthybowl.home.quotas.notProvisioned',\n 'No plan limit found for this workspace — creating may be refused.'\n )\n : quota.remaining === null\n ? t('healthybowl.home.quotas.noLimitRemaining', 'No limit')\n : t('healthybowl.home.quotas.remaining', '{{count}} remaining', {\n count: quota.remaining,\n })}\n </p>\n </div>\n );\n })}\n </div>\n )}\n </section>\n {loadings.dashboard ? (\n <PageLoader />\n ) : errors.dashboard ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <div className=\"space-y-6\">\n {/* Live needs-attention summary — reads directly under the compact header */}\n <div\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium',\n attentionCount === 0\n ? 'bg-status-success-bg text-status-success-text'\n : 'bg-status-warning-bg text-status-warning-text'\n )}\n >\n {attentionCount === 0 ? <CheckCircle2 className=\"size-4\" /> : <AlertTriangle className=\"size-4\" />}\n {attentionSummary}\n </div>\n\n {/* First-run onboarding — only once data has settled and there's no farm yet */}\n {!farm?.id && (\n <EmphasisPanel className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <p className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.onboarding.title', 'Welcome to HealthyBowl')}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'healthybowl.home.onboarding.description',\n 'Set up your farm to start tracking crops, livestock, finances, and more.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('getting-started'))}\n className=\"inline-flex min-h-[44px] items-center gap-2 self-start rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas sm:self-auto\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.onboarding.action', 'Set up your farm')}\n </button>\n </EmphasisPanel>\n )}\n\n {/* Quick-action strip — compact row, existing wired targets */}\n <div className=\"flex flex-wrap gap-2\">\n {quickActions.map(({ label, icon: Icon, path }) => (\n <button\n key={label}\n type=\"button\"\n onClick={() => navigate(path)}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3.5 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-border-default hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas\"\n >\n <Icon className=\"size-4\" />\n {label}\n </button>\n ))}\n </div>\n\n {/* Primary row — 4 real-field KPIs + needs-attention panel above the fold */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <div className=\"grid grid-cols-2 gap-4 lg:col-span-2\">\n <KpiTile\n label={t('healthybowl.home.kpi.activeCrops', 'Active crops')}\n value={String(stats.activeCrops)}\n icon={<Sprout />}\n drillLabel={t('healthybowl.home.kpi.viewCrops', 'View crops')}\n onClick={() => navigate(buildPath('crops'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.harvestDue', 'Harvest due')}\n value={String(stats.harvestDue)}\n icon={<CalendarClock />}\n drillLabel={t('healthybowl.home.kpi.viewHarvest', 'View harvest')}\n onClick={() => navigate(buildPath('crops/harvest'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.netProfit', 'Net profit')}\n value={formatCurrency(stats.netProfit, HB_DEFAULT_CURRENCY)}\n icon={<Wallet />}\n tone={netProfitTone}\n drillLabel={t('healthybowl.home.kpi.viewFinance', 'View finances')}\n onClick={() => navigate(buildPath('financial'))}\n />\n <KpiTile\n label={t('healthybowl.home.kpi.needsAttention', 'Needs attention')}\n value={String(attentionCount)}\n icon={<AlertTriangle />}\n tone={attentionTone}\n glow={attentionTone === 'danger' || attentionTone === 'warning'}\n drillLabel={t('healthybowl.home.kpi.viewAlerts', 'View alerts')}\n onClick={() => navigate(buildPath('weather/alerts'))}\n />\n </div>\n\n {/* Needs attention */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"flex items-center justify-between px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.needsAttention.title', 'Needs attention')}\n </h3>\n {sortedAlerts.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alerts'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.needsAttention.viewAll', 'View all')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-4 pb-4\">\n {sortedAlerts.length === 0 ? (\n <EmptyState\n icon={<CheckCircle2 className=\"h-8 w-8 text-status-success-text\" />}\n title={t('healthybowl.home.needsAttention.empty.title', \"You're all caught up\")}\n description={t(\n 'healthybowl.home.needsAttention.empty.description',\n 'No urgent farm alerts right now.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather/alert-rules'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {t('healthybowl.home.needsAttention.empty.action', 'Manage alert rules')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleAlerts.map((alert) => (\n <AlertRow\n key={alert.id}\n alert={alert}\n ctaLabel={alertCta(alert.severity)}\n relTime={relTime(alert.timestamp)}\n onOpen={() => openAlert(alert)}\n />\n ))}\n </ul>\n )}\n </div>\n </GlassCard>\n </div>\n\n {/* Anchor row — crop overview (strongest) + compact weather */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Crop overview — the farm-specific anchor */}\n <GlassCard glow className=\"flex h-full flex-col border-border-seam p-0 lg:col-span-2\">\n <div className=\"flex items-center justify-between px-5 pb-2 pt-5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-primary [&>svg]:size-4\">\n <Sprout />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n {t('healthybowl.home.cropsAnchor.title', 'Crop overview')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {crops.length === 1\n ? t('healthybowl.home.cropsAnchor.subtitleOne', '1 crop in progress')\n : t('healthybowl.home.cropsAnchor.subtitleOther', '{{count}} crops in progress', {\n count: crops.length,\n })}\n </p>\n </div>\n </div>\n {crops.length > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"text-xs font-medium text-text-secondary transition-colors hover:text-text-primary focus-visible:text-text-primary focus-visible:outline-none\"\n >\n {t('healthybowl.home.cropsAnchor.viewAll', 'View all crops')}\n </button>\n )}\n </div>\n <div className=\"flex-1 px-3 pb-3\">\n {crops.length === 0 ? (\n <EmptyState\n icon={<Sprout className=\"h-8 w-8 text-primary\" />}\n title={t('healthybowl.home.cropsAnchor.empty.title', 'No active crops')}\n description={t(\n 'healthybowl.home.cropsAnchor.empty.description',\n 'Register your first crop to track growth, health and harvest here.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('crops'))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n <Plus className=\"h-4 w-4\" />\n {t('healthybowl.home.quickActions.addCrop.label', 'Add crop')}\n </button>\n }\n />\n ) : (\n <ul className=\"divide-y divide-border-subtle\">\n {visibleCrops.map((crop) => {\n const stage = (crop.growthStage || crop.status || '').replace(/_/g, ' ').trim();\n const metaLabel = [crop.fieldName, stage].filter(Boolean).join(' · ');\n return (\n <CropRow\n key={crop.id}\n crop={crop}\n metaLabel={metaLabel || t('healthybowl.home.cropsAnchor.noField', 'Unassigned')}\n healthLabel={(crop.healthStatus || 'unknown').replace(/_/g, ' ')}\n harvestLabel={\n crop.expectedHarvestDate\n ? t('healthybowl.home.cropsAnchor.harvest', 'Harvest {{date}}', {\n date: formatDateOnly(crop.expectedHarvestDate),\n })\n : t('healthybowl.home.cropsAnchor.harvestUnknown', 'Harvest date TBD')\n }\n openLabel={t('healthybowl.home.cropsAnchor.open', 'Open')}\n onOpen={() => navigate(buildPath(`crops/${crop.id}`))}\n />\n );\n })}\n </ul>\n )}\n </div>\n </GlassCard>\n\n {/* Weather — secondary */}\n <GlassCard className=\"flex h-full flex-col border-border-seam p-0\">\n <div className=\"px-4 pb-1 pt-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t('healthybowl.home.weatherCard.title', 'Current weather')}\n </h3>\n {weather.location && <p className=\"text-xs text-text-secondary\">{weather.location}</p>}\n </div>\n <div className=\"flex flex-1 flex-col gap-4 px-4 pb-4\">\n {!hasWeather ? (\n // No observation. Say so, rather than printing 0 °C / 0% / 0 hPa\n // — fabricated readings are worse than none on a farm dashboard.\n <EmptyState\n icon={<CloudOff className=\"h-8 w-8 text-text-muted\" />}\n title={\n errors.weather\n ? t('healthybowl.home.weatherCard.error.title', 'Weather unavailable')\n : t('healthybowl.home.weatherCard.empty.title', 'No weather yet')\n }\n description={\n errors.weather\n ? t(\n 'healthybowl.home.weatherCard.error.description',\n \"We couldn't load conditions for your farm just now.\"\n )\n : t(\n 'healthybowl.home.weatherCard.empty.description',\n 'Set your farm location to see local conditions here.'\n )\n }\n action={\n <button\n type=\"button\"\n onClick={() => (errors.weather ? refetch() : navigate(buildPath('farm')))}\n className=\"inline-flex min-h-[40px] items-center gap-2 rounded-md border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {errors.weather\n ? t('healthybowl.home.weatherCard.error.retry', 'Try again')\n : t('healthybowl.home.weatherCard.empty.action', 'Set farm location')}\n </button>\n }\n />\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-4xl font-bold text-text-primary\">{weather.current.temperature}&deg;C</p>\n <p className=\"text-sm text-text-secondary\">{weather.current.condition}</p>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.home.weatherCard.feelsLike', 'Feels like')} {weather.current.feelsLike}&deg;C\n </p>\n </div>\n <div className=\"flex flex-col items-center\">\n <Cloud className=\"h-12 w-12 text-text-secondary\" />\n <span className=\"mt-1 text-xs text-text-secondary\">UV {weather.current.uvIndex}</span>\n </div>\n </div>\n\n <div className=\"grid grid-cols-2 gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Droplets className=\"h-4 w-4\" />\n <span>\n {weather.current.humidity}% {t('healthybowl.home.weatherCard.humidity', 'Humidity')}\n </span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Wind className=\"h-4 w-4\" />\n <span>{weather.current.windSpeed} km/h</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Thermometer className=\"h-4 w-4\" />\n <span>{weather.current.pressure} hPa</span>\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Eye className=\"h-4 w-4\" />\n <span>{weather.current.visibility} km</span>\n </div>\n </div>\n </>\n )}\n\n {weather.forecast.length > 0 && (\n <div className=\"grid grid-cols-4 gap-2 border-t border-border-subtle pt-3\">\n {weather.forecast.slice(0, 4).map((day) => (\n <div key={day.date} className=\"rounded-md bg-bg-sunken/50 p-2 text-center\">\n <p className=\"text-xs font-medium text-text-secondary\">\n {new Date(day.date).toLocaleDateString(locale, { weekday: 'short' })}\n </p>\n <p className=\"mt-1 text-sm font-semibold text-text-primary\">{day.high}&deg;</p>\n <p className=\"text-xs text-text-secondary\">{day.low}&deg;</p>\n <p className=\"mt-0.5 text-xs text-text-secondary\">{day.precipitation}%</p>\n </div>\n ))}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={() => navigate(buildPath('weather'))}\n className=\"mt-auto w-full rounded-md border border-border-subtle py-2 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus\"\n >\n {t('healthybowl.home.weatherCard.viewForecast', 'View full forecast')}\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* At a glance — demoted secondary metrics with honest zero-states */}\n <section>\n <h3 className=\"mb-2 text-xs font-medium uppercase tracking-wide text-text-secondary\">\n {t('healthybowl.home.glance.title', 'At a glance')}\n </h3>\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <MiniStat\n label={t('healthybowl.home.glance.fields', 'Fields')}\n value={String(stats.totalFields)}\n hint={\n stats.totalFields > 0\n ? t('healthybowl.home.glance.fieldsHint', 'Monitored')\n : t('healthybowl.home.glance.fieldsEmpty', 'No fields yet')\n }\n icon={<MapPin />}\n onClick={() => navigate(buildPath('crops/fields'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.livestock', 'Livestock')}\n value={String(stats.totalAnimals)}\n hint={\n stats.totalAnimals > 0\n ? t('healthybowl.home.glance.livestockHint', 'Under management')\n : t('healthybowl.home.glance.livestockEmpty', 'No livestock added')\n }\n icon={<PawPrint />}\n onClick={() => navigate(buildPath('livestock'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.organic', 'Organic score')}\n value={\n stats.organicScore > 0\n ? `${stats.organicScore}%`\n : t('healthybowl.home.glance.organicEmpty', 'Not configured')\n }\n hint={stats.organicScore > 0 ? t('healthybowl.home.glance.organicHint', 'Compliance') : undefined}\n icon={<ShieldCheck />}\n onClick={() => navigate(buildPath('compliance'))}\n />\n <MiniStat\n label={t('healthybowl.home.glance.expenses', 'Expenses')}\n value={formatCurrency(stats.totalExpenses, HB_DEFAULT_CURRENCY)}\n hint={\n expenseRatioPercent != null\n ? t('healthybowl.home.glance.expensesRatio', '{{pct}}% of revenue', { pct: expenseRatioPercent })\n : t('healthybowl.home.glance.noRevenue', 'No revenue yet')\n }\n icon={<Wallet />}\n onClick={() => navigate(buildPath('financial'))}\n />\n </div>\n </section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,IAAM,IAAuC;CAC3C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IAAsC;CAC1C,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IAAkD;CAAE,UAAU;CAAG,SAAS;CAAG,MAAM;AAAE,GAErF,IAAsD;CAC1D,UAAU;CACV,SAAS;CACT,MAAM;AACR,GAEM,KAAiB,MAAmB;CACxC,QAAQ,GAAR;EACE,KAAK,aACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO;CACX;AACF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ACpB,eAAe,EAAS,EAAU,YAAY,CAAC;MAChD,CAAA;MACD,kBAAC,GAAD;OACE,OAAO,EAAE,oCAAoC,UAAU;OACvD,OAAO,EAAe,EAAM,eAAA,KAAkC;OAC9D,MACE,KAAuB,OAEnB,EAAE,qCAAqC,gBAAgB,IADvD,EAAE,yCAAyC,uBAAuB,EAAE,KAAK,EAAoB,CAAC;OAGpG,MAAM,kBAAC,GAAD,CAAS,CAAA;OACf,eAAe,EAAS,EAAU,WAAW,CAAC;MAC/C,CAAA;KACE;MACE,EAAA,CAAA;GACN;IAEG;;AAEhB"}
@@ -0,0 +1,8 @@
1
+ //#region src/healthybowl/utils/quotaLabels.ts
2
+ function e(e) {
3
+ return `healthybowl.home.quotas.label.${e.trim().replace(/^healthybowl\./, "").toLowerCase().replace(/[^a-z0-9]+([a-z0-9])/g, (e, t) => t.toUpperCase()).replace(/[^a-zA-Z0-9]/g, "") || "unknown"}`;
4
+ }
5
+ //#endregion
6
+ export { e as quotaLabelKey };
7
+
8
+ //# sourceMappingURL=quotaLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotaLabels.js","names":[],"sources":["../../../src/healthybowl/utils/quotaLabels.ts"],"sourcesContent":["/**\n * Translation key for a plan-usage quota label (BOFF-8851).\n *\n * The server sends each quota's English label (`HealthyBowlQuotaProvider`), so\n * the dashboard keys the label client-side by its stable `quotaName` and falls\n * back to the server's English when no translation exists.\n *\n * healthybowl.farms.active -> healthybowl.home.quotas.label.farmsActive\n * healthybowl.sensor_probes.active -> healthybowl.home.quotas.label.sensorProbesActive\n */\nexport function quotaLabelKey(quotaName: string): string {\n const slug = quotaName\n .trim()\n .replace(/^healthybowl\\./, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+([a-z0-9])/g, (_match, next: string) => next.toUpperCase())\n .replace(/[^a-zA-Z0-9]/g, '');\n return `healthybowl.home.quotas.label.${slug || 'unknown'}`;\n}\n"],"mappings":";AAUA,SAAgB,EAAc,GAA2B;CAOvD,OAAO,iCANM,EACV,KAAK,EACL,QAAQ,kBAAkB,EAAE,EAC5B,YAAY,EACZ,QAAQ,0BAA0B,GAAQ,MAAiB,EAAK,YAAY,CAAC,EAC7E,QAAQ,iBAAiB,EACY,KAAQ;AAClD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.1007.1",
3
+ "version": "2026.1007.2",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [