@burdenoff/microfe-coolandlovely 2026.1123.2 → 2026.1124.2

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 (21) hide show
  1. package/dist/coolandlovely/CoolAndLovelyRoutes.js +29 -25
  2. package/dist/coolandlovely/components/intelligence/BrandCreatorMatchPanel.d.ts +6 -0
  3. package/dist/coolandlovely/components/intelligence/BrandCreatorMatchPanel.js +147 -0
  4. package/dist/coolandlovely/components/intelligence/CollectionCurationCallout.d.ts +8 -0
  5. package/dist/coolandlovely/components/intelligence/CollectionCurationCallout.js +109 -0
  6. package/dist/coolandlovely/components/intelligence/ProvenanceChip.d.ts +8 -0
  7. package/dist/coolandlovely/components/intelligence/ProvenanceChip.js +36 -0
  8. package/dist/coolandlovely/components/intelligence/WardrobeIntelligenceStrip.d.ts +2 -0
  9. package/dist/coolandlovely/components/intelligence/WardrobeIntelligenceStrip.js +123 -0
  10. package/dist/coolandlovely/hooks/index.d.ts +1 -0
  11. package/dist/coolandlovely/hooks/index.js +1 -0
  12. package/dist/coolandlovely/hooks/useStyleIntelligenceApi.d.ts +24 -0
  13. package/dist/coolandlovely/hooks/useStyleIntelligenceApi.js +266 -0
  14. package/dist/coolandlovely/pages/brands/BrandDetailPage.js +157 -155
  15. package/dist/coolandlovely/pages/collections/CollectionDetailPage.js +110 -105
  16. package/dist/coolandlovely/pages/intelligence/StyleIntelligencePage.d.ts +15 -0
  17. package/dist/coolandlovely/pages/intelligence/StyleIntelligencePage.js +1007 -0
  18. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js +71 -69
  19. package/dist/coolandlovely/types/index.d.ts +1 -0
  20. package/dist/coolandlovely/types/intelligence.d.ts +128 -0
  21. package/package.json +1 -1
@@ -0,0 +1,1007 @@
1
+ import { PageLayout as e } from "../../components/PageLayout.js";
2
+ import { Thumbnail as t } from "../../components/Thumbnail.js";
3
+ import { ColourSwatchRow as n } from "../../components/ColourSwatchRow.js";
4
+ import { useAddLookbookEntry as ee, useBrands as te, useCreateCollaboration as ne, useCreateLook as re, useLookbooks as ie, usePublishLook as ae } from "../../hooks/useCoolAndLovelyApi.js";
5
+ import { ActorName as r } from "../../components/ActorName.js";
6
+ import { useTr as oe } from "../../hooks/useTr.js";
7
+ import { ProvenanceChip as i } from "../../components/intelligence/ProvenanceChip.js";
8
+ import { formatActivityAction as se } from "../../components/ActivityTrail.js";
9
+ import { useCoolAndLovely as ce } from "../../context/CoolAndLovelyContext.js";
10
+ import { useContextNavigation as le } from "../../hooks/useContextNavigation.js";
11
+ import "../../hooks/index.js";
12
+ import { extractLookStyleItemIds as ue, formatBlockerLabel as de, formatFindingKindLabel as fe, isQuotaExhaustedError as a, isRewearFinding as pe, useAiCreditStatus as me, useAnalyzeWardrobeGaps as he, useCurateCollection as ge, useDecisionActivity as _e, useSuggestCollaborationMatch as ve, useSuggestOutfit as ye } from "../../hooks/useStyleIntelligenceApi.js";
13
+ import { cn as o } from "../../utils/cn.js";
14
+ import { formatDate as be, formatPrice as s, formatRelativeTime as xe, titleCase as c } from "../../utils/formatters.js";
15
+ import { useMemo as l, useState as u } from "react";
16
+ import { AlertTriangle as d, ArrowRight as Se, BookHeart as Ce, Check as f, ExternalLink as we, Handshake as p, History as m, Layers as Te, Loader2 as h, RotateCw as Ee, ShieldCheck as De, Shirt as g, Sparkles as _, Store as Oe, X as ke } from "lucide-react";
17
+ import { useSearchParams as Ae } from "react-router";
18
+ import { Fragment as je, jsx as v, jsxs as y } from "react/jsx-runtime";
19
+ import { GlassCard as b } from "@burdenoff/fe-libs/ui";
20
+ // src/coolandlovely/pages/intelligence/StyleIntelligencePage.tsx
21
+ var Me = [
22
+ "EVERYDAY",
23
+ "WORK",
24
+ "EVENING",
25
+ "WEDDING_GUEST",
26
+ "VACATION",
27
+ "PARTY",
28
+ "ACTIVE",
29
+ "OTHER"
30
+ ], Ne = [
31
+ {
32
+ value: "NONE",
33
+ label: "Any weather"
34
+ },
35
+ {
36
+ value: "HOT",
37
+ label: "Hot"
38
+ },
39
+ {
40
+ value: "WARM",
41
+ label: "Warm"
42
+ },
43
+ {
44
+ value: "MILD",
45
+ label: "Mild"
46
+ },
47
+ {
48
+ value: "COLD",
49
+ label: "Cold"
50
+ },
51
+ {
52
+ value: "RAINY",
53
+ label: "Rainy"
54
+ }
55
+ ], x = [
56
+ "SPRING",
57
+ "SUMMER",
58
+ "AUTUMN",
59
+ "WINTER",
60
+ "RESORT",
61
+ "ALL_SEASON"
62
+ ];
63
+ function Pe(e) {
64
+ return e === "brand" || e === "activity" ? e : "shopper";
65
+ }
66
+ function Fe(e) {
67
+ return e && x.includes(e) ? e : "SUMMER";
68
+ }
69
+ function S() {
70
+ let S = oe(), C = le(), { navigate: Ie, currentUser: w } = ce(), [T, Le] = Ae(), [E, Re] = u(() => Pe(T.get("tab"))), [D, ze] = u("EVERYDAY"), [O, Be] = u("MILD"), [k, Ve] = u(!0), [He, A] = u(null), [Ue, We] = u(""), [Ge, j] = u(null), [Ke, M] = u(!1), [N, qe] = u(null), Je = te({ pagination: {
71
+ limit: 50,
72
+ offset: 0
73
+ } }), P = l(() => Je.data?.items ?? [], [Je.data]), [Ye, Xe] = u(() => T.get("brandId") ?? ""), [F, Ze] = u(() => Fe(T.get("season"))), [Qe, I] = u(null), [$e, et] = u({}), L = Ye || P[0]?.id || "", R = ie(w?.id), z = l(() => (R.data ?? []).filter((e) => e.ownerId === w?.id), [R.data, w?.id]), B = Ue || z[0]?.id || "", V = me(), H = _e(25), U = ye(), W = he(), G = ge(), K = ve(), q = ee(), J = re(), Y = ae(), X = ne(), Z = U.data && U.data.provenance.decisionId !== He ? U.data : null, Q = l(() => Z ? ue(Z) : [], [Z]), tt = !!V.data?.exhausted || U.isError && a(U.error) || W.isError && a(W.error) || G.isError && a(G.error) || K.isError && a(K.error), nt = (e) => {
74
+ Re(e);
75
+ let t = new URLSearchParams(T);
76
+ t.set("tab", e), Le(t, { replace: !0 });
77
+ }, $ = () => {
78
+ Ie ? Ie("/ai") : window.location.assign("/ai");
79
+ }, rt = () => {
80
+ A(null), j(null), qe(null), M(!1), U.mutate({
81
+ occasion: D,
82
+ weatherHint: O === "NONE" ? void 0 : O,
83
+ includeCatalogGapPieces: k
84
+ });
85
+ }, it = async () => {
86
+ if (Z && B && Q.length !== 0) {
87
+ j(null);
88
+ for (let e of Q) await q.mutateAsync({
89
+ lookbookId: B,
90
+ styleItemId: e,
91
+ note: `${Z.draftTitle} (decision ${Z.provenance.decisionId.slice(0, 8)})`
92
+ });
93
+ j(`Added ${Q.length} piece(s) to lookbook. You can remove entries anytime from Lookbooks.`);
94
+ }
95
+ }, at = async () => {
96
+ if (!Z || Q.length === 0) return;
97
+ let e = await J.mutateAsync({
98
+ title: Z.draftTitle,
99
+ caption: Z.summary,
100
+ occasion: Z.occasion,
101
+ visibility: "PUBLIC",
102
+ items: Q.map((e, t) => ({
103
+ styleItemId: e,
104
+ position: t
105
+ }))
106
+ }), t = await Y.mutateAsync(e.id);
107
+ qe(t.id), M(!1);
108
+ }, ot = (e) => {
109
+ X.mutate({
110
+ brandId: e.draft.brandId,
111
+ creatorId: e.draft.creatorId,
112
+ title: e.draft.title,
113
+ brief: e.draft.brief,
114
+ role: e.draft.role
115
+ }, { onSuccess: (t) => {
116
+ et((n) => ({
117
+ ...n,
118
+ [e.creatorId]: t.id
119
+ })), I(null);
120
+ } });
121
+ }, st = l(() => (W.data?.findings ?? []).filter((e) => pe(e.kind)), [W.data]), ct = l(() => (W.data?.findings ?? []).filter((e) => !pe(e.kind)), [W.data]);
122
+ return /* @__PURE__ */ y(e, {
123
+ title: S("coolandlovely.page.intelligenceTitle", "Style Intelligence"),
124
+ description: S("coolandlovely.page.intelligenceSubtitle", "Grounded outfit composition, wardrobe gap & re-wear analysis, seasonal drop curation and creator matching — always advisory until you accept."),
125
+ actions: /* @__PURE__ */ y("div", {
126
+ className: "flex flex-wrap items-center gap-2",
127
+ children: [V.data && /* @__PURE__ */ y("span", {
128
+ className: o("inline-flex items-center gap-1.5 rounded-full border border-border-seam px-3 py-1.5 text-xs font-medium tabular-nums", V.data.exhausted ? "bg-status-error-bg-subtle text-status-error-text" : "bg-bg-sunken text-text-primary"),
129
+ title: `Quota: ${V.data.quotaName}`,
130
+ children: [/* @__PURE__ */ v(De, { className: "h-3.5 w-3.5" }), V.data.noLimit ? "AI credits: Unlimited" : V.data.remaining === null ? `${V.data.used.toLocaleString()} AI credits used` : `${V.data.remaining.toLocaleString()} AI credits left`]
131
+ }), /* @__PURE__ */ y("button", {
132
+ type: "button",
133
+ onClick: $,
134
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
135
+ children: ["AI Operations & Models ", /* @__PURE__ */ v(we, { className: "h-3.5 w-3.5" })]
136
+ })]
137
+ }),
138
+ children: [
139
+ tt && /* @__PURE__ */ y("div", {
140
+ role: "alert",
141
+ className: "mb-6 flex flex-wrap items-start justify-between gap-3 rounded-xl border border-border-seam bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
142
+ children: [/* @__PURE__ */ y("div", {
143
+ className: "flex items-start gap-2.5",
144
+ children: [/* @__PURE__ */ v(d, { className: "mt-0.5 h-5 w-5 shrink-0" }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
145
+ className: "font-semibold",
146
+ children: "AI quota reached for this billing cycle"
147
+ }), /* @__PURE__ */ v("p", {
148
+ className: "mt-0.5 text-xs text-text-primary",
149
+ children: "Automated styling and merchandising decisions are paused until your workspace budget resets or is upgraded. Every manual wardrobe, lookbook, collection and collaboration workflow remains open."
150
+ })] })]
151
+ }), /* @__PURE__ */ v("button", {
152
+ type: "button",
153
+ onClick: $,
154
+ className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
155
+ children: "Review AI usage"
156
+ })]
157
+ }),
158
+ /* @__PURE__ */ v("div", {
159
+ role: "tablist",
160
+ "aria-label": "Style Intelligence views",
161
+ className: "mb-6 flex flex-wrap items-center gap-2 border-b border-border-seam pb-3",
162
+ children: [
163
+ {
164
+ id: "shopper",
165
+ label: "Shopper Styling",
166
+ icon: g
167
+ },
168
+ {
169
+ id: "brand",
170
+ label: "Brand Merchandising",
171
+ icon: Oe
172
+ },
173
+ {
174
+ id: "activity",
175
+ label: "AI Decision Provenance",
176
+ icon: m
177
+ }
178
+ ].map((e) => {
179
+ let t = e.icon, n = E === e.id;
180
+ return /* @__PURE__ */ y("button", {
181
+ role: "tab",
182
+ type: "button",
183
+ "aria-selected": n,
184
+ onClick: () => nt(e.id),
185
+ className: o("inline-flex items-center gap-2 rounded-lg px-3.5 py-2 text-sm font-medium transition-colors", n ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
186
+ children: [/* @__PURE__ */ v(t, { className: "h-4 w-4" }), e.label]
187
+ }, e.id);
188
+ })
189
+ }),
190
+ E === "shopper" && /* @__PURE__ */ y("div", {
191
+ className: "space-y-6",
192
+ children: [/* @__PURE__ */ y(b, {
193
+ treatment: "plain",
194
+ className: "p-5",
195
+ children: [
196
+ /* @__PURE__ */ y("div", {
197
+ className: "flex flex-wrap items-start justify-between gap-3",
198
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("h2", {
199
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary",
200
+ children: [/* @__PURE__ */ v(_, { className: "h-4 w-4" }), " Outfit Composer"]
201
+ }), /* @__PURE__ */ v("p", {
202
+ className: "mt-0.5 text-xs text-text-secondary",
203
+ children: "Builds a draft outfit from your own wardrobe (respecting your style profile sizes and palette) with optional catalog pieces for missing slots. Nothing is saved until you accept."
204
+ })] }), U.isPending && /* @__PURE__ */ y("button", {
205
+ type: "button",
206
+ onClick: () => U.reset(),
207
+ className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
208
+ children: [/* @__PURE__ */ v(ke, { className: "h-3.5 w-3.5" }), " Cancel"]
209
+ })]
210
+ }),
211
+ /* @__PURE__ */ y("div", {
212
+ className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-4",
213
+ children: [
214
+ /* @__PURE__ */ y("label", {
215
+ className: "block text-xs font-medium text-text-secondary",
216
+ children: ["Occasion", /* @__PURE__ */ v("select", {
217
+ value: D,
218
+ onChange: (e) => ze(e.target.value),
219
+ className: "mt-1 block w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary",
220
+ children: Me.map((e) => /* @__PURE__ */ v("option", {
221
+ value: e,
222
+ children: c(e)
223
+ }, e))
224
+ })]
225
+ }),
226
+ /* @__PURE__ */ y("label", {
227
+ className: "block text-xs font-medium text-text-secondary",
228
+ children: ["Weather hint", /* @__PURE__ */ v("select", {
229
+ value: O,
230
+ onChange: (e) => Be(e.target.value),
231
+ className: "mt-1 block w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary",
232
+ children: Ne.map((e) => /* @__PURE__ */ v("option", {
233
+ value: e.value,
234
+ children: e.label
235
+ }, e.value))
236
+ })]
237
+ }),
238
+ /* @__PURE__ */ y("label", {
239
+ className: "flex items-center gap-2 self-end pb-2 text-xs font-medium text-text-primary",
240
+ children: [/* @__PURE__ */ v("input", {
241
+ type: "checkbox",
242
+ checked: k,
243
+ onChange: (e) => Ve(e.target.checked),
244
+ className: "h-4 w-4 rounded border-border-seam"
245
+ }), "Fill gaps from active catalog"]
246
+ }),
247
+ /* @__PURE__ */ v("div", {
248
+ className: "flex items-end",
249
+ children: /* @__PURE__ */ y("button", {
250
+ type: "button",
251
+ disabled: U.isPending,
252
+ onClick: rt,
253
+ className: "inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
254
+ children: [U.isPending ? /* @__PURE__ */ v(h, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(_, { className: "h-4 w-4" }), "Suggest outfit"]
255
+ })
256
+ })
257
+ ]
258
+ }),
259
+ U.isError && !a(U.error) && /* @__PURE__ */ y("div", {
260
+ role: "status",
261
+ className: "mt-4 rounded-lg border border-border-seam bg-bg-sunken p-3 text-xs text-text-secondary",
262
+ children: [/* @__PURE__ */ v("p", {
263
+ className: "font-medium text-text-primary",
264
+ children: "Outfit suggestions are temporarily unavailable."
265
+ }), /* @__PURE__ */ y("p", {
266
+ className: "mt-1",
267
+ children: [
268
+ "You can still compose outfits manually in",
269
+ " ",
270
+ /* @__PURE__ */ v("button", {
271
+ type: "button",
272
+ onClick: () => C("/wardrobe"),
273
+ className: "underline text-text-primary",
274
+ children: "My Wardrobe"
275
+ }),
276
+ " ",
277
+ "or",
278
+ " ",
279
+ /* @__PURE__ */ v("button", {
280
+ type: "button",
281
+ onClick: () => C("/looks/new"),
282
+ className: "underline text-text-primary",
283
+ children: "Create Look"
284
+ }),
285
+ "."
286
+ ]
287
+ })]
288
+ }),
289
+ Z && /* @__PURE__ */ y("div", {
290
+ className: "mt-5 space-y-4 border-t border-border-seam pt-4",
291
+ children: [
292
+ /* @__PURE__ */ y("div", {
293
+ className: "flex flex-wrap items-start justify-between gap-3",
294
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
295
+ className: "text-base font-semibold text-text-primary",
296
+ children: Z.draftTitle
297
+ }), /* @__PURE__ */ v("p", {
298
+ className: "mt-0.5 text-sm text-text-secondary",
299
+ children: Z.summary
300
+ })] }), /* @__PURE__ */ y("div", {
301
+ className: "flex flex-wrap items-center gap-2",
302
+ children: [/* @__PURE__ */ y("span", {
303
+ className: "rounded-full bg-bg-sunken px-3 py-1 text-xs font-medium tabular-nums text-text-primary",
304
+ children: [Math.round(Z.confidence * 100), "% wardrobe coverage"]
305
+ }), /* @__PURE__ */ v(i, { provenance: Z.provenance })]
306
+ })]
307
+ }),
308
+ Z.pieces.length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("h4", {
309
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
310
+ children: [
311
+ "From your wardrobe (",
312
+ Z.pieces.length,
313
+ ")"
314
+ ]
315
+ }), /* @__PURE__ */ v("div", {
316
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
317
+ children: Z.pieces.map((e) => /* @__PURE__ */ y("div", {
318
+ className: "overflow-hidden rounded-lg border border-border-seam bg-bg-surface",
319
+ children: [/* @__PURE__ */ v(t, {
320
+ icon: /* @__PURE__ */ v(g, { className: "h-6 w-6" }),
321
+ fileId: e.wardrobeItem.image?.id,
322
+ alt: e.wardrobeItem.name,
323
+ seed: e.wardrobeItemId,
324
+ className: "aspect-[4/3] w-full"
325
+ }), /* @__PURE__ */ y("div", {
326
+ className: "p-3",
327
+ children: [
328
+ /* @__PURE__ */ y("div", {
329
+ className: "flex items-center justify-between gap-2 text-[11px] text-text-secondary",
330
+ children: [/* @__PURE__ */ v("span", {
331
+ className: "font-semibold uppercase text-text-primary",
332
+ children: c(e.slot)
333
+ }), /* @__PURE__ */ y("span", {
334
+ className: "tabular-nums",
335
+ children: ["Score ", Math.round(e.score * 100)]
336
+ })]
337
+ }),
338
+ /* @__PURE__ */ v("p", {
339
+ className: "mt-1 truncate text-sm font-medium text-text-primary",
340
+ children: e.wardrobeItem.name
341
+ }),
342
+ e.reasons.length > 0 && /* @__PURE__ */ v("p", {
343
+ className: "mt-1 line-clamp-2 text-xs text-text-secondary",
344
+ children: e.reasons[0]?.message
345
+ })
346
+ ]
347
+ })]
348
+ }, `${e.slot}-${e.wardrobeItemId}`))
349
+ })] }),
350
+ Z.gapPieces.length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("h4", {
351
+ className: "mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
352
+ children: [
353
+ "Suggested catalog pieces to complete the look (",
354
+ Z.gapPieces.length,
355
+ ")"
356
+ ]
357
+ }), /* @__PURE__ */ v("div", {
358
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
359
+ children: Z.gapPieces.map((e) => /* @__PURE__ */ y("button", {
360
+ type: "button",
361
+ onClick: () => C(`/items/${e.styleItemId}`),
362
+ className: "overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-colors hover:bg-bg-sunken/40",
363
+ children: [/* @__PURE__ */ v(t, {
364
+ icon: /* @__PURE__ */ v(g, { className: "h-6 w-6" }),
365
+ fileId: e.styleItem.image?.id,
366
+ alt: e.styleItem.name,
367
+ seed: e.styleItemId,
368
+ className: "aspect-[4/3] w-full"
369
+ }), /* @__PURE__ */ y("div", {
370
+ className: "p-3",
371
+ children: [
372
+ /* @__PURE__ */ y("div", {
373
+ className: "flex items-center justify-between gap-2 text-[11px] text-text-secondary",
374
+ children: [/* @__PURE__ */ v("span", {
375
+ className: "font-semibold uppercase text-text-primary",
376
+ children: c(e.slot)
377
+ }), /* @__PURE__ */ v("span", {
378
+ className: "tabular-nums",
379
+ children: s(e.styleItem.price, e.styleItem.currency)
380
+ })]
381
+ }),
382
+ /* @__PURE__ */ v("p", {
383
+ className: "mt-1 truncate text-sm font-medium text-text-primary",
384
+ children: e.styleItem.name
385
+ }),
386
+ e.reasons[0] && /* @__PURE__ */ v("p", {
387
+ className: "mt-1 line-clamp-2 text-xs text-text-secondary",
388
+ children: e.reasons[0].message
389
+ })
390
+ ]
391
+ })]
392
+ }, `${e.slot}-${e.styleItemId}`))
393
+ })] }),
394
+ /* @__PURE__ */ y("div", {
395
+ className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border-seam bg-bg-sunken/60 p-3",
396
+ children: [/* @__PURE__ */ y("div", {
397
+ className: "flex flex-wrap items-center gap-2",
398
+ children: [
399
+ Q.length > 0 && z.length > 0 ? /* @__PURE__ */ y(je, { children: [/* @__PURE__ */ v("select", {
400
+ "aria-label": "Target lookbook",
401
+ value: B,
402
+ onChange: (e) => We(e.target.value),
403
+ className: "rounded-lg border border-border-seam bg-bg-surface px-2.5 py-1.5 text-xs text-text-primary",
404
+ children: z.map((e) => /* @__PURE__ */ v("option", {
405
+ value: e.id,
406
+ children: e.name
407
+ }, e.id))
408
+ }), /* @__PURE__ */ y("button", {
409
+ type: "button",
410
+ disabled: q.isPending,
411
+ onClick: () => void it(),
412
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
413
+ children: [q.isPending ? /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ v(Ce, { className: "h-3.5 w-3.5" }), "Accept into lookbook"]
414
+ })] }) : /* @__PURE__ */ y("button", {
415
+ type: "button",
416
+ onClick: () => C("/lookbooks"),
417
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
418
+ children: [/* @__PURE__ */ v(Ce, { className: "h-3.5 w-3.5" }), " Manage lookbooks"]
419
+ }),
420
+ Q.length > 0 && !N && /* @__PURE__ */ v("button", {
421
+ type: "button",
422
+ onClick: () => M(!0),
423
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90",
424
+ children: "Publish as look…"
425
+ }),
426
+ N && /* @__PURE__ */ y("button", {
427
+ type: "button",
428
+ onClick: () => C(`/looks/${N}`),
429
+ className: "inline-flex items-center gap-1 text-xs font-medium text-status-success-text underline",
430
+ children: [/* @__PURE__ */ v(f, { className: "h-3.5 w-3.5" }), " Look published — open look"]
431
+ })
432
+ ]
433
+ }), /* @__PURE__ */ y("button", {
434
+ type: "button",
435
+ onClick: () => A(Z.provenance.decisionId),
436
+ className: "inline-flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-medium text-text-secondary hover:text-text-primary",
437
+ children: [/* @__PURE__ */ v(ke, { className: "h-3.5 w-3.5" }), " Dismiss proposal"]
438
+ })]
439
+ }),
440
+ Ke && /* @__PURE__ */ y("div", {
441
+ role: "dialog",
442
+ "aria-label": "Confirm publish look",
443
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4",
444
+ children: [
445
+ /* @__PURE__ */ y("p", {
446
+ className: "text-sm font-semibold text-text-primary",
447
+ children: [
448
+ "Confirm publishing “",
449
+ Z.draftTitle,
450
+ "”?"
451
+ ]
452
+ }),
453
+ /* @__PURE__ */ y("p", {
454
+ className: "mt-1 text-xs text-text-secondary",
455
+ children: [
456
+ "This creates a PUBLIC look citing ",
457
+ Q.length,
458
+ " catalog piece(s) and publishes it to the workspace feed. Deleting a published look later is irreversible (soft-deleted for audit)."
459
+ ]
460
+ }),
461
+ /* @__PURE__ */ y("div", {
462
+ className: "mt-3 flex items-center gap-2",
463
+ children: [/* @__PURE__ */ y("button", {
464
+ type: "button",
465
+ disabled: J.isPending || Y.isPending,
466
+ onClick: () => void at(),
467
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text disabled:opacity-50",
468
+ children: [(J.isPending || Y.isPending) && /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 animate-spin" }), "Confirm & publish look"]
469
+ }), /* @__PURE__ */ v("button", {
470
+ type: "button",
471
+ onClick: () => M(!1),
472
+ className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
473
+ children: "Cancel"
474
+ })]
475
+ })
476
+ ]
477
+ }),
478
+ Ge && /* @__PURE__ */ v("p", {
479
+ className: "text-xs text-status-success-text",
480
+ children: Ge
481
+ }),
482
+ (q.isError || J.isError || Y.isError) && /* @__PURE__ */ v("p", {
483
+ className: "text-xs text-status-error-text",
484
+ children: "Could not complete the accept action. You can create looks or lookbook entries directly from Looks or Lookbooks."
485
+ })
486
+ ]
487
+ })
488
+ ]
489
+ }), /* @__PURE__ */ y(b, {
490
+ treatment: "plain",
491
+ className: "p-5",
492
+ children: [
493
+ /* @__PURE__ */ y("div", {
494
+ className: "flex flex-wrap items-center justify-between gap-3",
495
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
496
+ className: "text-base font-semibold text-text-primary",
497
+ children: "Wardrobe gaps & re-wear nudges"
498
+ }), /* @__PURE__ */ v("p", {
499
+ className: "mt-0.5 text-xs text-text-secondary",
500
+ children: "Ranked findings over your owned pieces, wear log and palette preferences."
501
+ })] }), /* @__PURE__ */ y("button", {
502
+ type: "button",
503
+ disabled: W.isPending,
504
+ onClick: () => W.mutate(),
505
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
506
+ children: [W.isPending ? /* @__PURE__ */ v(h, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(_, { className: "h-4 w-4" }), "Analyze wardrobe"]
507
+ })]
508
+ }),
509
+ W.isError && !a(W.error) && /* @__PURE__ */ y("p", {
510
+ role: "status",
511
+ className: "mt-3 text-xs text-text-secondary",
512
+ children: [
513
+ "Wardrobe gap analysis is temporarily unavailable. Manage your pieces directly in",
514
+ " ",
515
+ /* @__PURE__ */ v("button", {
516
+ type: "button",
517
+ onClick: () => C("/wardrobe"),
518
+ className: "underline text-text-primary",
519
+ children: "My Wardrobe"
520
+ }),
521
+ "."
522
+ ]
523
+ }),
524
+ W.data && /* @__PURE__ */ y("div", {
525
+ className: "mt-4 space-y-4 border-t border-border-seam pt-4",
526
+ children: [/* @__PURE__ */ y("div", {
527
+ className: "flex flex-wrap items-center justify-between gap-2",
528
+ children: [/* @__PURE__ */ y("p", {
529
+ className: "text-xs text-text-secondary",
530
+ children: [
531
+ "Analysed",
532
+ " ",
533
+ /* @__PURE__ */ v("strong", {
534
+ className: "text-text-primary",
535
+ children: W.data.wardrobeItemCount
536
+ }),
537
+ " ",
538
+ "owned pieces ·",
539
+ " ",
540
+ /* @__PURE__ */ v("strong", {
541
+ className: "text-text-primary",
542
+ children: st.length
543
+ }),
544
+ " re-wear nudges · ",
545
+ /* @__PURE__ */ v("strong", {
546
+ className: "text-text-primary",
547
+ children: ct.length
548
+ }),
549
+ " ",
550
+ "coverage gaps"
551
+ ]
552
+ }), /* @__PURE__ */ v(i, { provenance: W.data.provenance })]
553
+ }), W.data.findings.length === 0 ? /* @__PURE__ */ v("p", {
554
+ className: "text-sm text-text-secondary",
555
+ children: "Your wardrobe covers all core occasions with no dormant pieces flagged."
556
+ }) : /* @__PURE__ */ v("div", {
557
+ className: "grid grid-cols-1 gap-3 md:grid-cols-2",
558
+ children: W.data.findings.map((e, t) => /* @__PURE__ */ y("div", {
559
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4",
560
+ children: [
561
+ /* @__PURE__ */ y("div", {
562
+ className: "flex items-center justify-between gap-2",
563
+ children: [/* @__PURE__ */ v("span", {
564
+ className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-primary",
565
+ children: fe(e.kind)
566
+ }), /* @__PURE__ */ y("span", {
567
+ className: "text-xs tabular-nums text-text-secondary",
568
+ children: [
569
+ "Severity ",
570
+ Math.round(e.severity * 100),
571
+ "%"
572
+ ]
573
+ })]
574
+ }),
575
+ /* @__PURE__ */ v("h3", {
576
+ className: "mt-2 text-sm font-semibold text-text-primary",
577
+ children: e.title
578
+ }),
579
+ /* @__PURE__ */ v("p", {
580
+ className: "mt-1 text-xs text-text-secondary",
581
+ children: e.detail
582
+ }),
583
+ /* @__PURE__ */ y("div", {
584
+ className: "mt-3 flex flex-wrap items-center gap-3",
585
+ children: [e.suggestedStyleItemIds.slice(0, 2).map((e, t) => /* @__PURE__ */ y("button", {
586
+ type: "button",
587
+ onClick: () => C(`/items/${e}`),
588
+ className: "inline-flex items-center gap-1 text-xs font-medium text-text-primary underline",
589
+ children: [
590
+ "Suggested piece #",
591
+ t + 1,
592
+ " ",
593
+ /* @__PURE__ */ v(Se, { className: "h-3 w-3" })
594
+ ]
595
+ }, e)), e.wardrobeItemIds.length > 0 && /* @__PURE__ */ y("button", {
596
+ type: "button",
597
+ onClick: () => C("/wardrobe"),
598
+ className: "inline-flex items-center gap-1 text-xs font-medium text-text-secondary underline hover:text-text-primary",
599
+ children: [
600
+ "Open wardrobe (",
601
+ e.wardrobeItemIds.length,
602
+ ")"
603
+ ]
604
+ })]
605
+ })
606
+ ]
607
+ }, `${e.kind}-${e.title}-${t}`))
608
+ })]
609
+ })
610
+ ]
611
+ })]
612
+ }),
613
+ E === "brand" && /* @__PURE__ */ y("div", {
614
+ className: "space-y-6",
615
+ children: [
616
+ /* @__PURE__ */ v(b, {
617
+ treatment: "plain",
618
+ className: "p-5",
619
+ children: /* @__PURE__ */ y("div", {
620
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
621
+ children: [
622
+ /* @__PURE__ */ y("label", {
623
+ className: "block text-xs font-medium text-text-secondary",
624
+ children: ["Brand storefront", /* @__PURE__ */ v("select", {
625
+ value: L,
626
+ onChange: (e) => Xe(e.target.value),
627
+ className: "mt-1 block w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary",
628
+ children: P.length === 0 ? /* @__PURE__ */ v("option", {
629
+ value: "",
630
+ children: "No brands in workspace"
631
+ }) : P.map((e) => /* @__PURE__ */ y("option", {
632
+ value: e.id,
633
+ children: [
634
+ e.name,
635
+ " (",
636
+ c(e.status),
637
+ ")"
638
+ ]
639
+ }, e.id))
640
+ })]
641
+ }),
642
+ /* @__PURE__ */ y("label", {
643
+ className: "block text-xs font-medium text-text-secondary",
644
+ children: ["Target season", /* @__PURE__ */ v("select", {
645
+ value: F,
646
+ onChange: (e) => Ze(e.target.value),
647
+ className: "mt-1 block w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary",
648
+ children: x.map((e) => /* @__PURE__ */ v("option", {
649
+ value: e,
650
+ children: c(e)
651
+ }, e))
652
+ })]
653
+ }),
654
+ /* @__PURE__ */ y("div", {
655
+ className: "flex flex-wrap items-end gap-2",
656
+ children: [/* @__PURE__ */ y("button", {
657
+ type: "button",
658
+ disabled: !L || G.isPending,
659
+ onClick: () => L && G.mutate({
660
+ brandId: L,
661
+ season: F
662
+ }),
663
+ className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
664
+ children: [G.isPending ? /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ v(Te, { className: "h-3.5 w-3.5" }), "Curate drop"]
665
+ }), /* @__PURE__ */ y("button", {
666
+ type: "button",
667
+ disabled: !L || K.isPending,
668
+ onClick: () => L && K.mutate({
669
+ brandId: L,
670
+ limit: 5
671
+ }),
672
+ className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
673
+ children: [K.isPending ? /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ v(p, { className: "h-3.5 w-3.5" }), "Match creators"]
674
+ })]
675
+ })
676
+ ]
677
+ })
678
+ }),
679
+ /* @__PURE__ */ y(b, {
680
+ treatment: "plain",
681
+ className: "p-5",
682
+ children: [
683
+ /* @__PURE__ */ v("h2", {
684
+ className: "text-base font-semibold text-text-primary",
685
+ children: "Collection curation & publish blockers"
686
+ }),
687
+ /* @__PURE__ */ v("p", {
688
+ className: "mt-0.5 text-xs text-text-secondary",
689
+ children: "Evaluates DRAFT style items for seasonal coherence and flags missing images, SKUs, colourways, sizes or pricing before a drop goes live."
690
+ }),
691
+ G.isError && !a(G.error) && /* @__PURE__ */ y("p", {
692
+ role: "status",
693
+ className: "mt-3 text-xs text-text-secondary",
694
+ children: [
695
+ "Collection curation is temporarily unavailable. Review items manually in",
696
+ " ",
697
+ /* @__PURE__ */ v("button", {
698
+ type: "button",
699
+ onClick: () => C("/collections"),
700
+ className: "underline text-text-primary",
701
+ children: "Collections"
702
+ }),
703
+ "."
704
+ ]
705
+ }),
706
+ G.data && /* @__PURE__ */ y("div", {
707
+ className: "mt-4 space-y-4 border-t border-border-seam pt-4",
708
+ children: [/* @__PURE__ */ y("div", {
709
+ className: "flex flex-wrap items-center justify-between gap-2",
710
+ children: [/* @__PURE__ */ y("div", {
711
+ className: "flex flex-wrap items-center gap-3 text-xs text-text-secondary",
712
+ children: [
713
+ /* @__PURE__ */ y("span", { children: [
714
+ /* @__PURE__ */ v("strong", {
715
+ className: "text-text-primary",
716
+ children: G.data.proposed.length
717
+ }),
718
+ " ",
719
+ "proposed"
720
+ ] }),
721
+ /* @__PURE__ */ y("span", { children: [
722
+ /* @__PURE__ */ v("strong", {
723
+ className: "text-text-primary",
724
+ children: G.data.blockedCount
725
+ }),
726
+ " ",
727
+ "with blockers"
728
+ ] }),
729
+ /* @__PURE__ */ y("span", { children: [
730
+ /* @__PURE__ */ v("strong", {
731
+ className: "text-text-primary",
732
+ children: G.data.outliers.length
733
+ }),
734
+ " ",
735
+ "outliers"
736
+ ] }),
737
+ G.data.storyPalette.length > 0 && /* @__PURE__ */ v(n, {
738
+ colours: G.data.storyPalette,
739
+ max: 6
740
+ })
741
+ ]
742
+ }), /* @__PURE__ */ v(i, { provenance: G.data.provenance })]
743
+ }), G.data.proposed.length === 0 ? /* @__PURE__ */ v("p", {
744
+ className: "text-sm text-text-secondary",
745
+ children: "No DRAFT pieces found for this brand to curate."
746
+ }) : /* @__PURE__ */ v("div", {
747
+ className: "space-y-2.5",
748
+ children: G.data.proposed.map((e) => /* @__PURE__ */ y("div", {
749
+ className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border-seam bg-bg-surface p-3",
750
+ children: [/* @__PURE__ */ y("div", {
751
+ className: "flex min-w-0 items-center gap-3",
752
+ children: [/* @__PURE__ */ v(t, {
753
+ icon: /* @__PURE__ */ v(g, { className: "h-5 w-5" }),
754
+ fileId: e.styleItem.image?.id,
755
+ alt: e.styleItem.name,
756
+ seed: e.styleItemId,
757
+ className: "h-12 w-12 shrink-0 rounded-md"
758
+ }), /* @__PURE__ */ y("div", {
759
+ className: "min-w-0",
760
+ children: [
761
+ /* @__PURE__ */ y("p", {
762
+ className: "truncate text-sm font-medium text-text-primary",
763
+ children: [e.position === null ? "" : `#${e.position + 1} · `, e.styleItem.name]
764
+ }),
765
+ /* @__PURE__ */ y("p", {
766
+ className: "text-xs text-text-secondary tabular-nums",
767
+ children: [
768
+ "Coherence ",
769
+ Math.round(e.coherence * 100),
770
+ "% ·",
771
+ " ",
772
+ s(e.styleItem.price, e.styleItem.currency)
773
+ ]
774
+ }),
775
+ e.blockers.length > 0 && /* @__PURE__ */ v("div", {
776
+ className: "mt-1 flex flex-wrap gap-1.5",
777
+ children: e.blockers.map((e) => /* @__PURE__ */ y("span", {
778
+ className: "inline-flex items-center gap-1 rounded-full bg-status-error-bg-subtle px-2 py-0.5 text-[11px] font-medium text-status-error-text",
779
+ children: [/* @__PURE__ */ v(d, { className: "h-3 w-3" }), de(e.code)]
780
+ }, e.code))
781
+ })
782
+ ]
783
+ })]
784
+ }), /* @__PURE__ */ v("button", {
785
+ type: "button",
786
+ onClick: () => C(`/items/${e.styleItemId}/edit`),
787
+ className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
788
+ children: e.blockers.length > 0 ? "Fix blockers" : "Edit piece"
789
+ })]
790
+ }, e.styleItemId))
791
+ })]
792
+ })
793
+ ]
794
+ }),
795
+ /* @__PURE__ */ y(b, {
796
+ treatment: "plain",
797
+ className: "p-5",
798
+ children: [
799
+ /* @__PURE__ */ v("h2", {
800
+ className: "text-base font-semibold text-text-primary",
801
+ children: "Creator collaboration matches"
802
+ }),
803
+ /* @__PURE__ */ v("p", {
804
+ className: "mt-0.5 text-xs text-text-secondary",
805
+ children: "Creators ranked by aesthetic overlap with this brand's published catalog. Every match drafts a PROPOSED brief for your review."
806
+ }),
807
+ K.isError && !a(K.error) && /* @__PURE__ */ y("p", {
808
+ role: "status",
809
+ className: "mt-3 text-xs text-text-secondary",
810
+ children: [
811
+ "Creator matching is temporarily unavailable. Create proposals manually in",
812
+ " ",
813
+ /* @__PURE__ */ v("button", {
814
+ type: "button",
815
+ onClick: () => C("/collaborations/new"),
816
+ className: "underline text-text-primary",
817
+ children: "Collaborations"
818
+ }),
819
+ "."
820
+ ]
821
+ }),
822
+ K.data && /* @__PURE__ */ y("div", {
823
+ className: "mt-4 space-y-4 border-t border-border-seam pt-4",
824
+ children: [/* @__PURE__ */ y("div", {
825
+ className: "flex flex-wrap items-center justify-between gap-2",
826
+ children: [/* @__PURE__ */ y("p", {
827
+ className: "text-xs text-text-secondary",
828
+ children: [
829
+ /* @__PURE__ */ v("strong", {
830
+ className: "text-text-primary",
831
+ children: K.data.matches.length
832
+ }),
833
+ " ",
834
+ "candidate(s) ·",
835
+ " ",
836
+ /* @__PURE__ */ v("strong", {
837
+ className: "text-text-primary",
838
+ children: K.data.excludedCreatorIds.length
839
+ }),
840
+ " ",
841
+ "skipped with open collaborations"
842
+ ]
843
+ }), /* @__PURE__ */ v(i, { provenance: K.data.provenance })]
844
+ }), K.data.matches.length === 0 ? /* @__PURE__ */ v("p", {
845
+ className: "text-sm text-text-secondary",
846
+ children: "No new creator matches right now. Publish active style items and public looks to generate aesthetic overlap evidence."
847
+ }) : /* @__PURE__ */ v("div", {
848
+ className: "grid grid-cols-1 gap-3 md:grid-cols-2",
849
+ children: K.data.matches.map((e) => {
850
+ let t = $e[e.creatorId], n = Qe === e.creatorId;
851
+ return /* @__PURE__ */ y("div", {
852
+ className: "rounded-lg border border-border-seam bg-bg-surface p-4",
853
+ children: [
854
+ /* @__PURE__ */ y("div", {
855
+ className: "flex items-center justify-between gap-2",
856
+ children: [/* @__PURE__ */ v("h3", {
857
+ className: "text-sm font-semibold text-text-primary",
858
+ children: /* @__PURE__ */ v(r, { id: e.creatorId })
859
+ }), /* @__PURE__ */ y("span", {
860
+ className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium tabular-nums text-text-primary",
861
+ children: [Math.round(e.fitScore * 100), "% fit"]
862
+ })]
863
+ }),
864
+ /* @__PURE__ */ v("p", {
865
+ className: "mt-1 text-xs font-medium text-text-primary",
866
+ children: e.draft.title
867
+ }),
868
+ /* @__PURE__ */ v("p", {
869
+ className: "mt-1 text-xs text-text-secondary",
870
+ children: e.draft.brief
871
+ }),
872
+ e.evidenceLookIds.length > 0 && /* @__PURE__ */ v("div", {
873
+ className: "mt-2 flex flex-wrap items-center gap-2",
874
+ children: e.evidenceLookIds.slice(0, 3).map((e, t) => /* @__PURE__ */ y("button", {
875
+ type: "button",
876
+ onClick: () => C(`/looks/${e}`),
877
+ className: "text-xs text-text-secondary underline hover:text-text-primary",
878
+ children: ["Evidence look #", t + 1]
879
+ }, e))
880
+ }),
881
+ /* @__PURE__ */ v("div", {
882
+ className: "mt-3",
883
+ children: t ? /* @__PURE__ */ y("button", {
884
+ type: "button",
885
+ onClick: () => C(`/collaborations/${t}`),
886
+ className: "inline-flex items-center gap-1 text-xs font-medium text-status-success-text underline",
887
+ children: [/* @__PURE__ */ v(f, { className: "h-3.5 w-3.5" }), " Collaboration proposed — view"]
888
+ }) : n ? /* @__PURE__ */ y("div", {
889
+ role: "dialog",
890
+ "aria-label": "Confirm propose collaboration",
891
+ className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken p-3",
892
+ children: [/* @__PURE__ */ y("p", {
893
+ className: "text-xs text-text-primary",
894
+ children: [
895
+ "Create a ",
896
+ /* @__PURE__ */ v("strong", { children: "PROPOSED" }),
897
+ " collaboration with this creator? Proposals can be edited or deleted before acceptance."
898
+ ]
899
+ }), /* @__PURE__ */ y("div", {
900
+ className: "flex items-center gap-2",
901
+ children: [/* @__PURE__ */ y("button", {
902
+ type: "button",
903
+ disabled: X.isPending,
904
+ onClick: () => ot(e),
905
+ className: "inline-flex items-center gap-1 rounded bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text disabled:opacity-50",
906
+ children: [X.isPending && /* @__PURE__ */ v(h, { className: "h-3 w-3 animate-spin" }), "Confirm propose"]
907
+ }), /* @__PURE__ */ v("button", {
908
+ type: "button",
909
+ onClick: () => I(null),
910
+ className: "rounded border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary",
911
+ children: "Cancel"
912
+ })]
913
+ })]
914
+ }) : /* @__PURE__ */ y("button", {
915
+ type: "button",
916
+ onClick: () => I(e.creatorId),
917
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
918
+ children: [/* @__PURE__ */ v(p, { className: "h-3.5 w-3.5" }), " Open as PROPOSED collaboration"]
919
+ })
920
+ })
921
+ ]
922
+ }, e.creatorId);
923
+ })
924
+ })]
925
+ })
926
+ ]
927
+ })
928
+ ]
929
+ }),
930
+ E === "activity" && /* @__PURE__ */ v("div", {
931
+ className: "space-y-4",
932
+ children: /* @__PURE__ */ y(b, {
933
+ treatment: "plain",
934
+ className: "p-5",
935
+ children: [/* @__PURE__ */ y("div", {
936
+ className: "flex flex-wrap items-center justify-between gap-3",
937
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("h2", {
938
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary",
939
+ children: [/* @__PURE__ */ v(m, { className: "h-4 w-4" }), " Recorded AI decisions"]
940
+ }), /* @__PURE__ */ v("p", {
941
+ className: "mt-0.5 text-xs text-text-secondary",
942
+ children: "Audit entries recorded in the workspace activity log (`coolandlovely-ai-decision`) keyed by each decision's provenance id. For model catalogs, workspace model routes and V2 invocation spend, open the shared AI Operations console."
943
+ })] }), /* @__PURE__ */ y("div", {
944
+ className: "flex items-center gap-2",
945
+ children: [/* @__PURE__ */ y("button", {
946
+ type: "button",
947
+ onClick: () => void H.refetch(),
948
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
949
+ children: [/* @__PURE__ */ v(Ee, { className: "h-3.5 w-3.5" }), " Refresh"]
950
+ }), /* @__PURE__ */ y("button", {
951
+ type: "button",
952
+ onClick: $,
953
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90",
954
+ children: ["Open shared AI Operations ", /* @__PURE__ */ v(we, { className: "h-3.5 w-3.5" })]
955
+ })]
956
+ })]
957
+ }), /* @__PURE__ */ v("div", {
958
+ className: "mt-4",
959
+ children: H.isLoading ? /* @__PURE__ */ y("p", {
960
+ className: "flex items-center gap-2 text-sm text-text-secondary",
961
+ children: [/* @__PURE__ */ v(h, { className: "h-4 w-4 animate-spin" }), " Loading recorded decisions…"]
962
+ }) : H.isError ? /* @__PURE__ */ y("p", {
963
+ className: "text-sm text-text-secondary",
964
+ children: [
965
+ "Decision audit entries could not be loaded (requires workspace",
966
+ " ",
967
+ /* @__PURE__ */ v("code", { children: "activity-log:read" }),
968
+ " permission)."
969
+ ]
970
+ }) : (H.data?.length ?? 0) === 0 ? /* @__PURE__ */ v("p", {
971
+ className: "text-sm text-text-secondary",
972
+ children: "No AI decisions recorded in this workspace yet. Run an outfit suggestion, wardrobe gap check, drop curation or creator match to record an auditable decision entry."
973
+ }) : /* @__PURE__ */ v("ul", {
974
+ className: "divide-y divide-border-seam",
975
+ children: (H.data ?? []).map((e) => /* @__PURE__ */ y("li", {
976
+ className: "flex flex-wrap items-start justify-between gap-3 py-3 first:pt-0",
977
+ children: [/* @__PURE__ */ y("div", {
978
+ className: "min-w-0",
979
+ children: [
980
+ /* @__PURE__ */ v("p", {
981
+ className: "text-sm font-medium text-text-primary",
982
+ children: se(e.action)
983
+ }),
984
+ /* @__PURE__ */ y("p", {
985
+ className: "mt-0.5 text-xs text-text-secondary",
986
+ children: [/* @__PURE__ */ v(r, { id: e.userId }), e.resourceId ? ` · decision ${e.resourceId.slice(0, 8)}` : ""]
987
+ }),
988
+ e.description && /* @__PURE__ */ v("p", {
989
+ className: "mt-0.5 text-xs text-text-secondary",
990
+ children: e.description
991
+ })
992
+ ]
993
+ }), /* @__PURE__ */ v("time", {
994
+ dateTime: e.timestamp,
995
+ title: be(e.timestamp),
996
+ className: "shrink-0 whitespace-nowrap text-xs text-text-secondary",
997
+ children: xe(e.timestamp)
998
+ })]
999
+ }, e.id))
1000
+ })
1001
+ })]
1002
+ })
1003
+ })
1004
+ ]
1005
+ });
1006
+ }
1007
+ export { S as StyleIntelligencePage };