@burdenoff/microfe-movethewheels 2026.510.105

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 (208) hide show
  1. package/README.md +82 -0
  2. package/dist/AIAssistantPage-hD0VYJdH.js +210 -0
  3. package/dist/AnalyticsPage-DHTHCUtr.js +201 -0
  4. package/dist/CreateOrderPage-Cprg4Y9V.js +471 -0
  5. package/dist/CustomerDetailsPage-DNDEw7IW.js +239 -0
  6. package/dist/CustomersPage-CDjjeCEL.js +119 -0
  7. package/dist/DashboardPage-8iTPXRAG.js +374 -0
  8. package/dist/DataTable-CRIKfdIN.js +239 -0
  9. package/dist/DriverDetailsPage-CRyRCno7.js +297 -0
  10. package/dist/DriversPage-16O8fVmf.js +127 -0
  11. package/dist/FinancePage-BYUxK5dR.js +154 -0
  12. package/dist/FleetPage-CHYETCWT.js +293 -0
  13. package/dist/ImportExportPage-C3MKKxfc.js +232 -0
  14. package/dist/InventoryPage--822AxZM.js +223 -0
  15. package/dist/LiveTrackingPage-Dp3rTJDr.js +332 -0
  16. package/dist/MarketplacePage-DjEqudfM.js +192 -0
  17. package/dist/MetricCard-GTbxAk1a.js +135 -0
  18. package/dist/OrderDetailsPage-BIuYG0ub.js +398 -0
  19. package/dist/OrdersListPage-CW5V0Uvh.js +257 -0
  20. package/dist/PageLayout-B7b0vl0R.js +1894 -0
  21. package/dist/ProductDetailsPage-Q3X7AT-7.js +168 -0
  22. package/dist/ProductsPage-CUj9JpnW.js +131 -0
  23. package/dist/ReportsPage-DblO5CdJ.js +227 -0
  24. package/dist/RouteDetailsPage-CLctgk6A.js +240 -0
  25. package/dist/RoutesPage-8hrv6RWT.js +116 -0
  26. package/dist/SettingsPage-BJ5BQeqn.js +247 -0
  27. package/dist/StatusBadge-BrrwraIA.js +206 -0
  28. package/dist/TrackingPage-BGqHDh-w.js +322 -0
  29. package/dist/VehicleDetailsPage-XnDH4iQR.js +194 -0
  30. package/dist/VehiclesPage-Cs4XxHkA.js +127 -0
  31. package/dist/WarehouseDetailsPage-GemdMvr_.js +215 -0
  32. package/dist/WarehousesPage-QTiuDuXy.js +121 -0
  33. package/dist/arrow-left-6CiLhqVp.js +11 -0
  34. package/dist/box-BunB_4UH.js +18 -0
  35. package/dist/chart-column-DWwVEVQ-.js +22 -0
  36. package/dist/chevron-right-DhZVf20o.js +8 -0
  37. package/dist/circle-alert-D5f6RZxt.js +26 -0
  38. package/dist/circle-check-big-D-JMHcTe.js +11 -0
  39. package/dist/clock-CvwBKbQP.js +13 -0
  40. package/dist/dev/main.d.ts +1 -0
  41. package/dist/dollar-sign-CP9qeU5d.js +14 -0
  42. package/dist/download-CIuG04pJ.js +21 -0
  43. package/dist/file-text-Dd_thxkn.js +26 -0
  44. package/dist/filter-DyRMX9CU.js +8 -0
  45. package/dist/formatters-_vJlC-47.js +50 -0
  46. package/dist/generated/global-operations.d.ts +1 -0
  47. package/dist/generated/global-types.d.ts +20715 -0
  48. package/dist/generated/wspace-operations.d.ts +3704 -0
  49. package/dist/generated/wspace-types.d.ts +53362 -0
  50. package/dist/graphqlClient-CdJyR_ed.js +55 -0
  51. package/dist/index.d.ts +4 -0
  52. package/dist/index.js +772 -0
  53. package/dist/map-BqH1cBJi.js +18 -0
  54. package/dist/map-pin-CFBOmh-A.js +13 -0
  55. package/dist/movethewheels/MoveTheWheelsRoot.d.ts +25 -0
  56. package/dist/movethewheels/MoveTheWheelsRoutes.d.ts +7 -0
  57. package/dist/movethewheels/components/DataTable.d.ts +32 -0
  58. package/dist/movethewheels/components/MetricCard.d.ts +43 -0
  59. package/dist/movethewheels/components/PageLayout.d.ts +68 -0
  60. package/dist/movethewheels/components/StatusBadge.d.ts +49 -0
  61. package/dist/movethewheels/components/index.d.ts +10 -0
  62. package/dist/movethewheels/components/ui.d.ts +22 -0
  63. package/dist/movethewheels/constants/index.d.ts +24 -0
  64. package/dist/movethewheels/constants/mockData.d.ts +33 -0
  65. package/dist/movethewheels/hooks/index.d.ts +12 -0
  66. package/dist/movethewheels/hooks/useAnalytics.d.ts +118 -0
  67. package/dist/movethewheels/hooks/useCustomers.d.ts +37 -0
  68. package/dist/movethewheels/hooks/useFleet.d.ts +71 -0
  69. package/dist/movethewheels/hooks/useInventory.d.ts +60 -0
  70. package/dist/movethewheels/hooks/useOrders.d.ts +47 -0
  71. package/dist/movethewheels/hooks/useRoutes.d.ts +41 -0
  72. package/dist/movethewheels/hooks/useTracking.d.ts +69 -0
  73. package/dist/movethewheels/index.d.ts +30 -0
  74. package/dist/movethewheels/pages/AIAssistantPage.d.ts +4 -0
  75. package/dist/movethewheels/pages/AnalyticsPage.d.ts +4 -0
  76. package/dist/movethewheels/pages/CreateOrderPage.d.ts +6 -0
  77. package/dist/movethewheels/pages/CustomerDetailsPage.d.ts +4 -0
  78. package/dist/movethewheels/pages/CustomersPage.d.ts +4 -0
  79. package/dist/movethewheels/pages/DashboardPage.d.ts +6 -0
  80. package/dist/movethewheels/pages/DriverDetailsPage.d.ts +4 -0
  81. package/dist/movethewheels/pages/DriversPage.d.ts +4 -0
  82. package/dist/movethewheels/pages/FinancePage.d.ts +4 -0
  83. package/dist/movethewheels/pages/FleetPage.d.ts +6 -0
  84. package/dist/movethewheels/pages/ImportExportPage.d.ts +4 -0
  85. package/dist/movethewheels/pages/InventoryPage.d.ts +4 -0
  86. package/dist/movethewheels/pages/LiveTrackingPage.d.ts +6 -0
  87. package/dist/movethewheels/pages/MarketplacePage.d.ts +4 -0
  88. package/dist/movethewheels/pages/OrderDetailsPage.d.ts +6 -0
  89. package/dist/movethewheels/pages/OrdersListPage.d.ts +6 -0
  90. package/dist/movethewheels/pages/ProductDetailsPage.d.ts +4 -0
  91. package/dist/movethewheels/pages/ProductsPage.d.ts +4 -0
  92. package/dist/movethewheels/pages/ReportsPage.d.ts +4 -0
  93. package/dist/movethewheels/pages/RouteDetailsPage.d.ts +4 -0
  94. package/dist/movethewheels/pages/RoutesPage.d.ts +4 -0
  95. package/dist/movethewheels/pages/SettingsPage.d.ts +4 -0
  96. package/dist/movethewheels/pages/TrackingPage.d.ts +6 -0
  97. package/dist/movethewheels/pages/VehicleDetailsPage.d.ts +4 -0
  98. package/dist/movethewheels/pages/VehiclesPage.d.ts +4 -0
  99. package/dist/movethewheels/pages/WarehouseDetailsPage.d.ts +4 -0
  100. package/dist/movethewheels/pages/WarehousesPage.d.ts +4 -0
  101. package/dist/movethewheels/providers/MoveTheWheelsProvider.d.ts +16 -0
  102. package/dist/movethewheels/store/movethewheelsStore.d.ts +73 -0
  103. package/dist/movethewheels/types/index.d.ts +655 -0
  104. package/dist/movethewheels/utils/cn.d.ts +6 -0
  105. package/dist/movethewheels/utils/formatters.d.ts +60 -0
  106. package/dist/movethewheels/utils/graphqlClient.d.ts +11 -0
  107. package/dist/movethewheels/utils/index.d.ts +7 -0
  108. package/dist/movethewheels/utils/navigation.d.ts +23 -0
  109. package/dist/navigation-BgnOfsVd.js +6 -0
  110. package/dist/navigation-C2fY_aS9.js +8 -0
  111. package/dist/package-DVZbDRcV.js +22 -0
  112. package/dist/phone-KdwpVmC4.js +18 -0
  113. package/dist/plus-Bl7uX6Ji.js +11 -0
  114. package/dist/refresh-cw-BYjl3K-8.js +22 -0
  115. package/dist/route-Ce_poKFi.js +51 -0
  116. package/dist/save-C-qDVat-.js +18 -0
  117. package/dist/search-5pdn5eOO.js +13 -0
  118. package/dist/settings-C4kIDsYg.js +28 -0
  119. package/dist/square-pen-BwQ67vLE.js +11 -0
  120. package/dist/star-BlVsC3Ad.js +8 -0
  121. package/dist/store-DTmQT5M0.js +26 -0
  122. package/dist/trending-up-C1faflCI.js +11 -0
  123. package/dist/triangle-alert-CUoVAA4L.js +18 -0
  124. package/dist/truck-BmDAzu05.js +30 -0
  125. package/dist/useAnalytics-ph7eTIK6.js +297 -0
  126. package/dist/useCustomers-bS3a4ytk.js +186 -0
  127. package/dist/useFleet-BdETplNE.js +398 -0
  128. package/dist/useInventory-Dwn18FPz.js +323 -0
  129. package/dist/useOrders-D_3_hGMp.js +324 -0
  130. package/dist/useRoutes-v4aBaS-E.js +224 -0
  131. package/dist/useTracking-De2KIUNu.js +261 -0
  132. package/dist/user-BplzDrLP.js +13 -0
  133. package/dist/users-i-igmsP4.js +24 -0
  134. package/dist/warehouse-DewG0PXh.js +25 -0
  135. package/dist/wrench-CoSDEIC7.js +31 -0
  136. package/package.json +107 -0
  137. package/src/dev/main.tsx +110 -0
  138. package/src/dev/styles.css +139 -0
  139. package/src/generated/global-operations.ts +2 -0
  140. package/src/generated/global-types.ts +24048 -0
  141. package/src/generated/wspace-operations.ts +3734 -0
  142. package/src/generated/wspace-types.ts +60715 -0
  143. package/src/index.ts +4 -0
  144. package/src/movethewheels/MoveTheWheelsRoot.tsx +258 -0
  145. package/src/movethewheels/MoveTheWheelsRoutes.tsx +119 -0
  146. package/src/movethewheels/components/DataTable.tsx +367 -0
  147. package/src/movethewheels/components/MetricCard.tsx +180 -0
  148. package/src/movethewheels/components/PageLayout.tsx +234 -0
  149. package/src/movethewheels/components/StatusBadge.tsx +243 -0
  150. package/src/movethewheels/components/index.ts +26 -0
  151. package/src/movethewheels/components/ui.tsx +124 -0
  152. package/src/movethewheels/constants/index.ts +65 -0
  153. package/src/movethewheels/constants/mockData.ts +1342 -0
  154. package/src/movethewheels/hooks/index.ts +55 -0
  155. package/src/movethewheels/hooks/useAnalytics.ts +476 -0
  156. package/src/movethewheels/hooks/useCustomers.ts +359 -0
  157. package/src/movethewheels/hooks/useFleet.ts +778 -0
  158. package/src/movethewheels/hooks/useInventory.ts +632 -0
  159. package/src/movethewheels/hooks/useOrders.ts +703 -0
  160. package/src/movethewheels/hooks/useRoutes.ts +453 -0
  161. package/src/movethewheels/hooks/useTracking.ts +505 -0
  162. package/src/movethewheels/index.ts +68 -0
  163. package/src/movethewheels/pages/AIAssistantPage.tsx +160 -0
  164. package/src/movethewheels/pages/AnalyticsPage.tsx +190 -0
  165. package/src/movethewheels/pages/CreateOrderPage.tsx +454 -0
  166. package/src/movethewheels/pages/CustomerDetailsPage.tsx +207 -0
  167. package/src/movethewheels/pages/CustomersPage.tsx +115 -0
  168. package/src/movethewheels/pages/DashboardPage.tsx +414 -0
  169. package/src/movethewheels/pages/DriverDetailsPage.tsx +261 -0
  170. package/src/movethewheels/pages/DriversPage.tsx +118 -0
  171. package/src/movethewheels/pages/FinancePage.tsx +141 -0
  172. package/src/movethewheels/pages/FleetPage.tsx +289 -0
  173. package/src/movethewheels/pages/ImportExportPage.tsx +165 -0
  174. package/src/movethewheels/pages/InventoryPage.tsx +212 -0
  175. package/src/movethewheels/pages/LiveTrackingPage.tsx +325 -0
  176. package/src/movethewheels/pages/MarketplacePage.tsx +235 -0
  177. package/src/movethewheels/pages/OrderDetailsPage.tsx +387 -0
  178. package/src/movethewheels/pages/OrdersListPage.tsx +241 -0
  179. package/src/movethewheels/pages/ProductDetailsPage.tsx +155 -0
  180. package/src/movethewheels/pages/ProductsPage.tsx +124 -0
  181. package/src/movethewheels/pages/ReportsPage.tsx +164 -0
  182. package/src/movethewheels/pages/RouteDetailsPage.tsx +245 -0
  183. package/src/movethewheels/pages/RoutesPage.tsx +104 -0
  184. package/src/movethewheels/pages/SettingsPage.tsx +242 -0
  185. package/src/movethewheels/pages/TrackingPage.tsx +419 -0
  186. package/src/movethewheels/pages/VehicleDetailsPage.tsx +218 -0
  187. package/src/movethewheels/pages/VehiclesPage.tsx +124 -0
  188. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +216 -0
  189. package/src/movethewheels/pages/WarehousesPage.tsx +122 -0
  190. package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +66 -0
  191. package/src/movethewheels/store/movethewheelsStore.ts +136 -0
  192. package/src/movethewheels/types/index.ts +744 -0
  193. package/src/movethewheels/utils/cn.ts +9 -0
  194. package/src/movethewheels/utils/formatters.ts +215 -0
  195. package/src/movethewheels/utils/graphqlClient.ts +63 -0
  196. package/src/movethewheels/utils/index.ts +8 -0
  197. package/src/movethewheels/utils/navigation.ts +70 -0
  198. package/src/operations/global/.gitkeep +0 -0
  199. package/src/operations/wspace/movethewheels/fragments/core.graphql +191 -0
  200. package/src/operations/wspace/movethewheels/mutations/entities.graphql +87 -0
  201. package/src/operations/wspace/movethewheels/mutations/logistics.graphql +86 -0
  202. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +81 -0
  203. package/src/operations/wspace/movethewheels/mutations/orders.graphql +21 -0
  204. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +61 -0
  205. package/src/operations/wspace/movethewheels/queries/entities.graphql +83 -0
  206. package/src/operations/wspace/movethewheels/queries/logistics.graphql +84 -0
  207. package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +40 -0
  208. package/src/operations/wspace/movethewheels/queries/orders.graphql +43 -0
@@ -0,0 +1,206 @@
1
+ import { l as e, rt as t } from "./PageLayout-B7b0vl0R.js";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ //#region src/movethewheels/constants/index.ts
4
+ var i = {
5
+ pending: {
6
+ bg: "bg-yellow-100",
7
+ text: "text-yellow-800",
8
+ border: "border-yellow-200"
9
+ },
10
+ confirmed: {
11
+ bg: "bg-blue-100",
12
+ text: "text-blue-800",
13
+ border: "border-blue-200"
14
+ },
15
+ assigned: {
16
+ bg: "bg-purple-100",
17
+ text: "text-purple-800",
18
+ border: "border-purple-200"
19
+ },
20
+ picked_up: {
21
+ bg: "bg-indigo-100",
22
+ text: "text-indigo-800",
23
+ border: "border-indigo-200"
24
+ },
25
+ in_transit: {
26
+ bg: "bg-cyan-100",
27
+ text: "text-cyan-800",
28
+ border: "border-cyan-200"
29
+ },
30
+ out_for_delivery: {
31
+ bg: "bg-orange-100",
32
+ text: "text-orange-800",
33
+ border: "border-orange-200"
34
+ },
35
+ delivered: {
36
+ bg: "bg-green-100",
37
+ text: "text-green-800",
38
+ border: "border-green-200"
39
+ },
40
+ cancelled: {
41
+ bg: "bg-red-100",
42
+ text: "text-red-800",
43
+ border: "border-red-200"
44
+ },
45
+ failed: {
46
+ bg: "bg-red-100",
47
+ text: "text-red-800",
48
+ border: "border-red-200"
49
+ }
50
+ }, a = {
51
+ available: {
52
+ bg: "bg-green-100",
53
+ text: "text-green-800"
54
+ },
55
+ assigned: {
56
+ bg: "bg-blue-100",
57
+ text: "text-blue-800"
58
+ },
59
+ maintenance: {
60
+ bg: "bg-yellow-100",
61
+ text: "text-yellow-800"
62
+ },
63
+ out_of_service: {
64
+ bg: "bg-red-100",
65
+ text: "text-red-800"
66
+ }
67
+ }, o = {
68
+ available: {
69
+ bg: "bg-green-100",
70
+ text: "text-green-800"
71
+ },
72
+ busy: {
73
+ bg: "bg-blue-100",
74
+ text: "text-blue-800"
75
+ },
76
+ offline: {
77
+ bg: "bg-gray-100",
78
+ text: "text-gray-800"
79
+ },
80
+ on_break: {
81
+ bg: "bg-yellow-100",
82
+ text: "text-yellow-800"
83
+ }
84
+ }, s = {
85
+ sm: "text-xs px-2 py-0.5",
86
+ md: "text-sm px-2.5 py-1",
87
+ lg: "text-base px-3 py-1.5"
88
+ };
89
+ function c({ status: c, type: l = "custom", customColors: u, size: d = "md", showDot: f = !0, className: p }) {
90
+ let m = u;
91
+ if (!m) switch (l) {
92
+ case "order":
93
+ m = i[c] || {
94
+ bg: "bg-gray-100",
95
+ text: "text-gray-700"
96
+ };
97
+ break;
98
+ case "vehicle":
99
+ m = a[c] || {
100
+ bg: "bg-gray-100",
101
+ text: "text-gray-700"
102
+ };
103
+ break;
104
+ case "driver":
105
+ m = o[c] || {
106
+ bg: "bg-gray-100",
107
+ text: "text-gray-700"
108
+ };
109
+ break;
110
+ default: m = {
111
+ bg: "bg-gray-100 dark:bg-gray-800",
112
+ text: "text-gray-700 dark:text-gray-300"
113
+ };
114
+ }
115
+ let h = c.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
116
+ return /* @__PURE__ */ r(e, {
117
+ variant: "outline",
118
+ className: t("font-medium capitalize border-0 whitespace-nowrap inline-flex items-center", m.bg, m.text, s[d], p),
119
+ children: [f && /* @__PURE__ */ n("span", { className: t("w-1.5 h-1.5 rounded-full mr-1.5 flex-shrink-0", m.text.replace("text-", "bg-")) }), h]
120
+ });
121
+ }
122
+ function l({ priority: r, size: i = "md", className: a }) {
123
+ let o = {
124
+ low: {
125
+ bg: "bg-gray-100 dark:bg-gray-800",
126
+ text: "text-gray-600 dark:text-gray-400"
127
+ },
128
+ normal: {
129
+ bg: "bg-blue-100 dark:bg-blue-900/30",
130
+ text: "text-blue-700 dark:text-blue-400"
131
+ },
132
+ high: {
133
+ bg: "bg-orange-100 dark:bg-orange-900/30",
134
+ text: "text-orange-700 dark:text-orange-400"
135
+ },
136
+ urgent: {
137
+ bg: "bg-red-100 dark:bg-red-900/30",
138
+ text: "text-red-700 dark:text-red-400"
139
+ }
140
+ }[r];
141
+ return /* @__PURE__ */ n(e, {
142
+ variant: "outline",
143
+ className: t("font-medium capitalize border-0 whitespace-nowrap", o.bg, o.text, s[i], a),
144
+ children: r
145
+ });
146
+ }
147
+ function u({ type: r, size: i = "md", className: a }) {
148
+ let o = {
149
+ b2b: {
150
+ bg: "bg-purple-100 dark:bg-purple-900/30",
151
+ text: "text-purple-700 dark:text-purple-400"
152
+ },
153
+ b2c: {
154
+ bg: "bg-teal-100 dark:bg-teal-900/30",
155
+ text: "text-teal-700 dark:text-teal-400"
156
+ }
157
+ }[r];
158
+ return /* @__PURE__ */ n(e, {
159
+ variant: "outline",
160
+ className: t("font-medium uppercase border-0 whitespace-nowrap", o.bg, o.text, s[i], a),
161
+ children: r
162
+ });
163
+ }
164
+ function d({ status: r, size: i = "md", className: a }) {
165
+ let o = {
166
+ pending: {
167
+ bg: "bg-yellow-100 dark:bg-yellow-900/30",
168
+ text: "text-yellow-700 dark:text-yellow-400"
169
+ },
170
+ paid: {
171
+ bg: "bg-green-100 dark:bg-green-900/30",
172
+ text: "text-green-700 dark:text-green-400"
173
+ },
174
+ failed: {
175
+ bg: "bg-red-100 dark:bg-red-900/30",
176
+ text: "text-red-700 dark:text-red-400"
177
+ },
178
+ refunded: {
179
+ bg: "bg-gray-100 dark:bg-gray-800",
180
+ text: "text-gray-700 dark:text-gray-400"
181
+ }
182
+ }[r];
183
+ return /* @__PURE__ */ n(e, {
184
+ variant: "outline",
185
+ className: t("font-medium capitalize border-0 whitespace-nowrap", o.bg, o.text, s[i], a),
186
+ children: r
187
+ });
188
+ }
189
+ function f({ type: i, size: a = "md", className: o }) {
190
+ return /* @__PURE__ */ r(e, {
191
+ variant: "outline",
192
+ className: t("font-medium capitalize whitespace-nowrap inline-flex items-center", s[a], o),
193
+ children: [/* @__PURE__ */ n("span", {
194
+ className: "mr-1",
195
+ children: {
196
+ van: "🚐",
197
+ truck: "🚚",
198
+ motorcycle: "🏍️",
199
+ bicycle: "🚲",
200
+ car: "🚗"
201
+ }[i]
202
+ }), i]
203
+ });
204
+ }
205
+ //#endregion
206
+ export { f as a, u as i, l as n, c as r, d as t };
@@ -0,0 +1,322 @@
1
+ import { A as e, d as t, f as n, g as r, h as i, i as a, t as o, u as s } from "./PageLayout-B7b0vl0R.js";
2
+ import { t as c } from "./circle-alert-D5f6RZxt.js";
3
+ import { t as l } from "./circle-check-big-D-JMHcTe.js";
4
+ import { t as u } from "./clock-CvwBKbQP.js";
5
+ import { t as d } from "./map-pin-CFBOmh-A.js";
6
+ import { t as f } from "./package-DVZbDRcV.js";
7
+ import { t as p } from "./search-5pdn5eOO.js";
8
+ import { t as m } from "./truck-BmDAzu05.js";
9
+ import { r as h } from "./graphqlClient-CdJyR_ed.js";
10
+ import { i as g } from "./useTracking-De2KIUNu.js";
11
+ import { r as _ } from "./StatusBadge-BrrwraIA.js";
12
+ import { r as v, t as y } from "./formatters-_vJlC-47.js";
13
+ import { t as b } from "./navigation-BgnOfsVd.js";
14
+ import { useState as x } from "react";
15
+ import { useSearchParams as S } from "react-router-dom";
16
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
17
+ import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
+ //#region src/movethewheels/pages/TrackingPage.tsx
19
+ function E() {
20
+ let { t: E } = T(), D = (e, t) => {
21
+ let n = E(e);
22
+ return n === e ? t : n;
23
+ }, { basePath: O, navigate: k } = h(), [A] = S(), j = A.get("order") || "", [M, N] = x(j), [P, F] = x(j), { tracking: I, order: L, isLoading: R, error: z } = g(P || void 0), B = (e) => {
24
+ e.preventDefault(), F(M);
25
+ }, V = (e) => {
26
+ k && k(b(O, e));
27
+ };
28
+ return /* @__PURE__ */ w(a, {
29
+ title: D("movethewheels.tracking.title", "Track Shipment"),
30
+ subtitle: D("movethewheels.tracking.subtitle", "Enter a tracking number or order ID to track your shipment"),
31
+ icon: /* @__PURE__ */ C(d, { size: 24 }),
32
+ headerActions: /* @__PURE__ */ w(s, {
33
+ variant: "outline",
34
+ onClick: () => V("tracking/live"),
35
+ children: [/* @__PURE__ */ C(d, { size: 16 }), D("movethewheels.tracking.actions.liveMapView", "Live Map View")]
36
+ }),
37
+ children: [
38
+ /* @__PURE__ */ C(t, { children: /* @__PURE__ */ C(n, {
39
+ className: "p-6",
40
+ children: /* @__PURE__ */ w("form", {
41
+ onSubmit: B,
42
+ className: "flex gap-4",
43
+ children: [/* @__PURE__ */ w("div", {
44
+ className: "flex-1 relative",
45
+ children: [/* @__PURE__ */ C(p, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground" }), /* @__PURE__ */ C(e, {
46
+ value: M,
47
+ onChange: (e) => N(e.target.value),
48
+ placeholder: D("movethewheels.tracking.search.placeholder", "Enter tracking number or order ID (e.g., order-1 or TRK123456789)"),
49
+ className: "pl-10 h-12 text-lg"
50
+ })]
51
+ }), /* @__PURE__ */ C(s, {
52
+ type: "submit",
53
+ size: "lg",
54
+ disabled: !M || R,
55
+ children: R ? D("movethewheels.tracking.search.searching", "Searching...") : D("movethewheels.tracking.search.track", "Track")
56
+ })]
57
+ })
58
+ }) }),
59
+ z && /* @__PURE__ */ C(t, {
60
+ className: "border-destructive",
61
+ children: /* @__PURE__ */ C(n, {
62
+ className: "p-6",
63
+ children: /* @__PURE__ */ w("div", {
64
+ className: "flex items-center gap-4",
65
+ children: [/* @__PURE__ */ C(c, { className: "w-8 h-8 text-destructive" }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
66
+ className: "font-medium text-destructive",
67
+ children: D("movethewheels.tracking.error.title", "Unable to find shipment")
68
+ }), /* @__PURE__ */ C("p", {
69
+ className: "text-sm text-muted-foreground",
70
+ children: D("movethewheels.tracking.error.description", "Please check the tracking number and try again")
71
+ })] })]
72
+ })
73
+ })
74
+ }),
75
+ !P && !z && /* @__PURE__ */ C(o, {
76
+ icon: /* @__PURE__ */ C(f, { size: 48 }),
77
+ title: D("movethewheels.tracking.empty.title", "Enter a tracking number"),
78
+ description: D("movethewheels.tracking.empty.description", "Use your tracking number or order ID to see the current status of your shipment")
79
+ }),
80
+ L && I && /* @__PURE__ */ w("div", {
81
+ className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
82
+ children: [/* @__PURE__ */ w("div", {
83
+ className: "lg:col-span-2 space-y-6",
84
+ children: [
85
+ /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(i, { children: /* @__PURE__ */ w("div", {
86
+ className: "flex items-center justify-between",
87
+ children: [/* @__PURE__ */ w(r, {
88
+ className: "flex items-center gap-2",
89
+ children: [
90
+ /* @__PURE__ */ C(f, { size: 20 }),
91
+ D("movethewheels.tracking.orderLabel", "Order"),
92
+ " ",
93
+ L.orderNumber
94
+ ]
95
+ }), /* @__PURE__ */ C(_, {
96
+ status: L.status,
97
+ type: "order"
98
+ })]
99
+ }) }), /* @__PURE__ */ C(n, { children: /* @__PURE__ */ w("div", {
100
+ className: "grid grid-cols-2 md:grid-cols-4 gap-4",
101
+ children: [
102
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
103
+ className: "text-sm text-muted-foreground",
104
+ children: D("movethewheels.tracking.details.trackingNumber", "Tracking Number")
105
+ }), /* @__PURE__ */ C("p", {
106
+ className: "font-mono font-medium",
107
+ children: L.trackingNumber
108
+ })] }),
109
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
110
+ className: "text-sm text-muted-foreground",
111
+ children: D("movethewheels.tracking.details.estimatedDelivery", "Estimated Delivery")
112
+ }), /* @__PURE__ */ C("p", {
113
+ className: "font-medium",
114
+ children: I.estimatedArrival ? v(I.estimatedArrival, "full") : L.scheduledDelivery ? v(L.scheduledDelivery, "full") : D("movethewheels.tracking.details.tbd", "TBD")
115
+ })] }),
116
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
117
+ className: "text-sm text-muted-foreground",
118
+ children: D("movethewheels.tracking.details.items", "Items")
119
+ }), /* @__PURE__ */ w("p", {
120
+ className: "font-medium",
121
+ children: [
122
+ L.items.length,
123
+ " ",
124
+ D("movethewheels.tracking.details.itemsSuffix", "items")
125
+ ]
126
+ })] }),
127
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
128
+ className: "text-sm text-muted-foreground",
129
+ children: D("movethewheels.tracking.details.lastUpdated", "Last Updated")
130
+ }), /* @__PURE__ */ C("p", {
131
+ className: "font-medium",
132
+ children: v(I.lastUpdated, "relative")
133
+ })] })
134
+ ]
135
+ }) })] }),
136
+ /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(i, { children: /* @__PURE__ */ w(r, {
137
+ className: "flex items-center gap-2",
138
+ children: [/* @__PURE__ */ C(u, { size: 18 }), D("movethewheels.tracking.progress.title", "Shipment Progress")]
139
+ }) }), /* @__PURE__ */ w(n, { children: [/* @__PURE__ */ C("div", {
140
+ className: "relative",
141
+ children: /* @__PURE__ */ C("div", {
142
+ className: "flex justify-between mb-4",
143
+ children: [
144
+ {
145
+ status: "confirmed",
146
+ label: D("movethewheels.tracking.progress.confirmed", "Confirmed"),
147
+ icon: l
148
+ },
149
+ {
150
+ status: "picked_up",
151
+ label: D("movethewheels.tracking.progress.pickedUp", "Picked Up"),
152
+ icon: f
153
+ },
154
+ {
155
+ status: "in_transit",
156
+ label: D("movethewheels.tracking.progress.inTransit", "In Transit"),
157
+ icon: m
158
+ },
159
+ {
160
+ status: "delivered",
161
+ label: D("movethewheels.tracking.progress.delivered", "Delivered"),
162
+ icon: d
163
+ }
164
+ ].map((e, t) => {
165
+ let n = [
166
+ "pending",
167
+ "confirmed",
168
+ "assigned",
169
+ "picked_up",
170
+ "in_transit",
171
+ "out_for_delivery",
172
+ "delivered"
173
+ ], r = n.indexOf(L.status), i = n.indexOf(e.status) <= r, a = e.status === L.status || L.status === "out_for_delivery" && e.status === "in_transit";
174
+ return /* @__PURE__ */ w("div", {
175
+ className: "flex flex-col items-center flex-1",
176
+ children: [
177
+ /* @__PURE__ */ C("div", {
178
+ className: `w-10 h-10 rounded-full flex items-center justify-center ${i ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"} ${a ? "ring-4 ring-primary/20" : ""}`,
179
+ children: /* @__PURE__ */ C(e.icon, { size: 20 })
180
+ }),
181
+ /* @__PURE__ */ C("p", {
182
+ className: `text-xs mt-2 text-center ${i ? "font-medium" : "text-muted-foreground"}`,
183
+ children: e.label
184
+ }),
185
+ t < 3 && /* @__PURE__ */ C("div", {
186
+ className: `absolute top-5 h-0.5 ${i ? "bg-primary" : "bg-muted"}`,
187
+ style: {
188
+ left: `calc(${(t + .5) * 25}% + 20px)`,
189
+ width: "calc(25% - 40px)"
190
+ }
191
+ })
192
+ ]
193
+ }, e.status);
194
+ })
195
+ })
196
+ }), /* @__PURE__ */ C("div", {
197
+ className: "mt-8 space-y-4",
198
+ children: L.timeline.slice().reverse().map((e, t) => /* @__PURE__ */ w("div", {
199
+ className: "flex gap-4",
200
+ children: [/* @__PURE__ */ w("div", {
201
+ className: "relative",
202
+ children: [/* @__PURE__ */ C("div", { className: `w-3 h-3 rounded-full ${t === 0 ? "bg-primary" : "bg-muted"}` }), t < L.timeline.length - 1 && /* @__PURE__ */ C("div", { className: "absolute top-3 left-1.5 w-px h-8 -ml-px bg-border" })]
203
+ }), /* @__PURE__ */ w("div", {
204
+ className: "flex-1 pb-4",
205
+ children: [
206
+ /* @__PURE__ */ w("div", {
207
+ className: "flex items-center gap-2",
208
+ children: [/* @__PURE__ */ C(_, {
209
+ status: e.status,
210
+ type: "order",
211
+ size: "sm"
212
+ }), /* @__PURE__ */ C("span", {
213
+ className: "text-sm text-muted-foreground",
214
+ children: v(e.timestamp, "full")
215
+ })]
216
+ }),
217
+ e.notes && /* @__PURE__ */ C("p", {
218
+ className: "text-sm mt-1",
219
+ children: e.notes
220
+ }),
221
+ e.location && /* @__PURE__ */ w("p", {
222
+ className: "text-xs text-muted-foreground mt-1",
223
+ children: [/* @__PURE__ */ C(d, {
224
+ size: 12,
225
+ className: "inline mr-1"
226
+ }), y(e.location)]
227
+ })
228
+ ]
229
+ })]
230
+ }, t))
231
+ })] })] }),
232
+ I.alerts && I.alerts.length > 0 && /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(i, { children: /* @__PURE__ */ w(r, {
233
+ className: "flex items-center gap-2",
234
+ children: [/* @__PURE__ */ C(c, { size: 18 }), D("movethewheels.tracking.alerts.title", "Alerts")]
235
+ }) }), /* @__PURE__ */ C(n, { children: /* @__PURE__ */ C("div", {
236
+ className: "space-y-3",
237
+ children: I.alerts.map((e) => /* @__PURE__ */ w("div", {
238
+ className: `flex items-start gap-3 p-3 rounded-lg ${e.severity === "critical" ? "bg-red-50 dark:bg-red-900/20" : e.severity === "high" ? "bg-orange-50 dark:bg-orange-900/20" : "bg-yellow-50 dark:bg-yellow-900/20"}`,
239
+ children: [/* @__PURE__ */ C(c, {
240
+ size: 16,
241
+ className: e.severity === "critical" ? "text-red-600" : e.severity === "high" ? "text-orange-600" : "text-yellow-600"
242
+ }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
243
+ className: "text-sm font-medium",
244
+ children: e.message
245
+ }), /* @__PURE__ */ w("p", {
246
+ className: "text-xs text-muted-foreground",
247
+ children: [v(e.timestamp, "relative"), e.resolvedAt && ` - ${D("movethewheels.tracking.alerts.resolved", "Resolved")}`]
248
+ })] })]
249
+ }, e.id))
250
+ }) })] })
251
+ ]
252
+ }), /* @__PURE__ */ w("div", {
253
+ className: "space-y-6",
254
+ children: [
255
+ /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(i, { children: /* @__PURE__ */ w(r, {
256
+ className: "flex items-center gap-2",
257
+ children: [/* @__PURE__ */ C(d, { size: 18 }), D("movethewheels.tracking.location.title", "Current Location")]
258
+ }) }), /* @__PURE__ */ w(n, { children: [
259
+ /* @__PURE__ */ C("div", {
260
+ className: "aspect-video bg-muted rounded-lg flex items-center justify-center mb-4",
261
+ children: /* @__PURE__ */ w("div", {
262
+ className: "text-center text-muted-foreground",
263
+ children: [/* @__PURE__ */ C(d, {
264
+ size: 32,
265
+ className: "mx-auto mb-2"
266
+ }), /* @__PURE__ */ C("p", {
267
+ className: "text-sm",
268
+ children: D("movethewheels.tracking.location.mapView", "Map View")
269
+ })]
270
+ })
271
+ }),
272
+ /* @__PURE__ */ C("p", {
273
+ className: "text-sm",
274
+ children: I.currentLocation.address || D("movethewheels.tracking.location.updating", "Location updating...")
275
+ }),
276
+ /* @__PURE__ */ w("p", {
277
+ className: "text-xs text-muted-foreground mt-1",
278
+ children: [
279
+ D("movethewheels.tracking.location.updated", "Updated"),
280
+ " ",
281
+ v(I.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")
282
+ ]
283
+ })
284
+ ] })] }),
285
+ /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(r, { children: D("movethewheels.tracking.deliveryAddress.title", "Delivery Address") }) }), /* @__PURE__ */ w(n, { children: [/* @__PURE__ */ C("p", {
286
+ className: "text-sm",
287
+ children: L.customerInfo.name
288
+ }), /* @__PURE__ */ C("p", {
289
+ className: "text-sm text-muted-foreground mt-2",
290
+ children: y(L.deliveryAddress)
291
+ })] })] }),
292
+ /* @__PURE__ */ C(t, { children: /* @__PURE__ */ w(n, {
293
+ className: "p-4 space-y-2",
294
+ children: [/* @__PURE__ */ C(s, {
295
+ variant: "outline",
296
+ className: "w-full",
297
+ onClick: () => V(`orders/${L.id}`),
298
+ children: D("movethewheels.tracking.actions.viewOrderDetails", "View Order Details")
299
+ }), /* @__PURE__ */ C(s, {
300
+ variant: "outline",
301
+ className: "w-full",
302
+ children: D("movethewheels.tracking.actions.contactDriver", "Contact Driver")
303
+ })]
304
+ }) })
305
+ ]
306
+ })]
307
+ }),
308
+ P && !L && !R && !z && /* @__PURE__ */ C(o, {
309
+ icon: /* @__PURE__ */ C(p, { size: 48 }),
310
+ title: D("movethewheels.tracking.notFound.title", "Shipment not found"),
311
+ description: `${D("movethewheels.tracking.notFound.descriptionPrefix", "No shipment found with tracking number")} "${P}"`,
312
+ action: /* @__PURE__ */ C(s, {
313
+ variant: "outline",
314
+ onClick: () => N(""),
315
+ children: D("movethewheels.tracking.notFound.tryAnother", "Try another number")
316
+ })
317
+ })
318
+ ]
319
+ });
320
+ }
321
+ //#endregion
322
+ export { E as default };