@burdenoff/microfe-labsofscience 2026.624.1 → 2026.625.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 (103) hide show
  1. package/dist/labsofscience/components/EmptyState.js +18 -11
  2. package/dist/labsofscience/components/EmptyState.js.map +1 -1
  3. package/dist/labsofscience/components/InvestmentCard.js +26 -24
  4. package/dist/labsofscience/components/InvestmentCard.js.map +1 -1
  5. package/dist/labsofscience/components/MetricsCard.js +19 -13
  6. package/dist/labsofscience/components/MetricsCard.js.map +1 -1
  7. package/dist/labsofscience/components/PageLayout.js +23 -15
  8. package/dist/labsofscience/components/PageLayout.js.map +1 -1
  9. package/dist/labsofscience/components/RatingDisplay.js +1 -1
  10. package/dist/labsofscience/components/RatingDisplay.js.map +1 -1
  11. package/dist/labsofscience/components/StatusBadge.js +34 -15
  12. package/dist/labsofscience/components/StatusBadge.js.map +1 -1
  13. package/dist/labsofscience/pages/HomePage.js +247 -233
  14. package/dist/labsofscience/pages/HomePage.js.map +1 -1
  15. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js +42 -42
  16. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js.map +1 -1
  17. package/dist/labsofscience/pages/admin/AdminDashboard.js +42 -41
  18. package/dist/labsofscience/pages/admin/AdminDashboard.js.map +1 -1
  19. package/dist/labsofscience/pages/admin/AdminFinancialPage.js +14 -14
  20. package/dist/labsofscience/pages/admin/AdminFinancialPage.js.map +1 -1
  21. package/dist/labsofscience/pages/admin/AdminOrdersPage.js +23 -23
  22. package/dist/labsofscience/pages/admin/AdminOrdersPage.js.map +1 -1
  23. package/dist/labsofscience/pages/admin/AdminProfilePage.js +11 -11
  24. package/dist/labsofscience/pages/admin/AdminProfilePage.js.map +1 -1
  25. package/dist/labsofscience/pages/admin/AdminSettingsPage.js +14 -14
  26. package/dist/labsofscience/pages/admin/AdminSettingsPage.js.map +1 -1
  27. package/dist/labsofscience/pages/admin/CartManagementPage.js +40 -40
  28. package/dist/labsofscience/pages/admin/CartManagementPage.js.map +1 -1
  29. package/dist/labsofscience/pages/admin/UserManagementPage.js +46 -46
  30. package/dist/labsofscience/pages/admin/UserManagementPage.js.map +1 -1
  31. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js +44 -44
  32. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  33. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js +16 -16
  34. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  35. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js +44 -44
  36. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  37. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js +56 -56
  38. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  39. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js +46 -46
  40. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  41. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js +51 -51
  42. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  43. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js +52 -52
  44. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js.map +1 -1
  45. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js +48 -48
  46. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js.map +1 -1
  47. package/dist/labsofscience/pages/common/HelpSupportPage.js +65 -65
  48. package/dist/labsofscience/pages/common/HelpSupportPage.js.map +1 -1
  49. package/dist/labsofscience/pages/common/NotificationCenterPage.js +46 -45
  50. package/dist/labsofscience/pages/common/NotificationCenterPage.js.map +1 -1
  51. package/dist/labsofscience/pages/common/SettingsPage.js +45 -45
  52. package/dist/labsofscience/pages/common/SettingsPage.js.map +1 -1
  53. package/dist/labsofscience/pages/customer/BookingDetailsPage.js +24 -23
  54. package/dist/labsofscience/pages/customer/BookingDetailsPage.js.map +1 -1
  55. package/dist/labsofscience/pages/customer/CartDetailPage.js +28 -27
  56. package/dist/labsofscience/pages/customer/CartDetailPage.js.map +1 -1
  57. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js +22 -21
  58. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js.map +1 -1
  59. package/dist/labsofscience/pages/customer/CheckoutPage.js +26 -26
  60. package/dist/labsofscience/pages/customer/CheckoutPage.js.map +1 -1
  61. package/dist/labsofscience/pages/customer/CustomerDashboard.js +38 -38
  62. package/dist/labsofscience/pages/customer/CustomerDashboard.js.map +1 -1
  63. package/dist/labsofscience/pages/customer/CustomerProfilePage.js +36 -36
  64. package/dist/labsofscience/pages/customer/CustomerProfilePage.js.map +1 -1
  65. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js +37 -36
  66. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js.map +1 -1
  67. package/dist/labsofscience/pages/customer/FavoritesPage.js +16 -15
  68. package/dist/labsofscience/pages/customer/FavoritesPage.js.map +1 -1
  69. package/dist/labsofscience/pages/customer/OrderHistoryPage.js +18 -17
  70. package/dist/labsofscience/pages/customer/OrderHistoryPage.js.map +1 -1
  71. package/dist/labsofscience/pages/customer/OrderTrackingPage.js +21 -20
  72. package/dist/labsofscience/pages/customer/OrderTrackingPage.js.map +1 -1
  73. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js +21 -20
  74. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js.map +1 -1
  75. package/dist/labsofscience/pages/customer/ReviewsPage.js +28 -27
  76. package/dist/labsofscience/pages/customer/ReviewsPage.js.map +1 -1
  77. package/dist/labsofscience/pages/customer/SavedAddressesPage.js +25 -24
  78. package/dist/labsofscience/pages/customer/SavedAddressesPage.js.map +1 -1
  79. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js +45 -45
  80. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js.map +1 -1
  81. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js +32 -31
  82. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  83. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js +38 -38
  84. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  85. package/dist/labsofscience/pages/investor/InvestorDashboard.js +26 -25
  86. package/dist/labsofscience/pages/investor/InvestorDashboard.js.map +1 -1
  87. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js +12 -11
  88. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  89. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js +25 -25
  90. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js.map +1 -1
  91. package/dist/labsofscience/pages/investor/InvestorProfilePage.js +57 -57
  92. package/dist/labsofscience/pages/investor/InvestorProfilePage.js.map +1 -1
  93. package/dist/labsofscience/pages/worker/TaskDetailsPage.js +26 -25
  94. package/dist/labsofscience/pages/worker/TaskDetailsPage.js.map +1 -1
  95. package/dist/labsofscience/pages/worker/WorkerDashboard.js +47 -47
  96. package/dist/labsofscience/pages/worker/WorkerDashboard.js.map +1 -1
  97. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js +41 -40
  98. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js.map +1 -1
  99. package/dist/labsofscience/pages/worker/WorkerProfilePage.js +43 -43
  100. package/dist/labsofscience/pages/worker/WorkerProfilePage.js.map +1 -1
  101. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js +32 -30
  102. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js.map +1 -1
  103. package/package.json +3 -3
@@ -123,7 +123,7 @@ function x() {
123
123
  ]
124
124
  }),
125
125
  /* @__PURE__ */ y("div", {
126
- className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6",
126
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4 mb-6",
127
127
  children: /* @__PURE__ */ b("div", {
128
128
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
129
129
  children: [
@@ -137,7 +137,7 @@ function x() {
137
137
  ...t,
138
138
  searchQuery: e.target.value
139
139
  })),
140
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
140
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
141
141
  })]
142
142
  }),
143
143
  /* @__PURE__ */ b("select", {
@@ -146,7 +146,7 @@ function x() {
146
146
  ...t,
147
147
  type: e.target.value
148
148
  })),
149
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
149
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
150
150
  children: [
151
151
  /* @__PURE__ */ y("option", {
152
152
  value: "all",
@@ -168,7 +168,7 @@ function x() {
168
168
  ...t,
169
169
  category: e.target.value
170
170
  })),
171
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
171
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
172
172
  children: [
173
173
  /* @__PURE__ */ y("option", {
174
174
  value: "",
@@ -198,7 +198,7 @@ function x() {
198
198
  ...t,
199
199
  sortBy: e.target.value
200
200
  })),
201
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
201
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
202
202
  children: [
203
203
  /* @__PURE__ */ y("option", {
204
204
  value: "recent",
@@ -222,6 +222,7 @@ function x() {
222
222
  })
223
223
  }),
224
224
  M.length === 0 && N.length === 0 ? /* @__PURE__ */ y(r, {
225
+ illustration: "empty-people",
225
226
  icon: /* @__PURE__ */ y(d, { className: "h-12 w-12" }),
226
227
  title: "No favorites yet",
227
228
  description: "Browse carts and tap the heart icon to add them to your favorites.",
@@ -244,7 +245,7 @@ function x() {
244
245
  }), /* @__PURE__ */ y("div", {
245
246
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
246
247
  children: M.map((e) => /* @__PURE__ */ b("div", {
247
- className: "rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden",
248
+ className: "rounded-lg border border-border-seam bg-bg-surface shadow-sm overflow-hidden",
248
249
  children: [/* @__PURE__ */ b("div", {
249
250
  className: "relative h-36 bg-bg-sunken",
250
251
  children: [
@@ -262,13 +263,13 @@ function x() {
262
263
  type: "button",
263
264
  onClick: () => P(e.id),
264
265
  title: "Remove from favorites",
265
- className: "absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-bg-surface/80 backdrop-blur-sm text-red-500 hover:bg-bg-surface transition-colors",
266
+ className: "absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-bg-surface/80 backdrop-blur-sm text-status-error-text hover:bg-bg-surface transition-colors",
266
267
  children: /* @__PURE__ */ y(d, { className: "h-4 w-4 fill-current" })
267
268
  }),
268
269
  /* @__PURE__ */ y("div", {
269
270
  className: "absolute top-2 left-2",
270
271
  children: /* @__PURE__ */ y("span", {
271
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", e.isOpen ? "bg-green-500/20 text-green-600 dark:text-green-400" : "bg-status-error-bg/20 text-status-error-text"),
272
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", e.isOpen ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-error-bg/20 text-status-error-text"),
272
273
  children: e.isOpen ? "Open" : "Closed"
273
274
  })
274
275
  })
@@ -284,7 +285,7 @@ function x() {
284
285
  }), /* @__PURE__ */ b("div", {
285
286
  className: "flex items-center gap-1 shrink-0",
286
287
  children: [
287
- /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5 fill-yellow-400 text-yellow-400" }),
288
+ /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }),
288
289
  /* @__PURE__ */ y("span", {
289
290
  className: "text-xs font-medium text-text-primary",
290
291
  children: e.rating
@@ -346,7 +347,7 @@ function x() {
346
347
  }), /* @__PURE__ */ y("button", {
347
348
  type: "button",
348
349
  onClick: () => x(`/customer/carts/${e.id}`),
349
- className: "flex-1 rounded-lg border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
350
+ className: "flex-1 rounded-lg border border-border-seam px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
350
351
  children: "View Menu"
351
352
  })]
352
353
  })
@@ -364,7 +365,7 @@ function x() {
364
365
  }), /* @__PURE__ */ y("div", {
365
366
  className: "space-y-3",
366
367
  children: N.map((e) => /* @__PURE__ */ y("div", {
367
- className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
368
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4",
368
369
  children: /* @__PURE__ */ b("div", {
369
370
  className: "flex flex-col sm:flex-row sm:items-center gap-4",
370
371
  children: [
@@ -390,7 +391,7 @@ function x() {
390
391
  type: "button",
391
392
  onClick: () => F(e.id),
392
393
  title: "Remove from favorites",
393
- className: "rounded-md p-1 text-red-500 hover:bg-status-error-bg/10 transition-colors",
394
+ className: "rounded-md p-1 text-status-error-text hover:bg-status-error-bg/10 transition-colors",
394
395
  children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
395
396
  })]
396
397
  })]
@@ -430,11 +431,11 @@ function x() {
430
431
  className: "flex flex-wrap items-center gap-2",
431
432
  children: [
432
433
  e.isVegetarian && /* @__PURE__ */ b("span", {
433
- className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",
434
+ className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
434
435
  children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), "Veg"]
435
436
  }),
436
437
  e.isVegan && /* @__PURE__ */ b("span", {
437
- className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",
438
+ className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
438
439
  children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), "Vegan"]
439
440
  }),
440
441
  /* @__PURE__ */ b("span", {
@@ -459,7 +460,7 @@ function x() {
459
460
  }), /* @__PURE__ */ y("button", {
460
461
  type: "button",
461
462
  onClick: () => x(`/customer/carts/${e.cartId}`),
462
- className: "flex-1 sm:flex-none rounded-lg border border-border-subtle px-4 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap",
463
+ className: "flex-1 sm:flex-none rounded-lg border border-border-seam px-4 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap",
463
464
  children: "View Cart"
464
465
  })]
465
466
  })
@@ -1 +1 @@
1
- {"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../../src/labsofscience/pages/customer/FavoritesPage.tsx"],"sourcesContent":["/**\n * Favorites Page\n * @module labsofscience/pages/customer\n *\n * Favorite carts AND products with stats header, 4 filters\n * (search, type, category, sort), Order Again / View Menu per cart,\n * Add to Cart / View Cart + remove per product, Veg badges,\n * prep time, 3 mock favorite products, 2 mock favorite carts.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport {\n Heart,\n Star,\n MapPin,\n Clock,\n CheckCircle2,\n Search,\n ShoppingCart,\n Leaf,\n Utensils,\n RotateCcw,\n ListFilter,\n X,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProviders, useOrders } from '../../hooks/useLabsOfScienceApi';\nimport { mockCarts } from '../../mocks/data';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate, formatDistance } from '../../utils/formatters';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface FavoriteCart {\n id: string;\n name: string;\n description: string;\n category: string;\n image: string;\n rating: number;\n reviewCount: number;\n isOpen: boolean;\n isVerified: boolean;\n distance: number;\n estimatedTime: number;\n addedToFavorites: string;\n lastOrdered?: string;\n totalOrders: number;\n totalSpent: number;\n}\n\ninterface FavoriteProduct {\n id: string;\n name: string;\n description: string;\n price: number;\n category: string;\n image: string;\n cartId: string;\n cartName: string;\n isVegetarian: boolean;\n isVegan: boolean;\n preparationTime: number;\n rating: number;\n addedToFavorites: string;\n lastOrdered?: string;\n orderCount: number;\n}\n\ninterface FavoriteFilters {\n searchQuery: string;\n type: 'all' | 'carts' | 'products';\n category: string;\n sortBy: 'recent' | 'name' | 'rating' | 'orders';\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function FavoritesPage() {\n const { navigateTo, currentUser } = useLabsOfScience();\n const { data: providers = [], isLoading: isLoadingProviders } = useProviders();\n const { data: orders = [], isLoading: isLoadingOrders } = useOrders({\n customerId: currentUser?.id,\n });\n\n const favoriteCarts: FavoriteCart[] = providers.slice(0, 2).map((p) => ({\n id: p.id,\n name: p.name,\n description: 'Authentic services from LabsOfScience',\n category: p.category,\n image: p.image,\n rating: p.rating,\n reviewCount: p.totalRatings,\n isOpen: p.isOpen,\n isVerified: p.isVerified || false,\n distance: p.distance,\n estimatedTime: p.estimatedTime,\n addedToFavorites: new Date().toISOString(),\n totalOrders: orders.filter((o) => o.cartId === p.id).length,\n totalSpent: orders.filter((o) => o.cartId === p.id).reduce((acc, o) => acc + o.total, 0),\n }));\n\n const favoriteProducts: FavoriteProduct[] = [\n {\n id: 'prod-001',\n name: 'Masala Dosa',\n description: 'Crispy rice crepe with spiced potato filling',\n price: 120,\n category: 'South Indian',\n image: 'https://images.unsplash.com/photo-1630383249896-424e482df921?w=300',\n cartId: providers[0]?.id || 'FOOD-001',\n cartName: providers[0]?.name || 'Dosa Express',\n isVegetarian: true,\n isVegan: false,\n preparationTime: 15,\n rating: 4.7,\n addedToFavorites: '2024-02-20T12:30:00Z',\n orderCount: 8,\n },\n ];\n\n const [filters, setFilters] = useState<FavoriteFilters>({\n searchQuery: '',\n type: 'all',\n category: '',\n sortBy: 'recent',\n });\n\n const isLoading = isLoadingProviders || isLoadingOrders;\n\n // --- Derived data ---\n const getDisplayItems = useCallback(() => {\n let carts = [...favoriteCarts];\n let products = [...favoriteProducts];\n\n // Search\n if (filters.searchQuery) {\n const q = filters.searchQuery.toLowerCase();\n carts = carts.filter(\n (c) =>\n c.name.toLowerCase().includes(q) ||\n c.description.toLowerCase().includes(q) ||\n c.category.toLowerCase().includes(q)\n );\n products = products.filter(\n (p) =>\n p.name.toLowerCase().includes(q) ||\n p.description.toLowerCase().includes(q) ||\n p.category.toLowerCase().includes(q) ||\n p.cartName.toLowerCase().includes(q)\n );\n }\n\n // Category\n if (filters.category) {\n carts = carts.filter((c) => c.category === filters.category);\n products = products.filter((p) => p.category === filters.category);\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n carts.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n products.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n break;\n case 'name':\n carts.sort((a, b) => a.name.localeCompare(b.name));\n products.sort((a, b) => a.name.localeCompare(b.name));\n break;\n case 'rating':\n carts.sort((a, b) => b.rating - a.rating);\n products.sort((a, b) => b.rating - a.rating);\n break;\n case 'orders':\n carts.sort((a, b) => b.totalOrders - a.totalOrders);\n products.sort((a, b) => b.orderCount - a.orderCount);\n break;\n }\n\n // Type filter\n if (filters.type === 'carts') return { carts, products: [] };\n if (filters.type === 'products') return { carts: [], products };\n return { carts, products };\n }, [favoriteCarts, favoriteProducts, filters]);\n\n const { carts: displayCarts, products: displayProducts } = getDisplayItems();\n\n const handleRemoveCart = (id: string) => {\n // In real app, this would call an API\n console.log('Remove cart:', id);\n };\n\n const handleRemoveProduct = (id: string) => {\n // In real app, this would call an API\n console.log('Remove product:', id);\n };\n\n // Stats\n const totalSaved =\n favoriteCarts.reduce((s, c) => s + c.totalSpent, 0) +\n favoriteProducts.reduce((s, p) => s + p.price * p.orderCount, 0);\n\n if (isLoading) {\n return (\n <PageLayout title=\"My Favorites\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"My Favorites\"\n description={`${favoriteCarts.length} carts, ${favoriteProducts.length} products`}\n >\n {/* Stats Header */}\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-text-secondary mb-6\">\n <span className=\"flex items-center gap-1.5\">\n <ShoppingCart className=\"h-3.5 w-3.5\" />\n {favoriteCarts.length} carts\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Utensils className=\"h-3.5 w-3.5\" />\n {favoriteProducts.length} products\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Star className=\"h-3.5 w-3.5\" />\n Total saved: {formatCurrency(totalSaved, { minimumFractionDigits: 0 })}\n </span>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6\">\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search favorites...\"\n value={filters.searchQuery}\n onChange={(e) => setFilters((p) => ({ ...p, searchQuery: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Type */}\n <select\n value={filters.type}\n onChange={(e) =>\n setFilters((p) => ({ ...p, type: e.target.value as FavoriteFilters['type'] }))\n }\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"all\">All Favorites</option>\n <option value=\"carts\">Favorite Carts</option>\n <option value=\"products\">Favorite Products</option>\n </select>\n\n {/* Category */}\n <select\n value={filters.category}\n onChange={(e) => setFilters((p) => ({ ...p, category: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"\">All Categories</option>\n <option value=\"Food & Beverage\">Food & Beverage</option>\n <option value=\"Street Food\">Street Food</option>\n <option value=\"South Indian\">South Indian</option>\n <option value=\"Beverages\">Beverages</option>\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) =>\n setFilters((p) => ({ ...p, sortBy: e.target.value as FavoriteFilters['sortBy'] }))\n }\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"recent\">Recently Added</option>\n <option value=\"name\">Name A-Z</option>\n <option value=\"rating\">Highest Rated</option>\n <option value=\"orders\">Most Ordered</option>\n </select>\n </div>\n </div>\n\n {/* Content */}\n {displayCarts.length === 0 && displayProducts.length === 0 ? (\n <EmptyState\n icon={<Heart className=\"h-12 w-12\" />}\n title=\"No favorites yet\"\n description=\"Browse carts and tap the heart icon to add them to your favorites.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Discover Carts\n </button>\n }\n />\n ) : (\n <div className=\"space-y-8\">\n {/* Favorite Carts */}\n {displayCarts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <ShoppingCart className=\"h-4 w-4 text-text-secondary\" />\n Favorite Carts ({displayCarts.length})\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayCarts.map((cart) => (\n <div\n key={cart.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden\"\n >\n {/* Image */}\n <div className=\"relative h-36 bg-bg-sunken\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"block h-full w-full\"\n >\n <img\n src={cart.image}\n alt={cart.name}\n className=\"h-full w-full object-cover\"\n />\n </button>\n <button\n type=\"button\"\n onClick={() => handleRemoveCart(cart.id)}\n title=\"Remove from favorites\"\n className=\"absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-bg-surface/80 backdrop-blur-sm text-red-500 hover:bg-bg-surface transition-colors\"\n >\n <Heart className=\"h-4 w-4 fill-current\" />\n </button>\n <div className=\"absolute top-2 left-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n cart.isOpen\n ? 'bg-green-500/20 text-green-600 dark:text-green-400'\n : 'bg-status-error-bg/20 text-status-error-text'\n )}\n >\n {cart.isOpen ? 'Open' : 'Closed'}\n </span>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"p-4\">\n <div className=\"flex items-start justify-between gap-2 mb-2\">\n <h4 className=\"text-sm font-semibold text-text-primary truncate\">\n {cart.name}\n </h4>\n <div className=\"flex items-center gap-1 shrink-0\">\n <Star className=\"h-3.5 w-3.5 fill-yellow-400 text-yellow-400\" />\n <span className=\"text-xs font-medium text-text-primary\">{cart.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n ({cart.reviewCount})\n </span>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary line-clamp-2 mb-3\">\n {cart.description}\n </p>\n\n <div className=\"space-y-1.5 text-xs text-text-secondary\">\n <div className=\"flex justify-between\">\n <span>Added:</span>\n <span>\n {formatDate(cart.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total orders:</span>\n <span>{cart.totalOrders}</span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total spent:</span>\n <span className=\"font-medium\">\n {formatCurrency(cart.totalSpent, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {cart.lastOrdered && (\n <div className=\"flex justify-between\">\n <span>Last ordered:</span>\n <span>\n {formatDate(cart.lastOrdered, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Order Again\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 rounded-lg border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Menu\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Favorite Products */}\n {displayProducts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Utensils className=\"h-4 w-4 text-text-secondary\" />\n Favorite Products ({displayProducts.length})\n </h3>\n <div className=\"space-y-3\">\n {displayProducts.map((product) => (\n <div key={product.id} className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-4\">\n {/* Image */}\n <img\n src={product.image}\n alt={product.name}\n className=\"w-20 h-20 rounded-lg object-cover shrink-0 mx-auto sm:mx-0\"\n />\n\n {/* Info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2 mb-1\">\n <h4 className=\"text-sm font-semibold text-text-primary\">{product.name}</h4>\n <div className=\"flex items-center gap-2 shrink-0\">\n <span className=\"text-base font-bold text-text-primary\">\n {formatCurrency(product.price, { minimumFractionDigits: 0 })}\n </span>\n <button\n type=\"button\"\n onClick={() => handleRemoveProduct(product.id)}\n title=\"Remove from favorites\"\n className=\"rounded-md p-1 text-red-500 hover:bg-status-error-bg/10 transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary mb-2\">{product.description}</p>\n\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary mb-2\">\n <span>\n From:{' '}\n <span className=\"font-medium text-text-primary\">{product.cartName}</span>\n </span>\n <span>Ordered {product.orderCount} times</span>\n <span>\n Added:{' '}\n {formatDate(product.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {product.isVegetarian && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400\">\n <Leaf className=\"h-3 w-3\" />\n Veg\n </span>\n )}\n {product.isVegan && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400\">\n <Leaf className=\"h-3 w-3\" />\n Vegan\n </span>\n )}\n <span className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] font-medium text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n {product.preparationTime} min\n </span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex sm:flex-col gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity whitespace-nowrap\"\n >\n Add to Cart\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg border border-border-subtle px-4 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap\"\n >\n View Cart\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAoFA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,EAAE,MAAM,IAAY,EAAE,EAAE,WAAW,MAAuB,GAAc,EACxE,EAAE,MAAM,IAAS,EAAE,EAAE,WAAW,MAAoB,EAAU,EAClE,YAAY,GAAa,IAC1B,CAAC,EAEI,IAAgC,EAAU,MAAM,GAAG,EAAE,CAAC,KAAK,OAAO;EACtE,IAAI,EAAE;EACN,MAAM,EAAE;EACR,aAAa;EACb,UAAU,EAAE;EACZ,OAAO,EAAE;EACT,QAAQ,EAAE;EACV,aAAa,EAAE;EACf,QAAQ,EAAE;EACV,YAAY,EAAE,cAAc;EAC5B,UAAU,EAAE;EACZ,eAAe,EAAE;EACjB,mCAAkB,IAAI,MAAM,EAAC,aAAa;EAC1C,aAAa,EAAO,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC;EACrD,YAAY,EAAO,QAAQ,MAAM,EAAE,WA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C9D,WAAU;oBACX;UAEQ,CAAA,CACL;;QACF;;MACF,EApFI,EAAQ,GAoFZ,CACN;KACE,CAAA,CACE,EAAA,CAAA,CAER;;GAEG"}
1
+ {"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../../src/labsofscience/pages/customer/FavoritesPage.tsx"],"sourcesContent":["/**\n * Favorites Page\n * @module labsofscience/pages/customer\n *\n * Favorite carts AND products with stats header, 4 filters\n * (search, type, category, sort), Order Again / View Menu per cart,\n * Add to Cart / View Cart + remove per product, Veg badges,\n * prep time, 3 mock favorite products, 2 mock favorite carts.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport {\n Heart,\n Star,\n MapPin,\n Clock,\n CheckCircle2,\n Search,\n ShoppingCart,\n Leaf,\n Utensils,\n RotateCcw,\n ListFilter,\n X,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useProviders, useOrders } from '../../hooks/useLabsOfScienceApi';\nimport { mockCarts } from '../../mocks/data';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate, formatDistance } from '../../utils/formatters';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface FavoriteCart {\n id: string;\n name: string;\n description: string;\n category: string;\n image: string;\n rating: number;\n reviewCount: number;\n isOpen: boolean;\n isVerified: boolean;\n distance: number;\n estimatedTime: number;\n addedToFavorites: string;\n lastOrdered?: string;\n totalOrders: number;\n totalSpent: number;\n}\n\ninterface FavoriteProduct {\n id: string;\n name: string;\n description: string;\n price: number;\n category: string;\n image: string;\n cartId: string;\n cartName: string;\n isVegetarian: boolean;\n isVegan: boolean;\n preparationTime: number;\n rating: number;\n addedToFavorites: string;\n lastOrdered?: string;\n orderCount: number;\n}\n\ninterface FavoriteFilters {\n searchQuery: string;\n type: 'all' | 'carts' | 'products';\n category: string;\n sortBy: 'recent' | 'name' | 'rating' | 'orders';\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function FavoritesPage() {\n const { navigateTo, currentUser } = useLabsOfScience();\n const { data: providers = [], isLoading: isLoadingProviders } = useProviders();\n const { data: orders = [], isLoading: isLoadingOrders } = useOrders({\n customerId: currentUser?.id,\n });\n\n const favoriteCarts: FavoriteCart[] = providers.slice(0, 2).map((p) => ({\n id: p.id,\n name: p.name,\n description: 'Authentic services from LabsOfScience',\n category: p.category,\n image: p.image,\n rating: p.rating,\n reviewCount: p.totalRatings,\n isOpen: p.isOpen,\n isVerified: p.isVerified || false,\n distance: p.distance,\n estimatedTime: p.estimatedTime,\n addedToFavorites: new Date().toISOString(),\n totalOrders: orders.filter((o) => o.cartId === p.id).length,\n totalSpent: orders.filter((o) => o.cartId === p.id).reduce((acc, o) => acc + o.total, 0),\n }));\n\n const favoriteProducts: FavoriteProduct[] = [\n {\n id: 'prod-001',\n name: 'Masala Dosa',\n description: 'Crispy rice crepe with spiced potato filling',\n price: 120,\n category: 'South Indian',\n image: 'https://images.unsplash.com/photo-1630383249896-424e482df921?w=300',\n cartId: providers[0]?.id || 'FOOD-001',\n cartName: providers[0]?.name || 'Dosa Express',\n isVegetarian: true,\n isVegan: false,\n preparationTime: 15,\n rating: 4.7,\n addedToFavorites: '2024-02-20T12:30:00Z',\n orderCount: 8,\n },\n ];\n\n const [filters, setFilters] = useState<FavoriteFilters>({\n searchQuery: '',\n type: 'all',\n category: '',\n sortBy: 'recent',\n });\n\n const isLoading = isLoadingProviders || isLoadingOrders;\n\n // --- Derived data ---\n const getDisplayItems = useCallback(() => {\n let carts = [...favoriteCarts];\n let products = [...favoriteProducts];\n\n // Search\n if (filters.searchQuery) {\n const q = filters.searchQuery.toLowerCase();\n carts = carts.filter(\n (c) =>\n c.name.toLowerCase().includes(q) ||\n c.description.toLowerCase().includes(q) ||\n c.category.toLowerCase().includes(q)\n );\n products = products.filter(\n (p) =>\n p.name.toLowerCase().includes(q) ||\n p.description.toLowerCase().includes(q) ||\n p.category.toLowerCase().includes(q) ||\n p.cartName.toLowerCase().includes(q)\n );\n }\n\n // Category\n if (filters.category) {\n carts = carts.filter((c) => c.category === filters.category);\n products = products.filter((p) => p.category === filters.category);\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n carts.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n products.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n break;\n case 'name':\n carts.sort((a, b) => a.name.localeCompare(b.name));\n products.sort((a, b) => a.name.localeCompare(b.name));\n break;\n case 'rating':\n carts.sort((a, b) => b.rating - a.rating);\n products.sort((a, b) => b.rating - a.rating);\n break;\n case 'orders':\n carts.sort((a, b) => b.totalOrders - a.totalOrders);\n products.sort((a, b) => b.orderCount - a.orderCount);\n break;\n }\n\n // Type filter\n if (filters.type === 'carts') return { carts, products: [] };\n if (filters.type === 'products') return { carts: [], products };\n return { carts, products };\n }, [favoriteCarts, favoriteProducts, filters]);\n\n const { carts: displayCarts, products: displayProducts } = getDisplayItems();\n\n const handleRemoveCart = (id: string) => {\n // In real app, this would call an API\n console.log('Remove cart:', id);\n };\n\n const handleRemoveProduct = (id: string) => {\n // In real app, this would call an API\n console.log('Remove product:', id);\n };\n\n // Stats\n const totalSaved =\n favoriteCarts.reduce((s, c) => s + c.totalSpent, 0) +\n favoriteProducts.reduce((s, p) => s + p.price * p.orderCount, 0);\n\n if (isLoading) {\n return (\n <PageLayout title=\"My Favorites\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"My Favorites\"\n description={`${favoriteCarts.length} carts, ${favoriteProducts.length} products`}\n >\n {/* Stats Header */}\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-text-secondary mb-6\">\n <span className=\"flex items-center gap-1.5\">\n <ShoppingCart className=\"h-3.5 w-3.5\" />\n {favoriteCarts.length} carts\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Utensils className=\"h-3.5 w-3.5\" />\n {favoriteProducts.length} products\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Star className=\"h-3.5 w-3.5\" />\n Total saved: {formatCurrency(totalSaved, { minimumFractionDigits: 0 })}\n </span>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 mb-6\">\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search favorites...\"\n value={filters.searchQuery}\n onChange={(e) => setFilters((p) => ({ ...p, searchQuery: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Type */}\n <select\n value={filters.type}\n onChange={(e) =>\n setFilters((p) => ({ ...p, type: e.target.value as FavoriteFilters['type'] }))\n }\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"all\">All Favorites</option>\n <option value=\"carts\">Favorite Carts</option>\n <option value=\"products\">Favorite Products</option>\n </select>\n\n {/* Category */}\n <select\n value={filters.category}\n onChange={(e) => setFilters((p) => ({ ...p, category: e.target.value }))}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"\">All Categories</option>\n <option value=\"Food & Beverage\">Food & Beverage</option>\n <option value=\"Street Food\">Street Food</option>\n <option value=\"South Indian\">South Indian</option>\n <option value=\"Beverages\">Beverages</option>\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) =>\n setFilters((p) => ({ ...p, sortBy: e.target.value as FavoriteFilters['sortBy'] }))\n }\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"recent\">Recently Added</option>\n <option value=\"name\">Name A-Z</option>\n <option value=\"rating\">Highest Rated</option>\n <option value=\"orders\">Most Ordered</option>\n </select>\n </div>\n </div>\n\n {/* Content */}\n {displayCarts.length === 0 && displayProducts.length === 0 ? (\n <EmptyState\n illustration=\"empty-people\"\n icon={<Heart className=\"h-12 w-12\" />}\n title=\"No favorites yet\"\n description=\"Browse carts and tap the heart icon to add them to your favorites.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Discover Carts\n </button>\n }\n />\n ) : (\n <div className=\"space-y-8\">\n {/* Favorite Carts */}\n {displayCarts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <ShoppingCart className=\"h-4 w-4 text-text-secondary\" />\n Favorite Carts ({displayCarts.length})\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayCarts.map((cart) => (\n <div\n key={cart.id}\n className=\"rounded-lg border border-border-seam bg-bg-surface shadow-sm overflow-hidden\"\n >\n {/* Image */}\n <div className=\"relative h-36 bg-bg-sunken\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"block h-full w-full\"\n >\n <img\n src={cart.image}\n alt={cart.name}\n className=\"h-full w-full object-cover\"\n />\n </button>\n <button\n type=\"button\"\n onClick={() => handleRemoveCart(cart.id)}\n title=\"Remove from favorites\"\n className=\"absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-bg-surface/80 backdrop-blur-sm text-status-error-text hover:bg-bg-surface transition-colors\"\n >\n <Heart className=\"h-4 w-4 fill-current\" />\n </button>\n <div className=\"absolute top-2 left-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n cart.isOpen\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-status-error-bg/20 text-status-error-text'\n )}\n >\n {cart.isOpen ? 'Open' : 'Closed'}\n </span>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"p-4\">\n <div className=\"flex items-start justify-between gap-2 mb-2\">\n <h4 className=\"text-sm font-semibold text-text-primary truncate\">\n {cart.name}\n </h4>\n <div className=\"flex items-center gap-1 shrink-0\">\n <Star className=\"h-3.5 w-3.5 fill-status-warning-text text-status-warning-text\" />\n <span className=\"text-xs font-medium text-text-primary\">{cart.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n ({cart.reviewCount})\n </span>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary line-clamp-2 mb-3\">\n {cart.description}\n </p>\n\n <div className=\"space-y-1.5 text-xs text-text-secondary\">\n <div className=\"flex justify-between\">\n <span>Added:</span>\n <span>\n {formatDate(cart.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total orders:</span>\n <span>{cart.totalOrders}</span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total spent:</span>\n <span className=\"font-medium\">\n {formatCurrency(cart.totalSpent, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {cart.lastOrdered && (\n <div className=\"flex justify-between\">\n <span>Last ordered:</span>\n <span>\n {formatDate(cart.lastOrdered, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Order Again\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 rounded-lg border border-border-seam px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Menu\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Favorite Products */}\n {displayProducts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Utensils className=\"h-4 w-4 text-text-secondary\" />\n Favorite Products ({displayProducts.length})\n </h3>\n <div className=\"space-y-3\">\n {displayProducts.map((product) => (\n <div key={product.id} className=\"rounded-lg border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-4\">\n {/* Image */}\n <img\n src={product.image}\n alt={product.name}\n className=\"w-20 h-20 rounded-lg object-cover shrink-0 mx-auto sm:mx-0\"\n />\n\n {/* Info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2 mb-1\">\n <h4 className=\"text-sm font-semibold text-text-primary\">{product.name}</h4>\n <div className=\"flex items-center gap-2 shrink-0\">\n <span className=\"text-base font-bold text-text-primary\">\n {formatCurrency(product.price, { minimumFractionDigits: 0 })}\n </span>\n <button\n type=\"button\"\n onClick={() => handleRemoveProduct(product.id)}\n title=\"Remove from favorites\"\n className=\"rounded-md p-1 text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary mb-2\">{product.description}</p>\n\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary mb-2\">\n <span>\n From:{' '}\n <span className=\"font-medium text-text-primary\">{product.cartName}</span>\n </span>\n <span>Ordered {product.orderCount} times</span>\n <span>\n Added:{' '}\n {formatDate(product.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {product.isVegetarian && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text\">\n <Leaf className=\"h-3 w-3\" />\n Veg\n </span>\n )}\n {product.isVegan && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text\">\n <Leaf className=\"h-3 w-3\" />\n Vegan\n </span>\n )}\n <span className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] font-medium text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n {product.preparationTime} min\n </span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex sm:flex-col gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity whitespace-nowrap\"\n >\n Add to Cart\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg border border-border-seam px-4 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap\"\n >\n View Cart\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAoFA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,EAAE,MAAM,IAAY,EAAE,EAAE,WAAW,MAAuB,GAAc,EACxE,EAAE,MAAM,IAAS,EAAE,EAAE,WAAW,MAAoB,EAAU,EAClE,YAAY,GAAa,IAC1B,CAAC,EAEI,IAAgC,EAAU,MAAM,GAAG,EAAE,CAAC,KA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AAY,CAAA,EAAA,QAEvB;;YAET,kBAAC,QAAD;aAAM,WAAU;uBAAhB;cACE,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA;cAC5B,EAAQ;cAAgB;cACpB;;YACH;;UACF;;QAGN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,EACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,CACL;;QACF;;MACF,EApFI,EAAQ,GAoFZ,CACN;KACE,CAAA,CACE,EAAA,CAAA,CAER;;GAEG"}
@@ -171,7 +171,7 @@ function M() {
171
171
  className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",
172
172
  children: [
173
173
  /* @__PURE__ */ D("div", {
174
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
174
+ className: "rounded-lg border border-border-seam bg-bg-surface p-3.5",
175
175
  children: [/* @__PURE__ */ D("div", {
176
176
  className: "flex items-center gap-2 mb-1",
177
177
  children: [/* @__PURE__ */ E(v, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
@@ -184,7 +184,7 @@ function M() {
184
184
  })]
185
185
  }),
186
186
  /* @__PURE__ */ D("div", {
187
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
187
+ className: "rounded-lg border border-border-seam bg-bg-surface p-3.5",
188
188
  children: [/* @__PURE__ */ D("div", {
189
189
  className: "flex items-center gap-2 mb-1",
190
190
  children: [/* @__PURE__ */ E(g, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
@@ -197,7 +197,7 @@ function M() {
197
197
  })]
198
198
  }),
199
199
  /* @__PURE__ */ D("div", {
200
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
200
+ className: "rounded-lg border border-border-seam bg-bg-surface p-3.5",
201
201
  children: [/* @__PURE__ */ D("div", {
202
202
  className: "flex items-center gap-2 mb-1",
203
203
  children: [/* @__PURE__ */ E(C, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
@@ -210,7 +210,7 @@ function M() {
210
210
  })]
211
211
  }),
212
212
  /* @__PURE__ */ D("div", {
213
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
213
+ className: "rounded-lg border border-border-seam bg-bg-surface p-3.5",
214
214
  children: [/* @__PURE__ */ D("div", {
215
215
  className: "flex items-center gap-2 mb-1",
216
216
  children: [/* @__PURE__ */ E(p, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
@@ -223,7 +223,7 @@ function M() {
223
223
  })]
224
224
  }),
225
225
  /* @__PURE__ */ D("div", {
226
- className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5 col-span-2 md:col-span-1",
226
+ className: "rounded-lg border border-border-seam bg-bg-surface p-3.5 col-span-2 md:col-span-1",
227
227
  children: [/* @__PURE__ */ D("div", {
228
228
  className: "flex items-center gap-2 mb-1",
229
229
  children: [/* @__PURE__ */ E(h, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
@@ -238,7 +238,7 @@ function M() {
238
238
  ]
239
239
  }),
240
240
  /* @__PURE__ */ E("div", {
241
- className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6",
241
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4 mb-6",
242
242
  children: /* @__PURE__ */ D("div", {
243
243
  className: "grid grid-cols-1 md:grid-cols-4 gap-3",
244
244
  children: [
@@ -249,13 +249,13 @@ function M() {
249
249
  placeholder: "Search orders...",
250
250
  value: I.searchQuery,
251
251
  onChange: (e) => G("searchQuery", e.target.value),
252
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
252
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
253
253
  })]
254
254
  }),
255
255
  /* @__PURE__ */ E("select", {
256
256
  value: I.status,
257
257
  onChange: (e) => G("status", e.target.value),
258
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
258
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
259
259
  children: k.map((e) => /* @__PURE__ */ E("option", {
260
260
  value: e.value,
261
261
  children: e.label
@@ -264,7 +264,7 @@ function M() {
264
264
  /* @__PURE__ */ E("select", {
265
265
  value: I.dateRange,
266
266
  onChange: (e) => G("dateRange", e.target.value),
267
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
267
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
268
268
  children: A.map((e) => /* @__PURE__ */ E("option", {
269
269
  value: e.value,
270
270
  children: e.label
@@ -273,7 +273,7 @@ function M() {
273
273
  /* @__PURE__ */ E("select", {
274
274
  value: I.sortBy,
275
275
  onChange: (e) => G("sortBy", e.target.value),
276
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
276
+ className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
277
277
  children: j.map((e) => /* @__PURE__ */ E("option", {
278
278
  value: e.value,
279
279
  children: e.label
@@ -289,6 +289,7 @@ function M() {
289
289
  children: "Loading orders..."
290
290
  })]
291
291
  }) : U.length === 0 ? /* @__PURE__ */ E(r, {
292
+ illustration: "empty-data",
292
293
  icon: /* @__PURE__ */ E(x, { className: "h-12 w-12" }),
293
294
  title: "No orders found",
294
295
  description: I.searchQuery || I.status ? "Try adjusting your filters" : "You haven't placed any orders yet",
@@ -301,7 +302,7 @@ function M() {
301
302
  }) : /* @__PURE__ */ E("div", {
302
303
  className: "space-y-4",
303
304
  children: U.map((e) => /* @__PURE__ */ E("div", {
304
- className: "rounded-lg border border-border-subtle bg-bg-surface hover:shadow-md transition-shadow",
305
+ className: "rounded-lg border border-border-seam bg-bg-surface hover:shadow-md transition-shadow",
305
306
  children: /* @__PURE__ */ D("div", {
306
307
  className: "p-4 md:p-5",
307
308
  children: [
@@ -334,7 +335,7 @@ function M() {
334
335
  children: [/* @__PURE__ */ D("button", {
335
336
  type: "button",
336
337
  onClick: () => M(`/customer/orders/${e.id}`),
337
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
338
+ className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
338
339
  children: [/* @__PURE__ */ E(m, { className: "h-3 w-3" }), "Track Order"]
339
340
  }), e.status === "delivered" && /* @__PURE__ */ D("button", {
340
341
  type: "button",
@@ -346,7 +347,7 @@ function M() {
346
347
  })]
347
348
  }),
348
349
  /* @__PURE__ */ E("div", {
349
- className: "border-t border-border-subtle pt-3",
350
+ className: "border-t border-border-seam pt-3",
350
351
  children: /* @__PURE__ */ D("div", {
351
352
  className: "flex flex-wrap gap-1",
352
353
  children: [e.items.slice(0, 3).map((t, n) => /* @__PURE__ */ D("span", {
@@ -372,7 +373,7 @@ function M() {
372
373
  className: "mt-3",
373
374
  children: [
374
375
  e.status === "delivered" && /* @__PURE__ */ D("div", {
375
- className: "flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400",
376
+ className: "flex items-center gap-1.5 text-xs text-status-success-text",
376
377
  children: [/* @__PURE__ */ E(d, { className: "h-3 w-3" }), /* @__PURE__ */ E("span", { children: "Order delivered successfully" })]
377
378
  }),
378
379
  e.status === "cancelled" && /* @__PURE__ */ D("div", {
@@ -386,7 +387,7 @@ function M() {
386
387
  "ready",
387
388
  "out_for_delivery"
388
389
  ].includes(e.status) && /* @__PURE__ */ D("div", {
389
- className: "flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400",
390
+ className: "flex items-center gap-1.5 text-xs text-status-info-text",
390
391
  children: [/* @__PURE__ */ E(w, { className: "h-3 w-3" }), /* @__PURE__ */ D("span", { children: [
391
392
  "Estimated delivery by",
392
393
  " ",
@@ -410,7 +411,7 @@ function M() {
410
411
  }) : /* @__PURE__ */ D("button", {
411
412
  type: "button",
412
413
  onClick: () => M(`/customer/orders/${e.id}/rate`),
413
- className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
414
+ className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
414
415
  children: [/* @__PURE__ */ E(S, { className: "h-3 w-3" }), "Rate Order"]
415
416
  })
416
417
  })
@@ -425,7 +426,7 @@ function M() {
425
426
  onClick: () => {
426
427
  F((e) => e + O);
427
428
  },
428
- className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
429
+ className: "inline-flex items-center gap-2 rounded-lg border border-border-seam px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
429
430
  children: [/* @__PURE__ */ E(f, { className: "h-4 w-4" }), "Load More Orders"]
430
431
  })
431
432
  })
@@ -1 +1 @@
1
- {"version":3,"file":"OrderHistoryPage.js","names":[],"sources":["../../../../src/labsofscience/pages/customer/OrderHistoryPage.tsx"],"sourcesContent":["/**\n * Order History Page\n * @module labsofscience/pages/customer\n *\n * Full list of customer orders with stats summary, search, status/date/sort\n * filters, rating display, reorder, cancellation reason, and Load More pagination.\n */\n\nimport { useState, useMemo, useCallback, useEffect } from 'react';\nimport {\n ShoppingBag,\n Search,\n Star,\n RotateCcw,\n Eye,\n ChevronDown,\n Package,\n IndianRupee,\n TrendingUp,\n Clock,\n Heart,\n CheckCircle2,\n XCircle,\n Truck,\n Loader2,\n AlertCircle,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { RatingDisplay } from '../../components/RatingDisplay';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useOrders } from '../../hooks/useLabsOfScienceApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate } from '../../utils/formatters';\nimport type { OrderStatus, MockOrder } from '../../types';\n\ninterface OrderFilters {\n status: string;\n dateRange: string;\n searchQuery: string;\n sortBy: string;\n}\n\nconst PAGE_SIZE = 10;\n\nconst statusOptions = [\n { value: '', label: 'All Status' },\n { value: 'pending', label: 'Pending' },\n { value: 'confirmed', label: 'Confirmed' },\n { value: 'preparing', label: 'Preparing' },\n { value: 'ready', label: 'Ready' },\n { value: 'out_for_delivery', label: 'Out for Delivery' },\n { value: 'delivered', label: 'Delivered' },\n { value: 'cancelled', label: 'Cancelled' },\n];\n\nconst dateRangeOptions = [\n { value: '7days', label: 'Last 7 Days' },\n { value: '30days', label: 'Last 30 Days' },\n { value: '90days', label: 'Last 90 Days' },\n { value: 'all', label: 'All Time' },\n];\n\nconst sortOptions = [\n { value: 'recent', label: 'Most Recent' },\n { value: 'oldest', label: 'Oldest First' },\n { value: 'amount_high', label: 'Amount: High to Low' },\n { value: 'amount_low', label: 'Amount: Low to High' },\n];\n\nexport function OrderHistoryPage() {\n const { navigateTo, currentUser } = useLabsOfScience();\n const [displayCount, setDisplayCount] = useState(PAGE_SIZE);\n const [filters, setFilters] = useState<OrderFilters>({\n status: '',\n dateRange: '30days',\n searchQuery: '',\n sortBy: 'recent',\n });\n\n const { data: allOrders = [], isLoading, isError } = useOrders({ customerId: currentUser?.id });\n\n // Calculate stats from all orders\n const orderStats = useMemo(() => {\n const totalOrders = allOrders.length;\n const totalSpent = allOrders.reduce((sum, o) => sum + o.total, 0);\n const averageOrderValue = totalOrders > 0 ? Math.round(totalSpent / totalOrders) : 0;\n const recentOrdersCount = allOrders.filter(\n (o) => new Date(o.orderDate) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)\n ).length;\n\n // Find favorite cart (most ordered from)\n const cartCounts: Record<string, number> = {};\n for (const o of allOrders) {\n cartCounts[o.cartName] = (cartCounts[o.cartName] || 0) + 1;\n }\n const favoriteCart =\n Object.entries(cartCounts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'No orders yet';\n\n return { totalOrders, totalSpent, averageOrderValue, recentOrdersCount, favoriteCart };\n }, [allOrders]);\n\n // Filter and sort orders\n const filteredOrders = useMemo(() => {\n let orders = [...allOrders];\n\n // Filter by status\n if (filters.status) {\n orders = orders.filter((o) => o.status === filters.status);\n }\n\n // Filter by date range\n if (filters.dateRange !== 'all') {\n const now = new Date();\n const dateLimit = new Date();\n switch (filters.dateRange) {\n case '7days':\n dateLimit.setDate(now.getDate() - 7);\n break;\n case '30days':\n dateLimit.setDate(now.getDate() - 30);\n break;\n case '90days':\n dateLimit.setDate(now.getDate() - 90);\n break;\n }\n orders = orders.filter((o) => new Date(o.orderDate) >= dateLimit);\n }\n\n // Search filter\n if (filters.searchQuery) {\n const query = filters.searchQuery.toLowerCase();\n orders = orders.filter(\n (o) =>\n o.id.toLowerCase().includes(query) ||\n o.cartName.toLowerCase().includes(query) ||\n o.items.some((item) => item.name.toLowerCase().includes(query))\n );\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n orders.sort((a, b) => new Date(b.orderDate).getTime() - new Date(a.orderDate).getTime());\n break;\n case 'oldest':\n orders.sort((a, b) => new Date(a.orderDate).getTime() - new Date(b.orderDate).getTime());\n break;\n case 'amount_high':\n orders.sort((a, b) => b.total - a.total);\n break;\n case 'amount_low':\n orders.sort((a, b) => a.total - b.total);\n break;\n }\n\n return orders;\n }, [allOrders, filters]);\n\n const displayedOrders = useMemo(\n () => filteredOrders.slice(0, displayCount),\n [filteredOrders, displayCount]\n );\n\n const hasMore = displayCount < filteredOrders.length;\n\n const handleFilterChange = (key: keyof OrderFilters, value: string) => {\n setFilters((prev) => ({ ...prev, [key]: value }));\n setDisplayCount(PAGE_SIZE);\n };\n\n const handleReorder = (order: MockOrder) => {\n navigateTo(`/customer/cart/${order.cartId}`);\n alert('Add items to cart to reorder');\n };\n\n const handleLoadMore = () => {\n setDisplayCount((prev) => prev + PAGE_SIZE);\n };\n\n if (isLoading) {\n return (\n <PageLayout title=\"Order History\" description=\"Loading your orders...\">\n <div className=\"flex h-[60vh] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout title=\"Order History\" description=\"Error loading orders\">\n <div className=\"flex h-[60vh] flex-col items-center justify-center gap-4\">\n <AlertCircle className=\"h-12 w-12 text-status-error-text\" />\n <h2 className=\"text-xl font-semibold\">Error loading your orders</h2>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n Retry\n </button>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Order History\" description=\"View all your past and current orders\">\n {/* Stats Summary */}\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Package className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.totalOrders}</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <IndianRupee className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Spent</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.totalSpent, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <TrendingUp className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Average Order</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.averageOrderValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Clock className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Recent Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.recentOrdersCount}</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5 col-span-2 md:col-span-1\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Heart className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Favorite Cart</p>\n </div>\n <p className=\"text-sm font-bold text-text-primary truncate\">{orderStats.favoriteCart}</p>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search orders...\"\n value={filters.searchQuery}\n onChange={(e) => handleFilterChange('searchQuery', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Status Filter */}\n <select\n value={filters.status}\n onChange={(e) => handleFilterChange('status', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {statusOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Date Range */}\n <select\n value={filters.dateRange}\n onChange={(e) => handleFilterChange('dateRange', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {dateRangeOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) => handleFilterChange('sortBy', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {sortOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n {/* Orders List */}\n {isLoading ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading orders...</p>\n </div>\n ) : displayedOrders.length === 0 ? (\n <EmptyState\n icon={<ShoppingBag className=\"h-12 w-12\" />}\n title=\"No orders found\"\n description={\n filters.searchQuery || filters.status\n ? 'Try adjusting your filters'\n : \"You haven't placed any orders yet\"\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Start Ordering\n </button>\n }\n />\n ) : (\n <div className=\"space-y-4\">\n {displayedOrders.map((order) => (\n <div\n key={order.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface hover:shadow-md transition-shadow\"\n >\n <div className=\"p-4 md:p-5\">\n {/* Order Header */}\n <div className=\"flex flex-col md:flex-row md:items-center justify-between mb-3\">\n <div className=\"mb-3 md:mb-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <h3 className=\"text-base font-semibold text-text-primary\">{order.cartName}</h3>\n <StatusBadge status={order.status} />\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n Order #{order.id} &middot; {formatDate(order.orderDate)}\n </p>\n </div>\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <p className=\"text-lg font-bold text-text-primary\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-3 w-3\" />\n Track Order\n </button>\n {order.status === 'delivered' && (\n <button\n type=\"button\"\n onClick={() => handleReorder(order)}\n className=\"flex items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Reorder\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Order Items Summary */}\n <div className=\"border-t border-border-subtle pt-3\">\n <div className=\"flex flex-wrap gap-1\">\n {order.items.slice(0, 3).map((item, index) => (\n <span key={index} className=\"text-xs text-text-secondary\">\n {item.name} ({item.quantity})\n {index < Math.min(2, order.items.length - 1) && ', '}\n </span>\n ))}\n {order.items.length > 3 && (\n <span className=\"text-xs text-text-secondary\">\n +{order.items.length - 3} more items\n </span>\n )}\n </div>\n </div>\n\n {/* Status Message */}\n <div className=\"mt-3\">\n {order.status === 'delivered' && (\n <div className=\"flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n <span>Order delivered successfully</span>\n </div>\n )}\n {order.status === 'cancelled' && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-error-text\">\n <XCircle className=\"h-3 w-3\" />\n <span>\n Cancelled{order.cancellationReason && ` - ${order.cancellationReason}`}\n </span>\n </div>\n )}\n {['pending', 'confirmed', 'preparing', 'ready', 'out_for_delivery'].includes(\n order.status\n ) && (\n <div className=\"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400\">\n <Truck className=\"h-3 w-3\" />\n <span>\n Estimated delivery by{' '}\n {order.estimatedDeliveryTime\n ? formatDate(order.estimatedDeliveryTime)\n : 'TBD'}\n </span>\n </div>\n )}\n </div>\n\n {/* Rating Section */}\n {order.status === 'delivered' && (\n <div className=\"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n {order.rating ? (\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <RatingDisplay value={order.rating} />\n {order.review && (\n <p className=\"text-xs text-text-secondary italic\">\n &ldquo;{order.review}&rdquo;\n </p>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}/rate`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Star className=\"h-3 w-3\" />\n Rate Order\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Load More */}\n {hasMore && !isLoading && (\n <div className=\"text-center mt-8\">\n <button\n type=\"button\"\n onClick={handleLoadMore}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ChevronDown className=\"h-4 w-4\" />\n Load More Orders\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4CA,IAAM,IAAY,IAEZ,IAAgB;CACpB;EAAE,OAAO;EAAI,OAAO;EAAc;CAClC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACxD;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC3C,EAEK,IAAmB;CACvB;EAAE,OAAO;EAAS,OAAO;EAAe;CACxC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAO,OAAO;EAAY;CACpC,EAEK,IAAc;CAClB;EAAE,OAAO;EAAU,OAAO;EAAe;CACzC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAe,OAAO;EAAuB;CACtD;EAAE,OAAO;EAAc,OAAO;EAAuB;CACtD;AAED,SAAgB,IAAmB;CACjC,IAAM,EAAE,eAAY,mBAAgB,GAAkB,EAChD,CAAC,GAAc,KAAmB,EAAS,EAAU,EACrD,CAAC,GAAS,KAAc,EAAuB;EACnD,QAAQ;EACR,WAAW;EACX,aAAa;EACb,QAAQ;EACT,CAAC,EAEI,EAAE,MAAM,IAAY,EAAE,EAAE,cAAW,eAAY,EAAU,EAAE,YAAY,GAAa,IAAI,CAAC,EAGzF,IAAa,QAAc;EAC/B,IAAM,IAAc,EAAU,QACxB,IAAa,EAAU,QAAQ,GAAK,MAAM,IAAM,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EAAM,GAAG,OAAO;SAC9D,WAAU;mBAHZ,CAKE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAAA,aAErB;;QAEP,CAAA;OAEJ;;KACF,EAnHC,EAAM,GAmHP,CACN;IACE,CAAA;GAIP,KAAW,CAAC,KACX,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,eA/RmB;AAC3B,SAAiB,MAAS,IAAO,EAAU;;KA+RnC,WAAU;eAHZ,CAKE,kBAAC,GAAD,EAAa,WAAU,WAAY,CAAA,EAAA,mBAE5B;;IACL,CAAA;GAEG"}
1
+ {"version":3,"file":"OrderHistoryPage.js","names":[],"sources":["../../../../src/labsofscience/pages/customer/OrderHistoryPage.tsx"],"sourcesContent":["/**\n * Order History Page\n * @module labsofscience/pages/customer\n *\n * Full list of customer orders with stats summary, search, status/date/sort\n * filters, rating display, reorder, cancellation reason, and Load More pagination.\n */\n\nimport { useState, useMemo, useCallback, useEffect } from 'react';\nimport {\n ShoppingBag,\n Search,\n Star,\n RotateCcw,\n Eye,\n ChevronDown,\n Package,\n IndianRupee,\n TrendingUp,\n Clock,\n Heart,\n CheckCircle2,\n XCircle,\n Truck,\n Loader2,\n AlertCircle,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { RatingDisplay } from '../../components/RatingDisplay';\nimport { useLabsOfScience } from '../../context/LabsOfScienceContext';\nimport { useOrders } from '../../hooks/useLabsOfScienceApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate } from '../../utils/formatters';\nimport type { OrderStatus, MockOrder } from '../../types';\n\ninterface OrderFilters {\n status: string;\n dateRange: string;\n searchQuery: string;\n sortBy: string;\n}\n\nconst PAGE_SIZE = 10;\n\nconst statusOptions = [\n { value: '', label: 'All Status' },\n { value: 'pending', label: 'Pending' },\n { value: 'confirmed', label: 'Confirmed' },\n { value: 'preparing', label: 'Preparing' },\n { value: 'ready', label: 'Ready' },\n { value: 'out_for_delivery', label: 'Out for Delivery' },\n { value: 'delivered', label: 'Delivered' },\n { value: 'cancelled', label: 'Cancelled' },\n];\n\nconst dateRangeOptions = [\n { value: '7days', label: 'Last 7 Days' },\n { value: '30days', label: 'Last 30 Days' },\n { value: '90days', label: 'Last 90 Days' },\n { value: 'all', label: 'All Time' },\n];\n\nconst sortOptions = [\n { value: 'recent', label: 'Most Recent' },\n { value: 'oldest', label: 'Oldest First' },\n { value: 'amount_high', label: 'Amount: High to Low' },\n { value: 'amount_low', label: 'Amount: Low to High' },\n];\n\nexport function OrderHistoryPage() {\n const { navigateTo, currentUser } = useLabsOfScience();\n const [displayCount, setDisplayCount] = useState(PAGE_SIZE);\n const [filters, setFilters] = useState<OrderFilters>({\n status: '',\n dateRange: '30days',\n searchQuery: '',\n sortBy: 'recent',\n });\n\n const { data: allOrders = [], isLoading, isError } = useOrders({ customerId: currentUser?.id });\n\n // Calculate stats from all orders\n const orderStats = useMemo(() => {\n const totalOrders = allOrders.length;\n const totalSpent = allOrders.reduce((sum, o) => sum + o.total, 0);\n const averageOrderValue = totalOrders > 0 ? Math.round(totalSpent / totalOrders) : 0;\n const recentOrdersCount = allOrders.filter(\n (o) => new Date(o.orderDate) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)\n ).length;\n\n // Find favorite cart (most ordered from)\n const cartCounts: Record<string, number> = {};\n for (const o of allOrders) {\n cartCounts[o.cartName] = (cartCounts[o.cartName] || 0) + 1;\n }\n const favoriteCart =\n Object.entries(cartCounts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'No orders yet';\n\n return { totalOrders, totalSpent, averageOrderValue, recentOrdersCount, favoriteCart };\n }, [allOrders]);\n\n // Filter and sort orders\n const filteredOrders = useMemo(() => {\n let orders = [...allOrders];\n\n // Filter by status\n if (filters.status) {\n orders = orders.filter((o) => o.status === filters.status);\n }\n\n // Filter by date range\n if (filters.dateRange !== 'all') {\n const now = new Date();\n const dateLimit = new Date();\n switch (filters.dateRange) {\n case '7days':\n dateLimit.setDate(now.getDate() - 7);\n break;\n case '30days':\n dateLimit.setDate(now.getDate() - 30);\n break;\n case '90days':\n dateLimit.setDate(now.getDate() - 90);\n break;\n }\n orders = orders.filter((o) => new Date(o.orderDate) >= dateLimit);\n }\n\n // Search filter\n if (filters.searchQuery) {\n const query = filters.searchQuery.toLowerCase();\n orders = orders.filter(\n (o) =>\n o.id.toLowerCase().includes(query) ||\n o.cartName.toLowerCase().includes(query) ||\n o.items.some((item) => item.name.toLowerCase().includes(query))\n );\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n orders.sort((a, b) => new Date(b.orderDate).getTime() - new Date(a.orderDate).getTime());\n break;\n case 'oldest':\n orders.sort((a, b) => new Date(a.orderDate).getTime() - new Date(b.orderDate).getTime());\n break;\n case 'amount_high':\n orders.sort((a, b) => b.total - a.total);\n break;\n case 'amount_low':\n orders.sort((a, b) => a.total - b.total);\n break;\n }\n\n return orders;\n }, [allOrders, filters]);\n\n const displayedOrders = useMemo(\n () => filteredOrders.slice(0, displayCount),\n [filteredOrders, displayCount]\n );\n\n const hasMore = displayCount < filteredOrders.length;\n\n const handleFilterChange = (key: keyof OrderFilters, value: string) => {\n setFilters((prev) => ({ ...prev, [key]: value }));\n setDisplayCount(PAGE_SIZE);\n };\n\n const handleReorder = (order: MockOrder) => {\n navigateTo(`/customer/cart/${order.cartId}`);\n alert('Add items to cart to reorder');\n };\n\n const handleLoadMore = () => {\n setDisplayCount((prev) => prev + PAGE_SIZE);\n };\n\n if (isLoading) {\n return (\n <PageLayout title=\"Order History\" description=\"Loading your orders...\">\n <div className=\"flex h-[60vh] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout title=\"Order History\" description=\"Error loading orders\">\n <div className=\"flex h-[60vh] flex-col items-center justify-center gap-4\">\n <AlertCircle className=\"h-12 w-12 text-status-error-text\" />\n <h2 className=\"text-xl font-semibold\">Error loading your orders</h2>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n Retry\n </button>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Order History\" description=\"View all your past and current orders\">\n {/* Stats Summary */}\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6\">\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Package className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.totalOrders}</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <IndianRupee className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Spent</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.totalSpent, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <TrendingUp className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Average Order</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.averageOrderValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Clock className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Recent Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.recentOrdersCount}</p>\n </div>\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-3.5 col-span-2 md:col-span-1\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Heart className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Favorite Cart</p>\n </div>\n <p className=\"text-sm font-bold text-text-primary truncate\">{orderStats.favoriteCart}</p>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 mb-6\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search orders...\"\n value={filters.searchQuery}\n onChange={(e) => handleFilterChange('searchQuery', e.target.value)}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Status Filter */}\n <select\n value={filters.status}\n onChange={(e) => handleFilterChange('status', e.target.value)}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {statusOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Date Range */}\n <select\n value={filters.dateRange}\n onChange={(e) => handleFilterChange('dateRange', e.target.value)}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {dateRangeOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) => handleFilterChange('sortBy', e.target.value)}\n className=\"w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {sortOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n {/* Orders List */}\n {isLoading ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading orders...</p>\n </div>\n ) : displayedOrders.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<ShoppingBag className=\"h-12 w-12\" />}\n title=\"No orders found\"\n description={\n filters.searchQuery || filters.status\n ? 'Try adjusting your filters'\n : \"You haven't placed any orders yet\"\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Start Ordering\n </button>\n }\n />\n ) : (\n <div className=\"space-y-4\">\n {displayedOrders.map((order) => (\n <div\n key={order.id}\n className=\"rounded-lg border border-border-seam bg-bg-surface hover:shadow-md transition-shadow\"\n >\n <div className=\"p-4 md:p-5\">\n {/* Order Header */}\n <div className=\"flex flex-col md:flex-row md:items-center justify-between mb-3\">\n <div className=\"mb-3 md:mb-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <h3 className=\"text-base font-semibold text-text-primary\">{order.cartName}</h3>\n <StatusBadge status={order.status} />\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n Order #{order.id} &middot; {formatDate(order.orderDate)}\n </p>\n </div>\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <p className=\"text-lg font-bold text-text-primary\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-3 w-3\" />\n Track Order\n </button>\n {order.status === 'delivered' && (\n <button\n type=\"button\"\n onClick={() => handleReorder(order)}\n className=\"flex items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Reorder\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Order Items Summary */}\n <div className=\"border-t border-border-seam pt-3\">\n <div className=\"flex flex-wrap gap-1\">\n {order.items.slice(0, 3).map((item, index) => (\n <span key={index} className=\"text-xs text-text-secondary\">\n {item.name} ({item.quantity})\n {index < Math.min(2, order.items.length - 1) && ', '}\n </span>\n ))}\n {order.items.length > 3 && (\n <span className=\"text-xs text-text-secondary\">\n +{order.items.length - 3} more items\n </span>\n )}\n </div>\n </div>\n\n {/* Status Message */}\n <div className=\"mt-3\">\n {order.status === 'delivered' && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n <span>Order delivered successfully</span>\n </div>\n )}\n {order.status === 'cancelled' && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-error-text\">\n <XCircle className=\"h-3 w-3\" />\n <span>\n Cancelled{order.cancellationReason && ` - ${order.cancellationReason}`}\n </span>\n </div>\n )}\n {['pending', 'confirmed', 'preparing', 'ready', 'out_for_delivery'].includes(\n order.status\n ) && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-info-text\">\n <Truck className=\"h-3 w-3\" />\n <span>\n Estimated delivery by{' '}\n {order.estimatedDeliveryTime\n ? formatDate(order.estimatedDeliveryTime)\n : 'TBD'}\n </span>\n </div>\n )}\n </div>\n\n {/* Rating Section */}\n {order.status === 'delivered' && (\n <div className=\"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n {order.rating ? (\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <RatingDisplay value={order.rating} />\n {order.review && (\n <p className=\"text-xs text-text-secondary italic\">\n &ldquo;{order.review}&rdquo;\n </p>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}/rate`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Star className=\"h-3 w-3\" />\n Rate Order\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Load More */}\n {hasMore && !isLoading && (\n <div className=\"text-center mt-8\">\n <button\n type=\"button\"\n onClick={handleLoadMore}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-seam px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ChevronDown className=\"h-4 w-4\" />\n Load More Orders\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4CA,IAAM,IAAY,IAEZ,IAAgB;CACpB;EAAE,OAAO;EAAI,OAAO;EAAc;CAClC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACxD;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC3C,EAEK,IAAmB;CACvB;EAAE,OAAO;EAAS,OAAO;EAAe;CACxC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAO,OAAO;EAAY;CACpC,EAEK,IAAc;CAClB;EAAE,OAAO;EAAU,OAAO;EAAe;CACzC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAe,OAAO;EAAuB;CACt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