@burdenoff/microfe-theglobalfuel 2026.509.101

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 (112) hide show
  1. package/README.md +12 -0
  2. package/dist/dev/main.d.ts +2 -0
  3. package/dist/dev/main.d.ts.map +1 -0
  4. package/dist/generated/global-operations.d.ts +2 -0
  5. package/dist/generated/global-operations.d.ts.map +1 -0
  6. package/dist/generated/global-types.d.ts +18199 -0
  7. package/dist/generated/global-types.d.ts.map +1 -0
  8. package/dist/generated/wspace-operations.d.ts +2 -0
  9. package/dist/generated/wspace-operations.d.ts.map +1 -0
  10. package/dist/generated/wspace-types.d.ts +43046 -0
  11. package/dist/generated/wspace-types.d.ts.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +5 -0
  15. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  16. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  17. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  18. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  19. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
  20. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
  21. package/dist/theglobalfuel/TheGlobalFuelRoot.js +175 -0
  22. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -0
  23. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +2 -0
  24. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
  25. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +91 -0
  26. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -0
  27. package/dist/theglobalfuel/index.d.ts +5 -0
  28. package/dist/theglobalfuel/index.d.ts.map +1 -0
  29. package/dist/theglobalfuel/index.js +3 -0
  30. package/dist/theglobalfuel/pages/AiIntelligencePage.d.ts +2 -0
  31. package/dist/theglobalfuel/pages/AiIntelligencePage.d.ts.map +1 -0
  32. package/dist/theglobalfuel/pages/AiIntelligencePage.js +190 -0
  33. package/dist/theglobalfuel/pages/AiIntelligencePage.js.map +1 -0
  34. package/dist/theglobalfuel/pages/AnalyticsPage.d.ts +2 -0
  35. package/dist/theglobalfuel/pages/AnalyticsPage.d.ts.map +1 -0
  36. package/dist/theglobalfuel/pages/AnalyticsPage.js +241 -0
  37. package/dist/theglobalfuel/pages/AnalyticsPage.js.map +1 -0
  38. package/dist/theglobalfuel/pages/CompliancePage.d.ts +2 -0
  39. package/dist/theglobalfuel/pages/CompliancePage.d.ts.map +1 -0
  40. package/dist/theglobalfuel/pages/CompliancePage.js +173 -0
  41. package/dist/theglobalfuel/pages/CompliancePage.js.map +1 -0
  42. package/dist/theglobalfuel/pages/DashboardPage.d.ts +2 -0
  43. package/dist/theglobalfuel/pages/DashboardPage.d.ts.map +1 -0
  44. package/dist/theglobalfuel/pages/DashboardPage.js +145 -0
  45. package/dist/theglobalfuel/pages/DashboardPage.js.map +1 -0
  46. package/dist/theglobalfuel/pages/FinancialPage.d.ts +2 -0
  47. package/dist/theglobalfuel/pages/FinancialPage.d.ts.map +1 -0
  48. package/dist/theglobalfuel/pages/FinancialPage.js +204 -0
  49. package/dist/theglobalfuel/pages/FinancialPage.js.map +1 -0
  50. package/dist/theglobalfuel/pages/FleetManagementPage.d.ts +2 -0
  51. package/dist/theglobalfuel/pages/FleetManagementPage.d.ts.map +1 -0
  52. package/dist/theglobalfuel/pages/FleetManagementPage.js +244 -0
  53. package/dist/theglobalfuel/pages/FleetManagementPage.js.map +1 -0
  54. package/dist/theglobalfuel/pages/MarketplacePage.d.ts +2 -0
  55. package/dist/theglobalfuel/pages/MarketplacePage.d.ts.map +1 -0
  56. package/dist/theglobalfuel/pages/MarketplacePage.js +260 -0
  57. package/dist/theglobalfuel/pages/MarketplacePage.js.map +1 -0
  58. package/dist/theglobalfuel/pages/OperationsPage.d.ts +2 -0
  59. package/dist/theglobalfuel/pages/OperationsPage.d.ts.map +1 -0
  60. package/dist/theglobalfuel/pages/OperationsPage.js +190 -0
  61. package/dist/theglobalfuel/pages/OperationsPage.js.map +1 -0
  62. package/dist/theglobalfuel/pages/QualityControlPage.d.ts +2 -0
  63. package/dist/theglobalfuel/pages/QualityControlPage.d.ts.map +1 -0
  64. package/dist/theglobalfuel/pages/QualityControlPage.js +215 -0
  65. package/dist/theglobalfuel/pages/QualityControlPage.js.map +1 -0
  66. package/dist/theglobalfuel/pages/ReportsPage.d.ts +2 -0
  67. package/dist/theglobalfuel/pages/ReportsPage.d.ts.map +1 -0
  68. package/dist/theglobalfuel/pages/ReportsPage.js +247 -0
  69. package/dist/theglobalfuel/pages/ReportsPage.js.map +1 -0
  70. package/dist/theglobalfuel/pages/ResourcesPage.d.ts +2 -0
  71. package/dist/theglobalfuel/pages/ResourcesPage.d.ts.map +1 -0
  72. package/dist/theglobalfuel/pages/ResourcesPage.js +225 -0
  73. package/dist/theglobalfuel/pages/ResourcesPage.js.map +1 -0
  74. package/dist/theglobalfuel/pages/RiskManagementPage.d.ts +2 -0
  75. package/dist/theglobalfuel/pages/RiskManagementPage.d.ts.map +1 -0
  76. package/dist/theglobalfuel/pages/RiskManagementPage.js +230 -0
  77. package/dist/theglobalfuel/pages/RiskManagementPage.js.map +1 -0
  78. package/dist/theglobalfuel/pages/SupplyChainPage.d.ts +2 -0
  79. package/dist/theglobalfuel/pages/SupplyChainPage.d.ts.map +1 -0
  80. package/dist/theglobalfuel/pages/SupplyChainPage.js +214 -0
  81. package/dist/theglobalfuel/pages/SupplyChainPage.js.map +1 -0
  82. package/dist/theglobalfuel/pages/SustainabilityPage.d.ts +2 -0
  83. package/dist/theglobalfuel/pages/SustainabilityPage.d.ts.map +1 -0
  84. package/dist/theglobalfuel/pages/SustainabilityPage.js +261 -0
  85. package/dist/theglobalfuel/pages/SustainabilityPage.js.map +1 -0
  86. package/dist/theglobalfuel/pages/TrainingPage.d.ts +2 -0
  87. package/dist/theglobalfuel/pages/TrainingPage.d.ts.map +1 -0
  88. package/dist/theglobalfuel/pages/TrainingPage.js +253 -0
  89. package/dist/theglobalfuel/pages/TrainingPage.js.map +1 -0
  90. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.d.ts +6 -0
  91. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.d.ts.map +1 -0
  92. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js +27 -0
  93. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js.map +1 -0
  94. package/dist/theglobalfuel/store/theglobalfuelStore.d.ts +163 -0
  95. package/dist/theglobalfuel/store/theglobalfuelStore.d.ts.map +1 -0
  96. package/dist/theglobalfuel/store/theglobalfuelStore.js +712 -0
  97. package/dist/theglobalfuel/store/theglobalfuelStore.js.map +1 -0
  98. package/dist/theglobalfuel/types/index.d.ts +51 -0
  99. package/dist/theglobalfuel/types/index.d.ts.map +1 -0
  100. package/dist/theglobalfuel/utils/cn.d.ts +4 -0
  101. package/dist/theglobalfuel/utils/cn.d.ts.map +1 -0
  102. package/dist/theglobalfuel/utils/cn.js +10 -0
  103. package/dist/theglobalfuel/utils/cn.js.map +1 -0
  104. package/dist/theglobalfuel/utils/i18n.d.ts +6 -0
  105. package/dist/theglobalfuel/utils/i18n.d.ts.map +1 -0
  106. package/dist/theglobalfuel/utils/i18n.js +15 -0
  107. package/dist/theglobalfuel/utils/i18n.js.map +1 -0
  108. package/dist/theglobalfuel/utils/navigation.d.ts +2 -0
  109. package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
  110. package/dist/theglobalfuel/utils/navigation.js +8 -0
  111. package/dist/theglobalfuel/utils/navigation.js.map +1 -0
  112. package/package.json +107 -0
@@ -0,0 +1,261 @@
1
+ import { useTheGlobalFuelStore as e } from "../store/theglobalfuelStore.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { Award as n, Download as r, Droplets as i, Factory as a, Flame as o, Leaf as s, Recycle as c, TrendingDown as l, TrendingUp as u } from "lucide-react";
4
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v } from "@burdenoff/fe-libs/ui";
6
+ //#region src/theglobalfuel/pages/SustainabilityPage.tsx
7
+ function y() {
8
+ let { sustainability: y } = e(), b = y.scope1 + y.scope2 + y.scope3, x = [
9
+ {
10
+ title: "Net Zero by 2050",
11
+ target: "100% reduction",
12
+ progress: 18,
13
+ status: "on-track"
14
+ },
15
+ {
16
+ title: "Flare Gas Elimination",
17
+ target: "95% reduction",
18
+ progress: y.flareReductionPct,
19
+ status: "on-track"
20
+ },
21
+ {
22
+ title: "Methane Reduction",
23
+ target: "75% reduction",
24
+ progress: 52,
25
+ status: "ahead"
26
+ },
27
+ {
28
+ title: "Water Recycling",
29
+ target: "90% recycled",
30
+ progress: 68,
31
+ status: "at-risk"
32
+ }
33
+ ];
34
+ return /* @__PURE__ */ f("div", {
35
+ className: "space-y-6 p-6",
36
+ children: [
37
+ /* @__PURE__ */ f("div", {
38
+ className: "flex items-center justify-between",
39
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
40
+ className: "flex items-center gap-2 text-2xl font-semibold",
41
+ children: [/* @__PURE__ */ d(s, { className: "h-7 w-7 text-green-600" }), "Sustainability & ESG"]
42
+ }), /* @__PURE__ */ d("p", {
43
+ className: "mt-1 text-sm text-muted-foreground",
44
+ children: "Environmental metrics, carbon emissions, and ESG compliance for petroleum operations"
45
+ })] }), /* @__PURE__ */ f(m, { children: [/* @__PURE__ */ d(r, { className: "mr-2 h-4 w-4" }), "Export ESG Report"] })]
46
+ }),
47
+ /* @__PURE__ */ f("div", {
48
+ className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
49
+ children: [
50
+ /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ f(_, {
51
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
52
+ children: [/* @__PURE__ */ d(v, {
53
+ className: "text-sm font-medium",
54
+ children: "ESG Score"
55
+ }), /* @__PURE__ */ d(n, { className: "h-4 w-4 text-green-600" })]
56
+ }), /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ f("div", {
57
+ className: "text-2xl font-bold",
58
+ children: [
59
+ y.esgScore,
60
+ " ",
61
+ /* @__PURE__ */ f("span", {
62
+ className: "text-sm text-green-600",
63
+ children: [
64
+ "(",
65
+ y.esgRating,
66
+ ")"
67
+ ]
68
+ })
69
+ ]
70
+ }), /* @__PURE__ */ f("p", {
71
+ className: "flex items-center text-xs text-green-600",
72
+ children: [/* @__PURE__ */ d(u, { className: "mr-1 h-3 w-3" }), "+5.2% vs last year"]
73
+ })] })] }),
74
+ /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ f(_, {
75
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
76
+ children: [/* @__PURE__ */ d(v, {
77
+ className: "text-sm font-medium",
78
+ children: "Carbon Emissions"
79
+ }), /* @__PURE__ */ d(a, { className: "h-4 w-4 text-gray-600" })]
80
+ }), /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ f("div", {
81
+ className: "text-2xl font-bold",
82
+ children: [(y.carbonEmissionsMTCO2e / 1e3).toFixed(0), "K MT CO2e"]
83
+ }), /* @__PURE__ */ f("p", {
84
+ className: "flex items-center text-xs text-green-600",
85
+ children: [
86
+ /* @__PURE__ */ d(l, { className: "mr-1 h-3 w-3" }),
87
+ y.carbonChange,
88
+ "%"
89
+ ]
90
+ })] })] }),
91
+ /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ f(_, {
92
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
93
+ children: [/* @__PURE__ */ d(v, {
94
+ className: "text-sm font-medium",
95
+ children: "Flare Reduction"
96
+ }), /* @__PURE__ */ d(o, { className: "h-4 w-4 text-orange-600" })]
97
+ }), /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ f("div", {
98
+ className: "text-2xl font-bold",
99
+ children: [y.flareReductionPct, "%"]
100
+ }), /* @__PURE__ */ d("p", {
101
+ className: "text-xs text-muted-foreground",
102
+ children: "Toward zero routine flaring"
103
+ })] })] }),
104
+ /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ f(_, {
105
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
106
+ children: [/* @__PURE__ */ d(v, {
107
+ className: "text-sm font-medium",
108
+ children: "Waste Recycled"
109
+ }), /* @__PURE__ */ d(c, { className: "h-4 w-4 text-blue-600" })]
110
+ }), /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ f("div", {
111
+ className: "text-2xl font-bold",
112
+ children: [y.wasteRecycledPct, "%"]
113
+ }), /* @__PURE__ */ d("p", {
114
+ className: "text-xs text-muted-foreground",
115
+ children: "Of total waste"
116
+ })] })] })
117
+ ]
118
+ }),
119
+ /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ d(_, { children: /* @__PURE__ */ d(v, { children: "Carbon Emissions by Scope" }) }), /* @__PURE__ */ d(g, {
120
+ className: "space-y-4",
121
+ children: [
122
+ {
123
+ label: "Scope 1 - Direct (Flaring, Combustion)",
124
+ value: y.scope1
125
+ },
126
+ {
127
+ label: "Scope 2 - Energy Indirect",
128
+ value: y.scope2
129
+ },
130
+ {
131
+ label: "Scope 3 - Value Chain",
132
+ value: y.scope3
133
+ }
134
+ ].map((e) => {
135
+ let t = (e.value / b * 100).toFixed(1);
136
+ return /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
137
+ className: "mb-1 flex justify-between text-sm",
138
+ children: [/* @__PURE__ */ d("span", { children: e.label }), /* @__PURE__ */ f("span", {
139
+ className: "font-medium",
140
+ children: [
141
+ (e.value / 1e3).toFixed(0),
142
+ "K MT (",
143
+ t,
144
+ "%)"
145
+ ]
146
+ })]
147
+ }), /* @__PURE__ */ d("div", {
148
+ className: "h-3 w-full rounded-full bg-muted",
149
+ children: /* @__PURE__ */ d("div", {
150
+ className: "h-3 rounded-full bg-green-500",
151
+ style: { width: `${t}%` }
152
+ })
153
+ })] }, e.label);
154
+ })
155
+ })] }),
156
+ /* @__PURE__ */ d("div", {
157
+ className: "grid gap-4 md:grid-cols-2",
158
+ children: x.map((e) => /* @__PURE__ */ d(h, { children: /* @__PURE__ */ f(g, {
159
+ className: "pt-6",
160
+ children: [
161
+ /* @__PURE__ */ f("div", {
162
+ className: "mb-3 flex items-start justify-between",
163
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h4", {
164
+ className: "font-semibold",
165
+ children: e.title
166
+ }), /* @__PURE__ */ f("p", {
167
+ className: "text-sm text-muted-foreground",
168
+ children: ["Target: ", e.target]
169
+ })] }), /* @__PURE__ */ d(p, {
170
+ variant: "outline",
171
+ className: t(e.status === "on-track" && "text-blue-600", e.status === "ahead" && "text-green-600", e.status === "at-risk" && "text-orange-600"),
172
+ children: e.status.replace("-", " ")
173
+ })]
174
+ }),
175
+ /* @__PURE__ */ f("div", {
176
+ className: "mb-1 flex justify-between text-sm",
177
+ children: [/* @__PURE__ */ d("span", {
178
+ className: "text-muted-foreground",
179
+ children: "Progress"
180
+ }), /* @__PURE__ */ f("span", {
181
+ className: "font-medium",
182
+ children: [e.progress, "%"]
183
+ })]
184
+ }),
185
+ /* @__PURE__ */ d("div", {
186
+ className: "h-2 w-full rounded-full bg-muted",
187
+ children: /* @__PURE__ */ d("div", {
188
+ className: t("h-2 rounded-full", e.status === "ahead" && "bg-green-500", e.status === "on-track" && "bg-blue-500", e.status === "at-risk" && "bg-orange-500"),
189
+ style: { width: `${e.progress}%` }
190
+ })
191
+ })
192
+ ]
193
+ }) }, e.title))
194
+ }),
195
+ /* @__PURE__ */ f("div", {
196
+ className: "grid gap-4 lg:grid-cols-2",
197
+ children: [/* @__PURE__ */ f(h, { children: [/* @__PURE__ */ d(_, { children: /* @__PURE__ */ f(v, {
198
+ className: "flex items-center gap-2",
199
+ children: [/* @__PURE__ */ d(i, { className: "h-5 w-5 text-blue-500" }), "Water"]
200
+ }) }), /* @__PURE__ */ d(g, {
201
+ className: "space-y-3",
202
+ children: [
203
+ {
204
+ l: "Total Consumption",
205
+ v: `${(y.waterConsumptionM3 / 1e6).toFixed(1)}M m3`
206
+ },
207
+ {
208
+ l: "Produced Water Recycled",
209
+ v: "68%"
210
+ },
211
+ {
212
+ l: "Water Intensity",
213
+ v: "1.2 m3/bbl"
214
+ }
215
+ ].map((e) => /* @__PURE__ */ f("div", {
216
+ className: "flex justify-between",
217
+ children: [/* @__PURE__ */ d("span", {
218
+ className: "text-sm",
219
+ children: e.l
220
+ }), /* @__PURE__ */ d("span", {
221
+ className: "text-sm font-medium",
222
+ children: e.v
223
+ })]
224
+ }, e.l))
225
+ })] }), /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ d(_, { children: /* @__PURE__ */ f(v, {
226
+ className: "flex items-center gap-2",
227
+ children: [/* @__PURE__ */ d(c, { className: "h-5 w-5 text-orange-500" }), "Waste"]
228
+ }) }), /* @__PURE__ */ d(g, {
229
+ className: "space-y-3",
230
+ children: [
231
+ {
232
+ l: "Total Waste",
233
+ v: "12,400 MT"
234
+ },
235
+ {
236
+ l: "Recycling Rate",
237
+ v: `${y.wasteRecycledPct}%`
238
+ },
239
+ {
240
+ l: "Hazardous",
241
+ v: "850 MT (-12.3%)"
242
+ }
243
+ ].map((e) => /* @__PURE__ */ f("div", {
244
+ className: "flex justify-between",
245
+ children: [/* @__PURE__ */ d("span", {
246
+ className: "text-sm",
247
+ children: e.l
248
+ }), /* @__PURE__ */ d("span", {
249
+ className: "text-sm font-medium",
250
+ children: e.v
251
+ })]
252
+ }, e.l))
253
+ })] })]
254
+ })
255
+ ]
256
+ });
257
+ }
258
+ //#endregion
259
+ export { y as SustainabilityPage };
260
+
261
+ //# sourceMappingURL=SustainabilityPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SustainabilityPage.js","names":[],"sources":["../../../src/theglobalfuel/pages/SustainabilityPage.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport {\n Leaf,\n Factory,\n Droplets,\n Recycle,\n Flame,\n Award,\n TrendingDown,\n TrendingUp,\n Download,\n} from 'lucide-react';\nimport { useTheGlobalFuelStore } from '../store/theglobalfuelStore';\nimport { cn } from '../utils/cn';\n\nexport function SustainabilityPage() {\n const { sustainability } = useTheGlobalFuelStore();\n const totalEmissions = sustainability.scope1 + sustainability.scope2 + sustainability.scope3;\n\n const goals = [\n {\n title: 'Net Zero by 2050',\n target: '100% reduction',\n progress: 18,\n status: 'on-track' as const,\n },\n {\n title: 'Flare Gas Elimination',\n target: '95% reduction',\n progress: sustainability.flareReductionPct,\n status: 'on-track' as const,\n },\n { title: 'Methane Reduction', target: '75% reduction', progress: 52, status: 'ahead' as const },\n { title: 'Water Recycling', target: '90% recycled', progress: 68, status: 'at-risk' as const },\n ];\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <Leaf className=\"h-7 w-7 text-green-600\" />\n Sustainability &amp; ESG\n </h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Environmental metrics, carbon emissions, and ESG compliance for petroleum operations\n </p>\n </div>\n <Button>\n <Download className=\"mr-2 h-4 w-4\" />\n Export ESG Report\n </Button>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">ESG Score</CardTitle>\n <Award className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">\n {sustainability.esgScore}{' '}\n <span className=\"text-sm text-green-600\">({sustainability.esgRating})</span>\n </div>\n <p className=\"flex items-center text-xs text-green-600\">\n <TrendingUp className=\"mr-1 h-3 w-3\" />\n +5.2% vs last year\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Carbon Emissions</CardTitle>\n <Factory className=\"h-4 w-4 text-gray-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">\n {(sustainability.carbonEmissionsMTCO2e / 1000).toFixed(0)}K MT CO2e\n </div>\n <p className=\"flex items-center text-xs text-green-600\">\n <TrendingDown className=\"mr-1 h-3 w-3\" />\n {sustainability.carbonChange}%\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Flare Reduction</CardTitle>\n <Flame className=\"h-4 w-4 text-orange-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{sustainability.flareReductionPct}%</div>\n <p className=\"text-xs text-muted-foreground\">Toward zero routine flaring</p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Waste Recycled</CardTitle>\n <Recycle className=\"h-4 w-4 text-blue-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{sustainability.wasteRecycledPct}%</div>\n <p className=\"text-xs text-muted-foreground\">Of total waste</p>\n </CardContent>\n </Card>\n </div>\n <Card>\n <CardHeader>\n <CardTitle>Carbon Emissions by Scope</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {[\n { label: 'Scope 1 - Direct (Flaring, Combustion)', value: sustainability.scope1 },\n { label: 'Scope 2 - Energy Indirect', value: sustainability.scope2 },\n { label: 'Scope 3 - Value Chain', value: sustainability.scope3 },\n ].map((s) => {\n const pct = ((s.value / totalEmissions) * 100).toFixed(1);\n return (\n <div key={s.label}>\n <div className=\"mb-1 flex justify-between text-sm\">\n <span>{s.label}</span>\n <span className=\"font-medium\">\n {(s.value / 1000).toFixed(0)}K MT ({pct}%)\n </span>\n </div>\n <div className=\"h-3 w-full rounded-full bg-muted\">\n <div className=\"h-3 rounded-full bg-green-500\" style={{ width: `${pct}%` }} />\n </div>\n </div>\n );\n })}\n </CardContent>\n </Card>\n <div className=\"grid gap-4 md:grid-cols-2\">\n {goals.map((g) => (\n <Card key={g.title}>\n <CardContent className=\"pt-6\">\n <div className=\"mb-3 flex items-start justify-between\">\n <div>\n <h4 className=\"font-semibold\">{g.title}</h4>\n <p className=\"text-sm text-muted-foreground\">Target: {g.target}</p>\n </div>\n <Badge\n variant=\"outline\"\n className={cn(\n g.status === 'on-track' && 'text-blue-600',\n g.status === 'ahead' && 'text-green-600',\n g.status === 'at-risk' && 'text-orange-600'\n )}\n >\n {g.status.replace('-', ' ')}\n </Badge>\n </div>\n <div className=\"mb-1 flex justify-between text-sm\">\n <span className=\"text-muted-foreground\">Progress</span>\n <span className=\"font-medium\">{g.progress}%</span>\n </div>\n <div className=\"h-2 w-full rounded-full bg-muted\">\n <div\n className={cn(\n 'h-2 rounded-full',\n g.status === 'ahead' && 'bg-green-500',\n g.status === 'on-track' && 'bg-blue-500',\n g.status === 'at-risk' && 'bg-orange-500'\n )}\n style={{ width: `${g.progress}%` }}\n />\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Droplets className=\"h-5 w-5 text-blue-500\" />\n Water\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {[\n {\n l: 'Total Consumption',\n v: `${(sustainability.waterConsumptionM3 / 1e6).toFixed(1)}M m3`,\n },\n { l: 'Produced Water Recycled', v: '68%' },\n { l: 'Water Intensity', v: '1.2 m3/bbl' },\n ].map((r) => (\n <div key={r.l} className=\"flex justify-between\">\n <span className=\"text-sm\">{r.l}</span>\n <span className=\"text-sm font-medium\">{r.v}</span>\n </div>\n ))}\n </CardContent>\n </Card>\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Recycle className=\"h-5 w-5 text-orange-500\" />\n Waste\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {[\n { l: 'Total Waste', v: '12,400 MT' },\n { l: 'Recycling Rate', v: `${sustainability.wasteRecycledPct}%` },\n { l: 'Hazardous', v: '850 MT (-12.3%)' },\n ].map((r) => (\n <div key={r.l} className=\"flex justify-between\">\n <span className=\"text-sm\">{r.l}</span>\n <span className=\"text-sm font-medium\">{r.v}</span>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAeA,SAAgB,IAAqB;CACnC,IAAM,EAAE,sBAAmB,GAAuB,EAC5C,IAAiB,EAAe,SAAS,EAAe,SAAS,EAAe,QAEhF,IAAQ;EACZ;GACE,OAAO;GACP,QAAQ;GACR,UAAU;GACV,QAAQ;GACT;EACD;GACE,OAAO;GACP,QAAQ;GACR,UAAU,EAAe;GACzB,QAAQ;GACT;EACD;GAAE,OAAO;GAAqB,QAAQ;GAAiB,UAAU;GAAI,QAAQ;GAAkB;EAC/F;GAAE,OAAO;GAAmB,QAAQ;GAAgB,UAAU;GAAI,QAAQ;GAAoB;EAC/F;AAED,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eAAd,CACE,kBAAC,GAAD,EAAM,WAAU,0BAA2B,CAAA,EAAA,uBAExC;QACL,kBAAC,KAAD;KAAG,WAAU;eAAqC;KAE9C,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAU,WAAU,gBAAiB,CAAA,EAAA,oBAE9B,EAAA,CAAA,CACL;;GACN,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAY,WAAU;gBAAtB,CACE,kBAAC,GAAD;OAAW,WAAU;iBAAsB;O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AE;OAAS,CAAA,EACtC,kBAAC,QAAD;OAAM,WAAU;iBAAuB,EAAE;OAAS,CAAA,CAC9C;QAHI,EAAE,EAGN,CACN;KACU,CAAA,CACT,EAAA,CAAA,EACP,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;KAAW,WAAU;eAArB,CACE,kBAAC,GAAD,EAAS,WAAU,2BAA4B,CAAA,EAAA,QAErC;QACD,CAAA,EACb,kBAAC,GAAD;KAAa,WAAU;eACpB;MACC;OAAE,GAAG;OAAe,GAAG;OAAa;MACpC;OAAE,GAAG;OAAkB,GAAG,GAAG,EAAe,iBAAiB;OAAI;MACjE;OAAE,GAAG;OAAa,GAAG;OAAmB;MACzC,CAAC,KAAK,MACL,kBAAC,OAAD;MAAe,WAAU;gBAAzB,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAW,EAAE;OAAS,CAAA,EACtC,kBAAC,QAAD;OAAM,WAAU;iBAAuB,EAAE;OAAS,CAAA,CAC9C;QAHI,EAAE,EAGN,CACN;KACU,CAAA,CACT,EAAA,CAAA,CACH;;GACF"}
@@ -0,0 +1,2 @@
1
+ export declare function TrainingPage(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=TrainingPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrainingPage.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/pages/TrainingPage.tsx"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,4CA0L3B"}
@@ -0,0 +1,253 @@
1
+ import { useTheGlobalFuelStore as e } from "../store/theglobalfuelStore.js";
2
+ import { Award as t, BookOpen as n, Clock as r, GraduationCap as i, TrendingUp as a, Users as o } from "lucide-react";
3
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Tabs as h, TabsContent as g, TabsList as _, TabsTrigger as v } from "@burdenoff/fe-libs/ui";
5
+ //#region src/theglobalfuel/pages/TrainingPage.tsx
6
+ function y() {
7
+ let { training: y } = e(), b = (y.reduce((e, t) => e + t.completionRate, 0) / y.length).toFixed(0), x = y.reduce((e, t) => e + t.enrolled, 0);
8
+ return /* @__PURE__ */ c("div", {
9
+ className: "space-y-6 p-6",
10
+ children: [
11
+ /* @__PURE__ */ c("div", {
12
+ className: "flex items-center justify-between",
13
+ children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("h1", {
14
+ className: "flex items-center gap-2 text-2xl font-semibold",
15
+ children: [/* @__PURE__ */ s(i, { className: "h-7 w-7 text-purple-600" }), "Training & Development"]
16
+ }), /* @__PURE__ */ s("p", {
17
+ className: "mt-1 text-sm text-muted-foreground",
18
+ children: "H2S safety, pipeline integrity, refinery operations, and compliance training"
19
+ })] }), /* @__PURE__ */ c(u, { children: [/* @__PURE__ */ s(n, { className: "mr-2 h-4 w-4" }), "Create Course"] })]
20
+ }),
21
+ /* @__PURE__ */ c("div", {
22
+ className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
23
+ children: [
24
+ /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ c(p, {
25
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
26
+ children: [/* @__PURE__ */ s(m, {
27
+ className: "text-sm font-medium",
28
+ children: "Active Trainees"
29
+ }), /* @__PURE__ */ s(o, { className: "h-4 w-4 text-blue-600" })]
30
+ }), /* @__PURE__ */ c(f, { children: [/* @__PURE__ */ s("div", {
31
+ className: "text-2xl font-bold",
32
+ children: x
33
+ }), /* @__PURE__ */ c("p", {
34
+ className: "text-xs text-muted-foreground",
35
+ children: [
36
+ "Across ",
37
+ y.length,
38
+ " programs"
39
+ ]
40
+ })] })] }),
41
+ /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ c(p, {
42
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
43
+ children: [/* @__PURE__ */ s(m, {
44
+ className: "text-sm font-medium",
45
+ children: "Completion Rate"
46
+ }), /* @__PURE__ */ s(a, { className: "h-4 w-4 text-green-600" })]
47
+ }), /* @__PURE__ */ c(f, { children: [/* @__PURE__ */ c("div", {
48
+ className: "text-2xl font-bold",
49
+ children: [b, "%"]
50
+ }), /* @__PURE__ */ s("p", {
51
+ className: "text-xs text-muted-foreground",
52
+ children: "+3.2% from last quarter"
53
+ })] })] }),
54
+ /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ c(p, {
55
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
56
+ children: [/* @__PURE__ */ s(m, {
57
+ className: "text-sm font-medium",
58
+ children: "Programs"
59
+ }), /* @__PURE__ */ s(n, { className: "h-4 w-4 text-purple-600" })]
60
+ }), /* @__PURE__ */ c(f, { children: [/* @__PURE__ */ s("div", {
61
+ className: "text-2xl font-bold",
62
+ children: y.length
63
+ }), /* @__PURE__ */ c("p", {
64
+ className: "text-xs text-muted-foreground",
65
+ children: [y.filter((e) => e.level === "required").length, " required"]
66
+ })] })] }),
67
+ /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ c(p, {
68
+ className: "flex flex-row items-center justify-between space-y-0 pb-2",
69
+ children: [/* @__PURE__ */ s(m, {
70
+ className: "text-sm font-medium",
71
+ children: "Certified Staff"
72
+ }), /* @__PURE__ */ s(t, { className: "h-4 w-4 text-yellow-600" })]
73
+ }), /* @__PURE__ */ c(f, { children: [/* @__PURE__ */ s("div", {
74
+ className: "text-2xl font-bold",
75
+ children: "342"
76
+ }), /* @__PURE__ */ s("p", {
77
+ className: "text-xs text-muted-foreground",
78
+ children: "89% of workforce"
79
+ })] })] })
80
+ ]
81
+ }),
82
+ /* @__PURE__ */ c(h, {
83
+ defaultValue: "courses",
84
+ children: [
85
+ /* @__PURE__ */ c(_, { children: [/* @__PURE__ */ s(v, {
86
+ value: "courses",
87
+ children: "Courses"
88
+ }), /* @__PURE__ */ s(v, {
89
+ value: "certs",
90
+ children: "Certifications"
91
+ })] }),
92
+ /* @__PURE__ */ s(g, {
93
+ value: "courses",
94
+ className: "mt-4",
95
+ children: /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(m, { children: "Training Programs" }) }), /* @__PURE__ */ s(f, {
96
+ className: "space-y-4",
97
+ children: y.map((e) => /* @__PURE__ */ c("div", {
98
+ className: "rounded-lg border p-4",
99
+ children: [
100
+ /* @__PURE__ */ s("div", {
101
+ className: "mb-3 flex items-start justify-between",
102
+ children: /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("div", {
103
+ className: "mb-1 flex items-center gap-2",
104
+ children: [/* @__PURE__ */ s(n, { className: "h-5 w-5 text-purple-600" }), /* @__PURE__ */ s("h4", {
105
+ className: "font-semibold",
106
+ children: e.title
107
+ })]
108
+ }), /* @__PURE__ */ c("div", {
109
+ className: "flex gap-2",
110
+ children: [/* @__PURE__ */ s(l, {
111
+ variant: "outline",
112
+ children: e.category
113
+ }), /* @__PURE__ */ s(l, {
114
+ variant: "outline",
115
+ className: e.level === "required" ? "text-red-600" : "text-blue-600",
116
+ children: e.level
117
+ })]
118
+ })] })
119
+ }),
120
+ /* @__PURE__ */ c("div", {
121
+ className: "mb-3 grid grid-cols-2 gap-3 md:grid-cols-4",
122
+ children: [
123
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("span", {
124
+ className: "text-xs text-muted-foreground",
125
+ children: "Duration"
126
+ }), /* @__PURE__ */ c("div", {
127
+ className: "flex items-center gap-1",
128
+ children: [/* @__PURE__ */ s(r, { className: "h-3 w-3" }), /* @__PURE__ */ s("p", {
129
+ className: "text-sm font-medium",
130
+ children: e.duration
131
+ })]
132
+ })] }),
133
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("span", {
134
+ className: "text-xs text-muted-foreground",
135
+ children: "Instructor"
136
+ }), /* @__PURE__ */ s("p", {
137
+ className: "text-sm font-medium",
138
+ children: e.instructor
139
+ })] }),
140
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("span", {
141
+ className: "text-xs text-muted-foreground",
142
+ children: "Enrolled"
143
+ }), /* @__PURE__ */ s("p", {
144
+ className: "text-sm font-medium",
145
+ children: e.enrolled
146
+ })] }),
147
+ /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("span", {
148
+ className: "text-xs text-muted-foreground",
149
+ children: "Completed"
150
+ }), /* @__PURE__ */ s("p", {
151
+ className: "text-sm font-medium",
152
+ children: e.completed
153
+ })] })
154
+ ]
155
+ }),
156
+ /* @__PURE__ */ c("div", {
157
+ className: "space-y-1",
158
+ children: [/* @__PURE__ */ c("div", {
159
+ className: "flex justify-between text-sm",
160
+ children: [/* @__PURE__ */ s("span", {
161
+ className: "text-muted-foreground",
162
+ children: "Completion"
163
+ }), /* @__PURE__ */ c("span", {
164
+ className: "font-medium",
165
+ children: [e.completionRate, "%"]
166
+ })]
167
+ }), /* @__PURE__ */ s("div", {
168
+ className: "h-2 w-full rounded-full bg-muted",
169
+ children: /* @__PURE__ */ s("div", {
170
+ className: "h-2 rounded-full bg-purple-500",
171
+ style: { width: `${e.completionRate}%` }
172
+ })
173
+ })]
174
+ })
175
+ ]
176
+ }, e.id))
177
+ })] })
178
+ }),
179
+ /* @__PURE__ */ s(g, {
180
+ value: "certs",
181
+ className: "mt-4",
182
+ children: /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(m, { children: "Professional Certifications" }) }), /* @__PURE__ */ s(f, {
183
+ className: "space-y-3",
184
+ children: [
185
+ {
186
+ name: "H2S Alive (ENFORM)",
187
+ issuer: "Energy Safety Canada",
188
+ holders: 142,
189
+ expiring: 8
190
+ },
191
+ {
192
+ name: "Process Safety Mgmt (PSM)",
193
+ issuer: "OSHA",
194
+ holders: 89,
195
+ expiring: 3
196
+ },
197
+ {
198
+ name: "Pipeline Operator Qualification",
199
+ issuer: "DOT/OQ",
200
+ holders: 45,
201
+ expiring: 5
202
+ },
203
+ {
204
+ name: "Confined Space Entry",
205
+ issuer: "OSHA 29 CFR",
206
+ holders: 156,
207
+ expiring: 12
208
+ }
209
+ ].map((e) => /* @__PURE__ */ c("div", {
210
+ className: "rounded-lg border p-4",
211
+ children: [/* @__PURE__ */ c("div", {
212
+ className: "mb-2 flex items-start gap-3",
213
+ children: [/* @__PURE__ */ s(t, { className: "h-6 w-6 text-yellow-600" }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h4", {
214
+ className: "font-semibold",
215
+ children: e.name
216
+ }), /* @__PURE__ */ c("p", {
217
+ className: "text-sm text-muted-foreground",
218
+ children: ["Issued by: ", e.issuer]
219
+ })] })]
220
+ }), /* @__PURE__ */ c("div", {
221
+ className: "grid grid-cols-2 gap-3",
222
+ children: [/* @__PURE__ */ c("div", {
223
+ className: "rounded bg-muted p-2",
224
+ children: [/* @__PURE__ */ s("span", {
225
+ className: "text-xs text-muted-foreground",
226
+ children: "Holders"
227
+ }), /* @__PURE__ */ s("p", {
228
+ className: "text-lg font-bold text-green-600",
229
+ children: e.holders
230
+ })]
231
+ }), /* @__PURE__ */ c("div", {
232
+ className: `rounded p-2 ${e.expiring > 5 ? "bg-orange-50" : "bg-muted"}`,
233
+ children: [/* @__PURE__ */ s("span", {
234
+ className: "text-xs text-muted-foreground",
235
+ children: "Expiring (90d)"
236
+ }), /* @__PURE__ */ s("p", {
237
+ className: `text-lg font-bold ${e.expiring > 5 ? "text-orange-600" : ""}`,
238
+ children: e.expiring
239
+ })]
240
+ })]
241
+ })]
242
+ }, e.name))
243
+ })] })
244
+ })
245
+ ]
246
+ })
247
+ ]
248
+ });
249
+ }
250
+ //#endregion
251
+ export { y as TrainingPage };
252
+
253
+ //# sourceMappingURL=TrainingPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrainingPage.js","names":[],"sources":["../../../src/theglobalfuel/pages/TrainingPage.tsx"],"sourcesContent":["import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Badge,\n Button,\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from '@burdenoff/fe-libs/ui';\nimport { GraduationCap, BookOpen, Award, Users, TrendingUp, Clock } from 'lucide-react';\nimport { useTheGlobalFuelStore } from '../store/theglobalfuelStore';\n\nexport function TrainingPage() {\n const { training } = useTheGlobalFuelStore();\n const avgCompletion = (\n training.reduce((a, t) => a + t.completionRate, 0) / training.length\n ).toFixed(0);\n const totalEnrolled = training.reduce((a, t) => a + t.enrolled, 0);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <GraduationCap className=\"h-7 w-7 text-purple-600\" />\n Training &amp; Development\n </h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n H2S safety, pipeline integrity, refinery operations, and compliance training\n </p>\n </div>\n <Button>\n <BookOpen className=\"mr-2 h-4 w-4\" />\n Create Course\n </Button>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Active Trainees</CardTitle>\n <Users className=\"h-4 w-4 text-blue-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{totalEnrolled}</div>\n <p className=\"text-xs text-muted-foreground\">Across {training.length} programs</p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Completion Rate</CardTitle>\n <TrendingUp className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{avgCompletion}%</div>\n <p className=\"text-xs text-muted-foreground\">+3.2% from last quarter</p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Programs</CardTitle>\n <BookOpen className=\"h-4 w-4 text-purple-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{training.length}</div>\n <p className=\"text-xs text-muted-foreground\">\n {training.filter((t) => t.level === 'required').length} required\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Certified Staff</CardTitle>\n <Award className=\"h-4 w-4 text-yellow-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">342</div>\n <p className=\"text-xs text-muted-foreground\">89% of workforce</p>\n </CardContent>\n </Card>\n </div>\n <Tabs defaultValue=\"courses\">\n <TabsList>\n <TabsTrigger value=\"courses\">Courses</TabsTrigger>\n <TabsTrigger value=\"certs\">Certifications</TabsTrigger>\n </TabsList>\n <TabsContent value=\"courses\" className=\"mt-4\">\n <Card>\n <CardHeader>\n <CardTitle>Training Programs</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {training.map((course) => (\n <div key={course.id} className=\"rounded-lg border p-4\">\n <div className=\"mb-3 flex items-start justify-between\">\n <div>\n <div className=\"mb-1 flex items-center gap-2\">\n <BookOpen className=\"h-5 w-5 text-purple-600\" />\n <h4 className=\"font-semibold\">{course.title}</h4>\n </div>\n <div className=\"flex gap-2\">\n <Badge variant=\"outline\">{course.category}</Badge>\n <Badge\n variant=\"outline\"\n className={course.level === 'required' ? 'text-red-600' : 'text-blue-600'}\n >\n {course.level}\n </Badge>\n </div>\n </div>\n </div>\n <div className=\"mb-3 grid grid-cols-2 gap-3 md:grid-cols-4\">\n <div>\n <span className=\"text-xs text-muted-foreground\">Duration</span>\n <div className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n <p className=\"text-sm font-medium\">{course.duration}</p>\n </div>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Instructor</span>\n <p className=\"text-sm font-medium\">{course.instructor}</p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Enrolled</span>\n <p className=\"text-sm font-medium\">{course.enrolled}</p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Completed</span>\n <p className=\"text-sm font-medium\">{course.completed}</p>\n </div>\n </div>\n <div className=\"space-y-1\">\n <div className=\"flex justify-between text-sm\">\n <span className=\"text-muted-foreground\">Completion</span>\n <span className=\"font-medium\">{course.completionRate}%</span>\n </div>\n <div className=\"h-2 w-full rounded-full bg-muted\">\n <div\n className=\"h-2 rounded-full bg-purple-500\"\n style={{ width: `${course.completionRate}%` }}\n />\n </div>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n </TabsContent>\n <TabsContent value=\"certs\" className=\"mt-4\">\n <Card>\n <CardHeader>\n <CardTitle>Professional Certifications</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {[\n {\n name: 'H2S Alive (ENFORM)',\n issuer: 'Energy Safety Canada',\n holders: 142,\n expiring: 8,\n },\n { name: 'Process Safety Mgmt (PSM)', issuer: 'OSHA', holders: 89, expiring: 3 },\n {\n name: 'Pipeline Operator Qualification',\n issuer: 'DOT/OQ',\n holders: 45,\n expiring: 5,\n },\n { name: 'Confined Space Entry', issuer: 'OSHA 29 CFR', holders: 156, expiring: 12 },\n ].map((c) => (\n <div key={c.name} className=\"rounded-lg border p-4\">\n <div className=\"mb-2 flex items-start gap-3\">\n <Award className=\"h-6 w-6 text-yellow-600\" />\n <div>\n <h4 className=\"font-semibold\">{c.name}</h4>\n <p className=\"text-sm text-muted-foreground\">Issued by: {c.issuer}</p>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"rounded bg-muted p-2\">\n <span className=\"text-xs text-muted-foreground\">Holders</span>\n <p className=\"text-lg font-bold text-green-600\">{c.holders}</p>\n </div>\n <div className={`rounded p-2 ${c.expiring > 5 ? 'bg-orange-50' : 'bg-muted'}`}>\n <span className=\"text-xs text-muted-foreground\">Expiring (90d)</span>\n <p className={`text-lg font-bold ${c.expiring > 5 ? 'text-orange-600' : ''}`}>\n {c.expiring}\n </p>\n </div>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n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;mBAAf,CACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,QAAD;WAAM,WAAU;qBAAgC;WAAc,CAAA,EAC9D,kBAAC,KAAD;WAAG,WAAU;qBAAoC,EAAE;WAAY,CAAA,CAC3D;aACN,kBAAC,OAAD;UAAK,WAAW,eAAe,EAAE,WAAW,IAAI,iBAAiB;oBAAjE,CACE,kBAAC,QAAD;WAAM,WAAU;qBAAgC;WAAqB,CAAA,EACrE,kBAAC,KAAD;WAAG,WAAW,qBAAqB,EAAE,WAAW,IAAI,oBAAoB;qBACrE,EAAE;WACD,CAAA,CACA;YACF;WACF;UApBI,EAAE,KAoBN,CACN;OACU,CAAA,CACT,EAAA,CAAA;MACK,CAAA;KACT;;GACH"}
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { TheGlobalFuelRootProps } from '../types';
3
+
4
+ export declare const useTheGlobalFuel: () => TheGlobalFuelRootProps;
5
+ export declare const TheGlobalFuelProvider: FC<PropsWithChildren<TheGlobalFuelRootProps>>;
6
+ //# sourceMappingURL=TheGlobalFuelProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TheGlobalFuelProvider.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/providers/TheGlobalFuelProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,eAAO,MAAM,gBAAgB,8BAI5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAsB/E,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { createContext as e, useContext as t, useMemo as n } from "react";
2
+ import { MemoryRouter as r } from "react-router-dom";
3
+ import { QueryClient as i, QueryClientProvider as a } from "@tanstack/react-query";
4
+ import { jsx as o } from "react/jsx-runtime";
5
+ //#region src/theglobalfuel/providers/TheGlobalFuelProvider.tsx
6
+ var s = e(null), c = () => {
7
+ let e = t(s);
8
+ if (!e) throw Error("useTheGlobalFuel must be used within TheGlobalFuelProvider");
9
+ return e;
10
+ }, l = ({ children: e, ...t }) => {
11
+ let c = /* @__PURE__ */ o(a, {
12
+ client: n(() => new i({ defaultOptions: { queries: {
13
+ retry: 1,
14
+ refetchOnWindowFocus: !1,
15
+ staleTime: 300 * 1e3
16
+ } } }), []),
17
+ children: /* @__PURE__ */ o(s.Provider, {
18
+ value: t,
19
+ children: e
20
+ })
21
+ });
22
+ return t.basePath ? c : /* @__PURE__ */ o(r, { children: c });
23
+ };
24
+ //#endregion
25
+ export { l as TheGlobalFuelProvider, c as useTheGlobalFuel };
26
+
27
+ //# sourceMappingURL=TheGlobalFuelProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TheGlobalFuelProvider.js","names":[],"sources":["../../../src/theglobalfuel/providers/TheGlobalFuelProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { TheGlobalFuelRootProps } from '../types';\n\ntype TheGlobalFuelContextValue = TheGlobalFuelRootProps;\n\nconst TheGlobalFuelContext = createContext<TheGlobalFuelContextValue | null>(null);\n\nexport const useTheGlobalFuel = () => {\n const context = useContext(TheGlobalFuelContext);\n if (!context) throw new Error('useTheGlobalFuel must be used within TheGlobalFuelProvider');\n return context;\n};\n\nexport const TheGlobalFuelProvider: FC<PropsWithChildren<TheGlobalFuelRootProps>> = ({\n children,\n ...props\n}) => {\n const queryClient = useMemo(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: { retry: 1, refetchOnWindowFocus: false, staleTime: 5 * 60 * 1000 },\n },\n }),\n []\n );\n\n const content = (\n <QueryClientProvider client={queryClient}>\n <TheGlobalFuelContext.Provider value={props}>{children}</TheGlobalFuelContext.Provider>\n </QueryClientProvider>\n );\n\n if (props.basePath) return content;\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;AAQA,IAAM,IAAuB,EAAgD,KAAK,EAErE,UAAyB;CACpC,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EAAS,OAAU,MAAM,6DAA6D;AAC3F,QAAO;GAGI,KAAwE,EACnF,aACA,GAAG,QACC;CAWJ,IAAM,IACJ,kBAAC,GAAD;EAAqB,QAXH,QAEhB,IAAI,EAAY,EACd,gBAAgB,EACd,SAAS;GAAE,OAAO;GAAG,sBAAsB;GAAO,WAAW,MAAS;GAAM,EAC7E,EACF,CAAC,EACJ,EAAE,CACH;YAIG,kBAAC,EAAqB,UAAtB;GAA+B,OAAO;GAAQ;GAAyC,CAAA;EACnE,CAAA;AAIxB,QADI,EAAM,WAAiB,IACpB,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA"}