@burdenoff/microfe-ecoimpacthub 2026.1110.7 → 2026.1110.9

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.
@@ -5,144 +5,152 @@ import { useCallback as r, useEffect as i } from "react";
5
5
  import { QueryClient as a, QueryClientProvider as o } from "@tanstack/react-query";
6
6
  import { FeatureFlagProvider as s } from "@burdenoff/fe-libs/shared/feature-flags";
7
7
  import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
- import { Binoculars as l, BookOpen as u, Factory as d, FileText as f, Gauge as p, HandCoins as m, LayoutDashboard as h, MapPin as g, PawPrint as _, Recycle as v, Sun as y, Trees as b } from "lucide-react";
9
- import { jsx as x } from "react/jsx-runtime";
8
+ import { Binoculars as l, BookOpen as u, Factory as d, FileCheck2 as f, FileText as p, Gauge as m, HandCoins as h, LayoutDashboard as g, MapPin as _, PawPrint as v, Recycle as y, Sun as b, Trees as x } from "lucide-react";
9
+ import { jsx as S } from "react/jsx-runtime";
10
10
  // src/ecoimpacthub/EcoImpactHubRoot.tsx
11
- var S = new a({ defaultOptions: { queries: {
11
+ var C = new a({ defaultOptions: { queries: {
12
12
  staleTime: 3e5,
13
13
  retry: 1,
14
14
  refetchOnWindowFocus: !1
15
- } } }), C = (a) => {
16
- let { registerNavItems: C, registerFooterItems: w, basePath: T = "/" } = a, { t: E } = c(), D = r((e, t) => {
17
- let n = E(e);
15
+ } } }), w = (a) => {
16
+ let { registerNavItems: w, registerFooterItems: T, basePath: E = "/" } = a, { t: D } = c(), O = r((e, t) => {
17
+ let n = D(e);
18
18
  return n === e ? t : n;
19
- }, [E]);
19
+ }, [D]);
20
20
  return i(() => {
21
- if (!C) return;
21
+ if (!w) return;
22
22
  let e = [
23
23
  {
24
24
  id: "ecoimpacthub-dashboard",
25
- label: D("ecoimpacthub.nav.dashboard", "Dashboard"),
26
- path: n(T, ""),
27
- icon: /* @__PURE__ */ x(h, { size: 20 }),
25
+ label: O("ecoimpacthub.nav.dashboard", "Dashboard"),
26
+ path: n(E, ""),
27
+ icon: /* @__PURE__ */ S(g, { size: 20 }),
28
28
  order: 0,
29
29
  group: "products"
30
30
  },
31
31
  {
32
32
  id: "ecoimpacthub-sites",
33
- label: D("ecoimpacthub.nav.sites", "Sites"),
34
- path: n(T, "sites"),
35
- icon: /* @__PURE__ */ x(g, { size: 20 }),
33
+ label: O("ecoimpacthub.nav.sites", "Sites"),
34
+ path: n(E, "sites"),
35
+ icon: /* @__PURE__ */ S(_, { size: 20 }),
36
36
  order: 1,
37
37
  group: "products"
38
38
  },
39
39
  {
40
40
  id: "ecoimpacthub-monitoring",
41
- label: D("ecoimpacthub.nav.monitoring", "Monitoring"),
42
- path: n(T, "monitoring"),
43
- icon: /* @__PURE__ */ x(p, { size: 20 }),
41
+ label: O("ecoimpacthub.nav.monitoring", "Monitoring"),
42
+ path: n(E, "monitoring"),
43
+ icon: /* @__PURE__ */ S(m, { size: 20 }),
44
44
  order: 2,
45
45
  group: "products"
46
46
  },
47
47
  {
48
48
  id: "ecoimpacthub-species",
49
- label: D("ecoimpacthub.nav.species", "Species"),
50
- path: n(T, "species"),
51
- icon: /* @__PURE__ */ x(_, { size: 20 }),
49
+ label: O("ecoimpacthub.nav.species", "Species"),
50
+ path: n(E, "species"),
51
+ icon: /* @__PURE__ */ S(v, { size: 20 }),
52
52
  order: 3,
53
53
  group: "products"
54
54
  },
55
55
  {
56
56
  id: "ecoimpacthub-observations",
57
- label: D("ecoimpacthub.nav.observations", "Observations"),
58
- path: n(T, "observations"),
59
- icon: /* @__PURE__ */ x(l, { size: 20 }),
57
+ label: O("ecoimpacthub.nav.observations", "Observations"),
58
+ path: n(E, "observations"),
59
+ icon: /* @__PURE__ */ S(l, { size: 20 }),
60
60
  order: 4,
61
61
  group: "products"
62
62
  },
63
63
  {
64
64
  id: "ecoimpacthub-habitat",
65
- label: D("ecoimpacthub.nav.habitat", "Habitat"),
66
- path: n(T, "habitat"),
67
- icon: /* @__PURE__ */ x(b, { size: 20 }),
65
+ label: O("ecoimpacthub.nav.habitat", "Habitat"),
66
+ path: n(E, "habitat"),
67
+ icon: /* @__PURE__ */ S(x, { size: 20 }),
68
68
  order: 5,
69
69
  group: "products"
70
70
  },
71
71
  {
72
72
  id: "ecoimpacthub-carbon",
73
- label: D("ecoimpacthub.nav.carbon", "Carbon"),
74
- path: n(T, "carbon"),
75
- icon: /* @__PURE__ */ x(d, { size: 20 }),
73
+ label: O("ecoimpacthub.nav.carbon", "Carbon"),
74
+ path: n(E, "carbon"),
75
+ icon: /* @__PURE__ */ S(d, { size: 20 }),
76
76
  order: 6,
77
77
  group: "products"
78
78
  },
79
79
  {
80
80
  id: "ecoimpacthub-circularity",
81
- label: D("ecoimpacthub.nav.circularity", "Waste & Circularity"),
82
- path: n(T, "circularity"),
83
- icon: /* @__PURE__ */ x(v, { size: 20 }),
81
+ label: O("ecoimpacthub.nav.circularity", "Waste & Circularity"),
82
+ path: n(E, "circularity"),
83
+ icon: /* @__PURE__ */ S(y, { size: 20 }),
84
84
  order: 7,
85
85
  group: "products"
86
86
  },
87
87
  {
88
88
  id: "ecoimpacthub-metrics",
89
- label: D("ecoimpacthub.nav.metrics", "Metrics"),
90
- path: n(T, "metrics"),
91
- icon: /* @__PURE__ */ x(u, { size: 20 }),
89
+ label: O("ecoimpacthub.nav.metrics", "Metrics"),
90
+ path: n(E, "metrics"),
91
+ icon: /* @__PURE__ */ S(u, { size: 20 }),
92
92
  order: 7,
93
93
  group: "products"
94
94
  },
95
95
  {
96
96
  id: "ecoimpacthub-energy",
97
- label: D("ecoimpacthub.nav.energy", "Energy"),
98
- path: n(T, "energy"),
99
- icon: /* @__PURE__ */ x(y, { size: 20 }),
97
+ label: O("ecoimpacthub.nav.energy", "Energy"),
98
+ path: n(E, "energy"),
99
+ icon: /* @__PURE__ */ S(b, { size: 20 }),
100
100
  order: 8,
101
101
  group: "products"
102
102
  },
103
103
  {
104
104
  id: "ecoimpacthub-reports",
105
- label: D("ecoimpacthub.nav.reports", "Reports"),
106
- path: n(T, "reports"),
107
- icon: /* @__PURE__ */ x(f, { size: 20 }),
105
+ label: O("ecoimpacthub.nav.reports", "Reports"),
106
+ path: n(E, "reports"),
107
+ icon: /* @__PURE__ */ S(p, { size: 20 }),
108
+ order: 9,
109
+ group: "products"
110
+ },
111
+ {
112
+ id: "ecoimpacthub-compliance",
113
+ label: O("ecoimpacthub.nav.compliance", "Compliance"),
114
+ path: n(E, "compliance"),
115
+ icon: /* @__PURE__ */ S(f, { size: 20 }),
108
116
  order: 9,
109
117
  group: "products"
110
118
  },
111
119
  {
112
120
  id: "ecoimpacthub-grants",
113
- label: D("ecoimpacthub.nav.grants", "Grants"),
114
- path: n(T, "grants"),
115
- icon: /* @__PURE__ */ x(m, { size: 20 }),
121
+ label: O("ecoimpacthub.nav.grants", "Grants"),
122
+ path: n(E, "grants"),
123
+ icon: /* @__PURE__ */ S(h, { size: 20 }),
116
124
  order: 8,
117
125
  group: "products"
118
126
  }
119
127
  ];
120
- return C(e);
128
+ return w(e);
121
129
  }, [
122
- C,
123
- T,
124
- D
130
+ w,
131
+ E,
132
+ O
125
133
  ]), i(() => {
126
- if (w) return w([{
134
+ if (T) return T([{
127
135
  id: "ecoimpacthub-status",
128
- label: D("ecoimpacthub.footer.ready", "EcoImpactHub Ready"),
136
+ label: O("ecoimpacthub.footer.ready", "EcoImpactHub Ready"),
129
137
  type: "status",
130
138
  section: "left",
131
139
  order: 10
132
140
  }]);
133
- }, [w, D]), /* @__PURE__ */ x(o, {
134
- client: S,
135
- children: /* @__PURE__ */ x(s, {
141
+ }, [T, O]), /* @__PURE__ */ S(o, {
142
+ client: C,
143
+ children: /* @__PURE__ */ S(s, {
136
144
  workspaceId: null,
137
145
  gateway: "global",
138
146
  defaultEnabled: !0,
139
- children: /* @__PURE__ */ x(e, {
147
+ children: /* @__PURE__ */ S(e, {
140
148
  ...a,
141
- children: /* @__PURE__ */ x(t, {})
149
+ children: /* @__PURE__ */ S(t, {})
142
150
  })
143
151
  })
144
152
  });
145
153
  };
146
- export { C as EcoImpactHubRoot };
154
+ export { w as EcoImpactHubRoot };
147
155
 
148
156
  //# sourceMappingURL=EcoImpactHubRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EcoImpactHubRoot.js","names":["queryClient","QueryClient","EcoImpactHubRoot","props","translate","useI18n","t","useCallback","value","key","fallback","useEffect","registerNavItems","navItems","joinPath","basePath","LayoutDashboard","MapPin","Gauge","PawPrint","Binoculars","Trees","Factory","Recycle","BookOpen","Sun","FileText","HandCoins","registerFooterItems","QueryClientProvider","FeatureFlagProvider","EcoImpactHubProvider","EcoImpactHubRoutes"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoot.tsx"],"sourcesContent":["/**\n * EcoImpactHub Root Component\n * @module ecoimpacthub\n *\n * Host-contract entry point. Registers the product's sidebar nav (eleven sections\n * that map 1:1 to the wspace-ecoimpacthub-svc `eco*` backend) and mounts the\n * routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n MapPin,\n Gauge,\n PawPrint,\n Binoculars,\n Trees,\n Factory,\n Recycle,\n BookOpen,\n Sun,\n FileText,\n HandCoins,\n} from 'lucide-react';\nimport { EcoImpactHubProvider } from './context/EcoImpactHubContext';\nimport { EcoImpactHubRoutes } from './EcoImpactHubRoutes';\nimport { joinPath } from './utils/navigation';\nimport type { EcoImpactHubRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nexport const EcoImpactHubRoot: FC<EcoImpactHubRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Register navigation items with the shell on mount. Ids/paths/orders match\n // the app-shell static NavRegistration block so the two are a single,\n // consistent source of truth.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'ecoimpacthub-dashboard',\n label: t('ecoimpacthub.nav.dashboard', 'Dashboard'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-sites',\n label: t('ecoimpacthub.nav.sites', 'Sites'),\n path: joinPath(basePath, 'sites'),\n icon: <MapPin size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-monitoring',\n label: t('ecoimpacthub.nav.monitoring', 'Monitoring'),\n path: joinPath(basePath, 'monitoring'),\n icon: <Gauge size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-species',\n label: t('ecoimpacthub.nav.species', 'Species'),\n path: joinPath(basePath, 'species'),\n icon: <PawPrint size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-observations',\n label: t('ecoimpacthub.nav.observations', 'Observations'),\n path: joinPath(basePath, 'observations'),\n icon: <Binoculars size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-habitat',\n label: t('ecoimpacthub.nav.habitat', 'Habitat'),\n path: joinPath(basePath, 'habitat'),\n icon: <Trees size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-carbon',\n label: t('ecoimpacthub.nav.carbon', 'Carbon'),\n path: joinPath(basePath, 'carbon'),\n icon: <Factory size={20} />,\n order: 6,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-circularity',\n label: t('ecoimpacthub.nav.circularity', 'Waste & Circularity'),\n path: joinPath(basePath, 'circularity'),\n icon: <Recycle size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-metrics',\n label: t('ecoimpacthub.nav.metrics', 'Metrics'),\n path: joinPath(basePath, 'metrics'),\n icon: <BookOpen size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-energy',\n label: t('ecoimpacthub.nav.energy', 'Energy'),\n path: joinPath(basePath, 'energy'),\n icon: <Sun size={20} />,\n order: 8,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-reports',\n label: t('ecoimpacthub.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileText size={20} />,\n order: 9,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-grants',\n label: t('ecoimpacthub.nav.grants', 'Grants'),\n path: joinPath(basePath, 'grants'),\n icon: <HandCoins size={20} />,\n order: 8,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'ecoimpacthub-status',\n label: t('ecoimpacthub.footer.ready', 'EcoImpactHub Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <EcoImpactHubProvider {...props}>\n <EcoImpactHubRoutes />\n </EcoImpactHubProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAiCA,IAAMA,IAAc,IAAIC,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW;CACX,OAAO;CACP,sBAAsB;AACxB,EACF,EACF,CAAC,GAEYC,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQC,GAC5D,EAAE,GAAGC,MAAcC,EAAQ,GAC3BC,IAAIC,GACP,GAAa,MAA6B;EACzC,IAAMC,IAAQJ,EAAUK,CA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B;GACvE,UAAA,kBAACC,GAAD;IAAsB,GAAI5B;IACxB,UAAA,kBAAC6B,GAAD,CAAqB,CAAA;GACD,CAAA;EACH,CAAA;CACF,CAAA;AAEzB"}
1
+ {"version":3,"file":"EcoImpactHubRoot.js","names":["queryClient","QueryClient","EcoImpactHubRoot","props","translate","useI18n","t","useCallback","value","key","fallback","useEffect","registerNavItems","navItems","joinPath","basePath","LayoutDashboard","MapPin","Gauge","PawPrint","Binoculars","Trees","Factory","Recycle","BookOpen","Sun","FileText","FileCheck2","HandCoins","registerFooterItems","QueryClientProvider","FeatureFlagProvider","EcoImpactHubProvider","EcoImpactHubRoutes"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoot.tsx"],"sourcesContent":["/**\n * EcoImpactHub Root Component\n * @module ecoimpacthub\n *\n * Host-contract entry point. Registers the product's sidebar nav (eleven sections\n * that map 1:1 to the wspace-ecoimpacthub-svc `eco*` backend) and mounts the\n * routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n LayoutDashboard,\n MapPin,\n Gauge,\n PawPrint,\n Binoculars,\n Trees,\n Factory,\n Recycle,\n BookOpen,\n Sun,\n FileCheck2,\n FileText,\n HandCoins,\n} from 'lucide-react';\nimport { EcoImpactHubProvider } from './context/EcoImpactHubContext';\nimport { EcoImpactHubRoutes } from './EcoImpactHubRoutes';\nimport { joinPath } from './utils/navigation';\nimport type { EcoImpactHubRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nexport const EcoImpactHubRoot: FC<EcoImpactHubRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Register navigation items with the shell on mount. Ids/paths/orders match\n // the app-shell static NavRegistration block so the two are a single,\n // consistent source of truth.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'ecoimpacthub-dashboard',\n label: t('ecoimpacthub.nav.dashboard', 'Dashboard'),\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-sites',\n label: t('ecoimpacthub.nav.sites', 'Sites'),\n path: joinPath(basePath, 'sites'),\n icon: <MapPin size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-monitoring',\n label: t('ecoimpacthub.nav.monitoring', 'Monitoring'),\n path: joinPath(basePath, 'monitoring'),\n icon: <Gauge size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-species',\n label: t('ecoimpacthub.nav.species', 'Species'),\n path: joinPath(basePath, 'species'),\n icon: <PawPrint size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-observations',\n label: t('ecoimpacthub.nav.observations', 'Observations'),\n path: joinPath(basePath, 'observations'),\n icon: <Binoculars size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-habitat',\n label: t('ecoimpacthub.nav.habitat', 'Habitat'),\n path: joinPath(basePath, 'habitat'),\n icon: <Trees size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-carbon',\n label: t('ecoimpacthub.nav.carbon', 'Carbon'),\n path: joinPath(basePath, 'carbon'),\n icon: <Factory size={20} />,\n order: 6,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-circularity',\n label: t('ecoimpacthub.nav.circularity', 'Waste & Circularity'),\n path: joinPath(basePath, 'circularity'),\n icon: <Recycle size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-metrics',\n label: t('ecoimpacthub.nav.metrics', 'Metrics'),\n path: joinPath(basePath, 'metrics'),\n icon: <BookOpen size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-energy',\n label: t('ecoimpacthub.nav.energy', 'Energy'),\n path: joinPath(basePath, 'energy'),\n icon: <Sun size={20} />,\n order: 8,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-reports',\n label: t('ecoimpacthub.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileText size={20} />,\n order: 9,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-compliance',\n label: t('ecoimpacthub.nav.compliance', 'Compliance'),\n path: joinPath(basePath, 'compliance'),\n icon: <FileCheck2 size={20} />,\n order: 9,\n group: 'products',\n },\n {\n id: 'ecoimpacthub-grants',\n label: t('ecoimpacthub.nav.grants', 'Grants'),\n path: joinPath(basePath, 'grants'),\n icon: <HandCoins size={20} />,\n order: 8,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'ecoimpacthub-status',\n label: t('ecoimpacthub.footer.ready', 'EcoImpactHub Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <EcoImpactHubProvider {...props}>\n <EcoImpactHubRoutes />\n </EcoImpactHubProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAkCA,IAAMA,IAAc,IAAIC,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW;CACX,OAAO;CACP,sBAAsB;AACxB,EACF,EACF,CAAC,GAEYC,KAA+C,MAAU;CACpE,IAAM,EAAE,qBAAkB,w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EACd,IAAKkB,GACL,OAAOA,EAAoB,CACzB;GACE,IAAI;GACJ,OAAOvB,EAAE,6BAA6B,oBAAoB;GAC1D,MAAM;GACN,SAAS;GACT,OAAO;EACT,CACF,CAAC;CACH,GAAG,CAACuB,GAAqBvB,CAAC,CAAC,GAGzB,kBAACwB,GAAD;EAAqB,QAAQ9B;EAC3B,UAAA,kBAAC+B,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;GACvE,UAAA,kBAACC,GAAD;IAAsB,GAAI7B;IACxB,UAAA,kBAAC8B,GAAD,CAAqB,CAAA;GACD,CAAA;EACH,CAAA;CACF,CAAA;AAEzB"}
@@ -7,117 +7,125 @@ import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-
7
7
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  import { Spinner as p } from "@burdenoff/fe-libs/ui";
9
9
  // src/ecoimpacthub/EcoImpactHubRoutes.tsx
10
- var m = a(() => import("./pages/sites/SitesPage.js").then((e) => ({ default: e.SitesPage }))), h = a(() => import("./pages/sites/SiteDetailPage.js").then((e) => ({ default: e.SiteDetailPage }))), g = a(() => import("./pages/monitoring/MonitoringPage.js").then((e) => ({ default: e.MonitoringPage }))), _ = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), v = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), y = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), b = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), x = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), S = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), C = a(() => import("./pages/energy/EnergyPage.js").then((e) => ({ default: e.EnergyPage }))), w = a(() => import("./pages/circularity/CircularityPage.js").then((e) => ({ default: e.CircularityPage }))), T = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), E = a(() => import("./pages/reports/ReportDetailPage.js").then((e) => ({ default: e.ReportDetailPage }))), D = a(() => import("./pages/metrics/MetricsPage.js").then((e) => ({ default: e.MetricsPage }))), O = a(() => import("./pages/grants/GrantsPage.js").then((e) => ({ default: e.GrantsPage }))), k = a(() => import("./pages/grants/GrantDetailPage.js").then((e) => ({ default: e.GrantDetailPage }))), A = a(() => import("./pages/grants/DonorPortalPage.js").then((e) => ({ default: e.DonorPortalPage }))), j = a(() => import("./pages/mobile/MobileDashboardPage.js").then((e) => ({ default: e.MobileDashboardPage }))), M = a(() => import("./pages/mobile/MobileRecordObservationPage.js").then((e) => ({ default: e.MobileRecordObservationPage }))), N = () => (n(), null), P = "ecoimpacthub.field.nativeHomeShown";
11
- function F() {
10
+ var m = a(() => import("./pages/sites/SitesPage.js").then((e) => ({ default: e.SitesPage }))), h = a(() => import("./pages/sites/SiteDetailPage.js").then((e) => ({ default: e.SiteDetailPage }))), g = a(() => import("./pages/monitoring/MonitoringPage.js").then((e) => ({ default: e.MonitoringPage }))), _ = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), v = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), y = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), b = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), x = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), S = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), C = a(() => import("./pages/energy/EnergyPage.js").then((e) => ({ default: e.EnergyPage }))), w = a(() => import("./pages/circularity/CircularityPage.js").then((e) => ({ default: e.CircularityPage }))), T = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), E = a(() => import("./pages/compliance/CompliancePage.js").then((e) => ({ default: e.CompliancePage }))), D = a(() => import("./pages/reports/ReportDetailPage.js").then((e) => ({ default: e.ReportDetailPage }))), O = a(() => import("./pages/metrics/MetricsPage.js").then((e) => ({ default: e.MetricsPage }))), k = a(() => import("./pages/grants/GrantsPage.js").then((e) => ({ default: e.GrantsPage }))), A = a(() => import("./pages/grants/GrantDetailPage.js").then((e) => ({ default: e.GrantDetailPage }))), j = a(() => import("./pages/grants/DonorPortalPage.js").then((e) => ({ default: e.DonorPortalPage }))), M = a(() => import("./pages/credits/CreditsPage.js").then((e) => ({ default: e.CreditsPage }))), N = a(() => import("./pages/mobile/MobileDashboardPage.js").then((e) => ({ default: e.MobileDashboardPage }))), P = a(() => import("./pages/mobile/MobileRecordObservationPage.js").then((e) => ({ default: e.MobileRecordObservationPage }))), F = () => (n(), null), I = "ecoimpacthub.field.nativeHomeShown";
11
+ function L() {
12
12
  if (!globalThis.Capacitor?.isNativePlatform?.()) return !1;
13
13
  try {
14
- if (sessionStorage.getItem(P)) return !1;
15
- sessionStorage.setItem(P, "1");
14
+ if (sessionStorage.getItem(I)) return !1;
15
+ sessionStorage.setItem(I, "1");
16
16
  } catch {}
17
17
  return !0;
18
18
  }
19
- var I = () => {
20
- let [e] = o(F);
19
+ var R = () => {
20
+ let [e] = o(L);
21
21
  return e ? /* @__PURE__ */ d(s, {
22
22
  to: "mobile",
23
23
  replace: !0
24
24
  }) : /* @__PURE__ */ d(r, {});
25
- }, L = () => /* @__PURE__ */ d("div", {
25
+ }, z = () => /* @__PURE__ */ d("div", {
26
26
  className: "flex min-h-[400px] items-center justify-center",
27
27
  children: /* @__PURE__ */ d(p, { size: "lg" })
28
28
  });
29
- function R(e, n) {
29
+ function B(e, n) {
30
30
  return /* @__PURE__ */ d(t, {
31
31
  flag: e,
32
32
  children: n
33
33
  });
34
34
  }
35
- var z = () => {
35
+ var V = () => {
36
36
  let { basePath: t, isStandalone: n } = e(), r = u(), a = t === "/" ? "" : (t ?? "").replace(/\/$/, "");
37
37
  return a && !n && !(r.pathname === a || r.pathname.startsWith(a + "/")) ? null : /* @__PURE__ */ f("div", {
38
38
  className: "flex min-h-full flex-col",
39
- children: [/* @__PURE__ */ d(N, {}), /* @__PURE__ */ d(i, {
40
- fallback: /* @__PURE__ */ d(L, {}),
39
+ children: [/* @__PURE__ */ d(F, {}), /* @__PURE__ */ d(i, {
40
+ fallback: /* @__PURE__ */ d(z, {}),
41
41
  children: /* @__PURE__ */ f(l, { children: [
42
42
  /* @__PURE__ */ d(c, {
43
43
  index: !0,
44
- element: R("ecoimpacthub.page.dashboard", /* @__PURE__ */ d(I, {}))
44
+ element: B("ecoimpacthub.page.dashboard", /* @__PURE__ */ d(R, {}))
45
45
  }),
46
46
  /* @__PURE__ */ d(c, {
47
47
  path: "sites",
48
- element: R("ecoimpacthub.page.sites", /* @__PURE__ */ d(m, {}))
48
+ element: B("ecoimpacthub.page.sites", /* @__PURE__ */ d(m, {}))
49
49
  }),
50
50
  /* @__PURE__ */ d(c, {
51
51
  path: "sites/:id",
52
- element: R("ecoimpacthub.page.sites", /* @__PURE__ */ d(h, {}))
52
+ element: B("ecoimpacthub.page.sites", /* @__PURE__ */ d(h, {}))
53
53
  }),
54
54
  /* @__PURE__ */ d(c, {
55
55
  path: "monitoring",
56
- element: R("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(g, {}))
56
+ element: B("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(g, {}))
57
57
  }),
58
58
  /* @__PURE__ */ d(c, {
59
59
  path: "species",
60
- element: R("ecoimpacthub.page.species", /* @__PURE__ */ d(_, {}))
60
+ element: B("ecoimpacthub.page.species", /* @__PURE__ */ d(_, {}))
61
61
  }),
62
62
  /* @__PURE__ */ d(c, {
63
63
  path: "species/:id",
64
- element: R("ecoimpacthub.page.species", /* @__PURE__ */ d(v, {}))
64
+ element: B("ecoimpacthub.page.species", /* @__PURE__ */ d(v, {}))
65
65
  }),
66
66
  /* @__PURE__ */ d(c, {
67
67
  path: "observations",
68
- element: R("ecoimpacthub.page.observations", /* @__PURE__ */ d(y, {}))
68
+ element: B("ecoimpacthub.page.observations", /* @__PURE__ */ d(y, {}))
69
69
  }),
70
70
  /* @__PURE__ */ d(c, {
71
71
  path: "habitat",
72
- element: R("ecoimpacthub.page.habitat", /* @__PURE__ */ d(b, {}))
72
+ element: B("ecoimpacthub.page.habitat", /* @__PURE__ */ d(b, {}))
73
73
  }),
74
74
  /* @__PURE__ */ d(c, {
75
75
  path: "habitat/:id",
76
- element: R("ecoimpacthub.page.habitat", /* @__PURE__ */ d(x, {}))
76
+ element: B("ecoimpacthub.page.habitat", /* @__PURE__ */ d(x, {}))
77
77
  }),
78
78
  /* @__PURE__ */ d(c, {
79
79
  path: "carbon",
80
- element: R("ecoimpacthub.page.carbon", /* @__PURE__ */ d(S, {}))
80
+ element: B("ecoimpacthub.page.carbon", /* @__PURE__ */ d(S, {}))
81
+ }),
82
+ /* @__PURE__ */ d(c, {
83
+ path: "credits",
84
+ element: B("ecoimpacthub.page.credits", /* @__PURE__ */ d(M, {}))
81
85
  }),
82
86
  /* @__PURE__ */ d(c, {
83
87
  path: "circularity",
84
- element: R("ecoimpacthub.page.circularity", /* @__PURE__ */ d(w, {}))
88
+ element: B("ecoimpacthub.page.circularity", /* @__PURE__ */ d(w, {}))
85
89
  }),
86
90
  /* @__PURE__ */ d(c, {
87
91
  path: "metrics",
88
- element: R("ecoimpacthub.page.metrics", /* @__PURE__ */ d(D, {}))
92
+ element: B("ecoimpacthub.page.metrics", /* @__PURE__ */ d(O, {}))
89
93
  }),
90
94
  /* @__PURE__ */ d(c, {
91
95
  path: "energy",
92
- element: R("ecoimpacthub.page.energy", /* @__PURE__ */ d(C, {}))
96
+ element: B("ecoimpacthub.page.energy", /* @__PURE__ */ d(C, {}))
93
97
  }),
94
98
  /* @__PURE__ */ d(c, {
95
99
  path: "reports",
96
- element: R("ecoimpacthub.page.reports", /* @__PURE__ */ d(T, {}))
100
+ element: B("ecoimpacthub.page.reports", /* @__PURE__ */ d(T, {}))
101
+ }),
102
+ /* @__PURE__ */ d(c, {
103
+ path: "compliance",
104
+ element: B("ecoimpacthub.page.compliance", /* @__PURE__ */ d(E, {}))
97
105
  }),
98
106
  /* @__PURE__ */ d(c, {
99
107
  path: "reports/:id",
100
- element: R("ecoimpacthub.page.reports", /* @__PURE__ */ d(E, {}))
108
+ element: B("ecoimpacthub.page.reports", /* @__PURE__ */ d(D, {}))
101
109
  }),
102
110
  /* @__PURE__ */ d(c, {
103
111
  path: "grants/portal",
104
- element: /* @__PURE__ */ d(A, {})
112
+ element: /* @__PURE__ */ d(j, {})
105
113
  }),
106
114
  /* @__PURE__ */ d(c, {
107
115
  path: "grants",
108
- element: R("ecoimpacthub.page.grants", /* @__PURE__ */ d(O, {}))
116
+ element: B("ecoimpacthub.page.grants", /* @__PURE__ */ d(k, {}))
109
117
  }),
110
118
  /* @__PURE__ */ d(c, {
111
119
  path: "grants/:id",
112
- element: R("ecoimpacthub.page.grants", /* @__PURE__ */ d(k, {}))
120
+ element: B("ecoimpacthub.page.grants", /* @__PURE__ */ d(A, {}))
113
121
  }),
114
122
  /* @__PURE__ */ d(c, {
115
123
  path: "mobile",
116
- element: R("ecoimpacthub.page.mobile", /* @__PURE__ */ d(j, {}))
124
+ element: B("ecoimpacthub.page.mobile", /* @__PURE__ */ d(N, {}))
117
125
  }),
118
126
  /* @__PURE__ */ d(c, {
119
127
  path: "mobile/record-observation",
120
- element: R("ecoimpacthub.page.observations", /* @__PURE__ */ d(M, {}))
128
+ element: B("ecoimpacthub.page.observations", /* @__PURE__ */ d(P, {}))
121
129
  }),
122
130
  /* @__PURE__ */ d(c, {
123
131
  path: "*",
@@ -130,6 +138,6 @@ var z = () => {
130
138
  })]
131
139
  });
132
140
  };
133
- export { z as EcoImpactHubRoutes };
141
+ export { V as EcoImpactHubRoutes };
134
142
 
135
143
  //# sourceMappingURL=EcoImpactHubRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EcoImpactHubRoutes.js","names":["SitesPage","lazy","m","SiteDetailPage","MonitoringPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","HabitatProjectDetailPage","CarbonPage","EnergyPage","CircularityPage","ReportsPage","ReportDetailPage","MetricsPage","GrantsPage","GrantDetailPage","DonorPortalPage","MobileDashboardPage","MobileRecordObservationPage","FieldSyncBridge","useFieldSyncBridge","NATIVE_HOME_KEY","shouldOpenNativeHome","DashboardIndex","openNativeHome","useState","Navigate","DashboardPage","PageLoader","Spinner","gated","FeatureFlagGate","element","EcoImpactHubRoutes","useEcoImpactHub","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoutes.tsx"],"sourcesContent":["/**\n * EcoImpactHub Routes\n * @module ecoimpacthub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `eco*` backend capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactNode, useState } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useEcoImpactHub } from './context/EcoImpactHubContext';\nimport { FeatureFlagGate } from './components/FeatureFlagGate';\nimport { useFieldSyncBridge } from './field/useFieldQueue';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/DashboardPage';\n\n// Sites (Environmental Monitoring)\nconst SitesPage = lazy(() =>\n import('./pages/sites/SitesPage').then((m) => ({ default: m.SitesPage }))\n);\nconst SiteDetailPage = lazy(() =>\n import('./pages/sites/SiteDetailPage').then((m) => ({ default: m.SiteDetailPage }))\n);\n\n// Monitoring (sensors / measurements / thresholds)\nconst MonitoringPage = lazy(() =>\n import('./pages/monitoring/MonitoringPage').then((m) => ({ default: m.MonitoringPage }))\n);\n\n// Species (Conservation)\nconst SpeciesPage = lazy(() =>\n import('./pages/species/SpeciesPage').then((m) => ({ default: m.SpeciesPage }))\n);\nconst SpeciesDetailPage = lazy(() =>\n import('./pages/species/SpeciesDetailPage').then((m) => ({ default: m.SpeciesDetailPage }))\n);\n\n// Observations (citizen science / field data)\nconst ObservationsPage = lazy(() =>\n import('./pages/observations/ObservationsPage').then((m) => ({ default: m.ObservationsPage }))\n);\n\n// Habitat projects & restoration\nconst HabitatProjectsPage = lazy(() =>\n import('./pages/habitat/HabitatProjectsPage').then((m) => ({ default: m.HabitatProjectsPage }))\n);\nconst HabitatProjectDetailPage = lazy(() =>\n import('./pages/habitat/HabitatProjectDetailPage').then((m) => ({\n default: m.HabitatProjectDetailPage,\n }))\n);\n\n// Carbon ledger / emission factors / reduction targets (Sustainability)\nconst CarbonPage = lazy(() =>\n import('./pages/carbon/CarbonPage').then((m) => ({ default: m.CarbonPage }))\n);\n\n// Renewable energy tracking — generation assets, meter readings, energy mix (BOFF-5829)\nconst EnergyPage = lazy(() =>\n import('./pages/energy/EnergyPage').then((m) => ({ default: m.EnergyPage }))\n);\n\n// ESG Reports\n// Waste & circularity — waste streams, diversion tracking, material loops (BOFF-5830)\nconst CircularityPage = lazy(() =>\n import('./pages/circularity/CircularityPage').then((m) => ({ default: m.CircularityPage }))\n);\n\nconst ReportsPage = lazy(() =>\n import('./pages/reports/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst ReportDetailPage = lazy(() =>\n import('./pages/reports/ReportDetailPage').then((m) => ({ default: m.ReportDetailPage }))\n);\n\n// Environmental metrics library (cross-product rollups)\nconst MetricsPage = lazy(() =>\n import('./pages/metrics/MetricsPage').then((m) => ({ default: m.MetricsPage }))\n);\n\n// Grants & donor portal (BOFF-5828)\nconst GrantsPage = lazy(() =>\n import('./pages/grants/GrantsPage').then((m) => ({ default: m.GrantsPage }))\n);\nconst GrantDetailPage = lazy(() =>\n import('./pages/grants/GrantDetailPage').then((m) => ({ default: m.GrantDetailPage }))\n);\nconst DonorPortalPage = lazy(() =>\n import('./pages/grants/DonorPortalPage').then((m) => ({ default: m.DonorPortalPage }))\n);\n\n// Mobile field app (Capacitor iOS/Android home + offline field capture)\nconst MobileDashboardPage = lazy(() =>\n import('./pages/mobile/MobileDashboardPage').then((m) => ({ default: m.MobileDashboardPage }))\n);\nconst MobileRecordObservationPage = lazy(() =>\n import('./pages/mobile/MobileRecordObservationPage').then((m) => ({\n default: m.MobileRecordObservationPage,\n }))\n);\n\n/**\n * Drains the offline field-observation queue for the active workspace while\n * the MFE is mounted, whichever page is showing (see `field/fieldSync.ts`).\n */\nconst FieldSyncBridge: FC = () => {\n useFieldSyncBridge();\n return null;\n};\n\nconst NATIVE_HOME_KEY = 'ecoimpacthub.field.nativeHomeShown';\n\n/**\n * Inside the installed iOS/Android app the first screen of each launch is the\n * field app's mobile dashboard; after that the regular dashboard stays one tap\n * away (sidebar \"Dashboard\"). Capacitor injects `window.Capacitor`, so the MFE\n * needs no Capacitor dependency to detect it.\n */\nfunction shouldOpenNativeHome(): boolean {\n const cap = (globalThis as { Capacitor?: { isNativePlatform?: () => boolean } }).Capacitor;\n if (!cap?.isNativePlatform?.()) return false;\n try {\n if (sessionStorage.getItem(NATIVE_HOME_KEY)) return false;\n sessionStorage.setItem(NATIVE_HOME_KEY, '1');\n } catch {\n // Storage unavailable: still open the field home this time.\n }\n return true;\n}\n\nconst DashboardIndex: FC = () => {\n const [openNativeHome] = useState(shouldOpenNativeHome);\n if (openNativeHome) return <Navigate to=\"mobile\" replace />;\n return <DashboardPage />;\n};\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nfunction gated(flag: string, element: ReactNode): ReactNode {\n return <FeatureFlagGate flag={flag}>{element}</FeatureFlagGate>;\n}\n\nexport const EcoImpactHubRoutes: FC = () => {\n const { basePath, isStandalone } = useEcoImpactHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <FieldSyncBridge />\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated('ecoimpacthub.page.dashboard', <DashboardIndex />)} />\n\n <Route path=\"sites\" element={gated('ecoimpacthub.page.sites', <SitesPage />)} />\n <Route path=\"sites/:id\" element={gated('ecoimpacthub.page.sites', <SiteDetailPage />)} />\n\n <Route\n path=\"monitoring\"\n element={gated('ecoimpacthub.page.monitoring', <MonitoringPage />)}\n />\n\n <Route path=\"species\" element={gated('ecoimpacthub.page.species', <SpeciesPage />)} />\n <Route\n path=\"species/:id\"\n element={gated('ecoimpacthub.page.species', <SpeciesDetailPage />)}\n />\n\n <Route\n path=\"observations\"\n element={gated('ecoimpacthub.page.observations', <ObservationsPage />)}\n />\n\n <Route\n path=\"habitat\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectsPage />)}\n />\n <Route\n path=\"habitat/:id\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectDetailPage />)}\n />\n\n <Route path=\"carbon\" element={gated('ecoimpacthub.page.carbon', <CarbonPage />)} />\n\n <Route\n path=\"circularity\"\n element={gated('ecoimpacthub.page.circularity', <CircularityPage />)}\n />\n\n <Route path=\"metrics\" element={gated('ecoimpacthub.page.metrics', <MetricsPage />)} />\n\n <Route path=\"energy\" element={gated('ecoimpacthub.page.energy', <EnergyPage />)} />\n\n <Route path=\"reports\" element={gated('ecoimpacthub.page.reports', <ReportsPage />)} />\n <Route\n path=\"reports/:id\"\n element={gated('ecoimpacthub.page.reports', <ReportDetailPage />)}\n />\n\n {/* Donor portal is a public, session-free view — not feature-flag gated,\n the link secret is the authorization (BOFF-5828). */}\n <Route path=\"grants/portal\" element={<DonorPortalPage />} />\n\n <Route path=\"grants\" element={gated('ecoimpacthub.page.grants', <GrantsPage />)} />\n <Route\n path=\"grants/:id\"\n element={gated('ecoimpacthub.page.grants', <GrantDetailPage />)}\n />\n\n <Route\n path=\"mobile\"\n element={gated('ecoimpacthub.page.mobile', <MobileDashboardPage />)}\n />\n <Route\n path=\"mobile/record-observation\"\n element={gated('ecoimpacthub.page.observations', <MobileRecordObservationPage />)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAMA,IAAYC,QAChB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,UAAU,EAAE,CAC1E,GACMC,IAAiBF,QACrB,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACpF,GAGME,IAAiBH,QACrB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACzF,GAGMG,IAAcJ,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,YAAY,EAAE,CAChF,GACMI,IAAoBL,QACxB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,kBAAkB,EAAE,CAC5F,GAGMK,IAAmBN,QACvB,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC/F,GAGMM,IAAsBP,QAC1B,OAAO,yCAAsC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,oBAAoB,EAAE,CAChG,GACMO,IAA2BR,QAC/B,OAAO,8CAA2C,CAAC,MAAM,OAAO,EAC9D,SAASC,EAAE,yBACb,EAAE,CACJ,GAGMQ,IAAaT,QACjB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,WAAW,EAAE,CAC7E,GAGMS,IAAaV,QACjB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,WAAW,EAAE,CAC7E,GAIMU,IAAkBX,QAC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IAC/D,CAAA;IAED,kBAAC2B,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,4BAA4B,kBAACb,GAAD,CAAsB,CAAA,CAAC;IACnE,CAAA;IACD,kBAACyB,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,kCAAkC,kBAACZ,GAAD,CAA8B,CAAA,CAAC;IACjF,CAAA;IAED,kBAACwB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAChB,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,CACP;;AAET"}
1
+ {"version":3,"file":"EcoImpactHubRoutes.js","names":["SitesPage","lazy","m","SiteDetailPage","MonitoringPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","HabitatProjectDetailPage","CarbonPage","EnergyPage","CircularityPage","ReportsPage","CompliancePage","ReportDetailPage","MetricsPage","GrantsPage","GrantDetailPage","DonorPortalPage","CreditsPage","MobileDashboardPage","MobileRecordObservationPage","FieldSyncBridge","useFieldSyncBridge","NATIVE_HOME_KEY","shouldOpenNativeHome","DashboardIndex","openNativeHome","useState","Navigate","DashboardPage","PageLoader","Spinner","gated","FeatureFlagGate","element","EcoImpactHubRoutes","useEcoImpactHub","location","useLocation","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route"],"sources":["../../src/ecoimpacthub/EcoImpactHubRoutes.tsx"],"sourcesContent":["/**\n * EcoImpactHub Routes\n * @module ecoimpacthub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `eco*` backend capability.\n */\n\nimport { type FC, lazy, Suspense, type ReactNode, useState } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useEcoImpactHub } from './context/EcoImpactHubContext';\nimport { FeatureFlagGate } from './components/FeatureFlagGate';\nimport { useFieldSyncBridge } from './field/useFieldQueue';\n\n// Eager — primary landing\nimport { DashboardPage } from './pages/DashboardPage';\n\n// Sites (Environmental Monitoring)\nconst SitesPage = lazy(() =>\n import('./pages/sites/SitesPage').then((m) => ({ default: m.SitesPage }))\n);\nconst SiteDetailPage = lazy(() =>\n import('./pages/sites/SiteDetailPage').then((m) => ({ default: m.SiteDetailPage }))\n);\n\n// Monitoring (sensors / measurements / thresholds)\nconst MonitoringPage = lazy(() =>\n import('./pages/monitoring/MonitoringPage').then((m) => ({ default: m.MonitoringPage }))\n);\n\n// Species (Conservation)\nconst SpeciesPage = lazy(() =>\n import('./pages/species/SpeciesPage').then((m) => ({ default: m.SpeciesPage }))\n);\nconst SpeciesDetailPage = lazy(() =>\n import('./pages/species/SpeciesDetailPage').then((m) => ({ default: m.SpeciesDetailPage }))\n);\n\n// Observations (citizen science / field data)\nconst ObservationsPage = lazy(() =>\n import('./pages/observations/ObservationsPage').then((m) => ({ default: m.ObservationsPage }))\n);\n\n// Habitat projects & restoration\nconst HabitatProjectsPage = lazy(() =>\n import('./pages/habitat/HabitatProjectsPage').then((m) => ({ default: m.HabitatProjectsPage }))\n);\nconst HabitatProjectDetailPage = lazy(() =>\n import('./pages/habitat/HabitatProjectDetailPage').then((m) => ({\n default: m.HabitatProjectDetailPage,\n }))\n);\n\n// Carbon ledger / emission factors / reduction targets (Sustainability)\nconst CarbonPage = lazy(() =>\n import('./pages/carbon/CarbonPage').then((m) => ({ default: m.CarbonPage }))\n);\n\n// Renewable energy tracking — generation assets, meter readings, energy mix (BOFF-5829)\nconst EnergyPage = lazy(() =>\n import('./pages/energy/EnergyPage').then((m) => ({ default: m.EnergyPage }))\n);\n\n// ESG Reports\n// Waste & circularity — waste streams, diversion tracking, material loops (BOFF-5830)\nconst CircularityPage = lazy(() =>\n import('./pages/circularity/CircularityPage').then((m) => ({ default: m.CircularityPage }))\n);\n\nconst ReportsPage = lazy(() =>\n import('./pages/reports/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\n\n// Compliance — obligations register, permits, deadline calendar (BOFF-5827)\nconst CompliancePage = lazy(() =>\n import('./pages/compliance/CompliancePage').then((m) => ({ default: m.CompliancePage }))\n);\nconst ReportDetailPage = lazy(() =>\n import('./pages/reports/ReportDetailPage').then((m) => ({ default: m.ReportDetailPage }))\n);\n\n// Environmental metrics library (cross-product rollups)\nconst MetricsPage = lazy(() =>\n import('./pages/metrics/MetricsPage').then((m) => ({ default: m.MetricsPage }))\n);\n\n// Grants & donor portal (BOFF-5828)\nconst GrantsPage = lazy(() =>\n import('./pages/grants/GrantsPage').then((m) => ({ default: m.GrantsPage }))\n);\nconst GrantDetailPage = lazy(() =>\n import('./pages/grants/GrantDetailPage').then((m) => ({ default: m.GrantDetailPage }))\n);\nconst DonorPortalPage = lazy(() =>\n import('./pages/grants/DonorPortalPage').then((m) => ({ default: m.DonorPortalPage }))\n);\n\n// Carbon credit registry (BOFF-5824): portfolio, vintages, methodologies, retirement ledger\nconst CreditsPage = lazy(() =>\n import('./pages/credits/CreditsPage').then((m) => ({ default: m.CreditsPage }))\n);\n\n// Mobile field app (Capacitor iOS/Android home + offline field capture)\nconst MobileDashboardPage = lazy(() =>\n import('./pages/mobile/MobileDashboardPage').then((m) => ({ default: m.MobileDashboardPage }))\n);\nconst MobileRecordObservationPage = lazy(() =>\n import('./pages/mobile/MobileRecordObservationPage').then((m) => ({\n default: m.MobileRecordObservationPage,\n }))\n);\n\n/**\n * Drains the offline field-observation queue for the active workspace while\n * the MFE is mounted, whichever page is showing (see `field/fieldSync.ts`).\n */\nconst FieldSyncBridge: FC = () => {\n useFieldSyncBridge();\n return null;\n};\n\nconst NATIVE_HOME_KEY = 'ecoimpacthub.field.nativeHomeShown';\n\n/**\n * Inside the installed iOS/Android app the first screen of each launch is the\n * field app's mobile dashboard; after that the regular dashboard stays one tap\n * away (sidebar \"Dashboard\"). Capacitor injects `window.Capacitor`, so the MFE\n * needs no Capacitor dependency to detect it.\n */\nfunction shouldOpenNativeHome(): boolean {\n const cap = (globalThis as { Capacitor?: { isNativePlatform?: () => boolean } }).Capacitor;\n if (!cap?.isNativePlatform?.()) return false;\n try {\n if (sessionStorage.getItem(NATIVE_HOME_KEY)) return false;\n sessionStorage.setItem(NATIVE_HOME_KEY, '1');\n } catch {\n // Storage unavailable: still open the field home this time.\n }\n return true;\n}\n\nconst DashboardIndex: FC = () => {\n const [openNativeHome] = useState(shouldOpenNativeHome);\n if (openNativeHome) return <Navigate to=\"mobile\" replace />;\n return <DashboardPage />;\n};\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nfunction gated(flag: string, element: ReactNode): ReactNode {\n return <FeatureFlagGate flag={flag}>{element}</FeatureFlagGate>;\n}\n\nexport const EcoImpactHubRoutes: FC = () => {\n const { basePath, isStandalone } = useEcoImpactHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <FieldSyncBridge />\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={gated('ecoimpacthub.page.dashboard', <DashboardIndex />)} />\n\n <Route path=\"sites\" element={gated('ecoimpacthub.page.sites', <SitesPage />)} />\n <Route path=\"sites/:id\" element={gated('ecoimpacthub.page.sites', <SiteDetailPage />)} />\n\n <Route\n path=\"monitoring\"\n element={gated('ecoimpacthub.page.monitoring', <MonitoringPage />)}\n />\n\n <Route path=\"species\" element={gated('ecoimpacthub.page.species', <SpeciesPage />)} />\n <Route\n path=\"species/:id\"\n element={gated('ecoimpacthub.page.species', <SpeciesDetailPage />)}\n />\n\n <Route\n path=\"observations\"\n element={gated('ecoimpacthub.page.observations', <ObservationsPage />)}\n />\n\n <Route\n path=\"habitat\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectsPage />)}\n />\n <Route\n path=\"habitat/:id\"\n element={gated('ecoimpacthub.page.habitat', <HabitatProjectDetailPage />)}\n />\n\n <Route path=\"carbon\" element={gated('ecoimpacthub.page.carbon', <CarbonPage />)} />\n\n <Route path=\"credits\" element={gated('ecoimpacthub.page.credits', <CreditsPage />)} />\n\n <Route\n path=\"circularity\"\n element={gated('ecoimpacthub.page.circularity', <CircularityPage />)}\n />\n\n <Route path=\"metrics\" element={gated('ecoimpacthub.page.metrics', <MetricsPage />)} />\n\n <Route path=\"energy\" element={gated('ecoimpacthub.page.energy', <EnergyPage />)} />\n\n <Route path=\"reports\" element={gated('ecoimpacthub.page.reports', <ReportsPage />)} />\n <Route\n path=\"compliance\"\n element={gated('ecoimpacthub.page.compliance', <CompliancePage />)}\n />\n <Route\n path=\"reports/:id\"\n element={gated('ecoimpacthub.page.reports', <ReportDetailPage />)}\n />\n\n {/* Donor portal is a public, session-free view — not feature-flag gated,\n the link secret is the authorization (BOFF-5828). */}\n <Route path=\"grants/portal\" element={<DonorPortalPage />} />\n\n <Route path=\"grants\" element={gated('ecoimpacthub.page.grants', <GrantsPage />)} />\n <Route\n path=\"grants/:id\"\n element={gated('ecoimpacthub.page.grants', <GrantDetailPage />)}\n />\n\n <Route\n path=\"mobile\"\n element={gated('ecoimpacthub.page.mobile', <MobileDashboardPage />)}\n />\n <Route\n path=\"mobile/record-observation\"\n element={gated('ecoimpacthub.page.observations', <MobileRecordObservationPage />)}\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAMA,IAAYC,QAChB,OAAO,6BAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,UAAU,EAAE,CAC1E,GACMC,IAAiBF,QACrB,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACpF,GAGME,IAAiBH,QAC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IACnE,CAAA;IACD,kBAACyB,GAAD;KACE,MAAK;KACL,SAASZ,EAAM,kCAAkC,kBAACZ,GAAD,CAA8B,CAAA,CAAC;IACjF,CAAA;IAED,kBAACwB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAChB,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,CACP;;AAET"}
@@ -58,6 +58,15 @@ var i = {
58
58
  PROPOSED: "secondary",
59
59
  ACHIEVED: "success",
60
60
  MISSED: "destructive",
61
+ FULFILLED: "success",
62
+ OVERDUE: "destructive",
63
+ WAIVED: "outline",
64
+ SUBMITTED: "info",
65
+ UNDER_REVIEW: "warning",
66
+ APPROVED: "success",
67
+ REJECTED: "destructive",
68
+ SUSPENDED: "warning",
69
+ EXPIRED: "outline",
61
70
  SCOPE_1: "destructive",
62
71
  SCOPE_2: "warning",
63
72
  SCOPE_3: "info",
@@ -87,7 +96,13 @@ var i = {
87
96
  CSRD: "outline",
88
97
  ISSB: "outline",
89
98
  EU_TAXONOMY: "outline",
90
- CUSTOM: "secondary"
99
+ CUSTOM: "secondary",
100
+ OPEN: "info",
101
+ PARTIALLY_ISSUED: "warning",
102
+ FULLY_ISSUED: "success",
103
+ CLOSED: "outline",
104
+ ISSUED: "success",
105
+ PARTIALLY_RETIRED: "warning"
91
106
  }, s = ({ status: s, className: c }) => {
92
107
  let l = s.toUpperCase(), u = o[l] ?? "secondary", d = a.has(l);
93
108
  return /* @__PURE__ */ r("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","names":["variantStyles","liveStatuses","statusVariantMap","StatusBadge","key","status","variant","isLive","cn","className","formatEnumLabel"],"sources":["../../../src/ecoimpacthub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module ecoimpacthub/components\n *\n * A colored badge for EcoImpactHub domain statuses (site status, sensor status,\n * threshold severity, conservation status, habitat-project lifecycle, carbon\n * entry status, reduction-target status, report status/framework, emission\n * scope) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['IN_PROGRESS', 'ONLINE', 'ACTIVE']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Site status\n ACTIVE: 'success',\n MONITORING_PAUSED: 'warning',\n ARCHIVED: 'outline',\n\n // Sensor status\n ONLINE: 'success',\n OFFLINE: 'destructive',\n DEGRADED: 'warning',\n MAINTENANCE: 'info',\n RETIRED: 'outline',\n\n // Threshold severity / generic severity\n INFO: 'secondary',\n WARNING: 'warning',\n CRITICAL: 'destructive',\n\n // Threshold direction\n ABOVE: 'warning',\n BELOW: 'info',\n OUTSIDE_RANGE: 'warning',\n\n // Measurement / breach\n BREACH: 'destructive',\n OK: 'success',\n\n // AI alert triage classification + anomaly kinds\n REAL_EVENT: 'destructive',\n SENSOR_FAULT: 'warning',\n INSUFFICIENT_DATA: 'secondary',\n SPIKE: 'warning',\n DROP: 'info',\n FLATLINE: 'secondary',\n\n // Conservation status (IUCN-style)\n LEAST_CONCERN: 'success',\n NEAR_THREATENED: 'info',\n VULNERABLE: 'warning',\n ENDANGERED: 'destructive',\n CRITICALLY_ENDANGERED: 'destructive',\n EXTINCT_IN_WILD: 'outline',\n DATA_DEFICIENT: 'secondary',\n NOT_EVALUATED: 'secondary',\n\n // Habitat-project lifecycle\n PLANNED: 'secondary',\n MONITORING: 'info',\n COMPLETED: 'success',\n ON_HOLD: 'warning',\n CANCELLED: 'destructive',\n\n // Carbon-entry status\n DRAFT: 'secondary',\n RECORDED: 'info',\n VERIFIED: 'success',\n ADJUSTED: 'warning',\n\n // Report status\n IN_REVIEW: 'warning',\n PUBLISHED: 'success',\n\n // Reduction-target status\n PROPOSED: 'secondary',\n ACHIEVED: 'success',\n MISSED: 'destructive',\n\n // Emission scope\n SCOPE_1: 'destructive',\n SCOPE_2: 'warning',\n SCOPE_3: 'info',\n\n // Waste categories (BOFF-5830) — informational, neutral badges\n GENERAL: 'secondary',\n RECYCLABLES: 'info',\n ORGANIC: 'success',\n HAZARDOUS: 'destructive',\n ELECTRONIC: 'info',\n CONSTRUCTION_DEMOLITION: 'warning',\n TEXTILES: 'info',\n PACKAGING: 'info',\n\n // Waste disposal routes (BOFF-5830): diverted routes read green/blue,\n // landfill reads red, OTHER stays neutral.\n LANDFILL: 'destructive',\n RECYCLED: 'success',\n COMPOSTED: 'success',\n RECOVERED: 'info',\n REUSED: 'success',\n OTHER: 'secondary',\n\n // Material-loop stages (BOFF-5830)\n INPUT: 'info',\n USE: 'secondary',\n RECOVERY: 'warning',\n REUSE: 'success',\n\n // Report frameworks (neutral badges)\n GHG_PROTOCOL: 'outline',\n GRI: 'outline',\n TCFD: 'outline',\n CDP: 'outline',\n SASB: 'outline',\n CSRD: 'outline',\n ISSB: 'outline',\n EU_TAXONOMY: 'outline',\n CUSTOM: 'secondary',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAIMC,oBAAe,IAAI,IAAI;CAAC;CAAe;CAAU;AAAQ,CAAC,GAE1DC,IAAiD;CAErD,QAAQ;CACR,mBAAmB;CACnB,UAAU;CAGV,QAAQ;CACR,SAAS;CACT,UAAU;CACV,aAAa;CACb,SAAS;CAGT,MAAM;CACN,SAAS;CACT,UAAU;CAGV,OAAO;CACP,OAAO;CACP,eAAe;CAGf,QAAQ;CACR,IAAI;CAGJ,YAAY;CACZ,cAAc;CACd,mBAAmB;CACnB,OAAO;CACP,MAAM;CACN,UAAU;CAGV,eAAe;CACf,iBAAiB;CACjB,YAAY;CACZ,YAAY;CACZ,uBAAuB;CACvB,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;CAGf,SAAS;CACT,YAAY;CACZ,WAAW;CACX,SAAS;CACT,WAAW;CAGX,OAAO;CACP,UAAU;CACV,UAAU;CACV,UAAU;CAGV,WAAW;CACX,WAAW;CAGX,UAAU;CACV,UAAU;CACV,QAAQ;CAGR,SAAS;CACT,SAAS;CACT,SAAS;CAGT,SAAS;CACT,aAAa;CACb,SAAS;CACT,WAAW;CACX,YAAY;CACZ,yBAAyB;CACzB,UAAU;CACV,WAAW;CAIX,UAAU;CACV,UAAU;CACV,WAAW;CACX,WAAW;CACX,QAAQ;CACR,OAAO;CAGP,OAAO;CACP,KAAK;CACL,UAAU;CACV,OAAO;CAGP,cAAc;CACd,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,MAAM;CACN,aAAa;CACb,QAAQ;AACV,GAEaC,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAMC,IAAMC,EAAO,YAAY,GACzBC,IAAUJ,EAAiBE,MAAQ,aACnCG,IAASN,EAAa,IAAIG,CAAG;CAEnC,OACE,kBAAC,QAAD;EACE,WAAWI,EACT,mFACAR,EAAcM,IACdG,CACF;EALF,UAAA,CAOGF,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA,GAEFG,EAAgBL,CAAM,CACnB;;AAEV"}
1
+ {"version":3,"file":"StatusBadge.js","names":["variantStyles","liveStatuses","statusVariantMap","StatusBadge","key","status","variant","isLive","cn","className","formatEnumLabel"],"sources":["../../../src/ecoimpacthub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module ecoimpacthub/components\n *\n * A colored badge for EcoImpactHub domain statuses (site status, sensor status,\n * threshold severity, conservation status, habitat-project lifecycle, carbon\n * entry status, reduction-target status, report status/framework, emission\n * scope) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['IN_PROGRESS', 'ONLINE', 'ACTIVE']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Site status\n ACTIVE: 'success',\n MONITORING_PAUSED: 'warning',\n ARCHIVED: 'outline',\n\n // Sensor status\n ONLINE: 'success',\n OFFLINE: 'destructive',\n DEGRADED: 'warning',\n MAINTENANCE: 'info',\n RETIRED: 'outline',\n\n // Threshold severity / generic severity\n INFO: 'secondary',\n WARNING: 'warning',\n CRITICAL: 'destructive',\n\n // Threshold direction\n ABOVE: 'warning',\n BELOW: 'info',\n OUTSIDE_RANGE: 'warning',\n\n // Measurement / breach\n BREACH: 'destructive',\n OK: 'success',\n\n // AI alert triage classification + anomaly kinds\n REAL_EVENT: 'destructive',\n SENSOR_FAULT: 'warning',\n INSUFFICIENT_DATA: 'secondary',\n SPIKE: 'warning',\n DROP: 'info',\n FLATLINE: 'secondary',\n\n // Conservation status (IUCN-style)\n LEAST_CONCERN: 'success',\n NEAR_THREATENED: 'info',\n VULNERABLE: 'warning',\n ENDANGERED: 'destructive',\n CRITICALLY_ENDANGERED: 'destructive',\n EXTINCT_IN_WILD: 'outline',\n DATA_DEFICIENT: 'secondary',\n NOT_EVALUATED: 'secondary',\n\n // Habitat-project lifecycle\n PLANNED: 'secondary',\n MONITORING: 'info',\n COMPLETED: 'success',\n ON_HOLD: 'warning',\n CANCELLED: 'destructive',\n\n // Carbon-entry status\n DRAFT: 'secondary',\n RECORDED: 'info',\n VERIFIED: 'success',\n ADJUSTED: 'warning',\n\n // Report status\n IN_REVIEW: 'warning',\n PUBLISHED: 'success',\n\n // Reduction-target status\n PROPOSED: 'secondary',\n ACHIEVED: 'success',\n MISSED: 'destructive',\n\n // Compliance — obligation lifecycle (BOFF-5827).\n // OPEN: 'info' is shared with the carbon-credit vintage lifecycle (BOFF-5824).\n FULFILLED: 'success',\n OVERDUE: 'destructive',\n WAIVED: 'outline',\n\n // Compliance — permit lifecycle\n SUBMITTED: 'info',\n UNDER_REVIEW: 'warning',\n APPROVED: 'success',\n REJECTED: 'destructive',\n SUSPENDED: 'warning',\n EXPIRED: 'outline',\n\n // Emission scope\n SCOPE_1: 'destructive',\n SCOPE_2: 'warning',\n SCOPE_3: 'info',\n\n // Waste categories (BOFF-5830) — informational, neutral badges\n GENERAL: 'secondary',\n RECYCLABLES: 'info',\n ORGANIC: 'success',\n HAZARDOUS: 'destructive',\n ELECTRONIC: 'info',\n CONSTRUCTION_DEMOLITION: 'warning',\n TEXTILES: 'info',\n PACKAGING: 'info',\n\n // Waste disposal routes (BOFF-5830): diverted routes read green/blue,\n // landfill reads red, OTHER stays neutral.\n LANDFILL: 'destructive',\n RECYCLED: 'success',\n COMPOSTED: 'success',\n RECOVERED: 'info',\n REUSED: 'success',\n OTHER: 'secondary',\n\n // Material-loop stages (BOFF-5830)\n INPUT: 'info',\n USE: 'secondary',\n RECOVERY: 'warning',\n REUSE: 'success',\n\n // Report frameworks (neutral badges)\n GHG_PROTOCOL: 'outline',\n GRI: 'outline',\n TCFD: 'outline',\n CDP: 'outline',\n SASB: 'outline',\n CSRD: 'outline',\n ISSB: 'outline',\n EU_TAXONOMY: 'outline',\n CUSTOM: 'secondary',\n\n // Carbon credit registry (BOFF-5824): vintage + credit lifecycle\n OPEN: 'info',\n PARTIALLY_ISSUED: 'warning',\n FULLY_ISSUED: 'success',\n CLOSED: 'outline',\n ISSUED: 'success',\n PARTIALLY_RETIRED: 'warning',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAIMC,oBAAe,IAAI,IAAI;CAAC;CAAe;CAAU;AAAQ,CAAC,GAE1DC,IAAiD;CAErD,QAAQ;CACR,mBAAmB;CACnB,UAAU;CA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