@burdenoff/microfe-ecoimpacthub 2026.1123.2 → 2026.1124.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/ecoimpacthub/EcoImpactHubRoutes.js +47 -39
  2. package/dist/ecoimpacthub/EcoImpactHubRoutes.js.map +1 -1
  3. package/dist/ecoimpacthub/hooks/ecoTransport.d.ts +2 -0
  4. package/dist/ecoimpacthub/hooks/ecoTransport.js +1 -0
  5. package/dist/ecoimpacthub/hooks/ecoTransport.js.map +1 -1
  6. package/dist/ecoimpacthub/hooks/index.d.ts +1 -0
  7. package/dist/ecoimpacthub/hooks/index.js +3 -2
  8. package/dist/ecoimpacthub/hooks/useEcoAiOperations.d.ts +15 -0
  9. package/dist/ecoimpacthub/hooks/useEcoAiOperations.js +90 -0
  10. package/dist/ecoimpacthub/hooks/useEcoAiOperations.js.map +1 -0
  11. package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +1 -1
  12. package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
  13. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.d.ts +21 -0
  14. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js +536 -0
  15. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js.map +1 -0
  16. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +346 -320
  17. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
  18. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +85 -81
  19. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
  20. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.d.ts +1 -0
  21. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js +193 -0
  22. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/habitat/stewardship.d.ts +34 -0
  24. package/dist/ecoimpacthub/pages/habitat/stewardship.js +83 -0
  25. package/dist/ecoimpacthub/pages/habitat/stewardship.js.map +1 -0
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +165 -143
  27. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  28. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +346 -185
  29. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  30. package/dist/ecoimpacthub/types/index.d.ts +83 -0
  31. package/dist/ecoimpacthub/utils/pageContext.js +2 -1
  32. package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
  33. package/package.json +2 -2
@@ -7,145 +7,153 @@ 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/ehs/EhsPage.js").then((e) => ({ default: e.EhsPage }))), v = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), y = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), b = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), x = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), S = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), C = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), w = a(() => import("./pages/energy/EnergyPage.js").then((e) => ({ default: e.EnergyPage }))), T = a(() => import("./pages/circularity/CircularityPage.js").then((e) => ({ default: e.CircularityPage }))), E = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), D = a(() => import("./pages/compliance/CompliancePage.js").then((e) => ({ default: e.CompliancePage }))), O = a(() => import("./pages/reports/ReportDetailPage.js").then((e) => ({ default: e.ReportDetailPage }))), k = a(() => import("./pages/metrics/MetricsPage.js").then((e) => ({ default: e.MetricsPage }))), A = a(() => import("./pages/grants/GrantsPage.js").then((e) => ({ default: e.GrantsPage }))), j = a(() => import("./pages/grants/GrantDetailPage.js").then((e) => ({ default: e.GrantDetailPage }))), M = a(() => import("./pages/grants/DonorPortalPage.js").then((e) => ({ default: e.DonorPortalPage }))), N = a(() => import("./pages/credits/CreditsPage.js").then((e) => ({ default: e.CreditsPage }))), P = a(() => import("./pages/suppliers/SuppliersPage.js").then((e) => ({ default: e.SuppliersPage }))), F = a(() => import("./pages/products/ProductFootprintPage.js").then((e) => ({ default: e.ProductFootprintPage }))), I = a(() => import("./pages/satellite/SatellitePage.js").then((e) => ({ default: e.SatellitePage }))), L = a(() => import("./pages/telemetry/TelemetryPage.js").then((e) => ({ default: e.TelemetryPage }))), R = a(() => import("./pages/mobile/MobileDashboardPage.js").then((e) => ({ default: e.MobileDashboardPage }))), z = a(() => import("./pages/mobile/MobileRecordObservationPage.js").then((e) => ({ default: e.MobileRecordObservationPage }))), B = () => (n(), null), V = "ecoimpacthub.field.nativeHomeShown";
11
- function H() {
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/ehs/EhsPage.js").then((e) => ({ default: e.EhsPage }))), v = a(() => import("./pages/species/SpeciesPage.js").then((e) => ({ default: e.SpeciesPage }))), y = a(() => import("./pages/species/SpeciesDetailPage.js").then((e) => ({ default: e.SpeciesDetailPage }))), b = a(() => import("./pages/observations/ObservationsPage.js").then((e) => ({ default: e.ObservationsPage }))), x = a(() => import("./pages/habitat/HabitatProjectsPage.js").then((e) => ({ default: e.HabitatProjectsPage }))), S = a(() => import("./pages/habitat/StewardshipPage.js").then((e) => ({ default: e.StewardshipPage }))), C = a(() => import("./pages/habitat/HabitatProjectDetailPage.js").then((e) => ({ default: e.HabitatProjectDetailPage }))), w = a(() => import("./pages/carbon/CarbonPage.js").then((e) => ({ default: e.CarbonPage }))), T = a(() => import("./pages/energy/EnergyPage.js").then((e) => ({ default: e.EnergyPage }))), E = a(() => import("./pages/circularity/CircularityPage.js").then((e) => ({ default: e.CircularityPage }))), D = a(() => import("./pages/reports/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), O = a(() => import("./pages/compliance/CompliancePage.js").then((e) => ({ default: e.CompliancePage }))), k = a(() => import("./pages/reports/ReportDetailPage.js").then((e) => ({ default: e.ReportDetailPage }))), A = a(() => import("./pages/metrics/MetricsPage.js").then((e) => ({ default: e.MetricsPage }))), j = a(() => import("./pages/grants/GrantsPage.js").then((e) => ({ default: e.GrantsPage }))), M = a(() => import("./pages/grants/GrantDetailPage.js").then((e) => ({ default: e.GrantDetailPage }))), N = a(() => import("./pages/grants/DonorPortalPage.js").then((e) => ({ default: e.DonorPortalPage }))), P = a(() => import("./pages/credits/CreditsPage.js").then((e) => ({ default: e.CreditsPage }))), F = a(() => import("./pages/suppliers/SuppliersPage.js").then((e) => ({ default: e.SuppliersPage }))), I = a(() => import("./pages/products/ProductFootprintPage.js").then((e) => ({ default: e.ProductFootprintPage }))), L = a(() => import("./pages/satellite/SatellitePage.js").then((e) => ({ default: e.SatellitePage }))), R = a(() => import("./pages/telemetry/TelemetryPage.js").then((e) => ({ default: e.TelemetryPage }))), z = a(() => import("./pages/ai/AiOperationsPage.js").then((e) => ({ default: e.AiOperationsPage }))), B = a(() => import("./pages/mobile/MobileDashboardPage.js").then((e) => ({ default: e.MobileDashboardPage }))), V = a(() => import("./pages/mobile/MobileRecordObservationPage.js").then((e) => ({ default: e.MobileRecordObservationPage }))), H = () => (n(), null), U = "ecoimpacthub.field.nativeHomeShown";
11
+ function W() {
12
12
  if (!globalThis.Capacitor?.isNativePlatform?.()) return !1;
13
13
  try {
14
- if (sessionStorage.getItem(V)) return !1;
15
- sessionStorage.setItem(V, "1");
14
+ if (sessionStorage.getItem(U)) return !1;
15
+ sessionStorage.setItem(U, "1");
16
16
  } catch {}
17
17
  return !0;
18
18
  }
19
- var U = () => {
20
- let [e] = o(H);
19
+ var G = () => {
20
+ let [e] = o(W);
21
21
  return e ? /* @__PURE__ */ d(s, {
22
22
  to: "mobile",
23
23
  replace: !0
24
24
  }) : /* @__PURE__ */ d(r, {});
25
- }, W = () => /* @__PURE__ */ d("div", {
25
+ }, K = () => /* @__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 G(e, n) {
29
+ function q(e, n) {
30
30
  return /* @__PURE__ */ d(t, {
31
31
  flag: e,
32
32
  children: n
33
33
  });
34
34
  }
35
- var K = () => {
35
+ var J = () => {
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(B, {}), /* @__PURE__ */ d(i, {
40
- fallback: /* @__PURE__ */ d(W, {}),
39
+ children: [/* @__PURE__ */ d(H, {}), /* @__PURE__ */ d(i, {
40
+ fallback: /* @__PURE__ */ d(K, {}),
41
41
  children: /* @__PURE__ */ f(l, { children: [
42
42
  /* @__PURE__ */ d(c, {
43
43
  index: !0,
44
- element: G("ecoimpacthub.page.dashboard", /* @__PURE__ */ d(U, {}))
44
+ element: q("ecoimpacthub.page.dashboard", /* @__PURE__ */ d(G, {}))
45
45
  }),
46
46
  /* @__PURE__ */ d(c, {
47
47
  path: "sites",
48
- element: G("ecoimpacthub.page.sites", /* @__PURE__ */ d(m, {}))
48
+ element: q("ecoimpacthub.page.sites", /* @__PURE__ */ d(m, {}))
49
49
  }),
50
50
  /* @__PURE__ */ d(c, {
51
51
  path: "sites/:id",
52
- element: G("ecoimpacthub.page.sites", /* @__PURE__ */ d(h, {}))
52
+ element: q("ecoimpacthub.page.sites", /* @__PURE__ */ d(h, {}))
53
53
  }),
54
54
  /* @__PURE__ */ d(c, {
55
55
  path: "monitoring",
56
- element: G("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(g, {}))
56
+ element: q("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(g, {}))
57
57
  }),
58
58
  /* @__PURE__ */ d(c, {
59
59
  path: "ehs",
60
- element: G("ecoimpacthub.page.ehs", /* @__PURE__ */ d(_, {}))
60
+ element: q("ecoimpacthub.page.ehs", /* @__PURE__ */ d(_, {}))
61
61
  }),
62
62
  /* @__PURE__ */ d(c, {
63
63
  path: "species",
64
- element: G("ecoimpacthub.page.species", /* @__PURE__ */ d(v, {}))
64
+ element: q("ecoimpacthub.page.species", /* @__PURE__ */ d(v, {}))
65
65
  }),
66
66
  /* @__PURE__ */ d(c, {
67
67
  path: "species/:id",
68
- element: G("ecoimpacthub.page.species", /* @__PURE__ */ d(y, {}))
68
+ element: q("ecoimpacthub.page.species", /* @__PURE__ */ d(y, {}))
69
69
  }),
70
70
  /* @__PURE__ */ d(c, {
71
71
  path: "observations",
72
- element: G("ecoimpacthub.page.observations", /* @__PURE__ */ d(b, {}))
72
+ element: q("ecoimpacthub.page.observations", /* @__PURE__ */ d(b, {}))
73
73
  }),
74
74
  /* @__PURE__ */ d(c, {
75
75
  path: "habitat",
76
- element: G("ecoimpacthub.page.habitat", /* @__PURE__ */ d(x, {}))
76
+ element: q("ecoimpacthub.page.habitat", /* @__PURE__ */ d(x, {}))
77
77
  }),
78
78
  /* @__PURE__ */ d(c, {
79
79
  path: "habitat/:id",
80
- element: G("ecoimpacthub.page.habitat", /* @__PURE__ */ d(S, {}))
80
+ element: q("ecoimpacthub.page.habitat", /* @__PURE__ */ d(C, {}))
81
+ }),
82
+ /* @__PURE__ */ d(c, {
83
+ path: "habitat/stewards",
84
+ element: q("ecoimpacthub.page.habitat", /* @__PURE__ */ d(S, {}))
81
85
  }),
82
86
  /* @__PURE__ */ d(c, {
83
87
  path: "carbon",
84
- element: G("ecoimpacthub.page.carbon", /* @__PURE__ */ d(C, {}))
88
+ element: q("ecoimpacthub.page.carbon", /* @__PURE__ */ d(w, {}))
85
89
  }),
86
90
  /* @__PURE__ */ d(c, {
87
91
  path: "credits",
88
- element: G("ecoimpacthub.page.credits", /* @__PURE__ */ d(N, {}))
92
+ element: q("ecoimpacthub.page.credits", /* @__PURE__ */ d(P, {}))
89
93
  }),
90
94
  /* @__PURE__ */ d(c, {
91
95
  path: "suppliers",
92
- element: G("ecoimpacthub.page.carbon", /* @__PURE__ */ d(P, {}))
96
+ element: q("ecoimpacthub.page.carbon", /* @__PURE__ */ d(F, {}))
93
97
  }),
94
98
  /* @__PURE__ */ d(c, {
95
99
  path: "products",
96
- element: G("ecoimpacthub.page.carbon", /* @__PURE__ */ d(F, {}))
100
+ element: q("ecoimpacthub.page.carbon", /* @__PURE__ */ d(I, {}))
97
101
  }),
98
102
  /* @__PURE__ */ d(c, {
99
103
  path: "satellite",
100
- element: G("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(I, {}))
104
+ element: q("ecoimpacthub.page.monitoring", /* @__PURE__ */ d(L, {}))
101
105
  }),
102
106
  /* @__PURE__ */ d(c, {
103
107
  path: "telemetry",
104
- element: G("ecoimpacthub.page.observations", /* @__PURE__ */ d(L, {}))
108
+ element: q("ecoimpacthub.page.observations", /* @__PURE__ */ d(R, {}))
105
109
  }),
106
110
  /* @__PURE__ */ d(c, {
107
111
  path: "circularity",
108
- element: G("ecoimpacthub.page.circularity", /* @__PURE__ */ d(T, {}))
112
+ element: q("ecoimpacthub.page.circularity", /* @__PURE__ */ d(E, {}))
109
113
  }),
110
114
  /* @__PURE__ */ d(c, {
111
115
  path: "metrics",
112
- element: G("ecoimpacthub.page.metrics", /* @__PURE__ */ d(k, {}))
116
+ element: q("ecoimpacthub.page.metrics", /* @__PURE__ */ d(A, {}))
113
117
  }),
114
118
  /* @__PURE__ */ d(c, {
115
119
  path: "energy",
116
- element: G("ecoimpacthub.page.energy", /* @__PURE__ */ d(w, {}))
120
+ element: q("ecoimpacthub.page.energy", /* @__PURE__ */ d(T, {}))
117
121
  }),
118
122
  /* @__PURE__ */ d(c, {
119
123
  path: "reports",
120
- element: G("ecoimpacthub.page.reports", /* @__PURE__ */ d(E, {}))
124
+ element: q("ecoimpacthub.page.reports", /* @__PURE__ */ d(D, {}))
121
125
  }),
122
126
  /* @__PURE__ */ d(c, {
123
127
  path: "compliance",
124
- element: G("ecoimpacthub.page.compliance", /* @__PURE__ */ d(D, {}))
128
+ element: q("ecoimpacthub.page.compliance", /* @__PURE__ */ d(O, {}))
125
129
  }),
126
130
  /* @__PURE__ */ d(c, {
127
131
  path: "reports/:id",
128
- element: G("ecoimpacthub.page.reports", /* @__PURE__ */ d(O, {}))
132
+ element: q("ecoimpacthub.page.reports", /* @__PURE__ */ d(k, {}))
129
133
  }),
130
134
  /* @__PURE__ */ d(c, {
131
135
  path: "grants/portal",
132
- element: /* @__PURE__ */ d(M, {})
136
+ element: /* @__PURE__ */ d(N, {})
133
137
  }),
134
138
  /* @__PURE__ */ d(c, {
135
139
  path: "grants",
136
- element: G("ecoimpacthub.page.grants", /* @__PURE__ */ d(A, {}))
140
+ element: q("ecoimpacthub.page.grants", /* @__PURE__ */ d(j, {}))
137
141
  }),
138
142
  /* @__PURE__ */ d(c, {
139
143
  path: "grants/:id",
140
- element: G("ecoimpacthub.page.grants", /* @__PURE__ */ d(j, {}))
144
+ element: q("ecoimpacthub.page.grants", /* @__PURE__ */ d(M, {}))
145
+ }),
146
+ /* @__PURE__ */ d(c, {
147
+ path: "ai",
148
+ element: q("ecoimpacthub.page.ai", /* @__PURE__ */ d(z, {}))
141
149
  }),
142
150
  /* @__PURE__ */ d(c, {
143
151
  path: "mobile",
144
- element: G("ecoimpacthub.page.mobile", /* @__PURE__ */ d(R, {}))
152
+ element: q("ecoimpacthub.page.mobile", /* @__PURE__ */ d(B, {}))
145
153
  }),
146
154
  /* @__PURE__ */ d(c, {
147
155
  path: "mobile/record-observation",
148
- element: G("ecoimpacthub.page.observations", /* @__PURE__ */ d(z, {}))
156
+ element: q("ecoimpacthub.page.observations", /* @__PURE__ */ d(V, {}))
149
157
  }),
150
158
  /* @__PURE__ */ d(c, {
151
159
  path: "*",
@@ -158,6 +166,6 @@ var K = () => {
158
166
  })]
159
167
  });
160
168
  };
161
- export { K as EcoImpactHubRoutes };
169
+ export { J as EcoImpactHubRoutes };
162
170
 
163
171
  //# sourceMappingURL=EcoImpactHubRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EcoImpactHubRoutes.js","names":["SitesPage","lazy","m","SiteDetailPage","MonitoringPage","EhsPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","HabitatProjectDetailPage","CarbonPage","EnergyPage","CircularityPage","ReportsPage","CompliancePage","ReportDetailPage","MetricsPage","GrantsPage","GrantDetailPage","DonorPortalPage","CreditsPage","SuppliersPage","ProductFootprintPage","SatellitePage","TelemetryPage","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// EHS compliance & risk (risk register / incidents / audits / actions / permits)\nconst EhsPage = lazy(() => import('./pages/ehs/EhsPage').then((m) => ({ default: m.EhsPage })));\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// Supplier Chain / Scope 3 Engagement (BOFF-4347)\nconst SuppliersPage = lazy(() =>\n import('./pages/suppliers/SuppliersPage').then((m) => ({ default: m.SuppliersPage }))\n);\n\n// Product Carbon Footprints / LCA (BOFF-4360)\nconst ProductFootprintPage = lazy(() =>\n import('./pages/products/ProductFootprintPage').then((m) => ({\n default: m.ProductFootprintPage,\n }))\n);\n\n// Satellite & Remote Sensing Imagery Pipeline (BOFF-4353)\nconst SatellitePage = lazy(() =>\n import('./pages/satellite/SatellitePage').then((m) => ({ default: m.SatellitePage }))\n);\n\n// Wildlife Telemetry Automation (BOFF-4356)\nconst TelemetryPage = lazy(() =>\n import('./pages/telemetry/TelemetryPage').then((m) => ({ default: m.TelemetryPage }))\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=\"ehs\" element={gated('ecoimpacthub.page.ehs', <EhsPage />)} />\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 path=\"suppliers\" element={gated('ecoimpacthub.page.carbon', <SuppliersPage />)} />\n <Route\n path=\"products\"\n element={gated('ecoimpacthub.page.carbon', <ProductFootprintPage />)}\n />\n <Route\n path=\"satellite\"\n element={gated('ecoimpacthub.page.monitoring', <SatellitePage />)}\n />\n <Route\n path=\"telemetry\"\n element={gated('ecoimpacthub.page.observations', <TelemetryPage />)}\n />\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,QACrB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,eAAe,EAAE,CACzF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iteDetailPage","MonitoringPage","EhsPage","SpeciesPage","SpeciesDetailPage","ObservationsPage","HabitatProjectsPage","StewardshipPage","HabitatProjectDetailPage","CarbonPage","EnergyPage","CircularityPage","ReportsPage","CompliancePage","ReportDetailPage","MetricsPage","GrantsPage","GrantDetailPage","DonorPortalPage","CreditsPage","SuppliersPage","ProductFootprintPage","SatellitePage","TelemetryPage","AiOperationsPage","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// EHS compliance & risk (risk register / incidents / audits / actions / permits)\nconst EhsPage = lazy(() => import('./pages/ehs/EhsPage').then((m) => ({ default: m.EhsPage })));\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 StewardshipPage = lazy(() =>\n import('./pages/habitat/StewardshipPage').then((m) => ({ default: m.StewardshipPage }))\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// Supplier Chain / Scope 3 Engagement (BOFF-4347)\nconst SuppliersPage = lazy(() =>\n import('./pages/suppliers/SuppliersPage').then((m) => ({ default: m.SuppliersPage }))\n);\n\n// Product Carbon Footprints / LCA (BOFF-4360)\nconst ProductFootprintPage = lazy(() =>\n import('./pages/products/ProductFootprintPage').then((m) => ({\n default: m.ProductFootprintPage,\n }))\n);\n\n// Satellite & Remote Sensing Imagery Pipeline (BOFF-4353)\nconst SatellitePage = lazy(() =>\n import('./pages/satellite/SatellitePage').then((m) => ({ default: m.SatellitePage }))\n);\n\n// Wildlife Telemetry Automation (BOFF-4356)\nconst TelemetryPage = lazy(() =>\n import('./pages/telemetry/TelemetryPage').then((m) => ({ default: m.TelemetryPage }))\n);\n\n// AI Operations surface (BOFF-3730): shared fe-libs primitive + domain decision cards\nconst AiOperationsPage = lazy(() =>\n import('./pages/ai/AiOperationsPage').then((m) => ({ default: m.AiOperationsPage }))\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=\"ehs\" element={gated('ecoimpacthub.page.ehs', <EhsPage />)} />\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 <Route\n path=\"habitat/stewards\"\n element={gated('ecoimpacthub.page.habitat', <StewardshipPage />)}\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 path=\"suppliers\" element={gated('ecoimpacthub.page.carbon', <SuppliersPage />)} />\n <Route\n path=\"products\"\n element={gated('ecoimpacthub.page.carbon', <ProductFootprintPage />)}\n />\n <Route\n path=\"satellite\"\n element={gated('ecoimpacthub.page.monitoring', <SatellitePage />)}\n />\n <Route\n path=\"telemetry\"\n element={gated('ecoimpacthub.page.observations', <TelemetryPage />)}\n />\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 path=\"ai\" element={gated('ecoimpacthub.page.ai', <AiOperationsPage />)} />\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,IAAUJ,QAAW,OAAO,yBAAsB,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,QAAQ,EAAE,CAAC,GAGxFI,IAAcL,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,YAAY,EAAE,CAChF,GACMK,IAAoBN,QACxB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,kBAAkB,EAAE,CAC5F,GAGMM,IAAmBP,QACvB,OAAO,2CAAwC,CAAC,MAAM,OAAO,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,CACP;;AAET"}
@@ -13,5 +13,7 @@ export interface EcoQueryOptions {
13
13
  * failure themselves (the AI monitoring calls), so the user sees one message.
14
14
  */
15
15
  suppressGlobalErrorEvent?: boolean;
16
+ /** Use the same workspace as the feature's query and mutation state. */
17
+ workspaceId?: string;
16
18
  }
17
19
  export declare const ecoQuery: <TData>(query: string, variables: Record<string, unknown>, baseUrl?: string, options?: EcoQueryOptions) => Promise<TData>;
@@ -13,6 +13,7 @@ var r = () => {
13
13
  query: i,
14
14
  variables: a,
15
15
  workspaceToken: !0,
16
+ ...s.workspaceId ? { workspaceId: s.workspaceId } : {},
16
17
  ...s.suppressGlobalErrorEvent ? { suppressGlobalErrorEvent: !0 } : {}
17
18
  });
18
19
  } catch (n) {
@@ -1 +1 @@
1
- {"version":3,"file":"ecoTransport.js","names":["clearGraphqlReadCaches","g","ecoQuery","response","graphqlFetch","options","err","errors","graphQLErrorsOf","EcoGraphQLError","query"],"sources":["../../../src/ecoimpacthub/hooks/ecoTransport.ts"],"sourcesContent":["/**\n * EcoImpactHub GraphQL transport\n * @module ecoimpacthub/hooks\n *\n * Thin wrapper over fe-libs `graphqlFetch` against the workspace gateway.\n * Failures throw an {@link EcoGraphQLError} that keeps the structured GraphQL\n * errors (including `extensions.code`), so callers can tell a quota or\n * feature-flag refusal apart from an ordinary failure.\n */\n\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { EcoGraphQLError, graphQLErrorsOf } from '../utils/graphqlErrors';\n\n/**\n * fe-libs `graphqlFetch` coalesces `query` responses in an in-memory cache keyed\n * by operationName+variables for ~15s (mutations are never cached). A read\n * issued right after a write (e.g. React-Query refetch triggered by our\n * `invalidateQueries`) would otherwise return the PRE-mutation response until the\n * TTL expires — making just-created/updated rows invisible until a full reload.\n * fe-libs' documented remedy is that write-performing callers clear those caches;\n * we do exactly that (the same maps `clearGraphqlFetchResponseCache` clears)\n * after every eco mutation so every follow-up read is fresh.\n */\ntype GraphqlReadCacheGlobals = {\n __graphqlFetchResponseCache?: { clear: () => void };\n __graphqlFetchPendingResponses?: { clear: () => void };\n __boffGraphQLResponseCache?: { clear: () => void };\n};\n\nconst clearGraphqlReadCaches = (): void => {\n const g = globalThis as GraphqlReadCacheGlobals;\n g.__graphqlFetchResponseCache?.clear();\n g.__graphqlFetchPendingResponses?.clear();\n g.__boffGraphQLResponseCache?.clear();\n};\n\nexport interface EcoQueryOptions {\n /**\n * Skip fe-libs' global backend-error toast. Set by callers that surface the\n * failure themselves (the AI monitoring calls), so the user sees one message.\n */\n suppressGlobalErrorEvent?: boolean;\n}\n\nexport const ecoQuery = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string,\n options: EcoQueryOptions = {}\n): Promise<TData> => {\n let response: Awaited<ReturnType<typeof graphqlFetch<TData>>>;\n try {\n response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n ...(options.suppressGlobalErrorEvent ? { suppressGlobalErrorEvent: true } : {}),\n });\n } catch (err) {\n // The batched transport rejects with an Error carrying the GraphQL errors\n // on `.errors`; keep their extensions (code, quotaName) for callers.\n const errors = graphQLErrorsOf(err);\n if (errors.length) throw new EcoGraphQLError(errors);\n throw err;\n }\n\n if (response.errors?.length) {\n throw new EcoGraphQLError(response.errors);\n }\n if (!response.data) {\n throw new Error('GraphQL response did not include data');\n }\n // After a write, drop fe-libs' short-lived read caches so the invalidation\n // refetch that follows reads fresh data instead of the pre-mutation snapshot.\n if (/^\\s*mutation\\b/.test(query)) {\n clearGraphqlReadCaches();\n }\n return response.data;\n};\n"],"mappings":";;;AA8BA,IAAMA,UAAqC;CACzC,IAAMC,IAAI;CAGV,AAFAA,EAAE,6BAA6B,MAAM,GACrCA,EAAE,gCAAgC,MAAM,GACxCA,EAAE,4BAA4B,MAAM;AACtC,GAUaC,IAAW,OACtB,GACA,GACA,GACA,IAA2B,CAAC,MACT;CACnB,IAAIC;CACJ,IAAI;EACF,IAAW,MAAMC,EAAoB;GACnC,SAAS;GACT;GACA;GACA;GACA,gBAAgB;GAChB,GAAIC,EAAQ,2BAA2B,EAAE,0BAA0B,GAAK,IAAI,CAAC;EAC/E,CAAC;CACH,SAASC,GAAK;EAGZ,IAAMC,IAASC,EAAgBF,CAAG;EAElC,MADIC,EAAO,SAAc,IAAIE,EAAgBF,CAAM,IAC7CD;CACR;CAEA,IAAIH,EAAS,QAAQ,QACnB,MAAM,IAAIM,EAAgBN,EAAS,MAAM;CAE3C,IAAI,CAACA,EAAS,MACZ,MAAU,MAAM,uCAAuC;CAOzD,OAHI,iBAAiB,KAAKO,CAAK,KAC7BV,EAAuB,GAElBG,EAAS;AAClB"}
1
+ {"version":3,"file":"ecoTransport.js","names":["clearGraphqlReadCaches","g","ecoQuery","response","graphqlFetch","options","err","errors","graphQLErrorsOf","EcoGraphQLError","query"],"sources":["../../../src/ecoimpacthub/hooks/ecoTransport.ts"],"sourcesContent":["/**\n * EcoImpactHub GraphQL transport\n * @module ecoimpacthub/hooks\n *\n * Thin wrapper over fe-libs `graphqlFetch` against the workspace gateway.\n * Failures throw an {@link EcoGraphQLError} that keeps the structured GraphQL\n * errors (including `extensions.code`), so callers can tell a quota or\n * feature-flag refusal apart from an ordinary failure.\n */\n\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { EcoGraphQLError, graphQLErrorsOf } from '../utils/graphqlErrors';\n\n/**\n * fe-libs `graphqlFetch` coalesces `query` responses in an in-memory cache keyed\n * by operationName+variables for ~15s (mutations are never cached). A read\n * issued right after a write (e.g. React-Query refetch triggered by our\n * `invalidateQueries`) would otherwise return the PRE-mutation response until the\n * TTL expires — making just-created/updated rows invisible until a full reload.\n * fe-libs' documented remedy is that write-performing callers clear those caches;\n * we do exactly that (the same maps `clearGraphqlFetchResponseCache` clears)\n * after every eco mutation so every follow-up read is fresh.\n */\ntype GraphqlReadCacheGlobals = {\n __graphqlFetchResponseCache?: { clear: () => void };\n __graphqlFetchPendingResponses?: { clear: () => void };\n __boffGraphQLResponseCache?: { clear: () => void };\n};\n\nconst clearGraphqlReadCaches = (): void => {\n const g = globalThis as GraphqlReadCacheGlobals;\n g.__graphqlFetchResponseCache?.clear();\n g.__graphqlFetchPendingResponses?.clear();\n g.__boffGraphQLResponseCache?.clear();\n};\n\nexport interface EcoQueryOptions {\n /**\n * Skip fe-libs' global backend-error toast. Set by callers that surface the\n * failure themselves (the AI monitoring calls), so the user sees one message.\n */\n suppressGlobalErrorEvent?: boolean;\n /** Use the same workspace as the feature's query and mutation state. */\n workspaceId?: string;\n}\n\nexport const ecoQuery = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string,\n options: EcoQueryOptions = {}\n): Promise<TData> => {\n let response: Awaited<ReturnType<typeof graphqlFetch<TData>>>;\n try {\n response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n ...(options.workspaceId ? { workspaceId: options.workspaceId } : {}),\n ...(options.suppressGlobalErrorEvent ? { suppressGlobalErrorEvent: true } : {}),\n });\n } catch (err) {\n // The batched transport rejects with an Error carrying the GraphQL errors\n // on `.errors`; keep their extensions (code, quotaName) for callers.\n const errors = graphQLErrorsOf(err);\n if (errors.length) throw new EcoGraphQLError(errors);\n throw err;\n }\n\n if (response.errors?.length) {\n throw new EcoGraphQLError(response.errors);\n }\n if (!response.data) {\n throw new Error('GraphQL response did not include data');\n }\n // After a write, drop fe-libs' short-lived read caches so the invalidation\n // refetch that follows reads fresh data instead of the pre-mutation snapshot.\n if (/^\\s*mutation\\b/.test(query)) {\n clearGraphqlReadCaches();\n }\n return response.data;\n};\n"],"mappings":";;;AA8BA,IAAMA,UAAqC;CACzC,IAAMC,IAAI;CAGV,AAFAA,EAAE,6BAA6B,MAAM,GACrCA,EAAE,gCAAgC,MAAM,GACxCA,EAAE,4BAA4B,MAAM;AACtC,GAYaC,IAAW,OACtB,GACA,GACA,GACA,IAA2B,CAAC,MACT;CACnB,IAAIC;CACJ,IAAI;EACF,IAAW,MAAMC,EAAoB;GACnC,SAAS;GACT;GACA;GACA;GACA,gBAAgB;GAChB,GAAIC,EAAQ,cAAc,EAAE,aAAaA,EAAQ,YAAY,IAAI,CAAC;GAClE,GAAIA,EAAQ,2BAA2B,EAAE,0BAA0B,GAAK,IAAI,CAAC;EAC/E,CAAC;CACH,SAASC,GAAK;EAGZ,IAAMC,IAASC,EAAgBF,CAAG;EAElC,MADIC,EAAO,SAAc,IAAIE,EAAgBF,CAAM,IAC7CD;CACR;CAEA,IAAIH,EAAS,QAAQ,QACnB,MAAM,IAAIM,EAAgBN,EAAS,MAAM;CAE3C,IAAI,CAACA,EAAS,MACZ,MAAU,MAAM,uCAAuC;CAOzD,OAHI,iBAAiB,KAAKO,CAAK,KAC7BV,EAAuB,GAElBG,EAAS;AAClB"}
@@ -11,4 +11,5 @@ export * from './useDashboardLayout';
11
11
  export * from './useActiveEcoEntity';
12
12
  export * from './useTr';
13
13
  export * from './useEcoAiMonitoring';
14
+ export * from './useEcoAiOperations';
14
15
  export * from './useEcoPlatformModulesApi';
@@ -7,5 +7,6 @@ import { DASHBOARD_WIDGET_DEFS as Dt, useDashboardLayout as Ot } from "./useDash
7
7
  import { useActiveEcoEntity as kt } from "./useActiveEcoEntity.js";
8
8
  import { useTr as At } from "./useTr.js";
9
9
  import { ECO_AI_DETECT_ANOMALIES_QUERY as jt, ECO_AI_PROPOSE_THRESHOLD_MUTATION as Mt, ECO_AI_TRIAGE_ALERT_MUTATION as Nt, useEcoAiDetectAnomalies as Pt, useEcoAiErrorReporter as Ft, useEcoAiProposeThreshold as It, useEcoAiTriageAlert as Lt } from "./useEcoAiMonitoring.js";
10
- import { useEcoAddProductAllocation as Rt, useEcoAiDashboardInsights as zt, useEcoArchiveSupplier as Bt, useEcoCreateProduct as Vt, useEcoCreateSiteAoi as Ht, useEcoCreateSupplier as Ut, useEcoCreateSupplierDataRequest as Wt, useEcoEnrollTelemetryCollar as Gt, useEcoIngestSatelliteImagery as Kt, useEcoIngestTelemetryFixes as qt, useEcoProductFootprintReport as Jt, useEcoProducts as Yt, useEcoRemoveProductAllocation as Xt, useEcoSatelliteIndicators as Zt, useEcoSatelliteScenes as Qt, useEcoScope3SupplierSummary as $t, useEcoSiteAois as en, useEcoSupplierDataRequests as tn, useEcoSuppliers as nn, useEcoTelemetryCollars as rn, useEcoTelemetryHomeRange as an, useEcoUpdateSupplierDataRequestStatus as on } from "./useEcoPlatformModulesApi.js";
11
- export { Dt as DASHBOARD_WIDGET_DEFS, jt as ECO_AI_DETECT_ANOMALIES_QUERY, Mt as ECO_AI_PROPOSE_THRESHOLD_MUTATION, Nt as ECO_AI_TRIAGE_ALERT_MUTATION, gt as uploadEcoFile, kt as useActiveEcoEntity, ht as useCursorPager, Ot as useDashboardLayout, e as useEcoAcceptCarbonEntryDraft, Rt as useEcoAddProductAllocation, t as useEcoAddReportLineItem, zt as useEcoAiDashboardInsights, Pt as useEcoAiDetectAnomalies, n as useEcoAiDraftCarbonEntries, Ft as useEcoAiErrorReporter, It as useEcoAiProposeThreshold, r as useEcoAiSuggestEmissionFactor, Lt as useEcoAiTriageAlert, i as useEcoApproveReport, a as useEcoArchiveEnergyAsset, o as useEcoArchiveGrant, s as useEcoArchiveGrantMilestone, c as useEcoArchiveMaterialLoop, l as useEcoArchiveSite, u as useEcoArchiveSpecies, Bt as useEcoArchiveSupplier, d as useEcoArchiveWasteStream, St as useEcoAssignTag, f as useEcoAudits, p as useEcoCancelDeadline, m as useEcoCarbonCredits, h as useEcoCarbonEntries, g as useEcoCarbonTotals, bt as useEcoComments, _ as useEcoCompleteAudit, v as useEcoCompleteDeadline, y as useEcoCorrectiveActions, Ct as useEcoCreateAndAssignTag, b as useEcoCreateAudit, xt as useEcoCreateComment, x as useEcoCreateCorrectiveAction, S as useEcoCreateCreditMethodology, C as useEcoCreateCreditVintage, w as useEcoCreateDeadline, T as useEcoCreateDonorPortalLink, E as useEcoCreateEhsPermit, D as useEcoCreateEmissionFactor, O as useEcoCreateEnergyAsset, k as useEcoCreateGrant, A as useEcoCreateGrantFunder, j as useEcoCreateGrantMilestone, M as useEcoCreateHabitatProject, N as useEcoCreateIncident, P as useEcoCreateMaterialLoop, F as useEcoCreateObligation, I as useEcoCreatePermit, Vt as useEcoCreateProduct, L as useEcoCreateReductionTarget, R as useEcoCreateReport, z as useEcoCreateRisk, B as useEcoCreateSensor, V as useEcoCreateSite, Ht as useEcoCreateSiteAoi, H as useEcoCreateSpecies, Ut as useEcoCreateSupplier, Wt as useEcoCreateSupplierDataRequest, U as useEcoCreateThreshold, W as useEcoCreateWasteStream, G as useEcoCreditMethodologies, K as useEcoCreditPortfolioSummary, q as useEcoCreditRetirements, J as useEcoCreditVintages, Y as useEcoDeadlines, X as useEcoDeleteMaterialLoopFlow, Z as useEcoDeleteWasteRecord, Q as useEcoEhsPermits, $ as useEcoEmissionFactors, ee as useEcoEnergyAssets, te as useEcoEnergyGridBaselines, ne as useEcoEnergyMixDashboard, re as useEcoEnergyReadings, Gt as useEcoEnrollTelemetryCollar, wt as useEcoEntityTags, _t as useEcoFile, vt as useEcoFileUpload, ie as useEcoGrant, ae as useEcoGrantFunders, oe as useEcoGrants, se as useEcoHabitatProject, ce as useEcoHabitatProjects, le as useEcoImportEnergyReadings, ue as useEcoIncidents, Kt as useEcoIngestSatelliteImagery, qt as useEcoIngestTelemetryFixes, de as useEcoIssueCarbonCredits, fe as useEcoLogRestorationActivity, pe as useEcoMaterialLoopFlows, me as useEcoMaterialLoopSummary, he as useEcoMaterialLoops, ge as useEcoMeasurements, _e as useEcoMetric, ve as useEcoMetricRollups, ye as useEcoMetrics, be as useEcoObligations, xe as useEcoObservations, Se as useEcoPermits, Jt as useEcoProductFootprintReport, Yt as useEcoProducts, Ce as useEcoPublishReport, we as useEcoRecordCarbonEntry, Te as useEcoRecordEnergyReading, Ee as useEcoRecordMaterialLoopFlow, De as useEcoRecordMeasurement, Oe as useEcoRecordObservation, ke as useEcoRecordWaste, Ae as useEcoReductionTargets, je as useEcoRejectCarbonEntryDraft, Me as useEcoRejectReport, Xt as useEcoRemoveProductAllocation, Tt as useEcoRemoveTagAssignment, Ne as useEcoRenewEhsPermit, Pe as useEcoReport, Fe as useEcoReports, Ie as useEcoRetireCarbonCredits, Le as useEcoRevokeDonorPortalLink, Re as useEcoRisks, Zt as useEcoSatelliteIndicators, Qt as useEcoSatelliteScenes, $t as useEcoScope3SupplierSummary, ze as useEcoSensors, Be as useEcoSetCorrectiveActionStatus, Ve as useEcoSetCreditMethodologyStatus, He as useEcoSetEhsPermitStatus, Ue as useEcoSetEnergyGridBaseline, We as useEcoSetIncidentStatus, Ge as useEcoSetObligationStatus, Ke as useEcoSetPermitStatus, qe as useEcoSetReductionTargetStatus, Je as useEcoSetSensorStatus, Ye as useEcoSetThresholdActive, Xe as useEcoSite, en as useEcoSiteAois, Ze as useEcoSites, Qe as useEcoSpecies, $e as useEcoSpeciesDetail, et as useEcoStartAudit, tt as useEcoSubmitReportForApproval, tn as useEcoSupplierDataRequests, nn as useEcoSuppliers, Et as useEcoTagSearch, rn as useEcoTelemetryCollars, an as useEcoTelemetryHomeRange, nt as useEcoThresholds, rt as useEcoTransferCarbonCredit, it as useEcoTransitionGrant, at as useEcoTransitionGrantMilestone, ot as useEcoTransitionHabitatProject, st as useEcoUpdateEnergyAsset, ct as useEcoUpdateGrant, lt as useEcoUpdateRisk, ut as useEcoUpdateSpecies, on as useEcoUpdateSupplierDataRequestStatus, dt as useEcoVerifyCarbonEntry, ft as useEcoWasteDiversionSummary, pt as useEcoWasteRecords, mt as useEcoWasteStreams, At as useTr, yt as wspaceFetch };
10
+ import { useEcoAiDraftReportLineItems as Rt, useEcoAiLoopSettings as zt, useEcoAiReportReadiness as Bt, useEcoAiRunEnvironmentalSweep as Vt, useEcoUpdateAiLoopSettings as Ht } from "./useEcoAiOperations.js";
11
+ import { useEcoAddProductAllocation as Ut, useEcoAiDashboardInsights as Wt, useEcoArchiveSupplier as Gt, useEcoCreateProduct as Kt, useEcoCreateSiteAoi as qt, useEcoCreateSupplier as Jt, useEcoCreateSupplierDataRequest as Yt, useEcoEnrollTelemetryCollar as Xt, useEcoIngestSatelliteImagery as Zt, useEcoIngestTelemetryFixes as Qt, useEcoProductFootprintReport as $t, useEcoProducts as en, useEcoRemoveProductAllocation as tn, useEcoSatelliteIndicators as nn, useEcoSatelliteScenes as rn, useEcoScope3SupplierSummary as an, useEcoSiteAois as on, useEcoSupplierDataRequests as sn, useEcoSuppliers as cn, useEcoTelemetryCollars as ln, useEcoTelemetryHomeRange as un, useEcoUpdateSupplierDataRequestStatus as dn } from "./useEcoPlatformModulesApi.js";
12
+ export { Dt as DASHBOARD_WIDGET_DEFS, jt as ECO_AI_DETECT_ANOMALIES_QUERY, Mt as ECO_AI_PROPOSE_THRESHOLD_MUTATION, Nt as ECO_AI_TRIAGE_ALERT_MUTATION, gt as uploadEcoFile, kt as useActiveEcoEntity, ht as useCursorPager, Ot as useDashboardLayout, e as useEcoAcceptCarbonEntryDraft, Ut as useEcoAddProductAllocation, t as useEcoAddReportLineItem, Wt as useEcoAiDashboardInsights, Pt as useEcoAiDetectAnomalies, n as useEcoAiDraftCarbonEntries, Rt as useEcoAiDraftReportLineItems, Ft as useEcoAiErrorReporter, zt as useEcoAiLoopSettings, It as useEcoAiProposeThreshold, Bt as useEcoAiReportReadiness, Vt as useEcoAiRunEnvironmentalSweep, r as useEcoAiSuggestEmissionFactor, Lt as useEcoAiTriageAlert, i as useEcoApproveReport, a as useEcoArchiveEnergyAsset, o as useEcoArchiveGrant, s as useEcoArchiveGrantMilestone, c as useEcoArchiveMaterialLoop, l as useEcoArchiveSite, u as useEcoArchiveSpecies, Gt as useEcoArchiveSupplier, d as useEcoArchiveWasteStream, St as useEcoAssignTag, f as useEcoAudits, p as useEcoCancelDeadline, m as useEcoCarbonCredits, h as useEcoCarbonEntries, g as useEcoCarbonTotals, bt as useEcoComments, _ as useEcoCompleteAudit, v as useEcoCompleteDeadline, y as useEcoCorrectiveActions, Ct as useEcoCreateAndAssignTag, b as useEcoCreateAudit, xt as useEcoCreateComment, x as useEcoCreateCorrectiveAction, S as useEcoCreateCreditMethodology, C as useEcoCreateCreditVintage, w as useEcoCreateDeadline, T as useEcoCreateDonorPortalLink, E as useEcoCreateEhsPermit, D as useEcoCreateEmissionFactor, O as useEcoCreateEnergyAsset, k as useEcoCreateGrant, A as useEcoCreateGrantFunder, j as useEcoCreateGrantMilestone, M as useEcoCreateHabitatProject, N as useEcoCreateIncident, P as useEcoCreateMaterialLoop, F as useEcoCreateObligation, I as useEcoCreatePermit, Kt as useEcoCreateProduct, L as useEcoCreateReductionTarget, R as useEcoCreateReport, z as useEcoCreateRisk, B as useEcoCreateSensor, V as useEcoCreateSite, qt as useEcoCreateSiteAoi, H as useEcoCreateSpecies, Jt as useEcoCreateSupplier, Yt as useEcoCreateSupplierDataRequest, U as useEcoCreateThreshold, W as useEcoCreateWasteStream, G as useEcoCreditMethodologies, K as useEcoCreditPortfolioSummary, q as useEcoCreditRetirements, J as useEcoCreditVintages, Y as useEcoDeadlines, X as useEcoDeleteMaterialLoopFlow, Z as useEcoDeleteWasteRecord, Q as useEcoEhsPermits, $ as useEcoEmissionFactors, ee as useEcoEnergyAssets, te as useEcoEnergyGridBaselines, ne as useEcoEnergyMixDashboard, re as useEcoEnergyReadings, Xt as useEcoEnrollTelemetryCollar, wt as useEcoEntityTags, _t as useEcoFile, vt as useEcoFileUpload, ie as useEcoGrant, ae as useEcoGrantFunders, oe as useEcoGrants, se as useEcoHabitatProject, ce as useEcoHabitatProjects, le as useEcoImportEnergyReadings, ue as useEcoIncidents, Zt as useEcoIngestSatelliteImagery, Qt as useEcoIngestTelemetryFixes, de as useEcoIssueCarbonCredits, fe as useEcoLogRestorationActivity, pe as useEcoMaterialLoopFlows, me as useEcoMaterialLoopSummary, he as useEcoMaterialLoops, ge as useEcoMeasurements, _e as useEcoMetric, ve as useEcoMetricRollups, ye as useEcoMetrics, be as useEcoObligations, xe as useEcoObservations, Se as useEcoPermits, $t as useEcoProductFootprintReport, en as useEcoProducts, Ce as useEcoPublishReport, we as useEcoRecordCarbonEntry, Te as useEcoRecordEnergyReading, Ee as useEcoRecordMaterialLoopFlow, De as useEcoRecordMeasurement, Oe as useEcoRecordObservation, ke as useEcoRecordWaste, Ae as useEcoReductionTargets, je as useEcoRejectCarbonEntryDraft, Me as useEcoRejectReport, tn as useEcoRemoveProductAllocation, Tt as useEcoRemoveTagAssignment, Ne as useEcoRenewEhsPermit, Pe as useEcoReport, Fe as useEcoReports, Ie as useEcoRetireCarbonCredits, Le as useEcoRevokeDonorPortalLink, Re as useEcoRisks, nn as useEcoSatelliteIndicators, rn as useEcoSatelliteScenes, an as useEcoScope3SupplierSummary, ze as useEcoSensors, Be as useEcoSetCorrectiveActionStatus, Ve as useEcoSetCreditMethodologyStatus, He as useEcoSetEhsPermitStatus, Ue as useEcoSetEnergyGridBaseline, We as useEcoSetIncidentStatus, Ge as useEcoSetObligationStatus, Ke as useEcoSetPermitStatus, qe as useEcoSetReductionTargetStatus, Je as useEcoSetSensorStatus, Ye as useEcoSetThresholdActive, Xe as useEcoSite, on as useEcoSiteAois, Ze as useEcoSites, Qe as useEcoSpecies, $e as useEcoSpeciesDetail, et as useEcoStartAudit, tt as useEcoSubmitReportForApproval, sn as useEcoSupplierDataRequests, cn as useEcoSuppliers, Et as useEcoTagSearch, ln as useEcoTelemetryCollars, un as useEcoTelemetryHomeRange, nt as useEcoThresholds, rt as useEcoTransferCarbonCredit, it as useEcoTransitionGrant, at as useEcoTransitionGrantMilestone, ot as useEcoTransitionHabitatProject, Ht as useEcoUpdateAiLoopSettings, st as useEcoUpdateEnergyAsset, ct as useEcoUpdateGrant, lt as useEcoUpdateRisk, ut as useEcoUpdateSpecies, dn as useEcoUpdateSupplierDataRequestStatus, dt as useEcoVerifyCarbonEntry, ft as useEcoWasteDiversionSummary, pt as useEcoWasteRecords, mt as useEcoWasteStreams, At as useTr, yt as wspaceFetch };
@@ -0,0 +1,15 @@
1
+ import { EcoAiEnvironmentalSweepResult, EcoAiLoopSettings, EcoAiReportDraftResult, EcoAiReportReadiness } from '../types';
2
+ export declare const useEcoAiReportReadiness: (reportId: string | undefined) => import('@tanstack/react-query').UseQueryResult<EcoAiReportReadiness, Error>;
3
+ export declare const useEcoAiDraftReportLineItems: () => import('@tanstack/react-query').UseMutationResult<EcoAiReportDraftResult, Error, string, unknown>;
4
+ export declare const useEcoAiLoopSettings: () => import('@tanstack/react-query').UseQueryResult<EcoAiLoopSettings, Error>;
5
+ export declare const useEcoUpdateAiLoopSettings: () => import('@tanstack/react-query').UseMutationResult<EcoAiLoopSettings, Error, {
6
+ enabled?: boolean;
7
+ cadenceCron?: string;
8
+ maxCreditsPerRun?: number;
9
+ dormantDaysThreshold?: number;
10
+ }, unknown>;
11
+ export declare const useEcoAiRunEnvironmentalSweep: () => import('@tanstack/react-query').UseMutationResult<EcoAiEnvironmentalSweepResult, Error, {
12
+ trigger?: string;
13
+ correlationId?: string;
14
+ forceRun?: boolean;
15
+ } | undefined, unknown>;
@@ -0,0 +1,90 @@
1
+ import { useEcoImpactHub as e } from "../context/EcoImpactHubContext.js";
2
+ import "../context/index.js";
3
+ import { ecoQuery as t } from "./ecoTransport.js";
4
+ import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
+ // src/ecoimpacthub/hooks/useEcoAiOperations.ts
6
+ var a = { suppressGlobalErrorEvent: !0 }, o = (n) => {
7
+ let { apiGatewayUrl: i } = e();
8
+ return r({
9
+ queryKey: [
10
+ "ecoimpacthub",
11
+ "ai",
12
+ "report-readiness",
13
+ n ?? ""
14
+ ],
15
+ enabled: !!n,
16
+ queryFn: async () => (await t("query EcoAiReportReadiness($reportId: ID!) {\n ecoAiReportReadiness(reportId: $reportId) {\n reportId framework totalDisclosures coveredCount missingCount coveragePct\n readyToPublish draftCarbonWarnings\n disclosures {\n disclosureCode label category sourceKind covered lineItemId\n citesDraftCarbonEntry sourceRecordCount gapReason\n }\n }\n }", { reportId: n }, i, a)).ecoAiReportReadiness
17
+ });
18
+ }, s = () => {
19
+ let { apiGatewayUrl: r } = e(), o = i();
20
+ return n({
21
+ mutationKey: [
22
+ "ecoimpacthub",
23
+ "ai",
24
+ "draft-report-line-items"
25
+ ],
26
+ mutationFn: async (e) => (await t("mutation EcoAiDraftReportLineItems($input: EcoAiDraftReportLineItemsInput!) {\n ecoAiDraftReportLineItems(input: $input) {\n reportId framework agentRunId engine draftedCount draftCarbonWarnings\n skippedDisclosures { disclosureCode label reason }\n lineItems {\n id workspaceId reportId carbonEntryId sourceMeasurementId sourceMetricId\n disclosureCode label value unit category aiDrafted agentRunId aiRationale\n createdAt updatedAt\n }\n }\n }", { input: { reportId: e } }, r, a)).ecoAiDraftReportLineItems,
27
+ onSuccess: (e) => {
28
+ o.invalidateQueries({ queryKey: ["ecoimpacthub", "reports"] }), o.invalidateQueries({ queryKey: [
29
+ "ecoimpacthub",
30
+ "report",
31
+ e.reportId
32
+ ] }), o.invalidateQueries({ queryKey: [
33
+ "ecoimpacthub",
34
+ "ai",
35
+ "report-readiness",
36
+ e.reportId
37
+ ] });
38
+ }
39
+ });
40
+ }, c = () => {
41
+ let { apiGatewayUrl: n } = e();
42
+ return r({
43
+ queryKey: [
44
+ "ecoimpacthub",
45
+ "ai",
46
+ "loop-settings"
47
+ ],
48
+ queryFn: async () => (await t("query EcoAiLoopSettings {\n ecoAiLoopSettings {\n id workspaceId enabled cadenceCron maxCreditsPerRun\n dormantDaysThreshold lastRunAt lastRunStatus lastCorrelationId\n }\n }", {}, n, a)).ecoAiLoopSettings
49
+ });
50
+ }, l = () => {
51
+ let { apiGatewayUrl: r } = e(), o = i();
52
+ return n({
53
+ mutationKey: [
54
+ "ecoimpacthub",
55
+ "ai",
56
+ "update-loop-settings"
57
+ ],
58
+ mutationFn: async (e) => (await t("mutation EcoUpdateAiLoopSettings($input: EcoUpdateAiLoopSettingsInput!) {\n ecoUpdateAiLoopSettings(input: $input) {\n id workspaceId enabled cadenceCron maxCreditsPerRun\n dormantDaysThreshold lastRunAt lastRunStatus lastCorrelationId\n }\n }", { input: e }, r, a)).ecoUpdateAiLoopSettings,
59
+ onSuccess: () => {
60
+ o.invalidateQueries({ queryKey: [
61
+ "ecoimpacthub",
62
+ "ai",
63
+ "loop-settings"
64
+ ] });
65
+ }
66
+ });
67
+ }, u = () => {
68
+ let { apiGatewayUrl: r } = e(), o = i();
69
+ return n({
70
+ mutationKey: [
71
+ "ecoimpacthub",
72
+ "ai",
73
+ "run-environmental-sweep"
74
+ ],
75
+ mutationFn: async (e) => (await t("mutation EcoAiRunEnvironmentalSweep($input: EcoAiRunEnvironmentalSweepInput) {\n ecoAiRunEnvironmentalSweep(input: $input) {\n status workspaceId correlationId trigger agentRunId engine\n creditsUsed maxCreditsPerRun anomalyCount sensorGapCount\n reportGapCount targetDriftCount staleDraftCount overdueHabitatCount\n notificationSent haltedReason ranAt\n findings {\n category severity entityId title detail recommendedAction citationPath\n }\n }\n }", { input: e ?? {
76
+ trigger: "interactive",
77
+ forceRun: !0
78
+ } }, r, a)).ecoAiRunEnvironmentalSweep,
79
+ onSuccess: () => {
80
+ o.invalidateQueries({ queryKey: [
81
+ "ecoimpacthub",
82
+ "ai",
83
+ "loop-settings"
84
+ ] });
85
+ }
86
+ });
87
+ };
88
+ export { s as useEcoAiDraftReportLineItems, c as useEcoAiLoopSettings, o as useEcoAiReportReadiness, u as useEcoAiRunEnvironmentalSweep, l as useEcoUpdateAiLoopSettings };
89
+
90
+ //# sourceMappingURL=useEcoAiOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEcoAiOperations.js","names":["AI_CALL","useEcoAiReportReadiness","useEcoImpactHub","useQuery","reportId","ecoQuery","apiGatewayUrl","useEcoAiDraftReportLineItems","qc","useQueryClient","useMutation","data","useEcoAiLoopSettings","useEcoUpdateAiLoopSettings","useEcoAiRunEnvironmentalSweep","input"],"sources":["../../../src/ecoimpacthub/hooks/useEcoAiOperations.ts"],"sourcesContent":["/**\n * AI ESG report assembly & autonomous environmental loop hooks\n * (BOFF-3701, BOFF-3719, BOFF-3730).\n * @module ecoimpacthub/hooks\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { useEcoImpactHub } from '../context';\nimport { ecoQuery } from './ecoTransport';\nimport type {\n EcoAiEnvironmentalSweepResult,\n EcoAiLoopSettings,\n EcoAiReportDraftResult,\n EcoAiReportReadiness,\n} from '../types';\n\nconst AI_CALL = { suppressGlobalErrorEvent: true } as const;\n\nexport const useEcoAiReportReadiness = (reportId: string | undefined) => {\n const { apiGatewayUrl } = useEcoImpactHub();\n return useQuery({\n queryKey: ['ecoimpacthub', 'ai', 'report-readiness', reportId ?? ''],\n enabled: Boolean(reportId),\n queryFn: async () => {\n const result = await ecoQuery<{ ecoAiReportReadiness: EcoAiReportReadiness }>(\n `query EcoAiReportReadiness($reportId: ID!) {\n ecoAiReportReadiness(reportId: $reportId) {\n reportId framework totalDisclosures coveredCount missingCount coveragePct\n readyToPublish draftCarbonWarnings\n disclosures {\n disclosureCode label category sourceKind covered lineItemId\n citesDraftCarbonEntry sourceRecordCount gapReason\n }\n }\n }`,\n { reportId },\n apiGatewayUrl,\n AI_CALL\n );\n return result.ecoAiReportReadiness;\n },\n });\n};\n\nexport const useEcoAiDraftReportLineItems = () => {\n const { apiGatewayUrl } = useEcoImpactHub();\n const qc = useQueryClient();\n return useMutation({\n mutationKey: ['ecoimpacthub', 'ai', 'draft-report-line-items'],\n mutationFn: async (reportId: string) => {\n const result = await ecoQuery<{ ecoAiDraftReportLineItems: EcoAiReportDraftResult }>(\n `mutation EcoAiDraftReportLineItems($input: EcoAiDraftReportLineItemsInput!) {\n ecoAiDraftReportLineItems(input: $input) {\n reportId framework agentRunId engine draftedCount draftCarbonWarnings\n skippedDisclosures { disclosureCode label reason }\n lineItems {\n id workspaceId reportId carbonEntryId sourceMeasurementId sourceMetricId\n disclosureCode label value unit category aiDrafted agentRunId aiRationale\n createdAt updatedAt\n }\n }\n }`,\n { input: { reportId } },\n apiGatewayUrl,\n AI_CALL\n );\n return result.ecoAiDraftReportLineItems;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: ['ecoimpacthub', 'reports'] });\n qc.invalidateQueries({ queryKey: ['ecoimpacthub', 'report', data.reportId] });\n qc.invalidateQueries({ queryKey: ['ecoimpacthub', 'ai', 'report-readiness', data.reportId] });\n },\n });\n};\n\nexport const useEcoAiLoopSettings = () => {\n const { apiGatewayUrl } = useEcoImpactHub();\n return useQuery({\n queryKey: ['ecoimpacthub', 'ai', 'loop-settings'],\n queryFn: async () => {\n const result = await ecoQuery<{ ecoAiLoopSettings: EcoAiLoopSettings }>(\n `query EcoAiLoopSettings {\n ecoAiLoopSettings {\n id workspaceId enabled cadenceCron maxCreditsPerRun\n dormantDaysThreshold lastRunAt lastRunStatus lastCorrelationId\n }\n }`,\n {},\n apiGatewayUrl,\n AI_CALL\n );\n return result.ecoAiLoopSettings;\n },\n });\n};\n\nexport const useEcoUpdateAiLoopSettings = () => {\n const { apiGatewayUrl } = useEcoImpactHub();\n const qc = useQueryClient();\n return useMutation({\n mutationKey: ['ecoimpacthub', 'ai', 'update-loop-settings'],\n mutationFn: async (input: {\n enabled?: boolean;\n cadenceCron?: string;\n maxCreditsPerRun?: number;\n dormantDaysThreshold?: number;\n }) => {\n const result = await ecoQuery<{ ecoUpdateAiLoopSettings: EcoAiLoopSettings }>(\n `mutation EcoUpdateAiLoopSettings($input: EcoUpdateAiLoopSettingsInput!) {\n ecoUpdateAiLoopSettings(input: $input) {\n id workspaceId enabled cadenceCron maxCreditsPerRun\n dormantDaysThreshold lastRunAt lastRunStatus lastCorrelationId\n }\n }`,\n { input },\n apiGatewayUrl,\n AI_CALL\n );\n return result.ecoUpdateAiLoopSettings;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: ['ecoimpacthub', 'ai', 'loop-settings'] });\n },\n });\n};\n\nexport const useEcoAiRunEnvironmentalSweep = () => {\n const { apiGatewayUrl } = useEcoImpactHub();\n const qc = useQueryClient();\n return useMutation({\n mutationKey: ['ecoimpacthub', 'ai', 'run-environmental-sweep'],\n mutationFn: async (input?: {\n trigger?: string;\n correlationId?: string;\n forceRun?: boolean;\n }) => {\n const result = await ecoQuery<{ ecoAiRunEnvironmentalSweep: EcoAiEnvironmentalSweepResult }>(\n `mutation EcoAiRunEnvironmentalSweep($input: EcoAiRunEnvironmentalSweepInput) {\n ecoAiRunEnvironmentalSweep(input: $input) {\n status workspaceId correlationId trigger agentRunId engine\n creditsUsed maxCreditsPerRun anomalyCount sensorGapCount\n reportGapCount targetDriftCount staleDraftCount overdueHabitatCount\n notificationSent haltedReason ranAt\n findings {\n category severity entityId title detail recommendedAction citationPath\n }\n }\n }`,\n { input: input ?? { trigger: 'interactive', forceRun: true } },\n apiGatewayUrl,\n AI_CALL\n );\n return result.ecoAiRunEnvironmentalSweep;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: ['ecoimpacthub', 'ai', 'loop-settings'] });\n },\n });\n};\n"],"mappings":";;;;;AAgBA,IAAMA,IAAU,EAAE,0BAA0B,GAAK,GAEpCC,KAA2B,MAAiC;CACvE,IAAM,EAAE,qBAAkBC,EAAgB;CAC1C,OAAOC,EAAS;EACd,UAAU;GAAC;GAAgB;GAAM;GAAoBC,KAAY;EAAE;EACnE,SAAS,EAAQA;EACjB,SAAS,aAgBA,MAfcC,EACnB,4bAUA,EAAE,YAAS,GACXC,GACAN,CACF,EAAA,CACc;CAElB,CAAC;AACH,GAEaO,UAAqC;CAChD,IAAM,EAAE,qBAAkBL,EAAgB,GACpCM,IAAKC,EAAe;CAC1B,OAAOC,EAAY;EACjB,aAAa;GAAC;GAAgB;GAAM;EAAyB;EAC7D,YAAY,OAAO,OAiBV,MAhBcL,EACnB,8iBAWA,EAAE,OAAO,EAAE,YAAS,EAAE,GACtBC,GACAN,CACF,EAAA,CACc;EAEhB,YAAY,MAAS;GAGnB,AAFAQ,EAAG,kBAAkB,EAAE,UAAU,CAAC,gBAAgB,SAAS,EAAE,CAAC,GAC9DA,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAgB;IAAUG,EAAK;GAAQ,EAAE,CAAC,GAC5EH,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAgB;IAAM;IAAoBG,EAAK;GAAQ,EAAE,CAAC;EAC9F;CACF,CAAC;AACH,GAEaC,UAA6B;CACxC,IAAM,EAAE,qBAAkBV,EAAgB;CAC1C,OAAOC,EAAS;EACd,UAAU;GAAC;GAAgB;GAAM;EAAe;EAChD,SAAS,aAYA,MAXcE,EACnB,iOAMA,CAAC,GACDC,GACAN,CACF,EAAA,CACc;CAElB,CAAC;AACH,GAEaa,UAAmC;CAC9C,IAAM,EAAE,qBAAkBX,EAAgB,GACpCM,IAAKC,EAAe;CAC1B,OAAOC,EAAY;EACjB,aAAa;GAAC;GAAgB;GAAM;EAAsB;EAC1D,YAAY,OAAO,OAiBV,MAXcL,EACnB,sSAMA,EAAE,SAAM,GACRC,GACAN,CACF,EAAA,CACc;EAEhB,iBAAiB;GACf,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAgB;IAAM;GAAe,EAAE,CAAC;EAC5E;CACF,CAAC;AACH,GAEac,UAAsC;CACjD,IAAM,EAAE,qBAAkBZ,EAAgB,GACpCM,IAAKC,EAAe;CAC1B,OAAOC,EAAY;EACjB,aAAa;GAAC;GAAgB;GAAM;EAAyB;EAC7D,YAAY,OAAO,OAqBV,MAhBcL,EACnB,8iBAWA,EAAE,OAAOU,KAAS;GAAE,SAAS;GAAe,UAAU;EAAK,EAAE,GAC7DT,GACAN,CACF,EAAA,CACc;EAEhB,iBAAiB;GACf,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAgB;IAAM;GAAe,EAAE,CAAC;EAC5E;CACF,CAAC;AACH"}
@@ -101,7 +101,7 @@ var a = {
101
101
  }, o = "\n id workspaceId name contactName contactEmail website notes createdAt updatedAt\n", s = "\n id workspaceId funderId projectId title referenceCode amount currency status\n startDate endDate description portalEnabled portalEnabledAt portalLastAccessedAt\n portalAccessCount createdAt updatedAt\n", c = "\n id workspaceId grantId title description amount dueDate achievedAt status reportId\n createdAt updatedAt\n", l = {
102
102
  limit: 50,
103
103
  offset: 0
104
- }, u = "\n id workspaceId name code type status description latitude longitude\n areaHectares country region createdAt updatedAt\n", d = "\n id workspaceId siteId name kind status hardwareId unit lastReadingAt installedAt\n createdAt updatedAt\n", f = "\n id workspaceId siteId sensorId parameter value unit source recordedAt isBreach notes\n createdAt updatedAt\n", p = "\n id workspaceId siteId parameter direction severity limitValue minValue maxValue unit\n isActive createdAt updatedAt\n", m = "\n id workspaceId commonName scientificName taxonGroup conservationStatus isPriority\n description createdAt updatedAt\n", h = "\n id workspaceId speciesId siteId method count observedAt latitude longitude observerId\n notes evidence { id } createdAt updatedAt\n", g = "\n id workspaceId name status description siteId targetHectares budgetAmount currency\n managerId startDate endDate completedAt createdAt updatedAt\n", _ = "\n id workspaceId projectId type summary details quantity unit performedAt createdAt updatedAt\n", v = "\n id workspaceId name scope activityUnit factorKgco2e source validYear isActive\n createdAt updatedAt\n", y = "\n id workspaceId siteId factorId scope status category activityValue activityUnit co2eKg\n periodStart notes agentRunId aiRationale aiProvenance createdAt updatedAt\n", b = "\n id workspaceId name status metric baselineYear baselineValue targetYear targetValue unit\n description createdAt updatedAt\n", x = "\n id workspaceId title framework status periodStart periodEnd summary publishedAt\n workflowRunId approvedBy approvedAt rejectedAt rejectionReason\n file { id } createdAt updatedAt\n", S = "\n id workspaceId reportId carbonEntryId label value unit category createdAt updatedAt\n", C = "\n id workspaceId code name standardBody version status description effectiveDate createdAt updatedAt\n", w = "\n id workspaceId methodologyId projectId vintageYear estimatedTco2e issuedTco2e retiredTco2e\n status issuanceDate createdAt updatedAt\n", T = "\n id workspaceId vintageId serialNumber quantityTco2e remainingTco2e ownerAccount status\n issuedAt createdAt updatedAt\n", E = "\n id workspaceId creditId quantityTco2e reason beneficiaryName retiredAt createdAt updatedAt\n", D = "\n id workspaceId siteId name category unit description isActive createdAt updatedAt\n", O = "\n id workspaceId streamId route quantity periodStart periodEnd notes createdAt updatedAt\n", ee = "\n buckets {\n unit totalQuantity landfilledQuantity recycledQuantity compostedQuantity\n recoveredQuantity reusedQuantity otherQuantity divertedQuantity diversionRate\n }\n recordCount\n", k = "\n id workspaceId name material unit description targetCircularityPct isActive createdAt updatedAt\n", A = "\n id workspaceId loopId stage quantity periodStart notes createdAt updatedAt\n", te = "\n loopId inputQuantity useQuantity recoveryQuantity reuseQuantity circularityRate targetCircularityPct\n", j = "\n id workspaceId metricKey metricName category unit periodStart periodEnd\n value target trend sourceProduct sourceRefId notes createdAt updatedAt\n", ne = "\n metricKey metricName category unit periodStart periodEnd\n totalValue target trend entryCount sourceCount sourceProducts\n", M = "\n id workspaceId title framework authority siteId status recurrence dueAt fulfilledAt\n description notes createdAt updatedAt\n", N = "\n id workspaceId obligationId siteId title permitNumber issuingAuthority status\n submittedAt approvedAt expiresAt notes createdAt updatedAt\n", P = "\n id workspaceId obligationId title dueAt remindAt remindedAt completedAt canceledAt\n notes createdAt updatedAt\n", re = (n = {}) => {
104
+ }, u = "\n id workspaceId name code type status description latitude longitude\n areaHectares country region createdAt updatedAt\n", d = "\n id workspaceId siteId name kind status hardwareId unit lastReadingAt installedAt\n createdAt updatedAt\n", f = "\n id workspaceId siteId sensorId parameter value unit source recordedAt isBreach notes\n createdAt updatedAt\n", p = "\n id workspaceId siteId parameter direction severity limitValue minValue maxValue unit\n isActive createdAt updatedAt\n", m = "\n id workspaceId commonName scientificName taxonGroup conservationStatus isPriority\n description createdAt updatedAt\n", h = "\n id workspaceId speciesId siteId method count observedAt latitude longitude observerId\n notes evidence { id } createdAt updatedAt\n", g = "\n id workspaceId name status description siteId targetHectares budgetAmount currency\n managerId startDate endDate completedAt createdAt updatedAt\n", _ = "\n id workspaceId projectId type summary details quantity unit performedAt createdAt updatedAt\n", v = "\n id workspaceId name scope activityUnit factorKgco2e source validYear isActive\n createdAt updatedAt\n", y = "\n id workspaceId siteId factorId scope status category activityValue activityUnit co2eKg\n periodStart notes agentRunId aiRationale aiProvenance createdAt updatedAt\n", b = "\n id workspaceId name status metric baselineYear baselineValue targetYear targetValue unit\n description createdAt updatedAt\n", x = "\n id workspaceId title framework status periodStart periodEnd summary publishedAt\n workflowRunId approvedBy approvedAt rejectedAt rejectionReason\n file { id } createdAt updatedAt\n", S = "\n id workspaceId reportId carbonEntryId sourceMeasurementId sourceMetricId\n disclosureCode label value unit category aiDrafted agentRunId aiRationale\n createdAt updatedAt\n", C = "\n id workspaceId code name standardBody version status description effectiveDate createdAt updatedAt\n", w = "\n id workspaceId methodologyId projectId vintageYear estimatedTco2e issuedTco2e retiredTco2e\n status issuanceDate createdAt updatedAt\n", T = "\n id workspaceId vintageId serialNumber quantityTco2e remainingTco2e ownerAccount status\n issuedAt createdAt updatedAt\n", E = "\n id workspaceId creditId quantityTco2e reason beneficiaryName retiredAt createdAt updatedAt\n", D = "\n id workspaceId siteId name category unit description isActive createdAt updatedAt\n", O = "\n id workspaceId streamId route quantity periodStart periodEnd notes createdAt updatedAt\n", ee = "\n buckets {\n unit totalQuantity landfilledQuantity recycledQuantity compostedQuantity\n recoveredQuantity reusedQuantity otherQuantity divertedQuantity diversionRate\n }\n recordCount\n", k = "\n id workspaceId name material unit description targetCircularityPct isActive createdAt updatedAt\n", A = "\n id workspaceId loopId stage quantity periodStart notes createdAt updatedAt\n", te = "\n loopId inputQuantity useQuantity recoveryQuantity reuseQuantity circularityRate targetCircularityPct\n", j = "\n id workspaceId metricKey metricName category unit periodStart periodEnd\n value target trend sourceProduct sourceRefId notes createdAt updatedAt\n", ne = "\n metricKey metricName category unit periodStart periodEnd\n totalValue target trend entryCount sourceCount sourceProducts\n", M = "\n id workspaceId title framework authority siteId status recurrence dueAt fulfilledAt\n description notes createdAt updatedAt\n", N = "\n id workspaceId obligationId siteId title permitNumber issuingAuthority status\n submittedAt approvedAt expiresAt notes createdAt updatedAt\n", P = "\n id workspaceId obligationId title dueAt remindAt remindedAt completedAt canceledAt\n notes createdAt updatedAt\n", re = (n = {}) => {
105
105
  let { apiGatewayUrl: i } = e();
106
106
  return r({
107
107
  queryKey: [...a.sites, n],