@burdenoff/microfe-movethewheels 2026.703.3 → 2026.703.4

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 (125) hide show
  1. package/dist/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-3YOnHO9Y.js} +3 -3
  2. package/dist/{AnalyticsPage-Dz6g2MvK.js → AnalyticsPage-CMpI1070.js} +11 -11
  3. package/dist/CreateOrderPage-DRAgGo9i.js +490 -0
  4. package/dist/CustomerDetailsPage-BCeMmOFe.js +615 -0
  5. package/dist/{CustomersPage-BKxMS1AV.js → CustomersPage-CaNBMXmM.js} +64 -53
  6. package/dist/{DashboardPage-BVjQi0EB.js → DashboardPage-DIKlXde3.js} +16 -16
  7. package/dist/DataTable-XvUcTjwi.js +340 -0
  8. package/dist/DocumentsCard-U2lSe-cn.js +169 -0
  9. package/dist/{DriverDetailsPage-CN3WQ0B9.js → DriverDetailsPage-BQrYd_Lp.js} +178 -195
  10. package/dist/{DriversPage-CH9rjQC-.js → DriversPage-PYmdFiby.js} +65 -54
  11. package/dist/FinancePage-Cwh9Bw4M.js +136 -0
  12. package/dist/{FleetPage-DqkFi3s3.js → FleetPage-3ZHsB-TN.js} +23 -22
  13. package/dist/{FormError-BlOjnXOq.js → FormError-cuLV2jVD.js} +1 -1
  14. package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-C6f7DqhM.js} +50 -70
  15. package/dist/{InventoryPage-e0ze63iX.js → InventoryPage-DpiqVu1v.js} +8 -8
  16. package/dist/{LiveTrackingPage-DCX-K-LR.js → LiveTrackingPage-FAzzlVnX.js} +9 -9
  17. package/dist/MarketplacePage-Bh_2ns4v.js +426 -0
  18. package/dist/Notice-CSoDYKw9.js +46 -0
  19. package/dist/OrderDetailsPage-zCj0lW0j.js +584 -0
  20. package/dist/{OrdersListPage-Cn90P1Xx.js → OrdersListPage-CAMsuUck.js} +166 -89
  21. package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-wsxAQkA0.js} +12 -12
  22. package/dist/{ProductsPage-QJfHHpqB.js → ProductsPage-DC5qDLfz.js} +60 -49
  23. package/dist/ReportsPage-BwUJ37eO.js +356 -0
  24. package/dist/RouteDetailsPage-DyMJE9AS.js +583 -0
  25. package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-Dtc669yc.js} +57 -46
  26. package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-CpH9xhQg.js} +5 -27
  27. package/dist/{TrackingPage-W-jtdM3Y.js → TrackingPage-DaNEFG_h.js} +10 -10
  28. package/dist/{VehicleDetailsPage-Bceo5oz3.js → VehicleDetailsPage-DldYNsYV.js} +125 -142
  29. package/dist/{VehiclesPage-ApKThYeG.js → VehiclesPage-BFw13iMt.js} +61 -50
  30. package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-CMG7or6G.js} +17 -17
  31. package/dist/{WarehousesPage-DCbXXXWE.js → WarehousesPage-Wkytnt86.js} +58 -47
  32. package/dist/arrow-right-Q3XQpTPR.js +11 -0
  33. package/dist/arrow-up-xNF1zJUG.js +17 -0
  34. package/dist/chevron-left-B2_r0Elx.js +8 -0
  35. package/dist/{wrench-CANXWxF-.js → fuel-B6_lnKDs.js} +2 -5
  36. package/dist/index.js +163 -174
  37. package/dist/upload-CHZofOqb.js +21 -0
  38. package/dist/{useAnalytics-DS8n0xgg.js → useAnalytics-D7HW2XRb.js} +52 -2
  39. package/dist/{useCustomers-BmTNGxiI.js → useCustomers-BPW4__PR.js} +29 -26
  40. package/dist/{useFleet-DKqXZ16m.js → useFleet-ChBkxAd6.js} +81 -69
  41. package/dist/{useInventory-DkyiVY_A.js → useInventory-CAAVMRp6.js} +83 -38
  42. package/dist/{useOrders-Cfk1GLiq.js → useOrders-B465S2nt.js} +58 -47
  43. package/dist/{useReports-CTqZr-AB.js → useReports-jQ3GpNOm.js} +40 -34
  44. package/dist/{useRoutes-BQWO607N.js → useRoutes-hS3d5-xr.js} +49 -41
  45. package/dist/{useTracking-B-va1kO3.js → useTracking-RjGz9PZG.js} +2 -2
  46. package/dist/user-check-BEKRCi7v.js +20 -0
  47. package/dist/wrench-q_rgJfaP.js +8 -0
  48. package/dist/x-tMeDMcCw.js +11 -0
  49. package/package.json +1 -1
  50. package/src/movethewheels/components/DataTable.tsx +252 -84
  51. package/src/movethewheels/components/DocumentsCard.tsx +102 -0
  52. package/src/movethewheels/components/Notice.tsx +61 -0
  53. package/src/movethewheels/components/index.ts +7 -0
  54. package/src/movethewheels/hooks/index.ts +9 -0
  55. package/src/movethewheels/hooks/useAnalytics.ts +95 -0
  56. package/src/movethewheels/hooks/useCustomers.ts +11 -4
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
  58. package/src/movethewheels/hooks/useFleet.ts +26 -7
  59. package/src/movethewheels/hooks/useInventory.ts +70 -7
  60. package/src/movethewheels/hooks/useOrders.ts +32 -2
  61. package/src/movethewheels/hooks/useReports.ts +14 -4
  62. package/src/movethewheels/hooks/useRoutes.ts +20 -3
  63. package/src/movethewheels/pages/AnalyticsPage.tsx +2 -2
  64. package/src/movethewheels/pages/CreateOrderPage.tsx +44 -16
  65. package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
  66. package/src/movethewheels/pages/CustomersPage.tsx +27 -11
  67. package/src/movethewheels/pages/DriverDetailsPage.tsx +16 -30
  68. package/src/movethewheels/pages/DriversPage.tsx +26 -9
  69. package/src/movethewheels/pages/FinancePage.tsx +67 -84
  70. package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
  72. package/src/movethewheels/pages/OrdersListPage.tsx +76 -13
  73. package/src/movethewheels/pages/ProductsPage.tsx +27 -7
  74. package/src/movethewheels/pages/ReportsPage.tsx +65 -4
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -13
  76. package/src/movethewheels/pages/RoutesPage.tsx +22 -6
  77. package/src/movethewheels/pages/SettingsPage.tsx +3 -19
  78. package/src/movethewheels/pages/VehicleDetailsPage.tsx +3 -33
  79. package/src/movethewheels/pages/VehiclesPage.tsx +26 -5
  80. package/src/movethewheels/pages/WarehousesPage.tsx +22 -17
  81. package/src/movethewheels/types/index.ts +8 -0
  82. package/src/movethewheels/utils/download.ts +62 -0
  83. package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
  84. package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
  85. package/dist/DataTable-DmciIKKM.js +0 -249
  86. package/dist/FinancePage-DEDykSOP.js +0 -158
  87. package/dist/MarketplacePage-CIQ97_zp.js +0 -247
  88. package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
  89. package/dist/ReportsPage-Zp53q3_8.js +0 -284
  90. package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
  91. /package/dist/{MetricCard-BY0QrMD4.js → MetricCard-CVBVpu7o.js} +0 -0
  92. /package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-C87mDpDP.js} +0 -0
  93. /package/dist/{box-D9Pal4HM.js → box-Eu05PXDh.js} +0 -0
  94. /package/dist/{chart-column-BFIJysDR.js → chart-column-ouzgxIv_.js} +0 -0
  95. /package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-eV4LjaSi.js} +0 -0
  96. /package/dist/{circle-alert-iY24lSlp.js → circle-alert-Bzh2DBSF.js} +0 -0
  97. /package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-CGMSpQmD.js} +0 -0
  98. /package/dist/{clock-DJZtdl8u.js → clock-Bl3ptexL.js} +0 -0
  99. /package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-CAVU95SO.js} +0 -0
  100. /package/dist/{download-DRXxoiQR.js → download-C5NbvVDc.js} +0 -0
  101. /package/dist/{file-text-DWWY6_f5.js → file-text-D-1uvLZG.js} +0 -0
  102. /package/dist/{filter-DloLC2eE.js → filter-DUfUg6BO.js} +0 -0
  103. /package/dist/{formatters-CF2S2l1m.js → formatters-BQr-aR5W.js} +0 -0
  104. /package/dist/{map-CkJaULb2.js → map-C-M-FQLR.js} +0 -0
  105. /package/dist/{map-pin-BGiCvyCs.js → map-pin-Dznl5l40.js} +0 -0
  106. /package/dist/{navigation-D36prnAn.js → navigation-BJSJl-VG.js} +0 -0
  107. /package/dist/{package-BChUzpJS.js → package-CcRttV2N.js} +0 -0
  108. /package/dist/{phone-Ac9s3mo_.js → phone-DVSZHt_j.js} +0 -0
  109. /package/dist/{plus-Z76q-FZm.js → plus-C_XZDwBz.js} +0 -0
  110. /package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-CfgN67l3.js} +0 -0
  111. /package/dist/{save-CojywNhG.js → save-DJE8Fpdv.js} +0 -0
  112. /package/dist/{search-CDGefqb3.js → search-D_VyGcZT.js} +0 -0
  113. /package/dist/{square-pen-CopE9GmB.js → square-pen-D-6JYrVQ.js} +0 -0
  114. /package/dist/{star-nHlLjDKR.js → star-BpRlUZuU.js} +0 -0
  115. /package/dist/{store-BR9Voi5E.js → store-B-8HMuyZ.js} +0 -0
  116. /package/dist/{trash-2-BKhar6Hs.js → trash-2-8vmv-XV_.js} +0 -0
  117. /package/dist/{trending-up-Dohgd4t_.js → trending-up-Dz6PqPRj.js} +0 -0
  118. /package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-D7Y3J_4z.js} +0 -0
  119. /package/dist/{truck-C0v_hbLR.js → truck-D-y2IDzv.js} +0 -0
  120. /package/dist/{useAssistant-D4v3oxD3.js → useAssistant-DVW4QgQb.js} +0 -0
  121. /package/dist/{useImportExport-DHr-SWSw.js → useImportExport-DrPDHEDK.js} +0 -0
  122. /package/dist/{useSettings-CkDH_-gM.js → useSettings-BB8X2RLh.js} +0 -0
  123. /package/dist/{user-jyFU3lXk.js → user-DzfTn4dE.js} +0 -0
  124. /package/dist/{users-DZ-ilS6B.js → users-CCrq-w0C.js} +0 -0
  125. /package/dist/{warehouse-6m5kXMLu.js → warehouse-CaqfmMKh.js} +0 -0
@@ -1,78 +1,82 @@
1
1
  import { ct as e, i as t, l as n, ot as r } from "./PageLayout-D4LDHJJq.js";
2
- import { t as i } from "./DataTable-DmciIKKM.js";
3
- import { t as a } from "./download-DRXxoiQR.js";
4
- import { t as o } from "./package-BChUzpJS.js";
5
- import { t as s } from "./plus-Z76q-FZm.js";
6
- import { t as c } from "./refresh-cw-DKt6f5T6.js";
7
- import { i as l } from "./useInventory-DkyiVY_A.js";
8
- import { n as u } from "./formatters-CF2S2l1m.js";
9
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
- import { CTAOverflowMenu as p, EmphasisPanel as m, PagePurpose as h } from "@burdenoff/fe-libs/ui";
2
+ import { t as i } from "./DataTable-XvUcTjwi.js";
3
+ import { t as a } from "./download-C5NbvVDc.js";
4
+ import { t as o } from "./package-CcRttV2N.js";
5
+ import { t as s } from "./plus-C_XZDwBz.js";
6
+ import { t as c } from "./refresh-cw-CfgN67l3.js";
7
+ import { a as l, i as u } from "./useInventory-CAAVMRp6.js";
8
+ import { n as d } from "./formatters-BQr-aR5W.js";
9
+ import { useState as f } from "react";
10
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
11
+ import { CTAOverflowMenu as h, EmphasisPanel as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
11
12
  //#region src/movethewheels/pages/ProductsPage.tsx
12
- function g() {
13
- let { basePath: g, navigate: _ } = r(), { products: v, totalProducts: y, isLoading: b, refetch: x } = l(), S = (t) => _?.(e(g, t));
14
- return /* @__PURE__ */ f(t, {
13
+ function v() {
14
+ let { basePath: v, navigate: y } = r(), [b, x] = f(0), [S, C] = f(25), { products: w, hasMore: T, isLoading: E, refetch: D } = l({
15
+ limit: S,
16
+ offset: b * S
17
+ }), { stats: O } = u(), k = (t) => y?.(e(v, t));
18
+ return /* @__PURE__ */ m(t, {
15
19
  title: "Products",
16
- subtitle: `${y} products`,
17
- icon: /* @__PURE__ */ d(o, { size: 24 }),
18
- headerActions: /* @__PURE__ */ d(p, {
20
+ subtitle: `${O.total} products`,
21
+ icon: /* @__PURE__ */ p(o, { size: 24 }),
22
+ headerActions: /* @__PURE__ */ p(h, {
19
23
  primary: {
20
24
  label: "Add Product",
21
- icon: /* @__PURE__ */ d(s, { size: 16 }),
22
- onSelect: () => S("inventory/products/new")
25
+ icon: /* @__PURE__ */ p(s, { size: 16 }),
26
+ onSelect: () => k("inventory/products/new")
23
27
  },
24
28
  actions: [{
25
29
  label: "Refresh",
26
- icon: /* @__PURE__ */ d(c, { size: 16 }),
27
- onSelect: () => x()
30
+ icon: /* @__PURE__ */ p(c, { size: 16 }),
31
+ onSelect: () => D()
28
32
  }, {
29
33
  label: "Export",
30
- icon: /* @__PURE__ */ d(a, { size: 16 }),
31
- onSelect: () => S("import-export")
34
+ icon: /* @__PURE__ */ p(a, { size: 16 }),
35
+ onSelect: () => k("import-export")
32
36
  }]
33
37
  }),
34
38
  children: [
35
- /* @__PURE__ */ d(h, {
36
- icon: /* @__PURE__ */ d(o, { size: 18 }),
39
+ /* @__PURE__ */ p(_, {
40
+ icon: /* @__PURE__ */ p(o, { size: 18 }),
37
41
  children: "The catalog of items you ship. Each product's dimensions, weight, value and handling flags (fragile, hazardous, temperature-controlled) drive how it's packed, priced and routed — keep them accurate so shipments are quoted and handled correctly."
38
42
  }),
39
- /* @__PURE__ */ f(m, { children: [/* @__PURE__ */ d("p", {
43
+ /* @__PURE__ */ m(g, { children: [/* @__PURE__ */ p("p", {
40
44
  className: "text-sm font-medium text-text-secondary",
41
45
  children: "Catalog at a glance"
42
- }), /* @__PURE__ */ f("div", {
46
+ }), /* @__PURE__ */ m("div", {
43
47
  className: "mt-3 grid grid-cols-3 gap-4",
44
48
  children: [
45
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
49
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
46
50
  className: "text-2xl font-bold text-text-primary tabular-nums",
47
- children: y
48
- }), /* @__PURE__ */ d("p", {
51
+ children: O.total
52
+ }), /* @__PURE__ */ p("p", {
49
53
  className: "text-xs text-text-secondary",
50
54
  children: "Total products"
51
55
  })] }),
52
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
56
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
53
57
  className: "text-2xl font-bold text-text-primary tabular-nums",
54
- children: v.filter((e) => e.fragile || e.hazardous).length
55
- }), /* @__PURE__ */ d("p", {
58
+ children: O.specialHandling
59
+ }), /* @__PURE__ */ p("p", {
56
60
  className: "text-xs text-text-secondary",
57
61
  children: "Special handling"
58
62
  })] }),
59
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
63
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
60
64
  className: "text-2xl font-bold text-text-primary tabular-nums",
61
- children: v.filter((e) => e.temperatureControlled).length
62
- }), /* @__PURE__ */ d("p", {
65
+ children: O.temperatureControlled
66
+ }), /* @__PURE__ */ p("p", {
63
67
  className: "text-xs text-text-secondary",
64
68
  children: "Temp-controlled"
65
69
  })] })
66
70
  ]
67
71
  })] }),
68
- /* @__PURE__ */ d(i, {
72
+ /* @__PURE__ */ p(i, {
69
73
  columns: [
70
74
  {
71
75
  id: "sku",
72
76
  header: "SKU",
73
77
  accessorKey: "sku",
74
78
  sortable: !0,
75
- cell: (e) => /* @__PURE__ */ d("span", {
79
+ cell: (e) => /* @__PURE__ */ p("span", {
76
80
  className: "font-mono",
77
81
  children: e.sku
78
82
  })
@@ -82,10 +86,10 @@ function g() {
82
86
  header: "Product Name",
83
87
  accessorKey: "name",
84
88
  sortable: !0,
85
- cell: (e) => /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
89
+ cell: (e) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
86
90
  className: "font-medium",
87
91
  children: e.name
88
- }), /* @__PURE__ */ d("p", {
92
+ }), /* @__PURE__ */ p("p", {
89
93
  className: "text-sm text-text-secondary line-clamp-1",
90
94
  children: e.description
91
95
  })] })
@@ -95,7 +99,7 @@ function g() {
95
99
  header: "Category",
96
100
  accessorKey: "category",
97
101
  sortable: !0,
98
- cell: (e) => /* @__PURE__ */ d(n, {
102
+ cell: (e) => /* @__PURE__ */ p(n, {
99
103
  variant: "outline",
100
104
  children: e.category
101
105
  })
@@ -117,28 +121,28 @@ function g() {
117
121
  header: "Value",
118
122
  accessorKey: "value",
119
123
  sortable: !0,
120
- cell: (e) => /* @__PURE__ */ d("span", {
124
+ cell: (e) => /* @__PURE__ */ p("span", {
121
125
  className: "font-medium",
122
- children: u(e.value)
126
+ children: d(e.value)
123
127
  })
124
128
  },
125
129
  {
126
130
  id: "flags",
127
131
  header: "Flags",
128
- cell: (e) => /* @__PURE__ */ f("div", {
132
+ cell: (e) => /* @__PURE__ */ m("div", {
129
133
  className: "flex gap-1",
130
134
  children: [
131
- e.fragile && /* @__PURE__ */ d(n, {
135
+ e.fragile && /* @__PURE__ */ p(n, {
132
136
  variant: "destructive",
133
137
  className: "text-xs",
134
138
  children: "Fragile"
135
139
  }),
136
- e.hazardous && /* @__PURE__ */ d(n, {
140
+ e.hazardous && /* @__PURE__ */ p(n, {
137
141
  variant: "destructive",
138
142
  className: "text-xs",
139
143
  children: "Hazardous"
140
144
  }),
141
- e.temperatureControlled && /* @__PURE__ */ d(n, {
145
+ e.temperatureControlled && /* @__PURE__ */ p(n, {
142
146
  variant: "secondary",
143
147
  className: "text-xs",
144
148
  children: "Temp Control"
@@ -147,8 +151,8 @@ function g() {
147
151
  })
148
152
  }
149
153
  ],
150
- data: v,
151
- isLoading: b,
154
+ data: w,
155
+ isLoading: E,
152
156
  searchable: !0,
153
157
  searchPlaceholder: "Search products...",
154
158
  searchFields: [
@@ -156,8 +160,15 @@ function g() {
156
160
  "sku",
157
161
  "category"
158
162
  ],
159
- onRowClick: (e) => S(`inventory/products/${e.id}`),
163
+ onRowClick: (e) => k(`inventory/products/${e.id}`),
160
164
  getRowId: (e) => e.id,
165
+ pageIndex: b,
166
+ pageSize: S,
167
+ onPageChange: x,
168
+ onPageSizeChange: (e) => {
169
+ C(e), x(0);
170
+ },
171
+ hasNextPage: T,
161
172
  emptyIllustration: "empty-files",
162
173
  emptyTitle: "No products yet",
163
174
  emptyDescription: "Add products to your catalog so they can be added to orders and stocked in warehouses."
@@ -166,4 +177,4 @@ function g() {
166
177
  });
167
178
  }
168
179
  //#endregion
169
- export { g as default };
180
+ export { v as default };
@@ -0,0 +1,356 @@
1
+ import { B as e, F as t, I as n, L as r, P as i, R as a, d as o, f as s, g as ee, h as c, i as l, l as u, lt as d, u as f } from "./PageLayout-D4LDHJJq.js";
2
+ import { t as p } from "./chevron-left-B2_r0Elx.js";
3
+ import { t as m } from "./chevron-right-eV4LjaSi.js";
4
+ import { t as h } from "./clock-Bl3ptexL.js";
5
+ import { t as g } from "./download-C5NbvVDc.js";
6
+ import { t as _ } from "./filter-DUfUg6BO.js";
7
+ import { t as v } from "./plus-C_XZDwBz.js";
8
+ import { t as y } from "./useReports-jQ3GpNOm.js";
9
+ import { r as b } from "./formatters-BQr-aR5W.js";
10
+ import { useState as x } from "react";
11
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
12
+ import { EmphasisPanel as w, IllustratedEmptyState as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
13
+ //#region node_modules/lucide-react/dist/esm/icons/calendar.js
14
+ var D = d("Calendar", [
15
+ ["path", {
16
+ d: "M8 2v4",
17
+ key: "1cmpym"
18
+ }],
19
+ ["path", {
20
+ d: "M16 2v4",
21
+ key: "4m81vk"
22
+ }],
23
+ ["rect", {
24
+ width: "18",
25
+ height: "18",
26
+ x: "3",
27
+ y: "4",
28
+ rx: "2",
29
+ key: "1hopcy"
30
+ }],
31
+ ["path", {
32
+ d: "M3 10h18",
33
+ key: "8toen8"
34
+ }]
35
+ ]), O = d("FileChartColumnIncreasing", [
36
+ ["path", {
37
+ d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
38
+ key: "1rqfz7"
39
+ }],
40
+ ["path", {
41
+ d: "M14 2v4a2 2 0 0 0 2 2h4",
42
+ key: "tnqrlb"
43
+ }],
44
+ ["path", {
45
+ d: "M8 18v-2",
46
+ key: "qcmpov"
47
+ }],
48
+ ["path", {
49
+ d: "M12 18v-4",
50
+ key: "q1q25u"
51
+ }],
52
+ ["path", {
53
+ d: "M16 18v-6",
54
+ key: "15y0np"
55
+ }]
56
+ ]);
57
+ //#endregion
58
+ //#region src/movethewheels/utils/download.ts
59
+ function k(e, t, n) {
60
+ if (typeof document > "u") return;
61
+ let r = new Blob([t], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
62
+ a.href = i, a.download = e, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(i);
63
+ }
64
+ function A(e, t) {
65
+ k(e, JSON.stringify(t, null, 2), "application/json");
66
+ }
67
+ function j(e) {
68
+ if (!e || typeof e != "object") return null;
69
+ let t = Object.entries(e);
70
+ if (t.length === 0) return null;
71
+ let n = (e) => /[",\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, r = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), i = ["Field,Value"];
72
+ for (let [e, a] of t) i.push(`${n(e)},${n(r(a))}`);
73
+ return i.join("\n");
74
+ }
75
+ function M(e) {
76
+ return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "report";
77
+ }
78
+ //#endregion
79
+ //#region src/movethewheels/pages/ReportsPage.tsx
80
+ var N = [
81
+ {
82
+ value: "operations",
83
+ label: "Operations Summary"
84
+ },
85
+ {
86
+ value: "finance",
87
+ label: "Financial Report"
88
+ },
89
+ {
90
+ value: "fleet",
91
+ label: "Fleet Utilization"
92
+ },
93
+ {
94
+ value: "customers",
95
+ label: "Customer Analytics"
96
+ },
97
+ {
98
+ value: "inventory",
99
+ label: "Inventory Status"
100
+ }
101
+ ], P = 10;
102
+ function F() {
103
+ let [d, F] = x(0), { reports: I, hasMore: L, isLoading: R, error: z, refetch: B, createReport: V, generateReport: H } = y({
104
+ limit: P,
105
+ offset: d * P
106
+ }), [U, W] = x("operations"), [G, K] = x(null), [q, J] = x(!1), [Y, X] = x(null), Z = (e) => N.find((t) => t.value === e)?.label ?? e, Q = async (e) => {
107
+ J(!0), X(null);
108
+ let t = {
109
+ name: `${Z(U)}${e ? " (Scheduled)" : ""}`,
110
+ type: U,
111
+ description: `${Z(U)} generated from live operational data`,
112
+ ...e ? { schedule: e } : {}
113
+ };
114
+ try {
115
+ await V(t), X({
116
+ tone: "success",
117
+ text: e ? "Scheduled report created." : "Report created."
118
+ });
119
+ } catch (e) {
120
+ X({
121
+ tone: "error",
122
+ text: e instanceof Error ? e.message : "Could not create report."
123
+ });
124
+ } finally {
125
+ J(!1);
126
+ }
127
+ }, te = async (e) => {
128
+ K(e), X(null);
129
+ try {
130
+ let t = await H(e), n = `${M(t.report.name)}-${t.generatedAt.slice(0, 10)}`, r = j(t.result ?? null);
131
+ r ? k(`${n}.csv`, r, "text/csv") : A(`${n}.json`, t), X({
132
+ tone: "success",
133
+ text: "Report generated and downloaded."
134
+ });
135
+ } catch (e) {
136
+ X({
137
+ tone: "error",
138
+ text: e instanceof Error ? e.message : "Could not generate report."
139
+ });
140
+ } finally {
141
+ K(null);
142
+ }
143
+ }, $ = I.filter((e) => e.schedule);
144
+ return /* @__PURE__ */ C(l, {
145
+ title: "Reports",
146
+ subtitle: "Generate and schedule reports",
147
+ icon: /* @__PURE__ */ S(O, { size: 24 }),
148
+ headerActions: /* @__PURE__ */ C("div", {
149
+ className: "flex gap-2",
150
+ children: [/* @__PURE__ */ C(i, {
151
+ value: U,
152
+ onValueChange: W,
153
+ children: [/* @__PURE__ */ S(r, {
154
+ className: "w-[190px]",
155
+ children: /* @__PURE__ */ S(a, {})
156
+ }), /* @__PURE__ */ S(t, { children: N.map((e) => /* @__PURE__ */ S(n, {
157
+ value: e.value,
158
+ children: e.label
159
+ }, e.value)) })]
160
+ }), /* @__PURE__ */ C(f, {
161
+ onClick: () => void Q(),
162
+ disabled: q,
163
+ children: [/* @__PURE__ */ S(v, { size: 16 }), " Create Report"]
164
+ })]
165
+ }),
166
+ children: [
167
+ /* @__PURE__ */ S(E, {
168
+ icon: /* @__PURE__ */ S(O, { size: 18 }),
169
+ children: "Turn your operational data into shareable summaries. Generate one-off reports on orders, finance, fleet, customers or inventory, or schedule them to land in inboxes automatically — so stakeholders always have the latest numbers without logging in."
170
+ }),
171
+ Y && /* @__PURE__ */ S("div", {
172
+ role: "status",
173
+ className: `rounded-lg p-3 text-sm ${Y.tone === "success" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-error-bg-subtle text-status-error-text"}`,
174
+ children: Y.text
175
+ }),
176
+ /* @__PURE__ */ C("div", {
177
+ className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
178
+ children: [/* @__PURE__ */ C("div", {
179
+ className: "lg:col-span-2 space-y-4",
180
+ children: [
181
+ /* @__PURE__ */ S("h3", {
182
+ className: "font-semibold",
183
+ children: "Available Reports"
184
+ }),
185
+ R ? /* @__PURE__ */ S("div", {
186
+ className: "space-y-3",
187
+ children: Array.from({ length: 3 }).map((t, n) => /* @__PURE__ */ S(e, { className: "h-20 w-full rounded-lg" }, n))
188
+ }) : z ? /* @__PURE__ */ S(o, {
189
+ className: "border-status-error-border",
190
+ children: /* @__PURE__ */ C(s, {
191
+ className: "p-6 text-center space-y-3",
192
+ children: [
193
+ /* @__PURE__ */ S("p", {
194
+ className: "text-status-error-text font-medium",
195
+ children: "Couldn't load reports"
196
+ }),
197
+ /* @__PURE__ */ S("p", {
198
+ className: "text-sm text-text-secondary",
199
+ children: z.message
200
+ }),
201
+ /* @__PURE__ */ S(f, {
202
+ variant: "outline",
203
+ onClick: B,
204
+ children: "Retry"
205
+ })
206
+ ]
207
+ })
208
+ }) : I.length === 0 ? /* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, {
209
+ className: "p-0",
210
+ children: /* @__PURE__ */ S(T, {
211
+ illustration: "empty-data",
212
+ title: "No reports yet",
213
+ description: "Create your first report to turn live operational data into a shareable summary.",
214
+ action: /* @__PURE__ */ C(f, {
215
+ onClick: () => void Q(),
216
+ disabled: q,
217
+ children: [/* @__PURE__ */ S(v, {
218
+ size: 16,
219
+ className: "mr-1.5"
220
+ }), " Create Report"]
221
+ })
222
+ })
223
+ }) }) : I.map((e) => /* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, {
224
+ className: "p-4",
225
+ children: /* @__PURE__ */ C("div", {
226
+ className: "flex items-center justify-between",
227
+ children: [/* @__PURE__ */ C("div", {
228
+ className: "flex items-center gap-3",
229
+ children: [/* @__PURE__ */ S("div", {
230
+ className: "w-10 h-10 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
231
+ children: /* @__PURE__ */ S(O, {
232
+ size: 20,
233
+ className: "text-primary"
234
+ })
235
+ }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
236
+ className: "font-medium",
237
+ children: e.name
238
+ }), /* @__PURE__ */ S("p", {
239
+ className: "text-sm text-text-secondary",
240
+ children: e.description ?? Z(e.type)
241
+ })] })]
242
+ }), /* @__PURE__ */ C("div", {
243
+ className: "flex items-center gap-3",
244
+ children: [/* @__PURE__ */ C("div", {
245
+ className: "text-right",
246
+ children: [/* @__PURE__ */ S(u, {
247
+ variant: "outline",
248
+ children: e.schedule ?? "On demand"
249
+ }), e.lastGenerated && /* @__PURE__ */ C("p", {
250
+ className: "text-xs text-text-secondary mt-1",
251
+ children: ["Last: ", b(new Date(e.lastGenerated), "short")]
252
+ })]
253
+ }), /* @__PURE__ */ S(f, {
254
+ variant: "outline",
255
+ size: "sm",
256
+ "aria-label": `Generate ${e.name}`,
257
+ disabled: G === e.id,
258
+ onClick: () => void te(e.id),
259
+ children: /* @__PURE__ */ S(g, { size: 14 })
260
+ })]
261
+ })]
262
+ })
263
+ }) }, e.id)),
264
+ !R && !z && (I.length > 0 || d > 0) && /* @__PURE__ */ C("div", {
265
+ className: "flex flex-wrap items-center justify-between gap-3 pt-1",
266
+ children: [/* @__PURE__ */ C("span", {
267
+ className: "text-sm text-text-secondary",
268
+ children: [
269
+ "Showing ",
270
+ I.length === 0 ? 0 : d * P + 1,
271
+ " to",
272
+ " ",
273
+ d * P + I.length
274
+ ]
275
+ }), /* @__PURE__ */ C("div", {
276
+ className: "flex items-center gap-1",
277
+ children: [
278
+ /* @__PURE__ */ S(f, {
279
+ variant: "outline",
280
+ size: "icon",
281
+ className: "h-8 w-8",
282
+ "aria-label": "Previous page",
283
+ onClick: () => F((e) => Math.max(0, e - 1)),
284
+ disabled: d === 0,
285
+ children: /* @__PURE__ */ S(p, { className: "h-4 w-4" })
286
+ }),
287
+ /* @__PURE__ */ C("span", {
288
+ className: "px-3 text-sm",
289
+ children: ["Page ", d + 1]
290
+ }),
291
+ /* @__PURE__ */ S(f, {
292
+ variant: "outline",
293
+ size: "icon",
294
+ className: "h-8 w-8",
295
+ "aria-label": "Next page",
296
+ onClick: () => F((e) => e + 1),
297
+ disabled: !L,
298
+ children: /* @__PURE__ */ S(m, { className: "h-4 w-4" })
299
+ })
300
+ ]
301
+ })]
302
+ })
303
+ ]
304
+ }), /* @__PURE__ */ C("div", {
305
+ className: "space-y-6",
306
+ children: [/* @__PURE__ */ C(w, {
307
+ className: "space-y-3",
308
+ children: [
309
+ /* @__PURE__ */ C("h2", {
310
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary",
311
+ children: [/* @__PURE__ */ S(h, { size: 18 }), " Scheduled Reports"]
312
+ }),
313
+ $.length === 0 ? /* @__PURE__ */ S("p", {
314
+ className: "text-sm text-text-secondary",
315
+ children: "No scheduled reports yet. Schedule one to have it generated automatically."
316
+ }) : $.map((e) => /* @__PURE__ */ C("div", {
317
+ className: "p-3 border border-border-seam rounded-lg",
318
+ children: [/* @__PURE__ */ S("p", {
319
+ className: "font-medium",
320
+ children: e.name
321
+ }), /* @__PURE__ */ C("p", {
322
+ className: "text-sm text-text-secondary",
323
+ children: ["Schedule: ", e.schedule]
324
+ })]
325
+ }, e.id)),
326
+ /* @__PURE__ */ S(f, {
327
+ variant: "outline",
328
+ className: "w-full",
329
+ disabled: q,
330
+ onClick: () => void Q("daily"),
331
+ children: "Schedule New Report"
332
+ })
333
+ ]
334
+ }), /* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(c, { children: /* @__PURE__ */ S(ee, { children: "Quick Actions" }) }), /* @__PURE__ */ C(s, {
335
+ className: "space-y-2",
336
+ children: [/* @__PURE__ */ C(f, {
337
+ variant: "outline",
338
+ className: "w-full justify-start",
339
+ disabled: q,
340
+ onClick: () => void Q("weekly"),
341
+ children: [/* @__PURE__ */ S(D, { size: 16 }), " Schedule Report"]
342
+ }), /* @__PURE__ */ C(f, {
343
+ variant: "outline",
344
+ className: "w-full justify-start",
345
+ disabled: q,
346
+ onClick: () => void Q(),
347
+ children: [/* @__PURE__ */ S(_, { size: 16 }), " Custom Report"]
348
+ })]
349
+ })] })]
350
+ })]
351
+ })
352
+ ]
353
+ });
354
+ }
355
+ //#endregion
356
+ export { F as default };