@mushi-mushi/web 1.28.0 → 1.30.0

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, markPageUnloading, flushLastOutboundOnUnload, DEFAULT_API_ENDPOINT, shouldDropCapturedError, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, updateSessionIdentity, normaliseThrown, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
1
+ import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, trackPageView, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, initEventTracker, getSessionId, createBreadcrumbBuffer, sha256Hex, trackEvent, flushEvents, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, newUuid, markPageUnloading, flushLastOutboundOnUnload, DEFAULT_API_ENDPOINT, shouldDropCapturedError, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, getEventAnonymousId, setEventConsent, parseIdentityToken, updateSessionIdentity, updateEventIdentity, normaliseThrown, destroyEventTracker, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates } from '@mushi-mushi/core';
2
2
 
3
3
  // src/capture/compress-screenshot.ts
4
4
  async function compressScreenshotDataUrl(dataUrl, maxBytes = MAX_SCREENSHOT_DATA_URL_BYTES) {
@@ -35,6 +35,281 @@ function estimateDataUrlBytes(dataUrl) {
35
35
  const b64 = dataUrl.slice(comma + 1);
36
36
  return Math.ceil(b64.length * 3 / 4);
37
37
  }
38
+ var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
39
+ function loadAssistantSession() {
40
+ try {
41
+ if (typeof sessionStorage === "undefined") return null;
42
+ const raw = sessionStorage.getItem(ASSISTANT_SESSION_STORAGE_KEY);
43
+ if (!raw) return null;
44
+ const parsed = JSON.parse(raw);
45
+ if (!parsed || typeof parsed !== "object") return null;
46
+ const record = parsed;
47
+ const turns = Array.isArray(record.turns) ? record.turns : null;
48
+ if (!turns) return null;
49
+ const normalized = [];
50
+ for (const item of turns) {
51
+ if (!item || typeof item !== "object") continue;
52
+ const t = item;
53
+ if (t.role !== "user" && t.role !== "assistant") continue;
54
+ if (typeof t.text !== "string") continue;
55
+ const turn = { role: t.role, text: t.text };
56
+ if (Array.isArray(t.options)) {
57
+ const options = t.options.filter((o) => typeof o === "string");
58
+ if (options.length) turn.options = options;
59
+ }
60
+ if (t.offerReport === true) turn.offerReport = true;
61
+ normalized.push(turn);
62
+ }
63
+ const threadId = typeof record.threadId === "string" && record.threadId.length > 0 ? record.threadId : null;
64
+ return { turns: normalized, threadId };
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+ function saveAssistantSession(snapshot) {
70
+ try {
71
+ if (typeof sessionStorage === "undefined") return;
72
+ if (!snapshot.turns.length && !snapshot.threadId) {
73
+ sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
74
+ return;
75
+ }
76
+ sessionStorage.setItem(ASSISTANT_SESSION_STORAGE_KEY, JSON.stringify(snapshot));
77
+ } catch {
78
+ }
79
+ }
80
+ function clearAssistantSession() {
81
+ try {
82
+ if (typeof sessionStorage === "undefined") return;
83
+ sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
84
+ } catch {
85
+ }
86
+ }
87
+ var CATEGORY_ICONS = {
88
+ bug: "\u26A0\uFE0F",
89
+ slow: "\u{1F40C}",
90
+ visual: "\u{1F3A8}",
91
+ confusing: "\u{1F615}",
92
+ other: "\u{1F4DD}"
93
+ };
94
+ var FEATURE_REQUEST_INTENT = "Feature request";
95
+ function reporterStatusShort(status) {
96
+ switch (status) {
97
+ case "new":
98
+ case "queued":
99
+ case "pending":
100
+ case "submitted":
101
+ return "Sent";
102
+ case "classified":
103
+ case "triaged":
104
+ case "grouped":
105
+ case "dispatched":
106
+ return "Review";
107
+ case "fixing":
108
+ return "Fixing";
109
+ case "fixed":
110
+ case "resolved":
111
+ case "completed":
112
+ return "Fixed";
113
+ case "dismissed":
114
+ return "Closed";
115
+ default:
116
+ return status.replace(/_/g, " ").slice(0, 12);
117
+ }
118
+ }
119
+ function reporterStatusLabel(status) {
120
+ switch (status) {
121
+ case "new":
122
+ case "queued":
123
+ case "pending":
124
+ case "submitted":
125
+ return "Submitted";
126
+ case "classified":
127
+ case "triaged":
128
+ case "grouped":
129
+ case "dispatched":
130
+ return "In review";
131
+ case "fixing":
132
+ return "Fix in progress";
133
+ case "fixed":
134
+ case "resolved":
135
+ case "completed":
136
+ return "Fixed \u2014 confirm?";
137
+ case "verified":
138
+ return "Verified";
139
+ case "reopened":
140
+ return "Reopened";
141
+ case "dismissed":
142
+ return "Closed";
143
+ default:
144
+ return status.replace(/_/g, " ");
145
+ }
146
+ }
147
+ function reporterStatusTone(status) {
148
+ switch (status) {
149
+ case "new":
150
+ case "queued":
151
+ case "pending":
152
+ case "submitted":
153
+ return "sent";
154
+ case "classified":
155
+ case "triaged":
156
+ case "grouped":
157
+ case "dispatched":
158
+ return "review";
159
+ case "fixing":
160
+ return "fixing";
161
+ case "fixed":
162
+ case "resolved":
163
+ case "completed":
164
+ return "fixed";
165
+ case "verified":
166
+ return "fixed";
167
+ case "reopened":
168
+ return "fixing";
169
+ case "dismissed":
170
+ return "closed";
171
+ default:
172
+ return "unknown";
173
+ }
174
+ }
175
+ function formatRelativeTime(iso) {
176
+ const then = Date.parse(iso);
177
+ if (Number.isNaN(then)) return "";
178
+ const diffMs = Date.now() - then;
179
+ if (diffMs < 0) return "just now";
180
+ const sec = Math.floor(diffMs / 1e3);
181
+ if (sec < 60) return "just now";
182
+ const min = Math.floor(sec / 60);
183
+ if (min < 60) return `${min}m ago`;
184
+ const hr = Math.floor(min / 60);
185
+ if (hr < 24) return `${hr}h ago`;
186
+ const day = Math.floor(hr / 24);
187
+ if (day < 7) return `${day}d ago`;
188
+ const week = Math.floor(day / 7);
189
+ if (week < 5) return `${week}w ago`;
190
+ return new Date(then).toLocaleDateString(void 0, { month: "short", day: "numeric" });
191
+ }
192
+ function pad2(n) {
193
+ return n < 10 ? `0${n}` : String(n);
194
+ }
195
+ var BRAND_FOOTER_URL = "https://kensaur.us/mushi-mushi/";
196
+ var BRAND_FOOTER_UTM = "utm_source=widget&utm_medium=powered-by";
197
+ function buildBrandFooterHref(ref) {
198
+ const base = `${BRAND_FOOTER_URL}?${BRAND_FOOTER_UTM}`;
199
+ return ref && /^[0-9a-f]{6,64}$/.test(ref) ? `${base}&ref=${ref}` : base;
200
+ }
201
+ var TOTAL_STEPS = 3;
202
+ var STEP_NUMBER = {
203
+ category: 1,
204
+ intent: 2,
205
+ details: 3};
206
+ function isSubmitShortcut(e) {
207
+ return (e.metaKey || e.ctrlKey) && e.key === "Enter";
208
+ }
209
+ function submitShortcutKey(platform) {
210
+ return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318" : "Ctrl";
211
+ }
212
+ function readPlatform() {
213
+ if (typeof navigator === "undefined") return "";
214
+ const uaData = navigator.userAgentData;
215
+ return uaData?.platform || navigator.platform || navigator.userAgent || "";
216
+ }
217
+ function shouldShowSdkFreshness(mode, debug, loc) {
218
+ if (mode === "banner") return true;
219
+ if (mode === "console-only" || mode === "off") return false;
220
+ if (debug) return true;
221
+ if (!loc) return false;
222
+ const host = loc.hostname.replace(/^\[|\]$/g, "");
223
+ return loc.protocol === "file:" || host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "0.0.0.0" || host.endsWith(".localhost") || host.endsWith(".local");
224
+ }
225
+ function withDeadline(promise, ms) {
226
+ return new Promise((resolve, reject) => {
227
+ const timer = setTimeout(() => reject(new Error("Timed out")), ms);
228
+ promise.then(
229
+ (v) => {
230
+ clearTimeout(timer);
231
+ resolve(v);
232
+ },
233
+ (e) => {
234
+ clearTimeout(timer);
235
+ reject(e);
236
+ }
237
+ );
238
+ });
239
+ }
240
+ var REPORTER_READ_DEADLINE_MS = 15e3;
241
+ var DESCRIPTION_MAX_LENGTH = 4e3;
242
+ function charCounterText(value, minLen, neededCopy) {
243
+ const trimmed = value.trim().length;
244
+ return trimmed < minLen ? neededCopy.replace("{n}", String(minLen - trimmed)) : `${value.length}/${DESCRIPTION_MAX_LENGTH}`;
245
+ }
246
+ function formatReceiptTime(date, locale) {
247
+ const opts = {
248
+ month: "short",
249
+ day: "numeric",
250
+ hour: "2-digit",
251
+ minute: "2-digit",
252
+ timeZoneName: "short"
253
+ };
254
+ try {
255
+ return date.toLocaleString(locale, opts);
256
+ } catch {
257
+ return date.toLocaleString(void 0, opts);
258
+ }
259
+ }
260
+ function escapeHtml(value) {
261
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
262
+ }
263
+ function renderAppIconHtml(opts) {
264
+ const domain = opts.appDomain ?? resolveProjectDomain({
265
+ project_id: opts.projectId,
266
+ project_name: opts.appName,
267
+ project_slug: opts.appSlug ?? ""
268
+ });
269
+ const initials = escapeHtml(projectInitials(opts.appName));
270
+ const candidates = projectFaviconUrlCandidates({
271
+ project_id: opts.projectId,
272
+ project_name: opts.appName,
273
+ project_slug: opts.appSlug ?? "",
274
+ sdk_origin: opts.appDomain ? `https://${opts.appDomain}` : null
275
+ });
276
+ if (!candidates.length) {
277
+ return `<span class="mushi-app-icon mushi-app-icon-initials-only" aria-hidden="true">${initials}</span>`;
278
+ }
279
+ const encoded = escapeHtml(JSON.stringify(candidates));
280
+ return `<span class="mushi-app-icon" data-mushi-favicon data-candidates="${encoded}" data-initials="${initials}" aria-hidden="true" title="${escapeHtml(domain ?? opts.appName)}">
281
+ <img class="mushi-app-icon-img" src="${escapeHtml(candidates[0])}" alt="" referrerpolicy="no-referrer" width="16" height="16" />
282
+ <span class="mushi-app-icon-initials" hidden>${initials}</span>
283
+ </span>`;
284
+ }
285
+ function bindFaviconFallbacks(root) {
286
+ root.querySelectorAll("[data-mushi-favicon]").forEach((wrap) => {
287
+ const img = wrap.querySelector(".mushi-app-icon-img");
288
+ const fallback = wrap.querySelector(".mushi-app-icon-initials");
289
+ if (!img || !fallback) return;
290
+ let candidates = [];
291
+ try {
292
+ candidates = JSON.parse(wrap.dataset.candidates ?? "[]");
293
+ } catch {
294
+ candidates = [];
295
+ }
296
+ let index = 0;
297
+ const tryNext = () => {
298
+ index += 1;
299
+ if (index < candidates.length) {
300
+ img.src = candidates[index];
301
+ } else {
302
+ img.remove();
303
+ fallback.hidden = false;
304
+ wrap.classList.add("mushi-app-icon-initials-only");
305
+ }
306
+ };
307
+ img.onerror = tryNext;
308
+ img.onload = () => {
309
+ if (isLikelyGenericFavicon(img)) tryNext();
310
+ };
311
+ });
312
+ }
38
313
 
39
314
  // src/i18n/en.ts
40
315
  var en = {
@@ -92,10 +367,25 @@ var en = {
92
367
  step3: {
93
368
  heading: "Tell us more",
94
369
  descriptionPlaceholder: "Describe what happened\u2026",
370
+ featurePlaceholder: "Describe your idea\u2026",
371
+ featureExamples: ["Add a dark mode", "Export my data", "Keyboard shortcuts"],
372
+ otherPlaceholder: "What's on your mind?",
373
+ submitHint: "{key} + Enter to send",
374
+ charsNeeded: "{n} more characters",
95
375
  screenshotButton: "Attach Screenshot",
96
376
  screenshotAttached: "Screenshot attached \u2713",
97
377
  screenshotCapturing: "Taking screenshot\u2026",
98
378
  screenshotFailed: "Couldn't capture \u2014 describe it instead",
379
+ screenshotRetry: "Try again",
380
+ screenshotShareTab: "Share this tab instead",
381
+ screenshotErrors: {
382
+ permission: "Screen capture was blocked. Allow it, then try again.",
383
+ unsupported: "This browser can't capture the page. Describe it instead.",
384
+ taint: "Content from another site blocked the capture. Describe it instead.",
385
+ timeout: "Capture timed out.",
386
+ csp: "This site's security policy blocks screenshots.",
387
+ error: "Capture failed."
388
+ },
99
389
  screenshotPreviewAlt: "Preview of the screenshot that will be sent",
100
390
  screenshotSensitiveHint: "Check the preview \u2014 remove it if any private info (balances, personal details) is visible.",
101
391
  elementButton: "Select Element",
@@ -190,9 +480,13 @@ var en = {
190
480
  confirmFixed: "Yes, fixed for me",
191
481
  notFixed: "Not fixed yet",
192
482
  replyPlaceholder: "Reply to the developer\u2026",
193
- send: "Send"
483
+ send: "Send",
484
+ loadFailed: "Couldn't load this thread.",
485
+ retry: "Try again"
194
486
  },
195
487
  success: {
488
+ title: "Thanks \u2014 report received",
489
+ done: "Done",
196
490
  trackReport: "Track this report \u203A",
197
491
  receipt: "Receipt",
198
492
  delivering: "Delivering to the team\u2026",
@@ -222,7 +516,7 @@ var en = {
222
516
  changelog: {
223
517
  whatsNew: "What's new in {version}"
224
518
  },
225
- poweredBy: "Powered by Mushi v{version}"
519
+ poweredBy: "Bug reports by Mushi"
226
520
  }
227
521
  };
228
522
 
@@ -282,10 +576,25 @@ var ja = {
282
576
  step3: {
283
577
  heading: "\u8A73\u7D30\u3092\u6559\u3048\u3066\u304F\u3060\u3055\u3044",
284
578
  descriptionPlaceholder: "\u4F55\u304C\u8D77\u304D\u305F\u304B\u8AAC\u660E\u3057\u3066\u304F\u3060\u3055\u3044\u2026",
579
+ featurePlaceholder: "\u30A2\u30A4\u30C7\u30A2\u3092\u6559\u3048\u3066\u304F\u3060\u3055\u3044\u2026",
580
+ featureExamples: ["\u30C0\u30FC\u30AF\u30E2\u30FC\u30C9\u304C\u307B\u3057\u3044", "\u30C7\u30FC\u30BF\u3092\u66F8\u304D\u51FA\u3057\u305F\u3044", "\u30AD\u30FC\u30DC\u30FC\u30C9\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8"],
581
+ otherPlaceholder: "\u3069\u3093\u306A\u3053\u3068\u3067\u3082\u3069\u3046\u305E",
582
+ submitHint: "{key} + Enter \u3067\u9001\u4FE1",
583
+ charsNeeded: "\u3042\u3068{n}\u6587\u5B57",
285
584
  screenshotButton: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8",
286
585
  screenshotAttached: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u6DFB\u4ED8\u6E08\u307F \u2713",
287
586
  screenshotCapturing: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u64AE\u5F71\u4E2D\u2026",
288
587
  screenshotFailed: "\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F \u2014 \u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044",
588
+ screenshotRetry: "\u3082\u3046\u4E00\u5EA6",
589
+ screenshotShareTab: "\u3053\u306E\u30BF\u30D6\u3092\u5171\u6709\u3057\u3066\u64AE\u5F71",
590
+ screenshotErrors: {
591
+ permission: "\u753B\u9762\u306E\u53D6\u5F97\u304C\u30D6\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
592
+ unsupported: "\u3053\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u306F\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044\u3002",
593
+ taint: "\u5916\u90E8\u30B5\u30A4\u30C8\u306E\u5185\u5BB9\u306E\u305F\u3081\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u6587\u5B57\u3067\u6559\u3048\u3066\u304F\u3060\u3055\u3044\u3002",
594
+ timeout: "\u53D6\u5F97\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F\u3002",
595
+ csp: "\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u8A2D\u5B9A\u306B\u3088\u308A\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002",
596
+ error: "\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"
597
+ },
289
598
  screenshotPreviewAlt: "\u9001\u4FE1\u3055\u308C\u308B\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306E\u30D7\u30EC\u30D3\u30E5\u30FC",
290
599
  screenshotSensitiveHint: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u78BA\u8A8D\u3057\u3001\u6B8B\u9AD8\u3084\u500B\u4EBA\u60C5\u5831\u306A\u3069\u304C\u5199\u3063\u3066\u3044\u308C\u3070\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
291
600
  elementButton: "\u8981\u7D20\u3092\u9078\u629E",
@@ -380,9 +689,13 @@ var ja = {
380
689
  confirmFixed: "\u306F\u3044\u3001\u76F4\u308A\u307E\u3057\u305F",
381
690
  notFixed: "\u307E\u3060\u76F4\u3063\u3066\u3044\u307E\u305B\u3093",
382
691
  replyPlaceholder: "\u958B\u767A\u8005\u306B\u8FD4\u4FE1\u2026",
383
- send: "\u9001\u4FE1"
692
+ send: "\u9001\u4FE1",
693
+ loadFailed: "\u30B9\u30EC\u30C3\u30C9\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
694
+ retry: "\u518D\u8A66\u884C"
384
695
  },
385
696
  success: {
697
+ title: "\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059 \u2014 \u53D7\u3051\u4ED8\u3051\u307E\u3057\u305F",
698
+ done: "\u9589\u3058\u308B",
386
699
  trackReport: "\u3053\u306E\u30EC\u30DD\u30FC\u30C8\u3092\u8FFD\u8DE1 \u203A",
387
700
  receipt: "\u53D7\u4ED8",
388
701
  delivering: "\u30C1\u30FC\u30E0\u306B\u9001\u4FE1\u4E2D\u2026",
@@ -412,7 +725,7 @@ var ja = {
412
725
  changelog: {
413
726
  whatsNew: "{version} \u306E\u65B0\u6A5F\u80FD"
414
727
  },
415
- poweredBy: "Mushi v{version}"
728
+ poweredBy: "\u30D0\u30B0\u5831\u544A\u306F Mushi \u3067"
416
729
  }
417
730
  };
418
731
 
@@ -472,10 +785,25 @@ var th = {
472
785
  step3: {
473
786
  heading: "\u0E1A\u0E2D\u0E01\u0E40\u0E23\u0E32\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21",
474
787
  descriptionPlaceholder: "\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E40\u0E01\u0E34\u0E14\u0E02\u0E36\u0E49\u0E19\u2026",
788
+ featurePlaceholder: "\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E44\u0E2D\u0E40\u0E14\u0E35\u0E22\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u2026",
789
+ featureExamples: ["\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E42\u0E2B\u0E21\u0E14\u0E21\u0E37\u0E14", "\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25", "\u0E04\u0E35\u0E22\u0E4C\u0E25\u0E31\u0E14"],
790
+ otherPlaceholder: "\u0E21\u0E35\u0E2D\u0E30\u0E44\u0E23\u0E2D\u0E22\u0E32\u0E01\u0E1A\u0E2D\u0E01\u0E40\u0E23\u0E32?",
791
+ submitHint: "{key} + Enter \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E2A\u0E48\u0E07",
792
+ charsNeeded: "\u0E2D\u0E35\u0E01 {n} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
475
793
  screenshotButton: "\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15",
476
794
  screenshotAttached: "\u0E41\u0E19\u0E1A\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E41\u0E25\u0E49\u0E27 \u2713",
477
795
  screenshotCapturing: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E16\u0E48\u0E32\u0E22\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u2026",
478
796
  screenshotFailed: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E16\u0E48\u0E32\u0E22\u0E20\u0E32\u0E1E\u0E44\u0E14\u0E49 \u2014 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",
797
+ screenshotRetry: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
798
+ screenshotShareTab: "\u0E41\u0E0A\u0E23\u0E4C\u0E41\u0E17\u0E47\u0E1A\u0E19\u0E35\u0E49\u0E41\u0E17\u0E19",
799
+ screenshotErrors: {
800
+ permission: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E16\u0E39\u0E01\u0E1A\u0E25\u0E47\u0E2D\u0E01 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
801
+ unsupported: "\u0E40\u0E1A\u0E23\u0E32\u0E27\u0E4C\u0E40\u0E0B\u0E2D\u0E23\u0E4C\u0E19\u0E35\u0E49\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E2B\u0E19\u0E49\u0E32\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",
802
+ taint: "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E08\u0E32\u0E01\u0E40\u0E27\u0E47\u0E1A\u0E2D\u0E37\u0E48\u0E19\u0E1A\u0E25\u0E47\u0E2D\u0E01\u0E01\u0E32\u0E23\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E \u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E41\u0E17\u0E19",
803
+ timeout: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E2B\u0E21\u0E14\u0E40\u0E27\u0E25\u0E32",
804
+ csp: "\u0E19\u0E42\u0E22\u0E1A\u0E32\u0E22\u0E04\u0E27\u0E32\u0E21\u0E1B\u0E25\u0E2D\u0E14\u0E20\u0E31\u0E22\u0E02\u0E2D\u0E07\u0E40\u0E27\u0E47\u0E1A\u0E19\u0E35\u0E49\u0E1A\u0E25\u0E47\u0E2D\u0E01\u0E01\u0E32\u0E23\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E",
805
+ error: "\u0E08\u0E31\u0E1A\u0E20\u0E32\u0E1E\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08"
806
+ },
479
807
  screenshotPreviewAlt: "\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E2A\u0E01\u0E23\u0E35\u0E19\u0E0A\u0E47\u0E2D\u0E15\u0E17\u0E35\u0E48\u0E08\u0E30\u0E16\u0E39\u0E01\u0E2A\u0E48\u0E07",
480
808
  screenshotSensitiveHint: "\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E20\u0E32\u0E1E \u2014 \u0E2B\u0E32\u0E01\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E15\u0E31\u0E27 (\u0E22\u0E2D\u0E14\u0E40\u0E07\u0E34\u0E19 \u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25) \u0E42\u0E1B\u0E23\u0E14\u0E25\u0E1A\u0E2D\u0E2D\u0E01",
481
809
  elementButton: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A",
@@ -570,9 +898,13 @@ var th = {
570
898
  confirmFixed: "\u0E43\u0E0A\u0E48 \u0E41\u0E01\u0E49\u0E41\u0E25\u0E49\u0E27",
571
899
  notFixed: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E41\u0E01\u0E49",
572
900
  replyPlaceholder: "\u0E15\u0E2D\u0E1A\u0E19\u0E31\u0E01\u0E1E\u0E31\u0E12\u0E19\u0E32\u2026",
573
- send: "\u0E2A\u0E48\u0E07"
901
+ send: "\u0E2A\u0E48\u0E07",
902
+ loadFailed: "\u0E42\u0E2B\u0E25\u0E14\u0E40\u0E18\u0E23\u0E14\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",
903
+ retry: "\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07"
574
904
  },
575
905
  success: {
906
+ title: "\u0E02\u0E2D\u0E1A\u0E04\u0E38\u0E13 \u2014 \u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E41\u0E25\u0E49\u0E27",
907
+ done: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19",
576
908
  trackReport: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49 \u203A",
577
909
  receipt: "\u0E43\u0E1A\u0E23\u0E31\u0E1A",
578
910
  delivering: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E17\u0E35\u0E21\u2026",
@@ -602,7 +934,7 @@ var th = {
602
934
  changelog: {
603
935
  whatsNew: "\u0E21\u0E35\u0E2D\u0E30\u0E44\u0E23\u0E43\u0E2B\u0E21\u0E48\u0E43\u0E19 {version}"
604
936
  },
605
- poweredBy: "Powered by Mushi v{version}"
937
+ poweredBy: "\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E1A\u0E31\u0E4A\u0E01\u0E42\u0E14\u0E22 Mushi"
606
938
  }
607
939
  };
608
940
 
@@ -662,10 +994,25 @@ var es = {
662
994
  step3: {
663
995
  heading: "Cu\xE9ntanos m\xE1s",
664
996
  descriptionPlaceholder: "Describe lo que pas\xF3\u2026",
997
+ featurePlaceholder: "Describe tu idea\u2026",
998
+ featureExamples: ["A\xF1adir modo oscuro", "Exportar mis datos", "Atajos de teclado"],
999
+ otherPlaceholder: "\xBFQu\xE9 quieres contarnos?",
1000
+ submitHint: "{key} + Enter para enviar",
1001
+ charsNeeded: "Faltan {n} caracteres",
665
1002
  screenshotButton: "Adjuntar captura",
666
1003
  screenshotAttached: "Captura adjunta \u2713",
667
1004
  screenshotCapturing: "Tomando captura\u2026",
668
1005
  screenshotFailed: "No se pudo capturar \u2014 descr\xEDbelo en su lugar",
1006
+ screenshotRetry: "Reintentar",
1007
+ screenshotShareTab: "Compartir esta pesta\xF1a",
1008
+ screenshotErrors: {
1009
+ permission: "Se bloque\xF3 la captura. Perm\xEDtela y reintenta.",
1010
+ unsupported: "Este navegador no puede capturar la p\xE1gina. Descr\xEDbelo.",
1011
+ taint: "Contenido de otro sitio bloque\xF3 la captura. Descr\xEDbelo.",
1012
+ timeout: "La captura tard\xF3 demasiado.",
1013
+ csp: "La pol\xEDtica de seguridad de este sitio bloquea las capturas.",
1014
+ error: "La captura fall\xF3."
1015
+ },
669
1016
  screenshotPreviewAlt: "Vista previa de la captura que se enviar\xE1",
670
1017
  screenshotSensitiveHint: "Revisa la vista previa \u2014 qu\xEDtala si se ve informaci\xF3n privada (saldos, datos personales).",
671
1018
  elementButton: "Seleccionar elemento",
@@ -760,9 +1107,13 @@ var es = {
760
1107
  confirmFixed: "S\xED, qued\xF3 resuelto",
761
1108
  notFixed: "A\xFAn no est\xE1 resuelto",
762
1109
  replyPlaceholder: "Responder al desarrollador\u2026",
763
- send: "Enviar"
1110
+ send: "Enviar",
1111
+ loadFailed: "No se pudo cargar el hilo.",
1112
+ retry: "Reintentar"
764
1113
  },
765
1114
  success: {
1115
+ title: "Gracias \u2014 reporte recibido",
1116
+ done: "Listo",
766
1117
  trackReport: "Seguir este reporte \u203A",
767
1118
  receipt: "Recibo",
768
1119
  delivering: "Enviando al equipo\u2026",
@@ -792,7 +1143,7 @@ var es = {
792
1143
  changelog: {
793
1144
  whatsNew: "Novedades de {version}"
794
1145
  },
795
- poweredBy: "Con tecnolog\xEDa de Mushi v{version}"
1146
+ poweredBy: "Reportes de errores con Mushi"
796
1147
  }
797
1148
  };
798
1149
 
@@ -904,2035 +1255,52 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
904
1255
  inverse,
905
1256
  neonBannerBg,
906
1257
  neonBannerFg,
907
- neonBannerBorder,
908
- brandBannerBorder,
909
- statusSent,
910
- statusReview,
911
- statusFixing,
912
- statusFixed,
913
- statusClosedBg,
914
- fontDisplay,
915
- fontBody,
916
- fontMono,
917
- easeStamp,
918
- zBanner,
919
- fabSize
920
- } = v;
921
- const { sizeBody, sizeLabel, lineBody } = MUSHI_TYPE;
922
- const { durationFast } = MUSHI_MOTION;
923
- const {
924
- instant: durInstant,
925
- fast: durFast,
926
- base: durBase,
927
- panel: durPanel,
928
- slow: durSlow,
929
- ring: durRing
930
- } = MUSHI_DURATION;
931
- const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = MUSHI_GEOMETRY;
932
- const panelLauncherGap = fabSize + MUSHI_SPACING.comfy;
933
- const { base: zBase } = MUSHI_Z;
934
- const controlRadius = MUSHI_RADIUS.control;
935
- const cardRadius = MUSHI_RADIUS.card;
936
- const {
937
- tight: spaceTight,
938
- snug: spaceSnug,
939
- comfy: spaceComfy,
940
- roomy: spaceRoomy,
941
- lounge: spaceLounge,
942
- open: spaceOpen,
943
- wide: spaceWide
944
- } = MUSHI_SPACING;
945
- const touchMin = 44;
946
- return `
947
- :host {
948
- all: initial;
949
- font-family: ${fontBody};
950
- font-size: ${sizeBody}px;
951
- line-height: ${lineBody};
952
- color: ${ink};
953
- -webkit-font-smoothing: antialiased;
954
- -moz-osx-font-smoothing: grayscale;
955
- font-feature-settings: 'ss01', 'cv11'; /* nicer system-ui glyphs where supported */
956
- --mushi-ok: ${ok};
957
- /* Spacing + radius scales (MUSHI_SPACING / MUSHI_RADIUS) \u2014 prefer these
958
- over literal px so web + RN stay aligned with brand.tokens.json. */
959
- --mushi-space-tight: ${spaceTight}px;
960
- --mushi-space-snug: ${spaceSnug}px;
961
- --mushi-space-comfy: ${spaceComfy}px;
962
- --mushi-space-roomy: ${spaceRoomy}px;
963
- --mushi-space-lounge: ${spaceLounge}px;
964
- --mushi-space-open: ${spaceOpen}px;
965
- --mushi-space-wide: ${spaceWide}px;
966
- --mushi-radius-control: ${controlRadius}px;
967
- --mushi-radius-card: ${cardRadius}px;
968
- --mushi-touch-min: ${touchMin}px;
969
- /* Derived channel vars \u2014 accent RGB triplet + shadow-ink triplet.
970
- Lets Shadow-DOM CSS compose rgba() values that respect host-accent
971
- overrides and dark-mode ink without repeating the hex guard. */
972
- --mushi-accent-rgb: ${accentRgb};
973
- --mushi-shadow-ink: ${shadowInk};
974
- /* SDK contract: the host element is always pass-through. Only the
975
- interactive surfaces (.mushi-trigger, .mushi-banner, .mushi-panel)
976
- opt back into pointer events so the widget never creates an
977
- invisible touch blocker over host-app UI. */
978
- pointer-events: none;
979
- }
980
- /* Only actual widget controls receive touch/mouse events. */
981
- .mushi-trigger,
982
- .mushi-banner,
983
- .mushi-panel {
984
- pointer-events: auto;
985
- }
986
- *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
987
- button { font-family: inherit; }
988
-
989
- .mushi-trigger {
990
- position: fixed;
991
- width: ${fabSize}px;
992
- height: ${fabSize}px;
993
- min-width: var(--mushi-touch-min);
994
- min-height: var(--mushi-touch-min);
995
- border: 1px solid ${ruleStrong};
996
- border-radius: ${controlRadius}px;
997
- background: ${paper};
998
- color: ${ink};
999
- cursor: pointer;
1000
- display: flex;
1001
- align-items: center;
1002
- justify-content: center;
1003
- font-family: ${fontDisplay};
1004
- font-size: 22px;
1005
- line-height: 1;
1006
- box-shadow:
1007
- 0 1px 0 ${rule},
1008
- 0 6px 14px -8px rgba(${shadowInk},0.35),
1009
- inset 0 -3px 0 ${widgetAccent};
1010
- transition: transform ${durationFast}ms ${easeStamp}, opacity ${durationFast}ms ${easeStamp};
1011
- overflow: visible;
1012
- isolation: isolate;
1013
- }
1014
- .mushi-trigger::after {
1015
- content: '';
1016
- position: absolute;
1017
- top: 6px;
1018
- right: 6px;
1019
- width: 6px;
1020
- height: 6px;
1021
- border-radius: 50%;
1022
- background: ${widgetAccent};
1023
- box-shadow: 0 0 0 0 ${widgetAccent};
1024
- animation: mushi-pulse 2.4s ${easeStamp} infinite;
1025
- }
1026
- .mushi-trigger:hover {
1027
- transform: translateY(-2px) rotate(-1.5deg);
1028
- box-shadow:
1029
- 0 1px 0 ${rule},
1030
- 0 14px 24px -10px rgba(${shadowInk},0.45),
1031
- 0 0 20px -6px rgba(${accentRgb},0.22),
1032
- inset 0 -3px 0 ${widgetAccent};
1033
- }
1034
- .mushi-trigger:active {
1035
- transform: translateY(0) rotate(0);
1036
- box-shadow:
1037
- 0 1px 0 ${rule},
1038
- 0 2px 4px -2px rgba(${shadowInk},0.35),
1039
- inset 0 -2px 0 ${widgetAccent};
1040
- }
1041
- .mushi-trigger:focus-visible {
1042
- outline: 2px solid ${widgetAccent};
1043
- outline-offset: 3px;
1044
- }
1045
- /* First-session welcome pulse. Three soft halos at 800ms each, then
1046
- auto-clear. Uses a box-shadow ring rather than transform/scale so it
1047
- can compose with the hover transform without fighting it. Respects
1048
- prefers-reduced-motion. */
1049
- @keyframes mushi-trigger-pulse {
1050
- 0% { box-shadow: 0 0 0 0 rgba(${accentRgb},0.55), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
1051
- 70% { box-shadow: 0 0 0 16px rgba(${accentRgb},0), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
1052
- 100% { box-shadow: 0 0 0 0 rgba(${accentRgb},0), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
1053
- }
1054
- .mushi-trigger-pulse {
1055
- animation: mushi-trigger-pulse 800ms ${easeStamp} 3;
1056
- }
1057
- @media (prefers-reduced-motion: reduce) {
1058
- .mushi-trigger-pulse { animation: none; }
1059
- }
1060
- .mushi-trigger.bottom-right {
1061
- bottom: var(--mushi-bottom, calc(${gutter}px + env(safe-area-inset-bottom, 0px)));
1062
- right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
1063
- }
1064
- .mushi-trigger.bottom-left {
1065
- bottom: var(--mushi-bottom, calc(${gutter}px + env(safe-area-inset-bottom, 0px)));
1066
- left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
1067
- }
1068
- .mushi-trigger.top-right {
1069
- top: var(--mushi-top, calc(${gutter}px + env(safe-area-inset-top, 0px)));
1070
- right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
1071
- }
1072
- .mushi-trigger.top-left {
1073
- top: var(--mushi-top, calc(${gutter}px + env(safe-area-inset-top, 0px)));
1074
- left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
1075
- }
1076
- .mushi-trigger.edge-tab {
1077
- width: ${edgeTabWidth}px;
1078
- height: 88px;
1079
- border-radius: ${controlRadius}px 0 0 ${controlRadius}px;
1080
- writing-mode: vertical-rl;
1081
- text-orientation: upright;
1082
- font-size: 16px;
1083
- box-shadow:
1084
- 0 1px 0 ${rule},
1085
- 0 10px 24px -14px rgba(${shadowInk},0.45),
1086
- inset -3px 0 0 ${widgetAccent};
1087
- }
1088
- .mushi-trigger.edge-tab.bottom-right,
1089
- .mushi-trigger.edge-tab.top-right {
1090
- right: var(--mushi-right, 0);
1091
- }
1092
- .mushi-trigger.edge-tab.bottom-left,
1093
- .mushi-trigger.edge-tab.top-left {
1094
- left: var(--mushi-left, 0);
1095
- border-radius: 0 ${controlRadius}px ${controlRadius}px 0;
1096
- box-shadow:
1097
- 0 1px 0 ${rule},
1098
- 0 10px 24px -14px rgba(${shadowInk},0.45),
1099
- inset 3px 0 0 ${widgetAccent};
1100
- }
1101
- .mushi-trigger.shrunk {
1102
- width: ${bannerHeight}px;
1103
- height: ${bannerHeight}px;
1104
- opacity: 0.82;
1105
- transform: scale(0.92);
1106
- }
1107
-
1108
- /* \u2500\u2500 Draggable FAB \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1109
- When draggable is enabled the trigger uses CSS translate to apply the
1110
- drag offset ON TOP of the existing inset positioning, so snapping and
1111
- safe-area clamp still work correctly via the inset vars.
1112
- --mushi-drag-active 0|1 gates the transform so non-draggable FABs are
1113
- completely unaffected. touch-action: none prevents browser pan/scroll
1114
- from racing the pointer capture. */
1115
- .mushi-trigger {
1116
- touch-action: none;
1117
- translate:
1118
- calc(var(--mushi-drag-active, 0) * var(--mushi-drag-x, 0px))
1119
- calc(var(--mushi-drag-active, 0) * var(--mushi-drag-y, 0px));
1120
- }
1121
- .mushi-trigger.dragging {
1122
- cursor: grabbing !important;
1123
- z-index: calc(var(--z, ${zBase}) + 2);
1124
- transition: none !important;
1125
- box-shadow:
1126
- 0 1px 0 ${rule},
1127
- 0 20px 40px -12px rgba(${shadowInk},0.55),
1128
- inset 0 -3px 0 ${widgetAccent};
1129
- opacity: 0.92;
1130
- }
1131
- @media (prefers-reduced-motion: reduce) {
1132
- .mushi-trigger { transition: none !important; }
1133
- }
1134
-
1135
- @keyframes mushi-pulse {
1136
- 0% { box-shadow: 0 0 0 0 ${widgetAccent}; opacity: 1; }
1137
- 70% { box-shadow: 0 0 0 8px ${widgetAccent}00; opacity: 0.5; }
1138
- 100% { box-shadow: 0 0 0 0 ${widgetAccent}00; opacity: 1; }
1139
- }
1140
-
1141
- .mushi-panel {
1142
- position: fixed;
1143
- width: ${panelWidth}px;
1144
- max-width: calc(100vw - ${MUSHI_SPACING.wide}px);
1145
- max-height: min(${panelMaxHeight}px, calc(100dvh - 120px - var(--mushi-keyboard-inset, 0px)));
1146
- background: ${paper};
1147
- border: 1px solid ${ruleStrong};
1148
- border-radius: 6px;
1149
- box-shadow:
1150
- 0 1px 0 ${rule},
1151
- 0 24px 56px -20px rgba(${shadowInk},0.30),
1152
- 0 8px 16px -8px rgba(${shadowInk},0.20);
1153
- overflow: hidden;
1154
- display: flex;
1155
- flex-direction: column;
1156
- transform-origin: var(--mushi-origin, bottom right);
1157
- /* Keyboard inset \u2014 layout exception (IME), not decorative (docs/MOTION.md) */
1158
- transition: bottom ${durInstant}ms ease, top ${durInstant}ms ease, max-height ${durInstant}ms ease;
1159
- }
1160
- /* Keyboard-safe: on narrow viewports lift above the keyboard */
1161
- .mushi-panel.keyboard-open {
1162
- bottom: calc(var(--mushi-keyboard-inset, 0px) + 8px) !important;
1163
- }
1164
- /* On narrow mobile, fill the width as a bottom sheet */
1165
- @media (max-width: ${panelSheetBreakpoint}px) {
1166
- .mushi-panel {
1167
- left: 0 !important;
1168
- right: 0 !important;
1169
- width: 100% !important;
1170
- max-width: 100% !important;
1171
- border-bottom-left-radius: 0;
1172
- border-bottom-right-radius: 0;
1173
- bottom: var(--mushi-keyboard-inset, 0px) !important;
1174
- }
1175
- .mushi-panel.keyboard-open {
1176
- bottom: calc(var(--mushi-keyboard-inset, 0px) + 4px) !important;
1177
- }
1178
- }
1179
- .mushi-panel.open { animation: mushi-stamp-in ${durPanel}ms ${easeStamp} both; }
1180
- .mushi-panel.closed { display: none; }
1181
- .mushi-panel.bottom-right {
1182
- bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, ${gutter}px) + ${panelLauncherGap}px));
1183
- right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
1184
- --mushi-origin: bottom right;
1185
- }
1186
- .mushi-panel.bottom-left {
1187
- bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, ${gutter}px) + ${panelLauncherGap}px));
1188
- left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
1189
- --mushi-origin: bottom left;
1190
- }
1191
- .mushi-panel.top-right {
1192
- top: var(--mushi-panel-top, calc(var(--mushi-top, ${gutter}px) + ${panelLauncherGap}px));
1193
- right: var(--mushi-right, calc(${gutter}px + env(safe-area-inset-right, 0px)));
1194
- --mushi-origin: top right;
1195
- }
1196
- .mushi-panel.top-left {
1197
- top: var(--mushi-panel-top, calc(var(--mushi-top, ${gutter}px) + ${panelLauncherGap}px));
1198
- left: var(--mushi-left, calc(${gutter}px + env(safe-area-inset-left, 0px)));
1199
- --mushi-origin: top left;
1200
- }
1201
- .mushi-outdated {
1202
- margin: 12px 14px 0;
1203
- padding: 10px 12px;
1204
- border: 1px solid ${widgetAccentWash};
1205
- background: ${widgetAccentWash};
1206
- color: ${widgetAccentInk};
1207
- font-family: ${fontBody};
1208
- font-size: 12px;
1209
- line-height: 1.4;
1210
- }
1211
- .mushi-outdated strong {
1212
- display: block;
1213
- font-family: ${fontMono};
1214
- font-size: 10px;
1215
- letter-spacing: 0.12em;
1216
- text-transform: uppercase;
1217
- margin-bottom: 2px;
1218
- }
1219
- .mushi-outdated span {
1220
- display: block;
1221
- margin-top: 3px;
1222
- color: ${inkMuted};
1223
- }
1224
-
1225
- @keyframes mushi-stamp-in {
1226
- 0% { opacity: 0; transform: scale(0.94) translateY(6px); }
1227
- 60% { opacity: 1; }
1228
- 100% { opacity: 1; transform: scale(1) translateY(0); }
1229
- }
1230
-
1231
- .mushi-header {
1232
- padding: 13px 18px 10px;
1233
- border-bottom: 1px solid ${rule};
1234
- display: grid;
1235
- grid-template-columns: auto 1fr auto;
1236
- align-items: end;
1237
- gap: 10px;
1238
- }
1239
- .mushi-header-mark {
1240
- display: inline-flex;
1241
- align-items: center;
1242
- justify-content: center;
1243
- width: 22px;
1244
- height: 22px;
1245
- border-radius: 3px;
1246
- background: ${widgetAccent};
1247
- color: ${onAccent};
1248
- font-family: ${fontDisplay};
1249
- font-size: 14px;
1250
- font-weight: 600;
1251
- line-height: 1;
1252
- letter-spacing: -0.02em;
1253
- transform: rotate(-3deg);
1254
- flex-shrink: 0;
1255
- }
1256
- .mushi-header-titles {
1257
- min-width: 0;
1258
- display: flex;
1259
- flex-direction: column;
1260
- gap: 2px;
1261
- }
1262
- .mushi-header-eyebrow {
1263
- font-family: ${fontMono};
1264
- font-size: 10px;
1265
- letter-spacing: 0.18em;
1266
- text-transform: uppercase;
1267
- color: ${inkMuted};
1268
- }
1269
- .mushi-header h3 {
1270
- font-family: ${fontDisplay};
1271
- font-size: 19px;
1272
- font-weight: 500;
1273
- line-height: 1.15;
1274
- letter-spacing: -0.01em;
1275
- color: ${ink};
1276
- }
1277
- .mushi-header-meta {
1278
- align-self: start;
1279
- display: flex;
1280
- align-items: center;
1281
- gap: 6px;
1282
- }
1283
- .mushi-step-counter {
1284
- font-family: ${fontMono};
1285
- font-size: 11px;
1286
- color: ${inkMuted};
1287
- letter-spacing: 0.06em;
1288
- tab-size: 2ch;
1289
- padding-top: 2px;
1290
- }
1291
- .mushi-step-counter b {
1292
- font-weight: 600;
1293
- color: ${ink};
1294
- }
1295
- .mushi-close {
1296
- background: none;
1297
- border: none;
1298
- cursor: pointer;
1299
- padding: 2px 4px;
1300
- color: ${inkMuted};
1301
- font-family: ${fontBody};
1302
- font-size: 16px;
1303
- line-height: 1;
1304
- border-radius: 0;
1305
- transition: opacity ${durInstant}ms ${easeStamp};
1306
- }
1307
- .mushi-back {
1308
- align-self: flex-start;
1309
- background: none;
1310
- border: none;
1311
- cursor: pointer;
1312
- padding: 3px 0;
1313
- margin: 0 0 2px;
1314
- min-height: 22px;
1315
- color: ${inkMuted};
1316
- font-family: ${fontMono};
1317
- font-size: 11px;
1318
- font-weight: 500;
1319
- letter-spacing: 0.06em;
1320
- text-transform: uppercase;
1321
- line-height: 1.2;
1322
- border-radius: 0;
1323
- display: inline-flex;
1324
- align-items: center;
1325
- gap: 4px;
1326
- transition: opacity ${durInstant}ms ${easeStamp};
1327
- white-space: nowrap;
1328
- }
1329
- .mushi-close:hover { color: ${widgetAccent}; }
1330
- .mushi-back:hover { color: ${ink}; }
1331
- .mushi-close:focus-visible {
1332
- outline: 1.5px solid ${widgetAccent};
1333
- outline-offset: 2px;
1334
- }
1335
- .mushi-back:focus-visible {
1336
- outline: none;
1337
- color: ${widgetAccent};
1338
- text-decoration: underline;
1339
- text-underline-offset: 3px;
1340
- }
1341
-
1342
- /* \u2500\u2500 Body \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1343
- Generous left/right padding (22px) so type breathes. Vertical
1344
- padding tighter at top because the header rule already creates
1345
- breathing room. */
1346
- .mushi-body {
1347
- padding: 8px 22px 16px;
1348
- overflow-y: auto;
1349
- flex: 1;
1350
- scrollbar-width: thin;
1351
- scrollbar-color: ${inkFaint} transparent;
1352
- }
1353
- .mushi-body::-webkit-scrollbar { width: 6px; }
1354
- .mushi-body::-webkit-scrollbar-thumb { background: ${inkFaint}; border-radius: 3px; }
1355
-
1356
- .mushi-option-btn {
1357
- display: grid;
1358
- grid-template-columns: auto 1fr auto;
1359
- align-items: center;
1360
- gap: ${spaceComfy}px;
1361
- width: 100%;
1362
- min-height: var(--mushi-touch-min);
1363
- padding: ${spaceComfy}px 0;
1364
- border: none;
1365
- border-bottom: 1px solid ${rule};
1366
- background: transparent;
1367
- cursor: pointer;
1368
- color: inherit;
1369
- text-align: left;
1370
- transition: transform ${durBase}ms ${easeStamp}, opacity ${durBase}ms ${easeStamp};
1371
- position: relative;
1372
- }
1373
- .mushi-option-btn:last-child { border-bottom: none; }
1374
- .mushi-option-btn:hover {
1375
- transform: translateX(6px);
1376
- color: ${widgetAccent};
1377
- background: linear-gradient(90deg, rgba(${accentRgb},0.07), transparent 55%);
1378
- }
1379
- .mushi-option-btn:hover .mushi-option-arrow { opacity: 1; transform: translateX(0); color: ${widgetAccent}; }
1380
- .mushi-option-btn:focus-visible {
1381
- outline: none;
1382
- transform: translateX(6px);
1383
- box-shadow: inset 2px 0 0 ${widgetAccent};
1384
- }
1385
- .mushi-option-icon {
1386
- font-size: 18px;
1387
- line-height: 1;
1388
- flex-shrink: 0;
1389
- filter: ${isDark ? "none" : "grayscale(0.15)"};
1390
- }
1391
- .mushi-option-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
1392
- .mushi-option-label {
1393
- font-family: ${fontDisplay};
1394
- font-size: 16px;
1395
- font-weight: 500;
1396
- letter-spacing: -0.005em;
1397
- line-height: 1.2;
1398
- }
1399
- .mushi-option-desc {
1400
- font-size: 12px;
1401
- color: ${inkMuted};
1402
- letter-spacing: 0.005em;
1403
- }
1404
- .mushi-option-arrow {
1405
- font-family: ${fontMono};
1406
- font-size: 14px;
1407
- color: ${inkFaint};
1408
- opacity: 0;
1409
- transform: translateX(-4px);
1410
- transition: opacity ${durBase}ms ${easeStamp}, transform ${durBase}ms ${easeStamp};
1411
- }
1412
- /* Feature-request and Reports-inbox entries sit above the five
1413
- category cards as discoverable shortcuts. We give them a subtle
1414
- left rule so the eye reads them as a separate group rather than
1415
- "another category". The shortcut group has zero hover indent
1416
- overshoot \u2014 we want them quiet until intent. */
1417
- .mushi-feature-entry,
1418
- .mushi-reports-entry {
1419
- padding-left: 10px;
1420
- border-left: 2px solid ${inkFaint};
1421
- transition: opacity ${durBase}ms ${easeStamp}, transform ${durBase}ms ${easeStamp};
1422
- }
1423
- .mushi-feature-entry:hover,
1424
- .mushi-reports-entry:hover {
1425
- border-left-color: ${widgetAccent};
1426
- padding-left: 14px;
1427
- }
1428
- .mushi-feature-entry .mushi-option-icon {
1429
- filter: none;
1430
- }
1431
- .mushi-report-row {
1432
- width: 100%;
1433
- display: grid;
1434
- grid-template-columns: 1fr auto;
1435
- gap: 10px;
1436
- align-items: center;
1437
- padding: 12px 4px 12px 0;
1438
- border: 0;
1439
- border-bottom: 1px solid ${rule};
1440
- background: transparent;
1441
- color: ${ink};
1442
- cursor: pointer;
1443
- text-align: left;
1444
- transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
1445
- }
1446
- .mushi-report-row:hover,
1447
- .mushi-report-row:focus-visible {
1448
- background: ${isDark ? "rgba(242,235,221,0.04)" : "rgba(14,13,11,0.03)"};
1449
- padding-left: 4px;
1450
- }
1451
- .mushi-report-main {
1452
- min-width: 0;
1453
- display: grid;
1454
- gap: 6px;
1455
- }
1456
- .mushi-report-title {
1457
- font-size: 13px;
1458
- line-height: 1.35;
1459
- display: -webkit-box;
1460
- -webkit-line-clamp: 2;
1461
- -webkit-box-orient: vertical;
1462
- overflow: hidden;
1463
- }
1464
- .mushi-report-meta {
1465
- display: flex;
1466
- flex-wrap: wrap;
1467
- align-items: center;
1468
- gap: 8px;
1469
- }
1470
- .mushi-report-status {
1471
- display: inline-flex;
1472
- align-items: center;
1473
- font-family: ${fontMono};
1474
- font-size: 10px;
1475
- font-weight: 600;
1476
- letter-spacing: 0.04em;
1477
- text-transform: uppercase;
1478
- padding: 2px 7px;
1479
- border-radius: 999px;
1480
- border: 1px solid transparent;
1481
- }
1482
- .mushi-status-sent {
1483
- color: ${statusSent.fg};
1484
- background: ${statusSent.bg};
1485
- border-color: ${statusSent.border};
1486
- }
1487
- .mushi-status-review {
1488
- color: ${statusReview.fg};
1489
- background: ${statusReview.bg};
1490
- border-color: ${statusReview.border};
1491
- }
1492
- .mushi-status-fixing {
1493
- color: ${statusFixing.fg};
1494
- background: ${statusFixing.bg};
1495
- border-color: ${statusFixing.border};
1496
- }
1497
- .mushi-status-fixed {
1498
- color: ${statusFixed.fg};
1499
- background: ${statusFixed.bg};
1500
- border-color: ${statusFixed.border};
1501
- }
1502
- .mushi-status-closed,
1503
- .mushi-status-unknown {
1504
- color: ${inkMuted};
1505
- background: ${statusClosedBg};
1506
- border-color: ${ruleStrong};
1507
- }
1508
- .mushi-report-when {
1509
- font-family: ${fontMono};
1510
- font-size: 10px;
1511
- color: ${inkFaint};
1512
- }
1513
- .mushi-unread-badge {
1514
- display: inline-flex;
1515
- align-items: center;
1516
- justify-content: center;
1517
- min-width: 18px;
1518
- height: 18px;
1519
- padding: 0 5px;
1520
- border-radius: 999px;
1521
- font-family: ${fontMono};
1522
- font-size: 10px;
1523
- font-weight: 700;
1524
- color: ${widgetAccentInk};
1525
- background: ${widgetAccent};
1526
- }
1527
- .mushi-report-chevron {
1528
- font-size: 18px;
1529
- line-height: 1;
1530
- color: ${inkFaint};
1531
- transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
1532
- }
1533
- .mushi-report-row:hover .mushi-report-chevron,
1534
- .mushi-report-row:focus-visible .mushi-report-chevron {
1535
- color: ${widgetAccent};
1536
- transform: translateX(2px);
1537
- }
1538
- .mushi-thread-summary {
1539
- border-bottom: 1px solid ${rule};
1540
- padding-bottom: 10px;
1541
- margin-bottom: 10px;
1542
- }
1543
- .mushi-thread-summary-meta {
1544
- display: flex;
1545
- flex-wrap: wrap;
1546
- align-items: center;
1547
- gap: 10px;
1548
- margin-bottom: 8px;
1549
- }
1550
- .mushi-thread {
1551
- display: grid;
1552
- gap: 8px;
1553
- max-height: 180px;
1554
- overflow: auto;
1555
- margin-bottom: 12px;
1556
- }
1557
- .mushi-thread-comment {
1558
- padding: 8px 10px;
1559
- border: 1px solid ${rule};
1560
- background: ${isDark ? "rgba(242,235,221,0.04)" : "rgba(14,13,11,0.03)"};
1561
- }
1562
- .mushi-thread-comment.reporter {
1563
- border-color: ${widgetAccentWash};
1564
- background: ${widgetAccentWash};
1565
- }
1566
- .mushi-thread-comment strong {
1567
- display: block;
1568
- font-family: ${fontMono};
1569
- font-size: 10px;
1570
- letter-spacing: 0.04em;
1571
- margin-bottom: 3px;
1572
- }
1573
- .mushi-thread-comment p,
1574
- .mushi-muted,
1575
- .mushi-error-inline {
1576
- font-size: 12px;
1577
- color: ${inkMuted};
1578
- line-height: 1.45;
1579
- }
1580
- .mushi-error-inline { color: ${widgetAccent}; }
1581
-
1582
- .mushi-selected-category {
1583
- display: inline-flex;
1584
- align-items: center;
1585
- gap: 8px;
1586
- padding: 6px 10px 6px 12px;
1587
- border-left: 2px solid ${widgetAccent};
1588
- background: ${widgetAccentWash};
1589
- color: ${widgetAccentInk};
1590
- font-family: ${fontDisplay};
1591
- font-size: 13px;
1592
- margin: 4px 0 14px;
1593
- border-radius: 0 3px 3px 0;
1594
- }
1595
- .mushi-selected-category span:first-child { font-size: 14px; }
1596
- .mushi-intents {
1597
- display: flex;
1598
- flex-direction: column;
1599
- gap: 2px;
1600
- }
1601
- .mushi-intents .mushi-option-btn {
1602
- grid-template-columns: 1fr auto;
1603
- }
1604
-
1605
- /* Example starter chips \u2014 reduce first-report activation energy */
1606
- .mushi-example-chips {
1607
- display: flex;
1608
- flex-wrap: wrap;
1609
- gap: 6px;
1610
- margin-bottom: 10px;
1611
- }
1612
- .mushi-example-chip {
1613
- padding: 4px 10px;
1614
- border: 1px solid ${rule};
1615
- border-radius: 12px;
1616
- background: transparent;
1617
- color: ${inkMuted};
1618
- font-family: ${fontBody};
1619
- font-size: 11px;
1620
- cursor: pointer;
1621
- transition: opacity ${durInstant}ms ${easeStamp}, transform ${durInstant}ms ${easeStamp};
1622
- white-space: nowrap;
1623
- }
1624
- .mushi-example-chip:hover {
1625
- color: ${ink};
1626
- border-color: ${inkMuted};
1627
- background: ${isDark ? "rgba(242,235,221,0.06)" : "rgba(14,13,11,0.04)"};
1628
- }
1629
- .mushi-example-chip:focus-visible {
1630
- outline: 2px solid ${widgetAccent};
1631
- outline-offset: 2px;
1632
- }
1633
-
1634
- /* Textarea wrapper to position char counter */
1635
- .mushi-textarea-wrap {
1636
- position: relative;
1637
- }
1638
- .mushi-char-counter {
1639
- position: absolute;
1640
- bottom: 4px;
1641
- right: 0;
1642
- font-family: ${fontMono};
1643
- font-size: 10px;
1644
- letter-spacing: 0.04em;
1645
- color: ${inkFaint};
1646
- pointer-events: none;
1647
- transition: opacity ${durFast}ms ${easeStamp};
1648
- }
1649
-
1650
- .mushi-textarea {
1651
- width: 100%;
1652
- min-height: 96px;
1653
- padding: 8px 0 10px;
1654
- border: none;
1655
- border-bottom: 1px solid ${ruleStrong};
1656
- background: transparent;
1657
- color: ${ink};
1658
- font-family: ${fontBody};
1659
- font-size: 14px;
1660
- line-height: 1.5;
1661
- resize: vertical;
1662
- outline: none;
1663
- transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
1664
- }
1665
- .mushi-textarea::placeholder {
1666
- color: ${inkFaint};
1667
- font-style: italic;
1668
- }
1669
- .mushi-textarea:focus { border-bottom-color: ${widgetAccent}; }
1670
-
1671
- .mushi-attachments {
1672
- display: flex;
1673
- flex-wrap: wrap;
1674
- gap: 6px;
1675
- margin-top: 12px;
1676
- }
1677
- .mushi-attach-btn {
1678
- display: inline-flex;
1679
- align-items: center;
1680
- gap: 6px;
1681
- padding: 5px 10px;
1682
- border: 1px solid ${ruleStrong};
1683
- border-radius: 3px;
1684
- background: transparent;
1685
- color: ${inkMuted};
1686
- font-family: ${fontMono};
1687
- font-size: 11px;
1688
- letter-spacing: 0.04em;
1689
- text-transform: uppercase;
1690
- cursor: pointer;
1691
- transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
1692
- }
1693
- .mushi-attach-btn:hover {
1694
- color: ${ink};
1695
- border-color: ${ink};
1696
- }
1697
- .mushi-attach-btn.active {
1698
- color: ${widgetAccent};
1699
- border-color: ${widgetAccent};
1700
- background: ${widgetAccentWash};
1701
- }
1702
- .mushi-attach-btn.danger {
1703
- color: ${widgetAccentInk};
1704
- border-color: ${widgetAccentWash};
1705
- background: transparent;
1706
- }
1707
- .mushi-attach-btn.danger:hover {
1708
- color: ${widgetAccent};
1709
- border-color: ${widgetAccent};
1710
- background: ${widgetAccentWash};
1711
- }
1712
- .mushi-attach-btn.loading {
1713
- opacity: 0.7;
1714
- cursor: wait;
1715
- }
1716
- .mushi-attach-btn.error {
1717
- color: ${widgetAccent};
1718
- border-color: ${widgetAccentWash};
1719
- }
1720
- .mushi-attach-btn:focus-visible {
1721
- outline: 2px solid ${widgetAccent};
1722
- outline-offset: 2px;
1723
- }
1724
- .mushi-annotate-host {
1725
- flex-basis: 100%;
1726
- margin-top: 8px;
1727
- }
1728
- .mushi-annotate-host:empty {
1729
- margin-top: 0;
1730
- }
1731
- .mushi-screenshot-preview {
1732
- margin: 10px 0 0;
1733
- display: flex;
1734
- flex-direction: column;
1735
- gap: 6px;
1736
- }
1737
- .mushi-screenshot-preview img {
1738
- display: block;
1739
- max-width: 100%;
1740
- max-height: 160px;
1741
- width: auto;
1742
- border: 1px solid ${ruleStrong};
1743
- border-radius: 3px;
1744
- object-fit: contain;
1745
- align-self: flex-start;
1746
- }
1747
- .mushi-screenshot-hint {
1748
- margin: 0;
1749
- color: ${inkMuted};
1750
- font-family: ${fontMono};
1751
- font-size: 10.5px;
1752
- line-height: 1.4;
1753
- letter-spacing: 0.02em;
1754
- }
1755
- .mushi-identified-user {
1756
- margin: 8px 0 0;
1757
- font-size: 11.5px;
1758
- color: ${inkMuted};
1759
- line-height: 1.4;
1760
- }
1761
- .mushi-identified-user strong {
1762
- color: ${ink};
1763
- font-weight: 600;
1764
- }
1765
- .mushi-annotate-toolbar {
1766
- display: flex;
1767
- flex-wrap: wrap;
1768
- gap: 6px;
1769
- margin-bottom: 8px;
1770
- }
1771
- @keyframes mushi-spin {
1772
- to { transform: rotate(360deg); }
1773
- }
1774
- @keyframes mushi-fade-in {
1775
- from { opacity: 0; transform: translateY(4px); }
1776
- to { opacity: 1; transform: translateY(0); }
1777
- }
1778
- .mushi-spinner {
1779
- display: inline-block;
1780
- width: 10px;
1781
- height: 10px;
1782
- border: 1.5px solid currentColor;
1783
- border-top-color: transparent;
1784
- border-radius: 50%;
1785
- animation: mushi-spin ${durRing}ms linear infinite;
1786
- }
1787
-
1788
- .mushi-footer {
1789
- padding: 14px 22px 16px;
1790
- border-top: 1px solid ${rule};
1791
- display: flex;
1792
- align-items: center;
1793
- justify-content: space-between;
1794
- gap: 12px;
1795
- }
1796
- .mushi-footer-hint {
1797
- font-family: ${fontMono};
1798
- font-size: 10px;
1799
- letter-spacing: 0.10em;
1800
- text-transform: uppercase;
1801
- color: ${inkFaint};
1802
- }
1803
- .mushi-submit {
1804
- position: relative;
1805
- display: inline-flex;
1806
- align-items: center;
1807
- gap: ${spaceSnug}px;
1808
- min-height: var(--mushi-touch-min);
1809
- padding: ${spaceComfy}px ${spaceLounge}px;
1810
- border: 1px solid ${widgetAccent};
1811
- border-radius: ${controlRadius}px;
1812
- background: linear-gradient(160deg, ${widgetAccent} 0%, ${widgetAccentShadow} 100%);
1813
- color: ${onAccent};
1814
- font-family: ${fontMono};
1815
- font-size: ${sizeLabel}px;
1816
- letter-spacing: 0.16em;
1817
- text-transform: uppercase;
1818
- cursor: pointer;
1819
- overflow: hidden;
1820
- transition: transform ${durFast}ms ${easeStamp}, opacity ${durFast}ms ${easeStamp};
1821
- box-shadow: 0 2px 0 ${widgetAccentShadow};
1822
- }
1823
- .mushi-submit::after {
1824
- content: '';
1825
- position: absolute;
1826
- inset: 0;
1827
- background: radial-gradient(circle at center, rgba(255,255,255,0.35) 0%, transparent 60%);
1828
- opacity: 0;
1829
- transform: scale(0.4);
1830
- transition: opacity ${durPanel}ms ${easeStamp}, transform ${durSlow}ms ${easeStamp};
1831
- pointer-events: none;
1832
- }
1833
- .mushi-submit:hover {
1834
- transform: translateY(-1px);
1835
- box-shadow:
1836
- 0 3px 0 ${widgetAccentShadow},
1837
- 0 0 0 3px rgba(${accentRgb},0.18),
1838
- 0 4px 16px -4px rgba(${accentRgb},0.35);
1839
- }
1840
- .mushi-submit:hover::after { opacity: 1; transform: scale(1.4); }
1841
- .mushi-submit:active { transform: translateY(1px); box-shadow: 0 1px 0 ${widgetAccentShadow}; }
1842
- .mushi-submit:disabled {
1843
- cursor: wait;
1844
- opacity: 0.7;
1845
- }
1846
- .mushi-submit:focus-visible {
1847
- outline: 2px solid ${widgetAccent};
1848
- outline-offset: 3px;
1849
- }
1850
- .mushi-submit-arrow {
1851
- display: inline-block;
1852
- transition: transform ${durBase}ms ${easeStamp};
1853
- }
1854
- .mushi-submit:hover .mushi-submit-arrow { transform: translateX(3px); }
1855
-
1856
- .mushi-brand-footer {
1857
- padding: 9px 14px 11px;
1858
- border-top: 1px solid ${rule};
1859
- color: ${inkFaint};
1860
- font-family: ${fontMono};
1861
- font-size: 9px;
1862
- letter-spacing: 0.16em;
1863
- text-align: center;
1864
- text-transform: uppercase;
1865
- }
1866
-
1867
- .mushi-step-indicator {
1868
- display: flex;
1869
- align-items: center;
1870
- justify-content: center;
1871
- gap: 8px;
1872
- padding: 10px 22px 14px;
1873
- color: ${inkFaint};
1874
- font-family: ${fontMono};
1875
- font-size: 11px;
1876
- letter-spacing: 0.10em;
1877
- }
1878
- .mushi-step-num {
1879
- display: inline-flex;
1880
- align-items: baseline;
1881
- gap: 4px;
1882
- transition: opacity ${durFast}ms ${easeStamp};
1883
- }
1884
- .mushi-step-num.done { color: ${inkMuted}; text-decoration: line-through; text-decoration-color: ${inkFaint}; }
1885
- .mushi-step-num.active {
1886
- color: ${widgetAccent};
1887
- font-family: ${fontDisplay};
1888
- font-size: 14px;
1889
- font-weight: 600;
1890
- letter-spacing: 0;
1891
- }
1892
- .mushi-step-sep { width: 14px; height: 1px; background: ${rule}; }
1893
-
1894
- .mushi-success {
1895
- text-align: center;
1896
- padding: 28px 16px 20px;
1897
- }
1898
- .mushi-success-stamp {
1899
- position: relative;
1900
- width: 96px;
1901
- height: 96px;
1902
- margin: 0 auto 16px;
1903
- display: inline-flex;
1904
- align-items: center;
1905
- justify-content: center;
1906
- }
1907
- .mushi-success-stamp svg {
1908
- position: absolute;
1909
- inset: 0;
1910
- width: 100%;
1911
- height: 100%;
1912
- }
1913
- .mushi-success-stamp circle {
1914
- fill: none;
1915
- stroke: ${widgetAccent};
1916
- stroke-width: 3;
1917
- stroke-dasharray: 280;
1918
- stroke-dashoffset: 280;
1919
- transform: rotate(-90deg);
1920
- transform-origin: center;
1921
- animation: mushi-stamp-ring 700ms ${easeStamp} 80ms forwards;
1922
- filter: drop-shadow(0 0 6px rgba(${accentRgb},0.5));
1923
- }
1924
- .mushi-success-stamp-label {
1925
- font-family: ${fontDisplay};
1926
- font-size: 18px;
1927
- font-weight: 600;
1928
- color: ${widgetAccent};
1929
- letter-spacing: 0.04em;
1930
- transform: rotate(-6deg);
1931
- opacity: 0;
1932
- animation: mushi-stamp-press 360ms ${easeStamp} 600ms forwards;
1933
- }
1934
- .mushi-success-headline {
1935
- font-family: ${fontDisplay};
1936
- font-size: 18px;
1937
- font-weight: 500;
1938
- color: ${ink};
1939
- margin-bottom: 4px;
1940
- }
1941
- .mushi-success-meta {
1942
- font-family: ${fontMono};
1943
- font-size: 11px;
1944
- letter-spacing: 0.10em;
1945
- text-transform: uppercase;
1946
- color: ${inkMuted};
1947
- }
1948
-
1949
- /* \u2500\u2500 Two-way receipt (success step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1950
- /* The receipt block sits below the stamp/meta. Three states: */
1951
- /* 1. delivering... (spinner pill, while host onSubmit awaits) */
1952
- /* 2. confirmed (Receipt id + Track on Mushi link) */
1953
- /* 3. queued offline (warn pill \u2014 degrade gracefully) */
1954
- .mushi-success-receipt {
1955
- margin-top: 14px;
1956
- width: 100%;
1957
- max-width: 280px;
1958
- display: flex;
1959
- flex-direction: column;
1960
- gap: 6px;
1961
- align-items: stretch;
1962
- }
1963
- .mushi-success-receipt-row {
1964
- display: flex;
1965
- align-items: center;
1966
- justify-content: center;
1967
- gap: 8px;
1968
- font-family: ${fontMono};
1969
- font-size: 11px;
1970
- letter-spacing: 0.05em;
1971
- color: ${inkMuted};
1972
- }
1973
- .mushi-success-receipt-label {
1974
- text-transform: uppercase;
1975
- letter-spacing: 0.10em;
1976
- color: ${inkMuted};
1977
- }
1978
- .mushi-success-receipt-id {
1979
- display: inline-flex;
1980
- align-items: center;
1981
- gap: 5px;
1982
- padding: 3px 8px;
1983
- border-radius: 4px;
1984
- background: transparent;
1985
- border: 1px dashed ${rule};
1986
- color: inherit;
1987
- font-family: ${fontMono};
1988
- font-size: 12px;
1989
- letter-spacing: 0.02em;
1990
- cursor: pointer;
1991
- transition: opacity ${durInstant}ms ${easeStamp};
1992
- }
1993
- .mushi-success-receipt-id:hover,
1994
- .mushi-success-receipt-id:focus-visible {
1995
- background: rgba(${accentRgb},0.06);
1996
- border-color: ${widgetAccent};
1997
- color: ${widgetAccent};
1998
- outline: none;
1999
- }
2000
- .mushi-success-receipt-copy {
2001
- font-size: 11px;
2002
- opacity: 0.7;
2003
- }
2004
- .mushi-success-receipt-track {
2005
- display: inline-flex;
2006
- align-items: center;
2007
- justify-content: center;
2008
- gap: 4px;
2009
- padding: 6px 10px;
2010
- border-radius: 4px;
2011
- background: ${widgetAccent};
2012
- color: ${inverse};
2013
- font-family: ${fontMono};
2014
- font-size: 11px;
2015
- letter-spacing: 0.10em;
2016
- text-transform: uppercase;
2017
- text-decoration: none;
2018
- transition: filter ${durInstant}ms ease;
2019
- }
2020
- .mushi-success-receipt-track:hover,
2021
- .mushi-success-receipt-track:focus-visible {
2022
- filter: brightness(0.95);
2023
- outline: none;
2024
- }
2025
- .mushi-success-receipt-spinner {
2026
- width: 11px;
2027
- height: 11px;
2028
- border-radius: 50%;
2029
- border: 1.5px solid ${rule};
2030
- border-top-color: ${widgetAccent};
2031
- animation: mushi-receipt-spin 0.8s linear infinite;
2032
- }
2033
- @keyframes mushi-receipt-spin {
2034
- to { transform: rotate(360deg); }
2035
- }
2036
- .mushi-success-receipt-hint {
2037
- color: ${inkMuted};
2038
- font-style: italic;
2039
- }
2040
- .mushi-success-receipt-warn {
2041
- color: ${widgetAccent};
2042
- }
2043
- .mushi-success-my-reports {
2044
- display: block;
2045
- margin: 12px auto 0;
2046
- font-size: 12px;
2047
- font-family: ${fontMono};
2048
- color: ${widgetAccent};
2049
- text-decoration: underline;
2050
- text-underline-offset: 2px;
2051
- background: none;
2052
- border: none;
2053
- cursor: pointer;
2054
- padding: 4px 2px;
2055
- }
2056
- .mushi-success-my-reports:hover { opacity: 0.75; }
2057
- .mushi-success-sla {
2058
- margin-top: 2px;
2059
- font-family: ${fontDisplay};
2060
- font-size: 12px;
2061
- line-height: 1.45;
2062
- text-align: center;
2063
- color: ${inkMuted};
2064
- max-width: 260px;
2065
- }
2066
- .mushi-success-sla-default {
2067
- opacity: 0.85;
2068
- }
2069
-
2070
- @keyframes mushi-stamp-ring {
2071
- to { stroke-dashoffset: 0; }
2072
- }
2073
- @keyframes mushi-stamp-press {
2074
- 0% { opacity: 0; transform: rotate(-6deg) scale(1.3); }
2075
- 60% { opacity: 1; transform: rotate(-6deg) scale(0.94); }
2076
- 100% { opacity: 1; transform: rotate(-6deg) scale(1); }
2077
- }
2078
-
2079
- .mushi-error {
2080
- margin-top: 10px;
2081
- padding: 8px 0 8px 10px;
2082
- border-left: 2px solid ${widgetAccent};
2083
- color: ${widgetAccent};
2084
- font-size: 12px;
2085
- font-family: ${fontMono};
2086
- letter-spacing: 0.02em;
2087
- }
2088
-
2089
- /* \u2500\u2500 Rewards nudge (category step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2090
- .mushi-rewards-nudge {
2091
- border-top: 1px solid ${rule};
2092
- padding: 10px 0 4px;
2093
- margin-top: 6px;
2094
- }
2095
- .mushi-rewards-row {
2096
- display: flex;
2097
- align-items: center;
2098
- gap: 6px;
2099
- margin-bottom: 8px;
2100
- }
2101
- .mushi-tier-pip {
2102
- width: 7px;
2103
- height: 7px;
2104
- border-radius: 50%;
2105
- flex-shrink: 0;
2106
- }
2107
- .mushi-rewards-tier-name {
2108
- font-family: ${fontMono};
2109
- font-size: 11px;
2110
- letter-spacing: 0.08em;
2111
- text-transform: uppercase;
2112
- color: ${ink};
2113
- }
2114
- .mushi-rewards-pts-count {
2115
- font-family: ${fontMono};
2116
- font-size: 11px;
2117
- color: ${inkMuted};
2118
- margin-right: auto;
2119
- }
2120
- .mushi-rewards-pts-earn {
2121
- font-family: ${fontMono};
2122
- font-size: 10px;
2123
- color: ${widgetAccent};
2124
- letter-spacing: 0.04em;
2125
- white-space: nowrap;
2126
- }
2127
- .mushi-tier-bar-track {
2128
- height: 3px;
2129
- background: ${ruleStrong};
2130
- border-radius: 2px;
2131
- overflow: hidden;
2132
- margin-bottom: 5px;
2133
- }
2134
- .mushi-tier-bar-fill {
2135
- height: 100%;
2136
- width: 100%;
2137
- background: ${widgetAccent};
2138
- border-radius: 2px;
2139
- /* Meter fill \u2014 scaleX keeps compositor-friendly motion (docs/MOTION.md). */
2140
- transform-origin: left center;
2141
- transform: scaleX(var(--mushi-tier-pct, 0));
2142
- transition: transform ${durSlow}ms ${easeStamp};
2143
- }
2144
- .mushi-rewards-next-label {
2145
- font-family: ${fontMono};
2146
- font-size: 10px;
2147
- color: ${inkMuted};
2148
- text-align: right;
2149
- letter-spacing: 0.02em;
2150
- }
2151
-
2152
- /* \u2500\u2500 Rewards on success step \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2153
- .mushi-success-rewards {
2154
- margin-top: 14px;
2155
- padding-top: 12px;
2156
- border-top: 1px solid ${rule};
2157
- width: 100%;
2158
- }
2159
- .mushi-success-pts-award {
2160
- font-family: ${fontMono};
2161
- font-size: 22px;
2162
- font-weight: 700;
2163
- color: ${widgetAccent};
2164
- text-align: center;
2165
- letter-spacing: 0.06em;
2166
- margin-bottom: 10px;
2167
- opacity: 0;
2168
- animation: mushi-pts-pop ${durSlow}ms ${easeStamp} 900ms forwards;
2169
- }
2170
- .success-bar { margin: 0 0 5px; }
2171
-
2172
- @keyframes mushi-pts-pop {
2173
- from { opacity: 0; transform: scale(0.75) translateY(6px); }
2174
- to { opacity: 1; transform: scale(1) translateY(0); }
2175
- }
2176
-
2177
- /* \u2500\u2500\u2500 Beta mode strip (category step) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2178
- /* Brand palette: widgetAccent (vermillion) + washi ink for the strip.
2179
- The previous generic indigo purple is the single most recognisable AI-template
2180
- colour; replaced with the widget's own vermillion wash so the beta panel
2181
- reads as a Mushi-native surface rather than a generic SaaS plug-in. */
2182
-
2183
- .mushi-beta-strip {
2184
- margin: 0 16px 2px;
2185
- padding: 9px 12px;
2186
- background: ${widgetAccentWash};
2187
- border: 1px solid rgba(${accentRgb},${isDark ? "0.22" : "0.16"});
2188
- border-radius: 4px;
2189
- display: flex;
2190
- flex-direction: column;
2191
- gap: 4px;
2192
- }
2193
-
2194
- .mushi-beta-strip-row {
2195
- display: flex;
2196
- align-items: center;
2197
- gap: 8px;
2198
- }
2199
-
2200
- .mushi-beta-tag {
2201
- display: inline-flex;
2202
- align-items: center;
2203
- padding: 1px 6px;
2204
- border-radius: 3px;
2205
- background: ${widgetAccent};
2206
- color: ${onAccent};
2207
- font-family: ${fontMono};
2208
- font-size: 9px;
2209
- font-weight: 700;
2210
- letter-spacing: 0.14em;
2211
- line-height: 1.6;
2212
- white-space: nowrap;
2213
- flex-shrink: 0;
2214
- text-transform: uppercase;
2215
- }
2216
-
2217
- .mushi-beta-msg {
2218
- font-size: 11px;
2219
- color: ${inkMuted};
2220
- line-height: 1.45;
2221
- }
2222
-
2223
- .mushi-beta-contact-hint {
2224
- font-size: 10px;
2225
- color: ${inkFaint};
2226
- font-family: ${fontMono};
2227
- letter-spacing: 0.06em;
2228
- }
2229
-
2230
- .mushi-beta-perks {
2231
- list-style: none;
2232
- margin: 2px 0 0;
2233
- padding: 0;
2234
- display: flex;
2235
- flex-direction: column;
2236
- gap: 2px;
2237
- }
2238
-
2239
- .mushi-beta-perks li {
2240
- font-size: 12px;
2241
- color: ${widgetAccentInk};
2242
- font-weight: 500;
2243
- }
2244
-
2245
- /* \u2500\u2500\u2500 Beta changelog (collapsible What's new) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2246
-
2247
- .mushi-changelog {
2248
- margin-top: 5px;
2249
- }
2250
-
2251
- .mushi-changelog-summary {
2252
- font-size: 11px;
2253
- color: ${inkDim};
2254
- cursor: pointer;
2255
- list-style: none;
2256
- display: flex;
2257
- align-items: center;
2258
- gap: 4px;
2259
- user-select: none;
2260
- }
2261
-
2262
- .mushi-changelog-summary::before {
2263
- content: '\u25B6';
2264
- font-size: 7px;
2265
- opacity: 0.6;
2266
- transition: transform ${durInstant}ms ${easeStamp};
2267
- }
2268
-
2269
- .mushi-changelog[open] .mushi-changelog-summary::before {
2270
- transform: rotate(90deg);
2271
- }
2272
-
2273
- .mushi-changelog-list {
2274
- margin: 5px 0 0 4px;
2275
- padding: 0;
2276
- list-style: none;
2277
- display: flex;
2278
- flex-direction: column;
2279
- gap: 2px;
2280
- }
2281
-
2282
- .mushi-changelog-list li {
2283
- font-size: 11px;
2284
- color: ${inkDim};
2285
- line-height: 1.5;
2286
- }
2287
-
2288
- /* \u2500\u2500\u2500 Beta success footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2289
-
2290
- .mushi-beta-success-footer {
2291
- margin-top: 14px;
2292
- padding: 10px 14px;
2293
- background: ${widgetAccentWash};
2294
- border: 1px solid rgba(${accentRgb},${isDark ? "0.18" : "0.14"});
2295
- border-radius: 4px;
2296
- display: flex;
2297
- flex-direction: column;
2298
- gap: 3px;
2299
- text-align: left;
2300
- }
2301
-
2302
- .mushi-beta-success-line {
2303
- font-size: 12px;
2304
- color: ${widgetAccentInk};
2305
- line-height: 1.5;
2306
- }
2307
-
2308
- .mushi-beta-success-dim {
2309
- opacity: 0.65;
2310
- font-size: 12px;
2311
- }
2312
-
2313
- /* \u2500\u2500\u2500 Banner launcher (trigger: 'banner') \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2314
-
2315
- .mushi-banner {
2316
- position: fixed;
2317
- left: 0;
2318
- right: 0;
2319
- /* min-height (not fixed height) + border-box so the safe-area padding
2320
- below extends the bar into the notch/home-indicator zone instead of
2321
- letting content bleed under the status bar (mobile safe-area bleed
2322
- fix \u2014 Workstream C). Horizontal padding also clears the left/right
2323
- insets for landscape notches. */
2324
- box-sizing: border-box;
2325
- min-height: ${bannerHeight}px;
2326
- display: flex;
2327
- align-items: center;
2328
- justify-content: center;
2329
- gap: 10px;
2330
- padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
2331
- font-family: ${fontMono};
2332
- font-size: 12px;
2333
- letter-spacing: 0.04em;
2334
- white-space: nowrap;
2335
- overflow: hidden;
2336
- z-index: var(--mushi-banner-z, ${zBanner});
2337
- animation: mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;
2338
- }
2339
-
2340
- .mushi-banner.top { top: 0; padding-top: env(safe-area-inset-top, 0px); }
2341
- .mushi-banner.bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
2342
-
2343
- /* --- neon variant (electric lime \u2014 dev / beta tool aesthetic) --- */
2344
- .mushi-banner.neon {
2345
- background: ${neonBannerBg};
2346
- color: ${neonBannerFg};
2347
- border-bottom: 1.5px solid ${neonBannerBorder};
2348
- }
2349
- .mushi-banner.neon.bottom {
2350
- border-top: 1.5px solid ${neonBannerBorder};
2351
- border-bottom: none;
2352
- }
2353
- .mushi-banner.neon .mushi-banner-btn {
2354
- background: rgba(0,0,0,0.14);
2355
- color: ${neonBannerFg};
2356
- border: 1px solid rgba(0,0,0,0.22);
2357
- }
2358
- .mushi-banner.neon .mushi-banner-btn:hover {
2359
- background: rgba(0,0,0,0.22);
2360
- }
2361
-
2362
- /* --- brand variant (widgetAccent \u2014 editorial, app-quality) --- */
2363
- .mushi-banner.brand {
2364
- background: ${widgetAccent};
2365
- color: ${inverse};
2366
- border-bottom: 1.5px solid ${brandBannerBorder};
2367
- }
2368
- .mushi-banner.brand.bottom {
2369
- border-top: 1.5px solid ${brandBannerBorder};
2370
- border-bottom: none;
2371
- }
2372
- .mushi-banner.brand .mushi-banner-btn {
2373
- background: rgba(255,255,255,0.18);
2374
- color: ${inverse};
2375
- border: 1px solid rgba(255,255,255,0.32);
2376
- }
2377
- .mushi-banner.brand .mushi-banner-btn:hover {
2378
- background: rgba(255,255,255,0.28);
2379
- }
2380
-
2381
- /* --- subtle variant (frosted-glass, muted \u2014 least disruptive) ---
2382
- Uses the widget's own paper colour at high opacity + backdrop-blur so
2383
- it blends with the host app while remaining legible. The previous 4-6%
2384
- opacity values were effectively invisible \u2014 users could not distinguish
2385
- the banner from the page content below it. */
2386
- .mushi-banner.subtle {
2387
- background: ${isDark ? "rgba(15,14,12,0.88)" : "rgba(248,244,237,0.92)"};
2388
- backdrop-filter: blur(14px);
2389
- -webkit-backdrop-filter: blur(14px);
2390
- color: ${ink};
2391
- border-bottom: 1px solid ${ruleStrong};
2392
- }
2393
- .mushi-banner.subtle.bottom {
2394
- border-top: 1px solid ${ruleStrong};
2395
- border-bottom: none;
2396
- }
2397
- .mushi-banner.subtle .mushi-banner-btn {
2398
- background: ${isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.08)"};
2399
- color: ${ink};
2400
- border: 1px solid ${ruleStrong};
2401
- }
2402
- .mushi-banner.subtle .mushi-banner-btn:hover {
2403
- background: ${isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.14)"};
2404
- }
2405
-
2406
- .mushi-banner-label {
2407
- flex: 1;
2408
- text-align: center;
2409
- overflow: hidden;
2410
- text-overflow: ellipsis;
2411
- }
2412
-
2413
- /* Rich layout \u2014 pill + message + flat text actions (admin BetaBanner parity) */
2414
- .mushi-banner--rich {
2415
- justify-content: space-between;
2416
- gap: 12px;
2417
- min-height: ${bannerHeight}px;
2418
- height: auto;
2419
- padding: 4px 12px 4px 16px;
2420
- white-space: normal;
2421
- }
2422
- .mushi-banner-body {
2423
- display: flex;
2424
- align-items: center;
2425
- gap: 8px;
2426
- flex: 1;
2427
- min-width: 0;
2428
- overflow: hidden;
2429
- }
2430
- .mushi-banner-pill {
2431
- display: inline-flex;
2432
- flex-shrink: 0;
2433
- align-items: center;
2434
- padding: 1px 6px;
2435
- border-radius: 3px;
2436
- border: 1px solid currentColor;
2437
- font-size: 10px;
2438
- font-weight: 700;
2439
- letter-spacing: 0.18em;
2440
- text-transform: uppercase;
2441
- opacity: 0.92;
2442
- }
2443
- .mushi-banner.neon .mushi-banner-pill {
2444
- border-color: rgba(10,26,10,0.45);
2445
- background: rgba(10,26,10,0.12);
2446
- }
2447
- .mushi-banner.brand .mushi-banner-pill {
2448
- border-color: rgba(255,255,255,0.45);
2449
- background: rgba(255,255,255,0.14);
2450
- }
2451
- .mushi-banner.subtle .mushi-banner-pill {
2452
- border-color: ${ruleStrong};
2453
- background: ${isDark ? "rgba(242,235,221,0.08)" : "rgba(14,13,11,0.06)"};
2454
- }
2455
- .mushi-banner-message {
2456
- min-width: 0;
2457
- overflow: hidden;
2458
- text-overflow: ellipsis;
2459
- white-space: nowrap;
2460
- font-size: 12px;
2461
- font-weight: 500;
2462
- line-height: 1.3;
2463
- opacity: 0.9;
2464
- }
2465
- .mushi-banner-actions {
2466
- display: inline-flex;
2467
- align-items: center;
2468
- gap: 0;
2469
- /* Shrinkable + swipe-scrollable so a long action row can never push
2470
- past the viewport edge (dismiss sits outside this nav). */
2471
- flex-shrink: 1;
2472
- min-width: 0;
2473
- overflow-x: auto;
2474
- scrollbar-width: none;
2475
- font-size: 11px;
2476
- }
2477
- .mushi-banner-actions::-webkit-scrollbar { display: none; }
2478
- @media (max-width: ${panelSheetBreakpoint}px) {
2479
- /* Phones: keep only the primary bug CTA (+ dismiss outside the nav). */
2480
- .mushi-banner-actions .mushi-banner-extra { display: none; }
2481
- }
2482
- .mushi-banner-link {
2483
- display: inline-flex;
2484
- align-items: center;
2485
- padding: 2px 8px;
2486
- border: none;
2487
- background: transparent;
2488
- color: inherit;
2489
- cursor: pointer;
2490
- font: inherit;
2491
- letter-spacing: inherit;
2492
- text-decoration: none;
2493
- opacity: 0.88;
2494
- transition: opacity ${durInstant}ms ${easeStamp};
2495
- flex-shrink: 0;
2496
- }
2497
- .mushi-banner-link:hover { opacity: 1; }
2498
- .mushi-banner-link:focus-visible {
2499
- outline: 2px solid ${widgetAccent};
2500
- outline-offset: 2px;
2501
- border-radius: 2px;
2502
- }
2503
- .mushi-banner-divider {
2504
- opacity: 0.28;
2505
- padding: 0 1px;
2506
- user-select: none;
2507
- flex-shrink: 0;
2508
- }
2509
- .mushi-banner--rich .mushi-banner-dismiss {
2510
- margin-left: 4px;
2511
- }
2512
-
2513
- .mushi-banner-btn {
2514
- display: inline-flex;
2515
- align-items: center;
2516
- gap: 4px;
2517
- padding: 3px 10px;
2518
- border-radius: 3px;
2519
- cursor: pointer;
2520
- font: inherit;
2521
- letter-spacing: inherit;
2522
- transition: opacity ${durInstant}ms ${easeStamp};
2523
- flex-shrink: 0;
2524
- height: 24px;
2525
- line-height: 1;
2526
- }
2527
- .mushi-banner-btn:focus-visible {
2528
- outline: 2px solid ${widgetAccent};
2529
- outline-offset: 2px;
2530
- }
2531
-
2532
- .mushi-banner-dismiss {
2533
- background: transparent !important;
2534
- border: none !important;
2535
- opacity: 0.65;
2536
- cursor: pointer;
2537
- font-size: 14px;
2538
- line-height: 1;
2539
- padding: 4px 8px;
2540
- margin-left: auto;
2541
- flex-shrink: 0;
2542
- color: inherit;
2543
- border-radius: 3px;
2544
- transition: opacity ${durInstant}ms ${easeStamp};
2545
- }
2546
- .mushi-banner-dismiss:hover {
2547
- opacity: 1;
2548
- background: rgba(0,0,0,0.12) !important;
2549
- }
2550
- .mushi-banner.neon .mushi-banner-dismiss:hover { background: rgba(0,0,0,0.18) !important; }
2551
-
2552
- /* "My reports" link in the simple (non-rich) banner layout */
2553
- .mushi-banner-my-reports {
2554
- background: transparent;
2555
- border: none;
2556
- cursor: pointer;
2557
- font-size: 11px;
2558
- font-family: ${fontMono};
2559
- opacity: 0.75;
2560
- color: inherit;
2561
- padding: 2px 6px;
2562
- border-radius: 3px;
2563
- white-space: nowrap;
2564
- flex-shrink: 0;
2565
- transition: opacity ${durInstant}ms ${easeStamp};
2566
- margin-left: 4px;
2567
- }
2568
- .mushi-banner-my-reports:hover {
2569
- opacity: 1;
2570
- background: rgba(0,0,0,0.10);
2571
- }
2572
- .mushi-banner.neon .mushi-banner-my-reports:hover { background: rgba(0,0,0,0.18); }
2573
-
2574
- @keyframes mushi-banner-slide-in {
2575
- from { transform: translateY(calc(-1 * 100%)); opacity: 0.5; }
2576
- to { transform: translateY(0); opacity: 1; }
2577
- }
2578
- .mushi-banner.bottom {
2579
- animation-name: mushi-banner-slide-in-bottom;
2580
- }
2581
- @keyframes mushi-banner-slide-in-bottom {
2582
- from { transform: translateY(100%); opacity: 0.5; }
2583
- to { transform: translateY(0); opacity: 1; }
2584
- }
2585
-
2586
- @media (prefers-reduced-motion: reduce) {
2587
- *,
2588
- *::before,
2589
- *::after {
2590
- animation-duration: 0.001ms !important;
2591
- animation-iteration-count: 1 !important;
2592
- transition-duration: 0.001ms !important;
2593
- }
2594
- .mushi-success-stamp circle { stroke-dashoffset: 0; }
2595
- .mushi-success-stamp-label { opacity: 1; }
2596
- .mushi-success-pts-award { opacity: 1; }
2597
- }
2598
-
2599
- .mushi-community-footer{display:flex;align-items:center;gap:8px;padding:10px 0 2px;border-top:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.07)"};margin-top:8px;flex-wrap:wrap}
2600
- .mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2601
- .mushi-section-label{
2602
- margin:0 0 6px;
2603
- font-family:${fontMono};
2604
- font-size:11px;
2605
- letter-spacing:0.06em;
2606
- text-transform:uppercase;
2607
- color:${inkFaint};
2608
- }
2609
- .mushi-more-nav{margin-top:4px}
2610
- .mushi-more-nav-panel{display:flex;flex-direction:column;gap:0;border-top:1px dashed ${rule};padding-top:2px}
2611
- .mushi-more-nav-link{align-self:flex-start;margin:6px 0 2px;padding:0}
2612
- /* \u2500\u2500 "More issue types \u2192" toggle (progressive disclosure) \u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2613
- .mushi-more-toggle {
2614
- display: flex;
2615
- align-items: center;
2616
- gap: 8px;
2617
- width: 100%;
2618
- padding: 11px 0;
2619
- border: none;
2620
- border-top: 1px dashed ${rule};
2621
- background: transparent;
2622
- cursor: pointer;
2623
- color: ${inkMuted};
2624
- font-family: ${fontBody};
2625
- font-size: 13px;
2626
- text-align: left;
2627
- transition: opacity ${durFast}ms ${easeStamp};
2628
- }
2629
- .mushi-more-toggle:hover { color: ${widgetAccent}; }
2630
- .mushi-more-toggle:hover .mushi-more-toggle-arrow { transform: translateX(3px); }
2631
- .mushi-more-toggle-text { flex: 1; }
2632
- .mushi-more-toggle-count {
2633
- font-family: ${fontMono};
2634
- font-size: 10px;
2635
- letter-spacing: 0.08em;
2636
- text-transform: uppercase;
2637
- color: ${inkFaint};
2638
- background: ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.06)"};
2639
- padding: 2px 6px;
2640
- border-radius: 10px;
2641
- }
2642
- .mushi-more-toggle-arrow {
2643
- font-size: 14px;
2644
- opacity: 0.5;
2645
- transition: transform ${durFast}ms ${easeStamp};
2646
- }
2647
- /* \u2500\u2500 Step slide-in \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2648
- @keyframes mushi-step-in {
2649
- 0% { opacity: 0; transform: translateX(8px); }
2650
- 100% { opacity: 1; transform: translateX(0); }
2651
- }
2652
- .mushi-body {
2653
- animation: mushi-step-in 160ms ease both;
2654
- }
2655
- @media (prefers-reduced-motion: reduce) {
2656
- .mushi-body { animation: none; }
2657
- }
2658
- /* Expanded secondary categories animate in */
2659
- .mushi-categories-expanded {
2660
- animation: mushi-step-in ${durFast}ms ${easeStamp} both;
2661
- }
2662
- .mushi-link-btn{background:none;border:none;padding:4px 2px;cursor:pointer;color:${widgetAccent};font-size:12px;font-family:${fontMono};text-decoration:underline;text-underline-offset:2px}
2663
- .mushi-link-btn:hover{opacity:0.8}
2664
- .mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}
2665
- .mushi-nav-item{display:block;width:100%;text-align:left;background:${isDark ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.04)"};border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.08)"};border-radius:8px;padding:10px 14px;margin-bottom:8px;cursor:pointer;font-size:13px;color:${ink};transition:opacity ${durInstant}ms ${easeStamp}}
2666
- .mushi-nav-item:hover{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(0,0,0,0.07)"}}
2667
- .mushi-account-card{display:flex;align-items:center;gap:12px;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"};border-radius:10px;padding:12px 14px;margin-bottom:14px}
2668
- .mushi-account-avatar{width:40px;height:40px;border-radius:50%;background:${widgetAccentWash};color:${widgetAccentInk};display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;flex-shrink:0}
2669
- .mushi-account-info{display:flex;flex-direction:column;gap:2px;min-width:0}
2670
- .mushi-account-info strong{font:700 14px/1.3 inherit;color:${ink}}
2671
- .mushi-account-rank,.mushi-xapp-app-name,.mushi-label{font-size:12px;color:${inkDim};font-family:${fontMono}}
2672
- .mushi-account-rank{display:block}
2673
- .mushi-xapp-app-head{display:flex;align-items:center;gap:8px;margin:0 0 6px}
2674
- .mushi-xapp-app-name{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin:0}
2675
- .mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:1px solid ${isDark ? "rgba(255,255,255,0.12)" : "rgba(0,0,0,0.1)"};background:${paperRaised};overflow:hidden;flex-shrink:0}
2676
- .mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain}
2677
- .mushi-app-icon-initials{font-size:9px;font-weight:700;color:${inkDim};line-height:1}
2678
- .mushi-app-icon-initials-only{background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"}}
2679
- .mushi-header-host-icon{display:block;width:20px;height:20px;border-radius:4px;object-fit:contain}
2680
- .mushi-xapp-group{margin-bottom:14px}
2681
- .mushi-label{display:block;font-weight:600;margin-bottom:6px}
2682
-
2683
- /* \u2500\u2500 Assistant tab (P5) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2684
- .mushi-assistant{display:flex;flex-direction:column;height:100%;min-height:0;max-height:60vh}
2685
- .mushi-assistant-log{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px 8px}
2686
- .mushi-assistant-greeting{font:400 14px/1.5 ${fontBody};color:${inkMuted};padding:6px 2px}
2687
- .mushi-assistant-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
2688
- .mushi-assistant-chip{background:${widgetAccentWash};color:${widgetAccentInk};border:1px solid ${ruleStrong};border-radius:999px;padding:5px 12px;font-size:12px;cursor:pointer;font-family:${fontBody};transition:opacity ${durInstant}ms ${easeStamp},transform ${durInstant}ms ${easeStamp}}
2689
- .mushi-assistant-chip:hover{background:rgba(${accentRgb},${isDark ? "0.22" : "0.14"})}
2690
- .mushi-assistant-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2691
- .mushi-assistant-msg{max-width:85%;padding:8px 12px;border-radius:12px;font:400 14px/1.45 ${fontBody};white-space:pre-wrap;word-break:break-word}
2692
- .mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:${inverse};border-bottom-right-radius:4px}
2693
- .mushi-assistant-msg-bot{align-self:flex-start;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.05)"};color:${ink};border-bottom-left-radius:4px}
2694
- .mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}
2695
- .mushi-assistant-error{align-self:flex-start;color:${danger};font-size:12px;padding:4px 2px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
2696
- .mushi-assistant-recovery{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
2697
- .mushi-assistant-recovery-footer{margin-top:4px;padding-top:4px}
2698
- .mushi-assistant-report-cta{background:${widgetAccent};color:${inverse};border:none;border-radius:999px;padding:6px 14px;font-size:12px;cursor:pointer;font-family:${fontBody};font-weight:600}
2699
- .mushi-assistant-report-cta:hover{opacity:0.92}
2700
- .mushi-assistant-report-cta:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2701
- .mushi-assistant-report-link{background:transparent;color:${widgetAccentInk};border:none;padding:0;font-size:12px;cursor:pointer;font-family:${fontBody};text-decoration:underline;text-underline-offset:2px}
2702
- .mushi-assistant-report-link:hover{opacity:0.85}
2703
- .mushi-assistant-report-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2704
- .mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${rule};padding-top:8px}
2705
- .mushi-assistant-input{flex:1;resize:none;max-height:120px;border:1px solid ${ruleStrong};border-radius:10px;padding:8px 12px;font:400 14px/1.4 ${fontBody};background:${paper};color:${ink}}
2706
- .mushi-assistant-input:focus-visible{outline:2px solid ${widgetAccent};outline-offset:1px}
2707
- .mushi-assistant-submit{flex-shrink:0;width:36px;height:36px;border:none;border-radius:50%;background:${widgetAccent};color:${inverse};font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,opacity .15s}
2708
- .mushi-assistant-submit:hover{transform:translateY(-1px)}
2709
- .mushi-assistant-submit:disabled{opacity:0.5;cursor:default;transform:none}
2710
- .mushi-assistant-submit:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2711
- `;
2712
- }
2713
-
2714
- // src/version.ts
2715
- var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
2716
- var MUSHI_SDK_VERSION = "1.28.0" ;
2717
- var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
2718
- function loadAssistantSession() {
2719
- try {
2720
- if (typeof sessionStorage === "undefined") return null;
2721
- const raw = sessionStorage.getItem(ASSISTANT_SESSION_STORAGE_KEY);
2722
- if (!raw) return null;
2723
- const parsed = JSON.parse(raw);
2724
- if (!parsed || typeof parsed !== "object") return null;
2725
- const record = parsed;
2726
- const turns = Array.isArray(record.turns) ? record.turns : null;
2727
- if (!turns) return null;
2728
- const normalized = [];
2729
- for (const item of turns) {
2730
- if (!item || typeof item !== "object") continue;
2731
- const t = item;
2732
- if (t.role !== "user" && t.role !== "assistant") continue;
2733
- if (typeof t.text !== "string") continue;
2734
- const turn = { role: t.role, text: t.text };
2735
- if (Array.isArray(t.options)) {
2736
- const options = t.options.filter((o) => typeof o === "string");
2737
- if (options.length) turn.options = options;
2738
- }
2739
- if (t.offerReport === true) turn.offerReport = true;
2740
- normalized.push(turn);
2741
- }
2742
- const threadId = typeof record.threadId === "string" && record.threadId.length > 0 ? record.threadId : null;
2743
- return { turns: normalized, threadId };
2744
- } catch {
2745
- return null;
2746
- }
2747
- }
2748
- function saveAssistantSession(snapshot) {
2749
- try {
2750
- if (typeof sessionStorage === "undefined") return;
2751
- if (!snapshot.turns.length && !snapshot.threadId) {
2752
- sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
2753
- return;
2754
- }
2755
- sessionStorage.setItem(ASSISTANT_SESSION_STORAGE_KEY, JSON.stringify(snapshot));
2756
- } catch {
2757
- }
2758
- }
2759
- function clearAssistantSession() {
2760
- try {
2761
- if (typeof sessionStorage === "undefined") return;
2762
- sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
2763
- } catch {
2764
- }
2765
- }
2766
- var CATEGORY_ICONS = {
2767
- bug: "\u26A0\uFE0F",
2768
- slow: "\u{1F40C}",
2769
- visual: "\u{1F3A8}",
2770
- confusing: "\u{1F615}",
2771
- other: "\u{1F4DD}"
2772
- };
2773
- var FEATURE_REQUEST_INTENT = "Feature request";
2774
- function reporterStatusShort(status) {
2775
- switch (status) {
2776
- case "new":
2777
- case "queued":
2778
- case "pending":
2779
- case "submitted":
2780
- return "Sent";
2781
- case "classified":
2782
- case "triaged":
2783
- case "grouped":
2784
- case "dispatched":
2785
- return "Review";
2786
- case "fixing":
2787
- return "Fixing";
2788
- case "fixed":
2789
- case "resolved":
2790
- case "completed":
2791
- return "Fixed";
2792
- case "dismissed":
2793
- return "Closed";
2794
- default:
2795
- return status.replace(/_/g, " ").slice(0, 12);
2796
- }
2797
- }
2798
- function reporterStatusLabel(status) {
2799
- switch (status) {
2800
- case "new":
2801
- case "queued":
2802
- case "pending":
2803
- case "submitted":
2804
- return "Submitted";
2805
- case "classified":
2806
- case "triaged":
2807
- case "grouped":
2808
- case "dispatched":
2809
- return "In review";
2810
- case "fixing":
2811
- return "Fix in progress";
2812
- case "fixed":
2813
- case "resolved":
2814
- case "completed":
2815
- return "Fixed \u2014 confirm?";
2816
- case "verified":
2817
- return "Verified";
2818
- case "reopened":
2819
- return "Reopened";
2820
- case "dismissed":
2821
- return "Closed";
2822
- default:
2823
- return status.replace(/_/g, " ");
2824
- }
2825
- }
2826
- function reporterStatusTone(status) {
2827
- switch (status) {
2828
- case "new":
2829
- case "queued":
2830
- case "pending":
2831
- case "submitted":
2832
- return "sent";
2833
- case "classified":
2834
- case "triaged":
2835
- case "grouped":
2836
- case "dispatched":
2837
- return "review";
2838
- case "fixing":
2839
- return "fixing";
2840
- case "fixed":
2841
- case "resolved":
2842
- case "completed":
2843
- return "fixed";
2844
- case "verified":
2845
- return "fixed";
2846
- case "reopened":
2847
- return "fixing";
2848
- case "dismissed":
2849
- return "closed";
2850
- default:
2851
- return "unknown";
2852
- }
2853
- }
2854
- function formatRelativeTime(iso) {
2855
- const then = Date.parse(iso);
2856
- if (Number.isNaN(then)) return "";
2857
- const diffMs = Date.now() - then;
2858
- if (diffMs < 0) return "just now";
2859
- const sec = Math.floor(diffMs / 1e3);
2860
- if (sec < 60) return "just now";
2861
- const min = Math.floor(sec / 60);
2862
- if (min < 60) return `${min}m ago`;
2863
- const hr = Math.floor(min / 60);
2864
- if (hr < 24) return `${hr}h ago`;
2865
- const day = Math.floor(hr / 24);
2866
- if (day < 7) return `${day}d ago`;
2867
- const week = Math.floor(day / 7);
2868
- if (week < 5) return `${week}w ago`;
2869
- return new Date(then).toLocaleDateString(void 0, { month: "short", day: "numeric" });
2870
- }
2871
- function pad2(n) {
2872
- return n < 10 ? `0${n}` : String(n);
2873
- }
2874
- var TOTAL_STEPS = 3;
2875
- var STEP_NUMBER = {
2876
- category: 1,
2877
- intent: 2,
2878
- details: 3};
2879
- function isSubmitShortcut(e) {
2880
- return (e.metaKey || e.ctrlKey) && e.key === "Enter";
2881
- }
2882
- function escapeHtml(value) {
2883
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2884
- }
2885
- function renderAppIconHtml(opts) {
2886
- const domain = opts.appDomain ?? resolveProjectDomain({
2887
- project_id: opts.projectId,
2888
- project_name: opts.appName,
2889
- project_slug: opts.appSlug ?? ""
2890
- });
2891
- const initials = escapeHtml(projectInitials(opts.appName));
2892
- const candidates = projectFaviconUrlCandidates({
2893
- project_id: opts.projectId,
2894
- project_name: opts.appName,
2895
- project_slug: opts.appSlug ?? "",
2896
- sdk_origin: opts.appDomain ? `https://${opts.appDomain}` : null
2897
- });
2898
- if (!candidates.length) {
2899
- return `<span class="mushi-app-icon mushi-app-icon-initials-only" aria-hidden="true">${initials}</span>`;
2900
- }
2901
- const encoded = escapeHtml(JSON.stringify(candidates));
2902
- return `<span class="mushi-app-icon" data-mushi-favicon data-candidates="${encoded}" data-initials="${initials}" aria-hidden="true" title="${escapeHtml(domain ?? opts.appName)}">
2903
- <img class="mushi-app-icon-img" src="${escapeHtml(candidates[0])}" alt="" referrerpolicy="no-referrer" width="16" height="16" />
2904
- <span class="mushi-app-icon-initials" hidden>${initials}</span>
2905
- </span>`;
2906
- }
2907
- function bindFaviconFallbacks(root) {
2908
- root.querySelectorAll("[data-mushi-favicon]").forEach((wrap) => {
2909
- const img = wrap.querySelector(".mushi-app-icon-img");
2910
- const fallback = wrap.querySelector(".mushi-app-icon-initials");
2911
- if (!img || !fallback) return;
2912
- let candidates = [];
2913
- try {
2914
- candidates = JSON.parse(wrap.dataset.candidates ?? "[]");
2915
- } catch {
2916
- candidates = [];
2917
- }
2918
- let index = 0;
2919
- const tryNext = () => {
2920
- index += 1;
2921
- if (index < candidates.length) {
2922
- img.src = candidates[index];
2923
- } else {
2924
- img.remove();
2925
- fallback.hidden = false;
2926
- wrap.classList.add("mushi-app-icon-initials-only");
2927
- }
2928
- };
2929
- img.onerror = tryNext;
2930
- img.onload = () => {
2931
- if (isLikelyGenericFavicon(img)) tryNext();
2932
- };
2933
- });
1258
+ neonBannerBorder,
1259
+ brandBannerBorder,
1260
+ statusSent,
1261
+ statusReview,
1262
+ statusFixing,
1263
+ statusFixed,
1264
+ statusClosedBg,
1265
+ fontDisplay,
1266
+ fontBody,
1267
+ fontMono,
1268
+ easeStamp,
1269
+ zBanner,
1270
+ fabSize
1271
+ } = v;
1272
+ const { sizeBody, sizeLabel, lineBody } = MUSHI_TYPE;
1273
+ const { durationFast } = MUSHI_MOTION;
1274
+ const {
1275
+ instant: durInstant,
1276
+ fast: durFast,
1277
+ base: durBase,
1278
+ panel: durPanel,
1279
+ slow: durSlow,
1280
+ ring: durRing
1281
+ } = MUSHI_DURATION;
1282
+ const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = MUSHI_GEOMETRY;
1283
+ const panelLauncherGap = fabSize + MUSHI_SPACING.comfy;
1284
+ const { base: zBase } = MUSHI_Z;
1285
+ const controlRadius = MUSHI_RADIUS.control;
1286
+ const cardRadius = MUSHI_RADIUS.card;
1287
+ const {
1288
+ tight: spaceTight,
1289
+ snug: spaceSnug,
1290
+ comfy: spaceComfy,
1291
+ roomy: spaceRoomy,
1292
+ lounge: spaceLounge,
1293
+ open: spaceOpen,
1294
+ wide: spaceWide
1295
+ } = MUSHI_SPACING;
1296
+ const touchMin = 44;
1297
+ return ` :host{all:initial;font-family:${fontBody};font-size:${sizeBody}px;line-height:${lineBody};color:${ink};-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:'ss01','cv11';--mushi-ok:${ok};--mushi-space-tight:${spaceTight}px;--mushi-space-snug:${spaceSnug}px;--mushi-space-comfy:${spaceComfy}px;--mushi-space-roomy:${spaceRoomy}px;--mushi-space-lounge:${spaceLounge}px;--mushi-space-open:${spaceOpen}px;--mushi-space-wide:${spaceWide}px;--mushi-radius-control:${controlRadius}px;--mushi-radius-card:${cardRadius}px;--mushi-touch-min:${touchMin}px;--mushi-accent-rgb:${accentRgb};--mushi-shadow-ink:${shadowInk};pointer-events:none;}.mushi-trigger,.mushi-banner,.mushi-panel{pointer-events:auto;}*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}button{font-family:inherit;}.mushi-trigger{position:fixed;width:${fabSize}px;height:${fabSize}px;min-width:var(--mushi-touch-min);min-height:var(--mushi-touch-min);border:1px solid ${ruleStrong};border-radius:${controlRadius}px;background:${paper};color:${ink};cursor:pointer;display:flex;align-items:center;justify-content:center;font-family:${fontDisplay};font-size:22px;line-height:1;box-shadow:0 1px 0 ${rule},0 6px 14px -8px rgba(${shadowInk},0.35),inset 0 -3px 0 ${widgetAccent};transition:transform ${durationFast}ms ${easeStamp},opacity ${durationFast}ms ${easeStamp};overflow:visible;isolation:isolate;}.mushi-trigger::after{content:'';position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:${widgetAccent};box-shadow:0 0 0 0 ${widgetAccent};animation:mushi-pulse 2.4s ${easeStamp} infinite;}.mushi-trigger:hover{transform:translateY(-2px) rotate(-1.5deg);box-shadow:0 1px 0 ${rule},0 14px 24px -10px rgba(${shadowInk},0.45),0 0 20px -6px rgba(${accentRgb},0.22),inset 0 -3px 0 ${widgetAccent};}.mushi-trigger:active{transform:translateY(0) rotate(0);box-shadow:0 1px 0 ${rule},0 2px 4px -2px rgba(${shadowInk},0.35),inset 0 -2px 0 ${widgetAccent};}.mushi-trigger:focus-visible{outline:2px solid ${widgetAccent};outline-offset:3px;}@keyframes mushi-trigger-pulse{0%{box-shadow:0 0 0 0 rgba(${accentRgb},0.55),0 1px 0 ${rule},0 10px 24px -14px rgba(${shadowInk},0.45);}70%{box-shadow:0 0 0 16px rgba(${accentRgb},0),0 1px 0 ${rule},0 10px 24px -14px rgba(${shadowInk},0.45);}100%{box-shadow:0 0 0 0 rgba(${accentRgb},0),0 1px 0 ${rule},0 10px 24px -14px rgba(${shadowInk},0.45);}}.mushi-trigger-pulse{animation:mushi-trigger-pulse 800ms ${easeStamp} 3;}@media (prefers-reduced-motion:reduce){.mushi-trigger-pulse{animation:none;}}.mushi-trigger.bottom-right{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.bottom-left{bottom:var(--mushi-bottom,calc(${gutter}px + env(safe-area-inset-bottom,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.top-right{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));}.mushi-trigger.top-left{top:var(--mushi-top,calc(${gutter}px + env(safe-area-inset-top,0px)));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));}.mushi-trigger.edge-tab{width:${edgeTabWidth}px;height:88px;border-radius:${controlRadius}px 0 0 ${controlRadius}px;writing-mode:vertical-rl;text-orientation:upright;font-size:16px;box-shadow:0 1px 0 ${rule},0 10px 24px -14px rgba(${shadowInk},0.45),inset -3px 0 0 ${widgetAccent};}.mushi-trigger.edge-tab.bottom-right,.mushi-trigger.edge-tab.top-right{right:var(--mushi-right,0);}.mushi-trigger.edge-tab.bottom-left,.mushi-trigger.edge-tab.top-left{left:var(--mushi-left,0);border-radius:0 ${controlRadius}px ${controlRadius}px 0;box-shadow:0 1px 0 ${rule},0 10px 24px -14px rgba(${shadowInk},0.45),inset 3px 0 0 ${widgetAccent};}.mushi-trigger.shrunk{width:${bannerHeight}px;height:${bannerHeight}px;opacity:0.82;transform:scale(0.92);}.mushi-trigger{touch-action:none;translate:calc(var(--mushi-drag-active,0) * var(--mushi-drag-x,0px)) calc(var(--mushi-drag-active,0) * var(--mushi-drag-y,0px));}.mushi-trigger.dragging{cursor:grabbing !important;z-index:calc(var(--z,${zBase}) + 2);transition:none !important;box-shadow:0 1px 0 ${rule},0 20px 40px -12px rgba(${shadowInk},0.55),inset 0 -3px 0 ${widgetAccent};opacity:0.92;}@media (prefers-reduced-motion:reduce){.mushi-trigger{transition:none !important;}}@keyframes mushi-pulse{0%{box-shadow:0 0 0 0 ${widgetAccent};opacity:1;}70%{box-shadow:0 0 0 8px ${widgetAccent}00;opacity:0.5;}100%{box-shadow:0 0 0 0 ${widgetAccent}00;opacity:1;}}.mushi-panel{position:fixed;width:${panelWidth}px;max-width:calc(100vw - ${MUSHI_SPACING.wide}px);max-height:min(${panelMaxHeight}px,calc(100dvh - 120px - var(--mushi-keyboard-inset,0px)));background:${paper};border:1px solid ${ruleStrong};border-radius:6px;box-shadow:0 1px 0 ${rule},0 24px 56px -20px rgba(${shadowInk},0.30),0 8px 16px -8px rgba(${shadowInk},0.20);overflow:hidden;display:flex;flex-direction:column;transform-origin:var(--mushi-origin,bottom right);transition:bottom ${durInstant}ms ease,top ${durInstant}ms ease,max-height ${durInstant}ms ease;}.mushi-panel.keyboard-open{bottom:calc(var(--mushi-keyboard-inset,0px) + 8px) !important;}@media (max-width:${panelSheetBreakpoint}px){.mushi-panel{left:0 !important;right:0 !important;width:100% !important;max-width:100% !important;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:var(--mushi-keyboard-inset,0px) !important;}.mushi-panel.keyboard-open{bottom:calc(var(--mushi-keyboard-inset,0px) + 4px) !important;}}.mushi-panel.open{animation:mushi-stamp-in ${durPanel}ms ${easeStamp} both;}.mushi-panel.closed{display:none;}.mushi-panel.bottom-right{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:bottom right;}.mushi-panel.bottom-left{bottom:var(--mushi-panel-bottom,calc(var(--mushi-bottom,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:bottom left;}.mushi-panel.top-right{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));right:var(--mushi-right,calc(${gutter}px + env(safe-area-inset-right,0px)));--mushi-origin:top right;}.mushi-panel.top-left{top:var(--mushi-panel-top,calc(var(--mushi-top,${gutter}px) + ${panelLauncherGap}px));left:var(--mushi-left,calc(${gutter}px + env(safe-area-inset-left,0px)));--mushi-origin:top left;}.mushi-outdated{margin:12px 14px 0;padding:10px 12px;border:1px solid ${widgetAccentWash};background:${widgetAccentWash};color:${widgetAccentInk};font-family:${fontBody};font-size:12px;line-height:1.4;}.mushi-outdated strong{display:block;font-family:${fontMono};font-size:10px;letter-spacing:0.12em;text-transform:uppercase;margin-bottom:2px;}.mushi-outdated span{display:block;margin-top:3px;color:${inkMuted};}@keyframes mushi-stamp-in{0%{opacity:0;transform:scale(0.94) translateY(6px);}60%{opacity:1;}100%{opacity:1;transform:scale(1) translateY(0);}}.mushi-header{padding:13px 18px 10px;border-bottom:1px solid ${rule};display:grid;grid-template-columns:auto 1fr auto;align-items:end;gap:10px;}.mushi-header-mark{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:3px;background:${widgetAccent};color:${onAccent};font-family:${fontDisplay};font-size:14px;font-weight:600;line-height:1;letter-spacing:-0.02em;transform:rotate(-3deg);flex-shrink:0;}.mushi-header-titles{min-width:0;display:flex;flex-direction:column;gap:2px;}.mushi-header-eyebrow{font-family:${fontMono};font-size:10px;letter-spacing:0.18em;text-transform:uppercase;color:${inkMuted};}.mushi-header h3{font-family:${fontDisplay};font-size:19px;font-weight:500;line-height:1.15;letter-spacing:-0.01em;color:${ink};}.mushi-header-meta{align-self:start;display:flex;align-items:center;gap:6px;}.mushi-step-counter{font-family:${fontMono};font-size:11px;color:${inkMuted};letter-spacing:0.06em;tab-size:2ch;padding-top:2px;}.mushi-step-counter b{font-weight:600;color:${ink};}.mushi-close{background:none;border:none;cursor:pointer;padding:2px 4px;color:${inkMuted};font-family:${fontBody};font-size:16px;line-height:1;border-radius:0;transition:opacity ${durInstant}ms ${easeStamp};}.mushi-back{align-self:flex-start;background:none;border:none;cursor:pointer;padding:3px 0;margin:0 0 2px;min-height:22px;color:${inkMuted};font-family:${fontMono};font-size:11px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase;line-height:1.2;border-radius:0;display:inline-flex;align-items:center;gap:4px;transition:opacity ${durInstant}ms ${easeStamp};white-space:nowrap;}.mushi-close:hover{color:${widgetAccent};}.mushi-back:hover{color:${ink};}.mushi-close:focus-visible{outline:1.5px solid ${widgetAccent};outline-offset:2px;}.mushi-back:focus-visible{outline:none;color:${widgetAccent};text-decoration:underline;text-underline-offset:3px;}.mushi-body{padding:8px 22px 16px;overflow-y:auto;flex:1;min-height:0;scrollbar-width:thin;scrollbar-color:${inkFaint} transparent;}.mushi-body::-webkit-scrollbar{width:6px;}.mushi-body::-webkit-scrollbar-thumb{background:${inkFaint};border-radius:3px;}.mushi-option-btn{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:${spaceComfy}px;width:100%;min-height:var(--mushi-touch-min);padding:${spaceComfy}px 0;border:none;border-bottom:1px solid ${rule};background:transparent;cursor:pointer;color:inherit;text-align:left;transition:transform ${durBase}ms ${easeStamp},opacity ${durBase}ms ${easeStamp};position:relative;}.mushi-option-btn:last-child{border-bottom:none;}.mushi-option-btn:hover{transform:translateX(6px);color:${widgetAccent};background:linear-gradient(90deg,rgba(${accentRgb},0.07),transparent 55%);}.mushi-option-btn:hover .mushi-option-arrow{opacity:1;transform:translateX(0);color:${widgetAccent};}.mushi-option-btn:focus-visible{outline:none;transform:translateX(6px);box-shadow:inset 2px 0 0 ${widgetAccent};}.mushi-option-icon{font-size:18px;line-height:1;flex-shrink:0;filter:${isDark ? "none" : "grayscale(0.15)"};}.mushi-option-text{display:flex;flex-direction:column;gap:3px;min-width:0;}.mushi-option-label{font-family:${fontDisplay};font-size:16px;font-weight:500;letter-spacing:-0.005em;line-height:1.2;}.mushi-option-desc{font-size:12px;color:${inkMuted};letter-spacing:0.005em;}.mushi-option-arrow{font-family:${fontMono};font-size:14px;color:${inkFaint};opacity:0;transform:translateX(-4px);transition:opacity ${durBase}ms ${easeStamp},transform ${durBase}ms ${easeStamp};}.mushi-feature-entry,.mushi-reports-entry{padding-left:10px;border-left:2px solid ${inkFaint};transition:opacity ${durBase}ms ${easeStamp},transform ${durBase}ms ${easeStamp};}.mushi-feature-entry:hover,.mushi-reports-entry:hover{border-left-color:${widgetAccent};padding-left:14px;}.mushi-feature-entry .mushi-option-icon{filter:none;}.mushi-report-row{width:100%;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:12px 4px 12px 0;border:0;border-bottom:1px solid ${rule};background:transparent;color:${ink};cursor:pointer;text-align:left;transition:opacity ${durFast}ms ${easeStamp},transform ${durFast}ms ${easeStamp};}.mushi-report-row:hover,.mushi-report-row:focus-visible{background:${isDark ? "rgba(242,235,221,0.04)" : "rgba(14,13,11,0.03)"};padding-left:4px;}.mushi-report-main{min-width:0;display:grid;gap:6px;}.mushi-report-title{font-size:13px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.mushi-report-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}.mushi-report-status{display:inline-flex;align-items:center;font-family:${fontMono};font-size:10px;font-weight:600;letter-spacing:0.04em;text-transform:uppercase;padding:2px 7px;border-radius:999px;border:1px solid transparent;}.mushi-status-sent{color:${statusSent.fg};background:${statusSent.bg};border-color:${statusSent.border};}.mushi-status-review{color:${statusReview.fg};background:${statusReview.bg};border-color:${statusReview.border};}.mushi-status-fixing{color:${statusFixing.fg};background:${statusFixing.bg};border-color:${statusFixing.border};}.mushi-status-fixed{color:${statusFixed.fg};background:${statusFixed.bg};border-color:${statusFixed.border};}.mushi-status-closed,.mushi-status-unknown{color:${inkMuted};background:${statusClosedBg};border-color:${ruleStrong};}.mushi-report-when{font-family:${fontMono};font-size:10px;color:${inkFaint};}.mushi-unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;font-family:${fontMono};font-size:10px;font-weight:700;color:${widgetAccentInk};background:${widgetAccent};}.mushi-report-chevron{font-size:18px;line-height:1;color:${inkFaint};transition:opacity ${durFast}ms ${easeStamp},transform ${durFast}ms ${easeStamp};}.mushi-report-row:hover .mushi-report-chevron,.mushi-report-row:focus-visible .mushi-report-chevron{color:${widgetAccent};transform:translateX(2px);}.mushi-thread-summary{border-bottom:1px solid ${rule};padding-bottom:10px;margin-bottom:10px;}.mushi-thread-summary-meta{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:8px;}.mushi-thread{display:grid;gap:8px;max-height:180px;overflow:auto;margin-bottom:12px;}.mushi-thread-skeleton{display:grid;gap:8px;}.mushi-thread-skeleton span{height:34px;border:1px solid ${rule};background:${rule};opacity:0.5;}.mushi-thread-action-error{margin:0;padding:8px 22px 0;}.mushi-thread-composer{align-items:flex-end;}.mushi-thread-composer .mushi-textarea{flex:1;min-width:0;margin:0;}.mushi-thread-comment{padding:8px 10px;border:1px solid ${rule};background:${isDark ? "rgba(242,235,221,0.04)" : "rgba(14,13,11,0.03)"};}.mushi-thread-comment.reporter{border-color:${widgetAccentWash};background:${widgetAccentWash};}.mushi-thread-comment strong{display:block;font-family:${fontMono};font-size:10px;letter-spacing:0.04em;margin-bottom:3px;}.mushi-thread-comment p,.mushi-muted,.mushi-error-inline{font-size:12px;color:${inkMuted};line-height:1.45;}.mushi-error-inline{color:${widgetAccent};}.mushi-selected-category{display:inline-flex;align-items:center;gap:8px;padding:6px 10px 6px 12px;border-left:2px solid ${widgetAccent};background:${widgetAccentWash};color:${widgetAccentInk};font-family:${fontDisplay};font-size:13px;margin:4px 0 14px;border-radius:0 3px 3px 0;}.mushi-selected-category span:first-child{font-size:14px;}.mushi-intents{display:flex;flex-direction:column;gap:2px;}.mushi-intents .mushi-option-btn{grid-template-columns:1fr auto;}.mushi-example-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}.mushi-example-chip{padding:4px 10px;border:1px solid ${rule};border-radius:12px;background:transparent;color:${inkMuted};font-family:${fontBody};font-size:11px;cursor:pointer;transition:opacity ${durInstant}ms ${easeStamp},transform ${durInstant}ms ${easeStamp};white-space:nowrap;}.mushi-example-chip:hover{color:${ink};border-color:${inkMuted};background:${isDark ? "rgba(242,235,221,0.06)" : "rgba(14,13,11,0.04)"};}.mushi-example-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;}.mushi-textarea-wrap{position:relative;}.mushi-char-counter{position:absolute;bottom:4px;right:0;font-family:${fontMono};font-size:10px;letter-spacing:0.04em;color:${inkFaint};pointer-events:none;transition:opacity ${durFast}ms ${easeStamp};}.mushi-textarea{width:100%;min-height:96px;padding:8px 0 10px;border:none;border-bottom:1px solid ${ruleStrong};background:transparent;color:${ink};font-family:${fontBody};font-size:14px;line-height:1.5;resize:vertical;outline:none;transition:opacity ${durFast}ms ${easeStamp},transform ${durFast}ms ${easeStamp};}.mushi-textarea::placeholder{color:${inkFaint};font-style:italic;}.mushi-textarea:focus{border-bottom-color:${widgetAccent};}.mushi-attachments{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;}.mushi-attach-btn{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid ${ruleStrong};border-radius:3px;background:transparent;color:${inkMuted};font-family:${fontMono};font-size:11px;letter-spacing:0.04em;text-transform:uppercase;cursor:pointer;transition:opacity ${durFast}ms ${easeStamp},transform ${durFast}ms ${easeStamp};}.mushi-attach-btn:hover{color:${ink};border-color:${ink};}.mushi-attach-btn.active{color:${widgetAccent};border-color:${widgetAccent};background:${widgetAccentWash};}.mushi-attach-btn.danger{color:${widgetAccentInk};border-color:${widgetAccentWash};background:transparent;}.mushi-attach-btn.danger:hover{color:${widgetAccent};border-color:${widgetAccent};background:${widgetAccentWash};}.mushi-attach-btn.loading{opacity:0.7;cursor:wait;}.mushi-attach-btn.error{color:${widgetAccent};border-color:${widgetAccentWash};}.mushi-attach-btn:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;}.mushi-annotate-host{flex-basis:100%;margin-top:8px;}.mushi-annotate-host:empty{margin-top:0;}.mushi-screenshot-preview{margin:10px 0 0;display:flex;flex-direction:column;gap:6px;}.mushi-screenshot-preview img{display:block;max-width:100%;max-height:160px;width:auto;border:1px solid ${ruleStrong};border-radius:3px;object-fit:contain;align-self:flex-start;}.mushi-screenshot-hint{margin:0;color:${inkMuted};font-family:${fontMono};font-size:10.5px;line-height:1.4;letter-spacing:0.02em;}.mushi-identified-user{margin:8px 0 0;font-size:11.5px;color:${inkMuted};line-height:1.4;}.mushi-identified-user strong{color:${ink};font-weight:600;}.mushi-annotate-toolbar{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;}@keyframes mushi-spin{to{transform:rotate(360deg);}}@keyframes mushi-fade-in{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}.mushi-spinner{display:inline-block;width:10px;height:10px;border:1.5px solid currentColor;border-top-color:transparent;border-radius:50%;animation:mushi-spin ${durRing}ms linear infinite;}.mushi-footer{flex-shrink:0;padding:14px 22px 16px;border-top:1px solid ${rule};display:flex;align-items:center;justify-content:space-between;gap:12px;}.mushi-footer-hint{font-family:${fontMono};font-size:10px;letter-spacing:0.10em;text-transform:uppercase;color:${inkFaint};}.mushi-submit{position:relative;display:inline-flex;align-items:center;gap:${spaceSnug}px;min-height:var(--mushi-touch-min);padding:${spaceComfy}px ${spaceLounge}px;border:1px solid ${widgetAccent};border-radius:${controlRadius}px;background:linear-gradient(160deg,${widgetAccent} 0%,${widgetAccentShadow} 100%);color:${onAccent};font-family:${fontMono};font-size:${sizeLabel}px;letter-spacing:0.16em;text-transform:uppercase;cursor:pointer;overflow:hidden;transition:transform ${durFast}ms ${easeStamp},opacity ${durFast}ms ${easeStamp};box-shadow:0 2px 0 ${widgetAccentShadow};}.mushi-submit::after{content:'';position:absolute;inset:0;background:radial-gradient(circle at center,rgba(255,255,255,0.35) 0%,transparent 60%);opacity:0;transform:scale(0.4);transition:opacity ${durPanel}ms ${easeStamp},transform ${durSlow}ms ${easeStamp};pointer-events:none;}.mushi-submit:hover{transform:translateY(-1px);box-shadow:0 3px 0 ${widgetAccentShadow},0 0 0 3px rgba(${accentRgb},0.18),0 4px 16px -4px rgba(${accentRgb},0.35);}.mushi-submit:hover::after{opacity:1;transform:scale(1.4);}.mushi-submit:active{transform:translateY(1px);box-shadow:0 1px 0 ${widgetAccentShadow};}.mushi-submit:disabled{cursor:wait;opacity:0.7;}.mushi-submit:focus-visible{outline:2px solid ${widgetAccent};outline-offset:3px;}.mushi-submit-arrow{display:inline-block;transition:transform ${durBase}ms ${easeStamp};}.mushi-submit:hover .mushi-submit-arrow{transform:translateX(3px);}.mushi-brand-footer{padding:9px 14px 11px;border-top:1px solid ${rule};color:${inkFaint};font-family:${fontMono};font-size:9px;letter-spacing:0.16em;text-align:center;text-transform:uppercase;}.mushi-brand-link{color:inherit;text-decoration:none;text-underline-offset:3px;}.mushi-brand-link:hover{color:${inkMuted};text-decoration:underline;}.mushi-brand-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px;color:${widgetAccent};text-decoration:underline;}.mushi-success{text-align:center;padding:28px 16px 20px;}.mushi-success-stamp{position:relative;width:96px;height:96px;margin:0 auto 16px;display:inline-flex;align-items:center;justify-content:center;}.mushi-success-stamp svg{position:absolute;inset:0;width:100%;height:100%;}.mushi-success-stamp circle{fill:none;stroke:${widgetAccent};stroke-width:3;stroke-dasharray:280;stroke-dashoffset:280;transform:rotate(-90deg);transform-origin:center;animation:mushi-stamp-ring 700ms ${easeStamp} 80ms forwards;filter:drop-shadow(0 0 6px rgba(${accentRgb},0.5));}.mushi-success-stamp-label{font-family:${fontDisplay};font-size:18px;font-weight:600;color:${widgetAccent};letter-spacing:0.04em;transform:rotate(-6deg);opacity:0;animation:mushi-stamp-press 360ms ${easeStamp} 600ms forwards;}.mushi-success-meta{font-family:${fontMono};font-size:11px;letter-spacing:0.10em;text-transform:uppercase;color:${inkMuted};}.mushi-success-receipt{margin-top:14px;width:100%;max-width:280px;display:flex;flex-direction:column;gap:6px;align-items:stretch;}.mushi-success-receipt-row{display:flex;align-items:center;justify-content:center;gap:8px;font-family:${fontMono};font-size:11px;letter-spacing:0.05em;color:${inkMuted};}.mushi-success-receipt-label{text-transform:uppercase;letter-spacing:0.10em;color:${inkMuted};}.mushi-success-receipt-id{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:4px;background:transparent;border:1px dashed ${rule};color:inherit;font-family:${fontMono};font-size:12px;letter-spacing:0.02em;cursor:pointer;transition:opacity ${durInstant}ms ${easeStamp};}.mushi-success-receipt-id:hover,.mushi-success-receipt-id:focus-visible{background:rgba(${accentRgb},0.06);border-color:${widgetAccent};color:${widgetAccent};outline:none;}.mushi-success-receipt-copy{font-size:11px;opacity:0.7;}.mushi-success-receipt-track{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:6px 10px;border-radius:4px;background:${widgetAccent};color:${inverse};font-family:${fontMono};font-size:11px;letter-spacing:0.10em;text-transform:uppercase;text-decoration:none;transition:filter ${durInstant}ms ease;}.mushi-success-receipt-track:hover,.mushi-success-receipt-track:focus-visible{filter:brightness(0.95);outline:none;}.mushi-success-receipt-spinner{width:11px;height:11px;border-radius:50%;border:1.5px solid ${rule};border-top-color:${widgetAccent};animation:mushi-receipt-spin 0.8s linear infinite;}@keyframes mushi-receipt-spin{to{transform:rotate(360deg);}}.mushi-success-receipt-hint{color:${inkMuted};font-style:italic;}.mushi-success-receipt-warn{color:${widgetAccent};}.mushi-success-my-reports{display:block;margin:12px auto 0;font-size:12px;font-family:${fontMono};color:${widgetAccent};text-decoration:underline;text-underline-offset:2px;background:none;border:none;cursor:pointer;padding:4px 2px;}.mushi-success-my-reports:hover{opacity:0.75;}.mushi-success-sla{margin-top:2px;font-family:${fontDisplay};font-size:12px;line-height:1.45;text-align:center;color:${inkMuted};max-width:260px;}.mushi-success-sla-default{opacity:0.85;}@keyframes mushi-stamp-ring{to{stroke-dashoffset:0;}}@keyframes mushi-stamp-press{0%{opacity:0;transform:rotate(-6deg) scale(1.3);}60%{opacity:1;transform:rotate(-6deg) scale(0.94);}100%{opacity:1;transform:rotate(-6deg) scale(1);}}.mushi-error{margin-top:10px;padding:8px 0 8px 10px;border-left:2px solid ${widgetAccent};color:${widgetAccent};font-size:12px;font-family:${fontMono};letter-spacing:0.02em;}.mushi-rewards-nudge{border-top:1px solid ${rule};padding:10px 0 4px;margin-top:6px;}.mushi-rewards-row{display:flex;align-items:center;gap:6px;margin-bottom:8px;}.mushi-tier-pip{width:7px;height:7px;border-radius:50%;flex-shrink:0;}.mushi-rewards-tier-name{font-family:${fontMono};font-size:11px;letter-spacing:0.08em;text-transform:uppercase;color:${ink};}.mushi-rewards-pts-count{font-family:${fontMono};font-size:11px;color:${inkMuted};margin-right:auto;}.mushi-rewards-pts-earn{font-family:${fontMono};font-size:10px;color:${widgetAccent};letter-spacing:0.04em;white-space:nowrap;}.mushi-tier-bar-track{height:3px;background:${ruleStrong};border-radius:2px;overflow:hidden;margin-bottom:5px;}.mushi-tier-bar-fill{height:100%;width:100%;background:${widgetAccent};border-radius:2px;transform-origin:left center;transform:scaleX(var(--mushi-tier-pct,0));transition:transform ${durSlow}ms ${easeStamp};}.mushi-rewards-next-label{font-family:${fontMono};font-size:10px;color:${inkMuted};text-align:right;letter-spacing:0.02em;}.mushi-success-rewards{margin-top:14px;padding-top:12px;border-top:1px solid ${rule};width:100%;}.mushi-success-pts-award{font-family:${fontMono};font-size:22px;font-weight:700;color:${widgetAccent};text-align:center;letter-spacing:0.06em;margin-bottom:10px;opacity:0;animation:mushi-pts-pop ${durSlow}ms ${easeStamp} 900ms forwards;}.success-bar{margin:0 0 5px;}@keyframes mushi-pts-pop{from{opacity:0;transform:scale(0.75) translateY(6px);}to{opacity:1;transform:scale(1) translateY(0);}}.mushi-beta-strip{margin:0 16px 2px;padding:9px 12px;background:${widgetAccentWash};border:1px solid rgba(${accentRgb},${isDark ? "0.22" : "0.16"});border-radius:4px;display:flex;flex-direction:column;gap:4px;}.mushi-beta-strip-row{display:flex;align-items:center;gap:8px;}.mushi-beta-tag{display:inline-flex;align-items:center;padding:1px 6px;border-radius:3px;background:${widgetAccent};color:${onAccent};font-family:${fontMono};font-size:9px;font-weight:700;letter-spacing:0.14em;line-height:1.6;white-space:nowrap;flex-shrink:0;text-transform:uppercase;}.mushi-beta-msg{font-size:11px;color:${inkMuted};line-height:1.45;}.mushi-beta-contact-hint{font-size:10px;color:${inkFaint};font-family:${fontMono};letter-spacing:0.06em;}.mushi-beta-perks{list-style:none;margin:2px 0 0;padding:0;display:flex;flex-direction:column;gap:2px;}.mushi-beta-perks li{font-size:12px;color:${widgetAccentInk};font-weight:500;}.mushi-changelog{margin-top:5px;}.mushi-changelog-summary{font-size:11px;color:${inkDim};cursor:pointer;list-style:none;display:flex;align-items:center;gap:4px;user-select:none;}.mushi-changelog-summary::before{content:'\u25B6';font-size:7px;opacity:0.6;transition:transform ${durInstant}ms ${easeStamp};}.mushi-changelog[open] .mushi-changelog-summary::before{transform:rotate(90deg);}.mushi-changelog-list{margin:5px 0 0 4px;padding:0;list-style:none;display:flex;flex-direction:column;gap:2px;}.mushi-changelog-list li{font-size:11px;color:${inkDim};line-height:1.5;}.mushi-beta-success-footer{margin-top:14px;padding:10px 14px;background:${widgetAccentWash};border:1px solid rgba(${accentRgb},${isDark ? "0.18" : "0.14"});border-radius:4px;display:flex;flex-direction:column;gap:3px;text-align:left;}.mushi-beta-success-line{font-size:12px;color:${widgetAccentInk};line-height:1.5;}.mushi-beta-success-dim{opacity:0.65;font-size:12px;}.mushi-banner{position:fixed;left:0;right:0;box-sizing:border-box;min-height:${bannerHeight}px;display:flex;align-items:center;justify-content:center;gap:10px;padding:0 calc(16px + env(safe-area-inset-right,0px)) 0 calc(16px + env(safe-area-inset-left,0px));font-family:${fontMono};font-size:12px;letter-spacing:0.04em;white-space:nowrap;overflow:hidden;z-index:var(--mushi-banner-z,${zBanner});animation:mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;}.mushi-banner.top{top:0;padding-top:env(safe-area-inset-top,0px);}.mushi-banner.bottom{bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);}.mushi-banner.neon{background:${neonBannerBg};color:${neonBannerFg};border-bottom:1.5px solid ${neonBannerBorder};}.mushi-banner.neon.bottom{border-top:1.5px solid ${neonBannerBorder};border-bottom:none;}.mushi-banner.neon .mushi-banner-btn{background:rgba(0,0,0,0.14);color:${neonBannerFg};border:1px solid rgba(0,0,0,0.22);}.mushi-banner.neon .mushi-banner-btn:hover{background:rgba(0,0,0,0.22);}.mushi-banner.brand{background:${widgetAccent};color:${inverse};border-bottom:1.5px solid ${brandBannerBorder};}.mushi-banner.brand.bottom{border-top:1.5px solid ${brandBannerBorder};border-bottom:none;}.mushi-banner.brand .mushi-banner-btn{background:rgba(255,255,255,0.18);color:${inverse};border:1px solid rgba(255,255,255,0.32);}.mushi-banner.brand .mushi-banner-btn:hover{background:rgba(255,255,255,0.28);}.mushi-banner.subtle{background:${isDark ? "rgba(15,14,12,0.88)" : "rgba(248,244,237,0.92)"};backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:${ink};border-bottom:1px solid ${ruleStrong};}.mushi-banner.subtle.bottom{border-top:1px solid ${ruleStrong};border-bottom:none;}.mushi-banner.subtle .mushi-banner-btn{background:${isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.08)"};color:${ink};border:1px solid ${ruleStrong};}.mushi-banner.subtle .mushi-banner-btn:hover{background:${isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.14)"};}.mushi-banner-label{flex:1;text-align:center;overflow:hidden;text-overflow:ellipsis;}.mushi-banner--rich{justify-content:space-between;gap:12px;min-height:${bannerHeight}px;height:auto;padding:4px 12px 4px 16px;white-space:normal;}.mushi-banner-body{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden;}.mushi-banner-pill{display:inline-flex;flex-shrink:0;align-items:center;padding:1px 6px;border-radius:3px;border:1px solid currentColor;font-size:10px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;opacity:0.92;}.mushi-banner.neon .mushi-banner-pill{border-color:rgba(10,26,10,0.45);background:rgba(10,26,10,0.12);}.mushi-banner.brand .mushi-banner-pill{border-color:rgba(255,255,255,0.45);background:rgba(255,255,255,0.14);}.mushi-banner.subtle .mushi-banner-pill{border-color:${ruleStrong};background:${isDark ? "rgba(242,235,221,0.08)" : "rgba(14,13,11,0.06)"};}.mushi-banner-message{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.3;opacity:0.9;}.mushi-banner-actions{display:inline-flex;align-items:center;gap:0;flex-shrink:1;min-width:0;overflow-x:auto;scrollbar-width:none;font-size:11px;}.mushi-banner-actions::-webkit-scrollbar{display:none;}@media (max-width:${panelSheetBreakpoint}px){.mushi-banner-actions .mushi-banner-extra{display:none;}}.mushi-banner-link{display:inline-flex;align-items:center;padding:2px 8px;border:none;background:transparent;color:inherit;cursor:pointer;font:inherit;letter-spacing:inherit;text-decoration:none;opacity:0.88;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;}.mushi-banner-link:hover{opacity:1;}.mushi-banner-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px;}.mushi-banner-divider{opacity:0.28;padding:0 1px;user-select:none;flex-shrink:0;}.mushi-banner--rich .mushi-banner-dismiss{margin-left:4px;}.mushi-banner-btn{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:3px;cursor:pointer;font:inherit;letter-spacing:inherit;transition:opacity ${durInstant}ms ${easeStamp};flex-shrink:0;height:24px;line-height:1;}.mushi-banner-btn:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;}.mushi-banner-dismiss{background:transparent !important;border:none !important;opacity:0.65;cursor:pointer;font-size:14px;line-height:1;padding:4px 8px;margin-left:auto;flex-shrink:0;color:inherit;border-radius:3px;transition:opacity ${durInstant}ms ${easeStamp};}.mushi-banner-dismiss:hover{opacity:1;background:rgba(0,0,0,0.12) !important;}.mushi-banner.neon .mushi-banner-dismiss:hover{background:rgba(0,0,0,0.18) !important;}.mushi-banner-my-reports{background:transparent;border:none;cursor:pointer;font-size:11px;font-family:${fontMono};opacity:0.75;color:inherit;padding:2px 6px;border-radius:3px;white-space:nowrap;flex-shrink:0;transition:opacity ${durInstant}ms ${easeStamp};margin-left:4px;}.mushi-banner-my-reports:hover{opacity:1;background:rgba(0,0,0,0.10);}.mushi-banner.neon .mushi-banner-my-reports:hover{background:rgba(0,0,0,0.18);}@keyframes mushi-banner-slide-in{from{transform:translateY(calc(-1 * 100%));opacity:0.5;}to{transform:translateY(0);opacity:1;}}.mushi-banner.bottom{animation-name:mushi-banner-slide-in-bottom;}@keyframes mushi-banner-slide-in-bottom{from{transform:translateY(100%);opacity:0.5;}to{transform:translateY(0);opacity:1;}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.001ms !important;animation-iteration-count:1 !important;transition-duration:0.001ms !important;}.mushi-success-stamp circle{stroke-dashoffset:0;}.mushi-success-stamp-label{opacity:1;}.mushi-success-pts-award{opacity:1;}}.mushi-community-footer{display:flex;align-items:center;gap:8px;padding:10px 0 2px;border-top:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.07)"};margin-top:8px;flex-wrap:wrap}.mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mushi-section-label{margin:0 0 6px;font-family:${fontMono};font-size:11px;letter-spacing:0.06em;text-transform:uppercase;color:${inkFaint};}.mushi-more-nav{margin-top:4px}.mushi-more-nav-panel{display:flex;flex-direction:column;gap:0;border-top:1px dashed ${rule};padding-top:2px}.mushi-more-nav-link{align-self:flex-start;margin:6px 0 2px;padding:0}.mushi-more-toggle{display:flex;align-items:center;gap:8px;width:100%;padding:11px 0;border:none;border-top:1px dashed ${rule};background:transparent;cursor:pointer;color:${inkMuted};font-family:${fontBody};font-size:13px;text-align:left;transition:opacity ${durFast}ms ${easeStamp};}.mushi-more-toggle:hover{color:${widgetAccent};}.mushi-more-toggle:hover .mushi-more-toggle-arrow{transform:translateX(3px);}.mushi-more-toggle-text{flex:1;}.mushi-more-toggle-count{font-family:${fontMono};font-size:10px;letter-spacing:0.08em;text-transform:uppercase;color:${inkFaint};background:${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.06)"};padding:2px 6px;border-radius:10px;}.mushi-more-toggle-arrow{font-size:14px;opacity:0.5;transition:transform ${durFast}ms ${easeStamp};}@keyframes mushi-step-in{0%{opacity:0;transform:translateX(8px);}100%{opacity:1;transform:translateX(0);}}.mushi-body{animation:mushi-step-in 160ms ease both;}@media (prefers-reduced-motion:reduce){.mushi-body{animation:none;}}.mushi-categories-expanded{animation:mushi-step-in ${durFast}ms ${easeStamp} both;}.mushi-link-btn{background:none;border:none;padding:4px 2px;cursor:pointer;color:${widgetAccent};font-size:12px;font-family:${fontMono};text-decoration:underline;text-underline-offset:2px}.mushi-link-btn:hover{opacity:0.8}.mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}.mushi-nav-item{display:block;width:100%;text-align:left;background:${isDark ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.04)"};border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.08)"};border-radius:8px;padding:10px 14px;margin-bottom:8px;cursor:pointer;font-size:13px;color:${ink};transition:opacity ${durInstant}ms ${easeStamp}}.mushi-nav-item:hover{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(0,0,0,0.07)"}}.mushi-account-card{display:flex;align-items:center;gap:12px;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"};border-radius:10px;padding:12px 14px;margin-bottom:14px}.mushi-account-avatar{width:40px;height:40px;border-radius:50%;background:${widgetAccentWash};color:${widgetAccentInk};display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;flex-shrink:0}.mushi-account-info{display:flex;flex-direction:column;gap:2px;min-width:0}.mushi-account-info strong{font:700 14px/1.3 inherit;color:${ink}}.mushi-account-rank,.mushi-xapp-app-name,.mushi-label{font-size:12px;color:${inkDim};font-family:${fontMono}}.mushi-account-rank{display:block}.mushi-xapp-app-head{display:flex;align-items:center;gap:8px;margin:0 0 6px}.mushi-xapp-app-name{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin:0}.mushi-app-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:1px solid ${isDark ? "rgba(255,255,255,0.12)" : "rgba(0,0,0,0.1)"};background:${paperRaised};overflow:hidden;flex-shrink:0}.mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain}.mushi-app-icon-initials{font-size:9px;font-weight:700;color:${inkDim};line-height:1}.mushi-app-icon-initials-only{background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"}}.mushi-header-host-icon{display:block;width:20px;height:20px;border-radius:4px;object-fit:contain}.mushi-xapp-group{margin-bottom:14px}.mushi-label{display:block;font-weight:600;margin-bottom:6px}.mushi-assistant{display:flex;flex-direction:column;height:100%;min-height:0;max-height:60vh}.mushi-assistant-log{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px 8px}.mushi-assistant-greeting{font:400 14px/1.5 ${fontBody};color:${inkMuted};padding:6px 2px}.mushi-assistant-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.mushi-assistant-chip{background:${widgetAccentWash};color:${widgetAccentInk};border:1px solid ${ruleStrong};border-radius:999px;padding:5px 12px;font-size:12px;cursor:pointer;font-family:${fontBody};transition:opacity ${durInstant}ms ${easeStamp},transform ${durInstant}ms ${easeStamp}}.mushi-assistant-chip:hover{background:rgba(${accentRgb},${isDark ? "0.22" : "0.14"})}.mushi-assistant-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}.mushi-assistant-msg{max-width:85%;padding:8px 12px;border-radius:12px;font:400 14px/1.45 ${fontBody};white-space:pre-wrap;word-break:break-word}.mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:${inverse};border-bottom-right-radius:4px}.mushi-assistant-msg-bot{align-self:flex-start;background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.05)"};color:${ink};border-bottom-left-radius:4px}.mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}.mushi-assistant-error{align-self:flex-start;color:${danger};font-size:12px;padding:4px 2px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}.mushi-assistant-recovery{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.mushi-assistant-recovery-footer{margin-top:4px;padding-top:4px}.mushi-assistant-report-cta{background:${widgetAccent};color:${inverse};border:none;border-radius:999px;padding:6px 14px;font-size:12px;cursor:pointer;font-family:${fontBody};font-weight:600}.mushi-assistant-report-cta:hover{opacity:0.92}.mushi-assistant-report-cta:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}.mushi-assistant-report-link{background:transparent;color:${widgetAccentInk};border:none;padding:0;font-size:12px;cursor:pointer;font-family:${fontBody};text-decoration:underline;text-underline-offset:2px}.mushi-assistant-report-link:hover{opacity:0.85}.mushi-assistant-report-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}.mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${rule};padding-top:8px}.mushi-assistant-input{flex:1;resize:none;max-height:120px;border:1px solid ${ruleStrong};border-radius:10px;padding:8px 12px;font:400 14px/1.4 ${fontBody};background:${paper};color:${ink}}.mushi-assistant-input:focus-visible{outline:2px solid ${widgetAccent};outline-offset:1px}.mushi-assistant-submit{flex-shrink:0;width:36px;height:36px;border:none;border-radius:50%;background:${widgetAccent};color:${inverse};font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,opacity .15s}.mushi-assistant-submit:hover{transform:translateY(-1px)}.mushi-assistant-submit:disabled{opacity:0.5;cursor:default;transform:none}.mushi-assistant-submit:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}`;
2934
1298
  }
2935
1299
 
1300
+ // src/version.ts
1301
+ var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
1302
+ var MUSHI_SDK_VERSION = "1.30.0" ;
1303
+
2936
1304
  // src/widget-render.ts
2937
1305
  function renderStep(ctx) {
2938
1306
  switch (ctx.step) {
@@ -2967,41 +1335,41 @@ function renderAssistantStep(ctx) {
2967
1335
  const suggestions = ctx.callbacks.assistantSuggestions ?? [];
2968
1336
  const empty = ctx.assistantTurns.length === 0;
2969
1337
  const transcript = empty ? `<div class="mushi-assistant-greeting">${escapeHtml(greeting)}</div>
2970
- ${suggestions.length ? `<div class="mushi-assistant-suggestions">${suggestions.map((s) => `<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${escapeHtml(s)}">${escapeHtml(s)}</button>`).join("")}</div>` : ""}` : ctx.assistantTurns.map((turn) => {
1338
+ ${suggestions.length ? `<div class="mushi-assistant-suggestions">${suggestions.map((s) => `<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${escapeHtml(s)}">${escapeHtml(s)}</button>`).join("")}</div>` : ""}` : ctx.assistantTurns.map((turn) => {
2971
1339
  const cls = turn.role === "user" ? "mushi-assistant-msg-user" : "mushi-assistant-msg-bot";
2972
1340
  const opts = turn.options && turn.options.length ? `<div class="mushi-assistant-suggestions">${turn.options.map((o) => `<button type="button" class="mushi-assistant-chip" data-action="assistant-suggest" data-value="${escapeHtml(o)}">${escapeHtml(o)}</button>`).join("")}</div>` : "";
2973
1341
  const reportCta = turn.offerReport ? `<div class="mushi-assistant-recovery">
2974
- <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
2975
- </div>` : "";
1342
+ <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
1343
+ </div>` : "";
2976
1344
  return `<div class="mushi-assistant-msg ${cls}">${escapeHtml(turn.text)}</div>${opts}${reportCta}`;
2977
1345
  }).join("");
2978
1346
  const thinking = ctx.assistantSending ? `<div class="mushi-assistant-msg mushi-assistant-msg-bot mushi-assistant-thinking" role="status" aria-live="polite">${escapeHtml(t.assistant.thinking)}</div>` : "";
2979
1347
  const error = ctx.assistantError ? `<div class="mushi-assistant-error" role="alert">${escapeHtml(ctx.assistantError)}
2980
- <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
2981
- </div>` : "";
1348
+ <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
1349
+ </div>` : "";
2982
1350
  const stillStuck = !empty && !ctx.assistantSending && !ctx.assistantError ? `<div class="mushi-assistant-recovery mushi-assistant-recovery-footer">
2983
- <button type="button" class="mushi-assistant-report-link" data-action="assistant-report">${escapeHtml(t.assistant.stillStuckCta)}</button>
2984
- </div>` : "";
1351
+ <button type="button" class="mushi-assistant-report-link" data-action="assistant-report">${escapeHtml(t.assistant.stillStuckCta)}</button>
1352
+ </div>` : "";
2985
1353
  return `
2986
- ${renderHeader(ctx, { title: label, showBack: true })}
2987
- <div class="mushi-assistant">
2988
- <div class="mushi-assistant-log">
2989
- ${transcript}
2990
- ${thinking}
2991
- ${error}
2992
- ${stillStuck}
2993
- </div>
2994
- <form class="mushi-assistant-form" data-action="assistant-send">
2995
- <textarea
2996
- class="mushi-assistant-input"
2997
- rows="1"
2998
- placeholder="${escapeHtml(t.assistant.inputPlaceholder)}"
2999
- ${ctx.assistantSending ? "disabled" : ""}
3000
- ></textarea>
3001
- <button type="submit" class="mushi-assistant-submit" ${ctx.assistantSending ? "disabled" : ""} aria-label="${escapeHtml(t.assistant.sendAriaLabel)}">\u2191</button>
3002
- </form>
3003
- </div>
3004
- `;
1354
+ ${renderHeader(ctx, { title: label, showBack: true })}
1355
+ <div class="mushi-assistant">
1356
+ <div class="mushi-assistant-log">
1357
+ ${transcript}
1358
+ ${thinking}
1359
+ ${error}
1360
+ ${stillStuck}
1361
+ </div>
1362
+ <form class="mushi-assistant-form" data-action="assistant-send">
1363
+ <textarea
1364
+ class="mushi-assistant-input"
1365
+ rows="1"
1366
+ placeholder="${escapeHtml(t.assistant.inputPlaceholder)}"
1367
+ ${ctx.assistantSending ? "disabled" : ""}
1368
+ ></textarea>
1369
+ <button type="submit" class="mushi-assistant-submit" ${ctx.assistantSending ? "disabled" : ""} aria-label="${escapeHtml(t.assistant.sendAriaLabel)}">\u2191</button>
1370
+ </form>
1371
+ </div>
1372
+ `;
3005
1373
  }
3006
1374
  function renderOutdatedBanner(ctx) {
3007
1375
  if (!ctx.sdkFreshness) return "";
@@ -3009,16 +1377,17 @@ function renderOutdatedBanner(ctx) {
3009
1377
  const { latest, current, deprecated, message } = ctx.sdkFreshness;
3010
1378
  if (!latest && !deprecated) return "";
3011
1379
  return `
3012
- <div class="mushi-outdated" role="status">
3013
- <strong>Mushi SDK ${escapeHtml(current)}</strong>
3014
- ${latest ? `latest is ${escapeHtml(latest)}.` : "needs attention."}
3015
- ${message ? `<span>${escapeHtml(message)}</span>` : ""}
3016
- </div>
3017
- `;
1380
+ <div class="mushi-outdated" role="status">
1381
+ <strong>Mushi SDK ${escapeHtml(current)}</strong>
1382
+ ${latest ? `latest is ${escapeHtml(latest)}.` : "needs attention."}
1383
+ ${message ? `<span>${escapeHtml(message)}</span>` : ""}
1384
+ </div>
1385
+ `;
3018
1386
  }
3019
1387
  function renderBrandFooter(ctx) {
3020
- if (ctx.config.brandFooter === false) return "";
3021
- return `<div class="mushi-brand-footer">${escapeHtml(ctx.locale.flows.poweredBy.replace("{version}", ctx.sdkVersion))}</div>`;
1388
+ if (ctx.config.brandFooter !== true) return "";
1389
+ const href = buildBrandFooterHref(ctx.brandRef);
1390
+ return `<div class="mushi-brand-footer"><a class="mushi-brand-link" href="${escapeHtml(href)}" target="_blank" rel="noopener noreferrer" data-action="brand-footer">${escapeHtml(ctx.locale.flows.poweredBy)}<span aria-hidden="true"> \u2197</span></a></div>`;
3022
1391
  }
3023
1392
  function renderHeader(ctx, opts) {
3024
1393
  const t = ctx.locale;
@@ -3026,18 +1395,18 @@ function renderHeader(ctx, opts) {
3026
1395
  const eyebrowHtml = showBack ? `<button type="button" class="mushi-back" data-action="back" aria-label="${escapeHtml(t.widget.back)}">\u2190 ${escapeHtml(t.widget.back)}</button>` : `<span class="mushi-header-eyebrow">${escapeHtml(eyebrow ?? "Mushi \xB7 Report")}</span>`;
3027
1396
  const counterHtml = step ? `<span class="mushi-step-counter" aria-label="Step ${step} of ${TOTAL_STEPS}"><b>${pad2(step)}</b> / ${pad2(TOTAL_STEPS)}</span>` : "";
3028
1397
  return `
3029
- <div class="mushi-header">
3030
- <div class="mushi-header-mark" aria-hidden="true">${ctx.pageFaviconHref ? `<img class="mushi-header-host-icon" src="${escapeHtml(ctx.pageFaviconHref)}" alt="" referrerpolicy="no-referrer" width="20" height="20" />` : "\u866B"}</div>
3031
- <div class="mushi-header-titles">
3032
- ${eyebrowHtml}
3033
- <h3>${title}</h3>
3034
- </div>
3035
- <div class="mushi-header-meta">
3036
- ${counterHtml}
3037
- <button type="button" class="mushi-close" data-action="close" aria-label="${escapeHtml(t.widget.close)}">\u2715</button>
3038
- </div>
3039
- </div>
3040
- `;
1398
+ <div class="mushi-header">
1399
+ <div class="mushi-header-mark" aria-hidden="true">${ctx.pageFaviconHref ? `<img class="mushi-header-host-icon" src="${escapeHtml(ctx.pageFaviconHref)}" alt="" referrerpolicy="no-referrer" width="20" height="20" />` : "\u866B"}</div>
1400
+ <div class="mushi-header-titles">
1401
+ ${eyebrowHtml}
1402
+ <h3>${title}</h3>
1403
+ </div>
1404
+ <div class="mushi-header-meta">
1405
+ ${counterHtml}
1406
+ <button type="button" class="mushi-close" data-action="close" aria-label="${escapeHtml(t.widget.close)}">\u2715</button>
1407
+ </div>
1408
+ </div>
1409
+ `;
3041
1410
  }
3042
1411
  function countMoreNavItems(ctx) {
3043
1412
  let n = 1;
@@ -3056,59 +1425,59 @@ function renderMoreNavSection(ctx) {
3056
1425
  const reportsLabel = unread ? `${mn.yourReports} (${unread} ${mn.unreadNew})` : mn.yourReports;
3057
1426
  const panelItems = [
3058
1427
  `<button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
3059
- <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
3060
- <div class="mushi-option-text">
3061
- <span class="mushi-option-label">${escapeHtml(reportsLabel)}</span>
3062
- <span class="mushi-option-desc">${escapeHtml(mn.yourReportsDesc)}</span>
3063
- </div>
3064
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3065
- </button>`
1428
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
1429
+ <div class="mushi-option-text">
1430
+ <span class="mushi-option-label">${escapeHtml(reportsLabel)}</span>
1431
+ <span class="mushi-option-desc">${escapeHtml(mn.yourReportsDesc)}</span>
1432
+ </div>
1433
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1434
+ </button>`
3066
1435
  ];
3067
1436
  if (ctx.callbacks.onFeatureBoardRequest) {
3068
1437
  panelItems.push(`
3069
- <button type="button" class="mushi-option-btn" data-action="roadmap">
3070
- <span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
3071
- <div class="mushi-option-text">
3072
- <span class="mushi-option-label">${escapeHtml(mn.communityIdeas)}</span>
3073
- <span class="mushi-option-desc">${escapeHtml(mn.communityIdeasDesc)}</span>
3074
- </div>
3075
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3076
- </button>`);
1438
+ <button type="button" class="mushi-option-btn" data-action="roadmap">
1439
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
1440
+ <div class="mushi-option-text">
1441
+ <span class="mushi-option-label">${escapeHtml(mn.communityIdeas)}</span>
1442
+ <span class="mushi-option-desc">${escapeHtml(mn.communityIdeasDesc)}</span>
1443
+ </div>
1444
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1445
+ </button>`);
3077
1446
  }
3078
1447
  if (ctx.callbacks.assistantEnabled) {
3079
1448
  panelItems.push(`
3080
- <button type="button" class="mushi-option-btn" data-action="assistant">
3081
- <span class="mushi-option-icon" aria-hidden="true">\u{1F4AC}</span>
3082
- <div class="mushi-option-text">
3083
- <span class="mushi-option-label">${escapeHtml(ctx.callbacks.assistantLabel || t.assistant.defaultLabel)}</span>
3084
- <span class="mushi-option-desc">${escapeHtml(t.assistant.hubDescription)}</span>
3085
- </div>
3086
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3087
- </button>`);
1449
+ <button type="button" class="mushi-option-btn" data-action="assistant">
1450
+ <span class="mushi-option-icon" aria-hidden="true">\u{1F4AC}</span>
1451
+ <div class="mushi-option-text">
1452
+ <span class="mushi-option-label">${escapeHtml(ctx.callbacks.assistantLabel || t.assistant.defaultLabel)}</span>
1453
+ <span class="mushi-option-desc">${escapeHtml(t.assistant.hubDescription)}</span>
1454
+ </div>
1455
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1456
+ </button>`);
3088
1457
  }
3089
1458
  if (ctx.rewardsState) {
3090
1459
  panelItems.push(`
3091
- <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(mn.leaderboard)}</button>`);
1460
+ <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(mn.leaderboard)}</button>`);
3092
1461
  }
3093
1462
  panelItems.push(`
3094
- <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-account">
3095
- ${ctx.testerInfo ? `\u{1F464} ${escapeHtml(ctx.testerInfo.public_handle ?? ctx.testerInfo.display_name ?? mn.myAccount)}` : `\u{1F310} ${escapeHtml(mn.joinCommunity)}`}
3096
- </button>`);
1463
+ <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-account">
1464
+ ${ctx.testerInfo ? `\u{1F464} ${escapeHtml(ctx.testerInfo.public_handle ?? ctx.testerInfo.display_name ?? mn.myAccount)}` : `\u{1F310} ${escapeHtml(mn.joinCommunity)}`}
1465
+ </button>`);
3097
1466
  const panelHtml = ctx.showMoreNav ? `<div class="mushi-more-nav-panel">${panelItems.join("")}</div>` : "";
3098
1467
  return `
3099
- <div class="mushi-more-nav">
3100
- <button
3101
- type="button"
3102
- class="mushi-more-toggle mushi-more-nav-toggle"
3103
- data-action="toggle-more-nav"
3104
- aria-expanded="${ctx.showMoreNav ? "true" : "false"}"
3105
- >
3106
- <span class="mushi-more-toggle-text">${escapeHtml(toggleLabel)}</span>
3107
- <span class="mushi-more-toggle-arrow" aria-hidden="true">${ctx.showMoreNav ? "\u25BE" : "\u25B8"}</span>
3108
- </button>
3109
- ${panelHtml}
3110
- </div>
3111
- `;
1468
+ <div class="mushi-more-nav">
1469
+ <button
1470
+ type="button"
1471
+ class="mushi-more-toggle mushi-more-nav-toggle"
1472
+ data-action="toggle-more-nav"
1473
+ aria-expanded="${ctx.showMoreNav ? "true" : "false"}"
1474
+ >
1475
+ <span class="mushi-more-toggle-text">${escapeHtml(toggleLabel)}</span>
1476
+ <span class="mushi-more-toggle-arrow" aria-hidden="true">${ctx.showMoreNav ? "\u25BE" : "\u25B8"}</span>
1477
+ </button>
1478
+ ${panelHtml}
1479
+ </div>
1480
+ `;
3112
1481
  }
3113
1482
  function renderCategoryStep(ctx) {
3114
1483
  const t = ctx.locale;
@@ -3124,15 +1493,15 @@ function renderCategoryStep(ctx) {
3124
1493
  desc: t.step1.categoryDescriptions[id]
3125
1494
  }));
3126
1495
  const renderEntry = ({ id, icon, label, desc }) => `
3127
- <button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
3128
- <span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
3129
- <div class="mushi-option-text">
3130
- <span class="mushi-option-label">${escapeHtml(label)}</span>
3131
- ${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
3132
- </div>
3133
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3134
- </button>
3135
- `;
1496
+ <button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
1497
+ <span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
1498
+ <div class="mushi-option-text">
1499
+ <span class="mushi-option-label">${escapeHtml(label)}</span>
1500
+ ${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
1501
+ </div>
1502
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1503
+ </button>
1504
+ `;
3136
1505
  const isCustom = ctx.config.categories && ctx.config.categories.length > 0;
3137
1506
  const PRIMARY_LIMIT = 1;
3138
1507
  const primaryEntries = isCustom ? categoryEntries : categoryEntries.slice(0, PRIMARY_LIMIT);
@@ -3141,22 +1510,22 @@ function renderCategoryStep(ctx) {
3141
1510
  const primaryCategories = primaryEntries.map(renderEntry).join("");
3142
1511
  const secondaryCategories = secondaryEntries.map(renderEntry).join("");
3143
1512
  const secondaryHtml = hasMore ? ctx.showAllCategories ? `<div class="mushi-categories-expanded">${secondaryCategories}</div>` : `<button type="button" class="mushi-more-toggle" data-action="show-all-categories">
3144
- <span class="mushi-more-toggle-text">${escapeHtml(t.step1.moreCategoriesLabel)}</span>
3145
- <span class="mushi-more-toggle-count">${escapeHtml(t.step1.moreCategoriesCount.replace("{n}", String(secondaryEntries.length)))}</span>
3146
- <span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
3147
- </button>` : "";
1513
+ <span class="mushi-more-toggle-text">${escapeHtml(t.step1.moreCategoriesLabel)}</span>
1514
+ <span class="mushi-more-toggle-count">${escapeHtml(t.step1.moreCategoriesCount.replace("{n}", String(secondaryEntries.length)))}</span>
1515
+ <span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
1516
+ </button>` : "";
3148
1517
  return `
3149
- ${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
3150
- ${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
3151
- <div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
3152
- <p class="mushi-section-label">${escapeHtml(t.step1.reportSectionLabel)}</p>
3153
- ${renderFeatureRequestEntry(ctx)}
3154
- ${primaryCategories}
3155
- ${secondaryHtml}
3156
- ${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
3157
- ${renderMoreNavSection(ctx)}
3158
- </div>
3159
- `;
1518
+ ${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
1519
+ ${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
1520
+ <div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
1521
+ <p class="mushi-section-label">${escapeHtml(t.step1.reportSectionLabel)}</p>
1522
+ ${renderFeatureRequestEntry(ctx)}
1523
+ ${primaryCategories}
1524
+ ${secondaryHtml}
1525
+ ${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
1526
+ ${renderMoreNavSection(ctx)}
1527
+ </div>
1528
+ `;
3160
1529
  }
3161
1530
  function renderFeatureRequestEntry(ctx) {
3162
1531
  const enabled = ctx.config.featureRequestCard !== false;
@@ -3165,20 +1534,20 @@ function renderFeatureRequestEntry(ctx) {
3165
1534
  const label = ctx.config.featureRequestLabel || f.label;
3166
1535
  const desc = ctx.config.featureRequestDescription || f.description;
3167
1536
  return `
3168
- <button
3169
- type="button"
3170
- class="mushi-option-btn mushi-feature-entry"
3171
- data-action="feature-request"
3172
- aria-label="${escapeHtml(label)}"
3173
- >
3174
- <span class="mushi-option-icon" aria-hidden="true">\u2728</span>
3175
- <div class="mushi-option-text">
3176
- <span class="mushi-option-label">${escapeHtml(label)}</span>
3177
- <span class="mushi-option-desc">${escapeHtml(desc)}</span>
3178
- </div>
3179
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3180
- </button>
3181
- `;
1537
+ <button
1538
+ type="button"
1539
+ class="mushi-option-btn mushi-feature-entry"
1540
+ data-action="feature-request"
1541
+ aria-label="${escapeHtml(label)}"
1542
+ >
1543
+ <span class="mushi-option-icon" aria-hidden="true">\u2728</span>
1544
+ <div class="mushi-option-text">
1545
+ <span class="mushi-option-label">${escapeHtml(label)}</span>
1546
+ <span class="mushi-option-desc">${escapeHtml(desc)}</span>
1547
+ </div>
1548
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1549
+ </button>
1550
+ `;
3182
1551
  }
3183
1552
  function renderBetaChangelog(ctx) {
3184
1553
  const entries = ctx.config.betaMode?.changelogItems;
@@ -3190,11 +1559,11 @@ function renderBetaChangelog(ctx) {
3190
1559
  );
3191
1560
  const label = latest.date ? `${whatsNew} \xB7 ${escapeHtml(latest.date)}` : whatsNew;
3192
1561
  return `
3193
- <details class="mushi-changelog">
3194
- <summary class="mushi-changelog-summary">${label}</summary>
3195
- <ul class="mushi-changelog-list">${items}</ul>
3196
- </details>
3197
- `;
1562
+ <details class="mushi-changelog">
1563
+ <summary class="mushi-changelog-summary">${label}</summary>
1564
+ <ul class="mushi-changelog-list">${items}</ul>
1565
+ </details>
1566
+ `;
3198
1567
  }
3199
1568
  function renderBetaStrip(ctx) {
3200
1569
  const beta = ctx.config.betaMode;
@@ -3204,20 +1573,20 @@ function renderBetaStrip(ctx) {
3204
1573
  const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
3205
1574
  const perks = beta.perks ?? [];
3206
1575
  return `
3207
- <div class="mushi-beta-strip" role="note" aria-label="${escapeHtml(strip.ariaLabel)}">
3208
- <div class="mushi-beta-strip-row">
3209
- <span class="mushi-beta-tag" aria-hidden="true">BETA</span>
3210
- <span class="mushi-beta-msg">${message}</span>
3211
- </div>
3212
- ${email ? `<div class="mushi-beta-contact-hint">${escapeHtml(strip.contactHint).replace("{email}", email)}</div>` : ""}
3213
- ${perks.length > 0 ? `
3214
- <ul class="mushi-beta-perks" aria-label="Beta tester perks">
3215
- ${perks.map((p) => `<li>\u2713 ${escapeHtml(p)}</li>`).join("")}
3216
- </ul>
3217
- ` : ""}
3218
- ${renderBetaChangelog(ctx)}
3219
- </div>
3220
- `;
1576
+ <div class="mushi-beta-strip" role="note" aria-label="${escapeHtml(strip.ariaLabel)}">
1577
+ <div class="mushi-beta-strip-row">
1578
+ <span class="mushi-beta-tag" aria-hidden="true">BETA</span>
1579
+ <span class="mushi-beta-msg">${message}</span>
1580
+ </div>
1581
+ ${email ? `<div class="mushi-beta-contact-hint">${escapeHtml(strip.contactHint).replace("{email}", email)}</div>` : ""}
1582
+ ${perks.length > 0 ? `
1583
+ <ul class="mushi-beta-perks" aria-label="Beta tester perks">
1584
+ ${perks.map((p) => `<li>\u2713 ${escapeHtml(p)}</li>`).join("")}
1585
+ </ul>
1586
+ ` : ""}
1587
+ ${renderBetaChangelog(ctx)}
1588
+ </div>
1589
+ `;
3221
1590
  }
3222
1591
  function renderReportsStep(ctx) {
3223
1592
  const f = ctx.locale.flows;
@@ -3227,28 +1596,28 @@ function renderReportsStep(ctx) {
3227
1596
  const when = formatRelativeTime(report.created_at);
3228
1597
  const unread = report.unread_count && report.unread_count > 0 ? `<span class="mushi-unread-badge" aria-label="${report.unread_count} unread">${report.unread_count}</span>` : "";
3229
1598
  return `
3230
- <button type="button" class="mushi-report-row" data-report-id="${escapeHtml(report.id)}" aria-label="View report: ${escapeHtml(title)}">
3231
- <div class="mushi-report-main">
3232
- <span class="mushi-report-title">${escapeHtml(title)}</span>
3233
- <span class="mushi-report-meta">
3234
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(report.status))}</span>
3235
- ${when ? `<span class="mushi-report-when">${escapeHtml(when)}</span>` : ""}
3236
- ${unread}
3237
- </span>
3238
- </div>
3239
- <span class="mushi-report-chevron" aria-hidden="true">\u203A</span>
3240
- </button>`;
1599
+ <button type="button" class="mushi-report-row" data-report-id="${escapeHtml(report.id)}" aria-label="View report: ${escapeHtml(title)}">
1600
+ <div class="mushi-report-main">
1601
+ <span class="mushi-report-title">${escapeHtml(title)}</span>
1602
+ <span class="mushi-report-meta">
1603
+ <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(report.status))}</span>
1604
+ ${when ? `<span class="mushi-report-when">${escapeHtml(when)}</span>` : ""}
1605
+ ${unread}
1606
+ </span>
1607
+ </div>
1608
+ <span class="mushi-report-chevron" aria-hidden="true">\u203A</span>
1609
+ </button>`;
3241
1610
  }).join("");
3242
1611
  const leaderboardBtn = ctx.rewardsState ? `<button type="button" class="mushi-leaderboard-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(f.reports.leaderboardLink)}</button>` : "";
3243
1612
  return `
3244
- ${renderHeader(ctx, { title: f.reports.title, showBack: true, eyebrow: f.eyebrows.inbox })}
3245
- <div class="mushi-body">
3246
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.loading)}</p>` : ""}
3247
- ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
3248
- ${reports || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.empty)}</p>` : "")}
3249
- ${leaderboardBtn}
3250
- </div>
3251
- `;
1613
+ ${renderHeader(ctx, { title: f.reports.title, showBack: true, eyebrow: f.eyebrows.inbox })}
1614
+ <div class="mushi-body">
1615
+ ${ctx.listLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.loading)}</p>` : ""}
1616
+ ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
1617
+ ${reports || (!ctx.listLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.empty)}</p>` : "")}
1618
+ ${leaderboardBtn}
1619
+ </div>
1620
+ `;
3252
1621
  }
3253
1622
  function renderRoadmapStep(ctx) {
3254
1623
  const f = ctx.locale.flows;
@@ -3261,28 +1630,28 @@ function renderRoadmapStep(ctx) {
3261
1630
  const status = shipped ? f.roadmap.shipped : String(ticket.status_label ?? ticket.status ?? "open");
3262
1631
  const voteLabel = f.roadmap.voteCount.replace("{n}", String(votes));
3263
1632
  return `
3264
- <div class="mushi-report-row mushi-roadmap-row">
3265
- <div class="mushi-report-main">
3266
- <span class="mushi-report-title">${subject}</span>
3267
- <span class="mushi-report-meta">
3268
- <span class="mushi-report-status">${escapeHtml(status)}</span>
3269
- <span class="mushi-report-when">${escapeHtml(voteLabel)}</span>
3270
- </span>
3271
- </div>
3272
- ${ctx.callbacks.onFeatureBoardVote ? `
3273
- <button type="button" class="mushi-vote-btn" data-vote-id="${escapeHtml(id)}" aria-pressed="${voted}">
3274
- ${voted ? escapeHtml(f.roadmap.voted) : escapeHtml(f.roadmap.vote)}
3275
- </button>` : ""}
3276
- </div>`;
1633
+ <div class="mushi-report-row mushi-roadmap-row">
1634
+ <div class="mushi-report-main">
1635
+ <span class="mushi-report-title">${subject}</span>
1636
+ <span class="mushi-report-meta">
1637
+ <span class="mushi-report-status">${escapeHtml(status)}</span>
1638
+ <span class="mushi-report-when">${escapeHtml(voteLabel)}</span>
1639
+ </span>
1640
+ </div>
1641
+ ${ctx.callbacks.onFeatureBoardVote ? `
1642
+ <button type="button" class="mushi-vote-btn" data-vote-id="${escapeHtml(id)}" aria-pressed="${voted}">
1643
+ ${voted ? escapeHtml(f.roadmap.voted) : escapeHtml(f.roadmap.vote)}
1644
+ </button>` : ""}
1645
+ </div>`;
3277
1646
  }).join("");
3278
1647
  return `
3279
- ${renderHeader(ctx, { title: f.roadmap.title, showBack: true, eyebrow: f.eyebrows.roadmap })}
3280
- <div class="mushi-body">
3281
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.loading)}</p>` : ""}
3282
- ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
3283
- ${rows || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.empty)}</p>` : "")}
3284
- </div>
3285
- `;
1648
+ ${renderHeader(ctx, { title: f.roadmap.title, showBack: true, eyebrow: f.eyebrows.roadmap })}
1649
+ <div class="mushi-body">
1650
+ ${ctx.listLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.loading)}</p>` : ""}
1651
+ ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
1652
+ ${rows || (!ctx.listLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.empty)}</p>` : "")}
1653
+ </div>
1654
+ `;
3286
1655
  }
3287
1656
  function renderLeaderboardStep(ctx) {
3288
1657
  const f = ctx.locale.flows;
@@ -3301,24 +1670,24 @@ function renderLeaderboardStep(ctx) {
3301
1670
  const rank = e.rank || i + 1;
3302
1671
  const isMe = ctx.testerReputation && e.tester_id === ctx.testerReputation.tester_id;
3303
1672
  return `
3304
- <div class="mushi-lb-row ${rank === 1 ? "mushi-lb-top" : ""}${isMe ? " mushi-lb-me" : ""}">
3305
- <span class="mushi-lb-rank">#${rank}</span>
3306
- <span class="mushi-lb-name">${escapeHtml(e.public_handle ?? e.display_name ?? f.leaderboard.anon)}</span>
3307
- <span class="mushi-lb-pts">${(e.points_30d ?? e.total_points).toLocaleString()} pts</span>
3308
- </div>
3309
- `;
1673
+ <div class="mushi-lb-row ${rank === 1 ? "mushi-lb-top" : ""}${isMe ? " mushi-lb-me" : ""}">
1674
+ <span class="mushi-lb-rank">#${rank}</span>
1675
+ <span class="mushi-lb-name">${escapeHtml(e.public_handle ?? e.display_name ?? f.leaderboard.anon)}</span>
1676
+ <span class="mushi-lb-pts">${(e.points_30d ?? e.total_points).toLocaleString()} pts</span>
1677
+ </div>
1678
+ `;
3310
1679
  }).join("");
3311
1680
  const myRankBadge = myRank ? `<div class="mushi-lb-myrank">${escapeHtml(f.leaderboard.myRank.replace("{rank}", String(myRank)))}</div>` : !ctx.testerJwt ? `<button type="button" class="mushi-link-btn" data-action="open-account">${escapeHtml(f.leaderboard.signInPrompt)}</button>` : "";
3312
1681
  return `
3313
- ${renderHeader(ctx, { title: f.leaderboard.title, showBack: true, eyebrow: f.eyebrows.community })}
3314
- <div class="mushi-body">
3315
- ${loading ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.loading)}</p>` : ""}
3316
- ${!loading && !entries.length ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.empty)}</p>` : ""}
3317
- <div class="mushi-lb-list">${rows}</div>
3318
- ${myRankBadge}
3319
- <p class="mushi-lb-note">${escapeHtml(f.leaderboard.footer)}</p>
3320
- </div>
3321
- `;
1682
+ ${renderHeader(ctx, { title: f.leaderboard.title, showBack: true, eyebrow: f.eyebrows.community })}
1683
+ <div class="mushi-body">
1684
+ ${loading ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.loading)}</p>` : ""}
1685
+ ${!loading && !entries.length ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.empty)}</p>` : ""}
1686
+ <div class="mushi-lb-list">${rows}</div>
1687
+ ${myRankBadge}
1688
+ <p class="mushi-lb-note">${escapeHtml(f.leaderboard.footer)}</p>
1689
+ </div>
1690
+ `;
3322
1691
  }
3323
1692
  function renderAccountStep(ctx) {
3324
1693
  const f = ctx.locale.flows;
@@ -3328,56 +1697,56 @@ function renderAccountStep(ctx) {
3328
1697
  const rep = ctx.testerReputation;
3329
1698
  const rankLine = rep ? f.account.rankSummary.replace("{rank}", String(rep.rank ?? "\u2014")).replace("{points}", (rep.points_30d ?? 0).toLocaleString()) : "";
3330
1699
  return `
3331
- ${renderHeader(ctx, { title: f.account.title, showBack: true, eyebrow: f.eyebrows.identity })}
3332
- <div class="mushi-body">
3333
- <div class="mushi-account-card">
3334
- <div class="mushi-account-avatar">${escapeHtml(handle.charAt(0).toUpperCase())}</div>
3335
- <div class="mushi-account-info">
3336
- <strong>${escapeHtml(handle)}</strong>
3337
- ${rep ? `<span class="mushi-account-rank">${escapeHtml(rankLine)}</span>` : ""}
3338
- </div>
3339
- </div>
3340
- <button type="button" class="mushi-nav-item" data-action="open-cross-app-reports">
3341
- ${escapeHtml(f.account.crossAppReports)}
3342
- </button>
3343
- <button type="button" class="mushi-nav-item" data-action="open-global-leaderboard">
3344
- ${escapeHtml(f.account.viewLeaderboard)}
3345
- </button>
3346
- <button type="button" class="mushi-link-btn" data-action="sign-out-tester">${escapeHtml(f.account.signOut)}</button>
3347
- </div>
3348
- `;
1700
+ ${renderHeader(ctx, { title: f.account.title, showBack: true, eyebrow: f.eyebrows.identity })}
1701
+ <div class="mushi-body">
1702
+ <div class="mushi-account-card">
1703
+ <div class="mushi-account-avatar">${escapeHtml(handle.charAt(0).toUpperCase())}</div>
1704
+ <div class="mushi-account-info">
1705
+ <strong>${escapeHtml(handle)}</strong>
1706
+ ${rep ? `<span class="mushi-account-rank">${escapeHtml(rankLine)}</span>` : ""}
1707
+ </div>
1708
+ </div>
1709
+ <button type="button" class="mushi-nav-item" data-action="open-cross-app-reports">
1710
+ ${escapeHtml(f.account.crossAppReports)}
1711
+ </button>
1712
+ <button type="button" class="mushi-nav-item" data-action="open-global-leaderboard">
1713
+ ${escapeHtml(f.account.viewLeaderboard)}
1714
+ </button>
1715
+ <button type="button" class="mushi-link-btn" data-action="sign-out-tester">${escapeHtml(f.account.signOut)}</button>
1716
+ </div>
1717
+ `;
3349
1718
  }
3350
1719
  if (ctx.magicLinkSent) {
3351
1720
  return `
3352
- ${renderHeader(ctx, { title: f.account.checkEmailTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
3353
- <div class="mushi-body">
3354
- <p class="mushi-muted">${escapeHtml(f.account.magicLinkSent.replace("{email}", ctx.magicLinkEmail))}</p>
3355
- <button type="button" class="mushi-link-btn" data-action="resend-magic-link">${escapeHtml(f.account.resendEmail)}</button>
3356
- ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
3357
- </div>
3358
- `;
1721
+ ${renderHeader(ctx, { title: f.account.checkEmailTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
1722
+ <div class="mushi-body">
1723
+ <p class="mushi-muted">${escapeHtml(f.account.magicLinkSent.replace("{email}", ctx.magicLinkEmail))}</p>
1724
+ <button type="button" class="mushi-link-btn" data-action="resend-magic-link">${escapeHtml(f.account.resendEmail)}</button>
1725
+ ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
1726
+ </div>
1727
+ `;
3359
1728
  }
3360
1729
  return `
3361
- ${renderHeader(ctx, { title: f.account.joinTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
3362
- <div class="mushi-body">
3363
- <p class="mushi-muted">${escapeHtml(f.account.signInPrompt)}</p>
3364
- <label class="mushi-label" for="mushi-email-input">${escapeHtml(f.account.emailLabel)}</label>
3365
- <input
3366
- id="mushi-email-input"
3367
- type="email"
3368
- class="mushi-textarea"
3369
- data-role="magic-link-email"
3370
- placeholder="${escapeHtml(f.account.emailPlaceholder)}"
3371
- autocomplete="email"
3372
- value="${escapeHtml(ctx.magicLinkEmail)}"
3373
- style="padding: 10px 12px; height: auto; resize: none;"
3374
- />
3375
- ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
3376
- <button type="button" class="mushi-submit" data-action="send-magic-link"${ctx.magicLinkSending ? ' disabled aria-disabled="true"' : ""}>
3377
- <span>${ctx.magicLinkSending ? escapeHtml(f.account.sending) : escapeHtml(f.account.sendLink)}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3378
- </button>
3379
- </div>
3380
- `;
1730
+ ${renderHeader(ctx, { title: f.account.joinTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
1731
+ <div class="mushi-body">
1732
+ <p class="mushi-muted">${escapeHtml(f.account.signInPrompt)}</p>
1733
+ <label class="mushi-label" for="mushi-email-input">${escapeHtml(f.account.emailLabel)}</label>
1734
+ <input
1735
+ id="mushi-email-input"
1736
+ type="email"
1737
+ class="mushi-textarea"
1738
+ data-role="magic-link-email"
1739
+ placeholder="${escapeHtml(f.account.emailPlaceholder)}"
1740
+ autocomplete="email"
1741
+ value="${escapeHtml(ctx.magicLinkEmail)}"
1742
+ style="padding: 10px 12px; height: auto; resize: none;"
1743
+ />
1744
+ ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
1745
+ <button type="button" class="mushi-submit" data-action="send-magic-link"${ctx.magicLinkSending ? ' disabled aria-disabled="true"' : ""}>
1746
+ <span>${ctx.magicLinkSending ? escapeHtml(f.account.sending) : escapeHtml(f.account.sendLink)}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
1747
+ </button>
1748
+ </div>
1749
+ `;
3381
1750
  }
3382
1751
  function renderCrossAppReportsStep(ctx) {
3383
1752
  const f = ctx.locale.flows;
@@ -3403,70 +1772,75 @@ function renderCrossAppReportsStep(ctx) {
3403
1772
  appDomain: group.domain
3404
1773
  });
3405
1774
  return `
3406
- <div class="mushi-xapp-group">
3407
- <div class="mushi-xapp-app-head">
3408
- ${icon}
3409
- <h4 class="mushi-xapp-app-name">${escapeHtml(group.name)}</h4>
3410
- </div>
3411
- ${group.reports.map((r) => {
1775
+ <div class="mushi-xapp-group">
1776
+ <div class="mushi-xapp-app-head">
1777
+ ${icon}
1778
+ <h4 class="mushi-xapp-app-name">${escapeHtml(group.name)}</h4>
1779
+ </div>
1780
+ ${group.reports.map((r) => {
3412
1781
  const tone = reporterStatusTone(r.status);
3413
1782
  return `
3414
- <div class="mushi-report-row" data-report-id="${escapeHtml(r.id)}" tabindex="0" role="button">
3415
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(r.status))}</span>
3416
- <span class="mushi-report-title">${escapeHtml(r.title ?? r.category)}</span>
3417
- <span class="mushi-report-when">${escapeHtml(formatRelativeTime(r.created_at))}</span>
3418
- </div>
3419
- `;
1783
+ <div class="mushi-report-row" data-report-id="${escapeHtml(r.id)}" tabindex="0" role="button">
1784
+ <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(r.status))}</span>
1785
+ <span class="mushi-report-title">${escapeHtml(r.title ?? r.category)}</span>
1786
+ <span class="mushi-report-when">${escapeHtml(formatRelativeTime(r.created_at))}</span>
1787
+ </div>
1788
+ `;
3420
1789
  }).join("")}
3421
- </div>
3422
- `;
1790
+ </div>
1791
+ `;
3423
1792
  }).join("");
3424
1793
  return `
3425
- ${renderHeader(ctx, { title: f.crossApp.title, showBack: true, eyebrow: f.eyebrows.allApps })}
3426
- <div class="mushi-body">
3427
- ${ctx.crossAppLoading ? `<p class="mushi-muted">${escapeHtml(f.crossApp.loading)}</p>` : ""}
3428
- ${!ctx.crossAppLoading && !reports.length ? `<p class="mushi-muted">${escapeHtml(f.crossApp.empty)}</p>` : ""}
3429
- ${rows}
3430
- </div>
3431
- `;
1794
+ ${renderHeader(ctx, { title: f.crossApp.title, showBack: true, eyebrow: f.eyebrows.allApps })}
1795
+ <div class="mushi-body">
1796
+ ${ctx.crossAppLoading ? `<p class="mushi-muted">${escapeHtml(f.crossApp.loading)}</p>` : ""}
1797
+ ${!ctx.crossAppLoading && !reports.length ? `<p class="mushi-muted">${escapeHtml(f.crossApp.empty)}</p>` : ""}
1798
+ ${rows}
1799
+ </div>
1800
+ `;
3432
1801
  }
3433
1802
  function renderReportDetailStep(ctx) {
3434
1803
  const f = ctx.locale.flows;
3435
1804
  const report = ctx.reporterReports.find((r) => r.id === ctx.selectedReportId);
3436
- const status = report?.status ?? "unknown";
1805
+ const status = report?.status ?? "new";
3437
1806
  const tone = reporterStatusTone(status);
3438
1807
  const when = report?.created_at ? formatRelativeTime(report.created_at) : "";
1808
+ const busy = ctx.actionPending ? ' disabled aria-busy="true"' : "";
3439
1809
  const comments = ctx.reporterComments.map((comment) => `
3440
- <div class="mushi-thread-comment ${comment.author_kind}">
3441
- <strong>${escapeHtml(comment.author_kind === "reporter" ? "You" : comment.author_name ?? "Developer")}</strong>
3442
- <p>${escapeHtml(comment.body)}</p>
3443
- </div>
3444
- `).join("");
1810
+ <div class="mushi-thread-comment ${comment.author_kind}">
1811
+ <strong>${escapeHtml(comment.author_kind === "reporter" ? "You" : comment.author_name ?? "Developer")}</strong>
1812
+ <p>${escapeHtml(comment.body)}</p>
1813
+ </div>
1814
+ `).join("");
3445
1815
  return `
3446
- ${renderHeader(ctx, { title: f.thread.title, showBack: true, eyebrow: f.eyebrows.thread })}
3447
- <div class="mushi-body">
3448
- <div class="mushi-thread-summary">
3449
- <div class="mushi-thread-summary-meta">
3450
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusLabel(status))}</span>
3451
- ${when ? `<span class="mushi-report-when">Reported ${escapeHtml(when)}</span>` : ""}
3452
- </div>
3453
- <p>${escapeHtml(report?.summary ?? report?.description ?? "Report details")}</p>
3454
- </div>
3455
- <div class="mushi-thread">
3456
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.thread.loading)}</p>` : comments || `<p class="mushi-muted">${escapeHtml(f.thread.empty)}</p>`}
3457
- </div>
3458
- ${["fixed", "resolved", "verified"].includes(status) ? `
3459
- <div class="mushi-verify-actions" role="group" aria-label="Fix verification">
3460
- <button type="button" class="mushi-option-btn" data-action="reporter-confirms">${escapeHtml(f.thread.confirmFixed)}</button>
3461
- <button type="button" class="mushi-option-btn" data-action="reporter-not-fixed">${escapeHtml(f.thread.notFixed)}</button>
3462
- </div>
3463
- ` : ""}
3464
- <textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
3465
- <button type="button" class="mushi-submit" data-action="reporter-reply">
3466
- <span>Reply</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3467
- </button>
3468
- </div>
3469
- `;
1816
+ ${renderHeader(ctx, { title: f.thread.title, showBack: true, eyebrow: f.eyebrows.thread })}
1817
+ <div class="mushi-body">
1818
+ <div class="mushi-thread-summary">
1819
+ <div class="mushi-thread-summary-meta">
1820
+ <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusLabel(status))}</span>
1821
+ ${when ? `<span class="mushi-report-when">Reported ${escapeHtml(when)}</span>` : ""}
1822
+ </div>
1823
+ <p>${escapeHtml(report?.summary ?? report?.description ?? `#${(ctx.selectedReportId ?? "").slice(0, 8)}`)}</p>
1824
+ </div>
1825
+ <div class="mushi-thread">
1826
+ ${ctx.threadLoading ? `<div class="mushi-thread-skeleton" role="status" aria-label="${escapeHtml(f.thread.loading)}"><span></span><span></span></div>` : ctx.threadError ? `<p class="mushi-error-inline" role="alert">${escapeHtml(ctx.threadError)}</p>
1827
+ <button type="button" class="mushi-link-btn" data-action="retry-thread">${escapeHtml(f.thread.retry)}</button>` : comments || `<p class="mushi-muted">${escapeHtml(f.thread.empty)}</p>`}
1828
+ </div>
1829
+ ${["fixed", "resolved", "verified"].includes(status) ? `
1830
+ <div class="mushi-verify-actions" role="group" aria-label="Fix verification">
1831
+ <button type="button" class="mushi-option-btn" data-action="reporter-confirms"${busy}>${escapeHtml(f.thread.confirmFixed)}</button>
1832
+ <button type="button" class="mushi-option-btn" data-action="reporter-not-fixed"${busy}>${escapeHtml(f.thread.notFixed)}</button>
1833
+ </div>
1834
+ ` : ""}
1835
+ </div>
1836
+ ${ctx.actionError ? `<p class="mushi-error-inline mushi-thread-action-error" role="alert">${escapeHtml(ctx.actionError)}</p>` : ""}
1837
+ <div class="mushi-footer mushi-thread-composer">
1838
+ <textarea class="mushi-textarea" data-role="reporter-reply" rows="2" placeholder="${escapeHtml(f.thread.replyPlaceholder)}"></textarea>
1839
+ <button type="button" class="mushi-submit" data-action="reporter-reply"${busy}>
1840
+ <span>${escapeHtml(f.thread.send)}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
1841
+ </button>
1842
+ </div>
1843
+ `;
3470
1844
  }
3471
1845
  function renderIntentStep(ctx) {
3472
1846
  const t = ctx.locale;
@@ -3474,30 +1848,30 @@ function renderIntentStep(ctx) {
3474
1848
  const customEntry = ctx.resolveCustomCategory(catId);
3475
1849
  const intents = customEntry?.intents ?? (t.step2.intents[catId] || []);
3476
1850
  const options = intents.map((intent) => `
3477
- <button type="button" class="mushi-option-btn" data-intent="${escapeHtml(intent)}">
3478
- <span class="mushi-option-text"><span class="mushi-option-label">${escapeHtml(intent)}</span></span>
3479
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3480
- </button>
3481
- `).join("");
1851
+ <button type="button" class="mushi-option-btn" data-intent="${escapeHtml(intent)}">
1852
+ <span class="mushi-option-text"><span class="mushi-option-label">${escapeHtml(intent)}</span></span>
1853
+ <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
1854
+ </button>
1855
+ `).join("");
3482
1856
  const icon = ctx.categoryIcon(catId);
3483
1857
  const label = ctx.categoryLabel(catId);
3484
1858
  return `
3485
- ${renderHeader(ctx, { title: t.step2.heading, showBack: true, step: STEP_NUMBER.intent })}
3486
- <div class="mushi-body">
3487
- <div class="mushi-selected-category">
3488
- <span aria-hidden="true">${escapeHtml(icon)}</span>
3489
- <span>${escapeHtml(label)}</span>
3490
- </div>
3491
- <div class="mushi-intents">
3492
- ${options}
3493
- </div>
3494
- </div>
3495
- `;
1859
+ ${renderHeader(ctx, { title: t.step2.heading, showBack: true, step: STEP_NUMBER.intent })}
1860
+ <div class="mushi-body">
1861
+ <div class="mushi-selected-category">
1862
+ <span aria-hidden="true">${escapeHtml(icon)}</span>
1863
+ <span>${escapeHtml(label)}</span>
1864
+ </div>
1865
+ <div class="mushi-intents">
1866
+ ${options}
1867
+ </div>
1868
+ </div>
1869
+ `;
3496
1870
  }
3497
1871
  function renderDetailsStep(ctx) {
3498
1872
  const t = ctx.locale;
3499
1873
  const minLen = ctx.effectiveMinLength();
3500
- const screenshotLabel = ctx.screenshotCapturing ? t.step3.screenshotCapturing : ctx.screenshotError ? t.step3.screenshotFailed : ctx.screenshotAttached ? t.step3.screenshotAttached : t.step3.screenshotButton;
1874
+ const screenshotLabel = ctx.screenshotCapturing ? t.step3.screenshotCapturing : ctx.screenshotError ? t.step3.screenshotRetry : ctx.screenshotAttached ? t.step3.screenshotAttached : t.step3.screenshotButton;
3501
1875
  const screenshotClass = [
3502
1876
  "mushi-attach-btn",
3503
1877
  ctx.screenshotAttached ? "active" : "",
@@ -3511,143 +1885,162 @@ function renderDetailsStep(ctx) {
3511
1885
  ctx.elementError ? "error" : "",
3512
1886
  ctx.elementCapturing ? "loading" : ""
3513
1887
  ].filter(Boolean).join(" ");
3514
- const exampleChips = t.step3.examplePrompts.map((p) => `<button type="button" class="mushi-example-chip" data-example="${escapeHtml(p)}">${escapeHtml(p)}</button>`).join("");
1888
+ const mode = ctx.detailMode;
1889
+ const placeholder = mode === "feature" ? t.step3.featurePlaceholder : mode === "other" ? t.step3.otherPlaceholder : t.step3.descriptionPlaceholder;
1890
+ const examples = mode === "feature" ? t.step3.featureExamples : mode === "other" ? [] : t.step3.examplePrompts;
1891
+ const exampleChips = examples.map((p) => `<button type="button" class="mushi-example-chip" data-example="${escapeHtml(p)}">${escapeHtml(p)}</button>`).join("");
1892
+ const screenshotReason = ctx.screenshotError && ctx.screenshotErrorReason ? `<p class="mushi-error-inline" role="status" data-role="screenshot-reason">${escapeHtml(t.step3.screenshotErrors[ctx.screenshotErrorReason])}${ctx.callbacks.onScreenshotShareTabRequest ? ` <button type="button" class="mushi-link-btn" data-action="screenshot-share-tab">${escapeHtml(t.step3.screenshotShareTab)}</button>` : ""}</p>` : "";
3515
1893
  return `
3516
- ${renderHeader(ctx, { title: t.step3.heading, showBack: true, step: STEP_NUMBER.details })}
3517
- <div class="mushi-body">
3518
- <div class="mushi-example-chips" aria-label="Example prompts">${exampleChips}</div>
3519
- <div class="mushi-textarea-wrap">
3520
- <textarea
3521
- class="mushi-textarea"
3522
- placeholder="${escapeHtml(t.step3.descriptionPlaceholder)}"
3523
- rows="4"
3524
- maxlength="4000"
3525
- aria-label="${escapeHtml(t.step3.heading)}"
3526
- autofocus
3527
- ></textarea>
3528
- <div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">
3529
- <span data-role="char-current">0</span>/<span data-role="char-min">${minLen}</span>
3530
- </div>
3531
- </div>
3532
- <div class="mushi-attachments">
3533
- ${ctx.screenshotAvailable ? `<button type="button" class="${screenshotClass}"
3534
- data-action="screenshot"
3535
- ${ctx.screenshotCapturing ? "disabled" : ""}
3536
- aria-label="${escapeHtml(screenshotLabel)}"
3537
- >
3538
- ${ctx.screenshotCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F4F8}"}
3539
- ${escapeHtml(screenshotLabel)}
3540
- </button>` : ""}
3541
- ${ctx.screenshotAttached && ctx.allowScreenshotRemove ? '<button type="button" class="mushi-attach-btn danger" data-action="remove-screenshot" aria-label="Remove screenshot">\u2715 Remove</button>' : ""}
3542
- ${ctx.screenshotAttached ? '<button type="button" class="mushi-attach-btn" data-action="annotate-screenshot" aria-label="Mark up screenshot">\u270F Mark up</button><div class="mushi-annotate-host" data-role="annotate-host"></div>' : ""}
3543
- ${ctx.elementAvailable ? `<button type="button" class="${elementClass}"
3544
- data-action="element"
3545
- ${ctx.elementCapturing ? "disabled" : ""}
3546
- aria-label="${escapeHtml(elementLabel)}"
3547
- >
3548
- ${ctx.elementCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F3AF}"}
3549
- ${escapeHtml(elementLabel)}
3550
- </button>` : ""}
3551
- </div>
3552
- ${ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview">
3553
- <img src="${escapeHtml(ctx.screenshotPreview)}" alt="${escapeHtml(t.step3.screenshotPreviewAlt)}" />
3554
- ${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
3555
- </figure>` : ""}
3556
- <div class="mushi-error" style="display:none" role="alert"></div>
3557
- ${ctx.identifiedUser ? `<p class="mushi-identified-user" aria-label="Reporting as ${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "")}">\u{1F464} Reporting as <strong>${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "you")}</strong></p>` : ""}
3558
- </div>
3559
- <div class="mushi-footer">
3560
- <span class="mushi-footer-hint" aria-hidden="true">\u2318 + ENTER \u2192 send</span>
3561
- <button type="button" class="mushi-submit" data-action="submit"${ctx.submitting ? " disabled" : ""}>
3562
- <span>${ctx.submitting ? t.widget.submitting : t.widget.submit}</span>
3563
- <span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3564
- </button>
3565
- </div>
3566
- `;
1894
+ ${renderHeader(ctx, { title: t.step3.heading, showBack: true, step: STEP_NUMBER.details })}
1895
+ <div class="mushi-body">
1896
+ ${exampleChips ? `<div class="mushi-example-chips" aria-label="Example prompts">${exampleChips}</div>` : ""}
1897
+ <div class="mushi-textarea-wrap">
1898
+ <textarea
1899
+ class="mushi-textarea"
1900
+ placeholder="${escapeHtml(placeholder)}"
1901
+ rows="4"
1902
+ maxlength="${DESCRIPTION_MAX_LENGTH}"
1903
+ aria-label="${escapeHtml(t.step3.heading)}"
1904
+ autofocus
1905
+ ></textarea>
1906
+ <div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">${escapeHtml(charCounterText("", minLen, t.step3.charsNeeded))}</div>
1907
+ </div>
1908
+ <div class="mushi-attachments">
1909
+ ${ctx.screenshotAvailable ? `<button type="button" class="${screenshotClass}"
1910
+ data-action="screenshot"
1911
+ ${ctx.screenshotCapturing ? "disabled" : ""}
1912
+ aria-label="${escapeHtml(screenshotLabel)}"
1913
+ >
1914
+ ${ctx.screenshotCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F4F8}"}
1915
+ ${escapeHtml(screenshotLabel)}
1916
+ </button>` : ""}
1917
+ ${ctx.screenshotAttached && ctx.allowScreenshotRemove ? '<button type="button" class="mushi-attach-btn danger" data-action="remove-screenshot" aria-label="Remove screenshot">\u2715 Remove</button>' : ""}
1918
+ ${ctx.screenshotAttached ? '<button type="button" class="mushi-attach-btn" data-action="annotate-screenshot" aria-label="Mark up screenshot">\u270F Mark up</button><div class="mushi-annotate-host" data-role="annotate-host"></div>' : ""}
1919
+ ${ctx.elementAvailable ? `<button type="button" class="${elementClass}"
1920
+ data-action="element"
1921
+ ${ctx.elementCapturing ? "disabled" : ""}
1922
+ aria-label="${escapeHtml(elementLabel)}"
1923
+ >
1924
+ ${ctx.elementCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F3AF}"}
1925
+ ${escapeHtml(elementLabel)}
1926
+ </button>` : ""}
1927
+ </div>
1928
+ ${screenshotReason}
1929
+ ${ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview">
1930
+ <img src="${escapeHtml(ctx.screenshotPreview)}" alt="${escapeHtml(t.step3.screenshotPreviewAlt)}" />
1931
+ ${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
1932
+ </figure>` : ""}
1933
+ <div class="mushi-error" style="display:none" role="alert"></div>
1934
+ ${ctx.identifiedUser ? `<p class="mushi-identified-user" aria-label="Reporting as ${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "")}">\u{1F464} Reporting as <strong>${escapeHtml(ctx.identifiedUser.name ?? ctx.identifiedUser.email ?? "you")}</strong></p>` : ""}
1935
+ </div>
1936
+ <div class="mushi-footer">
1937
+ <span class="mushi-footer-hint" aria-hidden="true">${escapeHtml(t.step3.submitHint.replace("{key}", submitShortcutKey(readPlatform())))}</span>
1938
+ <button type="button" class="mushi-submit" data-action="submit"${ctx.submitting ? " disabled" : ""}>
1939
+ <span>${ctx.submitting ? t.widget.submitting : t.widget.submit}</span>
1940
+ <span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
1941
+ </button>
1942
+ </div>
1943
+ `;
1944
+ }
1945
+ function submitFailureLabel(ctx) {
1946
+ const s = ctx.locale.flows.success;
1947
+ switch (ctx.lastSubmitFailureKind) {
1948
+ case "rate_limited":
1949
+ return s.rateLimited;
1950
+ case "quota":
1951
+ return s.quotaBlocked;
1952
+ case "permanent":
1953
+ return s.permanentFailed;
1954
+ case "retrying":
1955
+ return s.retrying;
1956
+ }
1957
+ return ctx.lastSubmitQueuedOffline ? s.queuedOffline : null;
3567
1958
  }
3568
1959
  function renderSuccessStep(ctx) {
3569
1960
  const t = ctx.locale;
1961
+ const s = t.flows.success;
3570
1962
  const stamp = ctx.submittedAt ?? /* @__PURE__ */ new Date();
3571
- const time = stamp.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false });
1963
+ const locale = ctx.config.locale === "auto" ? void 0 : ctx.config.locale;
1964
+ const failure = submitFailureLabel(ctx);
1965
+ const canTrack = !failure && ctx.lastReportId && ctx.callbacks.onReporterReportsRequest;
3572
1966
  return `
3573
- ${renderHeader(ctx, { title: t.widget.title, showBack: true, eyebrow: "Mushi \xB7 Receipt" })}
3574
- <div class="mushi-body">
3575
- <div class="mushi-success">
3576
- <div class="mushi-success-stamp" aria-hidden="true">
3577
- <svg viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"><circle cx="50" cy="50" r="44"/></svg>
3578
- <span class="mushi-success-stamp-label">\u53D7</span>
3579
- </div>
3580
- <div class="mushi-success-headline">${t.widget.submitted}</div>
3581
- <div class="mushi-success-meta">REPORT \xB7 ${time}</div>
3582
- ${renderSuccessReceipt(ctx)}
3583
- ${ctx.rewardsState ? renderSuccessRewards(ctx) : ""}
3584
- ${ctx.config.betaMode?.enabled ? renderBetaSuccessFooter(ctx) : ""}
3585
- <button type="button" class="mushi-link-btn mushi-success-my-reports" data-action="view-my-reports">
3586
- ${escapeHtml(ctx.locale.flows.success.trackReport)}
3587
- </button>
3588
- </div>
3589
- </div>
3590
- `;
1967
+ ${renderHeader(ctx, { title: escapeHtml(failure ?? s.title), eyebrow: t.flows.eyebrows.receipt })}
1968
+ <div class="mushi-body">
1969
+ <div class="mushi-success">
1970
+ <div class="mushi-success-stamp" aria-hidden="true">
1971
+ <svg viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"><circle cx="50" cy="50" r="44"/></svg>
1972
+ <span class="mushi-success-stamp-label">\u53D7</span>
1973
+ </div>
1974
+ <time class="mushi-success-meta" datetime="${stamp.toISOString()}">${escapeHtml(formatReceiptTime(stamp, locale))}</time>
1975
+ ${renderSuccessReceipt(ctx)}
1976
+ ${ctx.rewardsState ? renderSuccessRewards(ctx) : ""}
1977
+ ${ctx.config.betaMode?.enabled ? renderBetaSuccessFooter(ctx) : ""}
1978
+ ${canTrack ? `<button type="button" class="mushi-link-btn mushi-success-my-reports" data-action="track-report">${escapeHtml(s.trackReport)}</button>` : ""}
1979
+ </div>
1980
+ </div>
1981
+ <div class="mushi-footer">
1982
+ <span></span>
1983
+ <button type="button" class="mushi-submit" data-action="done"><span>${escapeHtml(s.done)}</span></button>
1984
+ </div>
1985
+ `;
3591
1986
  }
3592
1987
  function renderSuccessReceipt(ctx) {
3593
1988
  const s = ctx.locale.flows.success;
3594
1989
  const failureKind = ctx.lastSubmitFailureKind;
3595
- if (failureKind === "rate_limited" || failureKind === "quota" || failureKind === "permanent" || failureKind === "retrying" || ctx.lastSubmitQueuedOffline) {
3596
- const label = failureKind === "rate_limited" ? s.rateLimited : failureKind === "quota" ? s.quotaBlocked : failureKind === "permanent" ? s.permanentFailed : failureKind === "retrying" ? s.retrying : s.queuedOffline;
1990
+ if (submitFailureLabel(ctx)) {
3597
1991
  const hint = failureKind === "rate_limited" ? s.rateLimitedHint : failureKind === "quota" ? s.quotaBlockedHint : failureKind === "permanent" ? s.permanentFailedHint : failureKind === "retrying" ? s.retryingHint : s.queuedHint;
3598
1992
  return `
3599
- <div class="mushi-success-receipt" role="status">
3600
- <div class="mushi-success-receipt-row mushi-success-receipt-warn">
3601
- <span class="mushi-success-receipt-label">${escapeHtml(label)}</span>
3602
- <span class="mushi-success-receipt-hint">${escapeHtml(hint)}</span>
3603
- </div>
3604
- </div>
3605
- `;
1993
+ <div class="mushi-success-receipt" role="status">
1994
+ <div class="mushi-success-receipt-row mushi-success-receipt-warn">
1995
+ <span class="mushi-success-receipt-hint">${escapeHtml(hint)}</span>
1996
+ </div>
1997
+ </div>
1998
+ `;
3606
1999
  }
3607
2000
  if (!ctx.lastReportId) {
3608
2001
  return `
3609
- <div class="mushi-success-receipt" role="status">
3610
- <div class="mushi-success-receipt-row">
3611
- <span class="mushi-success-receipt-spinner" aria-hidden="true"></span>
3612
- <span class="mushi-success-receipt-hint">${escapeHtml(s.delivering)}</span>
3613
- </div>
3614
- ${renderSlaLine(ctx)}
3615
- </div>
3616
- `;
2002
+ <div class="mushi-success-receipt" role="status">
2003
+ <div class="mushi-success-receipt-row">
2004
+ <span class="mushi-success-receipt-spinner" aria-hidden="true"></span>
2005
+ <span class="mushi-success-receipt-hint">${escapeHtml(s.delivering)}</span>
2006
+ </div>
2007
+ ${renderSlaLine(ctx)}
2008
+ </div>
2009
+ `;
3617
2010
  }
3618
2011
  const idShort = `#${ctx.lastReportId.slice(0, 8)}`;
3619
2012
  const dashboard = (ctx.config.dashboardUrl ?? "").replace(/\/$/, "");
3620
2013
  const trackHref = dashboard ? `${dashboard}/reports/${encodeURIComponent(ctx.lastReportId)}` : "";
3621
2014
  const screenshotDroppedNote = ctx.lastSubmitScreenshotDropped ? `
3622
- <div class="mushi-success-receipt-row mushi-success-receipt-warn">
3623
- <span class="mushi-success-receipt-hint">${escapeHtml(s.screenshotDropped)}</span>
3624
- </div>
3625
- ` : "";
2015
+ <div class="mushi-success-receipt-row mushi-success-receipt-warn">
2016
+ <span class="mushi-success-receipt-hint">${escapeHtml(s.screenshotDropped)}</span>
2017
+ </div>
2018
+ ` : "";
3626
2019
  return `
3627
- <div class="mushi-success-receipt" role="status">
3628
- <div class="mushi-success-receipt-row">
3629
- <span class="mushi-success-receipt-label">${escapeHtml(s.receipt)}</span>
3630
- <button
3631
- type="button"
3632
- class="mushi-success-receipt-id"
3633
- data-action="copy-report-id"
3634
- data-copy-id="${escapeHtml(ctx.lastReportId)}"
3635
- title="Copy report id ${escapeHtml(ctx.lastReportId)}"
3636
- aria-label="Copy report id ${escapeHtml(ctx.lastReportId)}"
3637
- >${escapeHtml(idShort)}<span class="mushi-success-receipt-copy" aria-hidden="true">\u2398</span></button>
3638
- </div>
3639
- ${trackHref ? `
3640
- <a
3641
- class="mushi-success-receipt-track"
3642
- href="${escapeHtml(trackHref)}"
3643
- target="_blank"
3644
- rel="noopener noreferrer"
3645
- >${escapeHtml(s.trackOnMushi)} <span aria-hidden="true">\u2197</span></a>
3646
- ` : ""}
3647
- ${screenshotDroppedNote}
3648
- ${renderSlaLine(ctx)}
3649
- </div>
3650
- `;
2020
+ <div class="mushi-success-receipt" role="status">
2021
+ <div class="mushi-success-receipt-row">
2022
+ <span class="mushi-success-receipt-label">${escapeHtml(s.receipt)}</span>
2023
+ <button
2024
+ type="button"
2025
+ class="mushi-success-receipt-id"
2026
+ data-action="copy-report-id"
2027
+ data-copy-id="${escapeHtml(ctx.lastReportId)}"
2028
+ title="Copy report id ${escapeHtml(ctx.lastReportId)}"
2029
+ aria-label="Copy report id ${escapeHtml(ctx.lastReportId)}"
2030
+ >${escapeHtml(idShort)}<span class="mushi-success-receipt-copy" aria-hidden="true">\u2398</span></button>
2031
+ </div>
2032
+ ${trackHref ? `
2033
+ <a
2034
+ class="mushi-success-receipt-track"
2035
+ href="${escapeHtml(trackHref)}"
2036
+ target="_blank"
2037
+ rel="noopener noreferrer"
2038
+ >${escapeHtml(s.trackOnMushi)} <span aria-hidden="true">\u2197</span></a>
2039
+ ` : ""}
2040
+ ${screenshotDroppedNote}
2041
+ ${renderSlaLine(ctx)}
2042
+ </div>
2043
+ `;
3651
2044
  }
3652
2045
  function renderSlaLine(ctx) {
3653
2046
  const sla = (ctx.config.responseSlaLabel ?? "").trim();
@@ -3661,10 +2054,10 @@ function renderBetaSuccessFooter(ctx) {
3661
2054
  const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
3662
2055
  const appName = escapeHtml(beta.appName ?? "the team");
3663
2056
  return `
3664
- <div class="mushi-beta-success-footer" role="note" aria-label="Beta feedback acknowledgement">
3665
- ${email ? `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${email}</div>` : `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${appName}</div>`}
3666
- </div>
3667
- `;
2057
+ <div class="mushi-beta-success-footer" role="note" aria-label="Beta feedback acknowledgement">
2058
+ ${email ? `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${email}</div>` : `<div class="mushi-beta-success-line">\u{1F4EC} Sent to ${appName}</div>`}
2059
+ </div>
2060
+ `;
3668
2061
  }
3669
2062
  function renderRewardsNudge(ctx) {
3670
2063
  const { tier, nextTier, totalPoints, pointsForReport } = ctx.rewardsState;
@@ -3681,21 +2074,21 @@ function renderRewardsNudge(ctx) {
3681
2074
  nextLabel = `${remaining.toLocaleString()} pts to ${escapeHtml(nextTier.displayName)}`;
3682
2075
  }
3683
2076
  return `
3684
- <div class="mushi-rewards-nudge" aria-label="Rewards progress">
3685
- <div class="mushi-rewards-row">
3686
- <span class="mushi-tier-pip" style="background:${color}" aria-hidden="true"></span>
3687
- <span class="mushi-rewards-tier-name">${escapeHtml(tierName)}</span>
3688
- <span class="mushi-rewards-pts-count">${totalPoints.toLocaleString()} pts</span>
3689
- <span class="mushi-rewards-pts-earn">+${pointsForReport} pts for a report</span>
3690
- </div>
3691
- ${nextTier ? `
3692
- <div class="mushi-tier-bar-track" role="progressbar" aria-valuenow="${pct}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
3693
- <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pct / 100}"></div>
3694
- </div>
3695
- <div class="mushi-rewards-next-label">${nextLabel}</div>
3696
- ` : ""}
3697
- </div>
3698
- `;
2077
+ <div class="mushi-rewards-nudge" aria-label="Rewards progress">
2078
+ <div class="mushi-rewards-row">
2079
+ <span class="mushi-tier-pip" style="background:${color}" aria-hidden="true"></span>
2080
+ <span class="mushi-rewards-tier-name">${escapeHtml(tierName)}</span>
2081
+ <span class="mushi-rewards-pts-count">${totalPoints.toLocaleString()} pts</span>
2082
+ <span class="mushi-rewards-pts-earn">+${pointsForReport} pts for a report</span>
2083
+ </div>
2084
+ ${nextTier ? `
2085
+ <div class="mushi-tier-bar-track" role="progressbar" aria-valuenow="${pct}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
2086
+ <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pct / 100}"></div>
2087
+ </div>
2088
+ <div class="mushi-rewards-next-label">${nextLabel}</div>
2089
+ ` : ""}
2090
+ </div>
2091
+ `;
3699
2092
  }
3700
2093
  function renderSuccessRewards(ctx) {
3701
2094
  const { tier, nextTier, totalPoints, pointsForReport } = ctx.rewardsState;
@@ -3710,16 +2103,16 @@ function renderSuccessRewards(ctx) {
3710
2103
  nextLabel = remaining > 0 ? `${remaining.toLocaleString()} pts to ${escapeHtml(nextTier.displayName)}` : `\u{1F389} ${escapeHtml(nextTier.displayName)} reached!`;
3711
2104
  }
3712
2105
  return `
3713
- <div class="mushi-success-rewards">
3714
- <div class="mushi-success-pts-award">+${pointsForReport} pts</div>
3715
- ${nextTier ? `
3716
- <div class="mushi-tier-bar-track success-bar" role="progressbar" aria-valuenow="${pctAfter}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
3717
- <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pctAfter / 100}"></div>
3718
- </div>
3719
- <div class="mushi-rewards-next-label">${nextLabel}</div>
3720
- ` : ""}
3721
- </div>
3722
- `;
2106
+ <div class="mushi-success-rewards">
2107
+ <div class="mushi-success-pts-award">+${pointsForReport} pts</div>
2108
+ ${nextTier ? `
2109
+ <div class="mushi-tier-bar-track success-bar" role="progressbar" aria-valuenow="${pctAfter}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
2110
+ <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pctAfter / 100}"></div>
2111
+ </div>
2112
+ <div class="mushi-rewards-next-label">${nextLabel}</div>
2113
+ ` : ""}
2114
+ </div>
2115
+ `;
3723
2116
  }
3724
2117
 
3725
2118
  // src/widget.ts
@@ -3816,6 +2209,8 @@ var MushiWidget = class _MushiWidget {
3816
2209
  screenshotAttached = false;
3817
2210
  screenshotCapturing = false;
3818
2211
  screenshotError = false;
2212
+ /** Why the last capture failed; drives the actionable hint under the tools. */
2213
+ screenshotErrorReason = null;
3819
2214
  allowScreenshotRemove = true;
3820
2215
  /**
3821
2216
  * Whether the screenshot / element-select tools are actually usable
@@ -3855,12 +2250,27 @@ var MushiWidget = class _MushiWidget {
3855
2250
  nudgeEl = null;
3856
2251
  nudgeTimer = null;
3857
2252
  sdkFreshness = null;
2253
+ /** Brand-footer ref (SDK sets it once hashed) + once-per-instance impression latch. */
2254
+ brandRef = null;
2255
+ brandImpressionSent = false;
3858
2256
  reporterReports = [];
3859
2257
  featureBoard = [];
3860
2258
  reporterComments = [];
3861
2259
  selectedReportId = null;
3862
- reporterLoading = false;
2260
+ /**
2261
+ * One flag per surface. A single shared flag used to let a reply (or vote,
2262
+ * or reopen) blank the thread it was posted from, and a failed reply
2263
+ * replaced the conversation with its error.
2264
+ */
2265
+ listLoading = false;
2266
+ threadLoading = false;
2267
+ actionPending = false;
2268
+ /** List / roadmap load error. */
3863
2269
  reporterError = null;
2270
+ /** Thread (comments) load error — rendered with Try again. */
2271
+ threadError = null;
2272
+ /** Reply / feedback / reopen / vote error — rendered beside the composer. */
2273
+ actionError = null;
3864
2274
  attachedLaunchers = [];
3865
2275
  smartHideCleanup = null;
3866
2276
  smartHideTimer = null;
@@ -3868,12 +2278,25 @@ var MushiWidget = class _MushiWidget {
3868
2278
  * ("REPORT · 14:23:07 JST") doesn't drift while the success step
3869
2279
  * is on screen. */
3870
2280
  submittedAt = null;
3871
- /** Pending success-state + auto-close timers. Tracked so destroy()
3872
- * can clear them — otherwise a host that unmounts mid-submit leaks
3873
- * this MushiWidget reference (and re-renders into a detached shadow
3874
- * root) for up to ~3.3s after destroy. */
2281
+ /** Pending success-state timer. Tracked so destroy() can clear it —
2282
+ * otherwise a host that unmounts mid-submit leaks this MushiWidget
2283
+ * reference (and re-renders into a detached shadow root). */
3875
2284
  successTimer = null;
3876
- autoCloseTimer = null;
2285
+ /**
2286
+ * Set on pointerdown inside the panel. A background re-render (runtime
2287
+ * config, rewards, inbox poll…) that lands between pointerdown and click
2288
+ * replaces the button under the pointer, and the browser then drops the
2289
+ * click — the first Submit "did nothing". render() defers while this is set
2290
+ * (bounded, so a lost pointerup can't freeze the panel).
2291
+ */
2292
+ pointerDownAt = null;
2293
+ renderDeferred = false;
2294
+ onPointerRelease = () => {
2295
+ this.pointerDownAt = null;
2296
+ if (!this.renderDeferred) return;
2297
+ this.renderDeferred = false;
2298
+ setTimeout(() => this.render(), 0);
2299
+ };
3877
2300
  rewardsState = null;
3878
2301
  leaderboardEntries = null;
3879
2302
  leaderboardLoading = false;
@@ -3931,6 +2354,8 @@ var MushiWidget = class _MushiWidget {
3931
2354
  if (this.host.isConnected) return;
3932
2355
  this.syncHostChromeState();
3933
2356
  document.body.appendChild(this.host);
2357
+ window.addEventListener("pointerup", this.onPointerRelease, true);
2358
+ window.addEventListener("pointercancel", this.onPointerRelease, true);
3934
2359
  this.syncAttachedLaunchers();
3935
2360
  this.syncSmartHide();
3936
2361
  this.bindColorSchemeListener();
@@ -4025,6 +2450,7 @@ var MushiWidget = class _MushiWidget {
4025
2450
  this.screenshotAttached = false;
4026
2451
  this.screenshotCapturing = false;
4027
2452
  this.screenshotError = false;
2453
+ this.screenshotErrorReason = null;
4028
2454
  this.screenshotPreview = null;
4029
2455
  this.elementSelected = false;
4030
2456
  this.elementCapturing = false;
@@ -4206,7 +2632,10 @@ var MushiWidget = class _MushiWidget {
4206
2632
  setScreenshotAttached(attached) {
4207
2633
  this.screenshotAttached = attached;
4208
2634
  this.screenshotCapturing = false;
4209
- if (attached) this.screenshotError = false;
2635
+ if (attached) {
2636
+ this.screenshotError = false;
2637
+ this.screenshotErrorReason = null;
2638
+ }
4210
2639
  if (!attached) this.screenshotPreview = null;
4211
2640
  if (this.isOpen) this.render();
4212
2641
  }
@@ -4257,10 +2686,17 @@ var MushiWidget = class _MushiWidget {
4257
2686
  setScreenshotCapturing(capturing) {
4258
2687
  this.screenshotCapturing = capturing;
4259
2688
  this.screenshotError = false;
2689
+ this.screenshotErrorReason = null;
4260
2690
  if (this.isOpen) this.render();
4261
2691
  }
4262
- setScreenshotError(failed) {
2692
+ /**
2693
+ * Flag (or clear) a failed capture. A call without a reason keeps the more
2694
+ * specific one an earlier call recorded for the same attempt (the capture
2695
+ * module reports 'taint'/'timeout' before the caller's generic failure).
2696
+ */
2697
+ setScreenshotError(failed, reason) {
4263
2698
  this.screenshotError = failed;
2699
+ this.screenshotErrorReason = failed ? reason ?? this.screenshotErrorReason ?? "error" : null;
4264
2700
  this.screenshotCapturing = false;
4265
2701
  if (this.isOpen) this.render();
4266
2702
  }
@@ -4363,6 +2799,11 @@ var MushiWidget = class _MushiWidget {
4363
2799
  this.sdkFreshness = info;
4364
2800
  if (this.isOpen) this.render();
4365
2801
  }
2802
+ setBrandRef(ref) {
2803
+ if (this.brandRef === ref) return;
2804
+ this.brandRef = ref;
2805
+ if (this.isOpen) this.render();
2806
+ }
4366
2807
  setRewardsState(state) {
4367
2808
  this.rewardsState = state;
4368
2809
  if (this.isOpen) this.render();
@@ -4397,14 +2838,12 @@ var MushiWidget = class _MushiWidget {
4397
2838
  if (this.isOpen && (this.step === "account" || this.step === "leaderboard")) this.render();
4398
2839
  }
4399
2840
  destroy() {
2841
+ window.removeEventListener("pointerup", this.onPointerRelease, true);
2842
+ window.removeEventListener("pointercancel", this.onPointerRelease, true);
4400
2843
  if (this.successTimer !== null) {
4401
2844
  clearTimeout(this.successTimer);
4402
2845
  this.successTimer = null;
4403
2846
  }
4404
- if (this.autoCloseTimer !== null) {
4405
- clearTimeout(this.autoCloseTimer);
4406
- this.autoCloseTimer = null;
4407
- }
4408
2847
  if (this.smartHideTimer !== null) {
4409
2848
  clearTimeout(this.smartHideTimer);
4410
2849
  this.smartHideTimer = null;
@@ -4832,6 +3271,14 @@ var MushiWidget = class _MushiWidget {
4832
3271
  this.draftSelEnd = 0;
4833
3272
  }
4834
3273
  render() {
3274
+ if (this.isOpen && this.pointerDownAt !== null && Date.now() - this.pointerDownAt < 2e3) {
3275
+ if (!this.renderDeferred) setTimeout(() => {
3276
+ if (this.renderDeferred) this.render();
3277
+ }, 2e3);
3278
+ this.renderDeferred = true;
3279
+ return;
3280
+ }
3281
+ this.renderDeferred = false;
4835
3282
  const theme = this.getTheme();
4836
3283
  const pos = this.config.position;
4837
3284
  const t = this.locale;
@@ -4911,7 +3358,14 @@ var MushiWidget = class _MushiWidget {
4911
3358
  const ctx = this.renderCtx();
4912
3359
  panel.innerHTML = `${renderOutdatedBanner(ctx)}${renderStep(ctx)}${renderBrandFooter(ctx)}`;
4913
3360
  this.shadow.appendChild(panel);
3361
+ panel.addEventListener("pointerdown", () => {
3362
+ this.pointerDownAt = Date.now();
3363
+ });
4914
3364
  this.attachHandlers(panel);
3365
+ if (!this.brandImpressionSent && this.config.brandFooter === true) {
3366
+ this.brandImpressionSent = true;
3367
+ this.callbacks.onBrandFooterImpression?.();
3368
+ }
4915
3369
  this.trapFocus(panel);
4916
3370
  this.restoreFormDrafts(panel);
4917
3371
  this.attachViewportHandlers(panel);
@@ -5169,6 +3623,18 @@ var MushiWidget = class _MushiWidget {
5169
3623
  this.vvCleanup?.();
5170
3624
  this.vvCleanup = null;
5171
3625
  }
3626
+ /**
3627
+ * Copy mode for the details step. Feature mode covers both the ✨ shortcut
3628
+ * and Other → "Feature request" intent (whose localized label is the first
3629
+ * entry of step2.intents.other in every locale).
3630
+ */
3631
+ detailMode() {
3632
+ const id = this.selectedCategory;
3633
+ const intent = this.selectedIntent;
3634
+ if (this.viaFeatureRequest || intent === FEATURE_REQUEST_INTENT) return "feature";
3635
+ if (id === "other" && !this.resolveCustomCategory(id) && intent === this.locale.step2.intents.other[0]) return "feature";
3636
+ return id && this.resolveBaseCategory(id) === "other" ? "other" : "bug";
3637
+ }
5172
3638
  /**
5173
3639
  * Minimum description length, lowered for CJK locales where each character
5174
3640
  * carries more meaning. Used by both the view layer (via renderCtx) and the
@@ -5195,7 +3661,11 @@ var MushiWidget = class _MushiWidget {
5195
3661
  config: this.config,
5196
3662
  rewardsState: this.rewardsState,
5197
3663
  lastReportId: this.lastReportId,
5198
- reporterLoading: this.reporterLoading,
3664
+ listLoading: this.listLoading,
3665
+ threadLoading: this.threadLoading,
3666
+ actionPending: this.actionPending,
3667
+ threadError: this.threadError,
3668
+ actionError: this.actionError,
5199
3669
  locale: this.locale,
5200
3670
  identifiedUser: this.identifiedUser,
5201
3671
  testerReputation: this.testerReputation,
@@ -5212,6 +3682,8 @@ var MushiWidget = class _MushiWidget {
5212
3682
  submitting: this.submitting,
5213
3683
  sdkFreshness: this.sdkFreshness,
5214
3684
  screenshotError: this.screenshotError,
3685
+ screenshotErrorReason: this.screenshotErrorReason,
3686
+ detailMode: this.detailMode(),
5215
3687
  reporterReports: this.reporterReports,
5216
3688
  magicLinkSending: this.magicLinkSending,
5217
3689
  magicLinkEmail: this.magicLinkEmail,
@@ -5248,13 +3720,17 @@ var MushiWidget = class _MushiWidget {
5248
3720
  assistantError: this.assistantError,
5249
3721
  showAllCategories: this.showAllCategories,
5250
3722
  showMoreNav: this.showMoreNav,
5251
- pageFaviconHref: readPageFaviconHref()
3723
+ pageFaviconHref: readPageFaviconHref(),
3724
+ brandRef: this.brandRef
5252
3725
  };
5253
3726
  }
5254
3727
  attachHandlers(panel) {
5255
3728
  const t = this.locale;
5256
3729
  bindFaviconFallbacks(panel);
5257
3730
  panel.querySelector('[data-action="close"]')?.addEventListener("click", () => this.close());
3731
+ panel.querySelector('[data-action="brand-footer"]')?.addEventListener("click", () => {
3732
+ this.callbacks.onBrandFooterClick?.();
3733
+ });
5258
3734
  panel.querySelector('[data-action="back"]')?.addEventListener("click", () => {
5259
3735
  if (this.step === "intent") {
5260
3736
  this.step = "category";
@@ -5284,11 +3760,6 @@ var MushiWidget = class _MushiWidget {
5284
3760
  this.step = "category";
5285
3761
  } else if (this.step === "cross-app-reports") {
5286
3762
  this.step = "account";
5287
- } else if (this.step === "success") {
5288
- this.step = "category";
5289
- this.selectedCategory = null;
5290
- this.selectedIntent = null;
5291
- this.viaFeatureRequest = false;
5292
3763
  }
5293
3764
  if (this.step === "category") {
5294
3765
  this.showAllCategories = false;
@@ -5416,6 +3887,9 @@ var MushiWidget = class _MushiWidget {
5416
3887
  this.callbacks.onTesterSignOut?.();
5417
3888
  this.render();
5418
3889
  });
3890
+ panel.querySelector('[data-action="retry-thread"]')?.addEventListener("click", () => {
3891
+ if (this.selectedReportId) void this.loadReporterComments(this.selectedReportId);
3892
+ });
5419
3893
  panel.querySelector('[data-action="reporter-reply"]')?.addEventListener("click", () => {
5420
3894
  void this.submitReporterReply(panel);
5421
3895
  });
@@ -5425,9 +3899,10 @@ var MushiWidget = class _MushiWidget {
5425
3899
  panel.querySelector('[data-action="reporter-not-fixed"]')?.addEventListener("click", () => {
5426
3900
  void this.submitReporterReopen();
5427
3901
  });
5428
- panel.querySelector('[data-action="view-my-reports"]')?.addEventListener("click", () => {
5429
- void this.loadReporterReports();
3902
+ panel.querySelector('[data-action="track-report"]')?.addEventListener("click", () => {
3903
+ if (this.lastReportId) void this.openTrackedReport(this.lastReportId);
5430
3904
  });
3905
+ panel.querySelector('[data-action="done"]')?.addEventListener("click", () => this.close());
5431
3906
  panel.querySelector('[data-action="copy-report-id"]')?.addEventListener("click", (e) => {
5432
3907
  const btn = e.currentTarget;
5433
3908
  const id = btn.dataset.copyId;
@@ -5466,18 +3941,13 @@ var MushiWidget = class _MushiWidget {
5466
3941
  });
5467
3942
  });
5468
3943
  const textarea = panel.querySelector(".mushi-textarea");
5469
- const charCurrentEl = panel.querySelector('[data-role="char-current"]');
5470
- if (textarea && charCurrentEl) {
3944
+ const counterEl = panel.querySelector('[data-role="char-counter"]');
3945
+ if (textarea && counterEl) {
5471
3946
  const minLen = this.effectiveMinLength();
5472
- const updateCounter = () => {
5473
- const len = textarea.value.trim().length;
5474
- charCurrentEl.textContent = String(len);
5475
- const counterEl = panel.querySelector('[data-role="char-counter"]');
5476
- if (counterEl) {
5477
- counterEl.style.color = len >= minLen ? "var(--mushi-ok, #22c55e)" : "";
5478
- }
5479
- };
5480
- textarea.addEventListener("input", updateCounter);
3947
+ textarea.addEventListener("input", () => {
3948
+ counterEl.textContent = charCounterText(textarea.value, minLen, t.step3.charsNeeded);
3949
+ counterEl.style.color = textarea.value.trim().length >= minLen ? "var(--mushi-ok, #22c55e)" : "";
3950
+ });
5481
3951
  }
5482
3952
  panel.querySelectorAll("[data-example]").forEach((chip) => {
5483
3953
  chip.addEventListener("click", () => {
@@ -5492,6 +3962,9 @@ var MushiWidget = class _MushiWidget {
5492
3962
  panel.querySelector('[data-action="screenshot"]')?.addEventListener("click", () => {
5493
3963
  this.callbacks.onScreenshotRequest();
5494
3964
  });
3965
+ panel.querySelector('[data-action="screenshot-share-tab"]')?.addEventListener("click", () => {
3966
+ this.callbacks.onScreenshotShareTabRequest?.();
3967
+ });
5495
3968
  panel.querySelector('[data-action="remove-screenshot"]')?.addEventListener("click", () => {
5496
3969
  this.callbacks.onScreenshotRemove?.();
5497
3970
  });
@@ -5511,7 +3984,7 @@ var MushiWidget = class _MushiWidget {
5511
3984
  const minLen = this.effectiveMinLength();
5512
3985
  if (description.length < minLen) {
5513
3986
  if (errorEl) {
5514
- const msg = `${t.step3.tooShort} (${description.length}/${minLen})`;
3987
+ const msg = `${t.step3.tooShort} (${charCounterText(description, minLen, t.step3.charsNeeded)})`;
5515
3988
  errorEl.textContent = msg;
5516
3989
  errorEl.style.display = "block";
5517
3990
  textarea2?.focus();
@@ -5530,9 +4003,10 @@ var MushiWidget = class _MushiWidget {
5530
4003
  const catId = this.selectedCategory;
5531
4004
  const baseCategory = this.resolveBaseCategory(catId);
5532
4005
  const isCustomCat = this.config.categories && this.config.categories.length > 0;
4006
+ const userCategory = isCustomCat && this.resolveCustomCategory(catId) ? catId : this.detailMode() === "feature" ? "feature" : isCustomCat ? catId : void 0;
5533
4007
  const ret = this.callbacks.onSubmit({
5534
4008
  category: baseCategory,
5535
- ...isCustomCat ? { userCategory: catId } : {},
4009
+ ...userCategory ? { userCategory } : {},
5536
4010
  description,
5537
4011
  intent: this.selectedIntent ?? void 0
5538
4012
  });
@@ -5552,22 +4026,12 @@ var MushiWidget = class _MushiWidget {
5552
4026
  this.render();
5553
4027
  this.draftDescription = "";
5554
4028
  void outcomeP.then((outcome) => {
5555
- if (this.step !== "success") return;
5556
- if (outcome) {
5557
- this.lastReportId = outcome.reportId ?? null;
5558
- this.lastSubmitQueuedOffline = Boolean(outcome.queuedOffline);
5559
- this.lastSubmitFailureKind = outcome.failureKind;
5560
- this.lastSubmitScreenshotDropped = Boolean(outcome.screenshotDropped);
5561
- this.render();
5562
- }
5563
- if (this.autoCloseTimer !== null) {
5564
- clearTimeout(this.autoCloseTimer);
5565
- }
5566
- const closeDelayMs = this.lastReportId && this.config.dashboardUrl ? 6e3 : 2800;
5567
- this.autoCloseTimer = setTimeout(() => {
5568
- this.autoCloseTimer = null;
5569
- if (this.step === "success") this.close();
5570
- }, closeDelayMs);
4029
+ if (this.step !== "success" || !outcome) return;
4030
+ this.lastReportId = outcome.reportId ?? null;
4031
+ this.lastSubmitQueuedOffline = Boolean(outcome.queuedOffline);
4032
+ this.lastSubmitFailureKind = outcome.failureKind;
4033
+ this.lastSubmitScreenshotDropped = Boolean(outcome.screenshotDropped);
4034
+ this.render();
5571
4035
  });
5572
4036
  }, 500);
5573
4037
  };
@@ -5599,7 +4063,7 @@ var MushiWidget = class _MushiWidget {
5599
4063
  }
5600
4064
  async loadFeatureBoard() {
5601
4065
  this.step = "roadmap";
5602
- this.reporterLoading = true;
4066
+ this.listLoading = true;
5603
4067
  this.reporterError = null;
5604
4068
  this.render();
5605
4069
  try {
@@ -5607,13 +4071,13 @@ var MushiWidget = class _MushiWidget {
5607
4071
  } catch (err) {
5608
4072
  this.reporterError = err instanceof Error ? err.message : "Could not load community ideas.";
5609
4073
  } finally {
5610
- this.reporterLoading = false;
4074
+ this.listLoading = false;
5611
4075
  this.render();
5612
4076
  }
5613
4077
  }
5614
4078
  async voteFeatureBoard(requestId) {
5615
- if (!this.callbacks.onFeatureBoardVote || this.reporterLoading) return;
5616
- this.reporterLoading = true;
4079
+ if (!this.callbacks.onFeatureBoardVote || this.actionPending) return;
4080
+ this.actionPending = true;
5617
4081
  this.render();
5618
4082
  try {
5619
4083
  await this.callbacks.onFeatureBoardVote(requestId);
@@ -5621,33 +4085,48 @@ var MushiWidget = class _MushiWidget {
5621
4085
  } catch (err) {
5622
4086
  this.reporterError = err instanceof Error ? err.message : "Could not update vote.";
5623
4087
  } finally {
5624
- this.reporterLoading = false;
4088
+ this.actionPending = false;
5625
4089
  this.render();
5626
4090
  }
5627
4091
  }
5628
- async submitReporterReopen() {
4092
+ /**
4093
+ * Run a thread action (reply / feedback / reopen) without leaving or
4094
+ * blanking the thread: the conversation stays painted, the action button
4095
+ * disables, and afterwards the status + comments refresh in place.
4096
+ */
4097
+ async runThreadAction(fallbackError, action) {
5629
4098
  const reportId = this.selectedReportId;
5630
- if (!reportId || this.reporterLoading) return;
5631
- this.reporterLoading = true;
4099
+ if (!reportId || this.actionPending) return false;
4100
+ this.actionPending = true;
4101
+ this.actionError = null;
5632
4102
  this.render();
5633
4103
  try {
4104
+ await action(reportId);
4105
+ await this.refreshReporterInboxQuiet();
4106
+ await this.loadReporterComments(reportId, true);
4107
+ return true;
4108
+ } catch (err) {
4109
+ this.actionError = err instanceof Error ? err.message : fallbackError;
4110
+ return false;
4111
+ } finally {
4112
+ this.actionPending = false;
4113
+ this.render();
4114
+ }
4115
+ }
4116
+ async submitReporterReopen() {
4117
+ await this.runThreadAction("Could not reopen report.", async (reportId) => {
5634
4118
  if (this.callbacks.onReporterReopen) {
5635
4119
  await this.callbacks.onReporterReopen(reportId, "Not fixed for me");
5636
4120
  } else {
5637
4121
  await this.callbacks.onReporterFeedback?.(reportId, "not_fixed", "Not fixed for me");
5638
4122
  }
5639
- await this.loadReporterReports();
5640
- } catch (err) {
5641
- this.reporterError = err instanceof Error ? err.message : "Could not reopen report.";
5642
- } finally {
5643
- this.reporterLoading = false;
5644
- this.render();
5645
- }
4123
+ });
5646
4124
  }
5647
4125
  /** Refresh My Reports data for unread badges without opening the inbox panel. */
5648
4126
  async refreshReporterInboxQuiet() {
5649
4127
  try {
5650
- this.reporterReports = await this.callbacks.onReporterReportsRequest?.() ?? [];
4128
+ const req = this.callbacks.onReporterReportsRequest?.();
4129
+ this.reporterReports = req ? await withDeadline(req, REPORTER_READ_DEADLINE_MS) : [];
5651
4130
  if (!this.isOpen) return;
5652
4131
  if (this.step === "reports") {
5653
4132
  this.render();
@@ -5667,70 +4146,68 @@ var MushiWidget = class _MushiWidget {
5667
4146
  }
5668
4147
  async loadReporterReports() {
5669
4148
  this.step = "reports";
5670
- this.reporterLoading = true;
4149
+ this.listLoading = true;
5671
4150
  this.reporterError = null;
5672
4151
  this.render();
5673
4152
  try {
5674
- this.reporterReports = await this.callbacks.onReporterReportsRequest?.() ?? [];
4153
+ const req = this.callbacks.onReporterReportsRequest?.();
4154
+ this.reporterReports = req ? await withDeadline(req, REPORTER_READ_DEADLINE_MS) : [];
5675
4155
  } catch (err) {
5676
4156
  this.reporterError = err instanceof Error ? err.message : "Could not load reports.";
5677
4157
  } finally {
5678
- this.reporterLoading = false;
4158
+ this.listLoading = false;
5679
4159
  this.render();
5680
4160
  }
5681
4161
  }
5682
- async loadReporterComments(reportId) {
4162
+ /** "Track this report" on the success step → that report's thread in My Reports. */
4163
+ async openTrackedReport(reportId) {
4164
+ await this.loadReporterReports();
4165
+ if (this.isOpen && this.step === "reports") await this.loadReporterComments(reportId);
4166
+ }
4167
+ /**
4168
+ * Open (or refresh) a thread. The header + summary paint immediately from
4169
+ * the in-memory report; only the comment list shows a skeleton while it
4170
+ * loads. `quiet` keeps the current comments on screen (post-action refresh).
4171
+ */
4172
+ async loadReporterComments(reportId, quiet = false) {
5683
4173
  if (this.selectedReportId !== reportId) {
5684
4174
  this.draftReply = "";
4175
+ this.reporterComments = [];
4176
+ this.actionError = null;
4177
+ quiet = false;
5685
4178
  }
5686
4179
  this.selectedReportId = reportId;
5687
4180
  this.step = "report-detail";
5688
- this.reporterLoading = true;
5689
- this.reporterError = null;
5690
- this.render();
4181
+ this.threadError = null;
4182
+ if (!quiet) {
4183
+ this.threadLoading = true;
4184
+ this.render();
4185
+ }
5691
4186
  try {
5692
- this.reporterComments = await this.callbacks.onReporterCommentsRequest?.(reportId) ?? [];
5693
- } catch (err) {
5694
- this.reporterError = err instanceof Error ? err.message : "Could not load thread.";
4187
+ const req = this.callbacks.onReporterCommentsRequest?.(reportId);
4188
+ const comments = req ? await withDeadline(req, REPORTER_READ_DEADLINE_MS) : [];
4189
+ if (this.selectedReportId === reportId) this.reporterComments = comments;
4190
+ } catch {
4191
+ if (this.selectedReportId === reportId) this.threadError = this.locale.flows.thread.loadFailed;
5695
4192
  } finally {
5696
- this.reporterLoading = false;
4193
+ this.threadLoading = false;
5697
4194
  this.render();
5698
4195
  }
5699
4196
  }
5700
4197
  async submitReporterFeedback(signal) {
5701
- const reportId = this.selectedReportId;
5702
- if (!reportId || this.reporterLoading) return;
5703
- this.reporterLoading = true;
5704
- this.render();
5705
- try {
5706
- await this.callbacks.onReporterFeedback?.(reportId, signal);
5707
- await this.loadReporterReports();
5708
- if (reportId) await this.loadReporterComments(reportId);
5709
- } catch (err) {
5710
- this.reporterError = err instanceof Error ? err.message : "Could not send feedback.";
5711
- this.reporterLoading = false;
5712
- this.render();
5713
- }
4198
+ await this.runThreadAction("Could not send feedback.", (reportId) => Promise.resolve(this.callbacks.onReporterFeedback?.(reportId, signal)));
5714
4199
  }
5715
4200
  async submitReporterReply(panel) {
5716
- const reportId = this.selectedReportId;
5717
4201
  const textarea = panel.querySelector('[data-role="reporter-reply"]');
5718
- const replyButton = panel.querySelector('[data-action="reporter-reply"]');
5719
4202
  const body = textarea?.value.trim() ?? "";
5720
- if (!reportId || !body || this.reporterLoading) return;
5721
- this.reporterLoading = true;
5722
- if (replyButton) replyButton.disabled = true;
5723
- this.render();
5724
- try {
4203
+ if (!body) return;
4204
+ this.draftReply = textarea?.value ?? "";
4205
+ await this.runThreadAction("Could not send reply.", async (reportId) => {
5725
4206
  await this.callbacks.onReporterReply?.(reportId, body);
5726
- if (textarea) textarea.value = "";
5727
4207
  this.draftReply = "";
5728
- await this.loadReporterComments(reportId);
5729
- } catch (err) {
5730
- this.reporterError = err instanceof Error ? err.message : "Could not send reply.";
5731
- this.reporterLoading = false;
5732
- this.render();
5733
- }
4208
+ const live = this.shadow.querySelector('[data-role="reporter-reply"]');
4209
+ if (live) live.value = "";
4210
+ });
5734
4211
  }
5735
4212
  /* ── Community: magic-link sign-in ───────────────────────────────── */
5736
4213
  async handleMagicLinkSend(panel) {
@@ -5840,7 +4317,8 @@ function mergeRuntimeCapture(host, runtime) {
5840
4317
  }
5841
4318
  return merged;
5842
4319
  }
5843
- function mergeRuntimeConfig(config, runtime) {
4320
+ var HOST_WINS_WIDGET_KEYS = ["brandFooter"];
4321
+ function mergeRuntimeConfig(config, runtime, host = config) {
5844
4322
  const nativeTrigger = runtime.native?.triggerMode;
5845
4323
  const runtimeLauncher = runtime.widget?.launcher;
5846
4324
  const hostTrigger = config.widget?.trigger;
@@ -5869,7 +4347,11 @@ function mergeRuntimeConfig(config, runtime) {
5869
4347
  if (runtime.widget) {
5870
4348
  for (const [key, value] of Object.entries(runtime.widget)) {
5871
4349
  if (key === "trigger" || key === "launcher") continue;
5872
- if (value !== void 0 && value !== null) definedRuntimeWidget[key] = value;
4350
+ if (value === void 0 || value === null) continue;
4351
+ if (HOST_WINS_WIDGET_KEYS.includes(key) && host.widget?.[key] !== void 0) {
4352
+ continue;
4353
+ }
4354
+ definedRuntimeWidget[key] = value;
5873
4355
  }
5874
4356
  }
5875
4357
  return {
@@ -6724,7 +5206,11 @@ function createScreenshotCapture(options = {}) {
6724
5206
  if (typeof document === "undefined") return null;
6725
5207
  const canvas = document.createElement("canvas");
6726
5208
  const ctx = canvas.getContext("2d");
6727
- if (!ctx) return null;
5209
+ if (!ctx) {
5210
+ activeOptions.onFailed?.("unsupported");
5211
+ emitScreenshotFailed("unsupported");
5212
+ return null;
5213
+ }
6728
5214
  const width = window.innerWidth;
6729
5215
  const height = window.innerHeight;
6730
5216
  const dpr = Math.min(window.devicePixelRatio || 1, 2);
@@ -6742,27 +5228,32 @@ function createScreenshotCapture(options = {}) {
6742
5228
  </svg>
6743
5229
  `;
6744
5230
  const img = new Image();
6745
- const blob = new Blob([svgData], { type: "image/svg+xml;charset=utf-8" });
6746
- const url = URL.createObjectURL(blob);
5231
+ const url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgData)}`;
5232
+ let cspBlocked = false;
5233
+ const onViolation = (e) => {
5234
+ const v = e;
5235
+ if (/^img-src|^default-src/.test(v.violatedDirective ?? "") && /^data/.test(v.blockedURI ?? "")) cspBlocked = true;
5236
+ };
5237
+ document.addEventListener("securitypolicyviolation", onViolation);
6747
5238
  return new Promise((resolve) => {
6748
5239
  let settled = false;
6749
5240
  const settle = (value, reason) => {
6750
5241
  if (settled) return;
6751
5242
  settled = true;
6752
5243
  clearTimeout(timer);
6753
- URL.revokeObjectURL(url);
5244
+ document.removeEventListener("securitypolicyviolation", onViolation);
6754
5245
  if (reason) {
6755
5246
  activeOptions.onFailed?.(reason);
6756
5247
  emitScreenshotFailed(reason);
6757
5248
  }
6758
5249
  resolve(value);
6759
5250
  };
6760
- const timer = setTimeout(() => settle(null, "error"), 5e3);
5251
+ const timer = setTimeout(() => settle(null, "timeout"), 5e3);
6761
5252
  img.onload = () => {
6762
5253
  try {
6763
5254
  ctx.drawImage(img, 0, 0, width, height);
6764
5255
  if (isCanvasBlank(ctx, width, height)) {
6765
- settle(null, "error");
5256
+ settle(null, "unsupported");
6766
5257
  return;
6767
5258
  }
6768
5259
  settle(canvas.toDataURL("image/jpeg", 0.7));
@@ -6770,7 +5261,7 @@ function createScreenshotCapture(options = {}) {
6770
5261
  settle(null, "taint");
6771
5262
  }
6772
5263
  };
6773
- img.onerror = () => settle(null, "error");
5264
+ img.onerror = () => setTimeout(() => settle(null, cspBlocked ? "csp" : "error"), 0);
6774
5265
  img.src = url;
6775
5266
  });
6776
5267
  } catch {
@@ -6792,16 +5283,17 @@ function emitScreenshotFailed(reason) {
6792
5283
  } catch {
6793
5284
  }
6794
5285
  }
6795
- var DEFAULT_REDACT_SELECTORS = [
6796
- 'input[type="password"]',
6797
- "[data-mushi-redact]"
6798
- ];
5286
+ var ALWAYS_REDACT_SELECTORS = 'input[type="password"],input[autocomplete^="cc-"],[data-private],[data-mushi-mask]';
5287
+ var DEFAULT_REDACT_SELECTORS = ["[data-mushi-redact]"];
6799
5288
  function buildPrivacySafeDocument(privacy) {
6800
5289
  const clone = document.documentElement.cloneNode(true);
6801
5290
  clone.querySelector("#mushi-mushi-widget")?.remove();
6802
5291
  stripTaintSources(clone);
6803
5292
  inlineDocumentStyles(clone);
6804
- const redactSelectors = privacy?.redactSelectors !== void 0 ? privacy.redactSelectors : DEFAULT_REDACT_SELECTORS;
5293
+ const redactSelectors = [
5294
+ ALWAYS_REDACT_SELECTORS,
5295
+ ...privacy?.redactSelectors ?? DEFAULT_REDACT_SELECTORS
5296
+ ];
6805
5297
  for (const selector of redactSelectors) {
6806
5298
  for (const el of safeQueryAll(clone, selector)) {
6807
5299
  redactElement(el);
@@ -7537,8 +6029,6 @@ function createDiscoveryCapture(opts) {
7537
6029
  }
7538
6030
  };
7539
6031
  }
7540
-
7541
- // src/capture/replay.ts
7542
6032
  var DEFAULT_MAX_MS = 3e4;
7543
6033
  var MAX_EVENTS = 400;
7544
6034
  var RRWEB_META = 4;
@@ -7596,15 +6086,33 @@ function createLiteReplay(maxMs) {
7596
6086
  }
7597
6087
  };
7598
6088
  }
6089
+ var DEFAULT_REDACT_SELECTORS2 = ['input[type="password"]', "[data-mushi-redact]"];
7599
6090
  var rrwebModule = null;
7600
- async function loadRrweb() {
6091
+ var warnedMissingRrweb = false;
6092
+ function asRrweb(mod) {
6093
+ if (!mod || typeof mod !== "object") return null;
6094
+ const direct = mod;
6095
+ if (typeof direct.record === "function") return direct;
6096
+ if (direct.default && typeof direct.default.record === "function") return direct.default;
6097
+ return null;
6098
+ }
6099
+ async function loadRrweb(loader) {
6100
+ if (rrwebModule) return rrwebModule;
6101
+ if (typeof loader === "function") {
6102
+ try {
6103
+ rrwebModule = asRrweb(await loader());
6104
+ if (rrwebModule) return rrwebModule;
6105
+ } catch {
6106
+ }
6107
+ }
6108
+ rrwebModule = asRrweb(globalThis.rrweb);
7601
6109
  if (rrwebModule) return rrwebModule;
7602
6110
  try {
7603
6111
  const specifier = "rrweb";
7604
- rrwebModule = await import(
6112
+ rrwebModule = asRrweb(await import(
7605
6113
  /* @vite-ignore */
7606
6114
  specifier
7607
- );
6115
+ ));
7608
6116
  return rrwebModule;
7609
6117
  } catch {
7610
6118
  return null;
@@ -7612,15 +6120,22 @@ async function loadRrweb() {
7612
6120
  }
7613
6121
  async function createReplayCapture(opts) {
7614
6122
  const maxMs = opts.maxDurationMs ?? DEFAULT_MAX_MS;
7615
- const rrweb = await loadRrweb();
6123
+ if (opts.mode === "lite") return createLiteReplay(maxMs);
6124
+ const rrweb = await loadRrweb(opts.loadRrweb);
7616
6125
  if (!rrweb?.record) {
6126
+ if (!warnedMissingRrweb) {
6127
+ warnedMissingRrweb = true;
6128
+ createLogger({ scope: "mushi" }).warn(
6129
+ "capture.replay is 'rrweb' but rrweb could not be loaded, so replay is recording clicks only. Install rrweb and pass capture: { rrweb: () => import('rrweb') }."
6130
+ );
6131
+ }
7617
6132
  return createLiteReplay(maxMs);
7618
6133
  }
7619
6134
  const record = rrweb.record;
7620
6135
  const events = [];
7621
6136
  let stopFn = null;
7622
6137
  let recording = false;
7623
- const maskSelectors = ['input[type="password"]', ...opts.redactSelectors ?? []];
6138
+ const redactSelectors = [.../* @__PURE__ */ new Set([...DEFAULT_REDACT_SELECTORS2, ...opts.redactSelectors ?? []])];
7624
6139
  const stop = () => {
7625
6140
  stopFn?.();
7626
6141
  stopFn = null;
@@ -7636,13 +6151,8 @@ async function createReplayCapture(opts) {
7636
6151
  trimReplayBuffer(events, maxMs, MAX_EVENTS);
7637
6152
  },
7638
6153
  maskAllInputs: true,
7639
- // Mask rendered DOM text too — without this, rrweb records every
7640
- // visible label (emails, names) as plaintext. Hosts that need richer
7641
- // capture can opt out via their own rrweb integration.
7642
- maskAllText: true,
7643
- maskTextSelector: maskSelectors.join(","),
7644
- // Re-emit a full snapshot roughly once per retained window so trimming
7645
- // never leaves incrementals without a base snapshot.
6154
+ maskTextSelector: "*",
6155
+ blockSelector: redactSelectors.join(","),
7646
6156
  checkoutEveryNms: maxMs,
7647
6157
  sampling: { mousemove: false, mouseInteraction: true, scroll: 150, media: 800 }
7648
6158
  }) ?? null;
@@ -7659,135 +6169,6 @@ async function createReplayCapture(opts) {
7659
6169
  };
7660
6170
  }
7661
6171
 
7662
- // src/capture/screenshot-annotation.ts
7663
- function createScreenshotAnnotation(imageDataUrl, container) {
7664
- return new Promise((resolve, reject) => {
7665
- const img = new Image();
7666
- img.onload = () => {
7667
- const wrap = document.createElement("div");
7668
- wrap.style.position = "relative";
7669
- wrap.style.display = "inline-block";
7670
- wrap.style.maxWidth = "100%";
7671
- const base = document.createElement("canvas");
7672
- const overlay = document.createElement("canvas");
7673
- const scale = Math.min(1, 720 / img.width);
7674
- const w = Math.round(img.width * scale);
7675
- const h = Math.round(img.height * scale);
7676
- for (const c of [base, overlay]) {
7677
- c.width = w;
7678
- c.height = h;
7679
- c.style.width = "100%";
7680
- c.style.height = "auto";
7681
- c.style.display = "block";
7682
- }
7683
- overlay.style.position = "absolute";
7684
- overlay.style.left = "0";
7685
- overlay.style.top = "0";
7686
- overlay.style.cursor = "crosshair";
7687
- const bctx = base.getContext("2d");
7688
- const octx = overlay.getContext("2d");
7689
- if (!bctx || !octx) {
7690
- reject(new Error("Canvas not supported"));
7691
- return;
7692
- }
7693
- bctx.drawImage(img, 0, 0, w, h);
7694
- wrap.appendChild(base);
7695
- wrap.appendChild(overlay);
7696
- container.appendChild(wrap);
7697
- let tool = "highlight";
7698
- let drawing = false;
7699
- let start = null;
7700
- const strokes = [];
7701
- const toLocal = (ev) => {
7702
- const rect = overlay.getBoundingClientRect();
7703
- const touch = "touches" in ev ? ev.touches[0] ?? ev.changedTouches[0] : null;
7704
- const clientX = touch ? touch.clientX : ev.clientX;
7705
- const clientY = touch ? touch.clientY : ev.clientY;
7706
- return {
7707
- x: (clientX - rect.left) / rect.width * w,
7708
- y: (clientY - rect.top) / rect.height * h
7709
- };
7710
- };
7711
- const redraw = () => {
7712
- octx.clearRect(0, 0, w, h);
7713
- for (const s of strokes) {
7714
- if (s.tool === "highlight" && s.points.length >= 2) {
7715
- const [a, b] = s.points;
7716
- octx.fillStyle = "rgba(255, 230, 0, 0.35)";
7717
- octx.fillRect(
7718
- Math.min(a.x, b.x),
7719
- Math.min(a.y, b.y),
7720
- Math.abs(b.x - a.x),
7721
- Math.abs(b.y - a.y)
7722
- );
7723
- } else if (s.tool === "arrow" && s.points.length >= 2) {
7724
- const [a, b] = s.points;
7725
- octx.strokeStyle = "#ef4444";
7726
- octx.lineWidth = 3;
7727
- octx.beginPath();
7728
- octx.moveTo(a.x, a.y);
7729
- octx.lineTo(b.x, b.y);
7730
- octx.stroke();
7731
- }
7732
- }
7733
- };
7734
- const onDown = (ev) => {
7735
- drawing = true;
7736
- start = toLocal(ev);
7737
- };
7738
- const onUp = (ev) => {
7739
- if (!drawing || !start) return;
7740
- drawing = false;
7741
- const end = toLocal(ev);
7742
- if (tool === "blur") {
7743
- const x = Math.min(start.x, end.x);
7744
- const y = Math.min(start.y, end.y);
7745
- const bw = Math.abs(end.x - start.x);
7746
- const bh = Math.abs(end.y - start.y);
7747
- if (bw >= 1 && bh >= 1) {
7748
- bctx.filter = "blur(8px)";
7749
- bctx.drawImage(base, x, y, bw, bh, x, y, bw, bh);
7750
- bctx.filter = "none";
7751
- }
7752
- } else {
7753
- strokes.push({ tool, points: [start, end] });
7754
- }
7755
- start = null;
7756
- redraw();
7757
- };
7758
- overlay.addEventListener("mousedown", onDown);
7759
- overlay.addEventListener("mouseup", onUp);
7760
- overlay.addEventListener("touchstart", onDown, { passive: true });
7761
- overlay.addEventListener("touchend", onUp);
7762
- resolve({
7763
- canvas: base,
7764
- setTool(t) {
7765
- tool = t;
7766
- },
7767
- getDataUrl() {
7768
- const out = document.createElement("canvas");
7769
- out.width = w;
7770
- out.height = h;
7771
- const ctx = out.getContext("2d");
7772
- if (!ctx) return imageDataUrl;
7773
- ctx.drawImage(base, 0, 0);
7774
- ctx.drawImage(overlay, 0, 0);
7775
- return out.toDataURL("image/jpeg", 0.85);
7776
- },
7777
- destroy() {
7778
- overlay.removeEventListener("mousedown", onDown);
7779
- overlay.removeEventListener("mouseup", onUp);
7780
- overlay.removeEventListener("touchstart", onDown);
7781
- overlay.removeEventListener("touchend", onUp);
7782
- wrap.remove();
7783
- }
7784
- });
7785
- };
7786
- img.onerror = () => reject(new Error("Failed to load screenshot"));
7787
- img.src = imageDataUrl;
7788
- });
7789
- }
7790
-
7791
6172
  // src/sentry.ts
7792
6173
  function getSentryGlobal() {
7793
6174
  try {
@@ -8333,17 +6714,42 @@ function createInstance(config) {
8333
6714
  sdkPackage: MUSHI_SDK_PACKAGE,
8334
6715
  sdkVersion: MUSHI_SDK_VERSION
8335
6716
  });
8336
- if (bootstrapConfig["trackSessions"] !== false) {
6717
+ let unsubPageViewHistory = null;
6718
+ if (bootstrapConfig.trackSessions !== false) {
8337
6719
  initSessionTracker({
8338
6720
  client: apiClient2,
8339
6721
  sdkVersion: MUSHI_SDK_VERSION,
8340
- reporterTokenHash: getReporterToken(bootstrapConfig.projectId) ?? null
6722
+ reporterToken: getReporterToken(bootstrapConfig.projectId) ?? null,
6723
+ projectId: bootstrapConfig.projectId,
6724
+ analytics: bootstrapConfig.analytics,
6725
+ // This package owns the history patch (history-patch.ts):
6726
+ // installAutoBreadcrumbs() captures History.prototype.pushState (the
6727
+ // native) and assigns its own wrapper to history.pushState, which
6728
+ // silently discarded core's page-view wrapper — so no SPA page view
6729
+ // was ever recorded from this SDK. Report views through the shared
6730
+ // patch instead of stacking a second wrapper.
6731
+ patchHistory: false
8341
6732
  });
6733
+ try {
6734
+ unsubPageViewHistory = subscribeHistory({
6735
+ onPush: () => trackPageView(),
6736
+ onPop: () => trackPageView()
6737
+ });
6738
+ } catch {
6739
+ }
8342
6740
  }
8343
6741
  const preFilter = createPreFilter(bootstrapConfig.preFilter);
8344
6742
  const offlineQueue = createOfflineQueue(bootstrapConfig.offline);
8345
6743
  const rateLimiter = createRateLimiter({ maxBurst: 10, refillRate: 1, refillIntervalMs: 5e3 });
8346
6744
  const piiScrubber = createPiiScrubber();
6745
+ initEventTracker({
6746
+ client: apiClient2,
6747
+ projectId: bootstrapConfig.projectId,
6748
+ sdkVersion: MUSHI_SDK_VERSION,
6749
+ config: bootstrapConfig.analytics,
6750
+ scrub: (s) => piiScrubber.scrub(s),
6751
+ getSessionId
6752
+ });
8347
6753
  function scrubBreadcrumbsForWire(crumbs) {
8348
6754
  return crumbs.map((c) => {
8349
6755
  const next = { ...c };
@@ -8456,7 +6862,7 @@ function createInstance(config) {
8456
6862
  privacy: activeConfig.privacy,
8457
6863
  // Surface capture failures (canvas taint, CSP) in the widget UI —
8458
6864
  // an invisible failure looks identical to a broken button.
8459
- onFailed: () => widget.setScreenshotError(true)
6865
+ onFailed: (reason) => widget.setScreenshotError(true, reason)
8460
6866
  };
8461
6867
  if (activeConfig.capture?.screenshotProvider) {
8462
6868
  screenshotCap = null;
@@ -8523,6 +6929,8 @@ function createInstance(config) {
8523
6929
  if ((replayMode === "rrweb" || replayMode === "lite") && (replaySampled || replayOnErrorSampled)) {
8524
6930
  const generation = ++replayGeneration;
8525
6931
  void createReplayCapture({
6932
+ mode: replayMode,
6933
+ loadRrweb: bootstrapConfig.capture?.rrweb,
8526
6934
  redactSelectors: activeConfig.privacy?.redactSelectors
8527
6935
  }).then((cap) => {
8528
6936
  if (generation !== replayGeneration) {
@@ -8564,6 +6972,7 @@ function createInstance(config) {
8564
6972
  let detachAutoBreadcrumbs = null;
8565
6973
  detachAutoBreadcrumbs = installAutoBreadcrumbs(breadcrumbs);
8566
6974
  let screenshotCaptureInFlight = false;
6975
+ let screenshotProviderDenied = false;
8567
6976
  function syncReporterInboxQuiet() {
8568
6977
  void widget.refreshReporterInboxQuiet();
8569
6978
  }
@@ -8619,6 +7028,7 @@ function createInstance(config) {
8619
7028
  }
8620
7029
  async function takeScreenshotWithoutChrome() {
8621
7030
  if (screenshotCaptureInFlight) return null;
7031
+ screenshotProviderDenied = false;
8622
7032
  const provider = activeConfig.capture?.screenshotProvider;
8623
7033
  if (provider) {
8624
7034
  screenshotCaptureInFlight = true;
@@ -8629,6 +7039,7 @@ function createInstance(config) {
8629
7039
  log.warn("screenshotProvider threw, falling back to built-in capturer", {
8630
7040
  error: err instanceof Error ? err.message : String(err)
8631
7041
  });
7042
+ screenshotProviderDenied = err instanceof Error && (err.name === "NotAllowedError" || err.name === "SecurityError" || /permission|denied/i.test(err.message));
8632
7043
  } finally {
8633
7044
  screenshotCaptureInFlight = false;
8634
7045
  }
@@ -8662,6 +7073,7 @@ function createInstance(config) {
8662
7073
  widget.setScreenshotAttached(pendingScreenshot !== null);
8663
7074
  widget.setScreenshotPreview(pendingScreenshot);
8664
7075
  }
7076
+ const brandRefReady = sha256Hex(projectId).then((hex) => hex.slice(0, 12)).catch(() => null);
8665
7077
  widget = new MushiWidget(bootstrapConfig.widget, {
8666
7078
  onSubmit: async ({ category, userCategory, description, intent }) => {
8667
7079
  log.info("Report submitted", { category, userCategory, intent });
@@ -8676,6 +7088,18 @@ function createInstance(config) {
8676
7088
  replayCap?.start();
8677
7089
  emit("widget:opened");
8678
7090
  },
7091
+ // Growth loop (plan-gtm C §5); the tracker already honours DNT/consent/enabled.
7092
+ onBrandFooterImpression: () => {
7093
+ void brandRefReady.then((ref) => {
7094
+ trackEvent("loop_impression", { placement: "widget" }, ref ? { reserved: { $ref: ref } } : void 0);
7095
+ });
7096
+ },
7097
+ onBrandFooterClick: () => {
7098
+ void brandRefReady.then((ref) => {
7099
+ trackEvent("loop_click", { placement: "widget" }, ref ? { reserved: { $ref: ref } } : void 0);
7100
+ return flushEvents();
7101
+ });
7102
+ },
8679
7103
  onClose: () => {
8680
7104
  log.debug("Widget closed");
8681
7105
  if (pendingProactiveTrigger) {
@@ -8691,9 +7115,10 @@ function createInstance(config) {
8691
7115
  const hasCapture = !!screenshotCap || !!activeConfig.capture?.screenshotProvider;
8692
7116
  if (!hasCapture || activeConfig.capture?.screenshot === "off") {
8693
7117
  log.warn("Screenshot requested but capture is disabled");
8694
- widget.setScreenshotError(true);
7118
+ widget.setScreenshotError(true, "unsupported");
8695
7119
  return;
8696
7120
  }
7121
+ if (screenshotCaptureInFlight) return;
8697
7122
  log.debug("Taking screenshot");
8698
7123
  widget.setScreenshotCapturing(true);
8699
7124
  try {
@@ -8706,8 +7131,45 @@ function createInstance(config) {
8706
7131
  }
8707
7132
  widget.setScreenshotAttached(pendingScreenshot !== null);
8708
7133
  widget.setScreenshotPreview(pendingScreenshot);
8709
- if (pendingScreenshot === null) widget.setScreenshotError(true);
8710
- },
7134
+ if (pendingScreenshot === null) widget.setScreenshotError(true, screenshotProviderDenied ? "permission" : void 0);
7135
+ },
7136
+ onScreenshotShareTabRequest: typeof navigator !== "undefined" && typeof navigator.mediaDevices?.getDisplayMedia === "function" ? () => {
7137
+ const stream = navigator.mediaDevices.getDisplayMedia({
7138
+ video: { displaySurface: "browser" },
7139
+ audio: false,
7140
+ preferCurrentTab: true,
7141
+ selfBrowserSurface: "include"
7142
+ });
7143
+ stream.catch(() => {
7144
+ });
7145
+ widget.setScreenshotCapturing(true);
7146
+ const host = document.getElementById("mushi-mushi-widget");
7147
+ if (host) host.style.visibility = "hidden";
7148
+ const p = activeConfig.privacy;
7149
+ import('./chunks/display-capture-5ZJSTBUK.js').then(
7150
+ (m) => m.grabMaskedTabFrame(stream, [
7151
+ ALWAYS_REDACT_SELECTORS,
7152
+ "[data-mushi-redact]",
7153
+ ...p?.redactSelectors ?? [],
7154
+ ...p?.maskSelectors ?? [],
7155
+ ...p?.blockSelectors ?? []
7156
+ ]),
7157
+ (err) => {
7158
+ void stream.then((s) => s.getTracks().forEach((t) => t.stop()), () => {
7159
+ });
7160
+ throw err;
7161
+ }
7162
+ ).then((dataUrl) => {
7163
+ pendingScreenshot = dataUrl;
7164
+ widget.setScreenshotAttached(true);
7165
+ widget.setScreenshotPreview(dataUrl);
7166
+ }).catch((err) => {
7167
+ log.warn("Tab capture failed", { error: err instanceof Error ? err.name : String(err) });
7168
+ widget.setScreenshotError(true, err instanceof Error && err.name === "NotAllowedError" ? "permission" : "error");
7169
+ }).finally(() => {
7170
+ if (host) host.style.visibility = "";
7171
+ });
7172
+ } : void 0,
8711
7173
  onScreenshotRemove: () => {
8712
7174
  log.debug("Screenshot attachment removed");
8713
7175
  pendingScreenshot = null;
@@ -8718,6 +7180,7 @@ function createInstance(config) {
8718
7180
  if (container.childElementCount > 0) return;
8719
7181
  let session;
8720
7182
  try {
7183
+ const { createScreenshotAnnotation } = await import('./chunks/screenshot-annotation-IG7C5B6Z.js');
8721
7184
  session = await createScreenshotAnnotation(pendingScreenshot, container);
8722
7185
  } catch (err) {
8723
7186
  log.warn("Screenshot annotation failed", {
@@ -8894,6 +7357,7 @@ function createInstance(config) {
8894
7357
  return res.ok ? res.data ?? null : null;
8895
7358
  }
8896
7359
  }, MUSHI_SDK_VERSION);
7360
+ void brandRefReady.then((ref) => widget.setBrandRef(ref));
8897
7361
  syncCaptureModules();
8898
7362
  if (typeof document !== "undefined") {
8899
7363
  if (document.readyState === "loading") {
@@ -8972,7 +7436,7 @@ function createInstance(config) {
8972
7436
  log.debug("Runtime SDK config disabled; using bootstrap config", { version: runtime.version });
8973
7437
  return;
8974
7438
  }
8975
- activeConfig = mergeRuntimeConfig(activeConfig, runtime);
7439
+ activeConfig = mergeRuntimeConfig(activeConfig, runtime, bootstrapConfig);
8976
7440
  syncCaptureModules();
8977
7441
  if (runtime.widget) widget.updateConfig(activeConfig.widget);
8978
7442
  if (reporterNotificationsEnabled) startReporterInboxPolling();
@@ -9019,7 +7483,11 @@ function createInstance(config) {
9019
7483
  deprecated: info.deprecated,
9020
7484
  message
9021
7485
  });
9022
- if (activeConfig.widget?.outdatedBanner !== "console-only") {
7486
+ if (shouldShowSdkFreshness(
7487
+ activeConfig.widget?.outdatedBanner,
7488
+ Boolean(activeConfig.debug),
7489
+ typeof location === "undefined" ? void 0 : location
7490
+ )) {
9023
7491
  widget.setSdkFreshness({
9024
7492
  latest,
9025
7493
  current: MUSHI_SDK_VERSION,
@@ -9340,6 +7808,7 @@ function createInstance(config) {
9340
7808
  destroy() {
9341
7809
  proactiveTriggers?.destroy();
9342
7810
  proactiveManager?.reset();
7811
+ destroyEventTracker();
9343
7812
  widget.destroy();
9344
7813
  consoleCap?.destroy();
9345
7814
  networkCap?.destroy();
@@ -9356,6 +7825,8 @@ function createInstance(config) {
9356
7825
  replayCap = null;
9357
7826
  offlineQueue.stopAutoSync();
9358
7827
  stopReporterInboxPolling();
7828
+ unsubPageViewHistory?.();
7829
+ unsubPageViewHistory = null;
9359
7830
  destroySessionTracker();
9360
7831
  breadcrumbs.clear();
9361
7832
  listeners.clear();
@@ -9502,6 +7973,7 @@ function createInstance(config) {
9502
7973
  level: "info",
9503
7974
  message: `Mushi.identify(${userId})`
9504
7975
  });
7976
+ updateEventIdentity(userId, traits ?? null);
9505
7977
  wireRewardsForIdentifiedUser(
9506
7978
  userId,
9507
7979
  traits ? {
@@ -9594,6 +8066,16 @@ function createInstance(config) {
9594
8066
  if (!activeConfig.rewards?.enabled) return;
9595
8067
  enqueue({ action, metadata });
9596
8068
  },
8069
+ // ─── Product analytics (Users & Funnels) ──────────────────────────
8070
+ track(event, properties) {
8071
+ return trackEvent(event, properties);
8072
+ },
8073
+ setConsent(state) {
8074
+ setEventConsent(state);
8075
+ },
8076
+ getAnonymousId() {
8077
+ return getEventAnonymousId();
8078
+ },
9597
8079
  pulseTrigger() {
9598
8080
  widget.pulseTrigger?.();
9599
8081
  },
@@ -9904,6 +8386,10 @@ function createNoopInstance() {
9904
8386
  getTier: async () => null,
9905
8387
  recordActivity: () => {
9906
8388
  },
8389
+ track: () => false,
8390
+ setConsent: () => {
8391
+ },
8392
+ getAnonymousId: () => null,
9907
8393
  pulseTrigger: () => {
9908
8394
  },
9909
8395
  listMyReports: async () => [],