@burdenoff/microfe-coolandlovely 2026.1109.7 → 2026.1109.9

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 (555) hide show
  1. package/dist/coolandlovely/CoolAndLovelyRoot.d.ts +0 -1
  2. package/dist/coolandlovely/CoolAndLovelyRoot.js +0 -2
  3. package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts +0 -1
  4. package/dist/coolandlovely/CoolAndLovelyRoutes.js +0 -2
  5. package/dist/coolandlovely/api/creatorMarketplaceRequest.d.ts +0 -1
  6. package/dist/coolandlovely/api/creatorMarketplaceRequest.js +0 -2
  7. package/dist/coolandlovely/api/resaleTransport.d.ts +0 -1
  8. package/dist/coolandlovely/api/resaleTransport.js +0 -2
  9. package/dist/coolandlovely/components/ActivityTrail.d.ts +0 -1
  10. package/dist/coolandlovely/components/ActivityTrail.js +0 -2
  11. package/dist/coolandlovely/components/ActorName.d.ts +0 -1
  12. package/dist/coolandlovely/components/ActorName.js +0 -2
  13. package/dist/coolandlovely/components/AddToCartPanel.d.ts +0 -1
  14. package/dist/coolandlovely/components/AddToCartPanel.js +0 -2
  15. package/dist/coolandlovely/components/AddToLookbookButton.d.ts +0 -1
  16. package/dist/coolandlovely/components/AddToLookbookButton.js +0 -2
  17. package/dist/coolandlovely/components/BrandCard.d.ts +0 -1
  18. package/dist/coolandlovely/components/BrandCard.js +0 -2
  19. package/dist/coolandlovely/components/BrandCover.d.ts +0 -1
  20. package/dist/coolandlovely/components/BrandCover.js +0 -2
  21. package/dist/coolandlovely/components/BrandCreatorAvatars.d.ts +0 -1
  22. package/dist/coolandlovely/components/BrandCreatorAvatars.js +0 -2
  23. package/dist/coolandlovely/components/CollaborationFeeCard.d.ts +0 -1
  24. package/dist/coolandlovely/components/CollaborationFeeCard.js +0 -2
  25. package/dist/coolandlovely/components/CollectionCard.d.ts +0 -1
  26. package/dist/coolandlovely/components/CollectionCard.js +0 -2
  27. package/dist/coolandlovely/components/ColourSwatchRow.d.ts +0 -1
  28. package/dist/coolandlovely/components/ColourSwatchRow.js +0 -2
  29. package/dist/coolandlovely/components/Comments.d.ts +0 -1
  30. package/dist/coolandlovely/components/Comments.js +0 -2
  31. package/dist/coolandlovely/components/EmptyState.d.ts +0 -1
  32. package/dist/coolandlovely/components/EmptyState.js +0 -2
  33. package/dist/coolandlovely/components/FeedbackWidget.d.ts +0 -1
  34. package/dist/coolandlovely/components/FeedbackWidget.js +0 -2
  35. package/dist/coolandlovely/components/Field.d.ts +0 -1
  36. package/dist/coolandlovely/components/Field.js +0 -2
  37. package/dist/coolandlovely/components/FileImage.d.ts +0 -1
  38. package/dist/coolandlovely/components/FileImage.js +0 -2
  39. package/dist/coolandlovely/components/FollowButton.d.ts +0 -1
  40. package/dist/coolandlovely/components/FollowButton.js +0 -2
  41. package/dist/coolandlovely/components/FulfilmentTimeline.d.ts +0 -1
  42. package/dist/coolandlovely/components/FulfilmentTimeline.js +0 -2
  43. package/dist/coolandlovely/components/ImageUploadField.d.ts +0 -1
  44. package/dist/coolandlovely/components/ImageUploadField.js +0 -2
  45. package/dist/coolandlovely/components/LookCard.d.ts +0 -1
  46. package/dist/coolandlovely/components/LookCard.js +0 -2
  47. package/dist/coolandlovely/components/LookbookCard.d.ts +0 -1
  48. package/dist/coolandlovely/components/LookbookCard.js +0 -2
  49. package/dist/coolandlovely/components/MetricsCard.d.ts +0 -1
  50. package/dist/coolandlovely/components/MetricsCard.js +0 -2
  51. package/dist/coolandlovely/components/PageLayout.d.ts +0 -1
  52. package/dist/coolandlovely/components/PageLayout.js +0 -2
  53. package/dist/coolandlovely/components/PayForOrder.d.ts +0 -1
  54. package/dist/coolandlovely/components/PayForOrder.js +0 -2
  55. package/dist/coolandlovely/components/RefundPanel.d.ts +0 -1
  56. package/dist/coolandlovely/components/RefundPanel.js +0 -2
  57. package/dist/coolandlovely/components/ResaleListingActions.d.ts +0 -1
  58. package/dist/coolandlovely/components/ResaleListingActions.js +0 -2
  59. package/dist/coolandlovely/components/ResaleListingEditor.d.ts +0 -1
  60. package/dist/coolandlovely/components/ResaleListingEditor.js +0 -2
  61. package/dist/coolandlovely/components/ResalePhotoPicker.d.ts +2 -2
  62. package/dist/coolandlovely/components/ResalePhotoPicker.js +74 -64
  63. package/dist/coolandlovely/components/ResalePhotoUpload.d.ts +6 -0
  64. package/dist/coolandlovely/components/ResalePhotoUpload.js +178 -0
  65. package/dist/coolandlovely/components/ReturnRequests.d.ts +0 -1
  66. package/dist/coolandlovely/components/ReturnRequests.js +0 -2
  67. package/dist/coolandlovely/components/ShopItemCard.d.ts +0 -1
  68. package/dist/coolandlovely/components/ShopItemCard.js +0 -2
  69. package/dist/coolandlovely/components/StateViews.d.ts +0 -1
  70. package/dist/coolandlovely/components/StateViews.js +0 -2
  71. package/dist/coolandlovely/components/StatusBadge.d.ts +0 -1
  72. package/dist/coolandlovely/components/StatusBadge.js +0 -2
  73. package/dist/coolandlovely/components/StepTracker.d.ts +0 -1
  74. package/dist/coolandlovely/components/StepTracker.js +0 -2
  75. package/dist/coolandlovely/components/StockEditor.d.ts +0 -1
  76. package/dist/coolandlovely/components/StockEditor.js +0 -2
  77. package/dist/coolandlovely/components/StoreListingCard.d.ts +0 -1
  78. package/dist/coolandlovely/components/StoreListingCard.js +0 -2
  79. package/dist/coolandlovely/components/TagList.d.ts +0 -1
  80. package/dist/coolandlovely/components/TagList.js +0 -2
  81. package/dist/coolandlovely/components/Thumbnail.d.ts +0 -1
  82. package/dist/coolandlovely/components/Thumbnail.js +0 -2
  83. package/dist/coolandlovely/components/VisibilityChip.d.ts +0 -1
  84. package/dist/coolandlovely/components/VisibilityChip.js +0 -2
  85. package/dist/coolandlovely/components/WardrobeItemCard.d.ts +0 -1
  86. package/dist/coolandlovely/components/WardrobeItemCard.js +0 -2
  87. package/dist/coolandlovely/components/index.d.ts +0 -1
  88. package/dist/coolandlovely/components/prices/BestPriceBadge.d.ts +0 -1
  89. package/dist/coolandlovely/components/prices/BestPriceBadge.js +0 -2
  90. package/dist/coolandlovely/components/prices/LookbookPriceBoard.d.ts +0 -1
  91. package/dist/coolandlovely/components/prices/LookbookPriceBoard.js +0 -2
  92. package/dist/coolandlovely/components/prices/PriceComparison.d.ts +0 -1
  93. package/dist/coolandlovely/components/prices/PriceComparison.js +0 -2
  94. package/dist/coolandlovely/components/prices/PriceCurrencySelect.d.ts +0 -1
  95. package/dist/coolandlovely/components/prices/PriceCurrencySelect.js +0 -2
  96. package/dist/coolandlovely/components/prices/PricePanel.d.ts +0 -1
  97. package/dist/coolandlovely/components/prices/PricePanel.js +0 -2
  98. package/dist/coolandlovely/components/prices/PriceWatchDisclosure.d.ts +0 -1
  99. package/dist/coolandlovely/components/prices/PriceWatchDisclosure.js +0 -2
  100. package/dist/coolandlovely/components/prices/PriceWatchForm.d.ts +0 -1
  101. package/dist/coolandlovely/components/prices/PriceWatchForm.js +0 -2
  102. package/dist/coolandlovely/components/prices/PriceWatches.d.ts +0 -1
  103. package/dist/coolandlovely/components/prices/PriceWatches.js +0 -2
  104. package/dist/coolandlovely/components/prices/RetailerOfferLink.d.ts +0 -1
  105. package/dist/coolandlovely/components/prices/RetailerOfferLink.js +0 -2
  106. package/dist/coolandlovely/components/prices/money.d.ts +0 -1
  107. package/dist/coolandlovely/components/prices/money.js +0 -2
  108. package/dist/coolandlovely/context/CoolAndLovelyContext.d.ts +0 -1
  109. package/dist/coolandlovely/context/CoolAndLovelyContext.js +0 -2
  110. package/dist/coolandlovely/context/QueryScope.d.ts +0 -1
  111. package/dist/coolandlovely/context/QueryScope.js +0 -2
  112. package/dist/coolandlovely/context/index.d.ts +0 -1
  113. package/dist/coolandlovely/context/queryScopeKey.d.ts +0 -1
  114. package/dist/coolandlovely/context/queryScopeKey.js +0 -2
  115. package/dist/coolandlovely/hooks/contextNavigationTarget.d.ts +0 -1
  116. package/dist/coolandlovely/hooks/contextNavigationTarget.js +0 -2
  117. package/dist/coolandlovely/hooks/index.d.ts +0 -1
  118. package/dist/coolandlovely/hooks/useActivity.d.ts +0 -1
  119. package/dist/coolandlovely/hooks/useActivity.js +0 -2
  120. package/dist/coolandlovely/hooks/useAssistantEntity.d.ts +0 -1
  121. package/dist/coolandlovely/hooks/useAssistantEntity.js +0 -2
  122. package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts +0 -1
  123. package/dist/coolandlovely/hooks/useBrandOrdersApi.js +0 -2
  124. package/dist/coolandlovely/hooks/useCatalogImport.d.ts +0 -1
  125. package/dist/coolandlovely/hooks/useCatalogImport.js +0 -2
  126. package/dist/coolandlovely/hooks/useComments.d.ts +0 -1
  127. package/dist/coolandlovely/hooks/useComments.js +0 -2
  128. package/dist/coolandlovely/hooks/useCommerceApi.d.ts +0 -1
  129. package/dist/coolandlovely/hooks/useCommerceApi.js +0 -2
  130. package/dist/coolandlovely/hooks/useContextNavigation.d.ts +0 -1
  131. package/dist/coolandlovely/hooks/useContextNavigation.js +0 -2
  132. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts +0 -1
  133. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +0 -2
  134. package/dist/coolandlovely/hooks/useCreatorAnalytics.d.ts +0 -1
  135. package/dist/coolandlovely/hooks/useCreatorAnalytics.js +0 -2
  136. package/dist/coolandlovely/hooks/useCreatorMarketplace.d.ts +0 -1
  137. package/dist/coolandlovely/hooks/useCreatorMarketplace.js +0 -2
  138. package/dist/coolandlovely/hooks/useEditorialApi.d.ts +0 -1
  139. package/dist/coolandlovely/hooks/useEditorialApi.js +0 -2
  140. package/dist/coolandlovely/hooks/useFiles.d.ts +0 -1
  141. package/dist/coolandlovely/hooks/useFiles.js +0 -2
  142. package/dist/coolandlovely/hooks/useInventoryApi.d.ts +0 -1
  143. package/dist/coolandlovely/hooks/useInventoryApi.js +0 -2
  144. package/dist/coolandlovely/hooks/usePriceApi.d.ts +0 -1
  145. package/dist/coolandlovely/hooks/usePriceApi.js +0 -2
  146. package/dist/coolandlovely/hooks/useResale.d.ts +0 -1
  147. package/dist/coolandlovely/hooks/useResale.js +0 -2
  148. package/dist/coolandlovely/hooks/useTr.d.ts +0 -1
  149. package/dist/coolandlovely/hooks/useTr.js +0 -2
  150. package/dist/coolandlovely/index.d.ts +0 -1
  151. package/dist/coolandlovely/pages/HomePage.d.ts +0 -1
  152. package/dist/coolandlovely/pages/HomePage.js +0 -2
  153. package/dist/coolandlovely/pages/admin/AdminBrandsPage.d.ts +0 -1
  154. package/dist/coolandlovely/pages/admin/AdminBrandsPage.js +0 -2
  155. package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.d.ts +0 -1
  156. package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.js +0 -2
  157. package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.d.ts +0 -1
  158. package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.js +0 -2
  159. package/dist/coolandlovely/pages/admin/index.d.ts +0 -1
  160. package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts +0 -1
  161. package/dist/coolandlovely/pages/brands/BrandDetailPage.js +0 -2
  162. package/dist/coolandlovely/pages/brands/BrandFormPage.d.ts +0 -1
  163. package/dist/coolandlovely/pages/brands/BrandFormPage.js +0 -2
  164. package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts +0 -1
  165. package/dist/coolandlovely/pages/brands/BrandsListPage.js +0 -2
  166. package/dist/coolandlovely/pages/brands/ImportCatalogPage.d.ts +0 -1
  167. package/dist/coolandlovely/pages/brands/ImportCatalogPage.js +0 -2
  168. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.d.ts +0 -1
  169. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js +0 -2
  170. package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.d.ts +0 -1
  171. package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.js +0 -2
  172. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts +0 -1
  173. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js +0 -2
  174. package/dist/coolandlovely/pages/collections/CollectionDetailPage.d.ts +0 -1
  175. package/dist/coolandlovely/pages/collections/CollectionDetailPage.js +0 -2
  176. package/dist/coolandlovely/pages/collections/CollectionFormPage.d.ts +0 -1
  177. package/dist/coolandlovely/pages/collections/CollectionFormPage.js +0 -2
  178. package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts +0 -1
  179. package/dist/coolandlovely/pages/collections/CollectionsListPage.js +0 -2
  180. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts +0 -1
  181. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js +0 -2
  182. package/dist/coolandlovely/pages/commerce/CartPage.d.ts +0 -1
  183. package/dist/coolandlovely/pages/commerce/CartPage.js +0 -2
  184. package/dist/coolandlovely/pages/commerce/CreatorAnalyticsSection.d.ts +0 -1
  185. package/dist/coolandlovely/pages/commerce/CreatorAnalyticsSection.js +0 -2
  186. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts +0 -1
  187. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js +0 -2
  188. package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts +0 -1
  189. package/dist/coolandlovely/pages/commerce/OrdersPage.js +0 -2
  190. package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts +0 -1
  191. package/dist/coolandlovely/pages/discover/DiscoverPage.js +0 -2
  192. package/dist/coolandlovely/pages/editorial/EditorialPage.d.ts +0 -1
  193. package/dist/coolandlovely/pages/editorial/EditorialPage.js +0 -2
  194. package/dist/coolandlovely/pages/items/StoreListedPieceView.d.ts +0 -1
  195. package/dist/coolandlovely/pages/items/StoreListedPieceView.js +0 -2
  196. package/dist/coolandlovely/pages/items/StyleItemDetailPage.d.ts +0 -1
  197. package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +0 -2
  198. package/dist/coolandlovely/pages/items/StyleItemFormPage.d.ts +0 -1
  199. package/dist/coolandlovely/pages/items/StyleItemFormPage.js +0 -2
  200. package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts +0 -1
  201. package/dist/coolandlovely/pages/items/StyleItemsListPage.js +0 -2
  202. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.d.ts +0 -1
  203. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js +0 -2
  204. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts +0 -1
  205. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js +0 -2
  206. package/dist/coolandlovely/pages/looks/LookDetailPage.d.ts +0 -1
  207. package/dist/coolandlovely/pages/looks/LookDetailPage.js +0 -2
  208. package/dist/coolandlovely/pages/looks/LookFormPage.d.ts +0 -1
  209. package/dist/coolandlovely/pages/looks/LookFormPage.js +0 -2
  210. package/dist/coolandlovely/pages/looks/LooksListPage.d.ts +0 -1
  211. package/dist/coolandlovely/pages/looks/LooksListPage.js +0 -2
  212. package/dist/coolandlovely/pages/marketplace/CreatorMarketplacePage.d.ts +0 -1
  213. package/dist/coolandlovely/pages/marketplace/CreatorMarketplacePage.js +0 -2
  214. package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts +0 -1
  215. package/dist/coolandlovely/pages/profile/StyleProfilePage.js +0 -2
  216. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts +0 -1
  217. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js +0 -2
  218. package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts +0 -1
  219. package/dist/coolandlovely/pages/resale/ResaleListingPage.js +0 -2
  220. package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts +0 -1
  221. package/dist/coolandlovely/pages/resale/ResaleReportsPage.js +0 -2
  222. package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts +0 -1
  223. package/dist/coolandlovely/pages/resale/ResaleSellerPage.js +0 -2
  224. package/dist/coolandlovely/pages/trends/TrendsPage.d.ts +0 -1
  225. package/dist/coolandlovely/pages/trends/TrendsPage.js +0 -2
  226. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.d.ts +0 -1
  227. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js +0 -2
  228. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts +0 -1
  229. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js +0 -2
  230. package/dist/coolandlovely/store/coolandlovelyStore.d.ts +0 -1
  231. package/dist/coolandlovely/store/coolandlovelyStore.js +0 -2
  232. package/dist/coolandlovely/store/index.d.ts +0 -1
  233. package/dist/coolandlovely/types/commerce.d.ts +0 -1
  234. package/dist/coolandlovely/types/index.d.ts +0 -1
  235. package/dist/coolandlovely/utils/cn.d.ts +0 -1
  236. package/dist/coolandlovely/utils/cn.js +0 -2
  237. package/dist/coolandlovely/utils/formatters.d.ts +0 -1
  238. package/dist/coolandlovely/utils/formatters.js +0 -2
  239. package/dist/coolandlovely/utils/icons.d.ts +0 -1
  240. package/dist/coolandlovely/utils/icons.js +0 -2
  241. package/dist/coolandlovely/utils/index.d.ts +0 -1
  242. package/dist/coolandlovely/utils/navigation.d.ts +0 -1
  243. package/dist/coolandlovely/utils/navigation.js +0 -2
  244. package/dist/coolandlovely/utils/paymentProviders.d.ts +0 -1
  245. package/dist/coolandlovely/utils/paymentProviders.js +0 -2
  246. package/dist/coolandlovely/utils/resaleCreateIntent.d.ts +0 -1
  247. package/dist/coolandlovely/utils/resaleCreateIntent.js +0 -2
  248. package/dist/coolandlovely/utils/resalePhotoUpload.d.ts +23 -0
  249. package/dist/coolandlovely/utils/resalePhotoUpload.js +121 -0
  250. package/dist/coolandlovely/utils/resalePhotoUploadIntent.d.ts +32 -0
  251. package/dist/coolandlovely/utils/resalePhotoUploadIntent.js +106 -0
  252. package/dist/coolandlovely/utils/resalePresentation.d.ts +0 -1
  253. package/dist/coolandlovely/utils/resalePresentation.js +0 -2
  254. package/dist/coolandlovely/utils/sparkline.d.ts +0 -1
  255. package/dist/coolandlovely/utils/sparkline.js +0 -2
  256. package/dist/generated/global-operations.d.ts +0 -1
  257. package/dist/generated/global-types.d.ts +0 -1
  258. package/dist/generated/wspace-operations.d.ts +0 -1
  259. package/dist/generated/wspace-operations.js +0 -2
  260. package/dist/generated/wspace-types.d.ts +0 -1
  261. package/dist/generated/wspace-types.js +0 -2
  262. package/dist/index.d.ts +0 -1
  263. package/dist/node_modules/clsx/dist/clsx.js +0 -2
  264. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -2
  265. package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
  266. package/dist/services/createSandboxAssistantTransport.js +0 -2
  267. package/dist/stories/__fixtures__/coolandlovely.d.ts +0 -1
  268. package/dist/utils/pageContext.d.ts +0 -1
  269. package/dist/utils/pageContext.js +0 -2
  270. package/package.json +8 -5
  271. package/dist/coolandlovely/CoolAndLovelyRoot.d.ts.map +0 -1
  272. package/dist/coolandlovely/CoolAndLovelyRoot.js.map +0 -1
  273. package/dist/coolandlovely/CoolAndLovelyRoutes.d.ts.map +0 -1
  274. package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +0 -1
  275. package/dist/coolandlovely/api/creatorMarketplaceRequest.d.ts.map +0 -1
  276. package/dist/coolandlovely/api/creatorMarketplaceRequest.js.map +0 -1
  277. package/dist/coolandlovely/api/resaleTransport.d.ts.map +0 -1
  278. package/dist/coolandlovely/api/resaleTransport.js.map +0 -1
  279. package/dist/coolandlovely/components/ActivityTrail.d.ts.map +0 -1
  280. package/dist/coolandlovely/components/ActivityTrail.js.map +0 -1
  281. package/dist/coolandlovely/components/ActorName.d.ts.map +0 -1
  282. package/dist/coolandlovely/components/ActorName.js.map +0 -1
  283. package/dist/coolandlovely/components/AddToCartPanel.d.ts.map +0 -1
  284. package/dist/coolandlovely/components/AddToCartPanel.js.map +0 -1
  285. package/dist/coolandlovely/components/AddToLookbookButton.d.ts.map +0 -1
  286. package/dist/coolandlovely/components/AddToLookbookButton.js.map +0 -1
  287. package/dist/coolandlovely/components/BrandCard.d.ts.map +0 -1
  288. package/dist/coolandlovely/components/BrandCard.js.map +0 -1
  289. package/dist/coolandlovely/components/BrandCover.d.ts.map +0 -1
  290. package/dist/coolandlovely/components/BrandCover.js.map +0 -1
  291. package/dist/coolandlovely/components/BrandCreatorAvatars.d.ts.map +0 -1
  292. package/dist/coolandlovely/components/BrandCreatorAvatars.js.map +0 -1
  293. package/dist/coolandlovely/components/CollaborationFeeCard.d.ts.map +0 -1
  294. package/dist/coolandlovely/components/CollaborationFeeCard.js.map +0 -1
  295. package/dist/coolandlovely/components/CollectionCard.d.ts.map +0 -1
  296. package/dist/coolandlovely/components/CollectionCard.js.map +0 -1
  297. package/dist/coolandlovely/components/ColourSwatchRow.d.ts.map +0 -1
  298. package/dist/coolandlovely/components/ColourSwatchRow.js.map +0 -1
  299. package/dist/coolandlovely/components/Comments.d.ts.map +0 -1
  300. package/dist/coolandlovely/components/Comments.js.map +0 -1
  301. package/dist/coolandlovely/components/EmptyState.d.ts.map +0 -1
  302. package/dist/coolandlovely/components/EmptyState.js.map +0 -1
  303. package/dist/coolandlovely/components/FeedbackWidget.d.ts.map +0 -1
  304. package/dist/coolandlovely/components/FeedbackWidget.js.map +0 -1
  305. package/dist/coolandlovely/components/Field.d.ts.map +0 -1
  306. package/dist/coolandlovely/components/Field.js.map +0 -1
  307. package/dist/coolandlovely/components/FileImage.d.ts.map +0 -1
  308. package/dist/coolandlovely/components/FileImage.js.map +0 -1
  309. package/dist/coolandlovely/components/FollowButton.d.ts.map +0 -1
  310. package/dist/coolandlovely/components/FollowButton.js.map +0 -1
  311. package/dist/coolandlovely/components/FulfilmentTimeline.d.ts.map +0 -1
  312. package/dist/coolandlovely/components/FulfilmentTimeline.js.map +0 -1
  313. package/dist/coolandlovely/components/ImageUploadField.d.ts.map +0 -1
  314. package/dist/coolandlovely/components/ImageUploadField.js.map +0 -1
  315. package/dist/coolandlovely/components/LookCard.d.ts.map +0 -1
  316. package/dist/coolandlovely/components/LookCard.js.map +0 -1
  317. package/dist/coolandlovely/components/LookbookCard.d.ts.map +0 -1
  318. package/dist/coolandlovely/components/LookbookCard.js.map +0 -1
  319. package/dist/coolandlovely/components/MetricsCard.d.ts.map +0 -1
  320. package/dist/coolandlovely/components/MetricsCard.js.map +0 -1
  321. package/dist/coolandlovely/components/PageLayout.d.ts.map +0 -1
  322. package/dist/coolandlovely/components/PageLayout.js.map +0 -1
  323. package/dist/coolandlovely/components/PayForOrder.d.ts.map +0 -1
  324. package/dist/coolandlovely/components/PayForOrder.js.map +0 -1
  325. package/dist/coolandlovely/components/RefundPanel.d.ts.map +0 -1
  326. package/dist/coolandlovely/components/RefundPanel.js.map +0 -1
  327. package/dist/coolandlovely/components/ResaleListingActions.d.ts.map +0 -1
  328. package/dist/coolandlovely/components/ResaleListingActions.js.map +0 -1
  329. package/dist/coolandlovely/components/ResaleListingEditor.d.ts.map +0 -1
  330. package/dist/coolandlovely/components/ResaleListingEditor.js.map +0 -1
  331. package/dist/coolandlovely/components/ResalePhotoPicker.d.ts.map +0 -1
  332. package/dist/coolandlovely/components/ResalePhotoPicker.js.map +0 -1
  333. package/dist/coolandlovely/components/ReturnRequests.d.ts.map +0 -1
  334. package/dist/coolandlovely/components/ReturnRequests.js.map +0 -1
  335. package/dist/coolandlovely/components/ShopItemCard.d.ts.map +0 -1
  336. package/dist/coolandlovely/components/ShopItemCard.js.map +0 -1
  337. package/dist/coolandlovely/components/StateViews.d.ts.map +0 -1
  338. package/dist/coolandlovely/components/StateViews.js.map +0 -1
  339. package/dist/coolandlovely/components/StatusBadge.d.ts.map +0 -1
  340. package/dist/coolandlovely/components/StatusBadge.js.map +0 -1
  341. package/dist/coolandlovely/components/StepTracker.d.ts.map +0 -1
  342. package/dist/coolandlovely/components/StepTracker.js.map +0 -1
  343. package/dist/coolandlovely/components/StockEditor.d.ts.map +0 -1
  344. package/dist/coolandlovely/components/StockEditor.js.map +0 -1
  345. package/dist/coolandlovely/components/StoreListingCard.d.ts.map +0 -1
  346. package/dist/coolandlovely/components/StoreListingCard.js.map +0 -1
  347. package/dist/coolandlovely/components/TagList.d.ts.map +0 -1
  348. package/dist/coolandlovely/components/TagList.js.map +0 -1
  349. package/dist/coolandlovely/components/Thumbnail.d.ts.map +0 -1
  350. package/dist/coolandlovely/components/Thumbnail.js.map +0 -1
  351. package/dist/coolandlovely/components/VisibilityChip.d.ts.map +0 -1
  352. package/dist/coolandlovely/components/VisibilityChip.js.map +0 -1
  353. package/dist/coolandlovely/components/WardrobeItemCard.d.ts.map +0 -1
  354. package/dist/coolandlovely/components/WardrobeItemCard.js.map +0 -1
  355. package/dist/coolandlovely/components/index.d.ts.map +0 -1
  356. package/dist/coolandlovely/components/prices/BestPriceBadge.d.ts.map +0 -1
  357. package/dist/coolandlovely/components/prices/BestPriceBadge.js.map +0 -1
  358. package/dist/coolandlovely/components/prices/LookbookPriceBoard.d.ts.map +0 -1
  359. package/dist/coolandlovely/components/prices/LookbookPriceBoard.js.map +0 -1
  360. package/dist/coolandlovely/components/prices/PriceComparison.d.ts.map +0 -1
  361. package/dist/coolandlovely/components/prices/PriceComparison.js.map +0 -1
  362. package/dist/coolandlovely/components/prices/PriceCurrencySelect.d.ts.map +0 -1
  363. package/dist/coolandlovely/components/prices/PriceCurrencySelect.js.map +0 -1
  364. package/dist/coolandlovely/components/prices/PricePanel.d.ts.map +0 -1
  365. package/dist/coolandlovely/components/prices/PricePanel.js.map +0 -1
  366. package/dist/coolandlovely/components/prices/PriceWatchDisclosure.d.ts.map +0 -1
  367. package/dist/coolandlovely/components/prices/PriceWatchDisclosure.js.map +0 -1
  368. package/dist/coolandlovely/components/prices/PriceWatchForm.d.ts.map +0 -1
  369. package/dist/coolandlovely/components/prices/PriceWatchForm.js.map +0 -1
  370. package/dist/coolandlovely/components/prices/PriceWatches.d.ts.map +0 -1
  371. package/dist/coolandlovely/components/prices/PriceWatches.js.map +0 -1
  372. package/dist/coolandlovely/components/prices/RetailerOfferLink.d.ts.map +0 -1
  373. package/dist/coolandlovely/components/prices/RetailerOfferLink.js.map +0 -1
  374. package/dist/coolandlovely/components/prices/money.d.ts.map +0 -1
  375. package/dist/coolandlovely/components/prices/money.js.map +0 -1
  376. package/dist/coolandlovely/context/CoolAndLovelyContext.d.ts.map +0 -1
  377. package/dist/coolandlovely/context/CoolAndLovelyContext.js.map +0 -1
  378. package/dist/coolandlovely/context/QueryScope.d.ts.map +0 -1
  379. package/dist/coolandlovely/context/QueryScope.js.map +0 -1
  380. package/dist/coolandlovely/context/index.d.ts.map +0 -1
  381. package/dist/coolandlovely/context/queryScopeKey.d.ts.map +0 -1
  382. package/dist/coolandlovely/context/queryScopeKey.js.map +0 -1
  383. package/dist/coolandlovely/hooks/contextNavigationTarget.d.ts.map +0 -1
  384. package/dist/coolandlovely/hooks/contextNavigationTarget.js.map +0 -1
  385. package/dist/coolandlovely/hooks/index.d.ts.map +0 -1
  386. package/dist/coolandlovely/hooks/useActivity.d.ts.map +0 -1
  387. package/dist/coolandlovely/hooks/useActivity.js.map +0 -1
  388. package/dist/coolandlovely/hooks/useAssistantEntity.d.ts.map +0 -1
  389. package/dist/coolandlovely/hooks/useAssistantEntity.js.map +0 -1
  390. package/dist/coolandlovely/hooks/useBrandOrdersApi.d.ts.map +0 -1
  391. package/dist/coolandlovely/hooks/useBrandOrdersApi.js.map +0 -1
  392. package/dist/coolandlovely/hooks/useCatalogImport.d.ts.map +0 -1
  393. package/dist/coolandlovely/hooks/useCatalogImport.js.map +0 -1
  394. package/dist/coolandlovely/hooks/useComments.d.ts.map +0 -1
  395. package/dist/coolandlovely/hooks/useComments.js.map +0 -1
  396. package/dist/coolandlovely/hooks/useCommerceApi.d.ts.map +0 -1
  397. package/dist/coolandlovely/hooks/useCommerceApi.js.map +0 -1
  398. package/dist/coolandlovely/hooks/useContextNavigation.d.ts.map +0 -1
  399. package/dist/coolandlovely/hooks/useContextNavigation.js.map +0 -1
  400. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.d.ts.map +0 -1
  401. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js.map +0 -1
  402. package/dist/coolandlovely/hooks/useCreatorAnalytics.d.ts.map +0 -1
  403. package/dist/coolandlovely/hooks/useCreatorAnalytics.js.map +0 -1
  404. package/dist/coolandlovely/hooks/useCreatorMarketplace.d.ts.map +0 -1
  405. package/dist/coolandlovely/hooks/useCreatorMarketplace.js.map +0 -1
  406. package/dist/coolandlovely/hooks/useEditorialApi.d.ts.map +0 -1
  407. package/dist/coolandlovely/hooks/useEditorialApi.js.map +0 -1
  408. package/dist/coolandlovely/hooks/useFiles.d.ts.map +0 -1
  409. package/dist/coolandlovely/hooks/useFiles.js.map +0 -1
  410. package/dist/coolandlovely/hooks/useInventoryApi.d.ts.map +0 -1
  411. package/dist/coolandlovely/hooks/useInventoryApi.js.map +0 -1
  412. package/dist/coolandlovely/hooks/usePriceApi.d.ts.map +0 -1
  413. package/dist/coolandlovely/hooks/usePriceApi.js.map +0 -1
  414. package/dist/coolandlovely/hooks/useResale.d.ts.map +0 -1
  415. package/dist/coolandlovely/hooks/useResale.js.map +0 -1
  416. package/dist/coolandlovely/hooks/useTr.d.ts.map +0 -1
  417. package/dist/coolandlovely/hooks/useTr.js.map +0 -1
  418. package/dist/coolandlovely/index.d.ts.map +0 -1
  419. package/dist/coolandlovely/pages/HomePage.d.ts.map +0 -1
  420. package/dist/coolandlovely/pages/HomePage.js.map +0 -1
  421. package/dist/coolandlovely/pages/admin/AdminBrandsPage.d.ts.map +0 -1
  422. package/dist/coolandlovely/pages/admin/AdminBrandsPage.js.map +0 -1
  423. package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.d.ts.map +0 -1
  424. package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.js.map +0 -1
  425. package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.d.ts.map +0 -1
  426. package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.js.map +0 -1
  427. package/dist/coolandlovely/pages/admin/index.d.ts.map +0 -1
  428. package/dist/coolandlovely/pages/brands/BrandDetailPage.d.ts.map +0 -1
  429. package/dist/coolandlovely/pages/brands/BrandDetailPage.js.map +0 -1
  430. package/dist/coolandlovely/pages/brands/BrandFormPage.d.ts.map +0 -1
  431. package/dist/coolandlovely/pages/brands/BrandFormPage.js.map +0 -1
  432. package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts.map +0 -1
  433. package/dist/coolandlovely/pages/brands/BrandsListPage.js.map +0 -1
  434. package/dist/coolandlovely/pages/brands/ImportCatalogPage.d.ts.map +0 -1
  435. package/dist/coolandlovely/pages/brands/ImportCatalogPage.js.map +0 -1
  436. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.d.ts.map +0 -1
  437. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js.map +0 -1
  438. package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.d.ts.map +0 -1
  439. package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.js.map +0 -1
  440. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts.map +0 -1
  441. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js.map +0 -1
  442. package/dist/coolandlovely/pages/collections/CollectionDetailPage.d.ts.map +0 -1
  443. package/dist/coolandlovely/pages/collections/CollectionDetailPage.js.map +0 -1
  444. package/dist/coolandlovely/pages/collections/CollectionFormPage.d.ts.map +0 -1
  445. package/dist/coolandlovely/pages/collections/CollectionFormPage.js.map +0 -1
  446. package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts.map +0 -1
  447. package/dist/coolandlovely/pages/collections/CollectionsListPage.js.map +0 -1
  448. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.d.ts.map +0 -1
  449. package/dist/coolandlovely/pages/commerce/BrandOrdersPage.js.map +0 -1
  450. package/dist/coolandlovely/pages/commerce/CartPage.d.ts.map +0 -1
  451. package/dist/coolandlovely/pages/commerce/CartPage.js.map +0 -1
  452. package/dist/coolandlovely/pages/commerce/CreatorAnalyticsSection.d.ts.map +0 -1
  453. package/dist/coolandlovely/pages/commerce/CreatorAnalyticsSection.js.map +0 -1
  454. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.d.ts.map +0 -1
  455. package/dist/coolandlovely/pages/commerce/CreatorEarningsPage.js.map +0 -1
  456. package/dist/coolandlovely/pages/commerce/OrdersPage.d.ts.map +0 -1
  457. package/dist/coolandlovely/pages/commerce/OrdersPage.js.map +0 -1
  458. package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts.map +0 -1
  459. package/dist/coolandlovely/pages/discover/DiscoverPage.js.map +0 -1
  460. package/dist/coolandlovely/pages/editorial/EditorialPage.d.ts.map +0 -1
  461. package/dist/coolandlovely/pages/editorial/EditorialPage.js.map +0 -1
  462. package/dist/coolandlovely/pages/items/StoreListedPieceView.d.ts.map +0 -1
  463. package/dist/coolandlovely/pages/items/StoreListedPieceView.js.map +0 -1
  464. package/dist/coolandlovely/pages/items/StyleItemDetailPage.d.ts.map +0 -1
  465. package/dist/coolandlovely/pages/items/StyleItemDetailPage.js.map +0 -1
  466. package/dist/coolandlovely/pages/items/StyleItemFormPage.d.ts.map +0 -1
  467. package/dist/coolandlovely/pages/items/StyleItemFormPage.js.map +0 -1
  468. package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts.map +0 -1
  469. package/dist/coolandlovely/pages/items/StyleItemsListPage.js.map +0 -1
  470. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.d.ts.map +0 -1
  471. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js.map +0 -1
  472. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts.map +0 -1
  473. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js.map +0 -1
  474. package/dist/coolandlovely/pages/looks/LookDetailPage.d.ts.map +0 -1
  475. package/dist/coolandlovely/pages/looks/LookDetailPage.js.map +0 -1
  476. package/dist/coolandlovely/pages/looks/LookFormPage.d.ts.map +0 -1
  477. package/dist/coolandlovely/pages/looks/LookFormPage.js.map +0 -1
  478. package/dist/coolandlovely/pages/looks/LooksListPage.d.ts.map +0 -1
  479. package/dist/coolandlovely/pages/looks/LooksListPage.js.map +0 -1
  480. package/dist/coolandlovely/pages/marketplace/CreatorMarketplacePage.d.ts.map +0 -1
  481. package/dist/coolandlovely/pages/marketplace/CreatorMarketplacePage.js.map +0 -1
  482. package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts.map +0 -1
  483. package/dist/coolandlovely/pages/profile/StyleProfilePage.js.map +0 -1
  484. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.d.ts.map +0 -1
  485. package/dist/coolandlovely/pages/resale/ResaleBrowsePage.js.map +0 -1
  486. package/dist/coolandlovely/pages/resale/ResaleListingPage.d.ts.map +0 -1
  487. package/dist/coolandlovely/pages/resale/ResaleListingPage.js.map +0 -1
  488. package/dist/coolandlovely/pages/resale/ResaleReportsPage.d.ts.map +0 -1
  489. package/dist/coolandlovely/pages/resale/ResaleReportsPage.js.map +0 -1
  490. package/dist/coolandlovely/pages/resale/ResaleSellerPage.d.ts.map +0 -1
  491. package/dist/coolandlovely/pages/resale/ResaleSellerPage.js.map +0 -1
  492. package/dist/coolandlovely/pages/trends/TrendsPage.d.ts.map +0 -1
  493. package/dist/coolandlovely/pages/trends/TrendsPage.js.map +0 -1
  494. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.d.ts.map +0 -1
  495. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js.map +0 -1
  496. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts.map +0 -1
  497. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js.map +0 -1
  498. package/dist/coolandlovely/store/coolandlovelyStore.d.ts.map +0 -1
  499. package/dist/coolandlovely/store/coolandlovelyStore.js.map +0 -1
  500. package/dist/coolandlovely/store/index.d.ts.map +0 -1
  501. package/dist/coolandlovely/types/commerce.d.ts.map +0 -1
  502. package/dist/coolandlovely/types/index.d.ts.map +0 -1
  503. package/dist/coolandlovely/utils/cn.d.ts.map +0 -1
  504. package/dist/coolandlovely/utils/cn.js.map +0 -1
  505. package/dist/coolandlovely/utils/formatters.d.ts.map +0 -1
  506. package/dist/coolandlovely/utils/formatters.js.map +0 -1
  507. package/dist/coolandlovely/utils/icons.d.ts.map +0 -1
  508. package/dist/coolandlovely/utils/icons.js.map +0 -1
  509. package/dist/coolandlovely/utils/index.d.ts.map +0 -1
  510. package/dist/coolandlovely/utils/navigation.d.ts.map +0 -1
  511. package/dist/coolandlovely/utils/navigation.js.map +0 -1
  512. package/dist/coolandlovely/utils/paymentProviders.d.ts.map +0 -1
  513. package/dist/coolandlovely/utils/paymentProviders.js.map +0 -1
  514. package/dist/coolandlovely/utils/resaleCreateIntent.d.ts.map +0 -1
  515. package/dist/coolandlovely/utils/resaleCreateIntent.js.map +0 -1
  516. package/dist/coolandlovely/utils/resalePresentation.d.ts.map +0 -1
  517. package/dist/coolandlovely/utils/resalePresentation.js.map +0 -1
  518. package/dist/coolandlovely/utils/sparkline.d.ts.map +0 -1
  519. package/dist/coolandlovely/utils/sparkline.js.map +0 -1
  520. package/dist/generated/global-operations.d.ts.map +0 -1
  521. package/dist/generated/global-types.d.ts.map +0 -1
  522. package/dist/generated/wspace-operations.d.ts.map +0 -1
  523. package/dist/generated/wspace-operations.js.map +0 -1
  524. package/dist/generated/wspace-types.d.ts.map +0 -1
  525. package/dist/generated/wspace-types.js.map +0 -1
  526. package/dist/index.d.ts.map +0 -1
  527. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  528. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  529. package/dist/services/createSandboxAssistantTransport.d.ts.map +0 -1
  530. package/dist/services/createSandboxAssistantTransport.js.map +0 -1
  531. package/dist/stories/BrandCard.stories.d.ts +0 -9
  532. package/dist/stories/BrandCard.stories.d.ts.map +0 -1
  533. package/dist/stories/CollectionCard.stories.d.ts +0 -9
  534. package/dist/stories/CollectionCard.stories.d.ts.map +0 -1
  535. package/dist/stories/DiscoverPage.stories.d.ts +0 -10
  536. package/dist/stories/DiscoverPage.stories.d.ts.map +0 -1
  537. package/dist/stories/FeedbackWidget.stories.d.ts +0 -8
  538. package/dist/stories/FeedbackWidget.stories.d.ts.map +0 -1
  539. package/dist/stories/LookCard.stories.d.ts +0 -9
  540. package/dist/stories/LookCard.stories.d.ts.map +0 -1
  541. package/dist/stories/LookbookCard.stories.d.ts +0 -9
  542. package/dist/stories/LookbookCard.stories.d.ts.map +0 -1
  543. package/dist/stories/MetricsCard.stories.d.ts +0 -9
  544. package/dist/stories/MetricsCard.stories.d.ts.map +0 -1
  545. package/dist/stories/ShopItemCard.stories.d.ts +0 -8
  546. package/dist/stories/ShopItemCard.stories.d.ts.map +0 -1
  547. package/dist/stories/StatusBadge.stories.d.ts +0 -10
  548. package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
  549. package/dist/stories/VisibilityChip.stories.d.ts +0 -9
  550. package/dist/stories/VisibilityChip.stories.d.ts.map +0 -1
  551. package/dist/stories/WardrobeItemCard.stories.d.ts +0 -10
  552. package/dist/stories/WardrobeItemCard.stories.d.ts.map +0 -1
  553. package/dist/stories/__fixtures__/coolandlovely.d.ts.map +0 -1
  554. package/dist/utils/pageContext.d.ts.map +0 -1
  555. package/dist/utils/pageContext.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShopItemCard.js","names":[],"sources":["../../../src/coolandlovely/components/ShopItemCard.tsx"],"sourcesContent":["/**\n * ShopItemCard — a product card for the \"shop the look\" grid.\n * @module coolandlovely/components\n *\n * Image + name + brand line + price + a rose \"Shop\" chevron that drills through\n * to the item detail page (the platform has no external shop URL, so \"Shop\" is\n * the internal drill-through). Reuses `Thumbnail`/`FileImage` for imagery.\n */\n\nimport type { FC } from 'react';\nimport { ChevronRight, ShoppingBag } from 'lucide-react';\nimport { Thumbnail } from './Thumbnail';\nimport { formatPrice } from '../utils/formatters';\nimport { cn } from '../utils/cn';\n\ninterface ShopItemCardProps {\n id: string;\n name: string;\n brandName?: string;\n price: number;\n currency: string;\n imageFileId?: string | null;\n onOpen: () => void;\n className?: string;\n}\n\nexport const ShopItemCard: FC<ShopItemCardProps> = ({\n id,\n name,\n brandName,\n price,\n currency,\n imageFileId,\n onOpen,\n className,\n}) => {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Shop ${name}`}\n className={cn(\n 'group flex w-full flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface text-left transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n className\n )}\n >\n <Thumbnail\n icon={<ShoppingBag className=\"h-7 w-7\" />}\n seed={id}\n fileId={imageFileId}\n alt={name}\n className=\"aspect-square w-full rounded-none\"\n />\n <div className=\"flex flex-col gap-0.5 p-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{name}</p>\n {brandName ? <p className=\"truncate text-xs text-text-secondary\">{brandName}</p> : null}\n <div className=\"mt-2 flex items-center justify-between gap-2\">\n <span className=\"text-sm font-semibold text-text-primary tabular-nums\">\n {formatPrice(price, currency)}\n </span>\n <span className=\"inline-flex items-center gap-0.5 text-xs font-semibold text-accent-primary\">\n Shop\n <ChevronRight className=\"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5\" />\n </span>\n </div>\n </div>\n </button>\n );\n};\n"],"mappings":";;;;;;AA0BA,IAAa,KAAuC,EAClD,OACA,SACA,cACA,UACA,aACA,gBACA,WACA,mBAGE,kBAAC,UAAD;CACE,MAAK;CACL,SAAS;CACT,cAAY,QAAQ;CACpB,WAAW,EACT,0OACA,CACF;WAPF,CASE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAa,WAAU,UAAW,CAAA;EACxC,MAAM;EACN,QAAQ;EACR,KAAK;EACL,WAAU;CACX,CAAA,GACD,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,KAAD;IAAG,WAAU;cAAkD;GAAQ,CAAA;GACtE,IAAY,kBAAC,KAAD;IAAG,WAAU;cAAwC;GAAa,CAAA,IAAI;GACnF,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAY,GAAO,CAAQ;IACxB,CAAA,GACN,kBAAC,QAAD;KAAM,WAAU;eAAhB,CAA6F,QAE3F,kBAAC,GAAD,EAAc,WAAU,+DAAgE,CAAA,CACpF;MACH;;EACF;GACC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StateViews.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StateViews.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAK5C,CAAC;AAEF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4BxC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/coolandlovely/components/StateViews.tsx"],"sourcesContent":["/**\n * Loading / Error state views\n * @module coolandlovely/components\n *\n * Calm, on-token loading and error panels reused across the domain pages so\n * every screen has consistent loading/empty/error treatment.\n */\n\nimport type { FC } from 'react';\nimport { AlertCircle, Loader2, RotateCw } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface LoadingViewProps {\n label?: string;\n className?: string;\n}\n\nexport const LoadingView: FC<LoadingViewProps> = ({ label = 'Loading…', className }) => (\n <div className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-3', className)}>\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\ninterface ErrorViewProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}\n\nexport const ErrorView: FC<ErrorViewProps> = ({ title, message, onRetry, className }) => {\n const tr = useTr();\n return (\n <div\n className={cn(\n 'flex min-h-[40vh] flex-col items-center justify-center gap-3 text-center',\n className\n )}\n >\n <AlertCircle className=\"h-10 w-10 text-status-error-text\" />\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {title ?? tr('coolandlovely.error.title', 'Something went wrong')}\n </h2>\n <p className=\"max-w-sm text-sm text-text-secondary\">\n {message ??\n tr('coolandlovely.error.message', 'We could not load this data. Please try again.')}\n </p>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"mt-1 inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <RotateCw className=\"h-4 w-4\" /> {tr('coolandlovely.error.retry', 'Retry')}\n </button>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;AAkBA,IAAa,KAAqC,EAAE,WAAQ,YAAY,mBACtE,kBAAC,OAAD;CAAK,WAAW,EAAG,gEAAgE,CAAS;WAA5F,CACE,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CAAA,GACxD,kBAAC,KAAD;EAAG,WAAU;YAA+B;CAAS,CAAA,CAClD;IAUM,KAAiC,EAAE,UAAO,YAAS,YAAS,mBAAgB;CACvF,IAAM,IAAK,EAAM;CACjB,OACE,kBAAC,OAAD;EACE,WAAW,EACT,4EACA,CACF;YAJF;GAME,kBAAC,GAAD,EAAa,WAAU,mCAAoC,CAAA;GAC3D,kBAAC,MAAD;IAAI,WAAU;cACX,KAAS,EAAG,6BAA6B,sBAAsB;GAC9D,CAAA;GACJ,kBAAC,KAAD;IAAG,WAAU;cACV,KACC,EAAG,+BAA+B,gDAAgD;GACnF,CAAA;GACF,KACC,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA;KAAC;KAAE,EAAG,6BAA6B,OAAO;IACnE;;EAEP;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0ID,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2B5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/coolandlovely/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module coolandlovely/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-accent-blue-subtle text-accent-blue',\n outline: 'border border-border-seam text-text-primary',\n};\n\nconst dotStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-text',\n warning: 'bg-status-warning-text',\n destructive: 'bg-status-error-text',\n secondary: 'bg-text-secondary',\n info: 'bg-accent-blue',\n outline: 'bg-text-secondary',\n};\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Brand lifecycle\n draft: 'secondary',\n pending_review: 'warning',\n published: 'success',\n suspended: 'destructive',\n archived: 'outline',\n\n // Collection lifecycle\n scheduled: 'info',\n live: 'success',\n ended: 'outline',\n\n // Style item status\n active: 'success',\n out_of_stock: 'warning',\n retired: 'outline',\n\n // Collaboration lifecycle\n proposed: 'secondary',\n accepted: 'info',\n in_progress: 'warning',\n declined: 'destructive',\n cancelled: 'destructive',\n\n // Visibility\n public: 'success',\n followers: 'info',\n private: 'secondary',\n\n // Wardrobe source\n owned: 'success',\n wishlist: 'info',\n purchased_on_platform: 'success',\n gifted: 'warning',\n\n // Orders + creator commissions (BOFF-3370)\n pending_payment: 'warning',\n paid: 'success',\n pending: 'secondary',\n synced: 'success',\n\n // Collaboration fees (BOFF-9637)\n awaiting_payment: 'warning',\n\n // Brand fulfilment (BOFF-9636)\n unfulfilled: 'warning',\n confirmed: 'info',\n shipped: 'info',\n delivered: 'success',\n\n // Refunds and commission reversal (BOFF-9702)\n partially_refunded: 'warning',\n refunded: 'outline',\n reversed: 'outline',\n not_reversible: 'warning',\n\n // Shopper return requests (BOFF-9900)\n requested: 'warning',\n approved: 'success',\n\n // Generic\n inactive: 'secondary',\n error: 'destructive',\n failed: 'destructive',\n completed: 'success',\n};\n\n/** Statuses that represent a live/active state get a calm opacity pulse on the dot. */\nconst liveStatuses = new Set(['live', 'published', 'active', 'in_progress']);\n\nconst STATUS_LABEL_KEYS: Record<string, string> = {\n draft: 'coolandlovely.status.draft',\n pending_review: 'coolandlovely.status.pendingReview',\n published: 'coolandlovely.status.published',\n suspended: 'coolandlovely.status.suspended',\n archived: 'coolandlovely.status.archived',\n scheduled: 'coolandlovely.status.scheduled',\n live: 'coolandlovely.status.live',\n ended: 'coolandlovely.status.ended',\n active: 'coolandlovely.status.active',\n out_of_stock: 'coolandlovely.status.outOfStock',\n retired: 'coolandlovely.status.retired',\n proposed: 'coolandlovely.status.proposed',\n accepted: 'coolandlovely.status.accepted',\n in_progress: 'coolandlovely.status.inProgress',\n declined: 'coolandlovely.status.declined',\n cancelled: 'coolandlovely.status.cancelled',\n public: 'coolandlovely.status.public',\n followers: 'coolandlovely.status.followers',\n private: 'coolandlovely.status.private',\n owned: 'coolandlovely.status.owned',\n wishlist: 'coolandlovely.status.wishlist',\n purchased_on_platform: 'coolandlovely.status.purchasedOnPlatform',\n gifted: 'coolandlovely.status.gifted',\n inactive: 'coolandlovely.status.inactive',\n error: 'coolandlovely.status.error',\n failed: 'coolandlovely.status.failed',\n completed: 'coolandlovely.status.completed',\n unfulfilled: 'coolandlovely.status.unfulfilled',\n confirmed: 'coolandlovely.status.confirmed',\n shipped: 'coolandlovely.status.shipped',\n delivered: 'coolandlovely.status.delivered',\n partially_refunded: 'coolandlovely.status.partiallyRefunded',\n refunded: 'coolandlovely.status.refunded',\n reversed: 'coolandlovely.status.reversed',\n not_reversible: 'coolandlovely.status.notReversible',\n awaiting_payment: 'coolandlovely.status.awaitingPayment',\n requested: 'coolandlovely.status.returnRequested',\n approved: 'coolandlovely.status.approved',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const key = status.toLowerCase();\n const variant = statusVariantMap[key] || 'secondary';\n const isLive = liveStatuses.has(key);\n const labelKey = STATUS_LABEL_KEYS[key];\n const label = labelKey ? tr(labelKey, formatStatusLabel(status)) : formatStatusLabel(status);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'h-1.5 w-1.5 rounded-full',\n dotStyles[variant],\n isLive && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAmBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;C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C,CAAC,QAAQ,UAAU,MAAS,EAAK,YAAY,CAAC;AAChF;AAEA,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAK,EAAM,GACX,IAAM,EAAO,YAAY,GACzB,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,CAAG,GAC7B,IAAW,EAAkB,IAC7B,IAAQ,IAAW,EAAG,GAAU,EAAkB,CAAM,CAAC,IAAI,EAAkB,CAAM;CAE3F,OACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,CACF;YALF,CAOE,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,4BACA,EAAU,IACV,KAAU,mCACZ;EACD,CAAA,GACA,CACG;;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepTracker.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StepTracker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,UAAU,gBAAgB;IACxB,oFAAoF;IACpF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6C5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepTracker.js","names":[],"sources":["../../../src/coolandlovely/components/StepTracker.tsx"],"sourcesContent":["/**\n * StepTracker — a horizontal lifecycle tracker for any `Coo*Status` machine.\n * @module coolandlovely/components\n *\n * Renders a row of numbered nodes with connectors: steps before `current` are\n * done (accent-filled + check), the `current` step is ringed, upcoming steps are\n * muted. Token-only. Used by the collaboration lifecycle (Proposed → Accepted →\n * In progress → Published) and reusable for brand/collection lifecycles.\n */\n\nimport type { FC } from 'react';\nimport { Check } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { titleCase } from '../utils/formatters';\n\ninterface StepTrackerProps {\n /** Ordered step values (e.g. ['PROPOSED','ACCEPTED','IN_PROGRESS','PUBLISHED']). */\n steps: string[];\n /** The current step value — must be one of `steps`. */\n current: string;\n className?: string;\n}\n\nexport const StepTracker: FC<StepTrackerProps> = ({ steps, current, className }) => {\n const foundIdx = steps.findIndex((step) => step === current);\n const currentIdx = foundIdx === -1 ? 0 : foundIdx;\n\n return (\n <ol className={cn('flex w-full items-start', className)}>\n {steps.map((step, index) => {\n const state = index < currentIdx ? 'done' : index === currentIdx ? 'current' : 'upcoming';\n const connectorDone = index <= currentIdx;\n return (\n <li key={step} className=\"relative flex flex-1 flex-col items-center gap-2 text-center\">\n {index > 0 ? (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute left-[-50%] top-4 z-0 h-0.5 w-full -translate-y-1/2',\n connectorDone ? 'bg-accent-primary' : 'bg-border-seam'\n )}\n />\n ) : null}\n <span\n className={cn(\n 'relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-xs font-semibold tabular-nums transition-colors',\n state === 'done' && 'bg-accent-primary text-action-primary-text',\n state === 'current' &&\n 'border-2 border-accent-primary bg-bg-surface text-accent-primary',\n state === 'upcoming' &&\n 'border border-border-seam bg-bg-surface text-text-secondary'\n )}\n >\n {state === 'done' ? <Check className=\"h-4 w-4\" /> : index + 1}\n </span>\n <span\n className={cn(\n 'text-xs font-medium',\n state === 'upcoming' ? 'text-text-secondary' : 'text-text-primary'\n )}\n >\n {titleCase(step)}\n </span>\n </li>\n );\n })}\n </ol>\n );\n};\n"],"mappings":";;;;;AAuBA,IAAa,KAAqC,EAAE,UAAO,YAAS,mBAAgB;CAClF,IAAM,IAAW,EAAM,WAAW,MAAS,MAAS,CAAO,GACrD,IAAa,MAAa,KAAK,IAAI;CAEzC,OACE,kBAAC,MAAD;EAAI,WAAW,EAAG,2BAA2B,CAAS;YACnD,EAAM,KAAK,GAAM,MAAU;GAC1B,IAAM,IAAQ,IAAQ,IAAa,SAAS,MAAU,IAAa,YAAY;GAE/E,OACE,kBAAC,MAAD;IAAe,WAAU;cAAzB;KACG,IAAQ,IACP,kBAAC,QAAD;MACE,eAAY;MACZ,WAAW,EACT,gEAPY,KAAS,IAQL,sBAAsB,gBACxC;KACD,CAAA,IACC;KACJ,kBAAC,QAAD;MACE,WAAW,EACT,4HACA,MAAU,UAAU,8CACpB,MAAU,aACR,oEACF,MAAU,cACR,6DACJ;gBAEC,MAAU,SAAS,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA,IAAI,IAAQ;KACxD,CAAA;KACN,kBAAC,QAAD;MACE,WAAW,EACT,uBACA,MAAU,aAAa,wBAAwB,mBACjD;gBAEC,EAAU,CAAI;KACX,CAAA;IACJ;MA9BK,CA8BL;EAER,CAAC;CACC,CAAA;AAER"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StockEditor.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StockEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAgC,MAAM,OAAO,CAAC;AAO9D,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAOD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqK5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StockEditor.js","names":[],"sources":["../../../src/coolandlovely/components/StockEditor.tsx"],"sourcesContent":["/**\n * StockEditor — per-size/colour stock for a style item (BOFF-9637).\n * @module coolandlovely/components\n *\n * A brand switches stock tracking on and records how many units of each variant it can sell.\n * With tracking on, checkout reserves stock and the piece goes ACTIVE / OUT_OF_STOCK on its own\n * as stock runs out or comes back. Units held by unpaid orders are shown, never edited here.\n */\n\nimport { type FC, useEffect, useMemo, useState } from 'react';\nimport { Boxes, Loader2, Save } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\n\nimport { useTr } from '../hooks';\nimport { useSetStyleItemInventory, useStyleItemInventory } from '../hooks/useInventoryApi';\n\ninterface StockEditorProps {\n styleItemId: string;\n}\n\nconst variantKey = (size: string | null, colour: string | null): string =>\n `${size ?? ''}\\u0000${colour ?? ''}`;\n\nconst MAX_STOCK = 100_000;\n\nexport const StockEditor: FC<StockEditorProps> = ({ styleItemId }) => {\n const tr = useTr();\n const inventory = useStyleItemInventory(styleItemId);\n const save = useSetStyleItemInventory();\n const [track, setTrack] = useState(false);\n const [counts, setCounts] = useState<Record<string, string>>({});\n\n useEffect(() => {\n if (!inventory.data) return;\n setTrack(inventory.data.trackInventory);\n setCounts(\n Object.fromEntries(\n inventory.data.variants.map((variant) => [\n variantKey(variant.size, variant.colour),\n String(variant.stockQuantity),\n ])\n )\n );\n }, [inventory.data]);\n\n const invalid = useMemo(\n () =>\n Object.values(counts).some((value) => {\n const n = Number(value);\n return value.trim() === '' || !Number.isInteger(n) || n < 0 || n > MAX_STOCK;\n }),\n [counts]\n );\n\n if (inventory.isLoading || !inventory.data) {\n return inventory.isError ? null : (\n <GlassCard treatment=\"plain\" className=\"p-6\">\n <Loader2 className=\"h-4 w-4 animate-spin text-text-secondary\" />\n </GlassCard>\n );\n }\n\n const variants = inventory.data.variants;\n const label = (size: string | null, colour: string | null): string =>\n [size, colour].filter(Boolean).join(' / ') ||\n tr('coolandlovely.stock.oneSize', 'One size, one colour');\n\n const submit = (): void => {\n save.mutate({\n id: styleItemId,\n input: {\n trackInventory: track,\n variants: variants.map((variant) => ({\n size: variant.size,\n colour: variant.colour,\n stockQuantity: Number(counts[variantKey(variant.size, variant.colour)] ?? 0),\n })),\n },\n });\n };\n\n return (\n <div data-testid=\"stock-editor\">\n <GlassCard treatment=\"plain\" className=\"space-y-4 p-6\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-11 w-11 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n <Boxes className=\"h-5 w-5\" />\n </div>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n {tr('coolandlovely.stock.title', 'Stock')}\n </h2>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'coolandlovely.stock.hint',\n 'Track units per size and colour. Checkout reserves stock, and the piece shows as out of stock on its own when it runs out.'\n )}\n </p>\n </div>\n </div>\n\n <label className=\"flex items-center gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={track}\n onChange={(event) => setTrack(event.target.checked)}\n data-testid=\"stock-track-toggle\"\n />\n {tr('coolandlovely.stock.track', 'Track stock for this piece')}\n </label>\n\n {track && (\n <div className=\"overflow-x-auto rounded-xl border border-border-seam\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-bg-sunken text-left text-xs uppercase tracking-wide text-text-secondary\">\n <tr>\n <th className=\"px-4 py-2\">{tr('coolandlovely.stock.variant', 'Variant')}</th>\n <th className=\"px-4 py-2\">{tr('coolandlovely.stock.available', 'Available')}</th>\n <th className=\"px-4 py-2 text-right\">\n {tr('coolandlovely.stock.reserved', 'Held by unpaid orders')}\n </th>\n </tr>\n </thead>\n <tbody>\n {variants.map((variant) => {\n const key = variantKey(variant.size, variant.colour);\n return (\n <tr key={key} className=\"border-t border-border-seam\">\n <td className=\"px-4 py-2 text-text-primary\">\n {label(variant.size, variant.colour)}\n </td>\n <td className=\"px-4 py-2\">\n <input\n type=\"number\"\n min={0}\n max={MAX_STOCK}\n step={1}\n aria-label={tr('coolandlovely.stock.unitsFor', 'Units of {{variant}}', {\n variant: label(variant.size, variant.colour),\n })}\n value={counts[key] ?? '0'}\n onChange={(event) =>\n setCounts((prev) => ({ ...prev, [key]: event.target.value }))\n }\n className=\"w-24 rounded-lg border border-border-seam bg-bg-surface px-2 py-1 text-sm tabular-nums text-text-primary\"\n />\n </td>\n <td className=\"px-4 py-2 text-right tabular-nums text-text-secondary\">\n {variant.reservedQuantity}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n )}\n\n {invalid && track && (\n <p className=\"text-sm text-status-error-text\">\n {tr('coolandlovely.stock.invalid', 'Enter a whole number of units for every variant.')}\n </p>\n )}\n {save.error && <p className=\"text-sm text-status-error-text\">{save.error.message}</p>}\n {save.isSuccess && !save.isPending && (\n <p className=\"text-sm text-status-success-text\">\n {tr('coolandlovely.stock.saved', 'Stock saved. Sale status: {{status}}', {\n status: save.data.status.replace(/_/g, ' ').toLowerCase(),\n })}\n </p>\n )}\n\n <div className=\"flex justify-end\">\n <button\n type=\"button\"\n disabled={save.isPending || (track && invalid)}\n onClick={submit}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-5 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {save.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Save className=\"h-4 w-4\" />\n )}\n {tr('coolandlovely.stock.save', 'Save stock')}\n </button>\n </div>\n </GlassCard>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAoBA,IAAM,KAAc,GAAqB,MACvC,GAAG,KAAQ,GAAG,QAAQ,KAAU,MAE5B,IAAY,KAEL,KAAqC,EAAE,qBAAkB;CACpE,IAAM,IAAK,EAAM,GACX,IAAY,EAAsB,CAAW,GAC7C,IAAO,EAAyB,GAChC,CAAC,GAAO,KAAY,EAAS,EAAK,GAClC,CAAC,GAAQ,KAAa,EAAiC,CAAC,CAAC;CAE/D,QAAgB;EACT,EAAU,SACf,EAAS,EAAU,KAAK,cAAc,GACtC,EACE,OAAO,YACL,EAAU,KAAK,SAAS,KAAK,MAAY,CACvC,EAAW,EAAQ,MAAM,EAAQ,MAAM,GACvC,OAAO,EAAQ,aAAa,CAC9B,CAAC,CACH,CACF;CACF,GAAG,CAAC,EAAU,IAAI,CAAC;CAEnB,IAAM,IAAU,QAEZ,OAAO,OAAO,CAAM,CAAC,CAAC,MAAM,MAAU;EACpC,IAAM,IAAI,OAAO,CAAK;EACtB,OAAO,EAAM,KAAK,MAAM,MAAM,CAAC,OAAO,UAAU,CAAC,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O;SACL,gBAAgB;SAChB,UAAU,EAAS,KAAK,OAAa;UACnC,MAAM,EAAQ;UACd,QAAQ,EAAQ;UAChB,eAAe,OAAO,EAAO,EAAW,EAAQ,MAAM,EAAQ,MAAM,MAAM,CAAC;SAC7E,EAAE;QACJ;OACF,CAAC;MACH;MAkGU,WAAU;gBAJZ,CAMG,EAAK,YACJ,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,IAE3C,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA,GAE5B,EAAG,4BAA4B,YAAY,CACtC;;IACL,CAAA;GACI;;CACR,CAAA;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StoreListingCard.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/StoreListingCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAa7C,UAAU,qBAAqB;IAC7B,IAAI,EAAE,IAAI,CACR,YAAY,EACZ,IAAI,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,iBAAiB,GAAG,eAAe,CACrF,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAiHtD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StoreListingCard.js","names":[],"sources":["../../../src/coolandlovely/components/StoreListingCard.tsx"],"sourcesContent":["/**\n * StoreListingCard — a piece's listing in the Burdenoff store catalogue (BOFF-3430 / BOFF-9666).\n * @module coolandlovely/components\n *\n * On-sale pieces of a live brand storefront are mirrored into the Burdenoff store as discovery\n * listings that link back here; CoolAndLovely stays the seller. The service keeps the listing in\n * sync on every change of the piece or its brand and records the outcome on the piece. This card\n * shows that state and offers \"Sync now\" when the last push failed.\n */\n\nimport type { FC } from 'react';\nimport { AlertTriangle, CheckCircle2, EyeOff, Loader2, RefreshCw, Store } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\n\nimport { useTr } from '../hooks';\nimport { useSyncStyleItemStoreListing } from '../hooks/useCoolAndLovelyApi';\nimport type { CooStyleItem } from '../types';\nimport { cn } from '../utils/cn';\nimport { formatDate } from '../utils/formatters';\n\ntype Tone = 'success' | 'warning' | 'error' | 'neutral';\n\nconst toneStyles: Record<Tone, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n error: 'bg-status-error-bg-subtle text-status-error-text',\n neutral: 'bg-bg-sunken text-text-secondary',\n};\n\ninterface StoreListingCardProps {\n item: Pick<\n CooStyleItem,\n 'id' | 'storeProductId' | 'storeListingStatus' | 'storeSyncStatus' | 'storeSyncedAt'\n >;\n}\n\nexport const StoreListingCard: FC<StoreListingCardProps> = ({ item }) => {\n const tr = useTr();\n const sync = useSyncStyleItemStoreListing();\n\n const failed = item.storeSyncStatus === 'FAILED';\n const pending = item.storeSyncStatus === 'PENDING';\n\n let tone: Tone;\n let label: string;\n let hint: string;\n if (failed) {\n tone = 'error';\n label = tr('coolandlovely.storeListing.failed', 'Sync failed');\n hint = tr(\n 'coolandlovely.storeListing.failedHint',\n 'The latest changes could not be sent to the Burdenoff store. Sync now, or they are sent again with the next change to this piece.'\n );\n } else if (pending) {\n tone = 'neutral';\n label = tr('coolandlovely.storeListing.pending', 'Syncing with the Burdenoff store');\n hint = tr(\n 'coolandlovely.storeListing.pendingHint',\n 'The listing is being updated. Refresh in a moment to see the result.'\n );\n } else if (item.storeListingStatus === 'PUBLISHED') {\n tone = 'success';\n label = tr('coolandlovely.storeListing.published', 'Listed in the Burdenoff store');\n hint = tr(\n 'coolandlovely.storeListing.publishedHint',\n 'Shoppers can find this piece in the store. Its listing links back here, and CoolAndLovely handles checkout.'\n );\n } else if (item.storeListingStatus === 'UNLISTED') {\n tone = 'warning';\n label = tr('coolandlovely.storeListing.unlisted', 'Hidden while out of stock');\n hint = tr(\n 'coolandlovely.storeListing.unlistedHint',\n 'The listing is kept but hidden from the store until the piece is back in stock.'\n );\n } else if (item.storeListingStatus === 'ARCHIVED') {\n tone = 'neutral';\n label = tr('coolandlovely.storeListing.archived', 'Taken down from the Burdenoff store');\n hint = tr(\n 'coolandlovely.storeListing.archivedHint',\n 'Only pieces that are on sale, with a price, in a live brand storefront are listed.'\n );\n } else {\n tone = 'neutral';\n label = tr('coolandlovely.storeListing.notListed', 'Not listed in the Burdenoff store');\n hint = tr(\n 'coolandlovely.storeListing.notListedHint',\n 'Pieces that are on sale, with a price, in a live brand storefront are listed automatically.'\n );\n }\n\n const Icon = failed\n ? AlertTriangle\n : pending\n ? Loader2\n : tone === 'success'\n ? CheckCircle2\n : tone === 'warning'\n ? EyeOff\n : Store;\n\n return (\n <GlassCard treatment=\"plain\" className=\"space-y-3 p-5\" data-testid=\"coo-store-listing-card\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {tr('coolandlovely.storeListing.title', 'Burdenoff store')}\n </h3>\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium',\n toneStyles[tone]\n )}\n data-testid=\"coo-store-listing-status\"\n >\n <Icon className={cn('h-3.5 w-3.5', pending && 'animate-spin')} aria-hidden=\"true\" />\n {label}\n </span>\n <p className=\"text-sm text-text-secondary\">{hint}</p>\n {item.storeSyncedAt && (\n <p className=\"text-xs text-text-secondary\">\n {tr('coolandlovely.storeListing.lastSynced', 'Last synced {{date}}', {\n date: formatDate(item.storeSyncedAt),\n })}\n </p>\n )}\n {failed && (\n <button\n type=\"button\"\n disabled={sync.isPending}\n onClick={() => sync.mutate(item.id)}\n data-testid=\"coo-store-listing-sync\"\n className=\"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50\"\n >\n {sync.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"h-4 w-4\" />\n )}\n {tr('coolandlovely.storeListing.syncNow', 'Sync now')}\n </button>\n )}\n {sync.isError && (\n <p role=\"alert\" className=\"text-xs text-status-error-text\">\n {tr(\n 'coolandlovely.storeListing.syncError',\n 'Could not reach the store right now. Try again in a moment.'\n )}\n </p>\n )}\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;AAsBA,IAAM,IAAmC;CACvC,SAAS;CACT,SAAS;CACT,OAAO;CACP,SAAS;AACX,GASa,KAA+C,EAAE,cAAW;CACvE,IAAM,IAAK,EAAM,GACX,IAAO,EAA6B,GAEpC,IAAS,EAAK,oBAAoB,UAClC,IAAU,EAAK,oBAAoB,WAErC,GACA,GACA;CACJ,AAAI,KACF,IAAO,SACP,IAAQ,EAAG,qCAAqC,aAAa,GAC7D,IAAO,EACL,yCACA,mIACF,KACS,KACT,IAAO,WACP,IAAQ,EAAG,sCAAsC,kCAAkC,GACnF,IAAO,EACL,0CACA,sEACF,KACS,EAAK,uBAAuB,eACrC,IAAO,WACP,IAAQ,EAAG,wCAAwC,+BAA+B,GAClF,IAAO,EACL,4CACA,6GACF,KACS,EAAK,uBAAuB,cACrC,IAAO,WACP,IAAQ,EAAG,uCAAuC,2BAA2B,GAC7E,IAAO,EACL,2CACA,iFACF,KACS,EAAK,uBAAuB,cACrC,IAAO,WACP,IAAQ,EAAG,uCAAuC,qCAAqC,GACvF,IAAO,EACL,2CACA,oFACF,MAEA,IAAO,WACP,IAAQ,EAAG,wCAAwC,mCAAmC,GACtF,IAAO,EACL,4CACA,6FACF;CAGF,IAAM,IAAO,IACT,IACA,IACE,IACA,MAAS,YACP,IACA,MAAS,YACP,IACA;CAEV,OACE,kBAAC,GAAD;EAAW,WAAU;EAAQ,WAAU;EAAgB,eAAY;YAAnE;GACE,kBAAC,MAAD;IAAI,WAAU;cACX,EAAG,oCAAoC,iBAAiB;GACvD,CAAA;GACJ,kBAAC,QAAD;IACE,WAAW,EACT,+EACA,EAAW,EACb;IACA,eAAY;cALd,CAOE,kBAAC,GAAD;KAAM,WAAW,EAAG,eAAe,KAAW,cAAc;KAAG,eAAY;IAAQ,CAAA,GAClF,CACG;;GACN,kBAAC,KAAD;IAAG,WAAU;cAA+B;GAAQ,CAAA;GACnD,EAAK,iBACJ,kBAAC,KAAD;IAAG,WAAU;cACV,EAAG,yCAAyC,wBAAwB,EACnE,MAAM,EAAW,EAAK,aAAa,EACrC,CAAC;GACA,CAAA;GAEJ,KACC,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,EAAK;IACf,eAAe,EAAK,OAAO,EAAK,EAAE;IAClC,eAAY;IACZ,WAAU;cALZ,CAOG,EAAK,YACJ,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,IAE3C,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,GAEjC,EAAG,sCAAsC,UAAU,CAC9C;;GAET,EAAK,WACJ,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cACvB,EACC,wCACA,6DACF;GACC,CAAA;EAEI;;AAEf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TagList.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/TagList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA2BpC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TagList.js","names":[],"sources":["../../../src/coolandlovely/components/TagList.tsx"],"sourcesContent":["/**\n * TagList Component\n * @module coolandlovely/components\n *\n * Renders a compact, capped set of tag/aesthetic chips on semantic tokens.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface TagListProps {\n tags: string[];\n /** Maximum chips to show before collapsing into a \"+N\" chip. */\n max?: number;\n className?: string;\n tone?: 'default' | 'accent';\n}\n\nexport const TagList: FC<TagListProps> = ({ tags, max = 6, className, tone = 'default' }) => {\n if (!tags.length) return null;\n const shown = tags.slice(0, max);\n const overflow = tags.length - shown.length;\n\n const chip =\n tone === 'accent'\n ? 'bg-accent-purple-subtle text-text-primary'\n : 'bg-bg-sunken text-text-secondary';\n\n return (\n <div className={cn('flex flex-wrap gap-1.5', className)}>\n {shown.map((tag) => (\n <span\n key={tag}\n className={cn('inline-flex items-center rounded-full px-2 py-0.5 text-xs', chip)}\n >\n {tag}\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n +{overflow}\n </span>\n )}\n </div>\n );\n};\n"],"mappings":";;;AAkBA,IAAa,KAA6B,EAAE,SAAM,SAAM,GAAG,cAAW,UAAO,gBAAgB;CAC3F,IAAI,CAAC,EAAK,QAAQ,OAAO;CACzB,IAAM,IAAQ,EAAK,MAAM,GAAG,CAAG,GACzB,IAAW,EAAK,SAAS,EAAM,QAE/B,IACJ,MAAS,WACL,8CACA;CAEN,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,0BAA0B,CAAS;YAAtD,CACG,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,WAAW,EAAG,6DAA6D,CAAI;aAE9E;EACG,GAJC,CAID,CACP,GACA,IAAW,KACV,kBAAC,QAAD;GAAM,WAAU;aAAhB,CAA6G,KACzG,CACE;IAEL;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Thumbnail.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/Thumbnail.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,cAAc;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAmBD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Thumbnail.js","names":[],"sources":["../../../src/coolandlovely/components/Thumbnail.tsx"],"sourcesContent":["/**\n * Thumbnail Component\n * @module coolandlovely/components\n *\n * Renders a calm, on-token visual placeholder for a fashion entity. Imagery in\n * CoolAndLovely is referenced from wspace-files-svc via federation (we only\n * have the File id here, not a resolvable URL), so the catalogue/wardrobe/look\n * surfaces render a branded glyph tile keyed by an icon rather than a broken\n * <img>. The seed (entity id) gives each tile a stable accent tint.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\nimport { FileImage } from './FileImage';\n\ninterface ThumbnailProps {\n icon: ReactNode;\n /** Stable seed (e.g. entity id) used to pick a deterministic accent tint. */\n seed?: string;\n className?: string;\n /** Whether a File reference exists (shows a subtle \"image attached\" hint). */\n hasImage?: boolean;\n label?: string;\n /** wspace-files File id — when it resolves, its image overlays the glyph. */\n fileId?: string | null;\n /** Alt text when a real image is shown. */\n alt?: string;\n /**\n * Optional content rendered absolutely over the image (e.g. a gradient scrim\n * + overlaid caption). Positioned by the caller; sits above the FileImage.\n */\n overlay?: ReactNode;\n}\n\nconst tints = [\n 'from-accent-purple-subtle to-bg-sunken',\n 'from-accent-blue-subtle to-bg-sunken',\n 'from-status-success-bg-subtle to-bg-sunken',\n 'from-status-warning-bg-subtle to-bg-sunken',\n 'from-[var(--color-accent-soft)] to-bg-sunken',\n];\n\nfunction tintFor(seed: string | undefined): string {\n if (!seed) return tints[0];\n let hash = 0;\n for (let i = 0; i < seed.length; i += 1) {\n hash = (hash * 31 + seed.charCodeAt(i)) % 997;\n }\n return tints[hash % tints.length];\n}\n\nexport const Thumbnail: FC<ThumbnailProps> = ({\n icon,\n seed,\n className,\n label,\n fileId,\n alt,\n overlay,\n}) => {\n return (\n <div\n className={cn(\n 'relative flex items-center justify-center overflow-hidden rounded-lg bg-gradient-to-br',\n tintFor(seed),\n className\n )}\n aria-hidden={label ? undefined : true}\n aria-label={label}\n >\n <span className=\"text-text-secondary opacity-80 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]\">\n {icon}\n </span>\n {fileId ? (\n <span className=\"absolute inset-0 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]\">\n <FileImage fileId={fileId} alt={alt ?? label ?? ''} />\n </span>\n ) : null}\n {overlay}\n </div>\n );\n};\n"],"mappings":";;;;AAkCA,IAAM,IAAQ;CACZ;CACA;CACA;CACA;CACA;AACF;AAEA,SAAS,EAAQ,GAAkC;CACjD,IAAI,CAAC,GAAM,OAAO,EAAM;CACxB,IAAI,IAAO;CACX,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GACpC,KAAQ,IAAO,KAAK,EAAK,WAAW,CAAC,KAAK;CAE5C,OAAO,EAAM,IAAO,EAAM;AAC5B;AAEA,IAAa,KAAiC,EAC5C,SACA,SACA,cACA,UACA,WACA,QACA,iBAGE,kBAAC,OAAD;CACE,WAAW,EACT,0FACA,EAAQ,CAAI,GACZ,CACF;CACA,eAAa,MAAQ,KAAA;CACrB,cAAY;WAPd;EASE,kBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA;EACL,IACC,kBAAC,QAAD;GAAM,WAAU;aACd,kBAAC,GAAD;IAAmB;IAAQ,KAAK,KAAO,KAAS;GAAK,CAAA;EACjD,CAAA,IACJ;EACH;CACE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisibilityChip.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/VisibilityChip.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,UAAU,mBAAmB;IAC3B,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkBlD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisibilityChip.js","names":[],"sources":["../../../src/coolandlovely/components/VisibilityChip.tsx"],"sourcesContent":["/**\n * VisibilityChip — a small icon + label chip for a look/lookbook/profile\n * visibility (PRIVATE / FOLLOWERS / PUBLIC).\n * @module coolandlovely/components\n *\n * Token-only. The lock/users/globe glyph makes the visibility scannable at a\n * glance on lookbook cards, the lookbook detail header and the style profile.\n */\n\nimport type { FC } from 'react';\nimport { Globe, Lock, Users } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { titleCase } from '../utils/formatters';\nimport { useTr } from '../hooks';\n\ninterface VisibilityChipProps {\n /** A `CooVisibility` value (PUBLIC / FOLLOWERS / PRIVATE) — case-insensitive. */\n visibility: string;\n className?: string;\n}\n\nconst CONFIG: Record<string, { icon: typeof Globe; label: string; labelKey: string }> = {\n public: { icon: Globe, label: 'Public', labelKey: 'coolandlovely.visibility.public' },\n followers: { icon: Users, label: 'Followers', labelKey: 'coolandlovely.visibility.followers' },\n private: { icon: Lock, label: 'Private', labelKey: 'coolandlovely.visibility.private' },\n};\n\nexport const VisibilityChip: FC<VisibilityChipProps> = ({ visibility, className }) => {\n const tr = useTr();\n const key = visibility.trim().toLowerCase();\n const config = CONFIG[key];\n const Icon = config?.icon ?? Lock;\n const label = config ? tr(config.labelKey, config.label) : titleCase(visibility);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary',\n className\n )}\n >\n <Icon className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;;;AAqBA,IAAM,IAAkF;CACtF,QAAQ;EAAE,MAAM;EAAO,OAAO;EAAU,UAAU;CAAkC;CACpF,WAAW;EAAE,MAAM;EAAO,OAAO;EAAa,UAAU;CAAqC;CAC7F,SAAS;EAAE,MAAM;EAAM,OAAO;EAAW,UAAU;CAAmC;AACxF,GAEa,KAA2C,EAAE,eAAY,mBAAgB;CACpF,IAAM,IAAK,EAAM,GAEX,IAAS,EADH,EAAW,KAAK,CAAC,CAAC,YACR,IAChB,IAAO,GAAQ,QAAQ,GACvB,IAAQ,IAAS,EAAG,EAAO,UAAU,EAAO,KAAK,IAAI,EAAU,CAAU;CAE/E,OACE,kBAAC,QAAD;EACE,WAAW,EACT,gHACA,CACF;YAJF,CAME,kBAAC,GAAD;GAAM,WAAU;GAAc,eAAY;EAAQ,CAAA,GACjD,CACG;;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WardrobeItemCard.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/components/WardrobeItemCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0GtD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WardrobeItemCard.js","names":[],"sources":["../../../src/coolandlovely/components/WardrobeItemCard.tsx"],"sourcesContent":["/**\n * WardrobeItemCard — a digital wardrobe piece card for list/grids.\n * @module coolandlovely/components\n *\n * Image-forward card with a worn-count badge, hover action bar (log wear / remove),\n * details, size, source and cost-per-wear. Extracted from WardrobeListPage for\n * isolated rendering/tests.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { CheckCircle2, Loader2, Trash2 } from 'lucide-react';\nimport { Thumbnail } from './Thumbnail';\nimport { StatusBadge } from './StatusBadge';\nimport { categoryIcon } from '../utils/icons';\nimport { titleCase, formatRelativeTime, formatPrice } from '../utils/formatters';\nimport { cn } from '../utils/cn';\nimport type { CooWardrobeItem } from '../types';\n\ninterface WardrobeItemCardProps {\n item: CooWardrobeItem;\n onLogWear?: () => void;\n onRemove?: () => void;\n isLoggingWear?: boolean;\n isRemoving?: boolean;\n className?: string;\n retailerPrice?: ReactNode;\n}\n\nexport const WardrobeItemCard: FC<WardrobeItemCardProps> = ({\n item,\n onLogWear,\n onRemove,\n isLoggingWear,\n isRemoving,\n className,\n retailerPrice,\n}) => {\n const subtitle = item.brandName || item.colour || titleCase(item.category);\n\n return (\n <div\n className={cn(\n 'group flex flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface shadow-sm transition-shadow hover:shadow-lg',\n className\n )}\n >\n {/* Image-forward hero */}\n <div className=\"relative\">\n <Thumbnail\n icon={categoryIcon(item.category, 40)}\n seed={item.id}\n fileId={item.image?.id}\n alt={item.name}\n className=\"aspect-[4/5] w-full rounded-none\"\n />\n\n {/* Worn-count badge */}\n <div className=\"absolute right-2.5 top-2.5 flex h-12 w-12 flex-col items-center justify-center rounded-full bg-bg-surface/90 text-center leading-none shadow-sm ring-1 ring-[var(--color-accent-soft)] backdrop-blur\">\n <span className=\"text-[9px] font-medium uppercase tracking-wide text-text-secondary\">\n worn\n </span>\n <span className=\"text-sm font-bold tabular-nums text-text-primary\">\n {item.timesWorn}×\n </span>\n </div>\n\n {/* Hover action bar */}\n <div className=\"absolute inset-x-0 bottom-0 flex items-center gap-1.5 bg-gradient-to-t from-bg-canvas/90 to-transparent p-2.5 pt-8 opacity-100 transition-opacity duration-200 sm:opacity-0 sm:focus-within:opacity-100 sm:group-hover:opacity-100\">\n <button\n type=\"button\"\n disabled={isLoggingWear}\n onClick={onLogWear}\n aria-label={`Log a wear for ${item.name}`}\n className=\"inline-flex items-center gap-1 rounded-lg bg-bg-surface/90 px-2.5 py-1 text-xs font-medium text-status-success-text shadow-sm backdrop-blur transition-colors hover:bg-bg-surface disabled:opacity-50\"\n >\n {isLoggingWear ? (\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <CheckCircle2 className=\"h-3.5 w-3.5\" />\n )}\n Wore it\n </button>\n <button\n type=\"button\"\n disabled={isRemoving}\n onClick={onRemove}\n aria-label={`Remove ${item.name}`}\n className=\"ml-auto inline-flex h-7 w-7 items-center justify-center rounded-lg bg-bg-surface/90 text-text-secondary shadow-sm backdrop-blur transition-colors hover:text-status-error-text disabled:opacity-50\"\n >\n {isRemoving ? (\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <Trash2 className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"flex flex-1 flex-col p-4\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">{item.name}</p>\n <p className=\"truncate text-xs text-text-secondary\">{subtitle}</p>\n <div className=\"mt-2 flex flex-wrap items-center gap-1.5\">\n <StatusBadge status={item.source} />\n {item.size && (\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {item.size}\n </span>\n )}\n </div>\n {retailerPrice}\n {item.notes && (\n <p className=\"mt-2 line-clamp-2 text-xs text-text-secondary\">{item.notes}</p>\n )}\n <div className=\"mt-3 flex items-center justify-between gap-2 border-t border-border-seam pt-2 text-xs text-text-secondary\">\n <span>\n {item.lastWornAt ? `Last worn ${formatRelativeTime(item.lastWornAt)}` : 'Not worn yet'}\n </span>\n {item.costPerWear != null ? (\n <span\n title={`${formatPrice(item.purchasePrice ?? 0, item.currency ?? 'USD')} ÷ ${item.timesWorn} wears`}\n className=\"shrink-0 font-medium text-text-primary\"\n >\n {formatPrice(item.costPerWear, item.currency ?? 'USD')}/wear\n </span>\n ) : item.purchasePrice != null ? (\n <span className=\"shrink-0 text-text-secondary\">\n {formatPrice(item.purchasePrice, item.currency ?? 'USD')} paid\n </span>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AA4BA,IAAa,KAA+C,EAC1D,SACA,cACA,aACA,kBACA,eACA,cACA,uBACI;CACJ,IAAM,IAAW,EAAK,aAAa,EAAK,UAAU,EAAU,EAAK,QAAQ;CAEzE,OACE,kBAAC,OAAD;EACE,WAAW,EACT,sIACA,CACF;YAJF,CAOE,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD;KACE,MAAM,EAAa,EAAK,UAAU,EAAE;KACpC,MAAM,EAAK;KACX,QAAQ,EAAK,OAAO;KACpB,KAAK,EAAK;KACV,WAAU;IACX,CAAA;IAGD,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD;MAAM,WAAU;gBAAqE;KAE/E,CAAA,GACN,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACG,EAAK,WAAU,GACZ;OACH;;IAGL,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,UAAD;MACE,MAAK;MACL,UAAU;MACV,SAAS;MACT,cAAY,kBAAkB,EAAK;MACnC,WAAU;gBALZ,CAOG,IACC,kBAAC,GAAD,EAAS,WAAU,2BAA4B,CAAA,IAE/C,kBAAC,GAAD,EA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,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BestPriceBadge.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/BestPriceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,GACP,EAAE;IACD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,sCAYA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BestPriceBadge.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/BestPriceBadge.tsx"],"sourcesContent":["import type { CooBestPricesQuery } from '../../../generated/wspace-operations';\nimport { formatRetailerPrice } from './money';\n\nexport function BestPriceBadge({\n summary,\n onOpen,\n}: {\n summary: CooBestPricesQuery['cooBestPrices'][number] | undefined;\n onOpen: () => void;\n}) {\n if (summary?.lowestPriceMinor == null) return null;\n return (\n <button\n type=\"button\"\n className=\"mt-2 text-left text-xs font-medium text-action-primary-bg underline\"\n onClick={onOpen}\n >\n Retailers from {formatRetailerPrice(summary.lowestPriceMinor, summary.currency)} ·{' '}\n {summary.offerCount} offers\n </button>\n );\n}\n"],"mappings":";;;AAGA,SAAgB,EAAe,EAC7B,YACA,aAIC;CAED,OADI,GAAS,oBAAoB,OAAa,OAE5C,kBAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,SAAS;YAHX;GAIC;GACiB,EAAoB,EAAQ,kBAAkB,EAAQ,QAAQ;GAAE;GAAG;GAClF,EAAQ;GAAW;EACd;;AAEZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LookbookPriceBoard.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/LookbookPriceBoard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3E,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,KAAK,EACL,eAAe,EACf,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,+BA6GA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LookbookPriceBoard.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/LookbookPriceBoard.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Loader2, Sparkles, Tag, X } from 'lucide-react';\nimport { useContextNavigation } from '../../hooks/useContextNavigation';\nimport { useBestPrices } from '../../hooks/usePriceApi';\nimport type { CooLook, CooLookbookEntry, CooStyleItem } from '../../types';\nimport { Thumbnail } from '../Thumbnail';\nimport { BestPriceBadge } from './BestPriceBadge';\nimport { PriceCurrencySelect } from './PriceCurrencySelect';\n\n/** Alternating aspect ratios preserve the existing board rhythm. */\nconst TILE_ASPECTS = ['aspect-[3/4]', 'aspect-square', 'aspect-[4/5]'];\n\nexport function LookbookPriceBoard({\n entries,\n looks,\n items,\n removingEntryId,\n onRemove,\n}: {\n entries: CooLookbookEntry[];\n looks: CooLook[];\n items: CooStyleItem[];\n removingEntryId?: string;\n onRemove: (id: string) => void;\n}) {\n const navigateTo = useContextNavigation();\n const [priceCurrency, setPriceCurrency] = useState('USD');\n const lookById = useMemo(() => new Map(looks.map((look) => [look.id, look])), [looks]);\n const itemById = useMemo(() => new Map(items.map((item) => [item.id, item])), [items]);\n const priceIds = useMemo(\n () => [\n ...new Set(\n entries.map((entry) => entry.styleItemId).filter((id): id is string => Boolean(id))\n ),\n ],\n [entries]\n );\n const bestPrices = useBestPrices(priceIds.slice(0, 100), priceCurrency);\n const priceByItem = useMemo(\n () => new Map(bestPrices.data?.map((entry) => [entry.styleItemId, entry])),\n [bestPrices.data]\n );\n return (\n <section className=\"mt-6\">\n <PriceCurrencySelect\n value={priceCurrency}\n onChange={setPriceCurrency}\n currencies={items.map((item) => item.currency)}\n />\n <p className=\"mb-3 text-xs text-text-secondary\">\n Retailer quotes for clipped catalog pieces use {priceCurrency} without currency conversion.\n {priceIds.length > 100 ? ' Pricing covers the first 100 linked pieces.' : ''}\n </p>\n {bestPrices.isError && (\n <p role=\"alert\" className=\"mb-3 text-sm text-status-error-text\">\n Retailer prices could not be loaded.{' '}\n <button type=\"button\" className=\"underline\" onClick={() => void bestPrices.refetch()}>\n Retry prices\n </button>\n </p>\n )}\n <h3 className=\"mb-3 text-lg font-semibold text-text-primary\">Board ({entries.length})</h3>\n {entries.length === 0 ? (\n <p className=\"rounded-lg border border-border-seam bg-bg-surface p-4 text-sm text-text-secondary\">\n This lookbook has no entries yet. Clip a catalogue piece or save a look to add one.\n </p>\n ) : (\n <div className=\"columns-2 gap-4 md:columns-3\">\n {entries.map((entry, idx) => {\n const isLook = Boolean(entry.lookId);\n const look = entry.lookId ? lookById.get(entry.lookId) : undefined;\n const item = entry.styleItemId ? itemById.get(entry.styleItemId) : undefined;\n const title = isLook ? (look?.title ?? 'Saved look') : (item?.name ?? 'Clipped piece');\n const imageFileId = isLook ? look?.image?.id : item?.image?.id;\n const removing = removingEntryId === entry.id;\n const onOpen = () => {\n if (isLook && entry.lookId) navigateTo(`/looks/${entry.lookId}`);\n else if (entry.styleItemId) navigateTo(`/items/${entry.styleItemId}`);\n };\n return (\n <div\n key={entry.id}\n className=\"group relative mb-4 break-inside-avoid overflow-hidden rounded-xl border border-border-seam bg-bg-surface shadow-sm transition-shadow hover:shadow-lg\"\n >\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Open ${title}`}\n className=\"block w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <Thumbnail\n icon={isLook ? <Sparkles className=\"h-8 w-8\" /> : <Tag className=\"h-8 w-8\" />}\n seed={entry.id}\n fileId={imageFileId}\n alt={title}\n className={`w-full rounded-none ${TILE_ASPECTS[idx % TILE_ASPECTS.length]}`}\n overlay={\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 flex flex-col gap-1.5 bg-gradient-to-t from-bg-canvas/90 via-bg-canvas/40 to-transparent p-3 pt-10\">\n {entry.note && (\n <span className=\"inline-flex w-fit max-w-full items-center rounded-md bg-bg-canvas/80 px-2 py-0.5 text-[11px] font-medium text-text-primary backdrop-blur\">\n <span className=\"truncate\">{entry.note}</span>\n </span>\n )}\n <p className=\"truncate text-sm font-semibold text-text-primary\">{title}</p>\n </div>\n }\n />\n </button>\n {entry.styleItemId && (\n <div className=\"px-3 pb-3\">\n <BestPriceBadge summary={priceByItem.get(entry.styleItemId)} onOpen={onOpen} />\n </div>\n )}\n <button\n type=\"button\"\n disabled={Boolean(removingEntryId)}\n onClick={() => onRemove(entry.id)}\n aria-label={`Remove ${title}`}\n className=\"absolute right-2 top-2 z-10 inline-flex h-7 w-7 items-center justify-center rounded-full bg-bg-surface/90 text-text-secondary opacity-100 shadow-sm backdrop-blur transition-opacity hover:text-status-error-text sm:opacity-0 sm:focus-visible:opacity-100 sm:group-hover:opacity-100 disabled:opacity-60\"\n >\n {removing ? (\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : (\n <X className=\"h-3.5 w-3.5\" />\n )}\n </button>\n </div>\n );\n })}\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAe;CAA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AU,2BAA4B,CAAA,IAE/C,kBAAC,GAAD,EAAG,WAAU,cAAe,CAAA;OAExB,CAAA;MACL;QA7CE,EAAM,EA6CR;IAET,CAAC;GACE,CAAA;EAEA;;AAEb"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceComparison.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PriceComparison.tsx"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,+BAmFA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceComparison.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PriceComparison.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { usePriceDetail } from '../../hooks/usePriceApi';\nimport { formatRetailerPrice } from './money';\nimport { RetailerOfferLink } from './RetailerOfferLink';\n\nexport function PriceComparison({\n styleItemId,\n currency,\n}: {\n styleItemId: string;\n currency: string;\n}) {\n const [period] = useState(() => {\n const end = new Date();\n return { end: end.toISOString(), start: new Date(end.getTime() - 30 * 86400000).toISOString() };\n });\n const query = usePriceDetail(styleItemId, currency, period.start, period.end, true);\n if (query.isPending)\n return (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Loading comparison…\n </p>\n );\n if (query.isError)\n return (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n Comparison could not be loaded.{' '}\n <button type=\"button\" className=\"underline\" onClick={() => void query.refetch()}>\n Retry comparison\n </button>\n </p>\n );\n return (\n <div className=\"space-y-4\">\n {!query.data?.cooComparePrices.length && (\n <p className=\"text-sm text-text-secondary\">No current retailer offers in this currency.</p>\n )}\n <ul className=\"space-y-2\">\n {query.data?.cooComparePrices.map((offer) => (\n <li\n key={offer.id}\n className=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border-seam p-3\"\n >\n <div>\n <p className=\"font-medium text-text-primary\">{offer.retailerName}</p>\n <p className=\"text-xs text-text-secondary\">\n Observed {new Date(offer.observedAt).toLocaleString()}\n </p>\n </div>\n <RetailerOfferLink\n url={offer.productUrl}\n priceMinor={offer.priceMinor}\n currency={offer.currency}\n />\n </li>\n ))}\n </ul>\n <h3 className=\"font-semibold text-text-primary\">Observed daily minimum · last 30 days</h3>\n <p className=\"text-xs text-text-secondary\">\n Only recorded in-stock observations are shown. Missing days are not estimates; this does not\n include taxes or delivery charges.\n </p>\n {query.data?.cooPriceHistory.length ? (\n <div className=\"max-h-60 overflow-auto\">\n <table className=\"w-full text-left text-sm\">\n <thead>\n <tr>\n <th className=\"p-2 text-text-secondary\" scope=\"col\">\n UTC day\n </th>\n <th className=\"p-2 text-text-secondary\" scope=\"col\">\n Lowest observed\n </th>\n </tr>\n </thead>\n <tbody>\n {query.data.cooPriceHistory.map((day) => (\n <tr key={day.day}>\n <th className=\"p-2 font-normal text-text-primary\" scope=\"row\">\n {day.day}\n </th>\n <td className=\"p-2 text-text-primary\">\n {formatRetailerPrice(day.lowestPriceMinor, currency)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary\">No observed history in this period.</p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,SAAgB,EAAgB,EAC9B,gBACA,eAIC;CACD,IAAM,CAAC,KAAU,QAAe;EAC9B,IAAM,oBAAM,IAAI,KAAK;EACrB,OAAO;GAAE,KAAK,EAAI,YAAY;GAAG,wBAAO,IAAI,KAAK,EAAI,QAAQ,IAAI,KAAK,KAAQ,EAAA,CAAE,YAAY;EAAE;CAChG,CAAC,GACK,IAAQ,EAAe,GAAa,GAAU,EAAO,OAAO,EAAO,KAAK,EAAI;CAgBlF,OAfI,EAAM,YAEN,kBAAC,KAAD;EAAG,MAAK;EAAS,WAAU;YAA8B;CAEtD,CAAA,IAEH,EAAM,UAEN,kBAAC,KAAD;EAAG,MAAK;EAAQ,WAAU;YAA1B;GAA2D;GACz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AAD;MAAI,WAAU;gBACX,EAAoB,EAAI,kBAAkB,CAAQ;KACjD,CAAA,CACF,EAAA,GAPK,EAAI,GAOT,CACL,EACI,CAAA,CACF;;GACJ,CAAA,IAEL,kBAAC,KAAD;IAAG,WAAU;cAA8B;GAAsC,CAAA;EAEhF;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceCurrencySelect.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PriceCurrencySelect.tsx"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,UAAe,GAChB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,+BAwBA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceCurrencySelect.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PriceCurrencySelect.tsx"],"sourcesContent":["import { useId } from 'react';\n\nexport function PriceCurrencySelect({\n value,\n onChange,\n currencies = [],\n}: {\n value: string;\n onChange: (currency: string) => void;\n currencies?: string[];\n}) {\n const id = useId();\n const options = [\n ...new Set([value, ...currencies, 'USD', 'INR', 'EUR', 'GBP', 'JPY', 'BHD', 'CAD', 'AUD']),\n ];\n return (\n <div className=\"mb-3 flex flex-wrap items-center gap-2\">\n <label htmlFor={id} className=\"text-sm text-text-secondary\">\n Retailer quote currency\n </label>\n <select\n id={id}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n >\n {options.map((currency) => (\n <option key={currency} value={currency}>\n {currency}\n </option>\n ))}\n </select>\n </div>\n );\n}\n"],"mappings":";;;AAEA,SAAgB,EAAoB,EAClC,UACA,aACA,gBAAa,CAAC,KAKb;CACD,IAAM,IAAK,EAAM,GACX,IAAU,CACd,mBAAG,IAAI,IAAI;EAAC;EAAO,GAAG;EAAY;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;CAAK,CAAC,CAC3F;CACA,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,SAAD;GAAO,SAAS;GAAI,WAAU;aAA8B;EAErD,CAAA,GACP,kBAAC,UAAD;GACM;GACG;GACP,WAAW,MAAU,EAAS,EAAM,OAAO,KAAK;GAChD,WAAU;aAET,EAAQ,KAAK,MACZ,kBAAC,UAAD;IAAuB,OAAO;cAC3B;GACK,GAFK,CAEL,CACT;EACK,CAAA,CACL;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PricePanel.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PricePanel.tsx"],"names":[],"mappings":"AASA,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,QAAQ,EAAE,eAAe,GAC1B,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,+BAoEA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PricePanel.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PricePanel.tsx"],"sourcesContent":["import { useId, useState } from 'react';\nimport { useBestPrices } from '../../hooks/usePriceApi';\nimport { formatRetailerPrice } from './money';\nimport { PriceComparison } from './PriceComparison';\nimport { PriceWatchForm } from './PriceWatchForm';\n\nconst buttonClass =\n 'rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50';\n\n/** Parent keys by active security context and item so shopper input state cannot leak. */\nexport function PricePanel({\n styleItemId,\n currency: initialCurrency,\n}: {\n styleItemId: string;\n currency: string;\n}) {\n const [currency, setCurrency] = useState(initialCurrency);\n const [expanded, setExpanded] = useState(false);\n const currencyId = useId();\n const best = useBestPrices([styleItemId], currency);\n const summary = best.data?.[0];\n return (\n <section\n className=\"space-y-4 rounded-xl border border-border-seam bg-bg-surface p-4\"\n aria-label=\"Retailer prices and alerts\"\n >\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Retailer prices</h2>\n <div className=\"flex items-center gap-2\">\n <label htmlFor={currencyId} className=\"text-sm text-text-secondary\">\n Currency\n </label>\n <select\n id={currencyId}\n className=\"rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n value={currency}\n onChange={(event) => setCurrency(event.target.value)}\n >\n {[...new Set([initialCurrency, 'USD', 'INR', 'EUR', 'GBP', 'JPY'])].map((code) => (\n <option key={code} value={code}>\n {code}\n </option>\n ))}\n </select>\n </div>\n </div>\n <p className=\"text-sm text-text-secondary\">\n Approved sources and exact product matches only. Prices are not converted. Confirm current\n price, shipping and stock at the retailer.\n </p>\n {best.isPending ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Checking current offers…\n </p>\n ) : best.isError ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n Prices could not be loaded.{' '}\n <button type=\"button\" className={buttonClass} onClick={() => void best.refetch()}>\n Retry prices\n </button>\n </p>\n ) : summary?.lowestPriceMinor != null ? (\n <p className=\"font-semibold text-text-primary\">\n From {formatRetailerPrice(summary.lowestPriceMinor, summary.currency)} across{' '}\n {summary.offerCount} current offers\n </p>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n No fresh in-stock retailer offers in {currency}.\n </p>\n )}\n <button\n type=\"button\"\n className={buttonClass}\n aria-expanded={expanded}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded ? 'Hide comparison' : 'Compare offers and history'}\n </button>\n {expanded && <PriceComparison styleItemId={styleItemId} currency={currency} />}\n <PriceWatchForm key={currency} styleItemId={styleItemId} currency={currency} />\n </section>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IACJ;AAGF,SAAgB,EAAW,EACzB,gBACA,UAAU,KAIT;CACD,IAAM,CAAC,GAAU,KAAe,EAAS,CAAe,GAClD,C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AC,CAAK;cAE3C,IAAW,oBAAoB;GAC1B,CAAA;GACP,KAAY,kBAAC,GAAD;IAA8B;IAAuB;GAAW,CAAA;GAC7E,kBAAC,GAAD;IAA4C;IAAuB;GAAW,GAAzD,CAAyD;EACvE;;AAEb"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatchDisclosure.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PriceWatchDisclosure.tsx"],"names":[],"mappings":"AAMA,wBAAgB,oBAAoB,gCAyBnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatchDisclosure.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PriceWatchDisclosure.tsx"],"sourcesContent":["import { lazy, Suspense, useState } from 'react';\n\nconst PriceWatches = lazy(() =>\n import('./PriceWatches').then((module) => ({ default: module.PriceWatches }))\n);\n\nexport function PriceWatchDisclosure() {\n const [expanded, setExpanded] = useState(false);\n return (\n <div className=\"my-6 space-y-3\">\n <button\n type=\"button\"\n aria-expanded={expanded}\n className=\"rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n onClick={() => setExpanded((value) => !value)}\n >\n Manage my price watches\n </button>\n {expanded && (\n <Suspense\n fallback={\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Loading price watches…\n </p>\n }\n >\n <PriceWatches />\n </Suspense>\n )}\n </div>\n );\n}\n"],"mappings":";;;AAEA,IAAM,IAAe,QACnB,OAAO,oBAAiB,CAAC,MAAM,OAAY,EAAE,SAAS,EAAO,aAAa,EAAE,CAC9E;AAEA,SAAgB,IAAuB;CACrC,IAAM,CAAC,GAAU,KAAe,EAAS,EAAK;CAC9C,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,MAAK;GACL,iBAAe;GACf,WAAU;GACV,eAAe,GAAa,MAAU,CAAC,CAAK;aAC7C;EAEO,CAAA,GACP,KACC,kBAAC,GAAD;GACE,UACE,kBAAC,KAAD;IAAG,MAAK;IAAS,WAAU;cAA8B;GAEtD,CAAA;aAGL,kBAAC,GAAD,CAAe,CAAA;EACP,CAAA,CAET;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatchForm.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PriceWatchForm.tsx"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,+BA2EA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatchForm.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PriceWatchForm.tsx"],"sourcesContent":["import { useId, useState } from 'react';\nimport { CooPriceAlertKind } from '../../../generated/wspace-types';\nimport { usePriceWatchAction } from '../../hooks/usePriceApi';\nimport { retailerTargetExample, retailerTargetMinor } from './money';\n\nconst buttonClass =\n 'rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50';\n\nexport function PriceWatchForm({\n styleItemId,\n currency,\n}: {\n styleItemId: string;\n currency: string;\n}) {\n const [target, setTarget] = useState('');\n const [message, setMessage] = useState('');\n const [inputError, setInputError] = useState('');\n const targetId = useId();\n const action = usePriceWatchAction();\n const save = async (kind: CooPriceAlertKind) => {\n setInputError('');\n setMessage('');\n try {\n const targetPriceMinor =\n kind === CooPriceAlertKind.PriceDrop && target\n ? retailerTargetMinor(target, currency)\n : null;\n await action.mutateAsync({\n kind: 'save',\n input: { styleItemId, currency, kind, targetPriceMinor },\n });\n setMessage(\n kind === CooPriceAlertKind.PriceDrop\n ? 'Price watch saved. Monitoring starts after an initial check.'\n : 'Stock watch saved. You will be notified when fresh reports show a return from out of stock.'\n );\n } catch (error) {\n setInputError(error instanceof Error ? error.message : 'The price watch could not be saved.');\n }\n };\n return (\n <div className=\"space-y-3 border-t border-border-seam pt-4\">\n <h3 className=\"font-semibold text-text-primary\">Watch this piece</h3>\n <p className=\"text-sm text-text-secondary\">\n New watches start with an initial check. Alerts need fresh retailer data and apply to future\n changes.\n </p>\n <div className=\"flex flex-wrap items-end gap-2\">\n <label className=\"flex flex-col gap-1 text-sm text-text-secondary\" htmlFor={targetId}>\n Future target in {currency} (optional)\n <input\n id={targetId}\n inputMode=\"decimal\"\n className=\"rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n value={target}\n onChange={(event) => setTarget(event.target.value)}\n placeholder={retailerTargetExample(currency)}\n />\n </label>\n <button\n type=\"button\"\n className={buttonClass}\n disabled={action.isPending}\n onClick={() => void save(CooPriceAlertKind.PriceDrop)}\n >\n Watch price drops\n </button>\n <button\n type=\"button\"\n className={buttonClass}\n disabled={action.isPending}\n onClick={() => void save(CooPriceAlertKind.BackInStock)}\n >\n Watch restocks\n </button>\n </div>\n {message && (\n <p role=\"status\" className=\"text-sm text-status-success-text\">\n {message}\n </p>\n )}\n {inputError && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {inputError}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAKA,IAAM,IACJ;AAEF,SAAgB,EAAe,EAC7B,gBACA,eAIC;CACD,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAS,KAAc,EAAS,EAAE,GACnC,CAAC,GAAY,KAAiB,EAAS,EAAE,GACzC,IAAW,EAAM,GACjB,IAAS,EAAoB,GAC7B,IAAO,OAAO,MAA4B;EAE9C,AADA,EAAc,EAAE,GAChB,EAAW,EAAE;EACb,IAAI;GACF,IAAM,IACJ,MAAS,EAAkB,aAAa,IACpC,EAAoB,GAAQ,CAAQ,IACpC;GAKN,AAJA,MAAM,EAAO,YAAY;IACvB,MAAM;IACN,OAAO;KAAE;KAAa;KAAU;KAAM;IAAiB;GACzD,CAAC,GACD,EACE,MAAS,EAAkB,YACvB,iEACA,6FACN;EACF,SAAS,GAAO;GACd,EAAc,aAAiB,QAAQ,EAAM,UAAU,qCAAqC;EAC9F;CACF;CACA,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,MAAD;IAAI,WAAU;cAAkC;GAAoB,CAAA;GACpE,kBAAC,KAAD;IAAG,WAAU;cAA8B;GAGxC,CAAA;GACH,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,SAAD;MAAO,WAAU;MAAkD,SAAS;gBAA5E;OAAsF;OAClE;OAAS;OAC3B,kBAAC,SAAD;QACE,IAAI;QACJ,WAAU;QACV,WAAU;QACV,OAAO;QACP,WAAW,MAAU,EAAU,EAAM,OAAO,KAAK;QACjD,aAAa,EAAsB,CAAQ;OAC5C,CAAA;MACI;;KACP,kBAAC,UAAD;MACE,MAAK;MACL,WAAW;MACX,UAAU,EAAO;MACjB,eAAe,KAAK,EAAK,EAAkB,SAAS;gBACrD;KAEO,CAAA;KACR,kBAAC,UAAD;MACE,MAAK;MACL,WAAW;MACX,UAAU,EAAO;MACjB,eAAe,KAAK,EAAK,EAAkB,WAAW;gBACvD;KAEO,CAAA;IACL;;GACJ,KACC,kBAAC,KAAD;IAAG,MAAK;IAAS,WAAU;cACxB;GACA,CAAA;GAEJ,KACC,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cACvB;GACA,CAAA;EAEF;;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatches.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/PriceWatches.tsx"],"names":[],"mappings":"AAgFA,gGAAgG;AAChG,wBAAgB,YAAY,gCAiH3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PriceWatches.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/PriceWatches.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useContextNavigation } from '../../hooks/useContextNavigation';\nimport {\n usePriceWatchAction,\n usePriceWatchDeliveries,\n usePriceWatches,\n} from '../../hooks/usePriceApi';\nimport { formatRetailerPrice } from './money';\n\nconst receiptStatusLabels: Record<string, string> = {\n DELIVERED: 'Sent',\n PENDING: 'Waiting',\n CLAIMED: 'Sending',\n FAILED: 'Could not send',\n};\n\nconst buttonClass =\n 'rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50';\n\nfunction WatchReceipts({ alertId }: { alertId: string }) {\n const [offset, setOffset] = useState(0);\n const query = usePriceWatchDeliveries(alertId, offset, true);\n if (query.isPending)\n return (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Loading delivery receipts…\n </p>\n );\n if (query.isError)\n return (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n Receipts could not be loaded.{' '}\n <button type=\"button\" className={buttonClass} onClick={() => void query.refetch()}>\n Retry\n </button>\n </p>\n );\n return (\n <div className=\"space-y-2\">\n <p className=\"text-xs text-text-secondary\">\n A delivered receipt confirms platform acceptance. Device display and retries can differ;\n delivery is at least once.\n </p>\n {query.data?.items.length ? (\n <ul className=\"space-y-1 text-sm text-text-secondary\">\n {query.data.items.map((entry) => (\n <li key={entry.id}>\n {receiptStatusLabels[entry.status] ?? 'Status unavailable'} ·{' '}\n {new Date(entry.createdAt).toLocaleString()}\n {entry.deliveredAt\n ? ` · accepted ${new Date(entry.deliveredAt).toLocaleString()}`\n : ''}\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"text-sm text-text-secondary\">No transitions recorded yet.</p>\n )}\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n className={buttonClass}\n disabled={offset === 0}\n onClick={() => setOffset((value) => Math.max(0, value - 20))}\n >\n Previous receipts\n </button>\n <button\n type=\"button\"\n className={buttonClass}\n disabled={!query.data?.pageInfo.hasMore}\n onClick={() => setOffset((value) => value + 20)}\n >\n Next receipts\n </button>\n </div>\n </div>\n );\n}\n\n/** Mounted lazily from Style Profile; actor/context changes remount through the scoped Root. */\nexport function PriceWatches() {\n const [offset, setOffset] = useState(0);\n const [receiptId, setReceiptId] = useState<string | null>(null);\n const query = usePriceWatches(offset);\n const action = usePriceWatchAction();\n const navigateTo = useContextNavigation();\n return (\n <section\n className=\"space-y-4 rounded-xl border border-border-seam bg-bg-surface p-4\"\n aria-label=\"My price watches\"\n >\n <h2 className=\"text-lg font-semibold text-text-primary\">My price watches</h2>\n <p className=\"text-sm text-text-secondary\">\n Private watches for pieces you selected. Manage currency and targets from a piece’s retailer\n comparison. Withdrawn private pieces disable their watches automatically.\n </p>\n {query.isPending ? (\n <p role=\"status\" className=\"text-sm text-text-secondary\">\n Loading watches…\n </p>\n ) : query.isError ? (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n Watches could not be loaded.{' '}\n <button type=\"button\" className={buttonClass} onClick={() => void query.refetch()}>\n Retry\n </button>\n </p>\n ) : query.data?.items.length ? (\n <ul className=\"space-y-3\">\n {query.data.items.map((watch) => (\n <li key={watch.id} className=\"space-y-3 rounded-lg border border-border-seam p-3\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <button\n type=\"button\"\n className=\"text-left text-sm font-semibold text-text-primary underline\"\n onClick={() => navigateTo(`/items/${watch.styleItemId}`)}\n >\n View watched piece\n </button>\n <p className=\"text-sm text-text-secondary\">\n {watch.kind === 'PRICE_DROP' ? 'Price drop' : 'Back in stock'} ·{' '}\n {watch.currency}\n {watch.targetPriceMinor != null\n ? ` · at or below ${formatRetailerPrice(watch.targetPriceMinor, watch.currency)}`\n : ''}{' '}\n · {watch.enabled ? 'Enabled' : 'Disabled'}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {watch.lastEvaluatedAt\n ? `Last checked ${new Date(watch.lastEvaluatedAt).toLocaleString()}`\n : 'Waiting for first check'}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n className={buttonClass}\n aria-expanded={receiptId === watch.id}\n onClick={() => setReceiptId((value) => (value === watch.id ? null : watch.id))}\n >\n Delivery receipts\n </button>\n <button\n type=\"button\"\n className={buttonClass}\n disabled={action.isPending}\n onClick={() => action.mutate({ kind: 'remove', id: watch.id })}\n >\n Remove watch\n </button>\n </div>\n </div>\n {receiptId === watch.id && <WatchReceipts key={watch.id} alertId={watch.id} />}\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n No price watches on this page. Open a piece’s retailer comparison to create one.\n </p>\n )}\n {action.isError && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {action.error.message}\n </p>\n )}\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n className={buttonClass}\n disabled={offset === 0 || query.isFetching}\n onClick={() => {\n setOffset((value) => Math.max(0, value - 20));\n setReceiptId(null);\n }}\n >\n Previous watches\n </button>\n <button\n type=\"button\"\n className={buttonClass}\n disabled={!query.data?.pageInfo.hasMore || query.isFetching}\n onClick={() => {\n setOffset((value) => value + 20);\n setReceiptId(null);\n }}\n >\n Next watches\n </button>\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;AASA,IAAM,IAA8C;CAClD,WAAW;CACX,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IACJ;AAEF,SAAS,EAAc,EAAE,cAAgC;CACvD,IAAM,CAAC,GAAQ,KAAa,EAAS,CAAC,GAChC,IAAQ,EAAwB,GAAS,GAAQ,EAAI;CAgB3D,OAfI,EAAM,YAEN,kBAAC,KAAD;EAAG,MAAK;EAAS,WAAU;YAA8B;CAEtD,CAAA,IAEH,EAAM,UAEN,kBAAC,KAAD;EAAG,MAAK;EAAQ,WAAU;YAA1B;GAA2D;GAC3B;GAC9B,kBAAC,UAAD;IAAQ,MAAK;IAAS,WAAW;IAAa,eAAe,KAAK,EAAM,QAAQ;cAAG;GAE3E,CAAA;EACP;MAGL,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,KAAD;IAAG,WAAU;cAA8B;GAGxC,CAAA;GACF,EAAM,MAAM,MAAM,SACjB,kBAAC,MAAD;IAAI,WAAU;cACX,EAAM,KAAK,MAAM,KAAK,MACrB,kBAAC,MAAD,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WAAW;KACX,UAAU,MAAW,KAAK,EAAM;KAChC,eAAe;MAEb,AADA,GAAW,MAAU,KAAK,IAAI,GAAG,IAAQ,EAAE,CAAC,GAC5C,EAAa,IAAI;KACnB;eACD;IAEO,CAAA,GACR,kBAAC,UAAD;KACE,MAAK;KACL,WAAW;KACX,UAAU,CAAC,EAAM,MAAM,SAAS,WAAW,EAAM;KACjD,eAAe;MAEb,AADA,GAAW,MAAU,IAAQ,EAAE,GAC/B,EAAa,IAAI;KACnB;eACD;IAEO,CAAA,CACL;;EACE;;AAEb"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetailerOfferLink.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/RetailerOfferLink.tsx"],"names":[],"mappings":"AAYA,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,UAAU,EACV,QAAQ,GACT,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,+BAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetailerOfferLink.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/RetailerOfferLink.tsx"],"sourcesContent":["import { formatRetailerPrice } from './money';\n\n/** The backend validates source URLs; the rendered link independently refuses active schemes. */\nfunction safeHref(value: string): string | null {\n try {\n const url = new URL(value);\n return url.protocol === 'https:' && !url.username && !url.password ? url.href : null;\n } catch {\n return null;\n }\n}\n\nexport function RetailerOfferLink({\n url,\n priceMinor,\n currency,\n}: {\n url: string;\n priceMinor: number;\n currency: string;\n}) {\n const href = safeHref(url);\n const price = formatRetailerPrice(priceMinor, currency);\n if (!href)\n return <span className=\"text-sm text-text-secondary\">{price} · Retailer link unavailable</span>;\n return (\n <a\n className=\"rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {price} · Visit retailer\n </a>\n );\n}\n"],"mappings":";;;AAGA,SAAS,EAAS,GAA8B;CAC9C,IAAI;EACF,IAAM,IAAM,IAAI,IAAI,CAAK;EACzB,OAAO,EAAI,aAAa,YAAY,CAAC,EAAI,YAAY,CAAC,EAAI,WAAW,EAAI,OAAO;CAClF,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,EAAkB,EAChC,QACA,eACA,eAKC;CACD,IAAM,IAAO,EAAS,CAAG,GACnB,IAAQ,EAAoB,GAAY,CAAQ;CAGtD,OAFK,IAGH,kBAAC,KAAD;EACE,WAAU;EACJ;EACN,QAAO;EACP,KAAI;YAJN,CAMG,GAAM,mBACN;MATI,kBAAC,QAAD;EAAM,WAAU;YAAhB,CAA+C,GAAM,8BAAkC;;AAWlG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/components/prices/money.ts"],"names":[],"mappings":"AAeA,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5F;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAM/E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAkC5F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"money.js","names":[],"sources":["../../../../src/coolandlovely/components/prices/money.ts"],"sourcesContent":["// Cache bounded formatting rules only; no price, actor or workspace data is retained.\nconst currencyFormatters = new Map<string, Intl.NumberFormat>();\nfunction currencyFormatter(currency: string, locale?: string): Intl.NumberFormat {\n const key = `${locale ?? 'browser'}:${currency}`;\n const prior = currencyFormatters.get(key);\n if (prior) return prior;\n const formatter = new Intl.NumberFormat(locale, { style: 'currency', currency });\n if (currencyFormatters.size >= 16) {\n const oldest = currencyFormatters.keys().next().value;\n if (oldest !== undefined) currencyFormatters.delete(oldest);\n }\n currencyFormatters.set(key, formatter);\n return formatter;\n}\n\n/** Retailer evidence uses integer minor units; never assume every currency has two decimals. */\nexport function formatRetailerPrice(minor: number, currency: string, locale?: string): string {\n const formatter = currencyFormatter(currency, locale);\n const digits = formatter.resolvedOptions().maximumFractionDigits ?? 2;\n return formatter.format(minor / 10 ** digits);\n}\n\n/** A localized, ungrouped example that matches the decimal keypad's expected separator. */\nexport function retailerTargetExample(currency: string, locale?: string): string {\n return currencyFormatter(currency, locale)\n .formatToParts(12.34)\n .filter((part) => ['integer', 'decimal', 'fraction'].includes(part.type))\n .map((part) => part.value)\n .join('');\n}\n\nexport function retailerTargetMinor(value: string, currency: string, locale?: string): number {\n const formatter = currencyFormatter(currency, locale);\n const digits = formatter.resolvedOptions().maximumFractionDigits ?? 2;\n const digitMap = new Map<string, string>();\n for (let digit = 0; digit < 10; digit++) {\n const localized = formatter\n .formatToParts(digit)\n .filter((part) => part.type === 'integer')\n .map((part) => part.value)\n .join('');\n digitMap.set(localized, String(digit));\n }\n const normalized = Array.from(value.trim())\n .map((character) => digitMap.get(character) ?? character)\n .join('');\n const separator =\n formatter.formatToParts(1.1).find((part) => part.type === 'decimal')?.value ?? '.';\n const parts = normalized.split(separator);\n // Grouping is intentionally refused: accepting both comma and dot can silently change amounts.\n if (\n parts.length > 2 ||\n !/^\\d+$/.test(parts[0] ?? '') ||\n (parts.length === 2 &&\n (digits === 0 || !/^\\d+$/.test(parts[1] ?? '') || (parts[1]?.length ?? 0) > digits))\n ) {\n throw new Error(\n `Use an ungrouped positive amount such as ${retailerTargetExample(currency, locale)}.`\n );\n }\n const [whole = '0', fraction = ''] = parts;\n const minor = Number(whole) * 10 ** digits + Number(fraction.padEnd(digits, '0'));\n if (!Number.isSafeInteger(minor) || minor < 1 || minor > 2147483647)\n throw new Error('Enter a positive amount within the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;IAClC,8CAA8C;IAC9C,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAQD,wBAAgB,gBAAgB,IAAI,yBAAyB,CAM5D;AA+ID,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAqB/E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CoolAndLovelyContext.js","names":[],"sources":["../../../src/coolandlovely/context/CoolAndLovelyContext.tsx"],"sourcesContent":["/**\n * CoolAndLovely Context Provider\n * @module coolandlovely/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { CoolAndLovelyRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface CoolAndLovelyContextValue extends Omit<\n CoolAndLovelyRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst CoolAndLovelyContext = createContext<CoolAndLovelyContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useCoolAndLovely(): CoolAndLovelyContextValue {\n const context = useContext(CoolAndLovelyContext);\n if (!context) {\n throw new Error('useCoolAndLovely must be used within a CoolAndLovelyProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<CoolAndLovelyRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<CoolAndLovelyContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <CoolAndLovelyContext.Provider value={contextValue}>{children}</CoolAndLovelyContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<CoolAndLovelyContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n organizationId,\n projectId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <CoolAndLovelyContext.Provider value={contextValue}>{children}</CoolAndLovelyContext.Provider>\n );\n};\n\nexport const CoolAndLovelyProvider: FC<PropsWithChildren<CoolAndLovelyRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,IAAI;AAMjF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,CAAoB;CAC/C,IAAI,CAAC,GACH,MAAU,MAAM,8DAA8D;CAEhF,OAAO;AACT;AAWA,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,mBACA,cACA,kBACA,cACA,wBACI;CACJ,IAAM,IAAiB,EAAkB,GACnC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,CAAY,GAClE,CAAC,CAAiB,CACpB,GAEM,IAAa,GAChB,MAAyB;EACxB,IAAM,IAAW,EAAS,GAAmB,CAAY;EACzD,EAAe,CAAQ;CACzB,GACA,CAAC,GAAmB,CAAc,CACpC,GAEM,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;CAAwC,CAAA;AAEjG,GAGM,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,mBACA,cACA,kBACA,cACA,wBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,CAAY,GAClE,CAAC,CAAiB,CACpB,GAEM,IAAa,GAChB,MAAyB;EAExB,EADiB,EAAS,GAAmB,CACpC,CAAQ;CACnB,GACA,CAAC,GAAmB,CAAQ,CAC9B,GAEM,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;CAAwC,CAAA;AAEjG,GAEa,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;CAe/B,OAZsB,IAapB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;CACsB,CAAA,IAXvB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;CACsB,CAAA,EACb,CAAA;AASpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryScope.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/context/QueryScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAGvF,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CASrF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryScope.js","names":[],"sources":["../../../src/coolandlovely/context/QueryScope.tsx"],"sourcesContent":["import { useEffect, useState, type PropsWithChildren, type ReactElement } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\n/** Each mounted security scope owns its cache, including legacy unscoped query keys. */\nexport function CoolAndLovelyQueryScope({ children }: PropsWithChildren): ReactElement {\n const [client] = useState(\n () =>\n new QueryClient({\n defaultOptions: { queries: { staleTime: 5 * 60 * 1000, retry: 1 } },\n })\n );\n useEffect(() => () => client.clear(), [client]);\n return <QueryClientProvider client={client}>{children}</QueryClientProvider>;\n}\n"],"mappings":";;;;AAIA,SAAgB,EAAwB,EAAE,eAA6C;CACrF,IAAM,CAAC,KAAU,QAEb,IAAI,EAAY,EACd,gBAAgB,EAAE,SAAS;EAAE,WAAW,MAAS;EAAM,OAAO;CAAE,EAAE,EACpE,CAAC,CACL;CAEA,OADA,cAAsB,EAAO,MAAM,GAAG,CAAC,CAAM,CAAC,GACvC,kBAAC,GAAD;EAA6B;EAAS;CAA8B,CAAA;AAC7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/context/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryScopeKey.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/context/queryScopeKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAS3E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryScopeKey.js","names":[],"sources":["../../../src/coolandlovely/context/queryScopeKey.ts"],"sourcesContent":["import type { CoolAndLovelyRootProps } from '../types';\n\n/** Only non-secret identities belong in the React remount key. */\nexport function coolAndLovelyScopeKey(props: CoolAndLovelyRootProps): string {\n return JSON.stringify([\n props.apiGatewayUrl ?? null,\n props.tenantId ?? null,\n props.organizationId ?? null,\n props.workspaceId ?? null,\n props.projectId ?? null,\n props.currentUser?.id ?? null,\n ]);\n}\n"],"mappings":";AAGA,SAAgB,EAAsB,GAAuC;CAC3E,OAAO,KAAK,UAAU;EACpB,EAAM,iBAAiB;EACvB,EAAM,YAAY;EAClB,EAAM,kBAAkB;EACxB,EAAM,eAAe;EACrB,EAAM,aAAa;EACnB,EAAM,aAAa,MAAM;CAC3B,CAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextNavigationTarget.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/contextNavigationTarget.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,oDAAqD,CAAC;AAErF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAChD,MAAM,CAqBR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextNavigationTarget.js","names":[],"sources":["../../../src/coolandlovely/hooks/contextNavigationTarget.ts"],"sourcesContent":["/** Query keys that carry the host's selected context. Nothing else is copied. */\nexport const CONTEXT_QUERY_KEYS = ['org', 'workspace', 'project', 'tenant'] as const;\n\n/**\n * Build a navigation target that keeps the selected context.\n *\n * `sources` are read in priority order; the first one that carries a key wins.\n * The caller passes the live address-bar query first and the router location\n * second: the host shell writes context keys with `history.replaceState` after\n * a context switch (fe-libs ActiveContextProvider), which React Router does not\n * observe, so the router location can be missing a key (typically `project`)\n * that the address bar already shows. The router query stays as the fallback\n * for embeddings that use an in-memory router.\n *\n * The target's own query and hash are kept; a context key in the source\n * replaces the same key in the target so a link can never point at a different\n * context than the one selected.\n */\nexport function buildContextNavigationTarget(\n path: string,\n sources: ReadonlyArray<string | null | undefined>\n): string {\n const hashIndex = path.indexOf('#');\n const beforeHash = hashIndex === -1 ? path : path.slice(0, hashIndex);\n const fragment = hashIndex === -1 ? undefined : path.slice(hashIndex + 1);\n const queryIndex = beforeHash.indexOf('?');\n const pathname = queryIndex === -1 ? beforeHash : beforeHash.slice(0, queryIndex);\n const existingQuery = queryIndex === -1 ? '' : beforeHash.slice(queryIndex + 1);\n\n const parsedSources = sources.map((source) => new URLSearchParams(source ?? ''));\n const context = new URLSearchParams(existingQuery);\n for (const key of CONTEXT_QUERY_KEYS) {\n for (const source of parsedSources) {\n const value = source.get(key);\n if (value) {\n context.set(key, value);\n break;\n }\n }\n }\n const query = context.toString();\n return `${pathname}${query ? `?${query}` : ''}${fragment === undefined ? '' : `#${fragment}`}`;\n}\n"],"mappings":";AACA,IAAa,IAAqB;CAAC;CAAO;CAAa;CAAW;AAAQ;AAiB1E,SAAgB,EACd,GACA,GACQ;CACR,IAAM,IAAY,EAAK,QAAQ,GAAG,GAC5B,IAAa,MAAc,KAAK,IAAO,EAAK,MAAM,GAAG,CAAS,GAC9D,IAAW,MAAc,KAAK,KAAA,IAAY,EAAK,MAAM,IAAY,CAAC,GAClE,IAAa,EAAW,QAAQ,GAAG,GACnC,IAAW,MAAe,KAAK,IAAa,EAAW,MAAM,GAAG,CAAU,GAC1E,IAAgB,MAAe,KAAK,KAAK,EAAW,MAAM,IAAa,CAAC,GAExE,IAAgB,EAAQ,KAAK,MAAW,IAAI,gBAAgB,KAAU,EAAE,CAAC,GACzE,IAAU,IAAI,gBAAgB,CAAa;CACjD,KAAK,IAAM,KAAO,GAChB,KAAK,IAAM,KAAU,GAAe;EAClC,IAAM,IAAQ,EAAO,IAAI,CAAG;EAC5B,IAAI,GAAO;GACT,EAAQ,IAAI,GAAK,CAAK;GACtB;EACF;CACF;CAEF,IAAM,IAAQ,EAAQ,SAAS;CAC/B,OAAO,GAAG,IAAW,IAAQ,IAAI,MAAU,KAAK,MAAa,KAAA,IAAY,KAAK,IAAI;AACpF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,EAEf,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EAEpB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAE5B,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EAEb,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EAEtB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EAErB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EAErB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EAEjB,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EAEd,mBAAmB,EACnB,cAAc,EAEd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useActivity.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useActivity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAqCD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,YAAY,MAAM,GAAG,SAAS,EAC9B,cAAU,8EAiBX,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useActivity.js","names":[],"sources":["../../../src/coolandlovely/hooks/useActivity.ts"],"sourcesContent":["/**\n * Audit-trail hooks — activity via wspace-activity-svc (NO new table).\n * @module coolandlovely/hooks\n *\n * CoolAndLovely does NOT own an audit table. Every `coo*` mutation is already\n * recorded by the svc's mutation-audit plugin\n * (`wspace-coolandlovely-svc/src/plugins/mutation-audit-plugin.ts`) through\n * be-sdk `trackOperation`, which writes an `ActivityLog` row on\n * wspace-activity-svc carrying:\n *\n * action — the plugin's `eventName`, e.g. `coolandlovely.brand_transitioned`\n * description — `\"<action> <resourceType>: <fieldName>\"`\n * resourceType — e.g. `coolandlovely-brand`\n * resourceId — the affected record's id\n * userId — the acting actor\n *\n * This hook is purely the read surface over those rows (`getActivities`,\n * federated on the workspace supergraph). Nothing is synthesised: when the\n * service has no rows for a record, callers render an empty state.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useCoolAndLovely } from '../context';\n\nconst QK = 'coolandlovely-activity';\n\n/** A single audit entry as surfaced in the MFE (scalar-only projection). */\nexport interface CooActivityEntry {\n id: string;\n action: string;\n description: string | null;\n resourceType: string | null;\n resourceId: string | null;\n userId: string;\n timestamp: string;\n}\n\nconst GET_ACTIVITIES = `\n query CooEntityActivity($filter: ActivityLogFilter) {\n getActivities(filter: $filter) {\n id\n action\n description\n resourceType\n resourceId\n userId\n timestamp\n }\n }\n`;\n\nconst activityFetch = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Activity request failed');\n }\n if (!response.data) {\n throw new Error('Activity response did not include data');\n }\n return response.data;\n};\n\n/**\n * Audit entries for one record, newest first.\n *\n * `getActivities` is `@rbac(action: \"read\", resource: \"activity-log\",\n * scopeType: \"wspace\")` — a member without that permission gets an error from\n * the gateway, which callers surface honestly rather than hiding.\n */\nexport const useEntityActivity = (\n resourceType: string,\n resourceId: string | undefined,\n limit = 20\n) => {\n const { apiGatewayUrl, workspaceId } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, resourceType, resourceId, limit],\n enabled: Boolean(resourceId) && Boolean(workspaceId),\n queryFn: async (): Promise<CooActivityEntry[]> => {\n const data = await activityFetch<{ getActivities: CooActivityEntry[] }>(\n GET_ACTIVITIES,\n { filter: { workspaceId, resourceType, resourceId, limit } },\n apiGatewayUrl\n );\n return [...data.getActivities].sort(\n (a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()\n );\n },\n });\n};\n"],"mappings":";;;;;AA0BA,IAAM,IAAK,0BAaL,IAAiB,iOAcjB,IAAgB,OACpB,GACA,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;CAClB,CAAC;CACD,IAAI,EAAS,QAAQ,QACnB,MAAU,MAAM,EAAS,OAAO,EAAE,EAAE,WAAW,yBAAyB;CAE1E,IAAI,CAAC,EAAS,MACZ,MAAU,MAAM,wCAAwC;CAE1D,OAAO,EAAS;AAClB,GASa,KACX,GACA,GACA,IAAQ,OACL;CACH,IAAM,EAAE,kBAAe,mBAAgB,EAAiB;CACxD,OAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAc;GAAY;EAAK;EAC9C,SAAS,EAAQ,KAAe,EAAQ;EACxC,SAAS,YAMA,CAAC,IAAG,MALQ,EACjB,GACA,EAAE,QAAQ;GAAE;GAAa;GAAc;GAAY;EAAM,EAAE,GAC3D,CACF,EAAA,CACgB,aAAa,CAAC,CAAC,MAC5B,GAAG,MAAM,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,QAAQ,IAAI,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,QAAQ,CAC5E;CAEJ,CAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAssistantEntity.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useAssistantEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,IAAI,CAMN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAssistantEntity.js","names":[],"sources":["../../../src/coolandlovely/hooks/useAssistantEntity.ts"],"sourcesContent":["/**\n * Assistant screen-context hook.\n * @module coolandlovely/hooks\n *\n * The floating assistant already receives `entityType` / `entityId`, both\n * resolved from the URL. Neither tells the model WHAT the shopper is looking\n * at, so \"publish this storefront\" or \"what collections is this in\" forces the\n * assistant to echo a UUID back at a human.\n *\n * `entityName` is one of the agent's allowed context keys\n * (`~/products/wspace/sandbox/ai-assistant/src/context-loader.ts`), but nothing\n * in this product ever sent it. Detail pages call this hook with the name from\n * their own loaded record — no extra request, no invented label — and it is\n * withdrawn again on unmount.\n */\n\nimport { useEffect } from 'react';\n\nimport { clearActiveEntityName, setActiveEntityName } from '../../utils/pageContext';\n\n/**\n * Publish the current entity's display name to the assistant page context.\n *\n * Safe to call before the record has loaded: a missing id or name simply\n * publishes nothing, so the assistant falls back to the id-only context it\n * gets today rather than receiving a placeholder.\n */\nexport function useAssistantEntityName(\n entityId: string | undefined,\n entityName: string | null | undefined\n): void {\n useEffect(() => {\n if (!entityId || !entityName) return;\n setActiveEntityName(entityId, entityName);\n return () => clearActiveEntityName(entityId);\n }, [entityId, entityName]);\n}\n"],"mappings":";;;AA2BA,SAAgB,EACd,GACA,GACM;CACN,QAAgB;EACV,OAAC,KAAY,CAAC,IAElB,OADA,EAAoB,GAAU,CAAU,SAC3B,EAAsB,CAAQ;CAC7C,GAAG,CAAC,GAAU,CAAU,CAAC;AAC3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBrandOrdersApi.d.ts","sourceRoot":"","sources":["../../../src/coolandlovely/hooks/useBrandOrdersApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EACV,4BAA4B,EAC5B,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAkBlB,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,GAAG,SAAS,EAC3B,mBAAmB,mBAAmB,mFAoBvC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,GAAG,SAAS,gFAkB/D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,GAAG,SAAS,EAAE,IAAI,MAAM,GAAG,SAAS,gFAchF,CAAC;AAEF,eAAO,MAAM,wBAAwB,uHAoBpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,kHAoC/B,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,GAAG,SAAS,EAC3B,SAAS,sBAAsB,sFAoBhC,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,sHAiBnC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,sHAgBnC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBrandOrdersApi.js","names":[],"sources":["../../../src/coolandlovely/hooks/useBrandOrdersApi.ts"],"sourcesContent":["/**\n * Brand order hooks (BOFF-9636)\n * @module coolandlovely/hooks\n *\n * React Query layer over the brand-side order fields of `wspace-coolandlovely-svc`: the paid\n * orders that contain a brand's pieces (only that brand's lines), counts per fulfilment state,\n * and the fulfilment mutation (confirm, ship with tracking, mark delivered). Also the brand's\n * refunds (BOFF-9702) and the shopper return requests it approves or declines (BOFF-9900).\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useCoolAndLovely } from '../context';\nimport type {\n CooApproveReturnRequestInput,\n CooBrandOrder,\n CooBrandOrderConnection,\n CooBrandOrderSummary,\n CooDeclineReturnRequestInput,\n CooFulfilmentStatus,\n CooRefundBrandOrderInput,\n CooReturnRequestConnection,\n CooReturnRequestStatus,\n CooUpdateOrderFulfilmentInput,\n} from '../types';\nimport { FULFILMENT_FIELDS, REFUND_FIELDS, RETURN_REQUEST_FIELDS } from './useCommerceApi';\nimport { coolQuery } from './useCoolAndLovelyApi';\n\nconst QK = 'coolandlovely';\n\nconst BRAND_ORDER_FIELDS = `\n id orderNumber status brandId currency brandSubtotal itemCount\n shippingName shippingAddress buyerNote paidAt createdAt\n items {\n id styleItemId brandId name sku image { id } size colour unitPrice quantity lineTotal\n lookId isCreatorAttributed stockTracked\n }\n fulfilment { ${FULFILMENT_FIELDS} }\n refund { ${REFUND_FIELDS} }\n returnRequest { ${RETURN_REQUEST_FIELDS} }\n`;\n\nexport const useBrandOrders = (\n brandId: string | undefined,\n fulfilmentStatus?: CooFulfilmentStatus\n) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-orders', brandId, fulfilmentStatus ?? 'ALL'],\n enabled: !!brandId,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrders: CooBrandOrderConnection }>(\n `query CooBrandOrders($brandId: ID!, $fulfilmentStatus: CooFulfilmentStatus, $pagination: PaginationInput) {\n cooBrandOrders(brandId: $brandId, fulfilmentStatus: $fulfilmentStatus, pagination: $pagination) {\n items { ${BRAND_ORDER_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { brandId, fulfilmentStatus, pagination: { limit: 50, offset: 0 } },\n apiGatewayUrl\n );\n return data.cooBrandOrders;\n },\n });\n};\n\nexport const useBrandOrderSummary = (brandId: string | undefined) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-order-summary', brandId],\n enabled: !!brandId,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrderSummary: CooBrandOrderSummary }>(\n `query CooBrandOrderSummary($brandId: ID!) {\n cooBrandOrderSummary(brandId: $brandId) {\n brandId unfulfilled confirmed shipped delivered refunded total\n }\n }`,\n { brandId },\n apiGatewayUrl\n );\n return data.cooBrandOrderSummary;\n },\n });\n};\n\nexport const useBrandOrder = (brandId: string | undefined, id: string | undefined) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-order', brandId, id],\n enabled: !!brandId && !!id,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandOrder: CooBrandOrder | null }>(\n `query CooBrandOrder($brandId: ID!, $id: ID!) { cooBrandOrder(brandId: $brandId, id: $id) { ${BRAND_ORDER_FIELDS} } }`,\n { brandId, id },\n apiGatewayUrl\n );\n return data.cooBrandOrder;\n },\n });\n};\n\nexport const useUpdateOrderFulfilment = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (input: CooUpdateOrderFulfilmentInput) => {\n const data = await coolQuery<{ cooUpdateOrderFulfilment: CooBrandOrder }>(\n `mutation CooUpdateOrderFulfilment($input: CooUpdateOrderFulfilmentInput!) {\n cooUpdateOrderFulfilment(input: $input) { ${BRAND_ORDER_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.cooUpdateOrderFulfilment;\n },\n onSuccess: (order) => {\n queryClient.setQueryData([QK, 'brand-order', order.brandId, order.id], order);\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-orders', order.brandId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-order-summary', order.brandId] });\n },\n });\n};\n\n/**\n * Refund the brand's pieces of an order (BOFF-9702). global-billing returns the money to the\n * shopper, and the creator commissions on the refunded lines are reversed. With `restock: true`\n * the refunded stock-tracked pieces go back into stock (BOFF-9901); sending it on a completed\n * refund restocks it afterwards.\n */\nexport const useRefundBrandOrder = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (input: CooRefundBrandOrderInput) => {\n const data = await coolQuery<{ cooRefundBrandOrder: CooBrandOrder }>(\n `mutation CooRefundBrandOrder($input: CooRefundBrandOrderInput!) {\n cooRefundBrandOrder(input: $input) { ${BRAND_ORDER_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.cooRefundBrandOrder;\n },\n onSuccess: (order) => {\n queryClient.setQueryData([QK, 'brand-order', order.brandId, order.id], order);\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-orders', order.brandId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-order-summary', order.brandId] });\n // A restock (BOFF-9901) changes the pieces' stock and can put a sold-out piece back on sale.\n if (order.refund?.restockStatus === 'RESTOCKED') {\n for (const styleItemId of new Set(order.items.map((item) => item.styleItemId))) {\n void queryClient.invalidateQueries({\n queryKey: [QK, 'style-item-inventory', styleItemId],\n });\n void queryClient.invalidateQueries({ queryKey: [QK, 'style-item', styleItemId] });\n }\n void queryClient.invalidateQueries({ queryKey: [QK, 'style-items'] });\n }\n },\n // A failed refund is recorded on the order; refetch so the page shows why.\n onError: (_error, input) => {\n void queryClient.invalidateQueries({\n queryKey: [QK, 'brand-order', input.brandId, input.orderId],\n });\n },\n });\n};\n\n/** The brand's return requests, newest first, optionally by status (BOFF-9900). */\nexport const useBrandReturnRequests = (\n brandId: string | undefined,\n status?: CooReturnRequestStatus\n) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, 'brand-return-requests', brandId, status ?? 'ALL'],\n enabled: !!brandId,\n queryFn: async () => {\n const data = await coolQuery<{ cooBrandReturnRequests: CooReturnRequestConnection }>(\n `query CooBrandReturnRequests($brandId: ID!, $status: CooReturnRequestStatus, $pagination: PaginationInput) {\n cooBrandReturnRequests(brandId: $brandId, status: $status, pagination: $pagination) {\n items { ${RETURN_REQUEST_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { brandId, status, pagination: { limit: 50, offset: 0 } },\n apiGatewayUrl\n );\n return data.cooBrandReturnRequests;\n },\n });\n};\n\nconst useReturnDecisionSettled = () => {\n const queryClient = useQueryClient();\n return (brandId: string, orderId: string, order?: CooBrandOrder) => {\n if (order) queryClient.setQueryData([QK, 'brand-order', brandId, orderId], order);\n else void queryClient.invalidateQueries({ queryKey: [QK, 'brand-order', brandId, orderId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-orders', brandId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-order-summary', brandId] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'brand-return-requests', brandId] });\n };\n};\n\n/**\n * Approve a shopper's return (BOFF-9900): refunds the brand's pieces through the brand refund and\n * marks the request approved. On an error the order is refetched so a failed refund shows why.\n */\nexport const useApproveReturnRequest = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n const settle = useReturnDecisionSettled();\n return useMutation({\n mutationFn: async (input: CooApproveReturnRequestInput) => {\n const data = await coolQuery<{ cooApproveReturnRequest: CooBrandOrder }>(\n `mutation CooApproveReturnRequest($input: CooApproveReturnRequestInput!) {\n cooApproveReturnRequest(input: $input) { ${BRAND_ORDER_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.cooApproveReturnRequest;\n },\n onSuccess: (order, input) => settle(input.brandId, input.orderId, order),\n onError: (_error, input) => settle(input.brandId, input.orderId),\n });\n};\n\n/** Decline a shopper's return with a note the shopper sees (BOFF-9900). */\nexport const useDeclineReturnRequest = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n const settle = useReturnDecisionSettled();\n return useMutation({\n mutationFn: async (input: CooDeclineReturnRequestInput) => {\n const data = await coolQuery<{ cooDeclineReturnRequest: CooBrandOrder }>(\n `mutation CooDeclineReturnRequest($input: CooDeclineReturnRequestInput!) {\n cooDeclineReturnRequest(input: $input) { ${BRAND_ORDER_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.cooDeclineReturnRequest;\n },\n onSuccess: (order, input) => settle(input.brandId, input.orderId, order),\n });\n};\n"],"mappings":";;;;;;AA4BA,IAAM,IAAK,iBAEL,IAAqB;;;;;;;iBAOV,EAAkB;aACtB,EAAc;oBACP,EAAsB;GAG7B,KACX,GACA,MACG;CACH,IAAM,EAAE,qBAAkB,EAAiB;CAC3C,OAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAgB;GAAS,KAAoB;EAAK;EACjE,SAA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AE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,yBAAyB,CAAC;IACnC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AA6ED,eAAO,MAAM,wBAAwB,iIA4FpC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCatalogImport.js","names":[],"sources":["../../../src/coolandlovely/hooks/useCatalogImport.ts"],"sourcesContent":["/**\n * Catalog import hooks (BOFF-3384)\n * @module coolandlovely/hooks\n *\n * Brands onboard an existing catalog from Shopify, WooCommerce or BigCommerce:\n *\n * 1. `usePreviewExternalCatalog` calls `cooPreviewExternalCatalog`, which reads\n * the merchant's store with the credentials typed into the form (used for\n * that one request, never stored) and returns the catalog mapped onto\n * CoolAndLovely brand / collection / style-item shapes.\n * 2. `useImportExternalCatalog` copies each product image (and the store logo)\n * from the platform's CDN into wspace-files, then imports everything in\n * one transaction with `cooBulkImportCatalog`, so CoolAndLovely only ever\n * stores federated File ids, never third-party image URLs.\n */\n\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\n\nimport { useCoolAndLovely } from '../context';\nimport type {\n CooBulkCatalogImportResult,\n CooBulkImportCatalogInput,\n CooBulkImportCatalogItemInput,\n CooExternalCatalogItemPreview,\n CooExternalCatalogPreview,\n CooExternalCatalogSourceInput,\n} from '../types';\nimport { coolQuery } from './useCoolAndLovelyApi';\nimport { COO_FILE_FOLDERS, uploadImageToFiles } from './useFiles';\n\nconst QK = 'coolandlovely';\n\n/** Images copied in parallel; small enough to stay polite to the platform CDN. */\nconst IMAGE_CONCURRENCY = 4;\n/** Largest image copied into Files; bigger ones are imported without an image. */\nconst MAX_IMAGE_BYTES = 10 * 1024 * 1024;\n\nconst PREVIEW_FIELDS = `\n provider sourceUrl truncated warnings\n brand { name handle tagline bio websiteUrl logoUrl tags }\n collections { name description tags }\n items {\n externalId collectionName name description category sku price currency\n colours sizes materials tags imageUrl sourceUrl\n }\n`;\n\nexport const usePreviewExternalCatalog = () => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useMutation({\n mutationFn: async (source: CooExternalCatalogSourceInput) => {\n const data = await coolQuery<{ cooPreviewExternalCatalog: CooExternalCatalogPreview }>(\n `mutation CooPreviewExternalCatalog($source: CooExternalCatalogSourceInput!) {\n cooPreviewExternalCatalog(source: $source) { ${PREVIEW_FIELDS} }\n }`,\n { source },\n apiGatewayUrl\n );\n return data.cooPreviewExternalCatalog;\n },\n });\n};\n\n/** Progress of an import run, for the progress bar. */\nexport interface CatalogImportProgress {\n phase: 'images' | 'saving';\n done: number;\n total: number;\n}\n\nexport interface ImportExternalCatalogArgs {\n preview: CooExternalCatalogPreview;\n /** Brand name and handle as the merchant confirmed them. */\n brandName: string;\n brandHandle: string;\n /** Items the merchant kept (by externalId). */\n selectedIds: ReadonlySet<string>;\n copyImages: boolean;\n onProgress?: (progress: CatalogImportProgress) => void;\n}\n\nexport interface ImportExternalCatalogResult extends CooBulkCatalogImportResult {\n imagesCopied: number;\n imagesFailed: number;\n}\n\nfunction fileNameFor(url: string, fallback: string, mimeType: string): string {\n const last = new URL(url).pathname.split('/').pop() ?? '';\n if (/\\.[a-z0-9]{2,5}$/i.test(last)) return last.slice(-120);\n const extension = mimeType.split('/')[1]?.split('+')[0] ?? 'jpg';\n return `${fallback}.${extension}`;\n}\n\n/**\n * Copy one remote image into wspace-files. Returns the File id, or null when\n * the image cannot be fetched (CORS, 404, not an image, too large) — the item\n * is then imported without an image rather than failing the whole import.\n */\nasync function copyImageToFiles(\n url: string,\n name: string,\n folder: string,\n apiGatewayUrl?: string\n): Promise<string | null> {\n try {\n const response = await fetch(url, {\n mode: 'cors',\n credentials: 'omit',\n referrerPolicy: 'no-referrer',\n });\n if (!response.ok) return null;\n const blob = await response.blob();\n if (!blob.type.startsWith('image/') || blob.size === 0 || blob.size > MAX_IMAGE_BYTES)\n return null;\n const file = new File([blob], fileNameFor(url, name, blob.type), { type: blob.type });\n const uploaded = await uploadImageToFiles(file, apiGatewayUrl, folder);\n return uploaded.id;\n } catch {\n return null;\n }\n}\n\n/** Run `task` over `items` with at most `limit` in flight, preserving order. */\nasync function mapWithConcurrency<T, R>(\n items: readonly T[],\n limit: number,\n task: (item: T, index: number) => Promise<R>\n): Promise<R[]> {\n const results = new Array<R>(items.length);\n let next = 0;\n const worker = async () => {\n while (next < items.length) {\n const index = next;\n next += 1;\n results[index] = await task(items[index] as T, index);\n }\n };\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));\n return results;\n}\n\nfunction toImportItem(\n item: CooExternalCatalogItemPreview,\n imageFileId: string | null\n): CooBulkImportCatalogItemInput {\n return {\n collectionName: item.collectionName ?? '',\n name: item.name,\n ...(item.description ? { description: item.description } : {}),\n category: item.category,\n ...(item.sku ? { sku: item.sku } : {}),\n ...(imageFileId ? { imageFileId } : {}),\n price: item.price,\n currency: item.currency,\n colours: item.colours,\n sizes: item.sizes,\n materials: item.materials,\n tags: item.tags,\n };\n}\n\nexport const useImportExternalCatalog = () => {\n const queryClient = useQueryClient();\n const { apiGatewayUrl } = useCoolAndLovely();\n return useMutation({\n mutationFn: async ({\n preview,\n brandName,\n brandHandle,\n selectedIds,\n copyImages,\n onProgress,\n }: ImportExternalCatalogArgs): Promise<ImportExternalCatalogResult> => {\n const items = preview.items.filter((item) => selectedIds.has(item.externalId));\n let imagesCopied = 0;\n let imagesFailed = 0;\n let done = 0;\n const imageJobs = copyImages ? items.filter((item) => item.imageUrl).length : 0;\n const logoJob = copyImages && preview.brand.logoUrl ? 1 : 0;\n const total = imageJobs + logoJob;\n onProgress?.({ phase: 'images', done, total });\n\n const tick = (copied: boolean) => {\n if (copied) imagesCopied += 1;\n else imagesFailed += 1;\n done += 1;\n onProgress?.({ phase: 'images', done, total });\n };\n\n let logoFileId: string | null = null;\n if (logoJob && preview.brand.logoUrl) {\n logoFileId = await copyImageToFiles(\n preview.brand.logoUrl,\n `${brandHandle}-logo`,\n COO_FILE_FOLDERS.brands,\n apiGatewayUrl\n );\n tick(Boolean(logoFileId));\n }\n\n const imageIds = await mapWithConcurrency(items, IMAGE_CONCURRENCY, async (item, index) => {\n if (!copyImages || !item.imageUrl) return null;\n const id = await copyImageToFiles(\n item.imageUrl,\n `${brandHandle}-${index + 1}`,\n COO_FILE_FOLDERS.items,\n apiGatewayUrl\n );\n tick(Boolean(id));\n return id;\n });\n\n const usedCollections = new Set(items.map((item) => item.collectionName).filter(Boolean));\n const input: CooBulkImportCatalogInput = {\n brand: {\n name: brandName,\n handle: brandHandle,\n ...(preview.brand.tagline ? { tagline: preview.brand.tagline } : {}),\n ...(preview.brand.bio ? { bio: preview.brand.bio } : {}),\n ...(preview.brand.websiteUrl ? { websiteUrl: preview.brand.websiteUrl } : {}),\n ...(logoFileId ? { logoFileId } : {}),\n tags: preview.brand.tags,\n },\n collections: preview.collections\n .filter((collection) => usedCollections.has(collection.name))\n .map((collection) => ({\n name: collection.name,\n ...(collection.description ? { description: collection.description } : {}),\n tags: collection.tags,\n })),\n items: items.map((item, index) => toImportItem(item, imageIds[index] ?? null)),\n };\n\n onProgress?.({ phase: 'saving', done, total });\n const data = await coolQuery<{ cooBulkImportCatalog: CooBulkCatalogImportResult }>(\n `mutation CooBulkImportCatalog($input: CooBulkImportCatalogInput!) {\n cooBulkImportCatalog(input: $input) {\n brand { id name handle }\n collectionsCreated\n itemsCreated\n }\n }`,\n { input },\n apiGatewayUrl\n );\n return { ...data.cooBulkImportCatalog, imagesCopied, imagesFailed };\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [QK, 'brands'] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'collections'] });\n void queryClient.invalidateQueries({ queryKey: [QK, 'style-items'] });\n },\n });\n};\n"],"mappings":";;;;;;AA8BA,IAAM,IAAK,iBAGL,IAAoB,GAEpB,IAAkB,KAAK,OAAO,MAE9B,IAAiB,sSAUV,UAAkC;CAC7C,IAAM,EAAE,qBAAkB,EAAiB;CAC3C,OAAO,EAAY,EACjB,YAAY,OAAO,OAQV,MAPY,EACjB;yDACiD,EAAe;YAEhE,EAAE,UAAO,GACT,CACF,EAAA,CACY,0BAEhB,CAAC;AACH;AAyBA,SAAS,EAAY,GAAa,GAAkB,GAA0B;CAC5E,IAAM,IAAO,IAAI,IAAI,CAAG,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK;CAGvD,OAFI,oBAAoB,KAAK,CAAI,IAAU,EAAK,MAAM,IAAI,IAEnD,GAAG,EAAS,GADD,EAAS,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM;AAE7D;AAOA,eAAe,EACb,GACA,GACA,GACA,GACwB;CACxB,IAAI;EACF,IAAM,IAAW,MAAM,MAAM,GAAK;GAChC,MAAM;GACN,aAAa;GACb,gBAAgB;EAClB,CAAC;EACD,IAAI,CAAC,EAAS,IAAI,OAAO;EACzB,IAAM,IAAO,MAAM,EAAS,KAAK;EAKjC,OAJI,CAAC,EAAK,KAAK,WAAW,QAAQ,KAAK,EAAK,SAAS,KAAK,EAAK,OAAO,IAC7D,QAGF,MADgB,EAAmB,IADzB,KAAK,CAAC,CAAI,GAAG,EAAY,GAAK,GAAM,EAAK,IAAI,GAAG,EAAE,MAAM,EAAK,KAAK,CACzC,GAAM,GAAe,CAAM,EAAA,CACrD;CAClB,QAAQ;EACN,OAAO;CACT;AACF;AAGA,eAAe,EACb,GACA,GACA,GACc;CACd,IAAM,IA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