@burdenoff/microfe-healthybowl 2026.820.3 → 2026.821.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,14 +8,14 @@ import { ToastContainer as l } from "../../components/Toast.js";
8
8
  import { PageLoader as u } from "../../components/PageLoader.js";
9
9
  import { useToast as d } from "../../hooks/useToast.js";
10
10
  import "../../components/index.js";
11
- import { useHealthyBowlData as ee } from "../../hooks/useHealthyBowlData.js";
12
- import { getEffectiveSchemeStatus as f, isAcceptingSchemeApplications as p, matchesSchemeAmount as te } from "./schemeDiscoveryFilters.js";
13
- import { useMemo as m, useState as h } from "react";
11
+ import { useHealthyBowlData as f } from "../../hooks/useHealthyBowlData.js";
12
+ import { getEffectiveSchemeStatus as p, isAcceptingSchemeApplications as m, matchesSchemeAmount as ee, matchesSchemeCategory as te } from "./schemeDiscoveryFilters.js";
13
+ import { useMemo as h, useState as g } from "react";
14
14
  import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { Bookmark as re, CalendarDays as ie, Check as g, CheckCircle as ae, ChevronDown as oe, Clock as se, DollarSign as ce, Landmark as le, Search as _, SlidersHorizontal as ue, X as v } from "lucide-react";
16
- import { useNavigate as de } from "react-router";
15
+ import { Bookmark as re, CalendarDays as ie, Check as ae, CheckCircle as oe, ChevronDown as se, Clock as ce, DollarSign as le, Landmark as ue, Search as _, SlidersHorizontal as de, X as v } from "lucide-react";
16
+ import { useNavigate as fe } from "react-router";
17
17
  import { jsx as y, jsxs as b } from "react/jsx-runtime";
18
- import { Badge as x, Button as S, Command as fe, CommandEmpty as pe, CommandGroup as me, CommandInput as he, CommandItem as ge, CommandList as _e, Input as C, Popover as ve, PopoverContent as ye, PopoverTrigger as be, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "@burdenoff/fe-libs/ui";
18
+ import { Badge as x, Button as S, Command as pe, CommandEmpty as me, CommandGroup as he, CommandInput as ge, CommandItem as C, CommandList as _e, Input as w, Popover as ve, PopoverContent as ye, PopoverTrigger as be, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "@burdenoff/fe-libs/ui";
19
19
  //#region src/healthybowl/pages/government-schemes/SchemeDiscoveryPage.tsx
20
20
  var xe = (e) => {
21
21
  switch (e) {
@@ -35,134 +35,134 @@ var xe = (e) => {
35
35
  case "equipment": return "muted";
36
36
  default: return "muted";
37
37
  }
38
- }, Ce = "__all__", k = () => {
39
- let { t: k } = ne(), { governmentSchemes: A, errors: we, loadings: Te, refetch: Ee } = ee(), De = m(() => [
38
+ }, Ce = "__all__", A = () => {
39
+ let { t: A } = ne(), { governmentSchemes: j, errors: we, loadings: Te, refetch: Ee } = f(), De = h(() => [
40
40
  {
41
41
  value: "all",
42
- label: k("healthybowl.common.all", "All")
42
+ label: A("healthybowl.common.all", "All")
43
43
  },
44
44
  {
45
45
  value: "subsidy",
46
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.subsidy", "Subsidy")
46
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.subsidy", "Subsidy")
47
47
  },
48
48
  {
49
49
  value: "credit",
50
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.credit", "Credit")
50
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.credit", "Credit")
51
51
  },
52
52
  {
53
53
  value: "insurance",
54
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.insurance", "Insurance")
54
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.insurance", "Insurance")
55
55
  },
56
56
  {
57
57
  value: "training",
58
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.training", "Training")
58
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.training", "Training")
59
59
  },
60
60
  {
61
61
  value: "grant",
62
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.grant", "Grant")
62
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.grant", "Grant")
63
63
  },
64
64
  {
65
65
  value: "equipment",
66
- label: k("healthybowl.governmentSchemes.schemeDiscovery.categories.equipment", "Equipment")
66
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.equipment", "Equipment")
67
67
  }
68
- ], [k]), Oe = m(() => [
68
+ ], [A]), Oe = h(() => [
69
69
  {
70
70
  value: "all",
71
- label: k("healthybowl.common.all", "All")
71
+ label: A("healthybowl.common.all", "All")
72
72
  },
73
73
  {
74
74
  value: "open",
75
- label: k("healthybowl.governmentSchemes.schemeDiscovery.statuses.open", "Open")
75
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.open", "Open")
76
76
  },
77
77
  {
78
78
  value: "closing_soon",
79
- label: k("healthybowl.governmentSchemes.schemeDiscovery.statuses.closingSoon", "Closing Soon")
79
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.closingSoon", "Closing Soon")
80
80
  },
81
81
  {
82
82
  value: "closed",
83
- label: k("healthybowl.governmentSchemes.schemeDiscovery.statuses.closed", "Closed")
83
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.closed", "Closed")
84
84
  },
85
85
  {
86
86
  value: "expired",
87
- label: k("healthybowl.governmentSchemes.schemeDiscovery.statuses.expired", "Expired")
87
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.expired", "Expired")
88
88
  }
89
- ], [k]), j = m(() => [
89
+ ], [A]), M = h(() => [
90
90
  {
91
91
  value: "deadline",
92
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.deadline", "Deadline (Soonest)")
92
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.deadline", "Deadline (Soonest)")
93
93
  },
94
94
  {
95
95
  value: "deadline-latest",
96
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.deadlineLatest", "Deadline (Latest)")
96
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.deadlineLatest", "Deadline (Latest)")
97
97
  },
98
98
  {
99
99
  value: "amount",
100
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.amount", "Amount (Highest)")
100
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.amount", "Amount (Highest)")
101
101
  },
102
102
  {
103
103
  value: "amount-low",
104
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.amountLow", "Amount (Lowest)")
104
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.amountLow", "Amount (Lowest)")
105
105
  },
106
106
  {
107
107
  value: "name",
108
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.name", "Name (A–Z)")
108
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.name", "Name (A–Z)")
109
109
  },
110
110
  {
111
111
  value: "name-desc",
112
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.nameDesc", "Name (Z–A)")
112
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.nameDesc", "Name (Z–A)")
113
113
  },
114
114
  {
115
115
  value: "country",
116
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.country", "Country (A–Z)")
116
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.country", "Country (A–Z)")
117
117
  },
118
118
  {
119
119
  value: "recent",
120
- label: k("healthybowl.governmentSchemes.schemeDiscovery.sort.recent", "Recently Added")
120
+ label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.recent", "Recently Added")
121
121
  }
122
- ], [k]), ke = de(), { buildPath: Ae } = a(), { toasts: je, toast: M, dismiss: Me } = d(), [N, P] = h(""), [F, I] = h("all"), [L, R] = h("all"), [z, B] = h([]), [V, H] = h("all"), [U, Ne] = h("all"), [W, Pe] = h(""), [G, K] = h(""), [q, J] = h(""), [Y, X] = h("deadline"), [Fe, Ie] = h(/* @__PURE__ */ new Set()), [Z, Le] = h(!1), Re = m(() => V === "all" ? j.filter((e) => e.value !== "amount" && e.value !== "amount-low") : j, [V, j]), ze = m(() => {
122
+ ], [A]), ke = fe(), { buildPath: Ae } = a(), { toasts: je, toast: N, dismiss: Me } = d(), [P, F] = g(""), [I, L] = g("all"), [R, z] = g("all"), [B, V] = g([]), [H, U] = g("all"), [W, G] = g("all"), [K, Ne] = g(""), [q, J] = g(""), [Y, X] = g(""), [Z, Q] = g("deadline"), [Pe, Fe] = g(/* @__PURE__ */ new Set()), [Ie, Le] = g(!1), Re = h(() => H === "all" ? M.filter((e) => e.value !== "amount" && e.value !== "amount-low") : M, [H, M]), ze = h(() => {
123
123
  let e = /* @__PURE__ */ new Set();
124
- for (let t of A) {
124
+ for (let t of j) {
125
125
  let n = (t.country ?? "").trim();
126
126
  n && e.add(n);
127
127
  }
128
128
  return Array.from(e).sort((e, t) => e.localeCompare(t));
129
- }, [A]), Be = m(() => {
130
- let e = new Set(A.map((e) => e.currency));
129
+ }, [j]), Be = h(() => {
130
+ let e = new Set(j.map((e) => e.currency));
131
131
  return Array.from(e).sort((e, t) => e.localeCompare(t));
132
- }, [A]), Ve = m(() => {
132
+ }, [j]), Ve = h(() => {
133
133
  let e = 0;
134
- return N.trim() && (e += 1), F !== "all" && (e += 1), L !== "all" && (e += 1), z.length > 0 && (e += 1), V !== "all" && (e += 1), U !== "all" && (e += 1), W.trim() && (e += 1), (G.trim() || q.trim()) && (e += 1), e;
134
+ return P.trim() && (e += 1), I !== "all" && (e += 1), R !== "all" && (e += 1), B.length > 0 && (e += 1), H !== "all" && (e += 1), W !== "all" && (e += 1), K.trim() && (e += 1), (q.trim() || Y.trim()) && (e += 1), e;
135
135
  }, [
136
- N,
137
- F,
138
- L,
139
- z,
140
- V,
141
- U,
136
+ P,
137
+ I,
138
+ R,
139
+ B,
140
+ H,
142
141
  W,
143
- G,
144
- q
145
- ]), He = V === "all" ? k("healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency", "Select a currency") : V, Q = m(() => {
146
- let e = G === "" ? null : Number(G), t = q === "" ? null : Number(q), n = r(), i = A.filter((r) => {
142
+ K,
143
+ q,
144
+ Y
145
+ ]), He = H === "all" ? A("healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency", "Select a currency") : H, $ = h(() => {
146
+ let e = q === "" ? null : Number(q), t = Y === "" ? null : Number(Y), n = r(), i = j.filter((r) => {
147
147
  let i = [
148
148
  r.title ?? "",
149
149
  r.department ?? "",
150
150
  r.description ?? "",
151
151
  r.benefits ?? "",
152
152
  ...r.eligibility ?? []
153
- ].join("\n").toLowerCase(), a = N.trim().toLowerCase(), o = W.trim().toLowerCase(), s = a === "" || i.includes(a), c = o === "" || i.includes(o), l = F === "all" || r.category === F, u = L === "all" || f(r, n) === L, d = z.length === 0 || z.includes((r.country ?? "").trim()), ee = V === "all" || r.currency === V, p = U === "all" || (U === "with" ? !!r.applicationDeadline : !r.applicationDeadline), m = te(r, {
154
- currency: V,
153
+ ].join("\n").toLowerCase(), a = P.trim().toLowerCase(), o = K.trim().toLowerCase(), s = a === "" || i.includes(a), c = o === "" || i.includes(o), l = te(r, I), u = R === "all" || p(r, n) === R, d = B.length === 0 || B.includes((r.country ?? "").trim()), f = H === "all" || r.currency === H, m = W === "all" || (W === "with" ? !!r.applicationDeadline : !r.applicationDeadline), h = ee(r, {
154
+ currency: H,
155
155
  min: e,
156
156
  max: t
157
157
  });
158
- return s && c && l && u && d && ee && p && m;
158
+ return s && c && l && u && d && f && m && h;
159
159
  });
160
160
  return i = [...i].sort((e, t) => {
161
- switch (Y) {
161
+ switch (Z) {
162
162
  case "deadline": return !e.applicationDeadline && !t.applicationDeadline ? 0 : e.applicationDeadline ? t.applicationDeadline ? new Date(e.applicationDeadline).getTime() - new Date(t.applicationDeadline).getTime() : -1 : 1;
163
163
  case "deadline-latest": return !e.applicationDeadline && !t.applicationDeadline ? 0 : e.applicationDeadline ? t.applicationDeadline ? new Date(t.applicationDeadline).getTime() - new Date(e.applicationDeadline).getTime() : -1 : 1;
164
- case "amount": return V === "all" ? 0 : (t.maxAmount ?? 0) - (e.maxAmount ?? 0);
165
- case "amount-low": return V === "all" ? 0 : (e.maxAmount ?? 0) - (t.maxAmount ?? 0);
164
+ case "amount": return H === "all" ? 0 : (t.maxAmount ?? 0) - (e.maxAmount ?? 0);
165
+ case "amount-low": return H === "all" ? 0 : (e.maxAmount ?? 0) - (t.maxAmount ?? 0);
166
166
  case "name": return (e.title ?? "").localeCompare(t.title ?? "");
167
167
  case "name-desc": return (t.title ?? "").localeCompare(e.title ?? "");
168
168
  case "country": return (e.country ?? "").localeCompare(t.country ?? "");
@@ -170,44 +170,44 @@ var xe = (e) => {
170
170
  }
171
171
  }), i;
172
172
  }, [
173
- A,
174
- N,
173
+ j,
174
+ P,
175
+ K,
176
+ I,
177
+ R,
178
+ B,
179
+ H,
175
180
  W,
176
- F,
177
- L,
178
- z,
179
- V,
180
- U,
181
- G,
182
181
  q,
183
- Y
182
+ Y,
183
+ Z
184
184
  ]), Ue = (e) => {
185
- B((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
185
+ V((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
186
186
  }, We = (e) => {
187
- H(e), e === "all" && (K(""), J(""), (Y === "amount" || Y === "amount-low") && X("deadline"));
187
+ U(e), e === "all" && (J(""), X(""), (Z === "amount" || Z === "amount-low") && Q("deadline"));
188
188
  }, Ge = () => {
189
- P(""), I("all"), R("all"), B([]), H("all"), Ne("all"), Pe(""), K(""), J(""), X("deadline");
189
+ F(""), L("all"), z("all"), V([]), U("all"), G("all"), Ne(""), J(""), X(""), Q("deadline");
190
190
  }, Ke = (e) => {
191
- let t = f(e, r());
192
- if (!p(e, r())) {
191
+ let t = p(e, r());
192
+ if (!m(e, r())) {
193
193
  let e = t === "expired";
194
- M({
195
- title: e ? k("healthybowl.governmentSchemes.schemeDiscovery.toast.expired.title", "Scheme Expired") : k("healthybowl.governmentSchemes.schemeDiscovery.toast.closed.title", "Scheme Closed"),
196
- description: e ? k("healthybowl.governmentSchemes.schemeDiscovery.toast.expired.description", "The application deadline for this scheme has passed.") : k("healthybowl.governmentSchemes.schemeDiscovery.toast.closed.description", "This scheme is no longer accepting applications."),
194
+ N({
195
+ title: e ? A("healthybowl.governmentSchemes.schemeDiscovery.toast.expired.title", "Scheme Expired") : A("healthybowl.governmentSchemes.schemeDiscovery.toast.closed.title", "Scheme Closed"),
196
+ description: e ? A("healthybowl.governmentSchemes.schemeDiscovery.toast.expired.description", "The application deadline for this scheme has passed.") : A("healthybowl.governmentSchemes.schemeDiscovery.toast.closed.description", "This scheme is no longer accepting applications."),
197
197
  variant: "error"
198
198
  });
199
199
  return;
200
200
  }
201
201
  ke(Ae(`government-schemes/schemes/${e.id}`));
202
202
  }, qe = (e) => {
203
- Ie((t) => {
203
+ Fe((t) => {
204
204
  let n = new Set(t);
205
- return n.has(e) ? (n.delete(e), M({
206
- title: k("healthybowl.governmentSchemes.schemeDiscovery.toast.removed.title", "Removed from saved"),
205
+ return n.has(e) ? (n.delete(e), N({
206
+ title: A("healthybowl.governmentSchemes.schemeDiscovery.toast.removed.title", "Removed from saved"),
207
207
  variant: "info"
208
- })) : (n.add(e), M({
209
- title: k("healthybowl.governmentSchemes.schemeDiscovery.toast.saved.title", "Saved for this session"),
210
- description: k("healthybowl.governmentSchemes.schemeDiscovery.toast.saved.description", "Saved schemes aren't stored permanently yet — this resets when you leave."),
208
+ })) : (n.add(e), N({
209
+ title: A("healthybowl.governmentSchemes.schemeDiscovery.toast.saved.title", "Saved for this session"),
210
+ description: A("healthybowl.governmentSchemes.schemeDiscovery.toast.saved.description", "Saved schemes aren't stored permanently yet — this resets when you leave."),
211
211
  variant: "info"
212
212
  })), n;
213
213
  });
@@ -215,20 +215,20 @@ var xe = (e) => {
215
215
  if (!e) return null;
216
216
  let t = (/* @__PURE__ */ new Date(`${e.slice(0, 10)}T12:00:00`)).getTime(), n = (/* @__PURE__ */ new Date(`${r()}T12:00:00`)).getTime();
217
217
  return Math.max(0, Math.round((t - n) / (1e3 * 60 * 60 * 24)));
218
- }, $ = V === "all" ? k("healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency", "Select a currency") : He;
218
+ }, Ye = H === "all" ? A("healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency", "Select a currency") : He;
219
219
  return /* @__PURE__ */ b(i, {
220
- title: k("healthybowl.governmentSchemes.schemeDiscovery.title", "Discover Schemes"),
221
- description: k("healthybowl.governmentSchemes.schemeDiscovery.description", "Find government schemes for your farm"),
220
+ title: A("healthybowl.governmentSchemes.schemeDiscovery.title", "Discover Schemes"),
221
+ description: A("healthybowl.governmentSchemes.schemeDiscovery.description", "Find government schemes for your farm"),
222
222
  purpose: "Browse and search government schemes your farm may qualify for — subsidies, grants and support programs. Find the ones that fit, then apply and track them so you don't leave money on the table.",
223
223
  children: [
224
224
  /* @__PURE__ */ b("div", {
225
225
  className: "relative",
226
226
  children: [/* @__PURE__ */ y(_, { className: "absolute start-4 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ y("input", {
227
227
  type: "text",
228
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.search.label", "Search schemes"),
229
- value: N,
230
- onChange: (e) => P(e.target.value),
231
- placeholder: k("healthybowl.governmentSchemes.schemeDiscovery.search.placeholder", "Search schemes by name, department, description, benefits or eligibility..."),
228
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.search.label", "Search schemes"),
229
+ value: P,
230
+ onChange: (e) => F(e.target.value),
231
+ placeholder: A("healthybowl.governmentSchemes.schemeDiscovery.search.placeholder", "Search schemes by name, department, description, benefits or eligibility..."),
232
232
  className: "h-12 w-full rounded-lg border border-border-subtle bg-bg-surface ps-12 pe-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-1"
233
233
  })]
234
234
  }),
@@ -236,8 +236,8 @@ var xe = (e) => {
236
236
  className: "flex flex-wrap items-center gap-2",
237
237
  children: De.map((t) => /* @__PURE__ */ y("button", {
238
238
  type: "button",
239
- onClick: () => I(t.value),
240
- className: e("rounded-full px-3 py-1.5 text-xs font-medium transition-colors", F === t.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"),
239
+ onClick: () => L(t.value),
240
+ className: e("rounded-full px-3 py-1.5 text-xs font-medium transition-colors", I === t.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"),
241
241
  children: t.label
242
242
  }, t.value))
243
243
  }),
@@ -250,48 +250,48 @@ var xe = (e) => {
250
250
  className: "flex min-w-[200px] flex-1 flex-col gap-1",
251
251
  children: [/* @__PURE__ */ y("span", {
252
252
  className: "text-xs font-medium text-text-secondary",
253
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel", "Country / Region")
253
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel", "Country / Region")
254
254
  }), /* @__PURE__ */ b(ve, {
255
- open: Z,
255
+ open: Ie,
256
256
  onOpenChange: Le,
257
257
  children: [/* @__PURE__ */ y(be, {
258
258
  asChild: !0,
259
259
  children: /* @__PURE__ */ b(S, {
260
260
  variant: "outline",
261
261
  role: "combobox",
262
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel", "Country / Region"),
263
- "aria-expanded": Z,
262
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel", "Country / Region"),
263
+ "aria-expanded": Ie,
264
264
  className: "h-9 w-full justify-between px-3 font-normal",
265
265
  children: [/* @__PURE__ */ y("span", {
266
266
  className: "truncate",
267
- children: z.length === 0 ? k("healthybowl.common.all", "All") : z.length === 1 ? z[0] : k("healthybowl.governmentSchemes.schemeDiscovery.filters.nSelected", "{{count}} selected", { count: z.length })
268
- }), /* @__PURE__ */ y(oe, { className: "ms-2 h-4 w-4 shrink-0 opacity-50" })]
267
+ children: B.length === 0 ? A("healthybowl.common.all", "All") : B.length === 1 ? B[0] : A("healthybowl.governmentSchemes.schemeDiscovery.filters.nSelected", "{{count}} selected", { count: B.length })
268
+ }), /* @__PURE__ */ y(se, { className: "ms-2 h-4 w-4 shrink-0 opacity-50" })]
269
269
  })
270
270
  }), /* @__PURE__ */ y(ye, {
271
271
  className: "w-[280px] p-0",
272
- children: /* @__PURE__ */ b(fe, { children: [/* @__PURE__ */ y(he, { placeholder: k("healthybowl.governmentSchemes.schemeDiscovery.filters.countrySearch", "Search country...") }), /* @__PURE__ */ b(_e, {
272
+ children: /* @__PURE__ */ b(pe, { children: [/* @__PURE__ */ y(ge, { placeholder: A("healthybowl.governmentSchemes.schemeDiscovery.filters.countrySearch", "Search country...") }), /* @__PURE__ */ b(_e, {
273
273
  "aria-multiselectable": "true",
274
- children: [/* @__PURE__ */ y(pe, { children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.countryEmpty", "No country found.") }), /* @__PURE__ */ b(me, { children: [/* @__PURE__ */ b(ge, {
274
+ children: [/* @__PURE__ */ y(me, { children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.countryEmpty", "No country found.") }), /* @__PURE__ */ b(he, { children: [/* @__PURE__ */ b(C, {
275
275
  value: Ce,
276
276
  role: "option",
277
- "aria-selected": z.length === 0,
278
- onSelect: () => B([]),
277
+ "aria-selected": B.length === 0,
278
+ onSelect: () => V([]),
279
279
  children: [/* @__PURE__ */ y("div", {
280
280
  "aria-hidden": "true",
281
- className: e("me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle", z.length === 0 ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-surface text-transparent"),
282
- children: /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" })
283
- }), k("healthybowl.common.all", "All")]
284
- }), ze.map((t) => /* @__PURE__ */ b(ge, {
281
+ className: e("me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle", B.length === 0 ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-surface text-transparent"),
282
+ children: /* @__PURE__ */ y(ae, { className: "h-3.5 w-3.5" })
283
+ }), A("healthybowl.common.all", "All")]
284
+ }), ze.map((t) => /* @__PURE__ */ b(C, {
285
285
  value: t,
286
286
  role: "option",
287
- "aria-selected": z.includes(t),
287
+ "aria-selected": B.includes(t),
288
288
  onSelect: () => {
289
289
  Ue(t);
290
290
  },
291
291
  children: [/* @__PURE__ */ y("div", {
292
292
  "aria-hidden": "true",
293
- className: e("me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle", z.includes(t) ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-surface text-transparent"),
294
- children: /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" })
293
+ className: e("me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle", B.includes(t) ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-surface text-transparent"),
294
+ children: /* @__PURE__ */ y(ae, { className: "h-3.5 w-3.5" })
295
295
  }), t]
296
296
  }, t))] })]
297
297
  })] })
@@ -302,18 +302,18 @@ var xe = (e) => {
302
302
  className: "flex min-w-[140px] flex-col gap-1",
303
303
  children: [/* @__PURE__ */ y("span", {
304
304
  className: "text-xs font-medium text-text-secondary",
305
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel", "Currency")
306
- }), /* @__PURE__ */ b(w, {
307
- value: V,
305
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel", "Currency")
306
+ }), /* @__PURE__ */ b(T, {
307
+ value: H,
308
308
  onValueChange: We,
309
- children: [/* @__PURE__ */ y(D, {
309
+ children: [/* @__PURE__ */ y(O, {
310
310
  className: "h-9 w-full",
311
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel", "Currency"),
312
- children: /* @__PURE__ */ y(O, { placeholder: k("healthybowl.common.all", "All") })
313
- }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
311
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel", "Currency"),
312
+ children: /* @__PURE__ */ y(k, { placeholder: A("healthybowl.common.all", "All") })
313
+ }), /* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, {
314
314
  value: "all",
315
- children: k("healthybowl.common.all", "All")
316
- }), Be.map((e) => /* @__PURE__ */ y(E, {
315
+ children: A("healthybowl.common.all", "All")
316
+ }), Be.map((e) => /* @__PURE__ */ y(D, {
317
317
  value: e,
318
318
  children: e
319
319
  }, e))] })]
@@ -323,15 +323,15 @@ var xe = (e) => {
323
323
  className: "flex min-w-[140px] flex-col gap-1",
324
324
  children: [/* @__PURE__ */ y("span", {
325
325
  className: "text-xs font-medium text-text-secondary",
326
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel", "Status")
327
- }), /* @__PURE__ */ b(w, {
328
- value: L,
329
- onValueChange: (e) => R(e),
330
- children: [/* @__PURE__ */ y(D, {
326
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel", "Status")
327
+ }), /* @__PURE__ */ b(T, {
328
+ value: R,
329
+ onValueChange: (e) => z(e),
330
+ children: [/* @__PURE__ */ y(O, {
331
331
  className: "h-9 w-full",
332
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel", "Status"),
333
- children: /* @__PURE__ */ y(O, {})
334
- }), /* @__PURE__ */ y(T, { children: Oe.map((e) => /* @__PURE__ */ y(E, {
332
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel", "Status"),
333
+ children: /* @__PURE__ */ y(k, {})
334
+ }), /* @__PURE__ */ y(E, { children: Oe.map((e) => /* @__PURE__ */ y(D, {
335
335
  value: e.value,
336
336
  children: e.label
337
337
  }, e.value)) })]
@@ -341,26 +341,26 @@ var xe = (e) => {
341
341
  className: "flex min-w-[160px] flex-col gap-1",
342
342
  children: [/* @__PURE__ */ y("span", {
343
343
  className: "text-xs font-medium text-text-secondary",
344
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel", "Deadline")
345
- }), /* @__PURE__ */ b(w, {
346
- value: U,
347
- onValueChange: (e) => Ne(e),
348
- children: [/* @__PURE__ */ y(D, {
344
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel", "Deadline")
345
+ }), /* @__PURE__ */ b(T, {
346
+ value: W,
347
+ onValueChange: (e) => G(e),
348
+ children: [/* @__PURE__ */ y(O, {
349
349
  className: "h-9 w-full",
350
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel", "Deadline"),
351
- children: /* @__PURE__ */ y(O, {})
352
- }), /* @__PURE__ */ b(T, { children: [
353
- /* @__PURE__ */ y(E, {
350
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel", "Deadline"),
351
+ children: /* @__PURE__ */ y(k, {})
352
+ }), /* @__PURE__ */ b(E, { children: [
353
+ /* @__PURE__ */ y(D, {
354
354
  value: "all",
355
- children: k("healthybowl.common.all", "All")
355
+ children: A("healthybowl.common.all", "All")
356
356
  }),
357
- /* @__PURE__ */ y(E, {
357
+ /* @__PURE__ */ y(D, {
358
358
  value: "with",
359
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWith", "Has deadline")
359
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWith", "Has deadline")
360
360
  }),
361
- /* @__PURE__ */ y(E, {
361
+ /* @__PURE__ */ y(D, {
362
362
  value: "without",
363
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWithout", "No deadline")
363
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWithout", "No deadline")
364
364
  })
365
365
  ] })]
366
366
  })]
@@ -369,15 +369,15 @@ var xe = (e) => {
369
369
  className: "flex min-w-[200px] flex-1 flex-col gap-1",
370
370
  children: [/* @__PURE__ */ y("span", {
371
371
  className: "text-xs font-medium text-text-secondary",
372
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel", "Topic / Crop")
372
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel", "Topic / Crop")
373
373
  }), /* @__PURE__ */ b("div", {
374
374
  className: "relative",
375
- children: [/* @__PURE__ */ y(_, { className: "absolute start-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ y(C, {
375
+ children: [/* @__PURE__ */ y(_, { className: "absolute start-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ y(w, {
376
376
  type: "text",
377
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel", "Topic / Crop"),
378
- value: W,
379
- onChange: (e) => Pe(e.target.value),
380
- placeholder: k("healthybowl.governmentSchemes.schemeDiscovery.filters.topicPlaceholder", "e.g. horticulture, organic, rice..."),
377
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel", "Topic / Crop"),
378
+ value: K,
379
+ onChange: (e) => Ne(e.target.value),
380
+ placeholder: A("healthybowl.governmentSchemes.schemeDiscovery.filters.topicPlaceholder", "e.g. horticulture, organic, rice..."),
381
381
  className: "h-9 ps-8"
382
382
  })]
383
383
  })]
@@ -387,40 +387,40 @@ var xe = (e) => {
387
387
  children: [
388
388
  /* @__PURE__ */ y("span", {
389
389
  className: "text-xs font-medium text-text-secondary",
390
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.amountLabel", "Amount ({{currency}})", { currency: He })
390
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.amountLabel", "Amount ({{currency}})", { currency: He })
391
391
  }),
392
392
  /* @__PURE__ */ b("div", {
393
393
  className: "flex items-center gap-2",
394
394
  children: [
395
- /* @__PURE__ */ y(C, {
395
+ /* @__PURE__ */ y(w, {
396
396
  type: "number",
397
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.minAmountLabel", "Minimum amount"),
397
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.minAmountLabel", "Minimum amount"),
398
398
  min: 0,
399
- disabled: V === "all",
400
- value: G,
401
- onChange: (e) => K(e.target.value),
402
- placeholder: k("healthybowl.governmentSchemes.schemeDiscovery.filters.minAmount", "Min {{currency}}", { currency: $ }),
399
+ disabled: H === "all",
400
+ value: q,
401
+ onChange: (e) => J(e.target.value),
402
+ placeholder: A("healthybowl.governmentSchemes.schemeDiscovery.filters.minAmount", "Min {{currency}}", { currency: Ye }),
403
403
  className: "h-9"
404
404
  }),
405
405
  /* @__PURE__ */ y("span", {
406
406
  className: "text-text-secondary",
407
407
  children: "-"
408
408
  }),
409
- /* @__PURE__ */ y(C, {
409
+ /* @__PURE__ */ y(w, {
410
410
  type: "number",
411
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmountLabel", "Maximum amount"),
411
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmountLabel", "Maximum amount"),
412
412
  min: 0,
413
- disabled: V === "all",
414
- value: q,
415
- onChange: (e) => J(e.target.value),
416
- placeholder: k("healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmount", "Max {{currency}}", { currency: $ }),
413
+ disabled: H === "all",
414
+ value: Y,
415
+ onChange: (e) => X(e.target.value),
416
+ placeholder: A("healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmount", "Max {{currency}}", { currency: Ye }),
417
417
  className: "h-9"
418
418
  })
419
419
  ]
420
420
  }),
421
- V === "all" ? /* @__PURE__ */ y("p", {
421
+ H === "all" ? /* @__PURE__ */ y("p", {
422
422
  className: "text-xs text-text-secondary",
423
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.amountCurrencyRequired", "Select one currency before filtering or sorting by amount.")
423
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.amountCurrencyRequired", "Select one currency before filtering or sorting by amount.")
424
424
  }) : null
425
425
  ]
426
426
  })
@@ -435,16 +435,16 @@ var xe = (e) => {
435
435
  "data-testid": "scheme-active-filter-count",
436
436
  "aria-live": "polite",
437
437
  className: "tabular-nums",
438
- children: k("healthybowl.governmentSchemes.schemeDiscovery.filters.activeCount", "{{count}} active filters", { count: Ve })
438
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.activeCount", "{{count}} active filters", { count: Ve })
439
439
  }),
440
- z.map((e) => /* @__PURE__ */ b(x, {
440
+ B.map((e) => /* @__PURE__ */ b(x, {
441
441
  variant: "secondary",
442
442
  className: "gap-1",
443
443
  children: [e, /* @__PURE__ */ y("button", {
444
444
  type: "button",
445
445
  onClick: () => Ue(e),
446
446
  className: "rounded-full outline-none ring-offset-1 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]",
447
- "aria-label": k("healthybowl.common.remove", "Remove"),
447
+ "aria-label": A("healthybowl.common.remove", "Remove"),
448
448
  children: /* @__PURE__ */ y(v, { className: "h-3 w-3" })
449
449
  })]
450
450
  }, e)),
@@ -453,19 +453,19 @@ var xe = (e) => {
453
453
  size: "sm",
454
454
  onClick: Ge,
455
455
  className: "h-7 px-2 text-xs",
456
- children: [/* @__PURE__ */ y(v, { className: "me-1 h-3 w-3" }), k("healthybowl.governmentSchemes.schemeDiscovery.actions.clearAll", "Clear all")]
456
+ children: [/* @__PURE__ */ y(v, { className: "me-1 h-3 w-3" }), A("healthybowl.governmentSchemes.schemeDiscovery.actions.clearAll", "Clear all")]
457
457
  })
458
458
  ]
459
459
  }), /* @__PURE__ */ b("div", {
460
460
  className: "flex items-center gap-2",
461
- children: [/* @__PURE__ */ y(ue, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ b(w, {
462
- value: Y,
463
- onValueChange: (e) => X(e),
464
- children: [/* @__PURE__ */ y(D, {
461
+ children: [/* @__PURE__ */ y(de, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ b(T, {
462
+ value: Z,
463
+ onValueChange: (e) => Q(e),
464
+ children: [/* @__PURE__ */ y(O, {
465
465
  className: "h-9 w-auto",
466
- "aria-label": k("healthybowl.governmentSchemes.schemeDiscovery.sort.label", "Sort schemes"),
467
- children: /* @__PURE__ */ y(O, {})
468
- }), /* @__PURE__ */ y(T, { children: Re.map((e) => /* @__PURE__ */ y(E, {
466
+ "aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.sort.label", "Sort schemes"),
467
+ children: /* @__PURE__ */ y(k, {})
468
+ }), /* @__PURE__ */ y(E, { children: Re.map((e) => /* @__PURE__ */ y(D, {
469
469
  value: e.value,
470
470
  children: e.label
471
471
  }, e.value)) })]
@@ -475,20 +475,20 @@ var xe = (e) => {
475
475
  }),
476
476
  /* @__PURE__ */ y("p", {
477
477
  className: "text-sm text-text-secondary",
478
- children: Q.length === 1 ? k("healthybowl.governmentSchemes.schemeDiscovery.resultCount.one", "{{count}} scheme found", { count: Q.length }) : k("healthybowl.governmentSchemes.schemeDiscovery.resultCount.other", "{{count}} schemes found", { count: Q.length })
478
+ children: $.length === 1 ? A("healthybowl.governmentSchemes.schemeDiscovery.resultCount.one", "{{count}} scheme found", { count: $.length }) : A("healthybowl.governmentSchemes.schemeDiscovery.resultCount.other", "{{count}} schemes found", { count: $.length })
479
479
  }),
480
- Q.length === 0 ? Te.government ? /* @__PURE__ */ y(u, {}) : we.government ? /* @__PURE__ */ y(c, { onRetry: Ee }) : /* @__PURE__ */ y(s, {
480
+ $.length === 0 ? Te.government ? /* @__PURE__ */ y(u, {}) : we.government ? /* @__PURE__ */ y(c, { onRetry: Ee }) : /* @__PURE__ */ y(s, {
481
481
  illustration: "empty-search",
482
- title: k("healthybowl.governmentSchemes.schemeDiscovery.emptyState.title", "No Schemes Found"),
483
- description: k("healthybowl.governmentSchemes.schemeDiscovery.emptyState.description", "Try adjusting your search or filter criteria to find matching schemes."),
482
+ title: A("healthybowl.governmentSchemes.schemeDiscovery.emptyState.title", "No Schemes Found"),
483
+ description: A("healthybowl.governmentSchemes.schemeDiscovery.emptyState.description", "Try adjusting your search or filter criteria to find matching schemes."),
484
484
  action: /* @__PURE__ */ y(S, {
485
485
  onClick: Ge,
486
- children: k("healthybowl.governmentSchemes.schemeDiscovery.emptyState.clearFilters", "Clear Filters")
486
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.emptyState.clearFilters", "Clear Filters")
487
487
  })
488
488
  }) : /* @__PURE__ */ y("div", {
489
489
  className: "grid gap-4 sm:grid-cols-2",
490
- children: Q.map((i) => {
491
- let a = Je(i.applicationDeadline), s = Fe.has(i.id), c = i.currency, l = f(i, r()), u = p(i, r());
490
+ children: $.map((i) => {
491
+ let a = Je(i.applicationDeadline), s = Pe.has(i.id), c = i.currency, l = p(i, r()), u = m(i, r());
492
492
  return /* @__PURE__ */ b("div", {
493
493
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
494
494
  children: [
@@ -496,7 +496,7 @@ var xe = (e) => {
496
496
  className: "flex items-start justify-between",
497
497
  children: [/* @__PURE__ */ b("div", {
498
498
  className: "flex items-center gap-2",
499
- children: [/* @__PURE__ */ y(le, { className: "h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ y("h3", {
499
+ children: [/* @__PURE__ */ y(ue, { className: "h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ y("h3", {
500
500
  className: "text-sm font-semibold text-text-primary",
501
501
  children: i.title
502
502
  })]
@@ -530,19 +530,19 @@ var xe = (e) => {
530
530
  className: "mt-3",
531
531
  children: [/* @__PURE__ */ y("p", {
532
532
  className: "text-xs font-medium text-text-primary",
533
- children: k("healthybowl.governmentSchemes.schemeDiscovery.card.eligibilityLabel", "Eligibility:")
533
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.card.eligibilityLabel", "Eligibility:")
534
534
  }), /* @__PURE__ */ b("ul", {
535
535
  className: "mt-1 space-y-0.5",
536
536
  children: [(i.eligibility ?? []).slice(0, 3).map((e) => /* @__PURE__ */ b("li", {
537
537
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
538
538
  children: [
539
- /* @__PURE__ */ y(ae, { className: "h-3 w-3 shrink-0 text-primary" }),
539
+ /* @__PURE__ */ y(oe, { className: "h-3 w-3 shrink-0 text-primary" }),
540
540
  " ",
541
541
  e
542
542
  ]
543
543
  }, e)), (i.eligibility ?? []).length > 3 && /* @__PURE__ */ y("li", {
544
544
  className: "text-xs text-text-secondary",
545
- children: k("healthybowl.governmentSchemes.schemeDiscovery.card.moreCriteria", "+{{count}} more criteria", { count: (i.eligibility ?? []).length - 3 })
545
+ children: A("healthybowl.governmentSchemes.schemeDiscovery.card.moreCriteria", "+{{count}} more criteria", { count: (i.eligibility ?? []).length - 3 })
546
546
  })]
547
547
  })]
548
548
  }),
@@ -555,15 +555,15 @@ var xe = (e) => {
555
555
  children: [
556
556
  i.maxAmount && /* @__PURE__ */ b("span", {
557
557
  className: "flex items-center gap-1",
558
- children: [/* @__PURE__ */ y(ce, { className: "h-3 w-3" }), k("healthybowl.governmentSchemes.schemeDiscovery.card.maxAmount", "Up to {{amount}}", { amount: t(i.maxAmount, c) })]
558
+ children: [/* @__PURE__ */ y(le, { className: "h-3 w-3" }), A("healthybowl.governmentSchemes.schemeDiscovery.card.maxAmount", "Up to {{amount}}", { amount: t(i.maxAmount, c) })]
559
559
  }),
560
560
  i.applicationDeadline && /* @__PURE__ */ b("span", {
561
561
  className: "flex items-center gap-1",
562
- children: [/* @__PURE__ */ y(ie, { className: "h-3 w-3" }), k("healthybowl.governmentSchemes.schemeDiscovery.card.deadline", "Deadline: {{date}}", { date: n(i.applicationDeadline) })]
562
+ children: [/* @__PURE__ */ y(ie, { className: "h-3 w-3" }), A("healthybowl.governmentSchemes.schemeDiscovery.card.deadline", "Deadline: {{date}}", { date: n(i.applicationDeadline) })]
563
563
  }),
564
564
  a != null && a > 0 && /* @__PURE__ */ b("span", {
565
565
  className: "flex items-center gap-1",
566
- children: [/* @__PURE__ */ y(se, { className: "h-3 w-3" }), a === 1 ? k("healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.one", "{{count}} day left", { count: a }) : k("healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.other", "{{count}} days left", { count: a })]
566
+ children: [/* @__PURE__ */ y(ce, { className: "h-3 w-3" }), a === 1 ? A("healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.one", "{{count}} day left", { count: a }) : A("healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.other", "{{count}} days left", { count: a })]
567
567
  })
568
568
  ]
569
569
  }),
@@ -574,11 +574,11 @@ var xe = (e) => {
574
574
  size: "sm",
575
575
  onClick: () => qe(i.id),
576
576
  className: e(s ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:bg-bg-sunken"),
577
- children: [/* @__PURE__ */ y(re, { className: e("h-3.5 w-3.5", s && "fill-current") }), s ? k("healthybowl.governmentSchemes.schemeDiscovery.actions.saved", "Saved") : k("healthybowl.governmentSchemes.schemeDiscovery.actions.saveForLater", "Save for Later")]
577
+ children: [/* @__PURE__ */ y(re, { className: e("h-3.5 w-3.5", s && "fill-current") }), s ? A("healthybowl.governmentSchemes.schemeDiscovery.actions.saved", "Saved") : A("healthybowl.governmentSchemes.schemeDiscovery.actions.saveForLater", "Save for Later")]
578
578
  }), /* @__PURE__ */ y(S, {
579
579
  size: "sm",
580
580
  onClick: () => Ke(i),
581
- children: u ? k("healthybowl.governmentSchemes.schemeDiscovery.actions.applyNow", "Apply Now") : l === "expired" ? k("healthybowl.governmentSchemes.schemeDiscovery.actions.expired", "Expired") : k("healthybowl.governmentSchemes.schemeDiscovery.actions.closed", "Closed")
581
+ children: u ? A("healthybowl.governmentSchemes.schemeDiscovery.actions.applyNow", "Apply Now") : l === "expired" ? A("healthybowl.governmentSchemes.schemeDiscovery.actions.expired", "Expired") : A("healthybowl.governmentSchemes.schemeDiscovery.actions.closed", "Closed")
582
582
  })]
583
583
  })
584
584
  ]
@@ -593,6 +593,6 @@ var xe = (e) => {
593
593
  });
594
594
  };
595
595
  //#endregion
596
- export { k as SchemeDiscoveryPage };
596
+ export { A as SchemeDiscoveryPage };
597
597
 
598
598
  //# sourceMappingURL=SchemeDiscoveryPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemeDiscoveryPage.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/SchemeDiscoveryPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Landmark,\n CheckCircle,\n Bookmark,\n CalendarDays,\n DollarSign,\n Clock,\n Search,\n Check,\n ChevronDown,\n X,\n SlidersHorizontal,\n} from 'lucide-react';\nimport {\n Button,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Input,\n Badge,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { formatCurrency, formatDate, cn, todayLocalDate } from '../../utils/helpers';\nimport type { GovernmentScheme } from '../../types';\nimport { getEffectiveSchemeStatus, isAcceptingSchemeApplications, matchesSchemeAmount } from './schemeDiscoveryFilters';\n\nconst statusVariant = (s: string) => {\n switch (s) {\n case 'open':\n return 'success' as const;\n case 'closing_soon':\n return 'warning' as const;\n case 'closed':\n case 'expired':\n return 'error' as const;\n default:\n return 'default' as const;\n }\n};\n\nconst categoryVariant = (c: string) => {\n switch (c) {\n case 'subsidy':\n return 'success' as const;\n case 'credit':\n return 'info' as const;\n case 'insurance':\n return 'warning' as const;\n case 'training':\n return 'default' as const;\n case 'grant':\n return 'success' as const;\n case 'equipment':\n return 'muted' as const;\n default:\n return 'muted' as const;\n }\n};\n\ntype CategoryFilter = 'all' | GovernmentScheme['category'];\ntype StatusFilter = 'all' | 'open' | 'closing_soon' | 'closed' | 'expired';\ntype DeadlineFilter = 'all' | 'with' | 'without';\ntype SortOption =\n 'deadline' | 'deadline-latest' | 'amount' | 'amount-low' | 'name' | 'name-desc' | 'country' | 'recent';\n\nconst ALL_COUNTRIES_VALUE = '__all__';\n\nexport const SchemeDiscoveryPage = () => {\n const { t } = useI18n();\n const { governmentSchemes, errors, loadings, refetch } = useHealthyBowlData();\n\n const categories: { value: CategoryFilter; label: string }[] = useMemo(\n () => [\n { value: 'all', label: t('healthybowl.common.all', 'All') },\n { value: 'subsidy', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.subsidy', 'Subsidy') },\n { value: 'credit', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.credit', 'Credit') },\n {\n value: 'insurance',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.insurance', 'Insurance'),\n },\n { value: 'training', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.training', 'Training') },\n { value: 'grant', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.grant', 'Grant') },\n {\n value: 'equipment',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.equipment', 'Equipment'),\n },\n ],\n [t]\n );\n\n const statuses: { value: StatusFilter; label: string }[] = useMemo(\n () => [\n { value: 'all', label: t('healthybowl.common.all', 'All') },\n { value: 'open', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.open', 'Open') },\n {\n value: 'closing_soon',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.closingSoon', 'Closing Soon'),\n },\n { value: 'closed', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.closed', 'Closed') },\n { value: 'expired', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.expired', 'Expired') },\n ],\n [t]\n );\n\n const sortOptions: { value: SortOption; label: string }[] = useMemo(\n () => [\n {\n value: 'deadline',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.deadline', 'Deadline (Soonest)'),\n },\n {\n value: 'deadline-latest',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.deadlineLatest', 'Deadline (Latest)'),\n },\n { value: 'amount', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.amount', 'Amount (Highest)') },\n {\n value: 'amount-low',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.amountLow', 'Amount (Lowest)'),\n },\n { value: 'name', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.name', 'Name (A–Z)') },\n {\n value: 'name-desc',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.nameDesc', 'Name (Z–A)'),\n },\n {\n value: 'country',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.country', 'Country (A–Z)'),\n },\n { value: 'recent', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.recent', 'Recently Added') },\n ],\n [t]\n );\n\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { toasts, toast, dismiss } = useToast();\n\n const [search, setSearch] = useState('');\n const [categoryFilter, setCategoryFilter] = useState<CategoryFilter>('all');\n const [statusFilter, setStatusFilter] = useState<StatusFilter>('all');\n const [selectedCountries, setSelectedCountries] = useState<string[]>([]);\n const [currencyFilter, setCurrencyFilter] = useState<string>('all');\n const [deadlineFilter, setDeadlineFilter] = useState<DeadlineFilter>('all');\n const [topicFilter, setTopicFilter] = useState('');\n const [minAmount, setMinAmount] = useState('');\n const [maxAmountFilter, setMaxAmountFilter] = useState('');\n const [sortBy, setSortBy] = useState<SortOption>('deadline');\n const [savedSchemes, setSavedSchemes] = useState<Set<string>>(new Set());\n const [countryPopoverOpen, setCountryPopoverOpen] = useState(false);\n\n const visibleSortOptions = useMemo(\n () =>\n currencyFilter === 'all'\n ? sortOptions.filter((option) => option.value !== 'amount' && option.value !== 'amount-low')\n : sortOptions,\n [currencyFilter, sortOptions]\n );\n\n // Distinct countries present in the loaded catalog, for the region filter.\n const countryOptions = useMemo(() => {\n const seen = new Set<string>();\n for (const scheme of governmentSchemes) {\n const country = (scheme.country ?? '').trim();\n if (country) seen.add(country);\n }\n return Array.from(seen).sort((a, b) => a.localeCompare(b));\n }, [governmentSchemes]);\n\n const currencyOptions = useMemo(() => {\n const seen = new Set(governmentSchemes.map((scheme) => scheme.currency));\n return Array.from(seen).sort((a, b) => a.localeCompare(b));\n }, [governmentSchemes]);\n\n const activeFilterCount = useMemo(() => {\n let count = 0;\n if (search.trim()) count += 1;\n if (categoryFilter !== 'all') count += 1;\n if (statusFilter !== 'all') count += 1;\n if (selectedCountries.length > 0) count += 1;\n if (currencyFilter !== 'all') count += 1;\n if (deadlineFilter !== 'all') count += 1;\n if (topicFilter.trim()) count += 1;\n if (minAmount.trim() || maxAmountFilter.trim()) count += 1;\n return count;\n }, [\n search,\n categoryFilter,\n statusFilter,\n selectedCountries,\n currencyFilter,\n deadlineFilter,\n topicFilter,\n minAmount,\n maxAmountFilter,\n ]);\n\n const amountCurrencyLabel =\n currencyFilter === 'all'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency', 'Select a currency')\n : currencyFilter;\n\n const filtered = useMemo(() => {\n const min = minAmount === '' ? null : Number(minAmount);\n const max = maxAmountFilter === '' ? null : Number(maxAmountFilter);\n const today = todayLocalDate();\n\n let results = governmentSchemes.filter((s) => {\n const haystack = [\n s.title ?? '',\n s.department ?? '',\n s.description ?? '',\n s.benefits ?? '',\n ...(s.eligibility ?? []),\n ]\n .join('\\n')\n .toLowerCase();\n\n const normalizedSearch = search.trim().toLowerCase();\n const normalizedTopic = topicFilter.trim().toLowerCase();\n const matchesSearch = normalizedSearch === '' || haystack.includes(normalizedSearch);\n const matchesTopic = normalizedTopic === '' || haystack.includes(normalizedTopic);\n const matchesCategory = categoryFilter === 'all' || s.category === categoryFilter;\n const matchesStatus = statusFilter === 'all' || getEffectiveSchemeStatus(s, today) === statusFilter;\n const matchesCountry = selectedCountries.length === 0 || selectedCountries.includes((s.country ?? '').trim());\n const matchesCurrency = currencyFilter === 'all' || s.currency === currencyFilter;\n const matchesDeadline =\n deadlineFilter === 'all' ||\n (deadlineFilter === 'with' ? Boolean(s.applicationDeadline) : !s.applicationDeadline);\n const matchesAmount = matchesSchemeAmount(s, { currency: currencyFilter, min, max });\n\n return (\n matchesSearch &&\n matchesTopic &&\n matchesCategory &&\n matchesStatus &&\n matchesCountry &&\n matchesCurrency &&\n matchesDeadline &&\n matchesAmount\n );\n });\n\n results = [...results].sort((a, b) => {\n switch (sortBy) {\n case 'deadline': {\n if (!a.applicationDeadline && !b.applicationDeadline) return 0;\n if (!a.applicationDeadline) return 1;\n if (!b.applicationDeadline) return -1;\n return new Date(a.applicationDeadline).getTime() - new Date(b.applicationDeadline).getTime();\n }\n case 'deadline-latest': {\n if (!a.applicationDeadline && !b.applicationDeadline) return 0;\n if (!a.applicationDeadline) return 1;\n if (!b.applicationDeadline) return -1;\n return new Date(b.applicationDeadline).getTime() - new Date(a.applicationDeadline).getTime();\n }\n case 'amount': {\n return currencyFilter === 'all' ? 0 : (b.maxAmount ?? 0) - (a.maxAmount ?? 0);\n }\n case 'amount-low': {\n return currencyFilter === 'all' ? 0 : (a.maxAmount ?? 0) - (b.maxAmount ?? 0);\n }\n case 'name': {\n return (a.title ?? '').localeCompare(b.title ?? '');\n }\n case 'name-desc': {\n return (b.title ?? '').localeCompare(a.title ?? '');\n }\n case 'country': {\n return (a.country ?? '').localeCompare(b.country ?? '');\n }\n case 'recent':\n default:\n return 0;\n }\n });\n\n return results;\n }, [\n governmentSchemes,\n search,\n topicFilter,\n categoryFilter,\n statusFilter,\n selectedCountries,\n currencyFilter,\n deadlineFilter,\n minAmount,\n maxAmountFilter,\n sortBy,\n ]);\n\n const toggleCountry = (country: string) => {\n setSelectedCountries((prev) => (prev.includes(country) ? prev.filter((c) => c !== country) : [...prev, country]));\n };\n\n const handleCurrencyFilterChange = (value: string) => {\n setCurrencyFilter(value);\n if (value === 'all') {\n setMinAmount('');\n setMaxAmountFilter('');\n if (sortBy === 'amount' || sortBy === 'amount-low') setSortBy('deadline');\n }\n };\n\n const clearAllFilters = () => {\n setSearch('');\n setCategoryFilter('all');\n setStatusFilter('all');\n setSelectedCountries([]);\n setCurrencyFilter('all');\n setDeadlineFilter('all');\n setTopicFilter('');\n setMinAmount('');\n setMaxAmountFilter('');\n setSortBy('deadline');\n };\n\n const handleApply = (scheme: GovernmentScheme) => {\n const effectiveStatus = getEffectiveSchemeStatus(scheme, todayLocalDate());\n if (!isAcceptingSchemeApplications(scheme, todayLocalDate())) {\n const expired = effectiveStatus === 'expired';\n toast({\n title: expired\n ? t('healthybowl.governmentSchemes.schemeDiscovery.toast.expired.title', 'Scheme Expired')\n : t('healthybowl.governmentSchemes.schemeDiscovery.toast.closed.title', 'Scheme Closed'),\n description: expired\n ? t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.expired.description',\n 'The application deadline for this scheme has passed.'\n )\n : t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.closed.description',\n 'This scheme is no longer accepting applications.'\n ),\n variant: 'error',\n });\n return;\n }\n navigate(buildPath(`government-schemes/schemes/${scheme.id}`));\n };\n\n const handleSave = (schemeId: string) => {\n setSavedSchemes((prev) => {\n const next = new Set(prev);\n if (next.has(schemeId)) {\n next.delete(schemeId);\n toast({\n title: t('healthybowl.governmentSchemes.schemeDiscovery.toast.removed.title', 'Removed from saved'),\n variant: 'info',\n });\n } else {\n next.add(schemeId);\n toast({\n title: t('healthybowl.governmentSchemes.schemeDiscovery.toast.saved.title', 'Saved for this session'),\n description: t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.saved.description',\n \"Saved schemes aren't stored permanently yet — this resets when you leave.\"\n ),\n variant: 'info',\n });\n }\n return next;\n });\n };\n\n const getDaysRemaining = (deadline?: string) => {\n if (!deadline) return null;\n const deadlineTime = new Date(`${deadline.slice(0, 10)}T12:00:00`).getTime();\n const todayTime = new Date(`${todayLocalDate()}T12:00:00`).getTime();\n return Math.max(0, Math.round((deadlineTime - todayTime) / (1000 * 60 * 60 * 24)));\n };\n\n const amountPlaceholder =\n currencyFilter === 'all'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency', 'Select a currency')\n : amountCurrencyLabel;\n\n return (\n <PageLayout\n title={t('healthybowl.governmentSchemes.schemeDiscovery.title', 'Discover Schemes')}\n description={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.description',\n 'Find government schemes for your farm'\n )}\n purpose=\"Browse and search government schemes your farm may qualify for — subsidies, grants and support programs. Find the ones that fit, then apply and track them so you don't leave money on the table.\"\n >\n {/* Search Bar */}\n <div className=\"relative\">\n <Search className=\"absolute start-4 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.search.label', 'Search schemes')}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.search.placeholder',\n 'Search schemes by name, department, description, benefits or eligibility...'\n )}\n className=\"h-12 w-full rounded-lg border border-border-subtle bg-bg-surface ps-12 pe-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-1\"\n />\n </div>\n\n {/* Category Tabs */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {categories.map((cat) => (\n <button\n key={cat.value}\n type=\"button\"\n onClick={() => setCategoryFilter(cat.value)}\n className={cn(\n 'rounded-full px-3 py-1.5 text-xs font-medium transition-colors',\n categoryFilter === cat.value\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n )}\n >\n {cat.label}\n </button>\n ))}\n </div>\n\n {/* Advanced Filters */}\n <div className=\"flex flex-col gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3\">\n <div className=\"flex flex-wrap items-center gap-3\">\n {/* Country multi-select combobox */}\n <div className=\"flex min-w-[200px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel', 'Country / Region')}\n </span>\n <Popover open={countryPopoverOpen} onOpenChange={setCountryPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-label={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel',\n 'Country / Region'\n )}\n aria-expanded={countryPopoverOpen}\n className=\"h-9 w-full justify-between px-3 font-normal\"\n >\n <span className=\"truncate\">\n {selectedCountries.length === 0\n ? t('healthybowl.common.all', 'All')\n : selectedCountries.length === 1\n ? selectedCountries[0]\n : t('healthybowl.governmentSchemes.schemeDiscovery.filters.nSelected', '{{count}} selected', {\n count: selectedCountries.length,\n })}\n </span>\n <ChevronDown className=\"ms-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[280px] p-0\">\n <Command>\n <CommandInput\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.countrySearch',\n 'Search country...'\n )}\n />\n <CommandList aria-multiselectable=\"true\">\n <CommandEmpty>\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.countryEmpty', 'No country found.')}\n </CommandEmpty>\n <CommandGroup>\n <CommandItem\n value={ALL_COUNTRIES_VALUE}\n role=\"option\"\n aria-selected={selectedCountries.length === 0}\n onSelect={() => setSelectedCountries([])}\n >\n <div\n aria-hidden=\"true\"\n className={cn(\n 'me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle',\n selectedCountries.length === 0\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-transparent'\n )}\n >\n <Check className=\"h-3.5 w-3.5\" />\n </div>\n {t('healthybowl.common.all', 'All')}\n </CommandItem>\n {countryOptions.map((country) => (\n <CommandItem\n key={country}\n value={country}\n role=\"option\"\n aria-selected={selectedCountries.includes(country)}\n onSelect={() => {\n toggleCountry(country);\n }}\n >\n <div\n aria-hidden=\"true\"\n className={cn(\n 'me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle',\n selectedCountries.includes(country)\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-transparent'\n )}\n >\n <Check className=\"h-3.5 w-3.5\" />\n </div>\n {country}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n\n {/* Currency filter */}\n <div className=\"flex min-w-[140px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel', 'Currency')}\n </span>\n <Select value={currencyFilter} onValueChange={handleCurrencyFilterChange}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel', 'Currency')}\n >\n <SelectValue placeholder={t('healthybowl.common.all', 'All')} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">{t('healthybowl.common.all', 'All')}</SelectItem>\n {currencyOptions.map((currency) => (\n <SelectItem key={currency} value={currency}>\n {currency}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {/* Status filter */}\n <div className=\"flex min-w-[140px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel', 'Status')}\n </span>\n <Select value={statusFilter} onValueChange={(value) => setStatusFilter(value as StatusFilter)}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel', 'Status')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {statuses.map((s) => (\n <SelectItem key={s.value} value={s.value}>\n {s.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {/* Deadline filter */}\n <div className=\"flex min-w-[160px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel', 'Deadline')}\n </span>\n <Select value={deadlineFilter} onValueChange={(value) => setDeadlineFilter(value as DeadlineFilter)}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel', 'Deadline')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">{t('healthybowl.common.all', 'All')}</SelectItem>\n <SelectItem value=\"with\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWith', 'Has deadline')}\n </SelectItem>\n <SelectItem value=\"without\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWithout', 'No deadline')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n\n {/* Topic / crop filter */}\n <div className=\"flex min-w-[200px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel', 'Topic / Crop')}\n </span>\n <div className=\"relative\">\n <Search className=\"absolute start-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n type=\"text\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel', 'Topic / Crop')}\n value={topicFilter}\n onChange={(e) => setTopicFilter(e.target.value)}\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.topicPlaceholder',\n 'e.g. horticulture, organic, rice...'\n )}\n className=\"h-9 ps-8\"\n />\n </div>\n </div>\n\n {/* Amount min/max */}\n <div className=\"flex min-w-[220px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.amountLabel', 'Amount ({{currency}})', {\n currency: amountCurrencyLabel,\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Input\n type=\"number\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.minAmountLabel', 'Minimum amount')}\n min={0}\n disabled={currencyFilter === 'all'}\n value={minAmount}\n onChange={(e) => setMinAmount(e.target.value)}\n placeholder={t('healthybowl.governmentSchemes.schemeDiscovery.filters.minAmount', 'Min {{currency}}', {\n currency: amountPlaceholder,\n })}\n className=\"h-9\"\n />\n <span className=\"text-text-secondary\">-</span>\n <Input\n type=\"number\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmountLabel', 'Maximum amount')}\n min={0}\n disabled={currencyFilter === 'all'}\n value={maxAmountFilter}\n onChange={(e) => setMaxAmountFilter(e.target.value)}\n placeholder={t('healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmount', 'Max {{currency}}', {\n currency: amountPlaceholder,\n })}\n className=\"h-9\"\n />\n </div>\n {currencyFilter === 'all' ? (\n <p className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.amountCurrencyRequired',\n 'Select one currency before filtering or sorting by amount.'\n )}\n </p>\n ) : null}\n </div>\n </div>\n\n {/* Active filter chips + sort + clear */}\n <div className=\"flex flex-wrap items-center justify-between gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge\n variant=\"secondary\"\n data-testid=\"scheme-active-filter-count\"\n aria-live=\"polite\"\n className=\"tabular-nums\"\n >\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.activeCount', '{{count}} active filters', {\n count: activeFilterCount,\n })}\n </Badge>\n {selectedCountries.map((country) => (\n <Badge key={country} variant=\"secondary\" className=\"gap-1\">\n {country}\n <button\n type=\"button\"\n onClick={() => toggleCountry(country)}\n className=\"rounded-full outline-none ring-offset-1 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n aria-label={t('healthybowl.common.remove', 'Remove')}\n >\n <X className=\"h-3 w-3\" />\n </button>\n </Badge>\n ))}\n {activeFilterCount > 0 && (\n <Button variant=\"ghost\" size=\"sm\" onClick={clearAllFilters} className=\"h-7 px-2 text-xs\">\n <X className=\"me-1 h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.actions.clearAll', 'Clear all')}\n </Button>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n <SlidersHorizontal className=\"h-3.5 w-3.5 text-text-secondary\" />\n <Select value={sortBy} onValueChange={(value) => setSortBy(value as SortOption)}>\n <SelectTrigger\n className=\"h-9 w-auto\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.sort.label', 'Sort schemes')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {visibleSortOptions.map((opt) => (\n <SelectItem key={opt.value} value={opt.value}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n </div>\n\n {/* Result Count */}\n <p className=\"text-sm text-text-secondary\">\n {filtered.length === 1\n ? t('healthybowl.governmentSchemes.schemeDiscovery.resultCount.one', '{{count}} scheme found', {\n count: filtered.length,\n })\n : t('healthybowl.governmentSchemes.schemeDiscovery.resultCount.other', '{{count}} schemes found', {\n count: filtered.length,\n })}\n </p>\n\n {/* Scheme Cards */}\n {filtered.length === 0 ? (\n loadings.government ? (\n <PageLoader />\n ) : errors.government ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.governmentSchemes.schemeDiscovery.emptyState.title', 'No Schemes Found')}\n description={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.emptyState.description',\n 'Try adjusting your search or filter criteria to find matching schemes.'\n )}\n action={\n <Button onClick={clearAllFilters}>\n {t('healthybowl.governmentSchemes.schemeDiscovery.emptyState.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )\n ) : (\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {filtered.map((scheme) => {\n const daysRemaining = getDaysRemaining(scheme.applicationDeadline);\n const isSaved = savedSchemes.has(scheme.id);\n const schemeCurrency = scheme.currency;\n const effectiveStatus = getEffectiveSchemeStatus(scheme, todayLocalDate());\n const acceptingApplications = isAcceptingSchemeApplications(scheme, todayLocalDate());\n\n return (\n <div key={scheme.id} className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n {/* Header */}\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-2\">\n <Landmark className=\"h-5 w-5 shrink-0 text-text-secondary\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">{scheme.title}</h3>\n </div>\n <StatusBadge label={effectiveStatus.replace(/_/g, ' ')} variant={statusVariant(effectiveStatus)} />\n </div>\n\n {/* Department and Category */}\n <div className=\"mt-1.5 flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-text-secondary\">{scheme.department}</span>\n <StatusBadge label={scheme.category} variant={categoryVariant(scheme.category)} />\n {scheme.country ? <StatusBadge label={scheme.country} variant=\"muted\" /> : null}\n </div>\n\n {/* Description */}\n <p className=\"mt-3 line-clamp-2 text-sm text-text-secondary\">{scheme.description}</p>\n\n {/* Eligibility */}\n <div className=\"mt-3\">\n <p className=\"text-xs font-medium text-text-primary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.eligibilityLabel', 'Eligibility:')}\n </p>\n <ul className=\"mt-1 space-y-0.5\">\n {(scheme.eligibility ?? []).slice(0, 3).map((e) => (\n <li key={e} className=\"flex items-center gap-1.5 text-xs text-text-secondary\">\n <CheckCircle className=\"h-3 w-3 shrink-0 text-primary\" /> {e}\n </li>\n ))}\n {(scheme.eligibility ?? []).length > 3 && (\n <li className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.governmentSchemes.schemeDiscovery.card.moreCriteria',\n '+{{count}} more criteria',\n { count: (scheme.eligibility ?? []).length - 3 }\n )}\n </li>\n )}\n </ul>\n </div>\n\n {/* Benefits */}\n <p className=\"mt-3 text-xs text-text-secondary\">{scheme.benefits}</p>\n\n {/* Amount and Deadline */}\n <div className=\"mt-3 flex flex-wrap items-center gap-3 text-xs text-text-secondary\">\n {scheme.maxAmount && (\n <span className=\"flex items-center gap-1\">\n <DollarSign className=\"h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.maxAmount', 'Up to {{amount}}', {\n amount: formatCurrency(scheme.maxAmount, schemeCurrency),\n })}\n </span>\n )}\n {scheme.applicationDeadline && (\n <span className=\"flex items-center gap-1\">\n <CalendarDays className=\"h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.deadline', 'Deadline: {{date}}', {\n date: formatDate(scheme.applicationDeadline),\n })}\n </span>\n )}\n {daysRemaining != null && daysRemaining > 0 && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {daysRemaining === 1\n ? t('healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.one', '{{count}} day left', {\n count: daysRemaining,\n })\n : t(\n 'healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.other',\n '{{count}} days left',\n { count: daysRemaining }\n )}\n </span>\n )}\n </div>\n\n {/* Actions */}\n <div className=\"mt-4 flex items-center justify-between\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleSave(scheme.id)}\n className={cn(\n isSaved ? 'bg-action-primary-bg/10 text-primary' : 'text-text-secondary hover:bg-bg-sunken'\n )}\n >\n <Bookmark className={cn('h-3.5 w-3.5', isSaved && 'fill-current')} />\n {isSaved\n ? t('healthybowl.governmentSchemes.schemeDiscovery.actions.saved', 'Saved')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.saveForLater', 'Save for Later')}\n </Button>\n <Button size=\"sm\" onClick={() => handleApply(scheme)}>\n {!acceptingApplications\n ? effectiveStatus === 'expired'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.actions.expired', 'Expired')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.closed', 'Closed')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.applyNow', 'Apply Now')}\n </Button>\n </div>\n </div>\n );\n })}\n </div>\n )}\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CA,IAAM,MAAiB,MAAc;CACnC,QAAQ,GAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK;EACL,KAAK,WACH,OAAO;EACT,SACE,OAAO;CACX;AACF,GAEM,MAAmB,MAAc;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IACD,EACE,qEACA,uBACA,EAAE,OAAO,EAAc,CACzB,CACA;;QAEL;;OAGL,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SACE,SAAQ;SACR,MAAK;SACL,eAAe,GAAW,EAAO,EAAE;SACnC,WAAW,EACT,IAAU,yCAAyC,wCACrD;mBANF,CAQE,kBAAC,IAAD,EAAU,WAAW,EAAG,eAAe,KAAW,cAAc,EAAI,CAAA,GACnE,IACG,EAAE,+DAA+D,OAAO,IACxE,EAAE,sEAAsE,gBAAgB,CACtF;YACR,kBAAC,GAAD;SAAQ,MAAK;SAAK,eAAe,GAAY,CAAM;mBAC/C,IAIE,EAAE,kEAAkE,WAAW,IAH/E,MAAoB,YAClB,EAAE,iEAAiE,SAAS,IAC5E,EAAE,gEAAgE,QAAQ;QAE1E,CAAA,CACL;;MACF;QAvGK,EAAO,EAuGZ;IAET,CAAC;GACE,CAAA;GAGP,kBAAC,GAAD;IAAwB;IAAQ,WAAW;GAAU,CAAA;EAC3C;;AAEhB"}
1
+ {"version":3,"file":"SchemeDiscoveryPage.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/SchemeDiscoveryPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Landmark,\n CheckCircle,\n Bookmark,\n CalendarDays,\n DollarSign,\n Clock,\n Search,\n Check,\n ChevronDown,\n X,\n SlidersHorizontal,\n} from 'lucide-react';\nimport {\n Button,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Input,\n Badge,\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout, StatusBadge, EmptyState, ErrorState, PageLoader } from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { useToast } from '../../hooks/useToast';\nimport { useBasePath } from '../../hooks/useBasePath';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport { formatCurrency, formatDate, cn, todayLocalDate } from '../../utils/helpers';\nimport type { GovernmentScheme } from '../../types';\nimport {\n getEffectiveSchemeStatus,\n isAcceptingSchemeApplications,\n matchesSchemeAmount,\n matchesSchemeCategory,\n} from './schemeDiscoveryFilters';\n\nconst statusVariant = (s: string) => {\n switch (s) {\n case 'open':\n return 'success' as const;\n case 'closing_soon':\n return 'warning' as const;\n case 'closed':\n case 'expired':\n return 'error' as const;\n default:\n return 'default' as const;\n }\n};\n\nconst categoryVariant = (c: string) => {\n switch (c) {\n case 'subsidy':\n return 'success' as const;\n case 'credit':\n return 'info' as const;\n case 'insurance':\n return 'warning' as const;\n case 'training':\n return 'default' as const;\n case 'grant':\n return 'success' as const;\n case 'equipment':\n return 'muted' as const;\n default:\n return 'muted' as const;\n }\n};\n\ntype CategoryFilter = 'all' | GovernmentScheme['category'];\ntype StatusFilter = 'all' | 'open' | 'closing_soon' | 'closed' | 'expired';\ntype DeadlineFilter = 'all' | 'with' | 'without';\ntype SortOption =\n 'deadline' | 'deadline-latest' | 'amount' | 'amount-low' | 'name' | 'name-desc' | 'country' | 'recent';\n\nconst ALL_COUNTRIES_VALUE = '__all__';\n\nexport const SchemeDiscoveryPage = () => {\n const { t } = useI18n();\n const { governmentSchemes, errors, loadings, refetch } = useHealthyBowlData();\n\n const categories: { value: CategoryFilter; label: string }[] = useMemo(\n () => [\n { value: 'all', label: t('healthybowl.common.all', 'All') },\n { value: 'subsidy', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.subsidy', 'Subsidy') },\n { value: 'credit', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.credit', 'Credit') },\n {\n value: 'insurance',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.insurance', 'Insurance'),\n },\n { value: 'training', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.training', 'Training') },\n { value: 'grant', label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.grant', 'Grant') },\n {\n value: 'equipment',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.categories.equipment', 'Equipment'),\n },\n ],\n [t]\n );\n\n const statuses: { value: StatusFilter; label: string }[] = useMemo(\n () => [\n { value: 'all', label: t('healthybowl.common.all', 'All') },\n { value: 'open', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.open', 'Open') },\n {\n value: 'closing_soon',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.closingSoon', 'Closing Soon'),\n },\n { value: 'closed', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.closed', 'Closed') },\n { value: 'expired', label: t('healthybowl.governmentSchemes.schemeDiscovery.statuses.expired', 'Expired') },\n ],\n [t]\n );\n\n const sortOptions: { value: SortOption; label: string }[] = useMemo(\n () => [\n {\n value: 'deadline',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.deadline', 'Deadline (Soonest)'),\n },\n {\n value: 'deadline-latest',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.deadlineLatest', 'Deadline (Latest)'),\n },\n { value: 'amount', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.amount', 'Amount (Highest)') },\n {\n value: 'amount-low',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.amountLow', 'Amount (Lowest)'),\n },\n { value: 'name', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.name', 'Name (A–Z)') },\n {\n value: 'name-desc',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.nameDesc', 'Name (Z–A)'),\n },\n {\n value: 'country',\n label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.country', 'Country (A–Z)'),\n },\n { value: 'recent', label: t('healthybowl.governmentSchemes.schemeDiscovery.sort.recent', 'Recently Added') },\n ],\n [t]\n );\n\n const navigate = useNavigate();\n const { buildPath } = useBasePath();\n const { toasts, toast, dismiss } = useToast();\n\n const [search, setSearch] = useState('');\n const [categoryFilter, setCategoryFilter] = useState<CategoryFilter>('all');\n const [statusFilter, setStatusFilter] = useState<StatusFilter>('all');\n const [selectedCountries, setSelectedCountries] = useState<string[]>([]);\n const [currencyFilter, setCurrencyFilter] = useState<string>('all');\n const [deadlineFilter, setDeadlineFilter] = useState<DeadlineFilter>('all');\n const [topicFilter, setTopicFilter] = useState('');\n const [minAmount, setMinAmount] = useState('');\n const [maxAmountFilter, setMaxAmountFilter] = useState('');\n const [sortBy, setSortBy] = useState<SortOption>('deadline');\n const [savedSchemes, setSavedSchemes] = useState<Set<string>>(new Set());\n const [countryPopoverOpen, setCountryPopoverOpen] = useState(false);\n\n const visibleSortOptions = useMemo(\n () =>\n currencyFilter === 'all'\n ? sortOptions.filter((option) => option.value !== 'amount' && option.value !== 'amount-low')\n : sortOptions,\n [currencyFilter, sortOptions]\n );\n\n // Distinct countries present in the loaded catalog, for the region filter.\n const countryOptions = useMemo(() => {\n const seen = new Set<string>();\n for (const scheme of governmentSchemes) {\n const country = (scheme.country ?? '').trim();\n if (country) seen.add(country);\n }\n return Array.from(seen).sort((a, b) => a.localeCompare(b));\n }, [governmentSchemes]);\n\n const currencyOptions = useMemo(() => {\n const seen = new Set(governmentSchemes.map((scheme) => scheme.currency));\n return Array.from(seen).sort((a, b) => a.localeCompare(b));\n }, [governmentSchemes]);\n\n const activeFilterCount = useMemo(() => {\n let count = 0;\n if (search.trim()) count += 1;\n if (categoryFilter !== 'all') count += 1;\n if (statusFilter !== 'all') count += 1;\n if (selectedCountries.length > 0) count += 1;\n if (currencyFilter !== 'all') count += 1;\n if (deadlineFilter !== 'all') count += 1;\n if (topicFilter.trim()) count += 1;\n if (minAmount.trim() || maxAmountFilter.trim()) count += 1;\n return count;\n }, [\n search,\n categoryFilter,\n statusFilter,\n selectedCountries,\n currencyFilter,\n deadlineFilter,\n topicFilter,\n minAmount,\n maxAmountFilter,\n ]);\n\n const amountCurrencyLabel =\n currencyFilter === 'all'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency', 'Select a currency')\n : currencyFilter;\n\n const filtered = useMemo(() => {\n const min = minAmount === '' ? null : Number(minAmount);\n const max = maxAmountFilter === '' ? null : Number(maxAmountFilter);\n const today = todayLocalDate();\n\n let results = governmentSchemes.filter((s) => {\n const haystack = [\n s.title ?? '',\n s.department ?? '',\n s.description ?? '',\n s.benefits ?? '',\n ...(s.eligibility ?? []),\n ]\n .join('\\n')\n .toLowerCase();\n\n const normalizedSearch = search.trim().toLowerCase();\n const normalizedTopic = topicFilter.trim().toLowerCase();\n const matchesSearch = normalizedSearch === '' || haystack.includes(normalizedSearch);\n const matchesTopic = normalizedTopic === '' || haystack.includes(normalizedTopic);\n const matchesCategory = matchesSchemeCategory(s, categoryFilter);\n const matchesStatus = statusFilter === 'all' || getEffectiveSchemeStatus(s, today) === statusFilter;\n const matchesCountry = selectedCountries.length === 0 || selectedCountries.includes((s.country ?? '').trim());\n const matchesCurrency = currencyFilter === 'all' || s.currency === currencyFilter;\n const matchesDeadline =\n deadlineFilter === 'all' ||\n (deadlineFilter === 'with' ? Boolean(s.applicationDeadline) : !s.applicationDeadline);\n const matchesAmount = matchesSchemeAmount(s, { currency: currencyFilter, min, max });\n\n return (\n matchesSearch &&\n matchesTopic &&\n matchesCategory &&\n matchesStatus &&\n matchesCountry &&\n matchesCurrency &&\n matchesDeadline &&\n matchesAmount\n );\n });\n\n results = [...results].sort((a, b) => {\n switch (sortBy) {\n case 'deadline': {\n if (!a.applicationDeadline && !b.applicationDeadline) return 0;\n if (!a.applicationDeadline) return 1;\n if (!b.applicationDeadline) return -1;\n return new Date(a.applicationDeadline).getTime() - new Date(b.applicationDeadline).getTime();\n }\n case 'deadline-latest': {\n if (!a.applicationDeadline && !b.applicationDeadline) return 0;\n if (!a.applicationDeadline) return 1;\n if (!b.applicationDeadline) return -1;\n return new Date(b.applicationDeadline).getTime() - new Date(a.applicationDeadline).getTime();\n }\n case 'amount': {\n return currencyFilter === 'all' ? 0 : (b.maxAmount ?? 0) - (a.maxAmount ?? 0);\n }\n case 'amount-low': {\n return currencyFilter === 'all' ? 0 : (a.maxAmount ?? 0) - (b.maxAmount ?? 0);\n }\n case 'name': {\n return (a.title ?? '').localeCompare(b.title ?? '');\n }\n case 'name-desc': {\n return (b.title ?? '').localeCompare(a.title ?? '');\n }\n case 'country': {\n return (a.country ?? '').localeCompare(b.country ?? '');\n }\n case 'recent':\n default:\n return 0;\n }\n });\n\n return results;\n }, [\n governmentSchemes,\n search,\n topicFilter,\n categoryFilter,\n statusFilter,\n selectedCountries,\n currencyFilter,\n deadlineFilter,\n minAmount,\n maxAmountFilter,\n sortBy,\n ]);\n\n const toggleCountry = (country: string) => {\n setSelectedCountries((prev) => (prev.includes(country) ? prev.filter((c) => c !== country) : [...prev, country]));\n };\n\n const handleCurrencyFilterChange = (value: string) => {\n setCurrencyFilter(value);\n if (value === 'all') {\n setMinAmount('');\n setMaxAmountFilter('');\n if (sortBy === 'amount' || sortBy === 'amount-low') setSortBy('deadline');\n }\n };\n\n const clearAllFilters = () => {\n setSearch('');\n setCategoryFilter('all');\n setStatusFilter('all');\n setSelectedCountries([]);\n setCurrencyFilter('all');\n setDeadlineFilter('all');\n setTopicFilter('');\n setMinAmount('');\n setMaxAmountFilter('');\n setSortBy('deadline');\n };\n\n const handleApply = (scheme: GovernmentScheme) => {\n const effectiveStatus = getEffectiveSchemeStatus(scheme, todayLocalDate());\n if (!isAcceptingSchemeApplications(scheme, todayLocalDate())) {\n const expired = effectiveStatus === 'expired';\n toast({\n title: expired\n ? t('healthybowl.governmentSchemes.schemeDiscovery.toast.expired.title', 'Scheme Expired')\n : t('healthybowl.governmentSchemes.schemeDiscovery.toast.closed.title', 'Scheme Closed'),\n description: expired\n ? t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.expired.description',\n 'The application deadline for this scheme has passed.'\n )\n : t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.closed.description',\n 'This scheme is no longer accepting applications.'\n ),\n variant: 'error',\n });\n return;\n }\n navigate(buildPath(`government-schemes/schemes/${scheme.id}`));\n };\n\n const handleSave = (schemeId: string) => {\n setSavedSchemes((prev) => {\n const next = new Set(prev);\n if (next.has(schemeId)) {\n next.delete(schemeId);\n toast({\n title: t('healthybowl.governmentSchemes.schemeDiscovery.toast.removed.title', 'Removed from saved'),\n variant: 'info',\n });\n } else {\n next.add(schemeId);\n toast({\n title: t('healthybowl.governmentSchemes.schemeDiscovery.toast.saved.title', 'Saved for this session'),\n description: t(\n 'healthybowl.governmentSchemes.schemeDiscovery.toast.saved.description',\n \"Saved schemes aren't stored permanently yet — this resets when you leave.\"\n ),\n variant: 'info',\n });\n }\n return next;\n });\n };\n\n const getDaysRemaining = (deadline?: string) => {\n if (!deadline) return null;\n const deadlineTime = new Date(`${deadline.slice(0, 10)}T12:00:00`).getTime();\n const todayTime = new Date(`${todayLocalDate()}T12:00:00`).getTime();\n return Math.max(0, Math.round((deadlineTime - todayTime) / (1000 * 60 * 60 * 24)));\n };\n\n const amountPlaceholder =\n currencyFilter === 'all'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency', 'Select a currency')\n : amountCurrencyLabel;\n\n return (\n <PageLayout\n title={t('healthybowl.governmentSchemes.schemeDiscovery.title', 'Discover Schemes')}\n description={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.description',\n 'Find government schemes for your farm'\n )}\n purpose=\"Browse and search government schemes your farm may qualify for — subsidies, grants and support programs. Find the ones that fit, then apply and track them so you don't leave money on the table.\"\n >\n {/* Search Bar */}\n <div className=\"relative\">\n <Search className=\"absolute start-4 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.search.label', 'Search schemes')}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.search.placeholder',\n 'Search schemes by name, department, description, benefits or eligibility...'\n )}\n className=\"h-12 w-full rounded-lg border border-border-subtle bg-bg-surface ps-12 pe-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-1\"\n />\n </div>\n\n {/* Category Tabs */}\n <div className=\"flex flex-wrap items-center gap-2\">\n {categories.map((cat) => (\n <button\n key={cat.value}\n type=\"button\"\n onClick={() => setCategoryFilter(cat.value)}\n className={cn(\n 'rounded-full px-3 py-1.5 text-xs font-medium transition-colors',\n categoryFilter === cat.value\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n )}\n >\n {cat.label}\n </button>\n ))}\n </div>\n\n {/* Advanced Filters */}\n <div className=\"flex flex-col gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3\">\n <div className=\"flex flex-wrap items-center gap-3\">\n {/* Country multi-select combobox */}\n <div className=\"flex min-w-[200px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel', 'Country / Region')}\n </span>\n <Popover open={countryPopoverOpen} onOpenChange={setCountryPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-label={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel',\n 'Country / Region'\n )}\n aria-expanded={countryPopoverOpen}\n className=\"h-9 w-full justify-between px-3 font-normal\"\n >\n <span className=\"truncate\">\n {selectedCountries.length === 0\n ? t('healthybowl.common.all', 'All')\n : selectedCountries.length === 1\n ? selectedCountries[0]\n : t('healthybowl.governmentSchemes.schemeDiscovery.filters.nSelected', '{{count}} selected', {\n count: selectedCountries.length,\n })}\n </span>\n <ChevronDown className=\"ms-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[280px] p-0\">\n <Command>\n <CommandInput\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.countrySearch',\n 'Search country...'\n )}\n />\n <CommandList aria-multiselectable=\"true\">\n <CommandEmpty>\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.countryEmpty', 'No country found.')}\n </CommandEmpty>\n <CommandGroup>\n <CommandItem\n value={ALL_COUNTRIES_VALUE}\n role=\"option\"\n aria-selected={selectedCountries.length === 0}\n onSelect={() => setSelectedCountries([])}\n >\n <div\n aria-hidden=\"true\"\n className={cn(\n 'me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle',\n selectedCountries.length === 0\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-transparent'\n )}\n >\n <Check className=\"h-3.5 w-3.5\" />\n </div>\n {t('healthybowl.common.all', 'All')}\n </CommandItem>\n {countryOptions.map((country) => (\n <CommandItem\n key={country}\n value={country}\n role=\"option\"\n aria-selected={selectedCountries.includes(country)}\n onSelect={() => {\n toggleCountry(country);\n }}\n >\n <div\n aria-hidden=\"true\"\n className={cn(\n 'me-2 flex h-4 w-4 items-center justify-center rounded-sm border border-border-subtle',\n selectedCountries.includes(country)\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-surface text-transparent'\n )}\n >\n <Check className=\"h-3.5 w-3.5\" />\n </div>\n {country}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n\n {/* Currency filter */}\n <div className=\"flex min-w-[140px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel', 'Currency')}\n </span>\n <Select value={currencyFilter} onValueChange={handleCurrencyFilterChange}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel', 'Currency')}\n >\n <SelectValue placeholder={t('healthybowl.common.all', 'All')} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">{t('healthybowl.common.all', 'All')}</SelectItem>\n {currencyOptions.map((currency) => (\n <SelectItem key={currency} value={currency}>\n {currency}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {/* Status filter */}\n <div className=\"flex min-w-[140px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel', 'Status')}\n </span>\n <Select value={statusFilter} onValueChange={(value) => setStatusFilter(value as StatusFilter)}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.statusLabel', 'Status')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {statuses.map((s) => (\n <SelectItem key={s.value} value={s.value}>\n {s.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {/* Deadline filter */}\n <div className=\"flex min-w-[160px] flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel', 'Deadline')}\n </span>\n <Select value={deadlineFilter} onValueChange={(value) => setDeadlineFilter(value as DeadlineFilter)}>\n <SelectTrigger\n className=\"h-9 w-full\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineLabel', 'Deadline')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">{t('healthybowl.common.all', 'All')}</SelectItem>\n <SelectItem value=\"with\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWith', 'Has deadline')}\n </SelectItem>\n <SelectItem value=\"without\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWithout', 'No deadline')}\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n\n {/* Topic / crop filter */}\n <div className=\"flex min-w-[200px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel', 'Topic / Crop')}\n </span>\n <div className=\"relative\">\n <Search className=\"absolute start-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <Input\n type=\"text\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.topicLabel', 'Topic / Crop')}\n value={topicFilter}\n onChange={(e) => setTopicFilter(e.target.value)}\n placeholder={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.topicPlaceholder',\n 'e.g. horticulture, organic, rice...'\n )}\n className=\"h-9 ps-8\"\n />\n </div>\n </div>\n\n {/* Amount min/max */}\n <div className=\"flex min-w-[220px] flex-1 flex-col gap-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.amountLabel', 'Amount ({{currency}})', {\n currency: amountCurrencyLabel,\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Input\n type=\"number\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.minAmountLabel', 'Minimum amount')}\n min={0}\n disabled={currencyFilter === 'all'}\n value={minAmount}\n onChange={(e) => setMinAmount(e.target.value)}\n placeholder={t('healthybowl.governmentSchemes.schemeDiscovery.filters.minAmount', 'Min {{currency}}', {\n currency: amountPlaceholder,\n })}\n className=\"h-9\"\n />\n <span className=\"text-text-secondary\">-</span>\n <Input\n type=\"number\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmountLabel', 'Maximum amount')}\n min={0}\n disabled={currencyFilter === 'all'}\n value={maxAmountFilter}\n onChange={(e) => setMaxAmountFilter(e.target.value)}\n placeholder={t('healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmount', 'Max {{currency}}', {\n currency: amountPlaceholder,\n })}\n className=\"h-9\"\n />\n </div>\n {currencyFilter === 'all' ? (\n <p className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.governmentSchemes.schemeDiscovery.filters.amountCurrencyRequired',\n 'Select one currency before filtering or sorting by amount.'\n )}\n </p>\n ) : null}\n </div>\n </div>\n\n {/* Active filter chips + sort + clear */}\n <div className=\"flex flex-wrap items-center justify-between gap-3 border-t border-border-subtle pt-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge\n variant=\"secondary\"\n data-testid=\"scheme-active-filter-count\"\n aria-live=\"polite\"\n className=\"tabular-nums\"\n >\n {t('healthybowl.governmentSchemes.schemeDiscovery.filters.activeCount', '{{count}} active filters', {\n count: activeFilterCount,\n })}\n </Badge>\n {selectedCountries.map((country) => (\n <Badge key={country} variant=\"secondary\" className=\"gap-1\">\n {country}\n <button\n type=\"button\"\n onClick={() => toggleCountry(country)}\n className=\"rounded-full outline-none ring-offset-1 focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]\"\n aria-label={t('healthybowl.common.remove', 'Remove')}\n >\n <X className=\"h-3 w-3\" />\n </button>\n </Badge>\n ))}\n {activeFilterCount > 0 && (\n <Button variant=\"ghost\" size=\"sm\" onClick={clearAllFilters} className=\"h-7 px-2 text-xs\">\n <X className=\"me-1 h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.actions.clearAll', 'Clear all')}\n </Button>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n <SlidersHorizontal className=\"h-3.5 w-3.5 text-text-secondary\" />\n <Select value={sortBy} onValueChange={(value) => setSortBy(value as SortOption)}>\n <SelectTrigger\n className=\"h-9 w-auto\"\n aria-label={t('healthybowl.governmentSchemes.schemeDiscovery.sort.label', 'Sort schemes')}\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {visibleSortOptions.map((opt) => (\n <SelectItem key={opt.value} value={opt.value}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n </div>\n\n {/* Result Count */}\n <p className=\"text-sm text-text-secondary\">\n {filtered.length === 1\n ? t('healthybowl.governmentSchemes.schemeDiscovery.resultCount.one', '{{count}} scheme found', {\n count: filtered.length,\n })\n : t('healthybowl.governmentSchemes.schemeDiscovery.resultCount.other', '{{count}} schemes found', {\n count: filtered.length,\n })}\n </p>\n\n {/* Scheme Cards */}\n {filtered.length === 0 ? (\n loadings.government ? (\n <PageLoader />\n ) : errors.government ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.governmentSchemes.schemeDiscovery.emptyState.title', 'No Schemes Found')}\n description={t(\n 'healthybowl.governmentSchemes.schemeDiscovery.emptyState.description',\n 'Try adjusting your search or filter criteria to find matching schemes.'\n )}\n action={\n <Button onClick={clearAllFilters}>\n {t('healthybowl.governmentSchemes.schemeDiscovery.emptyState.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )\n ) : (\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {filtered.map((scheme) => {\n const daysRemaining = getDaysRemaining(scheme.applicationDeadline);\n const isSaved = savedSchemes.has(scheme.id);\n const schemeCurrency = scheme.currency;\n const effectiveStatus = getEffectiveSchemeStatus(scheme, todayLocalDate());\n const acceptingApplications = isAcceptingSchemeApplications(scheme, todayLocalDate());\n\n return (\n <div key={scheme.id} className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n {/* Header */}\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-2\">\n <Landmark className=\"h-5 w-5 shrink-0 text-text-secondary\" />\n <h3 className=\"text-sm font-semibold text-text-primary\">{scheme.title}</h3>\n </div>\n <StatusBadge label={effectiveStatus.replace(/_/g, ' ')} variant={statusVariant(effectiveStatus)} />\n </div>\n\n {/* Department and Category */}\n <div className=\"mt-1.5 flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-text-secondary\">{scheme.department}</span>\n <StatusBadge label={scheme.category} variant={categoryVariant(scheme.category)} />\n {scheme.country ? <StatusBadge label={scheme.country} variant=\"muted\" /> : null}\n </div>\n\n {/* Description */}\n <p className=\"mt-3 line-clamp-2 text-sm text-text-secondary\">{scheme.description}</p>\n\n {/* Eligibility */}\n <div className=\"mt-3\">\n <p className=\"text-xs font-medium text-text-primary\">\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.eligibilityLabel', 'Eligibility:')}\n </p>\n <ul className=\"mt-1 space-y-0.5\">\n {(scheme.eligibility ?? []).slice(0, 3).map((e) => (\n <li key={e} className=\"flex items-center gap-1.5 text-xs text-text-secondary\">\n <CheckCircle className=\"h-3 w-3 shrink-0 text-primary\" /> {e}\n </li>\n ))}\n {(scheme.eligibility ?? []).length > 3 && (\n <li className=\"text-xs text-text-secondary\">\n {t(\n 'healthybowl.governmentSchemes.schemeDiscovery.card.moreCriteria',\n '+{{count}} more criteria',\n { count: (scheme.eligibility ?? []).length - 3 }\n )}\n </li>\n )}\n </ul>\n </div>\n\n {/* Benefits */}\n <p className=\"mt-3 text-xs text-text-secondary\">{scheme.benefits}</p>\n\n {/* Amount and Deadline */}\n <div className=\"mt-3 flex flex-wrap items-center gap-3 text-xs text-text-secondary\">\n {scheme.maxAmount && (\n <span className=\"flex items-center gap-1\">\n <DollarSign className=\"h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.maxAmount', 'Up to {{amount}}', {\n amount: formatCurrency(scheme.maxAmount, schemeCurrency),\n })}\n </span>\n )}\n {scheme.applicationDeadline && (\n <span className=\"flex items-center gap-1\">\n <CalendarDays className=\"h-3 w-3\" />\n {t('healthybowl.governmentSchemes.schemeDiscovery.card.deadline', 'Deadline: {{date}}', {\n date: formatDate(scheme.applicationDeadline),\n })}\n </span>\n )}\n {daysRemaining != null && daysRemaining > 0 && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {daysRemaining === 1\n ? t('healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.one', '{{count}} day left', {\n count: daysRemaining,\n })\n : t(\n 'healthybowl.governmentSchemes.schemeDiscovery.card.daysLeft.other',\n '{{count}} days left',\n { count: daysRemaining }\n )}\n </span>\n )}\n </div>\n\n {/* Actions */}\n <div className=\"mt-4 flex items-center justify-between\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleSave(scheme.id)}\n className={cn(\n isSaved ? 'bg-action-primary-bg/10 text-primary' : 'text-text-secondary hover:bg-bg-sunken'\n )}\n >\n <Bookmark className={cn('h-3.5 w-3.5', isSaved && 'fill-current')} />\n {isSaved\n ? t('healthybowl.governmentSchemes.schemeDiscovery.actions.saved', 'Saved')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.saveForLater', 'Save for Later')}\n </Button>\n <Button size=\"sm\" onClick={() => handleApply(scheme)}>\n {!acceptingApplications\n ? effectiveStatus === 'expired'\n ? t('healthybowl.governmentSchemes.schemeDiscovery.actions.expired', 'Expired')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.closed', 'Closed')\n : t('healthybowl.governmentSchemes.schemeDiscovery.actions.applyNow', 'Apply Now')}\n </Button>\n </div>\n </div>\n );\n })}\n </div>\n )}\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAM,MAAiB,MAAc;CACnC,QAAQ,GAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK;EACL,KAAK,WACH,OAAO;EACT,SACE,OAAO;CACX;AACF,GAEM,MAAmB,MAAc;CACrC,QAAQ,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,UACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,SACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,SACE,OAAO;CACX;AACF,GAQM,KAAsB,WAEf,UAA4B;CACvC,IAAM,EAAE,SAAM,GAAQ,GAChB,EAAE,sBAAmB,YAAQ,cAAU,gBAAY,EAAmB,GAEtE,KAAyD,QACvD;EACJ;GAAE,OAAO;GAAO,OAAO,EAAE,0BAA0B,KAAK;EAAE;EAC1D;GAAE,OAAO;GAAW,OAAO,EAAE,oEAAoE,SAAS;EAAE;EAC5G;GAAE,OAAO;GAAU,OAAO,EAAE,mEAAmE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iE,SAAS,IAC5E,EAAE,gEAAgE,QAAQ;QAE1E,CAAA,CACL;;MACF;QAvGK,EAAO,EAuGZ;IAET,CAAC;GACE,CAAA;GAGP,kBAAC,GAAD;IAAwB;IAAQ,WAAW;GAAU,CAAA;EAC3C;;AAEhB"}
@@ -7,9 +7,12 @@ function t(t, n) {
7
7
  return r !== "closed" && r !== "expired";
8
8
  }
9
9
  function n(e, t) {
10
+ return t === "all" || e.category.trim().toLowerCase() === t.trim().toLowerCase();
11
+ }
12
+ function r(e, t) {
10
13
  return t.min !== null || t.max !== null ? t.currency === "all" || e.currency !== t.currency || e.maxAmount == null ? !1 : (t.min === null || e.maxAmount >= t.min) && (t.max === null || e.maxAmount <= t.max) : !0;
11
14
  }
12
15
  //#endregion
13
- export { e as getEffectiveSchemeStatus, t as isAcceptingSchemeApplications, n as matchesSchemeAmount };
16
+ export { e as getEffectiveSchemeStatus, t as isAcceptingSchemeApplications, r as matchesSchemeAmount, n as matchesSchemeCategory };
14
17
 
15
18
  //# sourceMappingURL=schemeDiscoveryFilters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemeDiscoveryFilters.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/schemeDiscoveryFilters.ts"],"sourcesContent":["import type { GovernmentScheme } from '../../types';\n\nexport type EffectiveSchemeStatus = GovernmentScheme['status'] | 'expired';\n\n/**\n * Presentation-only lifecycle derived from canonical scheme status and deadline.\n * The server-owned status remains untouched; an elapsed deadline simply makes an\n * otherwise-open scheme expired for discovery and application decisions.\n */\nexport function getEffectiveSchemeStatus(\n scheme: Pick<GovernmentScheme, 'status' | 'applicationDeadline'>,\n today: string\n): EffectiveSchemeStatus {\n if (scheme.status === 'closed') return 'closed';\n if (scheme.applicationDeadline && scheme.applicationDeadline.slice(0, 10) < today) return 'expired';\n return scheme.status;\n}\n\nexport function isAcceptingSchemeApplications(\n scheme: Pick<GovernmentScheme, 'status' | 'applicationDeadline'>,\n today: string\n): boolean {\n const status = getEffectiveSchemeStatus(scheme, today);\n return status !== 'closed' && status !== 'expired';\n}\n\nexport interface SchemeAmountFilter {\n currency: string;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Apply numeric thresholds only when the user selected one canonical currency.\n * Raw values in different currencies are not comparable without an FX source.\n */\nexport function matchesSchemeAmount(\n scheme: Pick<GovernmentScheme, 'currency' | 'maxAmount'>,\n filter: SchemeAmountFilter\n): boolean {\n const active = filter.min !== null || filter.max !== null;\n if (!active) return true;\n if (filter.currency === 'all' || scheme.currency !== filter.currency || scheme.maxAmount == null) return false;\n return (\n (filter.min === null || scheme.maxAmount >= filter.min) && (filter.max === null || scheme.maxAmount <= filter.max)\n );\n}\n"],"mappings":";AASA,SAAgB,EACd,GACA,GACuB;CAGvB,OAFI,EAAO,WAAW,WAAiB,WACnC,EAAO,uBAAuB,EAAO,oBAAoB,MAAM,GAAG,EAAE,IAAI,IAAc,YACnF,EAAO;AAChB;AAEA,SAAgB,EACd,GACA,GACS;CACT,IAAM,IAAS,EAAyB,GAAQ,CAAK;CACrD,OAAO,MAAW,YAAY,MAAW;AAC3C;AAYA,SAAgB,EACd,GACA,GACS;CAIT,OAHe,EAAO,QAAQ,QAAQ,EAAO,QAAQ,OAEjD,EAAO,aAAa,SAAS,EAAO,aAAa,EAAO,YAAY,EAAO,aAAa,OAAa,MAEtG,EAAO,QAAQ,QAAQ,EAAO,aAAa,EAAO,SAAS,EAAO,QAAQ,QAAQ,EAAO,aAAa,EAAO,OAH5F;AAKtB"}
1
+ {"version":3,"file":"schemeDiscoveryFilters.js","names":[],"sources":["../../../../src/healthybowl/pages/government-schemes/schemeDiscoveryFilters.ts"],"sourcesContent":["import type { GovernmentScheme } from '../../types';\n\nexport type EffectiveSchemeStatus = GovernmentScheme['status'] | 'expired';\n\n/**\n * Presentation-only lifecycle derived from canonical scheme status and deadline.\n * The server-owned status remains untouched; an elapsed deadline simply makes an\n * otherwise-open scheme expired for discovery and application decisions.\n */\nexport function getEffectiveSchemeStatus(\n scheme: Pick<GovernmentScheme, 'status' | 'applicationDeadline'>,\n today: string\n): EffectiveSchemeStatus {\n if (scheme.status === 'closed') return 'closed';\n if (scheme.applicationDeadline && scheme.applicationDeadline.slice(0, 10) < today) return 'expired';\n return scheme.status;\n}\n\nexport function isAcceptingSchemeApplications(\n scheme: Pick<GovernmentScheme, 'status' | 'applicationDeadline'>,\n today: string\n): boolean {\n const status = getEffectiveSchemeStatus(scheme, today);\n return status !== 'closed' && status !== 'expired';\n}\n\nexport function matchesSchemeCategory(scheme: { category: string }, category: string): boolean {\n return category === 'all' || scheme.category.trim().toLowerCase() === category.trim().toLowerCase();\n}\n\nexport interface SchemeAmountFilter {\n currency: string;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Apply numeric thresholds only when the user selected one canonical currency.\n * Raw values in different currencies are not comparable without an FX source.\n */\nexport function matchesSchemeAmount(\n scheme: Pick<GovernmentScheme, 'currency' | 'maxAmount'>,\n filter: SchemeAmountFilter\n): boolean {\n const active = filter.min !== null || filter.max !== null;\n if (!active) return true;\n if (filter.currency === 'all' || scheme.currency !== filter.currency || scheme.maxAmount == null) return false;\n return (\n (filter.min === null || scheme.maxAmount >= filter.min) && (filter.max === null || scheme.maxAmount <= filter.max)\n );\n}\n"],"mappings":";AASA,SAAgB,EACd,GACA,GACuB;CAGvB,OAFI,EAAO,WAAW,WAAiB,WACnC,EAAO,uBAAuB,EAAO,oBAAoB,MAAM,GAAG,EAAE,IAAI,IAAc,YACnF,EAAO;AAChB;AAEA,SAAgB,EACd,GACA,GACS;CACT,IAAM,IAAS,EAAyB,GAAQ,CAAK;CACrD,OAAO,MAAW,YAAY,MAAW;AAC3C;AAEA,SAAgB,EAAsB,GAA8B,GAA2B;CAC7F,OAAO,MAAa,SAAS,EAAO,SAAS,KAAK,EAAE,YAAY,MAAM,EAAS,KAAK,EAAE,YAAY;AACpG;AAYA,SAAgB,EACd,GACA,GACS;CAIT,OAHe,EAAO,QAAQ,QAAQ,EAAO,QAAQ,OAEjD,EAAO,aAAa,SAAS,EAAO,aAAa,EAAO,YAAY,EAAO,aAAa,OAAa,MAEtG,EAAO,QAAQ,QAAQ,EAAO,aAAa,EAAO,SAAS,EAAO,QAAQ,QAAQ,EAAO,aAAa,EAAO,OAH5F;AAKtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-healthybowl",
3
- "version": "2026.820.3",
3
+ "version": "2026.821.1",
4
4
  "description": "Burdenoff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [