@burdenoff/microfe-healthybowl 2026.820.2 → 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.
- package/dist/healthybowl/pages/government-schemes/SchemeDiscoveryPage.js +181 -181
- package/dist/healthybowl/pages/government-schemes/SchemeDiscoveryPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/schemeDiscoveryFilters.js +4 -1
- package/dist/healthybowl/pages/government-schemes/schemeDiscoveryFilters.js.map +1 -1
- package/dist/healthybowl/pages/traceability/TraceLedgerPage.js +1 -0
- package/dist/healthybowl/pages/traceability/TraceLedgerPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
12
|
-
import { getEffectiveSchemeStatus as
|
|
13
|
-
import { useMemo as
|
|
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
|
|
16
|
-
import { useNavigate as
|
|
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
|
|
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__",
|
|
39
|
-
let { t:
|
|
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:
|
|
42
|
+
label: A("healthybowl.common.all", "All")
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
value: "subsidy",
|
|
46
|
-
label:
|
|
46
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.subsidy", "Subsidy")
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
value: "credit",
|
|
50
|
-
label:
|
|
50
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.credit", "Credit")
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
value: "insurance",
|
|
54
|
-
label:
|
|
54
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.insurance", "Insurance")
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
value: "training",
|
|
58
|
-
label:
|
|
58
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.training", "Training")
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
value: "grant",
|
|
62
|
-
label:
|
|
62
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.grant", "Grant")
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
value: "equipment",
|
|
66
|
-
label:
|
|
66
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.categories.equipment", "Equipment")
|
|
67
67
|
}
|
|
68
|
-
], [
|
|
68
|
+
], [A]), Oe = h(() => [
|
|
69
69
|
{
|
|
70
70
|
value: "all",
|
|
71
|
-
label:
|
|
71
|
+
label: A("healthybowl.common.all", "All")
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
value: "open",
|
|
75
|
-
label:
|
|
75
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.open", "Open")
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
value: "closing_soon",
|
|
79
|
-
label:
|
|
79
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.closingSoon", "Closing Soon")
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
value: "closed",
|
|
83
|
-
label:
|
|
83
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.closed", "Closed")
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
value: "expired",
|
|
87
|
-
label:
|
|
87
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.statuses.expired", "Expired")
|
|
88
88
|
}
|
|
89
|
-
], [
|
|
89
|
+
], [A]), M = h(() => [
|
|
90
90
|
{
|
|
91
91
|
value: "deadline",
|
|
92
|
-
label:
|
|
92
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.deadline", "Deadline (Soonest)")
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
value: "deadline-latest",
|
|
96
|
-
label:
|
|
96
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.deadlineLatest", "Deadline (Latest)")
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
value: "amount",
|
|
100
|
-
label:
|
|
100
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.amount", "Amount (Highest)")
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
value: "amount-low",
|
|
104
|
-
label:
|
|
104
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.amountLow", "Amount (Lowest)")
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
value: "name",
|
|
108
|
-
label:
|
|
108
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.name", "Name (A–Z)")
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
value: "name-desc",
|
|
112
|
-
label:
|
|
112
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.nameDesc", "Name (Z–A)")
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
value: "country",
|
|
116
|
-
label:
|
|
116
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.country", "Country (A–Z)")
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
value: "recent",
|
|
120
|
-
label:
|
|
120
|
+
label: A("healthybowl.governmentSchemes.schemeDiscovery.sort.recent", "Recently Added")
|
|
121
121
|
}
|
|
122
|
-
], [
|
|
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
|
|
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
|
-
}, [
|
|
130
|
-
let e = new Set(
|
|
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
|
-
}, [
|
|
132
|
+
}, [j]), Ve = h(() => {
|
|
133
133
|
let e = 0;
|
|
134
|
-
return
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
U,
|
|
136
|
+
P,
|
|
137
|
+
I,
|
|
138
|
+
R,
|
|
139
|
+
B,
|
|
140
|
+
H,
|
|
142
141
|
W,
|
|
143
|
-
|
|
144
|
-
q
|
|
145
|
-
|
|
146
|
-
|
|
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 =
|
|
154
|
-
currency:
|
|
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 &&
|
|
158
|
+
return s && c && l && u && d && f && m && h;
|
|
159
159
|
});
|
|
160
160
|
return i = [...i].sort((e, t) => {
|
|
161
|
-
switch (
|
|
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
|
|
165
|
-
case "amount-low": return
|
|
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
|
-
|
|
174
|
-
|
|
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
|
-
|
|
185
|
+
V((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
186
186
|
}, We = (e) => {
|
|
187
|
-
|
|
187
|
+
U(e), e === "all" && (J(""), X(""), (Z === "amount" || Z === "amount-low") && Q("deadline"));
|
|
188
188
|
}, Ge = () => {
|
|
189
|
-
|
|
189
|
+
F(""), L("all"), z("all"), V([]), U("all"), G("all"), Ne(""), J(""), X(""), Q("deadline");
|
|
190
190
|
}, Ke = (e) => {
|
|
191
|
-
let t =
|
|
192
|
-
if (!
|
|
191
|
+
let t = p(e, r());
|
|
192
|
+
if (!m(e, r())) {
|
|
193
193
|
let e = t === "expired";
|
|
194
|
-
|
|
195
|
-
title: e ?
|
|
196
|
-
description: e ?
|
|
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
|
-
|
|
203
|
+
Fe((t) => {
|
|
204
204
|
let n = new Set(t);
|
|
205
|
-
return n.has(e) ? (n.delete(e),
|
|
206
|
-
title:
|
|
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),
|
|
209
|
-
title:
|
|
210
|
-
description:
|
|
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
|
-
},
|
|
218
|
+
}, Ye = H === "all" ? A("healthybowl.governmentSchemes.schemeDiscovery.filters.selectCurrency", "Select a currency") : He;
|
|
219
219
|
return /* @__PURE__ */ b(i, {
|
|
220
|
-
title:
|
|
221
|
-
description:
|
|
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":
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
231
|
-
placeholder:
|
|
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: () =>
|
|
240
|
-
className: e("rounded-full px-3 py-1.5 text-xs font-medium transition-colors",
|
|
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:
|
|
253
|
+
children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.countryLabel", "Country / Region")
|
|
254
254
|
}), /* @__PURE__ */ b(ve, {
|
|
255
|
-
open:
|
|
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":
|
|
263
|
-
"aria-expanded":
|
|
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:
|
|
268
|
-
}), /* @__PURE__ */ y(
|
|
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(
|
|
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(
|
|
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":
|
|
278
|
-
onSelect: () =>
|
|
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",
|
|
282
|
-
children: /* @__PURE__ */ y(
|
|
283
|
-
}),
|
|
284
|
-
}), ze.map((t) => /* @__PURE__ */ b(
|
|
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":
|
|
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",
|
|
294
|
-
children: /* @__PURE__ */ y(
|
|
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:
|
|
306
|
-
}), /* @__PURE__ */ b(
|
|
307
|
-
value:
|
|
305
|
+
children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.currencyLabel", "Currency")
|
|
306
|
+
}), /* @__PURE__ */ b(T, {
|
|
307
|
+
value: H,
|
|
308
308
|
onValueChange: We,
|
|
309
|
-
children: [/* @__PURE__ */ y(
|
|
309
|
+
children: [/* @__PURE__ */ y(O, {
|
|
310
310
|
className: "h-9 w-full",
|
|
311
|
-
"aria-label":
|
|
312
|
-
children: /* @__PURE__ */ y(
|
|
313
|
-
}), /* @__PURE__ */ b(
|
|
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:
|
|
316
|
-
}), Be.map((e) => /* @__PURE__ */ y(
|
|
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:
|
|
327
|
-
}), /* @__PURE__ */ b(
|
|
328
|
-
value:
|
|
329
|
-
onValueChange: (e) =>
|
|
330
|
-
children: [/* @__PURE__ */ y(
|
|
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":
|
|
333
|
-
children: /* @__PURE__ */ y(
|
|
334
|
-
}), /* @__PURE__ */ y(
|
|
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:
|
|
345
|
-
}), /* @__PURE__ */ b(
|
|
346
|
-
value:
|
|
347
|
-
onValueChange: (e) =>
|
|
348
|
-
children: [/* @__PURE__ */ y(
|
|
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":
|
|
351
|
-
children: /* @__PURE__ */ y(
|
|
352
|
-
}), /* @__PURE__ */ b(
|
|
353
|
-
/* @__PURE__ */ y(
|
|
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:
|
|
355
|
+
children: A("healthybowl.common.all", "All")
|
|
356
356
|
}),
|
|
357
|
-
/* @__PURE__ */ y(
|
|
357
|
+
/* @__PURE__ */ y(D, {
|
|
358
358
|
value: "with",
|
|
359
|
-
children:
|
|
359
|
+
children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.deadlineWith", "Has deadline")
|
|
360
360
|
}),
|
|
361
|
-
/* @__PURE__ */ y(
|
|
361
|
+
/* @__PURE__ */ y(D, {
|
|
362
362
|
value: "without",
|
|
363
|
-
children:
|
|
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:
|
|
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(
|
|
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":
|
|
378
|
-
value:
|
|
379
|
-
onChange: (e) =>
|
|
380
|
-
placeholder:
|
|
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:
|
|
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(
|
|
395
|
+
/* @__PURE__ */ y(w, {
|
|
396
396
|
type: "number",
|
|
397
|
-
"aria-label":
|
|
397
|
+
"aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.minAmountLabel", "Minimum amount"),
|
|
398
398
|
min: 0,
|
|
399
|
-
disabled:
|
|
400
|
-
value:
|
|
401
|
-
onChange: (e) =>
|
|
402
|
-
placeholder:
|
|
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(
|
|
409
|
+
/* @__PURE__ */ y(w, {
|
|
410
410
|
type: "number",
|
|
411
|
-
"aria-label":
|
|
411
|
+
"aria-label": A("healthybowl.governmentSchemes.schemeDiscovery.filters.maxAmountLabel", "Maximum amount"),
|
|
412
412
|
min: 0,
|
|
413
|
-
disabled:
|
|
414
|
-
value:
|
|
415
|
-
onChange: (e) =>
|
|
416
|
-
placeholder:
|
|
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
|
-
|
|
421
|
+
H === "all" ? /* @__PURE__ */ y("p", {
|
|
422
422
|
className: "text-xs text-text-secondary",
|
|
423
|
-
children:
|
|
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:
|
|
438
|
+
children: A("healthybowl.governmentSchemes.schemeDiscovery.filters.activeCount", "{{count}} active filters", { count: Ve })
|
|
439
439
|
}),
|
|
440
|
-
|
|
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":
|
|
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" }),
|
|
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(
|
|
462
|
-
value:
|
|
463
|
-
onValueChange: (e) =>
|
|
464
|
-
children: [/* @__PURE__ */ y(
|
|
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":
|
|
467
|
-
children: /* @__PURE__ */ y(
|
|
468
|
-
}), /* @__PURE__ */ y(
|
|
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:
|
|
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
|
-
|
|
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:
|
|
483
|
-
description:
|
|
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:
|
|
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:
|
|
491
|
-
let a = Je(i.applicationDeadline), s =
|
|
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(
|
|
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:
|
|
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(
|
|
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:
|
|
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(
|
|
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" }),
|
|
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(
|
|
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 ?
|
|
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 ?
|
|
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 {
|
|
596
|
+
export { A as SchemeDiscoveryPage };
|
|
597
597
|
|
|
598
598
|
//# sourceMappingURL=SchemeDiscoveryPage.js.map
|