@burdenoff/microfe-ecoimpacthub 2026.819.4 → 2026.830.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.
Files changed (51) hide show
  1. package/dist/ecoimpacthub/hooks/index.d.ts +2 -0
  2. package/dist/ecoimpacthub/hooks/index.d.ts.map +1 -1
  3. package/dist/ecoimpacthub/hooks/index.js +2 -0
  4. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts +11 -0
  5. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts.map +1 -0
  6. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js +21 -0
  7. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js.map +1 -0
  8. package/dist/ecoimpacthub/hooks/useTr.d.ts +4 -0
  9. package/dist/ecoimpacthub/hooks/useTr.d.ts.map +1 -0
  10. package/dist/ecoimpacthub/hooks/useTr.js +20 -0
  11. package/dist/ecoimpacthub/hooks/useTr.js.map +1 -0
  12. package/dist/ecoimpacthub/pages/DashboardPage.d.ts.map +1 -1
  13. package/dist/ecoimpacthub/pages/DashboardPage.js +162 -138
  14. package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
  15. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts +15 -0
  16. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts.map +1 -0
  17. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js +36 -0
  18. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js.map +1 -0
  19. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts +15 -0
  20. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts.map +1 -0
  21. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js +66 -0
  22. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.d.ts.map +1 -1
  24. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +127 -124
  25. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.d.ts.map +1 -1
  27. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +226 -224
  28. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  29. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.d.ts.map +1 -1
  30. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +159 -156
  31. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  32. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.d.ts.map +1 -1
  33. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +40 -37
  34. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
  35. package/dist/ecoimpacthub/pages/sites/SitesPage.d.ts.map +1 -1
  36. package/dist/ecoimpacthub/pages/sites/SitesPage.js +208 -171
  37. package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
  38. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.d.ts.map +1 -1
  39. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +211 -214
  40. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
  41. package/dist/ecoimpacthub/pages/species/SpeciesPage.d.ts.map +1 -1
  42. package/dist/ecoimpacthub/pages/species/SpeciesPage.js +174 -157
  43. package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
  44. package/dist/ecoimpacthub/utils/activeEntity.d.ts +30 -0
  45. package/dist/ecoimpacthub/utils/activeEntity.d.ts.map +1 -0
  46. package/dist/ecoimpacthub/utils/activeEntity.js +12 -0
  47. package/dist/ecoimpacthub/utils/activeEntity.js.map +1 -0
  48. package/dist/ecoimpacthub/utils/pageContext.d.ts.map +1 -1
  49. package/dist/ecoimpacthub/utils/pageContext.js +30 -25
  50. package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
  51. package/package.json +1 -1
@@ -1,25 +1,27 @@
1
1
  import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatDateTime as ee, formatEnumLabel as n, formatNumber as r } from "../../utils/formatters.js";
4
- import { ErrorView as i, LoadingView as a, Section as te } from "../../components/StateViews.js";
3
+ import { formatDateTime as n, formatEnumLabel as r, formatNumber as i } from "../../utils/formatters.js";
4
+ import { ErrorView as a, LoadingView as ee, Section as te } from "../../components/StateViews.js";
5
5
  import { EmptyState as ne } from "../../components/EmptyState.js";
6
6
  import "../../context/index.js";
7
7
  import { useEcoArchiveSpecies as re, useEcoRecordObservation as ie, useEcoSites as ae, useEcoSpeciesDetail as oe, useEcoUpdateSpecies as se } from "../../hooks/useEcoImpactHubApi.js";
8
+ import { useActiveEcoEntity as ce } from "../../hooks/useActiveEcoEntity.js";
8
9
  import "../../hooks/index.js";
9
- import { DataTable as ce } from "../../components/DataTable.js";
10
- import { EcoTags as o } from "../../components/EcoTags.js";
11
- import { EvidenceUpload as s } from "../../components/EvidenceUpload.js";
12
- import { MethodBadge as le } from "../_shared/MethodBadge.js";
13
- import { EvidenceThumb as ue } from "../_shared/EvidenceThumb.js";
14
- import { ConservationBadge as c } from "../_shared/ConservationBadge.js";
15
- import { TaxonChip as de } from "../_shared/TaxonChip.js";
16
- import { useState as l } from "react";
17
- import { Archive as fe, ArrowLeft as pe, Binoculars as u, Pencil as me, Star as d } from "lucide-react";
18
- import { useParams as f } from "react-router";
19
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
20
- import { Button as g, GlassCard as _, Input as v, Label as y, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
10
+ import { DataTable as le } from "../../components/DataTable.js";
11
+ import { EcoTags as ue } from "../../components/EcoTags.js";
12
+ import { EvidenceUpload as de } from "../../components/EvidenceUpload.js";
13
+ import { MethodBadge as fe } from "../_shared/MethodBadge.js";
14
+ import { MethodPicker as pe } from "../_shared/MethodPicker.js";
15
+ import { EvidenceThumb as me } from "../_shared/EvidenceThumb.js";
16
+ import { ConservationBadge as o } from "../_shared/ConservationBadge.js";
17
+ import { TaxonChip as s } from "../_shared/TaxonChip.js";
18
+ import { useState as c } from "react";
19
+ import { Archive as l, ArrowLeft as u, Binoculars as d, Pencil as he, Star as f } from "lucide-react";
20
+ import { useParams as ge } from "react-router";
21
+ import { Fragment as _e, jsx as p, jsxs as m } from "react/jsx-runtime";
22
+ import { Button as h, GlassCard as g, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/ecoimpacthub/pages/species/SpeciesDetailPage.tsx
22
- var M = [
24
+ var j = [
23
25
  "DIRECT_SIGHTING",
24
26
  "CAMERA_TRAP",
25
27
  "ACOUSTIC",
@@ -27,7 +29,7 @@ var M = [
27
29
  "EDNA",
28
30
  "TELEMETRY",
29
31
  "COMMUNITY_REPORT"
30
- ], N = [
32
+ ], M = [
31
33
  "MAMMAL",
32
34
  "BIRD",
33
35
  "REPTILE",
@@ -37,7 +39,7 @@ var M = [
37
39
  "PLANT",
38
40
  "FUNGI",
39
41
  "OTHER"
40
- ], P = [
42
+ ], N = [
41
43
  "LEAST_CONCERN",
42
44
  "NEAR_THREATENED",
43
45
  "VULNERABLE",
@@ -46,223 +48,225 @@ var M = [
46
48
  "EXTINCT_IN_WILD",
47
49
  "DATA_DEFICIENT",
48
50
  "NOT_EVALUATED"
49
- ], F = (e) => {
51
+ ], P = (e) => {
50
52
  let t = (e) => String(e).padStart(2, "0");
51
53
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
52
54
  };
53
- function I() {
54
- let { id: I } = f(), { navigateTo: L } = e(), { data: R, isLoading: he, isError: ge, refetch: _e } = oe(I), ve = ae({ pagination: {
55
+ function F() {
56
+ let { id: F } = ge(), { navigateTo: I } = e(), { data: L, isLoading: ve, isError: ye, refetch: be } = oe(F);
57
+ ce(L?.id, L?.commonName);
58
+ let xe = ae({ pagination: {
55
59
  limit: 100,
56
60
  offset: 0
57
- } }), z = ie(), B = se(), V = re(), [ye, H] = l(!1), [U, W] = l({
61
+ } }), R = ie(), z = se(), B = re(), [Se, V] = c(!1), [H, U] = c({
58
62
  method: "DIRECT_SIGHTING",
59
63
  count: "1",
60
- observedAt: F(/* @__PURE__ */ new Date()),
64
+ observedAt: P(/* @__PURE__ */ new Date()),
61
65
  siteId: "",
62
66
  notes: "",
63
67
  evidence: null
64
- }), [be, G] = l(!1), [K, q] = l({
68
+ }), [W, G] = c(!1), [K, q] = c({
65
69
  commonName: "",
66
70
  scientificName: "",
67
71
  taxonGroup: "MAMMAL",
68
72
  conservationStatus: "NOT_EVALUATED",
69
73
  isPriority: !1,
70
74
  description: ""
71
- }), [J, Y] = l(null);
72
- if (he) return /* @__PURE__ */ m(t, {
75
+ }), [J, Y] = c(null);
76
+ if (ve) return /* @__PURE__ */ p(t, {
73
77
  title: "Species",
74
- children: /* @__PURE__ */ m(a, {})
78
+ children: /* @__PURE__ */ p(ee, {})
75
79
  });
76
- if (ge || !R) return /* @__PURE__ */ m(t, {
80
+ if (ye || !L) return /* @__PURE__ */ p(t, {
77
81
  title: "Species",
78
- children: /* @__PURE__ */ m(i, {
82
+ children: /* @__PURE__ */ p(a, {
79
83
  message: "This species could not be loaded.",
80
- onRetry: () => _e()
84
+ onRetry: () => be()
81
85
  })
82
86
  });
83
- let X = R.observations ?? [], Z = ve.data?.items ?? [], Q = /* @__PURE__ */ new Map();
87
+ let X = L.observations ?? [], Z = xe.data?.items ?? [], Q = /* @__PURE__ */ new Map();
84
88
  for (let e of Z) Q.set(e.id, e.name);
85
89
  let $ = () => {
86
- W({
90
+ U({
87
91
  method: "DIRECT_SIGHTING",
88
92
  count: "1",
89
- observedAt: F(/* @__PURE__ */ new Date()),
93
+ observedAt: P(/* @__PURE__ */ new Date()),
90
94
  siteId: "",
91
95
  notes: "",
92
96
  evidence: null
93
- }), Y(null), H(!0);
97
+ }), Y(null), V(!0);
94
98
  };
95
- return /* @__PURE__ */ h(t, {
96
- title: R.commonName,
97
- description: [R.scientificName, n(R.taxonGroup)].filter(Boolean).join(" · "),
98
- actions: /* @__PURE__ */ h(p, { children: [
99
- /* @__PURE__ */ m(c, { status: R.conservationStatus }),
100
- R.isPriority && /* @__PURE__ */ h("span", {
99
+ return /* @__PURE__ */ m(t, {
100
+ title: L.commonName,
101
+ description: [L.scientificName, r(L.taxonGroup)].filter(Boolean).join(" · "),
102
+ actions: /* @__PURE__ */ m(_e, { children: [
103
+ /* @__PURE__ */ p(o, { status: L.conservationStatus }),
104
+ L.isPriority && /* @__PURE__ */ m("span", {
101
105
  className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2.5 py-0.5 text-xs font-semibold text-status-warning-text",
102
106
  title: "Priority species",
103
- children: [/* @__PURE__ */ m(d, { className: "h-3.5 w-3.5 fill-current" }), " Priority"]
107
+ children: [/* @__PURE__ */ p(f, { className: "h-3.5 w-3.5 fill-current" }), " Priority"]
104
108
  }),
105
- /* @__PURE__ */ h(g, {
109
+ /* @__PURE__ */ m(h, {
106
110
  variant: "ghost",
107
- onClick: () => L("species"),
108
- children: [/* @__PURE__ */ m(pe, { className: "mr-1.5 h-4 w-4" }), " Back"]
111
+ onClick: () => I("species"),
112
+ children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Back"]
109
113
  })
110
114
  ] }),
111
115
  children: [
112
- /* @__PURE__ */ h("div", {
116
+ /* @__PURE__ */ m("div", {
113
117
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
114
- children: [/* @__PURE__ */ h(_, {
118
+ children: [/* @__PURE__ */ m(g, {
115
119
  treatment: "glass",
116
120
  className: "p-6 lg:col-span-2",
117
121
  children: [
118
- /* @__PURE__ */ h("dl", {
122
+ /* @__PURE__ */ m("dl", {
119
123
  className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
120
124
  children: [
121
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
125
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
122
126
  className: "text-xs text-text-tertiary",
123
127
  children: "Scientific name"
124
- }), /* @__PURE__ */ m("dd", {
128
+ }), /* @__PURE__ */ p("dd", {
125
129
  className: "mt-0.5 text-sm italic text-text-primary",
126
- children: R.scientificName ?? "—"
130
+ children: L.scientificName ?? "—"
127
131
  })] }),
128
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
132
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
129
133
  className: "text-xs text-text-tertiary",
130
134
  children: "Taxon group"
131
- }), /* @__PURE__ */ m("dd", {
135
+ }), /* @__PURE__ */ p("dd", {
132
136
  className: "mt-1",
133
- children: /* @__PURE__ */ m(de, { group: R.taxonGroup })
137
+ children: /* @__PURE__ */ p(s, { group: L.taxonGroup })
134
138
  })] }),
135
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
139
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
136
140
  className: "text-xs text-text-tertiary",
137
141
  children: "Conservation"
138
- }), /* @__PURE__ */ m("dd", {
142
+ }), /* @__PURE__ */ p("dd", {
139
143
  className: "mt-1",
140
- children: /* @__PURE__ */ m(c, { status: R.conservationStatus })
144
+ children: /* @__PURE__ */ p(o, { status: L.conservationStatus })
141
145
  })] }),
142
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
146
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
143
147
  className: "text-xs text-text-tertiary",
144
148
  children: "Priority"
145
- }), /* @__PURE__ */ m("dd", {
149
+ }), /* @__PURE__ */ p("dd", {
146
150
  className: "mt-0.5 text-sm text-text-primary",
147
- children: R.isPriority ? /* @__PURE__ */ h("span", {
151
+ children: L.isPriority ? /* @__PURE__ */ m("span", {
148
152
  className: "inline-flex items-center gap-1 text-status-warning-text",
149
- children: [/* @__PURE__ */ m(d, { className: "h-4 w-4 fill-current" }), " Priority"]
153
+ children: [/* @__PURE__ */ p(f, { className: "h-4 w-4 fill-current" }), " Priority"]
150
154
  }) : "—"
151
155
  })] }),
152
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", {
156
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
153
157
  className: "text-xs text-text-tertiary",
154
158
  children: "Observations"
155
- }), /* @__PURE__ */ m("dd", {
159
+ }), /* @__PURE__ */ p("dd", {
156
160
  className: "mt-0.5 text-sm text-text-primary tabular-nums",
157
161
  children: X.length
158
162
  })] })
159
163
  ]
160
164
  }),
161
- R.description && /* @__PURE__ */ m("p", {
165
+ L.description && /* @__PURE__ */ p("p", {
162
166
  className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
163
- children: R.description
167
+ children: L.description
164
168
  }),
165
- /* @__PURE__ */ m("div", {
169
+ /* @__PURE__ */ p("div", {
166
170
  className: "mt-5 border-t border-border-seam pt-4",
167
- children: /* @__PURE__ */ m(o, {
171
+ children: /* @__PURE__ */ p(ue, {
168
172
  entityType: "ecoimpacthub-species",
169
- entityId: R.id
173
+ entityId: L.id
170
174
  })
171
175
  })
172
176
  ]
173
- }), /* @__PURE__ */ h(_, {
177
+ }), /* @__PURE__ */ m(g, {
174
178
  treatment: "glass",
175
179
  className: "flex flex-col gap-3 p-6",
176
180
  children: [
177
- /* @__PURE__ */ m("p", {
181
+ /* @__PURE__ */ p("p", {
178
182
  className: "text-xs text-text-tertiary",
179
183
  children: "Quick actions"
180
184
  }),
181
- /* @__PURE__ */ h(g, {
185
+ /* @__PURE__ */ m(h, {
182
186
  onClick: $,
183
- children: [/* @__PURE__ */ m(u, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
187
+ children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
184
188
  }),
185
- /* @__PURE__ */ h(g, {
189
+ /* @__PURE__ */ m(h, {
186
190
  variant: "outline",
187
191
  onClick: () => {
188
192
  q({
189
- commonName: R.commonName,
190
- scientificName: R.scientificName ?? "",
191
- taxonGroup: R.taxonGroup,
192
- conservationStatus: R.conservationStatus,
193
- isPriority: R.isPriority,
194
- description: R.description ?? ""
193
+ commonName: L.commonName,
194
+ scientificName: L.scientificName ?? "",
195
+ taxonGroup: L.taxonGroup,
196
+ conservationStatus: L.conservationStatus,
197
+ isPriority: L.isPriority,
198
+ description: L.description ?? ""
195
199
  }), Y(null), G(!0);
196
200
  },
197
- children: [/* @__PURE__ */ m(me, { className: "mr-1.5 h-4 w-4" }), " Edit species"]
201
+ children: [/* @__PURE__ */ p(he, { className: "mr-1.5 h-4 w-4" }), " Edit species"]
198
202
  }),
199
- /* @__PURE__ */ h(g, {
203
+ /* @__PURE__ */ m(h, {
200
204
  variant: "ghost",
201
205
  onClick: async () => {
202
- if (I) {
206
+ if (F) {
203
207
  Y(null);
204
208
  try {
205
- await V.mutateAsync(I), L("species");
209
+ await B.mutateAsync(F), I("species");
206
210
  } catch (e) {
207
211
  Y(e instanceof Error ? e.message : "Failed to archive species.");
208
212
  }
209
213
  }
210
214
  },
211
- disabled: V.isPending,
215
+ disabled: B.isPending,
212
216
  className: "text-status-error-text hover:text-status-error-text",
213
- children: [/* @__PURE__ */ m(fe, { className: "mr-1.5 h-4 w-4" }), " Archive"]
217
+ children: [/* @__PURE__ */ p(l, { className: "mr-1.5 h-4 w-4" }), " Archive"]
214
218
  })
215
219
  ]
216
220
  })]
217
221
  }),
218
- J && /* @__PURE__ */ m("p", {
222
+ J && /* @__PURE__ */ p("p", {
219
223
  className: "mt-4 text-sm text-status-error-text",
220
224
  children: J
221
225
  }),
222
- /* @__PURE__ */ m(te, {
226
+ /* @__PURE__ */ p(te, {
223
227
  title: "Observations",
224
228
  description: "Field records logged against this species.",
225
- action: /* @__PURE__ */ h(g, {
229
+ action: /* @__PURE__ */ m(h, {
226
230
  size: "sm",
227
231
  onClick: $,
228
- children: [/* @__PURE__ */ m(u, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
232
+ children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
229
233
  }),
230
- children: X.length === 0 ? /* @__PURE__ */ m(ne, {
234
+ children: X.length === 0 ? /* @__PURE__ */ p(ne, {
231
235
  illustration: "empty-data",
232
236
  title: "No observations yet",
233
237
  description: "Record a field observation to see it here."
234
- }) : /* @__PURE__ */ m(ce, {
238
+ }) : /* @__PURE__ */ p(le, {
235
239
  columns: [
236
240
  {
237
241
  key: "evidence",
238
242
  header: "Evidence",
239
- render: (e) => /* @__PURE__ */ m(ue, {
243
+ render: (e) => /* @__PURE__ */ p(me, {
240
244
  fileId: e.evidence?.id,
241
- alt: R.commonName
245
+ alt: L.commonName
242
246
  })
243
247
  },
244
248
  {
245
249
  key: "method",
246
250
  header: "Method",
247
- render: (e) => /* @__PURE__ */ m(le, { method: e.method })
251
+ render: (e) => /* @__PURE__ */ p(fe, { method: e.method })
248
252
  },
249
253
  {
250
254
  key: "count",
251
255
  header: "Count",
252
256
  align: "right",
253
257
  sortValue: (e) => e.count,
254
- render: (e) => /* @__PURE__ */ h("span", {
258
+ render: (e) => /* @__PURE__ */ m("span", {
255
259
  className: "tabular-nums font-medium text-text-primary",
256
- children: ["×", r(e.count)]
260
+ children: ["×", i(e.count)]
257
261
  })
258
262
  },
259
263
  {
260
264
  key: "observedAt",
261
265
  header: "Observed",
262
266
  hideOnMobile: !0,
263
- render: (e) => /* @__PURE__ */ m("span", {
267
+ render: (e) => /* @__PURE__ */ p("span", {
264
268
  className: "whitespace-nowrap text-text-secondary",
265
- children: ee(e.observedAt)
269
+ children: n(e.observedAt)
266
270
  })
267
271
  },
268
272
  {
@@ -271,10 +275,10 @@ function I() {
271
275
  hideOnMobile: !0,
272
276
  render: (e) => {
273
277
  let t = e.siteId ? Q.get(e.siteId) : void 0;
274
- return t ? /* @__PURE__ */ m("span", {
278
+ return t ? /* @__PURE__ */ p("span", {
275
279
  className: "text-text-secondary",
276
280
  children: t
277
- }) : /* @__PURE__ */ m("span", {
281
+ }) : /* @__PURE__ */ p("span", {
278
282
  className: "text-text-tertiary",
279
283
  children: "—"
280
284
  });
@@ -284,11 +288,11 @@ function I() {
284
288
  key: "notes",
285
289
  header: "Notes",
286
290
  hideOnMobile: !0,
287
- render: (e) => e.notes ? /* @__PURE__ */ m("span", {
291
+ render: (e) => e.notes ? /* @__PURE__ */ p("span", {
288
292
  className: "block max-w-xs truncate text-text-secondary",
289
293
  title: e.notes,
290
294
  children: e.notes
291
- }) : /* @__PURE__ */ m("span", {
295
+ }) : /* @__PURE__ */ p("span", {
292
296
  className: "text-text-tertiary",
293
297
  children: "—"
294
298
  })
@@ -298,165 +302,158 @@ function I() {
298
302
  rowKey: (e) => e.id
299
303
  })
300
304
  }),
301
- /* @__PURE__ */ m(b, {
302
- open: ye,
303
- onOpenChange: H,
304
- children: /* @__PURE__ */ h(x, { children: [
305
- /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, { children: "Record observation" }), /* @__PURE__ */ h(S, { children: [
305
+ /* @__PURE__ */ p(y, {
306
+ open: Se,
307
+ onOpenChange: V,
308
+ children: /* @__PURE__ */ m(b, { children: [
309
+ /* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Record observation" }), /* @__PURE__ */ m(x, { children: [
306
310
  "Log a field sighting or detection of ",
307
- R.commonName,
311
+ L.commonName,
308
312
  "."
309
313
  ] })] }),
310
- /* @__PURE__ */ h("div", {
314
+ /* @__PURE__ */ m("div", {
311
315
  className: "grid gap-4 py-2",
312
316
  children: [
313
- /* @__PURE__ */ h("div", {
317
+ /* @__PURE__ */ m("div", {
318
+ className: "grid gap-1.5",
319
+ children: [/* @__PURE__ */ p(v, { children: "Method" }), /* @__PURE__ */ p(pe, {
320
+ options: j,
321
+ value: H.method,
322
+ onChange: (e) => U({
323
+ ...H,
324
+ method: e
325
+ }),
326
+ label: "Observation method"
327
+ })]
328
+ }),
329
+ /* @__PURE__ */ p("div", {
314
330
  className: "grid gap-2 sm:grid-cols-2",
315
- children: [/* @__PURE__ */ h("div", {
331
+ children: /* @__PURE__ */ m("div", {
316
332
  className: "grid gap-1.5",
317
- children: [/* @__PURE__ */ m(y, {
318
- htmlFor: "obsMethod",
319
- children: "Method"
320
- }), /* @__PURE__ */ h(E, {
321
- value: U.method,
322
- onValueChange: (e) => W({
323
- ...U,
324
- method: e
325
- }),
326
- children: [/* @__PURE__ */ m(k, {
327
- id: "obsMethod",
328
- children: /* @__PURE__ */ m(A, {})
329
- }), /* @__PURE__ */ m(D, { children: M.map((e) => /* @__PURE__ */ m(O, {
330
- value: e,
331
- children: n(e)
332
- }, e)) })]
333
- })]
334
- }), /* @__PURE__ */ h("div", {
335
- className: "grid gap-1.5",
336
- children: [/* @__PURE__ */ m(y, {
333
+ children: [/* @__PURE__ */ p(v, {
337
334
  htmlFor: "obsCount",
338
335
  children: "Count"
339
- }), /* @__PURE__ */ m(v, {
336
+ }), /* @__PURE__ */ p(_, {
340
337
  id: "obsCount",
341
338
  type: "number",
342
339
  min: "1",
343
340
  step: "1",
344
- value: U.count,
345
- onChange: (e) => W({
346
- ...U,
341
+ value: H.count,
342
+ onChange: (e) => U({
343
+ ...H,
347
344
  count: e.target.value
348
345
  }),
349
346
  placeholder: "1"
350
347
  })]
351
- })]
348
+ })
352
349
  }),
353
- /* @__PURE__ */ h("div", {
350
+ /* @__PURE__ */ m("div", {
354
351
  className: "grid gap-1.5",
355
- children: [/* @__PURE__ */ m(y, {
352
+ children: [/* @__PURE__ */ p(v, {
356
353
  htmlFor: "obsAt",
357
354
  children: "Observed at"
358
- }), /* @__PURE__ */ m(v, {
355
+ }), /* @__PURE__ */ p(_, {
359
356
  id: "obsAt",
360
357
  type: "datetime-local",
361
- value: U.observedAt,
362
- onChange: (e) => W({
363
- ...U,
358
+ value: H.observedAt,
359
+ onChange: (e) => U({
360
+ ...H,
364
361
  observedAt: e.target.value
365
362
  })
366
363
  })]
367
364
  }),
368
- /* @__PURE__ */ h("div", {
365
+ /* @__PURE__ */ m("div", {
369
366
  className: "grid gap-1.5",
370
- children: [/* @__PURE__ */ m(y, {
367
+ children: [/* @__PURE__ */ p(v, {
371
368
  htmlFor: "obsSite",
372
369
  children: "Site (optional)"
373
- }), /* @__PURE__ */ h(E, {
374
- value: U.siteId,
375
- onValueChange: (e) => W({
376
- ...U,
370
+ }), /* @__PURE__ */ m(T, {
371
+ value: H.siteId,
372
+ onValueChange: (e) => U({
373
+ ...H,
377
374
  siteId: e
378
375
  }),
379
- children: [/* @__PURE__ */ m(k, {
376
+ children: [/* @__PURE__ */ p(O, {
380
377
  id: "obsSite",
381
- children: /* @__PURE__ */ m(A, { placeholder: "No site" })
382
- }), /* @__PURE__ */ m(D, { children: Z.map((e) => /* @__PURE__ */ m(O, {
378
+ children: /* @__PURE__ */ p(k, { placeholder: "No site" })
379
+ }), /* @__PURE__ */ p(E, { children: Z.map((e) => /* @__PURE__ */ p(D, {
383
380
  value: e.id,
384
381
  children: e.name
385
382
  }, e.id)) })]
386
383
  })]
387
384
  }),
388
- /* @__PURE__ */ h("div", {
385
+ /* @__PURE__ */ m("div", {
389
386
  className: "grid gap-1.5",
390
- children: [/* @__PURE__ */ m(y, {
387
+ children: [/* @__PURE__ */ p(v, {
391
388
  htmlFor: "obsNotes",
392
389
  children: "Notes"
393
- }), /* @__PURE__ */ m(j, {
390
+ }), /* @__PURE__ */ p(A, {
394
391
  id: "obsNotes",
395
- value: U.notes,
396
- onChange: (e) => W({
397
- ...U,
392
+ value: H.notes,
393
+ onChange: (e) => U({
394
+ ...H,
398
395
  notes: e.target.value
399
396
  }),
400
397
  placeholder: "Optional context — behaviour, conditions, evidence.",
401
398
  rows: 2
402
399
  })]
403
400
  }),
404
- /* @__PURE__ */ m(s, {
401
+ /* @__PURE__ */ p(de, {
405
402
  id: "speciesObsEvidence",
406
403
  label: "Evidence photo (optional)",
407
- value: U.evidence,
408
- onChange: (e) => W({
409
- ...U,
404
+ value: H.evidence,
405
+ onChange: (e) => U({
406
+ ...H,
410
407
  evidence: e
411
408
  }),
412
409
  hint: "Attach a photo, audio clip or PDF as supporting evidence."
413
410
  })
414
411
  ]
415
412
  }),
416
- /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(g, {
413
+ /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
417
414
  variant: "outline",
418
- onClick: () => H(!1),
415
+ onClick: () => V(!1),
419
416
  children: "Cancel"
420
- }), /* @__PURE__ */ m(g, {
417
+ }), /* @__PURE__ */ p(h, {
421
418
  onClick: async () => {
422
- if (I) {
419
+ if (F) {
423
420
  Y(null);
424
421
  try {
425
- await z.mutateAsync({
426
- speciesId: I,
427
- method: U.method,
428
- count: U.count ? Number(U.count) : 1,
429
- observedAt: new Date(U.observedAt).toISOString(),
430
- siteId: U.siteId || null,
431
- notes: U.notes.trim() || null,
432
- evidenceFileId: U.evidence?.fileId ?? null
433
- }), H(!1);
422
+ await R.mutateAsync({
423
+ speciesId: F,
424
+ method: H.method,
425
+ count: H.count ? Number(H.count) : 1,
426
+ observedAt: new Date(H.observedAt).toISOString(),
427
+ siteId: H.siteId || null,
428
+ notes: H.notes.trim() || null,
429
+ evidenceFileId: H.evidence?.fileId ?? null
430
+ }), V(!1);
434
431
  } catch (e) {
435
432
  Y(e instanceof Error ? e.message : "Failed to record observation.");
436
433
  }
437
434
  }
438
435
  },
439
- disabled: z.isPending,
440
- children: z.isPending ? "Recording…" : "Record"
436
+ disabled: R.isPending,
437
+ children: R.isPending ? "Recording…" : "Record"
441
438
  })] })
442
439
  ] })
443
440
  }),
444
- /* @__PURE__ */ m(b, {
445
- open: be,
441
+ /* @__PURE__ */ p(y, {
442
+ open: W,
446
443
  onOpenChange: G,
447
- children: /* @__PURE__ */ h(x, { children: [
448
- /* @__PURE__ */ h(w, { children: [/* @__PURE__ */ m(T, { children: "Edit species" }), /* @__PURE__ */ m(S, { children: "Update naming, classification and priority for this species." })] }),
449
- /* @__PURE__ */ h("div", {
444
+ children: /* @__PURE__ */ m(b, { children: [
445
+ /* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Edit species" }), /* @__PURE__ */ p(x, { children: "Update naming, classification and priority for this species." })] }),
446
+ /* @__PURE__ */ m("div", {
450
447
  className: "grid gap-4 py-2",
451
448
  children: [
452
- /* @__PURE__ */ h("div", {
449
+ /* @__PURE__ */ m("div", {
453
450
  className: "grid gap-2 sm:grid-cols-2",
454
- children: [/* @__PURE__ */ h("div", {
451
+ children: [/* @__PURE__ */ m("div", {
455
452
  className: "grid gap-1.5",
456
- children: [/* @__PURE__ */ m(y, {
453
+ children: [/* @__PURE__ */ p(v, {
457
454
  htmlFor: "editCommon",
458
455
  children: "Common name *"
459
- }), /* @__PURE__ */ m(v, {
456
+ }), /* @__PURE__ */ p(_, {
460
457
  id: "editCommon",
461
458
  value: K.commonName,
462
459
  onChange: (e) => q({
@@ -465,12 +462,12 @@ function I() {
465
462
  }),
466
463
  placeholder: "Indian Pangolin"
467
464
  })]
468
- }), /* @__PURE__ */ h("div", {
465
+ }), /* @__PURE__ */ m("div", {
469
466
  className: "grid gap-1.5",
470
- children: [/* @__PURE__ */ m(y, {
467
+ children: [/* @__PURE__ */ p(v, {
471
468
  htmlFor: "editScientific",
472
469
  children: "Scientific name"
473
- }), /* @__PURE__ */ m(v, {
470
+ }), /* @__PURE__ */ p(_, {
474
471
  id: "editScientific",
475
472
  value: K.scientificName,
476
473
  onChange: (e) => q({
@@ -481,51 +478,51 @@ function I() {
481
478
  })]
482
479
  })]
483
480
  }),
484
- /* @__PURE__ */ h("div", {
481
+ /* @__PURE__ */ m("div", {
485
482
  className: "grid gap-2 sm:grid-cols-2",
486
- children: [/* @__PURE__ */ h("div", {
483
+ children: [/* @__PURE__ */ m("div", {
487
484
  className: "grid gap-1.5",
488
- children: [/* @__PURE__ */ m(y, {
485
+ children: [/* @__PURE__ */ p(v, {
489
486
  htmlFor: "editTaxon",
490
487
  children: "Taxon group"
491
- }), /* @__PURE__ */ h(E, {
488
+ }), /* @__PURE__ */ m(T, {
492
489
  value: K.taxonGroup,
493
490
  onValueChange: (e) => q({
494
491
  ...K,
495
492
  taxonGroup: e
496
493
  }),
497
- children: [/* @__PURE__ */ m(k, {
494
+ children: [/* @__PURE__ */ p(O, {
498
495
  id: "editTaxon",
499
- children: /* @__PURE__ */ m(A, {})
500
- }), /* @__PURE__ */ m(D, { children: N.map((e) => /* @__PURE__ */ m(O, {
496
+ children: /* @__PURE__ */ p(k, {})
497
+ }), /* @__PURE__ */ p(E, { children: M.map((e) => /* @__PURE__ */ p(D, {
501
498
  value: e,
502
- children: n(e)
499
+ children: r(e)
503
500
  }, e)) })]
504
501
  })]
505
- }), /* @__PURE__ */ h("div", {
502
+ }), /* @__PURE__ */ m("div", {
506
503
  className: "grid gap-1.5",
507
- children: [/* @__PURE__ */ m(y, {
504
+ children: [/* @__PURE__ */ p(v, {
508
505
  htmlFor: "editConservation",
509
506
  children: "Conservation status"
510
- }), /* @__PURE__ */ h(E, {
507
+ }), /* @__PURE__ */ m(T, {
511
508
  value: K.conservationStatus,
512
509
  onValueChange: (e) => q({
513
510
  ...K,
514
511
  conservationStatus: e
515
512
  }),
516
- children: [/* @__PURE__ */ m(k, {
513
+ children: [/* @__PURE__ */ p(O, {
517
514
  id: "editConservation",
518
- children: /* @__PURE__ */ m(A, {})
519
- }), /* @__PURE__ */ m(D, { children: P.map((e) => /* @__PURE__ */ m(O, {
515
+ children: /* @__PURE__ */ p(k, {})
516
+ }), /* @__PURE__ */ p(E, { children: N.map((e) => /* @__PURE__ */ p(D, {
520
517
  value: e,
521
- children: n(e)
518
+ children: r(e)
522
519
  }, e)) })]
523
520
  })]
524
521
  })]
525
522
  }),
526
- /* @__PURE__ */ h("label", {
523
+ /* @__PURE__ */ m("label", {
527
524
  className: "flex items-center gap-2 text-sm text-text-primary",
528
- children: [/* @__PURE__ */ m("input", {
525
+ children: [/* @__PURE__ */ p("input", {
529
526
  type: "checkbox",
530
527
  checked: K.isPriority,
531
528
  onChange: (e) => q({
@@ -535,12 +532,12 @@ function I() {
535
532
  className: "h-4 w-4 rounded border-border-seam accent-action-primary-bg"
536
533
  }), "Mark as priority species"]
537
534
  }),
538
- /* @__PURE__ */ h("div", {
535
+ /* @__PURE__ */ m("div", {
539
536
  className: "grid gap-1.5",
540
- children: [/* @__PURE__ */ m(y, {
537
+ children: [/* @__PURE__ */ p(v, {
541
538
  htmlFor: "editDescription",
542
539
  children: "Description"
543
- }), /* @__PURE__ */ m(j, {
540
+ }), /* @__PURE__ */ p(A, {
544
541
  id: "editDescription",
545
542
  value: K.description,
546
543
  onChange: (e) => q({
@@ -553,20 +550,20 @@ function I() {
553
550
  })
554
551
  ]
555
552
  }),
556
- /* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(g, {
553
+ /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
557
554
  variant: "outline",
558
555
  onClick: () => G(!1),
559
556
  children: "Cancel"
560
- }), /* @__PURE__ */ m(g, {
557
+ }), /* @__PURE__ */ p(h, {
561
558
  onClick: async () => {
562
- if (!I || !K.commonName.trim()) {
559
+ if (!F || !K.commonName.trim()) {
563
560
  Y("Common name is required.");
564
561
  return;
565
562
  }
566
563
  Y(null);
567
564
  try {
568
- await B.mutateAsync({
569
- id: I,
565
+ await z.mutateAsync({
566
+ id: F,
570
567
  input: {
571
568
  commonName: K.commonName.trim(),
572
569
  scientificName: K.scientificName.trim() || null,
@@ -580,8 +577,8 @@ function I() {
580
577
  Y(e instanceof Error ? e.message : "Failed to update species.");
581
578
  }
582
579
  },
583
- disabled: B.isPending,
584
- children: B.isPending ? "Saving…" : "Save changes"
580
+ disabled: z.isPending,
581
+ children: z.isPending ? "Saving…" : "Save changes"
585
582
  })] })
586
583
  ] })
587
584
  })
@@ -589,6 +586,6 @@ function I() {
589
586
  });
590
587
  }
591
588
  //#endregion
592
- export { I as SpeciesDetailPage };
589
+ export { F as SpeciesDetailPage };
593
590
 
594
591
  //# sourceMappingURL=SpeciesDetailPage.js.map