@burdenoff/microfe-adaptercloud 2026.614.1

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 (132) hide show
  1. package/README.md +12 -0
  2. package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
  3. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
  4. package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
  5. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
  6. package/dist/adaptercloud/components/EmptyState.js +28 -0
  7. package/dist/adaptercloud/components/EmptyState.js.map +1 -0
  8. package/dist/adaptercloud/components/InvestmentCard.js +96 -0
  9. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
  10. package/dist/adaptercloud/components/MetricsCard.js +46 -0
  11. package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
  12. package/dist/adaptercloud/components/PageLayout.js +26 -0
  13. package/dist/adaptercloud/components/PageLayout.js.map +1 -0
  14. package/dist/adaptercloud/components/RatingDisplay.js +35 -0
  15. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
  16. package/dist/adaptercloud/components/StatusBadge.js +45 -0
  17. package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
  18. package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
  19. package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
  20. package/dist/adaptercloud/context/index.js +1 -0
  21. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
  22. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
  23. package/dist/adaptercloud/index.js +7 -0
  24. package/dist/adaptercloud/mocks/data.js +1517 -0
  25. package/dist/adaptercloud/mocks/data.js.map +1 -0
  26. package/dist/adaptercloud/mocks/users.js +34 -0
  27. package/dist/adaptercloud/mocks/users.js.map +1 -0
  28. package/dist/adaptercloud/pages/HomePage.js +921 -0
  29. package/dist/adaptercloud/pages/HomePage.js.map +1 -0
  30. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
  31. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
  32. package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
  33. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
  34. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
  35. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
  36. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
  37. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
  38. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
  39. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
  40. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
  41. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
  42. package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
  43. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
  44. package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
  45. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
  46. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
  47. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
  48. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
  49. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
  50. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
  51. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
  52. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
  53. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
  54. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
  55. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
  56. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
  57. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
  58. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
  59. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
  60. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
  61. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
  62. package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
  63. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
  64. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
  65. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
  66. package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
  67. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
  68. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
  69. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
  70. package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
  71. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
  72. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
  73. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
  74. package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
  75. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
  76. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
  77. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
  78. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
  79. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
  80. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
  81. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
  82. package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
  83. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
  84. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
  85. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
  86. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
  87. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
  88. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
  89. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
  90. package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
  91. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
  92. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
  93. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
  94. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
  95. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
  96. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
  97. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
  98. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
  99. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
  100. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
  101. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
  102. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
  103. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
  104. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
  105. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
  106. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
  107. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
  108. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
  109. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
  110. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
  111. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
  112. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
  113. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
  114. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
  115. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
  116. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
  117. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
  118. package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
  119. package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
  120. package/dist/adaptercloud/store/index.js +1 -0
  121. package/dist/adaptercloud/utils/cn.js +10 -0
  122. package/dist/adaptercloud/utils/cn.js.map +1 -0
  123. package/dist/adaptercloud/utils/formatters.js +51 -0
  124. package/dist/adaptercloud/utils/formatters.js.map +1 -0
  125. package/dist/adaptercloud/utils/navigation.js +9 -0
  126. package/dist/adaptercloud/utils/navigation.js.map +1 -0
  127. package/dist/index.js +7 -0
  128. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
  129. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  130. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  131. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  132. package/package.json +106 -0
@@ -0,0 +1,675 @@
1
+ import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
2
+ import { cn as t } from "../../utils/cn.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { StatusBadge as r } from "../../components/StatusBadge.js";
5
+ import { EmptyState as i } from "../../components/EmptyState.js";
6
+ import { formatCurrency as a } from "../../utils/formatters.js";
7
+ import { useCallback as o, useEffect as s, useState as c } from "react";
8
+ import { AlertTriangle as l, ArrowRight as u, CheckCircle2 as d, ChefHat as f, ClipboardList as p, CreditCard as m, Loader2 as h, MapPin as g, Navigation as _, Package as v, Phone as y, PlayCircle as b, ShoppingBag as x, Star as S, Truck as C } from "lucide-react";
9
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
10
+ //#region src/adaptercloud/pages/worker/WorkerOrdersPage.tsx
11
+ var E = [
12
+ {
13
+ id: "task-001",
14
+ orderId: "ORD-2024-001",
15
+ cartId: "cart-001",
16
+ cartName: "South Indian Express",
17
+ type: "delivery",
18
+ status: "pending",
19
+ priority: "high",
20
+ customerName: "Rahul Sharma",
21
+ customerPhone: "+91-98765-43210",
22
+ items: [{
23
+ name: "Masala Dosa",
24
+ quantity: 2
25
+ }, {
26
+ name: "Filter Coffee",
27
+ quantity: 2
28
+ }],
29
+ address: {
30
+ addressLine1: "123, MG Road",
31
+ addressLine2: "Near Central Mall",
32
+ landmark: "Opposite SBI Bank",
33
+ city: "Bangalore",
34
+ pincode: "560001"
35
+ },
36
+ estimatedTime: new Date(Date.now() + 1800 * 1e3).toISOString(),
37
+ assignedTime: (/* @__PURE__ */ new Date(Date.now() - 300 * 1e3)).toISOString(),
38
+ distance: 3.5,
39
+ specialInstructions: "Please call before delivery",
40
+ payment: {
41
+ method: "Cash",
42
+ amount: 295,
43
+ status: "pending"
44
+ }
45
+ },
46
+ {
47
+ id: "task-002",
48
+ orderId: "ORD-2024-002",
49
+ cartId: "cart-001",
50
+ cartName: "South Indian Express",
51
+ type: "pickup",
52
+ status: "in_progress",
53
+ priority: "medium",
54
+ customerName: "Priya Patel",
55
+ customerPhone: "+91-98765-43211",
56
+ items: [{
57
+ name: "Idli Sambar",
58
+ quantity: 3
59
+ }],
60
+ estimatedTime: new Date(Date.now() + 900 * 1e3).toISOString(),
61
+ assignedTime: (/* @__PURE__ */ new Date(Date.now() - 600 * 1e3)).toISOString(),
62
+ specialInstructions: "",
63
+ payment: {
64
+ method: "Online",
65
+ amount: 198,
66
+ status: "completed"
67
+ }
68
+ },
69
+ {
70
+ id: "task-003",
71
+ orderId: "ORD-2024-003",
72
+ cartId: "cart-002",
73
+ cartName: "Chaat Corner",
74
+ type: "preparation",
75
+ status: "pending",
76
+ priority: "urgent",
77
+ customerName: "Amit Kumar",
78
+ customerPhone: "+91-98765-43212",
79
+ items: [{
80
+ name: "Pani Puri",
81
+ quantity: 2
82
+ }, {
83
+ name: "Bhel Puri",
84
+ quantity: 1
85
+ }],
86
+ estimatedTime: new Date(Date.now() + 1200 * 1e3).toISOString(),
87
+ assignedTime: (/* @__PURE__ */ new Date(Date.now() - 120 * 1e3)).toISOString(),
88
+ specialInstructions: "Extra spicy",
89
+ payment: {
90
+ method: "UPI",
91
+ amount: 150,
92
+ status: "completed"
93
+ }
94
+ },
95
+ {
96
+ id: "task-004",
97
+ orderId: "ORD-2024-004",
98
+ cartId: "cart-003",
99
+ cartName: "Biryani Pot",
100
+ type: "delivery",
101
+ status: "completed",
102
+ priority: "medium",
103
+ customerName: "Deepa Nair",
104
+ customerPhone: "+91-98765-43213",
105
+ items: [{
106
+ name: "Chicken Biryani",
107
+ quantity: 1
108
+ }, {
109
+ name: "Raita",
110
+ quantity: 1
111
+ }],
112
+ address: {
113
+ addressLine1: "456, Brigade Road",
114
+ city: "Bangalore",
115
+ pincode: "560025"
116
+ },
117
+ estimatedTime: (/* @__PURE__ */ new Date(Date.now() - 1800 * 1e3)).toISOString(),
118
+ assignedTime: (/* @__PURE__ */ new Date(Date.now() - 5400 * 1e3)).toISOString(),
119
+ distance: 2.1,
120
+ payment: {
121
+ method: "Online",
122
+ amount: 340,
123
+ status: "completed"
124
+ }
125
+ }
126
+ ];
127
+ function D(e) {
128
+ let t = /* @__PURE__ */ new Date(), n = new Date(e), r = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60));
129
+ return r < 0 ? "Overdue" : r < 60 ? `${r} min` : `${Math.floor(r / 60)}h ${r % 60}m`;
130
+ }
131
+ function O(e) {
132
+ switch (e) {
133
+ case "delivery": return {
134
+ icon: C,
135
+ label: "Delivery",
136
+ style: "bg-purple-500/20 text-purple-600 dark:text-purple-400"
137
+ };
138
+ case "pickup": return {
139
+ icon: x,
140
+ label: "Pickup",
141
+ style: "bg-blue-500/20 text-blue-600 dark:text-blue-400"
142
+ };
143
+ case "preparation": return {
144
+ icon: f,
145
+ label: "Preparation",
146
+ style: "bg-green-500/20 text-green-600 dark:text-green-400"
147
+ };
148
+ default: return {
149
+ icon: v,
150
+ label: e,
151
+ style: "bg-secondary text-secondary-foreground"
152
+ };
153
+ }
154
+ }
155
+ function k(e) {
156
+ switch (e) {
157
+ case "urgent": return "bg-red-500/20 text-red-600 dark:text-red-400";
158
+ case "high": return "bg-orange-500/20 text-orange-600 dark:text-orange-400";
159
+ case "medium": return "bg-yellow-500/20 text-yellow-600 dark:text-yellow-400";
160
+ case "low": return "bg-green-500/20 text-green-600 dark:text-green-400";
161
+ default: return "bg-secondary text-secondary-foreground";
162
+ }
163
+ }
164
+ var A = () => {
165
+ let { navigateTo: f } = e(), [v, x] = c(!0), [C, A] = c([]), [j, M] = c(null), [N, P] = c({
166
+ status: "",
167
+ type: "",
168
+ priority: "",
169
+ sortBy: "priority"
170
+ }), [F, I] = c({
171
+ totalTasks: 0,
172
+ completedToday: 0,
173
+ pendingTasks: 0,
174
+ averageTime: 0,
175
+ earnings: 0,
176
+ rating: 4.8
177
+ }), [, L] = c(0);
178
+ s(() => {
179
+ let e = setInterval(() => L((e) => e + 1), 6e4);
180
+ return () => clearInterval(e);
181
+ }, []);
182
+ let R = o(() => {
183
+ x(!0), setTimeout(() => {
184
+ let e = [...E];
185
+ N.status && (e = e.filter((e) => e.status === N.status)), N.type && (e = e.filter((e) => e.type === N.type)), N.priority && (e = e.filter((e) => e.priority === N.priority));
186
+ let t = {
187
+ urgent: 0,
188
+ high: 1,
189
+ medium: 2,
190
+ low: 3
191
+ };
192
+ switch (N.sortBy) {
193
+ case "priority":
194
+ e.sort((e, n) => (t[e.priority] ?? 4) - (t[n.priority] ?? 4));
195
+ break;
196
+ case "time":
197
+ e.sort((e, t) => new Date(e.estimatedTime).getTime() - new Date(t.estimatedTime).getTime());
198
+ break;
199
+ case "distance":
200
+ e.sort((e, t) => (e.distance ?? 999) - (t.distance ?? 999));
201
+ break;
202
+ }
203
+ A(e), M(E.find((e) => e.status === "in_progress") ?? null), I({
204
+ totalTasks: 45,
205
+ completedToday: 12,
206
+ pendingTasks: 3,
207
+ averageTime: 22,
208
+ earnings: 2450,
209
+ rating: 4.8
210
+ }), x(!1);
211
+ }, 600);
212
+ }, [N]);
213
+ s(() => {
214
+ R();
215
+ }, [R]);
216
+ let z = (e, t) => {
217
+ P((n) => ({
218
+ ...n,
219
+ [e]: t
220
+ }));
221
+ }, B = (e) => {
222
+ let t = E.find((t) => t.id === e);
223
+ t && (t.status = "in_progress", M(t), R());
224
+ }, V = (e) => {
225
+ let t = E.find((t) => t.id === e);
226
+ t && (t.status = "completed"), M(null), R(), alert("Task completed successfully");
227
+ }, H = (e) => {
228
+ window.location.href = `tel:${e.replace(/\s/g, "")}`;
229
+ }, U = (e) => {
230
+ if (e.address) {
231
+ let t = encodeURIComponent(`${e.address.addressLine1}, ${e.address.city}`);
232
+ window.open(`https://maps.google.com?q=${t}`, "_blank");
233
+ }
234
+ };
235
+ return v ? /* @__PURE__ */ w(n, {
236
+ title: "My Orders",
237
+ description: "Manage your assigned orders",
238
+ children: /* @__PURE__ */ w("div", {
239
+ className: "flex items-center justify-center py-24",
240
+ children: /* @__PURE__ */ T("div", {
241
+ className: "text-center",
242
+ children: [/* @__PURE__ */ w(h, { className: "h-10 w-10 animate-spin text-muted-foreground mx-auto mb-4" }), /* @__PURE__ */ w("p", {
243
+ className: "text-sm text-muted-foreground",
244
+ children: "Loading tasks..."
245
+ })]
246
+ })
247
+ })
248
+ }) : /* @__PURE__ */ w(n, {
249
+ title: "My Orders",
250
+ description: "Manage your assigned orders",
251
+ children: /* @__PURE__ */ T("div", {
252
+ className: "space-y-6",
253
+ children: [
254
+ /* @__PURE__ */ T("div", {
255
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",
256
+ children: [
257
+ /* @__PURE__ */ T("div", {
258
+ className: "rounded-lg border border-border bg-card p-4 shadow-sm",
259
+ children: [/* @__PURE__ */ w("p", {
260
+ className: "text-xs text-muted-foreground",
261
+ children: "Today's Tasks"
262
+ }), /* @__PURE__ */ w("p", {
263
+ className: "text-2xl font-bold text-foreground",
264
+ children: F.totalTasks
265
+ })]
266
+ }),
267
+ /* @__PURE__ */ T("div", {
268
+ className: "rounded-lg border border-green-500/20 bg-green-500/5 p-4 shadow-sm",
269
+ children: [/* @__PURE__ */ w("p", {
270
+ className: "text-xs text-green-600 dark:text-green-400",
271
+ children: "Completed"
272
+ }), /* @__PURE__ */ w("p", {
273
+ className: "text-2xl font-bold text-green-600 dark:text-green-400",
274
+ children: F.completedToday
275
+ })]
276
+ }),
277
+ /* @__PURE__ */ T("div", {
278
+ className: "rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 shadow-sm",
279
+ children: [/* @__PURE__ */ w("p", {
280
+ className: "text-xs text-yellow-600 dark:text-yellow-400",
281
+ children: "Pending"
282
+ }), /* @__PURE__ */ w("p", {
283
+ className: "text-2xl font-bold text-yellow-600 dark:text-yellow-400",
284
+ children: F.pendingTasks
285
+ })]
286
+ }),
287
+ /* @__PURE__ */ T("div", {
288
+ className: "rounded-lg border border-border bg-card p-4 shadow-sm",
289
+ children: [/* @__PURE__ */ w("p", {
290
+ className: "text-xs text-muted-foreground",
291
+ children: "Avg Time"
292
+ }), /* @__PURE__ */ T("p", {
293
+ className: "text-2xl font-bold text-foreground",
294
+ children: [F.averageTime, " min"]
295
+ })]
296
+ }),
297
+ /* @__PURE__ */ T("div", {
298
+ className: "rounded-lg border border-border bg-card p-4 shadow-sm",
299
+ children: [/* @__PURE__ */ w("p", {
300
+ className: "text-xs text-muted-foreground",
301
+ children: "Today's Earnings"
302
+ }), /* @__PURE__ */ w("p", {
303
+ className: "text-2xl font-bold text-foreground",
304
+ children: a(F.earnings, { minimumFractionDigits: 0 })
305
+ })]
306
+ }),
307
+ /* @__PURE__ */ T("div", {
308
+ className: "rounded-lg border border-border bg-card p-4 shadow-sm",
309
+ children: [/* @__PURE__ */ w("p", {
310
+ className: "text-xs text-muted-foreground",
311
+ children: "Rating"
312
+ }), /* @__PURE__ */ T("p", {
313
+ className: "text-2xl font-bold text-foreground flex items-center gap-1",
314
+ children: [/* @__PURE__ */ w(S, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }), F.rating]
315
+ })]
316
+ })
317
+ ]
318
+ }),
319
+ j && /* @__PURE__ */ T("div", {
320
+ className: "rounded-lg border-2 border-blue-500/30 bg-blue-500/5 p-5",
321
+ children: [/* @__PURE__ */ w("h2", {
322
+ className: "text-base font-semibold text-blue-600 dark:text-blue-400 mb-4",
323
+ children: "Current Task"
324
+ }), /* @__PURE__ */ T("div", {
325
+ className: "rounded-lg border border-border bg-card p-4",
326
+ children: [/* @__PURE__ */ T("div", {
327
+ className: "flex items-center justify-between mb-4",
328
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
329
+ className: "flex items-center gap-2 flex-wrap",
330
+ children: [
331
+ /* @__PURE__ */ T("h3", {
332
+ className: "text-sm font-semibold text-foreground",
333
+ children: ["Order #", j.orderId]
334
+ }),
335
+ (() => {
336
+ let e = O(j.type), n = e.icon;
337
+ return /* @__PURE__ */ T("span", {
338
+ className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", e.style),
339
+ children: [/* @__PURE__ */ w(n, { className: "h-3 w-3" }), e.label]
340
+ });
341
+ })(),
342
+ /* @__PURE__ */ w("span", {
343
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", k(j.priority)),
344
+ children: j.priority
345
+ })
346
+ ]
347
+ }), /* @__PURE__ */ w("p", {
348
+ className: "text-xs text-muted-foreground mt-1",
349
+ children: j.cartName
350
+ })] }), /* @__PURE__ */ T("div", {
351
+ className: "text-right",
352
+ children: [/* @__PURE__ */ w("p", {
353
+ className: "text-xl font-bold text-blue-600 dark:text-blue-400",
354
+ children: D(j.estimatedTime)
355
+ }), /* @__PURE__ */ w("p", {
356
+ className: "text-xs text-muted-foreground",
357
+ children: "Time remaining"
358
+ })]
359
+ })]
360
+ }), /* @__PURE__ */ T("div", {
361
+ className: "border-t border-border pt-4",
362
+ children: [
363
+ /* @__PURE__ */ T("div", {
364
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
365
+ children: [/* @__PURE__ */ T("div", { children: [
366
+ /* @__PURE__ */ w("p", {
367
+ className: "text-xs font-medium text-muted-foreground",
368
+ children: "Customer"
369
+ }),
370
+ /* @__PURE__ */ w("p", {
371
+ className: "text-sm font-medium text-foreground",
372
+ children: j.customerName
373
+ }),
374
+ j.address && /* @__PURE__ */ T("p", {
375
+ className: "text-xs text-muted-foreground mt-1",
376
+ children: [
377
+ j.address.addressLine1,
378
+ ", ",
379
+ j.address.city
380
+ ]
381
+ })
382
+ ] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
383
+ className: "text-xs font-medium text-muted-foreground",
384
+ children: "Items"
385
+ }), /* @__PURE__ */ w("div", {
386
+ className: "space-y-0.5",
387
+ children: j.items.map((e, t) => /* @__PURE__ */ T("p", {
388
+ className: "text-xs text-foreground",
389
+ children: [
390
+ e.quantity,
391
+ "x ",
392
+ e.name
393
+ ]
394
+ }, t))
395
+ })] })]
396
+ }),
397
+ j.specialInstructions && /* @__PURE__ */ T("div", {
398
+ className: "mt-3 p-3 rounded-md bg-yellow-500/10 border border-yellow-500/20",
399
+ children: [/* @__PURE__ */ T("p", {
400
+ className: "text-xs font-medium text-yellow-600 dark:text-yellow-400 flex items-center gap-1",
401
+ children: [/* @__PURE__ */ w(l, { className: "h-3 w-3" }), "Special Instructions:"]
402
+ }), /* @__PURE__ */ w("p", {
403
+ className: "text-xs text-yellow-700 dark:text-yellow-300 mt-0.5",
404
+ children: j.specialInstructions
405
+ })]
406
+ }),
407
+ /* @__PURE__ */ T("div", {
408
+ className: "flex flex-wrap gap-2 mt-4",
409
+ children: [
410
+ /* @__PURE__ */ T("button", {
411
+ type: "button",
412
+ onClick: () => H(j.customerPhone),
413
+ className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
414
+ children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call Customer"]
415
+ }),
416
+ j.type === "delivery" && j.address && /* @__PURE__ */ T("button", {
417
+ type: "button",
418
+ onClick: () => U(j),
419
+ className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
420
+ children: [/* @__PURE__ */ w(_, { className: "h-3.5 w-3.5" }), "Navigate"]
421
+ }),
422
+ /* @__PURE__ */ T("button", {
423
+ type: "button",
424
+ onClick: () => V(j.id),
425
+ className: "ml-auto inline-flex items-center gap-1.5 rounded-md bg-green-500/10 px-3 py-2 text-xs font-medium text-green-600 dark:text-green-400 hover:bg-green-500/20 transition-colors",
426
+ children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete Task"]
427
+ })
428
+ ]
429
+ })
430
+ ]
431
+ })]
432
+ })]
433
+ }),
434
+ /* @__PURE__ */ w("div", {
435
+ className: "rounded-lg border border-border bg-card p-4 shadow-sm",
436
+ children: /* @__PURE__ */ T("div", {
437
+ className: "grid grid-cols-1 md:grid-cols-4 gap-3",
438
+ children: [
439
+ /* @__PURE__ */ T("select", {
440
+ value: N.status,
441
+ onChange: (e) => z("status", e.target.value),
442
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40",
443
+ children: [
444
+ /* @__PURE__ */ w("option", {
445
+ value: "",
446
+ children: "All Tasks"
447
+ }),
448
+ /* @__PURE__ */ w("option", {
449
+ value: "pending",
450
+ children: "Pending Tasks"
451
+ }),
452
+ /* @__PURE__ */ w("option", {
453
+ value: "in_progress",
454
+ children: "In Progress"
455
+ }),
456
+ /* @__PURE__ */ w("option", {
457
+ value: "completed",
458
+ children: "Completed"
459
+ })
460
+ ]
461
+ }),
462
+ /* @__PURE__ */ T("select", {
463
+ value: N.type,
464
+ onChange: (e) => z("type", e.target.value),
465
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40",
466
+ children: [
467
+ /* @__PURE__ */ w("option", {
468
+ value: "",
469
+ children: "All Types"
470
+ }),
471
+ /* @__PURE__ */ w("option", {
472
+ value: "delivery",
473
+ children: "Delivery"
474
+ }),
475
+ /* @__PURE__ */ w("option", {
476
+ value: "pickup",
477
+ children: "Pickup"
478
+ }),
479
+ /* @__PURE__ */ w("option", {
480
+ value: "preparation",
481
+ children: "Preparation"
482
+ })
483
+ ]
484
+ }),
485
+ /* @__PURE__ */ T("select", {
486
+ value: N.priority,
487
+ onChange: (e) => z("priority", e.target.value),
488
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40",
489
+ children: [
490
+ /* @__PURE__ */ w("option", {
491
+ value: "",
492
+ children: "All Priorities"
493
+ }),
494
+ /* @__PURE__ */ w("option", {
495
+ value: "urgent",
496
+ children: "Urgent"
497
+ }),
498
+ /* @__PURE__ */ w("option", {
499
+ value: "high",
500
+ children: "High"
501
+ }),
502
+ /* @__PURE__ */ w("option", {
503
+ value: "medium",
504
+ children: "Medium"
505
+ }),
506
+ /* @__PURE__ */ w("option", {
507
+ value: "low",
508
+ children: "Low"
509
+ })
510
+ ]
511
+ }),
512
+ /* @__PURE__ */ T("select", {
513
+ value: N.sortBy,
514
+ onChange: (e) => z("sortBy", e.target.value),
515
+ className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40",
516
+ children: [
517
+ /* @__PURE__ */ w("option", {
518
+ value: "priority",
519
+ children: "Sort by Priority"
520
+ }),
521
+ /* @__PURE__ */ w("option", {
522
+ value: "time",
523
+ children: "Sort by Time"
524
+ }),
525
+ /* @__PURE__ */ w("option", {
526
+ value: "distance",
527
+ children: "Sort by Distance"
528
+ })
529
+ ]
530
+ })
531
+ ]
532
+ })
533
+ }),
534
+ C.length === 0 ? /* @__PURE__ */ w(i, {
535
+ icon: /* @__PURE__ */ w(p, { className: "h-12 w-12" }),
536
+ title: "No tasks available",
537
+ description: "Check back later for new tasks"
538
+ }) : /* @__PURE__ */ w("div", {
539
+ className: "space-y-3",
540
+ children: C.map((e) => {
541
+ let n = O(e.type), i = n.icon;
542
+ return /* @__PURE__ */ T("div", {
543
+ className: "rounded-lg border border-border bg-card p-5 shadow-sm hover:shadow-md transition-shadow",
544
+ children: [
545
+ /* @__PURE__ */ T("div", {
546
+ className: "flex items-center justify-between mb-3",
547
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
548
+ className: "flex items-center gap-2 flex-wrap",
549
+ children: [
550
+ /* @__PURE__ */ T("h3", {
551
+ className: "text-sm font-semibold text-foreground",
552
+ children: ["Order #", e.orderId]
553
+ }),
554
+ /* @__PURE__ */ T("span", {
555
+ className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", n.style),
556
+ children: [/* @__PURE__ */ w(i, { className: "h-3 w-3" }), n.label]
557
+ }),
558
+ /* @__PURE__ */ w("span", {
559
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", k(e.priority)),
560
+ children: e.priority
561
+ })
562
+ ]
563
+ }), /* @__PURE__ */ T("p", {
564
+ className: "text-xs text-muted-foreground mt-1",
565
+ children: [
566
+ e.cartName,
567
+ " · ",
568
+ e.customerName
569
+ ]
570
+ })] }), /* @__PURE__ */ T("div", {
571
+ className: "text-right",
572
+ children: [/* @__PURE__ */ w("p", {
573
+ className: "text-lg font-bold text-foreground",
574
+ children: a(e.payment.amount, { minimumFractionDigits: 0 })
575
+ }), /* @__PURE__ */ w("p", {
576
+ className: t("text-xs", e.payment.status === "completed" ? "text-green-600 dark:text-green-400" : "text-yellow-600 dark:text-yellow-400"),
577
+ children: /* @__PURE__ */ T("span", {
578
+ className: "flex items-center gap-1 justify-end",
579
+ children: [/* @__PURE__ */ w(m, { className: "h-3 w-3" }), e.payment.status === "completed" ? "Paid" : "COD"]
580
+ })
581
+ })]
582
+ })]
583
+ }),
584
+ /* @__PURE__ */ T("div", {
585
+ className: "grid grid-cols-1 md:grid-cols-3 gap-3 mb-3 text-sm",
586
+ children: [
587
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
588
+ className: "text-xs text-muted-foreground",
589
+ children: "Items"
590
+ }), /* @__PURE__ */ w("div", {
591
+ className: "text-xs text-foreground",
592
+ children: e.items.map((t, n) => /* @__PURE__ */ T("span", { children: [
593
+ t.quantity,
594
+ "x ",
595
+ t.name,
596
+ n < e.items.length - 1 && ", "
597
+ ] }, n))
598
+ })] }),
599
+ e.address && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
600
+ className: "text-xs text-muted-foreground",
601
+ children: "Delivery Address"
602
+ }), /* @__PURE__ */ w("p", {
603
+ className: "text-xs text-foreground",
604
+ children: e.address.addressLine1
605
+ })] }),
606
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
607
+ className: "text-xs text-muted-foreground",
608
+ children: "Time"
609
+ }), /* @__PURE__ */ w("p", {
610
+ className: t("text-xs font-medium", D(e.estimatedTime) === "Overdue" ? "text-red-600 dark:text-red-400" : "text-foreground"),
611
+ children: D(e.estimatedTime)
612
+ })] })
613
+ ]
614
+ }),
615
+ e.status === "pending" && /* @__PURE__ */ T("div", {
616
+ className: "flex items-center flex-wrap gap-2 border-t border-border pt-3",
617
+ children: [
618
+ /* @__PURE__ */ T("button", {
619
+ type: "button",
620
+ onClick: () => B(e.id),
621
+ disabled: j !== null,
622
+ className: t("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", j === null ? "bg-blue-500/10 text-blue-600 dark:text-blue-400 hover:bg-blue-500/20" : "bg-muted text-muted-foreground cursor-not-allowed"),
623
+ children: [/* @__PURE__ */ w(b, { className: "h-3.5 w-3.5" }), j ? "Complete current first" : "Start Task"]
624
+ }),
625
+ /* @__PURE__ */ T("button", {
626
+ type: "button",
627
+ onClick: () => H(e.customerPhone),
628
+ className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
629
+ children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call"]
630
+ }),
631
+ e.type === "delivery" && e.distance != null && /* @__PURE__ */ T("span", {
632
+ className: "ml-auto text-xs text-muted-foreground flex items-center gap-1",
633
+ children: [
634
+ /* @__PURE__ */ w(g, { className: "h-3 w-3" }),
635
+ e.distance,
636
+ " km away"
637
+ ]
638
+ })
639
+ ]
640
+ }),
641
+ e.status === "in_progress" && e.id !== j?.id && /* @__PURE__ */ T("div", {
642
+ className: "flex items-center gap-2 border-t border-border pt-3",
643
+ children: [/* @__PURE__ */ T("button", {
644
+ type: "button",
645
+ onClick: () => V(e.id),
646
+ className: "inline-flex items-center gap-1.5 rounded-md bg-green-500/10 px-3 py-1.5 text-xs font-medium text-green-600 dark:text-green-400 hover:bg-green-500/20 transition-colors",
647
+ children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete"]
648
+ }), /* @__PURE__ */ T("button", {
649
+ type: "button",
650
+ onClick: () => f(`/worker/task/${e.id}`),
651
+ className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
652
+ children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
653
+ })]
654
+ }),
655
+ e.status === "completed" && /* @__PURE__ */ T("div", {
656
+ className: "flex items-center gap-2 border-t border-border pt-3",
657
+ children: [/* @__PURE__ */ w(r, { status: "completed" }), /* @__PURE__ */ T("button", {
658
+ type: "button",
659
+ onClick: () => f(`/worker/task/${e.id}`),
660
+ className: "ml-auto inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
661
+ children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
662
+ })]
663
+ })
664
+ ]
665
+ }, e.id);
666
+ })
667
+ })
668
+ ]
669
+ })
670
+ });
671
+ };
672
+ //#endregion
673
+ export { A as WorkerOrdersPage };
674
+
675
+ //# sourceMappingURL=WorkerOrdersPage.js.map