@mushi-mushi/web 1.29.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
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -873,2085 +1224,83 @@ function getWidgetPreviewTokens(theme) {
873
1224
  vermillion: v.widgetAccent,
874
1225
  vermillionShadow: v.widgetAccentShadow,
875
1226
  accentWash: v.widgetAccentWash,
876
- onAccent: v.onAccent,
877
- neonBannerBg: v.neonBannerBg,
878
- neonBannerFg: v.neonBannerFg,
879
- neonBannerBorder: v.neonBannerBorder,
880
- brandBannerBorder: v.brandBannerBorder
881
- };
882
- }
883
- function getWidgetStyles(theme, accent = "", accentText = "") {
884
- const v = getWidgetThemeVars(theme, accent, accentText);
885
- const {
886
- isDark,
887
- paper,
888
- paperRaised,
889
- ink,
890
- inkMuted,
891
- inkFaint,
892
- inkDim,
893
- rule,
894
- ruleStrong,
895
- widgetAccent,
896
- widgetAccentWash,
897
- widgetAccentInk,
898
- widgetAccentShadow,
899
- accentRgb,
900
- shadowInk,
901
- ok,
902
- danger,
903
- onAccent,
904
- inverse,
905
- neonBannerBg,
906
- 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
- .mushi-brand-link {
1867
- color: inherit;
1868
- text-decoration: none;
1869
- text-underline-offset: 3px;
1870
- }
1871
- .mushi-brand-link:hover { color: ${inkMuted}; text-decoration: underline; }
1872
- .mushi-brand-link:focus-visible {
1873
- outline: 2px solid ${widgetAccent};
1874
- outline-offset: 2px;
1875
- border-radius: 2px;
1876
- color: ${widgetAccent};
1877
- text-decoration: underline;
1878
- }
1879
-
1880
- .mushi-step-indicator {
1881
- display: flex;
1882
- align-items: center;
1883
- justify-content: center;
1884
- gap: 8px;
1885
- padding: 10px 22px 14px;
1886
- color: ${inkFaint};
1887
- font-family: ${fontMono};
1888
- font-size: 11px;
1889
- letter-spacing: 0.10em;
1890
- }
1891
- .mushi-step-num {
1892
- display: inline-flex;
1893
- align-items: baseline;
1894
- gap: 4px;
1895
- transition: opacity ${durFast}ms ${easeStamp};
1896
- }
1897
- .mushi-step-num.done { color: ${inkMuted}; text-decoration: line-through; text-decoration-color: ${inkFaint}; }
1898
- .mushi-step-num.active {
1899
- color: ${widgetAccent};
1900
- font-family: ${fontDisplay};
1901
- font-size: 14px;
1902
- font-weight: 600;
1903
- letter-spacing: 0;
1904
- }
1905
- .mushi-step-sep { width: 14px; height: 1px; background: ${rule}; }
1906
-
1907
- .mushi-success {
1908
- text-align: center;
1909
- padding: 28px 16px 20px;
1910
- }
1911
- .mushi-success-stamp {
1912
- position: relative;
1913
- width: 96px;
1914
- height: 96px;
1915
- margin: 0 auto 16px;
1916
- display: inline-flex;
1917
- align-items: center;
1918
- justify-content: center;
1919
- }
1920
- .mushi-success-stamp svg {
1921
- position: absolute;
1922
- inset: 0;
1923
- width: 100%;
1924
- height: 100%;
1925
- }
1926
- .mushi-success-stamp circle {
1927
- fill: none;
1928
- stroke: ${widgetAccent};
1929
- stroke-width: 3;
1930
- stroke-dasharray: 280;
1931
- stroke-dashoffset: 280;
1932
- transform: rotate(-90deg);
1933
- transform-origin: center;
1934
- animation: mushi-stamp-ring 700ms ${easeStamp} 80ms forwards;
1935
- filter: drop-shadow(0 0 6px rgba(${accentRgb},0.5));
1936
- }
1937
- .mushi-success-stamp-label {
1938
- font-family: ${fontDisplay};
1939
- font-size: 18px;
1940
- font-weight: 600;
1941
- color: ${widgetAccent};
1942
- letter-spacing: 0.04em;
1943
- transform: rotate(-6deg);
1944
- opacity: 0;
1945
- animation: mushi-stamp-press 360ms ${easeStamp} 600ms forwards;
1946
- }
1947
- .mushi-success-headline {
1948
- font-family: ${fontDisplay};
1949
- font-size: 18px;
1950
- font-weight: 500;
1951
- color: ${ink};
1952
- margin-bottom: 4px;
1953
- }
1954
- .mushi-success-meta {
1955
- font-family: ${fontMono};
1956
- font-size: 11px;
1957
- letter-spacing: 0.10em;
1958
- text-transform: uppercase;
1959
- color: ${inkMuted};
1960
- }
1961
-
1962
- /* \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 */
1963
- /* The receipt block sits below the stamp/meta. Three states: */
1964
- /* 1. delivering... (spinner pill, while host onSubmit awaits) */
1965
- /* 2. confirmed (Receipt id + Track on Mushi link) */
1966
- /* 3. queued offline (warn pill \u2014 degrade gracefully) */
1967
- .mushi-success-receipt {
1968
- margin-top: 14px;
1969
- width: 100%;
1970
- max-width: 280px;
1971
- display: flex;
1972
- flex-direction: column;
1973
- gap: 6px;
1974
- align-items: stretch;
1975
- }
1976
- .mushi-success-receipt-row {
1977
- display: flex;
1978
- align-items: center;
1979
- justify-content: center;
1980
- gap: 8px;
1981
- font-family: ${fontMono};
1982
- font-size: 11px;
1983
- letter-spacing: 0.05em;
1984
- color: ${inkMuted};
1985
- }
1986
- .mushi-success-receipt-label {
1987
- text-transform: uppercase;
1988
- letter-spacing: 0.10em;
1989
- color: ${inkMuted};
1990
- }
1991
- .mushi-success-receipt-id {
1992
- display: inline-flex;
1993
- align-items: center;
1994
- gap: 5px;
1995
- padding: 3px 8px;
1996
- border-radius: 4px;
1997
- background: transparent;
1998
- border: 1px dashed ${rule};
1999
- color: inherit;
2000
- font-family: ${fontMono};
2001
- font-size: 12px;
2002
- letter-spacing: 0.02em;
2003
- cursor: pointer;
2004
- transition: opacity ${durInstant}ms ${easeStamp};
2005
- }
2006
- .mushi-success-receipt-id:hover,
2007
- .mushi-success-receipt-id:focus-visible {
2008
- background: rgba(${accentRgb},0.06);
2009
- border-color: ${widgetAccent};
2010
- color: ${widgetAccent};
2011
- outline: none;
2012
- }
2013
- .mushi-success-receipt-copy {
2014
- font-size: 11px;
2015
- opacity: 0.7;
2016
- }
2017
- .mushi-success-receipt-track {
2018
- display: inline-flex;
2019
- align-items: center;
2020
- justify-content: center;
2021
- gap: 4px;
2022
- padding: 6px 10px;
2023
- border-radius: 4px;
2024
- background: ${widgetAccent};
2025
- color: ${inverse};
2026
- font-family: ${fontMono};
2027
- font-size: 11px;
2028
- letter-spacing: 0.10em;
2029
- text-transform: uppercase;
2030
- text-decoration: none;
2031
- transition: filter ${durInstant}ms ease;
2032
- }
2033
- .mushi-success-receipt-track:hover,
2034
- .mushi-success-receipt-track:focus-visible {
2035
- filter: brightness(0.95);
2036
- outline: none;
2037
- }
2038
- .mushi-success-receipt-spinner {
2039
- width: 11px;
2040
- height: 11px;
2041
- border-radius: 50%;
2042
- border: 1.5px solid ${rule};
2043
- border-top-color: ${widgetAccent};
2044
- animation: mushi-receipt-spin 0.8s linear infinite;
2045
- }
2046
- @keyframes mushi-receipt-spin {
2047
- to { transform: rotate(360deg); }
2048
- }
2049
- .mushi-success-receipt-hint {
2050
- color: ${inkMuted};
2051
- font-style: italic;
2052
- }
2053
- .mushi-success-receipt-warn {
2054
- color: ${widgetAccent};
2055
- }
2056
- .mushi-success-my-reports {
2057
- display: block;
2058
- margin: 12px auto 0;
2059
- font-size: 12px;
2060
- font-family: ${fontMono};
2061
- color: ${widgetAccent};
2062
- text-decoration: underline;
2063
- text-underline-offset: 2px;
2064
- background: none;
2065
- border: none;
2066
- cursor: pointer;
2067
- padding: 4px 2px;
2068
- }
2069
- .mushi-success-my-reports:hover { opacity: 0.75; }
2070
- .mushi-success-sla {
2071
- margin-top: 2px;
2072
- font-family: ${fontDisplay};
2073
- font-size: 12px;
2074
- line-height: 1.45;
2075
- text-align: center;
2076
- color: ${inkMuted};
2077
- max-width: 260px;
2078
- }
2079
- .mushi-success-sla-default {
2080
- opacity: 0.85;
2081
- }
2082
-
2083
- @keyframes mushi-stamp-ring {
2084
- to { stroke-dashoffset: 0; }
2085
- }
2086
- @keyframes mushi-stamp-press {
2087
- 0% { opacity: 0; transform: rotate(-6deg) scale(1.3); }
2088
- 60% { opacity: 1; transform: rotate(-6deg) scale(0.94); }
2089
- 100% { opacity: 1; transform: rotate(-6deg) scale(1); }
2090
- }
2091
-
2092
- .mushi-error {
2093
- margin-top: 10px;
2094
- padding: 8px 0 8px 10px;
2095
- border-left: 2px solid ${widgetAccent};
2096
- color: ${widgetAccent};
2097
- font-size: 12px;
2098
- font-family: ${fontMono};
2099
- letter-spacing: 0.02em;
2100
- }
2101
-
2102
- /* \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 */
2103
- .mushi-rewards-nudge {
2104
- border-top: 1px solid ${rule};
2105
- padding: 10px 0 4px;
2106
- margin-top: 6px;
2107
- }
2108
- .mushi-rewards-row {
2109
- display: flex;
2110
- align-items: center;
2111
- gap: 6px;
2112
- margin-bottom: 8px;
2113
- }
2114
- .mushi-tier-pip {
2115
- width: 7px;
2116
- height: 7px;
2117
- border-radius: 50%;
2118
- flex-shrink: 0;
2119
- }
2120
- .mushi-rewards-tier-name {
2121
- font-family: ${fontMono};
2122
- font-size: 11px;
2123
- letter-spacing: 0.08em;
2124
- text-transform: uppercase;
2125
- color: ${ink};
2126
- }
2127
- .mushi-rewards-pts-count {
2128
- font-family: ${fontMono};
2129
- font-size: 11px;
2130
- color: ${inkMuted};
2131
- margin-right: auto;
2132
- }
2133
- .mushi-rewards-pts-earn {
2134
- font-family: ${fontMono};
2135
- font-size: 10px;
2136
- color: ${widgetAccent};
2137
- letter-spacing: 0.04em;
2138
- white-space: nowrap;
2139
- }
2140
- .mushi-tier-bar-track {
2141
- height: 3px;
2142
- background: ${ruleStrong};
2143
- border-radius: 2px;
2144
- overflow: hidden;
2145
- margin-bottom: 5px;
2146
- }
2147
- .mushi-tier-bar-fill {
2148
- height: 100%;
2149
- width: 100%;
2150
- background: ${widgetAccent};
2151
- border-radius: 2px;
2152
- /* Meter fill \u2014 scaleX keeps compositor-friendly motion (docs/MOTION.md). */
2153
- transform-origin: left center;
2154
- transform: scaleX(var(--mushi-tier-pct, 0));
2155
- transition: transform ${durSlow}ms ${easeStamp};
2156
- }
2157
- .mushi-rewards-next-label {
2158
- font-family: ${fontMono};
2159
- font-size: 10px;
2160
- color: ${inkMuted};
2161
- text-align: right;
2162
- letter-spacing: 0.02em;
2163
- }
2164
-
2165
- /* \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 */
2166
- .mushi-success-rewards {
2167
- margin-top: 14px;
2168
- padding-top: 12px;
2169
- border-top: 1px solid ${rule};
2170
- width: 100%;
2171
- }
2172
- .mushi-success-pts-award {
2173
- font-family: ${fontMono};
2174
- font-size: 22px;
2175
- font-weight: 700;
2176
- color: ${widgetAccent};
2177
- text-align: center;
2178
- letter-spacing: 0.06em;
2179
- margin-bottom: 10px;
2180
- opacity: 0;
2181
- animation: mushi-pts-pop ${durSlow}ms ${easeStamp} 900ms forwards;
2182
- }
2183
- .success-bar { margin: 0 0 5px; }
2184
-
2185
- @keyframes mushi-pts-pop {
2186
- from { opacity: 0; transform: scale(0.75) translateY(6px); }
2187
- to { opacity: 1; transform: scale(1) translateY(0); }
2188
- }
2189
-
2190
- /* \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 */
2191
- /* Brand palette: widgetAccent (vermillion) + washi ink for the strip.
2192
- The previous generic indigo purple is the single most recognisable AI-template
2193
- colour; replaced with the widget's own vermillion wash so the beta panel
2194
- reads as a Mushi-native surface rather than a generic SaaS plug-in. */
2195
-
2196
- .mushi-beta-strip {
2197
- margin: 0 16px 2px;
2198
- padding: 9px 12px;
2199
- background: ${widgetAccentWash};
2200
- border: 1px solid rgba(${accentRgb},${isDark ? "0.22" : "0.16"});
2201
- border-radius: 4px;
2202
- display: flex;
2203
- flex-direction: column;
2204
- gap: 4px;
2205
- }
2206
-
2207
- .mushi-beta-strip-row {
2208
- display: flex;
2209
- align-items: center;
2210
- gap: 8px;
2211
- }
2212
-
2213
- .mushi-beta-tag {
2214
- display: inline-flex;
2215
- align-items: center;
2216
- padding: 1px 6px;
2217
- border-radius: 3px;
2218
- background: ${widgetAccent};
2219
- color: ${onAccent};
2220
- font-family: ${fontMono};
2221
- font-size: 9px;
2222
- font-weight: 700;
2223
- letter-spacing: 0.14em;
2224
- line-height: 1.6;
2225
- white-space: nowrap;
2226
- flex-shrink: 0;
2227
- text-transform: uppercase;
2228
- }
2229
-
2230
- .mushi-beta-msg {
2231
- font-size: 11px;
2232
- color: ${inkMuted};
2233
- line-height: 1.45;
2234
- }
2235
-
2236
- .mushi-beta-contact-hint {
2237
- font-size: 10px;
2238
- color: ${inkFaint};
2239
- font-family: ${fontMono};
2240
- letter-spacing: 0.06em;
2241
- }
2242
-
2243
- .mushi-beta-perks {
2244
- list-style: none;
2245
- margin: 2px 0 0;
2246
- padding: 0;
2247
- display: flex;
2248
- flex-direction: column;
2249
- gap: 2px;
2250
- }
2251
-
2252
- .mushi-beta-perks li {
2253
- font-size: 12px;
2254
- color: ${widgetAccentInk};
2255
- font-weight: 500;
2256
- }
2257
-
2258
- /* \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 */
2259
-
2260
- .mushi-changelog {
2261
- margin-top: 5px;
2262
- }
2263
-
2264
- .mushi-changelog-summary {
2265
- font-size: 11px;
2266
- color: ${inkDim};
2267
- cursor: pointer;
2268
- list-style: none;
2269
- display: flex;
2270
- align-items: center;
2271
- gap: 4px;
2272
- user-select: none;
2273
- }
2274
-
2275
- .mushi-changelog-summary::before {
2276
- content: '\u25B6';
2277
- font-size: 7px;
2278
- opacity: 0.6;
2279
- transition: transform ${durInstant}ms ${easeStamp};
2280
- }
2281
-
2282
- .mushi-changelog[open] .mushi-changelog-summary::before {
2283
- transform: rotate(90deg);
2284
- }
2285
-
2286
- .mushi-changelog-list {
2287
- margin: 5px 0 0 4px;
2288
- padding: 0;
2289
- list-style: none;
2290
- display: flex;
2291
- flex-direction: column;
2292
- gap: 2px;
2293
- }
2294
-
2295
- .mushi-changelog-list li {
2296
- font-size: 11px;
2297
- color: ${inkDim};
2298
- line-height: 1.5;
2299
- }
2300
-
2301
- /* \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 */
2302
-
2303
- .mushi-beta-success-footer {
2304
- margin-top: 14px;
2305
- padding: 10px 14px;
2306
- background: ${widgetAccentWash};
2307
- border: 1px solid rgba(${accentRgb},${isDark ? "0.18" : "0.14"});
2308
- border-radius: 4px;
2309
- display: flex;
2310
- flex-direction: column;
2311
- gap: 3px;
2312
- text-align: left;
2313
- }
2314
-
2315
- .mushi-beta-success-line {
2316
- font-size: 12px;
2317
- color: ${widgetAccentInk};
2318
- line-height: 1.5;
2319
- }
2320
-
2321
- .mushi-beta-success-dim {
2322
- opacity: 0.65;
2323
- font-size: 12px;
2324
- }
2325
-
2326
- /* \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 */
2327
-
2328
- .mushi-banner {
2329
- position: fixed;
2330
- left: 0;
2331
- right: 0;
2332
- /* min-height (not fixed height) + border-box so the safe-area padding
2333
- below extends the bar into the notch/home-indicator zone instead of
2334
- letting content bleed under the status bar (mobile safe-area bleed
2335
- fix \u2014 Workstream C). Horizontal padding also clears the left/right
2336
- insets for landscape notches. */
2337
- box-sizing: border-box;
2338
- min-height: ${bannerHeight}px;
2339
- display: flex;
2340
- align-items: center;
2341
- justify-content: center;
2342
- gap: 10px;
2343
- padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
2344
- font-family: ${fontMono};
2345
- font-size: 12px;
2346
- letter-spacing: 0.04em;
2347
- white-space: nowrap;
2348
- overflow: hidden;
2349
- z-index: var(--mushi-banner-z, ${zBanner});
2350
- animation: mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;
2351
- }
2352
-
2353
- .mushi-banner.top { top: 0; padding-top: env(safe-area-inset-top, 0px); }
2354
- .mushi-banner.bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
2355
-
2356
- /* --- neon variant (electric lime \u2014 dev / beta tool aesthetic) --- */
2357
- .mushi-banner.neon {
2358
- background: ${neonBannerBg};
2359
- color: ${neonBannerFg};
2360
- border-bottom: 1.5px solid ${neonBannerBorder};
2361
- }
2362
- .mushi-banner.neon.bottom {
2363
- border-top: 1.5px solid ${neonBannerBorder};
2364
- border-bottom: none;
2365
- }
2366
- .mushi-banner.neon .mushi-banner-btn {
2367
- background: rgba(0,0,0,0.14);
2368
- color: ${neonBannerFg};
2369
- border: 1px solid rgba(0,0,0,0.22);
2370
- }
2371
- .mushi-banner.neon .mushi-banner-btn:hover {
2372
- background: rgba(0,0,0,0.22);
2373
- }
2374
-
2375
- /* --- brand variant (widgetAccent \u2014 editorial, app-quality) --- */
2376
- .mushi-banner.brand {
2377
- background: ${widgetAccent};
2378
- color: ${inverse};
2379
- border-bottom: 1.5px solid ${brandBannerBorder};
2380
- }
2381
- .mushi-banner.brand.bottom {
2382
- border-top: 1.5px solid ${brandBannerBorder};
2383
- border-bottom: none;
2384
- }
2385
- .mushi-banner.brand .mushi-banner-btn {
2386
- background: rgba(255,255,255,0.18);
2387
- color: ${inverse};
2388
- border: 1px solid rgba(255,255,255,0.32);
2389
- }
2390
- .mushi-banner.brand .mushi-banner-btn:hover {
2391
- background: rgba(255,255,255,0.28);
2392
- }
2393
-
2394
- /* --- subtle variant (frosted-glass, muted \u2014 least disruptive) ---
2395
- Uses the widget's own paper colour at high opacity + backdrop-blur so
2396
- it blends with the host app while remaining legible. The previous 4-6%
2397
- opacity values were effectively invisible \u2014 users could not distinguish
2398
- the banner from the page content below it. */
2399
- .mushi-banner.subtle {
2400
- background: ${isDark ? "rgba(15,14,12,0.88)" : "rgba(248,244,237,0.92)"};
2401
- backdrop-filter: blur(14px);
2402
- -webkit-backdrop-filter: blur(14px);
2403
- color: ${ink};
2404
- border-bottom: 1px solid ${ruleStrong};
2405
- }
2406
- .mushi-banner.subtle.bottom {
2407
- border-top: 1px solid ${ruleStrong};
2408
- border-bottom: none;
2409
- }
2410
- .mushi-banner.subtle .mushi-banner-btn {
2411
- background: ${isDark ? "rgba(242,235,221,0.10)" : "rgba(14,13,11,0.08)"};
2412
- color: ${ink};
2413
- border: 1px solid ${ruleStrong};
2414
- }
2415
- .mushi-banner.subtle .mushi-banner-btn:hover {
2416
- background: ${isDark ? "rgba(242,235,221,0.18)" : "rgba(14,13,11,0.14)"};
2417
- }
2418
-
2419
- .mushi-banner-label {
2420
- flex: 1;
2421
- text-align: center;
2422
- overflow: hidden;
2423
- text-overflow: ellipsis;
2424
- }
2425
-
2426
- /* Rich layout \u2014 pill + message + flat text actions (admin BetaBanner parity) */
2427
- .mushi-banner--rich {
2428
- justify-content: space-between;
2429
- gap: 12px;
2430
- min-height: ${bannerHeight}px;
2431
- height: auto;
2432
- padding: 4px 12px 4px 16px;
2433
- white-space: normal;
2434
- }
2435
- .mushi-banner-body {
2436
- display: flex;
2437
- align-items: center;
2438
- gap: 8px;
2439
- flex: 1;
2440
- min-width: 0;
2441
- overflow: hidden;
2442
- }
2443
- .mushi-banner-pill {
2444
- display: inline-flex;
2445
- flex-shrink: 0;
2446
- align-items: center;
2447
- padding: 1px 6px;
2448
- border-radius: 3px;
2449
- border: 1px solid currentColor;
2450
- font-size: 10px;
2451
- font-weight: 700;
2452
- letter-spacing: 0.18em;
2453
- text-transform: uppercase;
2454
- opacity: 0.92;
2455
- }
2456
- .mushi-banner.neon .mushi-banner-pill {
2457
- border-color: rgba(10,26,10,0.45);
2458
- background: rgba(10,26,10,0.12);
2459
- }
2460
- .mushi-banner.brand .mushi-banner-pill {
2461
- border-color: rgba(255,255,255,0.45);
2462
- background: rgba(255,255,255,0.14);
2463
- }
2464
- .mushi-banner.subtle .mushi-banner-pill {
2465
- border-color: ${ruleStrong};
2466
- background: ${isDark ? "rgba(242,235,221,0.08)" : "rgba(14,13,11,0.06)"};
2467
- }
2468
- .mushi-banner-message {
2469
- min-width: 0;
2470
- overflow: hidden;
2471
- text-overflow: ellipsis;
2472
- white-space: nowrap;
2473
- font-size: 12px;
2474
- font-weight: 500;
2475
- line-height: 1.3;
2476
- opacity: 0.9;
2477
- }
2478
- .mushi-banner-actions {
2479
- display: inline-flex;
2480
- align-items: center;
2481
- gap: 0;
2482
- /* Shrinkable + swipe-scrollable so a long action row can never push
2483
- past the viewport edge (dismiss sits outside this nav). */
2484
- flex-shrink: 1;
2485
- min-width: 0;
2486
- overflow-x: auto;
2487
- scrollbar-width: none;
2488
- font-size: 11px;
2489
- }
2490
- .mushi-banner-actions::-webkit-scrollbar { display: none; }
2491
- @media (max-width: ${panelSheetBreakpoint}px) {
2492
- /* Phones: keep only the primary bug CTA (+ dismiss outside the nav). */
2493
- .mushi-banner-actions .mushi-banner-extra { display: none; }
2494
- }
2495
- .mushi-banner-link {
2496
- display: inline-flex;
2497
- align-items: center;
2498
- padding: 2px 8px;
2499
- border: none;
2500
- background: transparent;
2501
- color: inherit;
2502
- cursor: pointer;
2503
- font: inherit;
2504
- letter-spacing: inherit;
2505
- text-decoration: none;
2506
- opacity: 0.88;
2507
- transition: opacity ${durInstant}ms ${easeStamp};
2508
- flex-shrink: 0;
2509
- }
2510
- .mushi-banner-link:hover { opacity: 1; }
2511
- .mushi-banner-link:focus-visible {
2512
- outline: 2px solid ${widgetAccent};
2513
- outline-offset: 2px;
2514
- border-radius: 2px;
2515
- }
2516
- .mushi-banner-divider {
2517
- opacity: 0.28;
2518
- padding: 0 1px;
2519
- user-select: none;
2520
- flex-shrink: 0;
2521
- }
2522
- .mushi-banner--rich .mushi-banner-dismiss {
2523
- margin-left: 4px;
2524
- }
2525
-
2526
- .mushi-banner-btn {
2527
- display: inline-flex;
2528
- align-items: center;
2529
- gap: 4px;
2530
- padding: 3px 10px;
2531
- border-radius: 3px;
2532
- cursor: pointer;
2533
- font: inherit;
2534
- letter-spacing: inherit;
2535
- transition: opacity ${durInstant}ms ${easeStamp};
2536
- flex-shrink: 0;
2537
- height: 24px;
2538
- line-height: 1;
2539
- }
2540
- .mushi-banner-btn:focus-visible {
2541
- outline: 2px solid ${widgetAccent};
2542
- outline-offset: 2px;
2543
- }
2544
-
2545
- .mushi-banner-dismiss {
2546
- background: transparent !important;
2547
- border: none !important;
2548
- opacity: 0.65;
2549
- cursor: pointer;
2550
- font-size: 14px;
2551
- line-height: 1;
2552
- padding: 4px 8px;
2553
- margin-left: auto;
2554
- flex-shrink: 0;
2555
- color: inherit;
2556
- border-radius: 3px;
2557
- transition: opacity ${durInstant}ms ${easeStamp};
2558
- }
2559
- .mushi-banner-dismiss:hover {
2560
- opacity: 1;
2561
- background: rgba(0,0,0,0.12) !important;
2562
- }
2563
- .mushi-banner.neon .mushi-banner-dismiss:hover { background: rgba(0,0,0,0.18) !important; }
2564
-
2565
- /* "My reports" link in the simple (non-rich) banner layout */
2566
- .mushi-banner-my-reports {
2567
- background: transparent;
2568
- border: none;
2569
- cursor: pointer;
2570
- font-size: 11px;
2571
- font-family: ${fontMono};
2572
- opacity: 0.75;
2573
- color: inherit;
2574
- padding: 2px 6px;
2575
- border-radius: 3px;
2576
- white-space: nowrap;
2577
- flex-shrink: 0;
2578
- transition: opacity ${durInstant}ms ${easeStamp};
2579
- margin-left: 4px;
2580
- }
2581
- .mushi-banner-my-reports:hover {
2582
- opacity: 1;
2583
- background: rgba(0,0,0,0.10);
2584
- }
2585
- .mushi-banner.neon .mushi-banner-my-reports:hover { background: rgba(0,0,0,0.18); }
2586
-
2587
- @keyframes mushi-banner-slide-in {
2588
- from { transform: translateY(calc(-1 * 100%)); opacity: 0.5; }
2589
- to { transform: translateY(0); opacity: 1; }
2590
- }
2591
- .mushi-banner.bottom {
2592
- animation-name: mushi-banner-slide-in-bottom;
2593
- }
2594
- @keyframes mushi-banner-slide-in-bottom {
2595
- from { transform: translateY(100%); opacity: 0.5; }
2596
- to { transform: translateY(0); opacity: 1; }
2597
- }
2598
-
2599
- @media (prefers-reduced-motion: reduce) {
2600
- *,
2601
- *::before,
2602
- *::after {
2603
- animation-duration: 0.001ms !important;
2604
- animation-iteration-count: 1 !important;
2605
- transition-duration: 0.001ms !important;
2606
- }
2607
- .mushi-success-stamp circle { stroke-dashoffset: 0; }
2608
- .mushi-success-stamp-label { opacity: 1; }
2609
- .mushi-success-pts-award { opacity: 1; }
2610
- }
2611
-
2612
- .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}
2613
- .mushi-community-btn{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2614
- .mushi-section-label{
2615
- margin:0 0 6px;
2616
- font-family:${fontMono};
2617
- font-size:11px;
2618
- letter-spacing:0.06em;
2619
- text-transform:uppercase;
2620
- color:${inkFaint};
2621
- }
2622
- .mushi-more-nav{margin-top:4px}
2623
- .mushi-more-nav-panel{display:flex;flex-direction:column;gap:0;border-top:1px dashed ${rule};padding-top:2px}
2624
- .mushi-more-nav-link{align-self:flex-start;margin:6px 0 2px;padding:0}
2625
- /* \u2500\u2500 "More issue types \u2192" toggle (progressive disclosure) \u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2626
- .mushi-more-toggle {
2627
- display: flex;
2628
- align-items: center;
2629
- gap: 8px;
2630
- width: 100%;
2631
- padding: 11px 0;
2632
- border: none;
2633
- border-top: 1px dashed ${rule};
2634
- background: transparent;
2635
- cursor: pointer;
2636
- color: ${inkMuted};
2637
- font-family: ${fontBody};
2638
- font-size: 13px;
2639
- text-align: left;
2640
- transition: opacity ${durFast}ms ${easeStamp};
2641
- }
2642
- .mushi-more-toggle:hover { color: ${widgetAccent}; }
2643
- .mushi-more-toggle:hover .mushi-more-toggle-arrow { transform: translateX(3px); }
2644
- .mushi-more-toggle-text { flex: 1; }
2645
- .mushi-more-toggle-count {
2646
- font-family: ${fontMono};
2647
- font-size: 10px;
2648
- letter-spacing: 0.08em;
2649
- text-transform: uppercase;
2650
- color: ${inkFaint};
2651
- background: ${isDark ? "rgba(255,255,255,0.07)" : "rgba(0,0,0,0.06)"};
2652
- padding: 2px 6px;
2653
- border-radius: 10px;
2654
- }
2655
- .mushi-more-toggle-arrow {
2656
- font-size: 14px;
2657
- opacity: 0.5;
2658
- transition: transform ${durFast}ms ${easeStamp};
2659
- }
2660
- /* \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 */
2661
- @keyframes mushi-step-in {
2662
- 0% { opacity: 0; transform: translateX(8px); }
2663
- 100% { opacity: 1; transform: translateX(0); }
2664
- }
2665
- .mushi-body {
2666
- animation: mushi-step-in 160ms ease both;
2667
- }
2668
- @media (prefers-reduced-motion: reduce) {
2669
- .mushi-body { animation: none; }
2670
- }
2671
- /* Expanded secondary categories animate in */
2672
- .mushi-categories-expanded {
2673
- animation: mushi-step-in ${durFast}ms ${easeStamp} both;
2674
- }
2675
- .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}
2676
- .mushi-link-btn:hover{opacity:0.8}
2677
- .mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}
2678
- .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}}
2679
- .mushi-nav-item:hover{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(0,0,0,0.07)"}}
2680
- .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}
2681
- .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}
2682
- .mushi-account-info{display:flex;flex-direction:column;gap:2px;min-width:0}
2683
- .mushi-account-info strong{font:700 14px/1.3 inherit;color:${ink}}
2684
- .mushi-account-rank,.mushi-xapp-app-name,.mushi-label{font-size:12px;color:${inkDim};font-family:${fontMono}}
2685
- .mushi-account-rank{display:block}
2686
- .mushi-xapp-app-head{display:flex;align-items:center;gap:8px;margin:0 0 6px}
2687
- .mushi-xapp-app-name{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin:0}
2688
- .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}
2689
- .mushi-app-icon-img{display:block;width:16px;height:16px;object-fit:contain}
2690
- .mushi-app-icon-initials{font-size:9px;font-weight:700;color:${inkDim};line-height:1}
2691
- .mushi-app-icon-initials-only{background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)"}}
2692
- .mushi-header-host-icon{display:block;width:20px;height:20px;border-radius:4px;object-fit:contain}
2693
- .mushi-xapp-group{margin-bottom:14px}
2694
- .mushi-label{display:block;font-weight:600;margin-bottom:6px}
2695
-
2696
- /* \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 */
2697
- .mushi-assistant{display:flex;flex-direction:column;height:100%;min-height:0;max-height:60vh}
2698
- .mushi-assistant-log{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px 8px}
2699
- .mushi-assistant-greeting{font:400 14px/1.5 ${fontBody};color:${inkMuted};padding:6px 2px}
2700
- .mushi-assistant-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
2701
- .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}}
2702
- .mushi-assistant-chip:hover{background:rgba(${accentRgb},${isDark ? "0.22" : "0.14"})}
2703
- .mushi-assistant-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2704
- .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}
2705
- .mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:${inverse};border-bottom-right-radius:4px}
2706
- .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}
2707
- .mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}
2708
- .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}
2709
- .mushi-assistant-recovery{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
2710
- .mushi-assistant-recovery-footer{margin-top:4px;padding-top:4px}
2711
- .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}
2712
- .mushi-assistant-report-cta:hover{opacity:0.92}
2713
- .mushi-assistant-report-cta:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2714
- .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}
2715
- .mushi-assistant-report-link:hover{opacity:0.85}
2716
- .mushi-assistant-report-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2717
- .mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${rule};padding-top:8px}
2718
- .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}}
2719
- .mushi-assistant-input:focus-visible{outline:2px solid ${widgetAccent};outline-offset:1px}
2720
- .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}
2721
- .mushi-assistant-submit:hover{transform:translateY(-1px)}
2722
- .mushi-assistant-submit:disabled{opacity:0.5;cursor:default;transform:none}
2723
- .mushi-assistant-submit:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
2724
- `;
2725
- }
2726
-
2727
- // src/version.ts
2728
- var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
2729
- var MUSHI_SDK_VERSION = "1.29.0" ;
2730
- var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
2731
- function loadAssistantSession() {
2732
- try {
2733
- if (typeof sessionStorage === "undefined") return null;
2734
- const raw = sessionStorage.getItem(ASSISTANT_SESSION_STORAGE_KEY);
2735
- if (!raw) return null;
2736
- const parsed = JSON.parse(raw);
2737
- if (!parsed || typeof parsed !== "object") return null;
2738
- const record = parsed;
2739
- const turns = Array.isArray(record.turns) ? record.turns : null;
2740
- if (!turns) return null;
2741
- const normalized = [];
2742
- for (const item of turns) {
2743
- if (!item || typeof item !== "object") continue;
2744
- const t = item;
2745
- if (t.role !== "user" && t.role !== "assistant") continue;
2746
- if (typeof t.text !== "string") continue;
2747
- const turn = { role: t.role, text: t.text };
2748
- if (Array.isArray(t.options)) {
2749
- const options = t.options.filter((o) => typeof o === "string");
2750
- if (options.length) turn.options = options;
2751
- }
2752
- if (t.offerReport === true) turn.offerReport = true;
2753
- normalized.push(turn);
2754
- }
2755
- const threadId = typeof record.threadId === "string" && record.threadId.length > 0 ? record.threadId : null;
2756
- return { turns: normalized, threadId };
2757
- } catch {
2758
- return null;
2759
- }
2760
- }
2761
- function saveAssistantSession(snapshot) {
2762
- try {
2763
- if (typeof sessionStorage === "undefined") return;
2764
- if (!snapshot.turns.length && !snapshot.threadId) {
2765
- sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
2766
- return;
2767
- }
2768
- sessionStorage.setItem(ASSISTANT_SESSION_STORAGE_KEY, JSON.stringify(snapshot));
2769
- } catch {
2770
- }
2771
- }
2772
- function clearAssistantSession() {
2773
- try {
2774
- if (typeof sessionStorage === "undefined") return;
2775
- sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
2776
- } catch {
2777
- }
2778
- }
2779
- var CATEGORY_ICONS = {
2780
- bug: "\u26A0\uFE0F",
2781
- slow: "\u{1F40C}",
2782
- visual: "\u{1F3A8}",
2783
- confusing: "\u{1F615}",
2784
- other: "\u{1F4DD}"
2785
- };
2786
- var FEATURE_REQUEST_INTENT = "Feature request";
2787
- function reporterStatusShort(status) {
2788
- switch (status) {
2789
- case "new":
2790
- case "queued":
2791
- case "pending":
2792
- case "submitted":
2793
- return "Sent";
2794
- case "classified":
2795
- case "triaged":
2796
- case "grouped":
2797
- case "dispatched":
2798
- return "Review";
2799
- case "fixing":
2800
- return "Fixing";
2801
- case "fixed":
2802
- case "resolved":
2803
- case "completed":
2804
- return "Fixed";
2805
- case "dismissed":
2806
- return "Closed";
2807
- default:
2808
- return status.replace(/_/g, " ").slice(0, 12);
2809
- }
2810
- }
2811
- function reporterStatusLabel(status) {
2812
- switch (status) {
2813
- case "new":
2814
- case "queued":
2815
- case "pending":
2816
- case "submitted":
2817
- return "Submitted";
2818
- case "classified":
2819
- case "triaged":
2820
- case "grouped":
2821
- case "dispatched":
2822
- return "In review";
2823
- case "fixing":
2824
- return "Fix in progress";
2825
- case "fixed":
2826
- case "resolved":
2827
- case "completed":
2828
- return "Fixed \u2014 confirm?";
2829
- case "verified":
2830
- return "Verified";
2831
- case "reopened":
2832
- return "Reopened";
2833
- case "dismissed":
2834
- return "Closed";
2835
- default:
2836
- return status.replace(/_/g, " ");
2837
- }
2838
- }
2839
- function reporterStatusTone(status) {
2840
- switch (status) {
2841
- case "new":
2842
- case "queued":
2843
- case "pending":
2844
- case "submitted":
2845
- return "sent";
2846
- case "classified":
2847
- case "triaged":
2848
- case "grouped":
2849
- case "dispatched":
2850
- return "review";
2851
- case "fixing":
2852
- return "fixing";
2853
- case "fixed":
2854
- case "resolved":
2855
- case "completed":
2856
- return "fixed";
2857
- case "verified":
2858
- return "fixed";
2859
- case "reopened":
2860
- return "fixing";
2861
- case "dismissed":
2862
- return "closed";
2863
- default:
2864
- return "unknown";
2865
- }
2866
- }
2867
- function formatRelativeTime(iso) {
2868
- const then = Date.parse(iso);
2869
- if (Number.isNaN(then)) return "";
2870
- const diffMs = Date.now() - then;
2871
- if (diffMs < 0) return "just now";
2872
- const sec = Math.floor(diffMs / 1e3);
2873
- if (sec < 60) return "just now";
2874
- const min = Math.floor(sec / 60);
2875
- if (min < 60) return `${min}m ago`;
2876
- const hr = Math.floor(min / 60);
2877
- if (hr < 24) return `${hr}h ago`;
2878
- const day = Math.floor(hr / 24);
2879
- if (day < 7) return `${day}d ago`;
2880
- const week = Math.floor(day / 7);
2881
- if (week < 5) return `${week}w ago`;
2882
- return new Date(then).toLocaleDateString(void 0, { month: "short", day: "numeric" });
2883
- }
2884
- function pad2(n) {
2885
- return n < 10 ? `0${n}` : String(n);
2886
- }
2887
- var BRAND_FOOTER_URL = "https://kensaur.us/mushi-mushi/";
2888
- var BRAND_FOOTER_UTM = "utm_source=widget&utm_medium=powered-by";
2889
- function buildBrandFooterHref(ref) {
2890
- const base = `${BRAND_FOOTER_URL}?${BRAND_FOOTER_UTM}`;
2891
- return ref && /^[0-9a-f]{6,64}$/.test(ref) ? `${base}&ref=${ref}` : base;
2892
- }
2893
- var TOTAL_STEPS = 3;
2894
- var STEP_NUMBER = {
2895
- category: 1,
2896
- intent: 2,
2897
- details: 3};
2898
- function isSubmitShortcut(e) {
2899
- return (e.metaKey || e.ctrlKey) && e.key === "Enter";
2900
- }
2901
- function escapeHtml(value) {
2902
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2903
- }
2904
- function renderAppIconHtml(opts) {
2905
- const domain = opts.appDomain ?? resolveProjectDomain({
2906
- project_id: opts.projectId,
2907
- project_name: opts.appName,
2908
- project_slug: opts.appSlug ?? ""
2909
- });
2910
- const initials = escapeHtml(projectInitials(opts.appName));
2911
- const candidates = projectFaviconUrlCandidates({
2912
- project_id: opts.projectId,
2913
- project_name: opts.appName,
2914
- project_slug: opts.appSlug ?? "",
2915
- sdk_origin: opts.appDomain ? `https://${opts.appDomain}` : null
2916
- });
2917
- if (!candidates.length) {
2918
- return `<span class="mushi-app-icon mushi-app-icon-initials-only" aria-hidden="true">${initials}</span>`;
2919
- }
2920
- const encoded = escapeHtml(JSON.stringify(candidates));
2921
- return `<span class="mushi-app-icon" data-mushi-favicon data-candidates="${encoded}" data-initials="${initials}" aria-hidden="true" title="${escapeHtml(domain ?? opts.appName)}">
2922
- <img class="mushi-app-icon-img" src="${escapeHtml(candidates[0])}" alt="" referrerpolicy="no-referrer" width="16" height="16" />
2923
- <span class="mushi-app-icon-initials" hidden>${initials}</span>
2924
- </span>`;
2925
- }
2926
- function bindFaviconFallbacks(root) {
2927
- root.querySelectorAll("[data-mushi-favicon]").forEach((wrap) => {
2928
- const img = wrap.querySelector(".mushi-app-icon-img");
2929
- const fallback = wrap.querySelector(".mushi-app-icon-initials");
2930
- if (!img || !fallback) return;
2931
- let candidates = [];
2932
- try {
2933
- candidates = JSON.parse(wrap.dataset.candidates ?? "[]");
2934
- } catch {
2935
- candidates = [];
2936
- }
2937
- let index = 0;
2938
- const tryNext = () => {
2939
- index += 1;
2940
- if (index < candidates.length) {
2941
- img.src = candidates[index];
2942
- } else {
2943
- img.remove();
2944
- fallback.hidden = false;
2945
- wrap.classList.add("mushi-app-icon-initials-only");
2946
- }
2947
- };
2948
- img.onerror = tryNext;
2949
- img.onload = () => {
2950
- if (isLikelyGenericFavicon(img)) tryNext();
2951
- };
2952
- });
1227
+ onAccent: v.onAccent,
1228
+ neonBannerBg: v.neonBannerBg,
1229
+ neonBannerFg: v.neonBannerFg,
1230
+ neonBannerBorder: v.neonBannerBorder,
1231
+ brandBannerBorder: v.brandBannerBorder
1232
+ };
1233
+ }
1234
+ function getWidgetStyles(theme, accent = "", accentText = "") {
1235
+ const v = getWidgetThemeVars(theme, accent, accentText);
1236
+ const {
1237
+ isDark,
1238
+ paper,
1239
+ paperRaised,
1240
+ ink,
1241
+ inkMuted,
1242
+ inkFaint,
1243
+ inkDim,
1244
+ rule,
1245
+ ruleStrong,
1246
+ widgetAccent,
1247
+ widgetAccentWash,
1248
+ widgetAccentInk,
1249
+ widgetAccentShadow,
1250
+ accentRgb,
1251
+ shadowInk,
1252
+ ok,
1253
+ danger,
1254
+ onAccent,
1255
+ inverse,
1256
+ neonBannerBg,
1257
+ neonBannerFg,
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}`;
2953
1298
  }
2954
1299
 
1300
+ // src/version.ts
1301
+ var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
1302
+ var MUSHI_SDK_VERSION = "1.30.0" ;
1303
+
2955
1304
  // src/widget-render.ts
2956
1305
  function renderStep(ctx) {
2957
1306
  switch (ctx.step) {
@@ -2986,41 +1335,41 @@ function renderAssistantStep(ctx) {
2986
1335
  const suggestions = ctx.callbacks.assistantSuggestions ?? [];
2987
1336
  const empty = ctx.assistantTurns.length === 0;
2988
1337
  const transcript = empty ? `<div class="mushi-assistant-greeting">${escapeHtml(greeting)}</div>
2989
- ${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) => {
2990
1339
  const cls = turn.role === "user" ? "mushi-assistant-msg-user" : "mushi-assistant-msg-bot";
2991
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>` : "";
2992
1341
  const reportCta = turn.offerReport ? `<div class="mushi-assistant-recovery">
2993
- <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
2994
- </div>` : "";
1342
+ <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
1343
+ </div>` : "";
2995
1344
  return `<div class="mushi-assistant-msg ${cls}">${escapeHtml(turn.text)}</div>${opts}${reportCta}`;
2996
1345
  }).join("");
2997
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>` : "";
2998
1347
  const error = ctx.assistantError ? `<div class="mushi-assistant-error" role="alert">${escapeHtml(ctx.assistantError)}
2999
- <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
3000
- </div>` : "";
1348
+ <button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
1349
+ </div>` : "";
3001
1350
  const stillStuck = !empty && !ctx.assistantSending && !ctx.assistantError ? `<div class="mushi-assistant-recovery mushi-assistant-recovery-footer">
3002
- <button type="button" class="mushi-assistant-report-link" data-action="assistant-report">${escapeHtml(t.assistant.stillStuckCta)}</button>
3003
- </div>` : "";
1351
+ <button type="button" class="mushi-assistant-report-link" data-action="assistant-report">${escapeHtml(t.assistant.stillStuckCta)}</button>
1352
+ </div>` : "";
3004
1353
  return `
3005
- ${renderHeader(ctx, { title: label, showBack: true })}
3006
- <div class="mushi-assistant">
3007
- <div class="mushi-assistant-log">
3008
- ${transcript}
3009
- ${thinking}
3010
- ${error}
3011
- ${stillStuck}
3012
- </div>
3013
- <form class="mushi-assistant-form" data-action="assistant-send">
3014
- <textarea
3015
- class="mushi-assistant-input"
3016
- rows="1"
3017
- placeholder="${escapeHtml(t.assistant.inputPlaceholder)}"
3018
- ${ctx.assistantSending ? "disabled" : ""}
3019
- ></textarea>
3020
- <button type="submit" class="mushi-assistant-submit" ${ctx.assistantSending ? "disabled" : ""} aria-label="${escapeHtml(t.assistant.sendAriaLabel)}">\u2191</button>
3021
- </form>
3022
- </div>
3023
- `;
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
+ `;
3024
1373
  }
3025
1374
  function renderOutdatedBanner(ctx) {
3026
1375
  if (!ctx.sdkFreshness) return "";
@@ -3028,12 +1377,12 @@ function renderOutdatedBanner(ctx) {
3028
1377
  const { latest, current, deprecated, message } = ctx.sdkFreshness;
3029
1378
  if (!latest && !deprecated) return "";
3030
1379
  return `
3031
- <div class="mushi-outdated" role="status">
3032
- <strong>Mushi SDK ${escapeHtml(current)}</strong>
3033
- ${latest ? `latest is ${escapeHtml(latest)}.` : "needs attention."}
3034
- ${message ? `<span>${escapeHtml(message)}</span>` : ""}
3035
- </div>
3036
- `;
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
+ `;
3037
1386
  }
3038
1387
  function renderBrandFooter(ctx) {
3039
1388
  if (ctx.config.brandFooter !== true) return "";
@@ -3046,18 +1395,18 @@ function renderHeader(ctx, opts) {
3046
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>`;
3047
1396
  const counterHtml = step ? `<span class="mushi-step-counter" aria-label="Step ${step} of ${TOTAL_STEPS}"><b>${pad2(step)}</b> / ${pad2(TOTAL_STEPS)}</span>` : "";
3048
1397
  return `
3049
- <div class="mushi-header">
3050
- <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>
3051
- <div class="mushi-header-titles">
3052
- ${eyebrowHtml}
3053
- <h3>${title}</h3>
3054
- </div>
3055
- <div class="mushi-header-meta">
3056
- ${counterHtml}
3057
- <button type="button" class="mushi-close" data-action="close" aria-label="${escapeHtml(t.widget.close)}">\u2715</button>
3058
- </div>
3059
- </div>
3060
- `;
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
+ `;
3061
1410
  }
3062
1411
  function countMoreNavItems(ctx) {
3063
1412
  let n = 1;
@@ -3076,59 +1425,59 @@ function renderMoreNavSection(ctx) {
3076
1425
  const reportsLabel = unread ? `${mn.yourReports} (${unread} ${mn.unreadNew})` : mn.yourReports;
3077
1426
  const panelItems = [
3078
1427
  `<button type="button" class="mushi-option-btn mushi-reports-entry" data-action="reports">
3079
- <span class="mushi-option-icon" aria-hidden="true">\u{1F4EC}</span>
3080
- <div class="mushi-option-text">
3081
- <span class="mushi-option-label">${escapeHtml(reportsLabel)}</span>
3082
- <span class="mushi-option-desc">${escapeHtml(mn.yourReportsDesc)}</span>
3083
- </div>
3084
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3085
- </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>`
3086
1435
  ];
3087
1436
  if (ctx.callbacks.onFeatureBoardRequest) {
3088
1437
  panelItems.push(`
3089
- <button type="button" class="mushi-option-btn" data-action="roadmap">
3090
- <span class="mushi-option-icon" aria-hidden="true">\u{1F5F3}\uFE0F</span>
3091
- <div class="mushi-option-text">
3092
- <span class="mushi-option-label">${escapeHtml(mn.communityIdeas)}</span>
3093
- <span class="mushi-option-desc">${escapeHtml(mn.communityIdeasDesc)}</span>
3094
- </div>
3095
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3096
- </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>`);
3097
1446
  }
3098
1447
  if (ctx.callbacks.assistantEnabled) {
3099
1448
  panelItems.push(`
3100
- <button type="button" class="mushi-option-btn" data-action="assistant">
3101
- <span class="mushi-option-icon" aria-hidden="true">\u{1F4AC}</span>
3102
- <div class="mushi-option-text">
3103
- <span class="mushi-option-label">${escapeHtml(ctx.callbacks.assistantLabel || t.assistant.defaultLabel)}</span>
3104
- <span class="mushi-option-desc">${escapeHtml(t.assistant.hubDescription)}</span>
3105
- </div>
3106
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3107
- </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>`);
3108
1457
  }
3109
1458
  if (ctx.rewardsState) {
3110
1459
  panelItems.push(`
3111
- <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>`);
3112
1461
  }
3113
1462
  panelItems.push(`
3114
- <button type="button" class="mushi-link-btn mushi-more-nav-link" data-action="open-account">
3115
- ${ctx.testerInfo ? `\u{1F464} ${escapeHtml(ctx.testerInfo.public_handle ?? ctx.testerInfo.display_name ?? mn.myAccount)}` : `\u{1F310} ${escapeHtml(mn.joinCommunity)}`}
3116
- </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>`);
3117
1466
  const panelHtml = ctx.showMoreNav ? `<div class="mushi-more-nav-panel">${panelItems.join("")}</div>` : "";
3118
1467
  return `
3119
- <div class="mushi-more-nav">
3120
- <button
3121
- type="button"
3122
- class="mushi-more-toggle mushi-more-nav-toggle"
3123
- data-action="toggle-more-nav"
3124
- aria-expanded="${ctx.showMoreNav ? "true" : "false"}"
3125
- >
3126
- <span class="mushi-more-toggle-text">${escapeHtml(toggleLabel)}</span>
3127
- <span class="mushi-more-toggle-arrow" aria-hidden="true">${ctx.showMoreNav ? "\u25BE" : "\u25B8"}</span>
3128
- </button>
3129
- ${panelHtml}
3130
- </div>
3131
- `;
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
+ `;
3132
1481
  }
3133
1482
  function renderCategoryStep(ctx) {
3134
1483
  const t = ctx.locale;
@@ -3144,15 +1493,15 @@ function renderCategoryStep(ctx) {
3144
1493
  desc: t.step1.categoryDescriptions[id]
3145
1494
  }));
3146
1495
  const renderEntry = ({ id, icon, label, desc }) => `
3147
- <button type="button" class="mushi-option-btn" data-category="${escapeHtml(id)}" role="radio" aria-checked="false">
3148
- <span class="mushi-option-icon" aria-hidden="true">${escapeHtml(icon)}</span>
3149
- <div class="mushi-option-text">
3150
- <span class="mushi-option-label">${escapeHtml(label)}</span>
3151
- ${desc ? `<span class="mushi-option-desc">${escapeHtml(desc)}</span>` : ""}
3152
- </div>
3153
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3154
- </button>
3155
- `;
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
+ `;
3156
1505
  const isCustom = ctx.config.categories && ctx.config.categories.length > 0;
3157
1506
  const PRIMARY_LIMIT = 1;
3158
1507
  const primaryEntries = isCustom ? categoryEntries : categoryEntries.slice(0, PRIMARY_LIMIT);
@@ -3161,22 +1510,22 @@ function renderCategoryStep(ctx) {
3161
1510
  const primaryCategories = primaryEntries.map(renderEntry).join("");
3162
1511
  const secondaryCategories = secondaryEntries.map(renderEntry).join("");
3163
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">
3164
- <span class="mushi-more-toggle-text">${escapeHtml(t.step1.moreCategoriesLabel)}</span>
3165
- <span class="mushi-more-toggle-count">${escapeHtml(t.step1.moreCategoriesCount.replace("{n}", String(secondaryEntries.length)))}</span>
3166
- <span class="mushi-more-toggle-arrow" aria-hidden="true">\u2192</span>
3167
- </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>` : "";
3168
1517
  return `
3169
- ${renderHeader(ctx, { title: t.step1.heading, step: STEP_NUMBER.category })}
3170
- ${ctx.config.betaMode?.enabled ? renderBetaStrip(ctx) : ""}
3171
- <div class="mushi-body" role="radiogroup" aria-label="${escapeHtml(t.step1.heading)}">
3172
- <p class="mushi-section-label">${escapeHtml(t.step1.reportSectionLabel)}</p>
3173
- ${renderFeatureRequestEntry(ctx)}
3174
- ${primaryCategories}
3175
- ${secondaryHtml}
3176
- ${ctx.rewardsState ? renderRewardsNudge(ctx) : ""}
3177
- ${renderMoreNavSection(ctx)}
3178
- </div>
3179
- `;
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
+ `;
3180
1529
  }
3181
1530
  function renderFeatureRequestEntry(ctx) {
3182
1531
  const enabled = ctx.config.featureRequestCard !== false;
@@ -3185,20 +1534,20 @@ function renderFeatureRequestEntry(ctx) {
3185
1534
  const label = ctx.config.featureRequestLabel || f.label;
3186
1535
  const desc = ctx.config.featureRequestDescription || f.description;
3187
1536
  return `
3188
- <button
3189
- type="button"
3190
- class="mushi-option-btn mushi-feature-entry"
3191
- data-action="feature-request"
3192
- aria-label="${escapeHtml(label)}"
3193
- >
3194
- <span class="mushi-option-icon" aria-hidden="true">\u2728</span>
3195
- <div class="mushi-option-text">
3196
- <span class="mushi-option-label">${escapeHtml(label)}</span>
3197
- <span class="mushi-option-desc">${escapeHtml(desc)}</span>
3198
- </div>
3199
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3200
- </button>
3201
- `;
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
+ `;
3202
1551
  }
3203
1552
  function renderBetaChangelog(ctx) {
3204
1553
  const entries = ctx.config.betaMode?.changelogItems;
@@ -3210,11 +1559,11 @@ function renderBetaChangelog(ctx) {
3210
1559
  );
3211
1560
  const label = latest.date ? `${whatsNew} \xB7 ${escapeHtml(latest.date)}` : whatsNew;
3212
1561
  return `
3213
- <details class="mushi-changelog">
3214
- <summary class="mushi-changelog-summary">${label}</summary>
3215
- <ul class="mushi-changelog-list">${items}</ul>
3216
- </details>
3217
- `;
1562
+ <details class="mushi-changelog">
1563
+ <summary class="mushi-changelog-summary">${label}</summary>
1564
+ <ul class="mushi-changelog-list">${items}</ul>
1565
+ </details>
1566
+ `;
3218
1567
  }
3219
1568
  function renderBetaStrip(ctx) {
3220
1569
  const beta = ctx.config.betaMode;
@@ -3224,20 +1573,20 @@ function renderBetaStrip(ctx) {
3224
1573
  const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
3225
1574
  const perks = beta.perks ?? [];
3226
1575
  return `
3227
- <div class="mushi-beta-strip" role="note" aria-label="${escapeHtml(strip.ariaLabel)}">
3228
- <div class="mushi-beta-strip-row">
3229
- <span class="mushi-beta-tag" aria-hidden="true">BETA</span>
3230
- <span class="mushi-beta-msg">${message}</span>
3231
- </div>
3232
- ${email ? `<div class="mushi-beta-contact-hint">${escapeHtml(strip.contactHint).replace("{email}", email)}</div>` : ""}
3233
- ${perks.length > 0 ? `
3234
- <ul class="mushi-beta-perks" aria-label="Beta tester perks">
3235
- ${perks.map((p) => `<li>\u2713 ${escapeHtml(p)}</li>`).join("")}
3236
- </ul>
3237
- ` : ""}
3238
- ${renderBetaChangelog(ctx)}
3239
- </div>
3240
- `;
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
+ `;
3241
1590
  }
3242
1591
  function renderReportsStep(ctx) {
3243
1592
  const f = ctx.locale.flows;
@@ -3247,28 +1596,28 @@ function renderReportsStep(ctx) {
3247
1596
  const when = formatRelativeTime(report.created_at);
3248
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>` : "";
3249
1598
  return `
3250
- <button type="button" class="mushi-report-row" data-report-id="${escapeHtml(report.id)}" aria-label="View report: ${escapeHtml(title)}">
3251
- <div class="mushi-report-main">
3252
- <span class="mushi-report-title">${escapeHtml(title)}</span>
3253
- <span class="mushi-report-meta">
3254
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(report.status))}</span>
3255
- ${when ? `<span class="mushi-report-when">${escapeHtml(when)}</span>` : ""}
3256
- ${unread}
3257
- </span>
3258
- </div>
3259
- <span class="mushi-report-chevron" aria-hidden="true">\u203A</span>
3260
- </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>`;
3261
1610
  }).join("");
3262
1611
  const leaderboardBtn = ctx.rewardsState ? `<button type="button" class="mushi-leaderboard-link" data-action="open-leaderboard">\u{1F3C6} ${escapeHtml(f.reports.leaderboardLink)}</button>` : "";
3263
1612
  return `
3264
- ${renderHeader(ctx, { title: f.reports.title, showBack: true, eyebrow: f.eyebrows.inbox })}
3265
- <div class="mushi-body">
3266
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.loading)}</p>` : ""}
3267
- ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
3268
- ${reports || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.reports.empty)}</p>` : "")}
3269
- ${leaderboardBtn}
3270
- </div>
3271
- `;
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
+ `;
3272
1621
  }
3273
1622
  function renderRoadmapStep(ctx) {
3274
1623
  const f = ctx.locale.flows;
@@ -3281,28 +1630,28 @@ function renderRoadmapStep(ctx) {
3281
1630
  const status = shipped ? f.roadmap.shipped : String(ticket.status_label ?? ticket.status ?? "open");
3282
1631
  const voteLabel = f.roadmap.voteCount.replace("{n}", String(votes));
3283
1632
  return `
3284
- <div class="mushi-report-row mushi-roadmap-row">
3285
- <div class="mushi-report-main">
3286
- <span class="mushi-report-title">${subject}</span>
3287
- <span class="mushi-report-meta">
3288
- <span class="mushi-report-status">${escapeHtml(status)}</span>
3289
- <span class="mushi-report-when">${escapeHtml(voteLabel)}</span>
3290
- </span>
3291
- </div>
3292
- ${ctx.callbacks.onFeatureBoardVote ? `
3293
- <button type="button" class="mushi-vote-btn" data-vote-id="${escapeHtml(id)}" aria-pressed="${voted}">
3294
- ${voted ? escapeHtml(f.roadmap.voted) : escapeHtml(f.roadmap.vote)}
3295
- </button>` : ""}
3296
- </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>`;
3297
1646
  }).join("");
3298
1647
  return `
3299
- ${renderHeader(ctx, { title: f.roadmap.title, showBack: true, eyebrow: f.eyebrows.roadmap })}
3300
- <div class="mushi-body">
3301
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.loading)}</p>` : ""}
3302
- ${ctx.reporterError ? `<p class="mushi-error-inline">${escapeHtml(ctx.reporterError)}</p>` : ""}
3303
- ${rows || (!ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.roadmap.empty)}</p>` : "")}
3304
- </div>
3305
- `;
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
+ `;
3306
1655
  }
3307
1656
  function renderLeaderboardStep(ctx) {
3308
1657
  const f = ctx.locale.flows;
@@ -3321,24 +1670,24 @@ function renderLeaderboardStep(ctx) {
3321
1670
  const rank = e.rank || i + 1;
3322
1671
  const isMe = ctx.testerReputation && e.tester_id === ctx.testerReputation.tester_id;
3323
1672
  return `
3324
- <div class="mushi-lb-row ${rank === 1 ? "mushi-lb-top" : ""}${isMe ? " mushi-lb-me" : ""}">
3325
- <span class="mushi-lb-rank">#${rank}</span>
3326
- <span class="mushi-lb-name">${escapeHtml(e.public_handle ?? e.display_name ?? f.leaderboard.anon)}</span>
3327
- <span class="mushi-lb-pts">${(e.points_30d ?? e.total_points).toLocaleString()} pts</span>
3328
- </div>
3329
- `;
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
+ `;
3330
1679
  }).join("");
3331
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>` : "";
3332
1681
  return `
3333
- ${renderHeader(ctx, { title: f.leaderboard.title, showBack: true, eyebrow: f.eyebrows.community })}
3334
- <div class="mushi-body">
3335
- ${loading ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.loading)}</p>` : ""}
3336
- ${!loading && !entries.length ? `<p class="mushi-muted">${escapeHtml(f.leaderboard.empty)}</p>` : ""}
3337
- <div class="mushi-lb-list">${rows}</div>
3338
- ${myRankBadge}
3339
- <p class="mushi-lb-note">${escapeHtml(f.leaderboard.footer)}</p>
3340
- </div>
3341
- `;
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
+ `;
3342
1691
  }
3343
1692
  function renderAccountStep(ctx) {
3344
1693
  const f = ctx.locale.flows;
@@ -3348,56 +1697,56 @@ function renderAccountStep(ctx) {
3348
1697
  const rep = ctx.testerReputation;
3349
1698
  const rankLine = rep ? f.account.rankSummary.replace("{rank}", String(rep.rank ?? "\u2014")).replace("{points}", (rep.points_30d ?? 0).toLocaleString()) : "";
3350
1699
  return `
3351
- ${renderHeader(ctx, { title: f.account.title, showBack: true, eyebrow: f.eyebrows.identity })}
3352
- <div class="mushi-body">
3353
- <div class="mushi-account-card">
3354
- <div class="mushi-account-avatar">${escapeHtml(handle.charAt(0).toUpperCase())}</div>
3355
- <div class="mushi-account-info">
3356
- <strong>${escapeHtml(handle)}</strong>
3357
- ${rep ? `<span class="mushi-account-rank">${escapeHtml(rankLine)}</span>` : ""}
3358
- </div>
3359
- </div>
3360
- <button type="button" class="mushi-nav-item" data-action="open-cross-app-reports">
3361
- ${escapeHtml(f.account.crossAppReports)}
3362
- </button>
3363
- <button type="button" class="mushi-nav-item" data-action="open-global-leaderboard">
3364
- ${escapeHtml(f.account.viewLeaderboard)}
3365
- </button>
3366
- <button type="button" class="mushi-link-btn" data-action="sign-out-tester">${escapeHtml(f.account.signOut)}</button>
3367
- </div>
3368
- `;
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
+ `;
3369
1718
  }
3370
1719
  if (ctx.magicLinkSent) {
3371
1720
  return `
3372
- ${renderHeader(ctx, { title: f.account.checkEmailTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
3373
- <div class="mushi-body">
3374
- <p class="mushi-muted">${escapeHtml(f.account.magicLinkSent.replace("{email}", ctx.magicLinkEmail))}</p>
3375
- <button type="button" class="mushi-link-btn" data-action="resend-magic-link">${escapeHtml(f.account.resendEmail)}</button>
3376
- ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
3377
- </div>
3378
- `;
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
+ `;
3379
1728
  }
3380
1729
  return `
3381
- ${renderHeader(ctx, { title: f.account.joinTitle, showBack: true, eyebrow: f.eyebrows.signIn })}
3382
- <div class="mushi-body">
3383
- <p class="mushi-muted">${escapeHtml(f.account.signInPrompt)}</p>
3384
- <label class="mushi-label" for="mushi-email-input">${escapeHtml(f.account.emailLabel)}</label>
3385
- <input
3386
- id="mushi-email-input"
3387
- type="email"
3388
- class="mushi-textarea"
3389
- data-role="magic-link-email"
3390
- placeholder="${escapeHtml(f.account.emailPlaceholder)}"
3391
- autocomplete="email"
3392
- value="${escapeHtml(ctx.magicLinkEmail)}"
3393
- style="padding: 10px 12px; height: auto; resize: none;"
3394
- />
3395
- ${ctx.magicLinkError ? `<p class="mushi-error">${escapeHtml(ctx.magicLinkError)}</p>` : ""}
3396
- <button type="button" class="mushi-submit" data-action="send-magic-link"${ctx.magicLinkSending ? ' disabled aria-disabled="true"' : ""}>
3397
- <span>${ctx.magicLinkSending ? escapeHtml(f.account.sending) : escapeHtml(f.account.sendLink)}</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3398
- </button>
3399
- </div>
3400
- `;
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
+ `;
3401
1750
  }
3402
1751
  function renderCrossAppReportsStep(ctx) {
3403
1752
  const f = ctx.locale.flows;
@@ -3423,70 +1772,75 @@ function renderCrossAppReportsStep(ctx) {
3423
1772
  appDomain: group.domain
3424
1773
  });
3425
1774
  return `
3426
- <div class="mushi-xapp-group">
3427
- <div class="mushi-xapp-app-head">
3428
- ${icon}
3429
- <h4 class="mushi-xapp-app-name">${escapeHtml(group.name)}</h4>
3430
- </div>
3431
- ${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) => {
3432
1781
  const tone = reporterStatusTone(r.status);
3433
1782
  return `
3434
- <div class="mushi-report-row" data-report-id="${escapeHtml(r.id)}" tabindex="0" role="button">
3435
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusShort(r.status))}</span>
3436
- <span class="mushi-report-title">${escapeHtml(r.title ?? r.category)}</span>
3437
- <span class="mushi-report-when">${escapeHtml(formatRelativeTime(r.created_at))}</span>
3438
- </div>
3439
- `;
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
+ `;
3440
1789
  }).join("")}
3441
- </div>
3442
- `;
1790
+ </div>
1791
+ `;
3443
1792
  }).join("");
3444
1793
  return `
3445
- ${renderHeader(ctx, { title: f.crossApp.title, showBack: true, eyebrow: f.eyebrows.allApps })}
3446
- <div class="mushi-body">
3447
- ${ctx.crossAppLoading ? `<p class="mushi-muted">${escapeHtml(f.crossApp.loading)}</p>` : ""}
3448
- ${!ctx.crossAppLoading && !reports.length ? `<p class="mushi-muted">${escapeHtml(f.crossApp.empty)}</p>` : ""}
3449
- ${rows}
3450
- </div>
3451
- `;
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
+ `;
3452
1801
  }
3453
1802
  function renderReportDetailStep(ctx) {
3454
1803
  const f = ctx.locale.flows;
3455
1804
  const report = ctx.reporterReports.find((r) => r.id === ctx.selectedReportId);
3456
- const status = report?.status ?? "unknown";
1805
+ const status = report?.status ?? "new";
3457
1806
  const tone = reporterStatusTone(status);
3458
1807
  const when = report?.created_at ? formatRelativeTime(report.created_at) : "";
1808
+ const busy = ctx.actionPending ? ' disabled aria-busy="true"' : "";
3459
1809
  const comments = ctx.reporterComments.map((comment) => `
3460
- <div class="mushi-thread-comment ${comment.author_kind}">
3461
- <strong>${escapeHtml(comment.author_kind === "reporter" ? "You" : comment.author_name ?? "Developer")}</strong>
3462
- <p>${escapeHtml(comment.body)}</p>
3463
- </div>
3464
- `).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("");
3465
1815
  return `
3466
- ${renderHeader(ctx, { title: f.thread.title, showBack: true, eyebrow: f.eyebrows.thread })}
3467
- <div class="mushi-body">
3468
- <div class="mushi-thread-summary">
3469
- <div class="mushi-thread-summary-meta">
3470
- <span class="mushi-report-status mushi-status-${tone}">${escapeHtml(reporterStatusLabel(status))}</span>
3471
- ${when ? `<span class="mushi-report-when">Reported ${escapeHtml(when)}</span>` : ""}
3472
- </div>
3473
- <p>${escapeHtml(report?.summary ?? report?.description ?? "Report details")}</p>
3474
- </div>
3475
- <div class="mushi-thread">
3476
- ${ctx.reporterLoading ? `<p class="mushi-muted">${escapeHtml(f.thread.loading)}</p>` : comments || `<p class="mushi-muted">${escapeHtml(f.thread.empty)}</p>`}
3477
- </div>
3478
- ${["fixed", "resolved", "verified"].includes(status) ? `
3479
- <div class="mushi-verify-actions" role="group" aria-label="Fix verification">
3480
- <button type="button" class="mushi-option-btn" data-action="reporter-confirms">${escapeHtml(f.thread.confirmFixed)}</button>
3481
- <button type="button" class="mushi-option-btn" data-action="reporter-not-fixed">${escapeHtml(f.thread.notFixed)}</button>
3482
- </div>
3483
- ` : ""}
3484
- <textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
3485
- <button type="button" class="mushi-submit" data-action="reporter-reply">
3486
- <span>Reply</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3487
- </button>
3488
- </div>
3489
- `;
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
+ `;
3490
1844
  }
3491
1845
  function renderIntentStep(ctx) {
3492
1846
  const t = ctx.locale;
@@ -3494,30 +1848,30 @@ function renderIntentStep(ctx) {
3494
1848
  const customEntry = ctx.resolveCustomCategory(catId);
3495
1849
  const intents = customEntry?.intents ?? (t.step2.intents[catId] || []);
3496
1850
  const options = intents.map((intent) => `
3497
- <button type="button" class="mushi-option-btn" data-intent="${escapeHtml(intent)}">
3498
- <span class="mushi-option-text"><span class="mushi-option-label">${escapeHtml(intent)}</span></span>
3499
- <span class="mushi-option-arrow" aria-hidden="true">\u2192</span>
3500
- </button>
3501
- `).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("");
3502
1856
  const icon = ctx.categoryIcon(catId);
3503
1857
  const label = ctx.categoryLabel(catId);
3504
1858
  return `
3505
- ${renderHeader(ctx, { title: t.step2.heading, showBack: true, step: STEP_NUMBER.intent })}
3506
- <div class="mushi-body">
3507
- <div class="mushi-selected-category">
3508
- <span aria-hidden="true">${escapeHtml(icon)}</span>
3509
- <span>${escapeHtml(label)}</span>
3510
- </div>
3511
- <div class="mushi-intents">
3512
- ${options}
3513
- </div>
3514
- </div>
3515
- `;
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
+ `;
3516
1870
  }
3517
1871
  function renderDetailsStep(ctx) {
3518
1872
  const t = ctx.locale;
3519
1873
  const minLen = ctx.effectiveMinLength();
3520
- 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;
3521
1875
  const screenshotClass = [
3522
1876
  "mushi-attach-btn",
3523
1877
  ctx.screenshotAttached ? "active" : "",
@@ -3531,143 +1885,162 @@ function renderDetailsStep(ctx) {
3531
1885
  ctx.elementError ? "error" : "",
3532
1886
  ctx.elementCapturing ? "loading" : ""
3533
1887
  ].filter(Boolean).join(" ");
3534
- 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>` : "";
3535
1893
  return `
3536
- ${renderHeader(ctx, { title: t.step3.heading, showBack: true, step: STEP_NUMBER.details })}
3537
- <div class="mushi-body">
3538
- <div class="mushi-example-chips" aria-label="Example prompts">${exampleChips}</div>
3539
- <div class="mushi-textarea-wrap">
3540
- <textarea
3541
- class="mushi-textarea"
3542
- placeholder="${escapeHtml(t.step3.descriptionPlaceholder)}"
3543
- rows="4"
3544
- maxlength="4000"
3545
- aria-label="${escapeHtml(t.step3.heading)}"
3546
- autofocus
3547
- ></textarea>
3548
- <div class="mushi-char-counter" data-role="char-counter" aria-hidden="true">
3549
- <span data-role="char-current">0</span>/<span data-role="char-min">${minLen}</span>
3550
- </div>
3551
- </div>
3552
- <div class="mushi-attachments">
3553
- ${ctx.screenshotAvailable ? `<button type="button" class="${screenshotClass}"
3554
- data-action="screenshot"
3555
- ${ctx.screenshotCapturing ? "disabled" : ""}
3556
- aria-label="${escapeHtml(screenshotLabel)}"
3557
- >
3558
- ${ctx.screenshotCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F4F8}"}
3559
- ${escapeHtml(screenshotLabel)}
3560
- </button>` : ""}
3561
- ${ctx.screenshotAttached && ctx.allowScreenshotRemove ? '<button type="button" class="mushi-attach-btn danger" data-action="remove-screenshot" aria-label="Remove screenshot">\u2715 Remove</button>' : ""}
3562
- ${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>' : ""}
3563
- ${ctx.elementAvailable ? `<button type="button" class="${elementClass}"
3564
- data-action="element"
3565
- ${ctx.elementCapturing ? "disabled" : ""}
3566
- aria-label="${escapeHtml(elementLabel)}"
3567
- >
3568
- ${ctx.elementCapturing ? '<span class="mushi-spinner" aria-hidden="true"></span>' : "\u{1F3AF}"}
3569
- ${escapeHtml(elementLabel)}
3570
- </button>` : ""}
3571
- </div>
3572
- ${ctx.screenshotAttached && ctx.screenshotPreview ? `<figure class="mushi-screenshot-preview">
3573
- <img src="${escapeHtml(ctx.screenshotPreview)}" alt="${escapeHtml(t.step3.screenshotPreviewAlt)}" />
3574
- ${ctx.screenshotHint ? `<figcaption class="mushi-screenshot-hint">\u26A0 ${escapeHtml(ctx.screenshotHint)}</figcaption>` : ""}
3575
- </figure>` : ""}
3576
- <div class="mushi-error" style="display:none" role="alert"></div>
3577
- ${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>` : ""}
3578
- </div>
3579
- <div class="mushi-footer">
3580
- <span class="mushi-footer-hint" aria-hidden="true">\u2318 + ENTER \u2192 send</span>
3581
- <button type="button" class="mushi-submit" data-action="submit"${ctx.submitting ? " disabled" : ""}>
3582
- <span>${ctx.submitting ? t.widget.submitting : t.widget.submit}</span>
3583
- <span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
3584
- </button>
3585
- </div>
3586
- `;
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;
3587
1958
  }
3588
1959
  function renderSuccessStep(ctx) {
3589
1960
  const t = ctx.locale;
1961
+ const s = t.flows.success;
3590
1962
  const stamp = ctx.submittedAt ?? /* @__PURE__ */ new Date();
3591
- 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;
3592
1966
  return `
3593
- ${renderHeader(ctx, { title: t.widget.title, showBack: true, eyebrow: "Mushi \xB7 Receipt" })}
3594
- <div class="mushi-body">
3595
- <div class="mushi-success">
3596
- <div class="mushi-success-stamp" aria-hidden="true">
3597
- <svg viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"><circle cx="50" cy="50" r="44"/></svg>
3598
- <span class="mushi-success-stamp-label">\u53D7</span>
3599
- </div>
3600
- <div class="mushi-success-headline">${t.widget.submitted}</div>
3601
- <div class="mushi-success-meta">REPORT \xB7 ${time}</div>
3602
- ${renderSuccessReceipt(ctx)}
3603
- ${ctx.rewardsState ? renderSuccessRewards(ctx) : ""}
3604
- ${ctx.config.betaMode?.enabled ? renderBetaSuccessFooter(ctx) : ""}
3605
- <button type="button" class="mushi-link-btn mushi-success-my-reports" data-action="view-my-reports">
3606
- ${escapeHtml(ctx.locale.flows.success.trackReport)}
3607
- </button>
3608
- </div>
3609
- </div>
3610
- `;
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
+ `;
3611
1986
  }
3612
1987
  function renderSuccessReceipt(ctx) {
3613
1988
  const s = ctx.locale.flows.success;
3614
1989
  const failureKind = ctx.lastSubmitFailureKind;
3615
- if (failureKind === "rate_limited" || failureKind === "quota" || failureKind === "permanent" || failureKind === "retrying" || ctx.lastSubmitQueuedOffline) {
3616
- 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)) {
3617
1991
  const hint = failureKind === "rate_limited" ? s.rateLimitedHint : failureKind === "quota" ? s.quotaBlockedHint : failureKind === "permanent" ? s.permanentFailedHint : failureKind === "retrying" ? s.retryingHint : s.queuedHint;
3618
1992
  return `
3619
- <div class="mushi-success-receipt" role="status">
3620
- <div class="mushi-success-receipt-row mushi-success-receipt-warn">
3621
- <span class="mushi-success-receipt-label">${escapeHtml(label)}</span>
3622
- <span class="mushi-success-receipt-hint">${escapeHtml(hint)}</span>
3623
- </div>
3624
- </div>
3625
- `;
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
+ `;
3626
1999
  }
3627
2000
  if (!ctx.lastReportId) {
3628
2001
  return `
3629
- <div class="mushi-success-receipt" role="status">
3630
- <div class="mushi-success-receipt-row">
3631
- <span class="mushi-success-receipt-spinner" aria-hidden="true"></span>
3632
- <span class="mushi-success-receipt-hint">${escapeHtml(s.delivering)}</span>
3633
- </div>
3634
- ${renderSlaLine(ctx)}
3635
- </div>
3636
- `;
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
+ `;
3637
2010
  }
3638
2011
  const idShort = `#${ctx.lastReportId.slice(0, 8)}`;
3639
2012
  const dashboard = (ctx.config.dashboardUrl ?? "").replace(/\/$/, "");
3640
2013
  const trackHref = dashboard ? `${dashboard}/reports/${encodeURIComponent(ctx.lastReportId)}` : "";
3641
2014
  const screenshotDroppedNote = ctx.lastSubmitScreenshotDropped ? `
3642
- <div class="mushi-success-receipt-row mushi-success-receipt-warn">
3643
- <span class="mushi-success-receipt-hint">${escapeHtml(s.screenshotDropped)}</span>
3644
- </div>
3645
- ` : "";
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
+ ` : "";
3646
2019
  return `
3647
- <div class="mushi-success-receipt" role="status">
3648
- <div class="mushi-success-receipt-row">
3649
- <span class="mushi-success-receipt-label">${escapeHtml(s.receipt)}</span>
3650
- <button
3651
- type="button"
3652
- class="mushi-success-receipt-id"
3653
- data-action="copy-report-id"
3654
- data-copy-id="${escapeHtml(ctx.lastReportId)}"
3655
- title="Copy report id ${escapeHtml(ctx.lastReportId)}"
3656
- aria-label="Copy report id ${escapeHtml(ctx.lastReportId)}"
3657
- >${escapeHtml(idShort)}<span class="mushi-success-receipt-copy" aria-hidden="true">\u2398</span></button>
3658
- </div>
3659
- ${trackHref ? `
3660
- <a
3661
- class="mushi-success-receipt-track"
3662
- href="${escapeHtml(trackHref)}"
3663
- target="_blank"
3664
- rel="noopener noreferrer"
3665
- >${escapeHtml(s.trackOnMushi)} <span aria-hidden="true">\u2197</span></a>
3666
- ` : ""}
3667
- ${screenshotDroppedNote}
3668
- ${renderSlaLine(ctx)}
3669
- </div>
3670
- `;
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
+ `;
3671
2044
  }
3672
2045
  function renderSlaLine(ctx) {
3673
2046
  const sla = (ctx.config.responseSlaLabel ?? "").trim();
@@ -3681,10 +2054,10 @@ function renderBetaSuccessFooter(ctx) {
3681
2054
  const email = beta.contactEmail ? escapeHtml(beta.contactEmail) : null;
3682
2055
  const appName = escapeHtml(beta.appName ?? "the team");
3683
2056
  return `
3684
- <div class="mushi-beta-success-footer" role="note" aria-label="Beta feedback acknowledgement">
3685
- ${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>`}
3686
- </div>
3687
- `;
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
+ `;
3688
2061
  }
3689
2062
  function renderRewardsNudge(ctx) {
3690
2063
  const { tier, nextTier, totalPoints, pointsForReport } = ctx.rewardsState;
@@ -3701,21 +2074,21 @@ function renderRewardsNudge(ctx) {
3701
2074
  nextLabel = `${remaining.toLocaleString()} pts to ${escapeHtml(nextTier.displayName)}`;
3702
2075
  }
3703
2076
  return `
3704
- <div class="mushi-rewards-nudge" aria-label="Rewards progress">
3705
- <div class="mushi-rewards-row">
3706
- <span class="mushi-tier-pip" style="background:${color}" aria-hidden="true"></span>
3707
- <span class="mushi-rewards-tier-name">${escapeHtml(tierName)}</span>
3708
- <span class="mushi-rewards-pts-count">${totalPoints.toLocaleString()} pts</span>
3709
- <span class="mushi-rewards-pts-earn">+${pointsForReport} pts for a report</span>
3710
- </div>
3711
- ${nextTier ? `
3712
- <div class="mushi-tier-bar-track" role="progressbar" aria-valuenow="${pct}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
3713
- <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pct / 100}"></div>
3714
- </div>
3715
- <div class="mushi-rewards-next-label">${nextLabel}</div>
3716
- ` : ""}
3717
- </div>
3718
- `;
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
+ `;
3719
2092
  }
3720
2093
  function renderSuccessRewards(ctx) {
3721
2094
  const { tier, nextTier, totalPoints, pointsForReport } = ctx.rewardsState;
@@ -3730,16 +2103,16 @@ function renderSuccessRewards(ctx) {
3730
2103
  nextLabel = remaining > 0 ? `${remaining.toLocaleString()} pts to ${escapeHtml(nextTier.displayName)}` : `\u{1F389} ${escapeHtml(nextTier.displayName)} reached!`;
3731
2104
  }
3732
2105
  return `
3733
- <div class="mushi-success-rewards">
3734
- <div class="mushi-success-pts-award">+${pointsForReport} pts</div>
3735
- ${nextTier ? `
3736
- <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)}">
3737
- <div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pctAfter / 100}"></div>
3738
- </div>
3739
- <div class="mushi-rewards-next-label">${nextLabel}</div>
3740
- ` : ""}
3741
- </div>
3742
- `;
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
+ `;
3743
2116
  }
3744
2117
 
3745
2118
  // src/widget.ts
@@ -3836,6 +2209,8 @@ var MushiWidget = class _MushiWidget {
3836
2209
  screenshotAttached = false;
3837
2210
  screenshotCapturing = false;
3838
2211
  screenshotError = false;
2212
+ /** Why the last capture failed; drives the actionable hint under the tools. */
2213
+ screenshotErrorReason = null;
3839
2214
  allowScreenshotRemove = true;
3840
2215
  /**
3841
2216
  * Whether the screenshot / element-select tools are actually usable
@@ -3882,8 +2257,20 @@ var MushiWidget = class _MushiWidget {
3882
2257
  featureBoard = [];
3883
2258
  reporterComments = [];
3884
2259
  selectedReportId = null;
3885
- 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. */
3886
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;
3887
2274
  attachedLaunchers = [];
3888
2275
  smartHideCleanup = null;
3889
2276
  smartHideTimer = null;
@@ -3891,12 +2278,25 @@ var MushiWidget = class _MushiWidget {
3891
2278
  * ("REPORT · 14:23:07 JST") doesn't drift while the success step
3892
2279
  * is on screen. */
3893
2280
  submittedAt = null;
3894
- /** Pending success-state + auto-close timers. Tracked so destroy()
3895
- * can clear them — otherwise a host that unmounts mid-submit leaks
3896
- * this MushiWidget reference (and re-renders into a detached shadow
3897
- * 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). */
3898
2284
  successTimer = null;
3899
- 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
+ };
3900
2300
  rewardsState = null;
3901
2301
  leaderboardEntries = null;
3902
2302
  leaderboardLoading = false;
@@ -3954,6 +2354,8 @@ var MushiWidget = class _MushiWidget {
3954
2354
  if (this.host.isConnected) return;
3955
2355
  this.syncHostChromeState();
3956
2356
  document.body.appendChild(this.host);
2357
+ window.addEventListener("pointerup", this.onPointerRelease, true);
2358
+ window.addEventListener("pointercancel", this.onPointerRelease, true);
3957
2359
  this.syncAttachedLaunchers();
3958
2360
  this.syncSmartHide();
3959
2361
  this.bindColorSchemeListener();
@@ -4048,6 +2450,7 @@ var MushiWidget = class _MushiWidget {
4048
2450
  this.screenshotAttached = false;
4049
2451
  this.screenshotCapturing = false;
4050
2452
  this.screenshotError = false;
2453
+ this.screenshotErrorReason = null;
4051
2454
  this.screenshotPreview = null;
4052
2455
  this.elementSelected = false;
4053
2456
  this.elementCapturing = false;
@@ -4229,7 +2632,10 @@ var MushiWidget = class _MushiWidget {
4229
2632
  setScreenshotAttached(attached) {
4230
2633
  this.screenshotAttached = attached;
4231
2634
  this.screenshotCapturing = false;
4232
- if (attached) this.screenshotError = false;
2635
+ if (attached) {
2636
+ this.screenshotError = false;
2637
+ this.screenshotErrorReason = null;
2638
+ }
4233
2639
  if (!attached) this.screenshotPreview = null;
4234
2640
  if (this.isOpen) this.render();
4235
2641
  }
@@ -4280,10 +2686,17 @@ var MushiWidget = class _MushiWidget {
4280
2686
  setScreenshotCapturing(capturing) {
4281
2687
  this.screenshotCapturing = capturing;
4282
2688
  this.screenshotError = false;
2689
+ this.screenshotErrorReason = null;
4283
2690
  if (this.isOpen) this.render();
4284
2691
  }
4285
- 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) {
4286
2698
  this.screenshotError = failed;
2699
+ this.screenshotErrorReason = failed ? reason ?? this.screenshotErrorReason ?? "error" : null;
4287
2700
  this.screenshotCapturing = false;
4288
2701
  if (this.isOpen) this.render();
4289
2702
  }
@@ -4425,14 +2838,12 @@ var MushiWidget = class _MushiWidget {
4425
2838
  if (this.isOpen && (this.step === "account" || this.step === "leaderboard")) this.render();
4426
2839
  }
4427
2840
  destroy() {
2841
+ window.removeEventListener("pointerup", this.onPointerRelease, true);
2842
+ window.removeEventListener("pointercancel", this.onPointerRelease, true);
4428
2843
  if (this.successTimer !== null) {
4429
2844
  clearTimeout(this.successTimer);
4430
2845
  this.successTimer = null;
4431
2846
  }
4432
- if (this.autoCloseTimer !== null) {
4433
- clearTimeout(this.autoCloseTimer);
4434
- this.autoCloseTimer = null;
4435
- }
4436
2847
  if (this.smartHideTimer !== null) {
4437
2848
  clearTimeout(this.smartHideTimer);
4438
2849
  this.smartHideTimer = null;
@@ -4860,6 +3271,14 @@ var MushiWidget = class _MushiWidget {
4860
3271
  this.draftSelEnd = 0;
4861
3272
  }
4862
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;
4863
3282
  const theme = this.getTheme();
4864
3283
  const pos = this.config.position;
4865
3284
  const t = this.locale;
@@ -4939,6 +3358,9 @@ var MushiWidget = class _MushiWidget {
4939
3358
  const ctx = this.renderCtx();
4940
3359
  panel.innerHTML = `${renderOutdatedBanner(ctx)}${renderStep(ctx)}${renderBrandFooter(ctx)}`;
4941
3360
  this.shadow.appendChild(panel);
3361
+ panel.addEventListener("pointerdown", () => {
3362
+ this.pointerDownAt = Date.now();
3363
+ });
4942
3364
  this.attachHandlers(panel);
4943
3365
  if (!this.brandImpressionSent && this.config.brandFooter === true) {
4944
3366
  this.brandImpressionSent = true;
@@ -5201,6 +3623,18 @@ var MushiWidget = class _MushiWidget {
5201
3623
  this.vvCleanup?.();
5202
3624
  this.vvCleanup = null;
5203
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
+ }
5204
3638
  /**
5205
3639
  * Minimum description length, lowered for CJK locales where each character
5206
3640
  * carries more meaning. Used by both the view layer (via renderCtx) and the
@@ -5227,7 +3661,11 @@ var MushiWidget = class _MushiWidget {
5227
3661
  config: this.config,
5228
3662
  rewardsState: this.rewardsState,
5229
3663
  lastReportId: this.lastReportId,
5230
- reporterLoading: this.reporterLoading,
3664
+ listLoading: this.listLoading,
3665
+ threadLoading: this.threadLoading,
3666
+ actionPending: this.actionPending,
3667
+ threadError: this.threadError,
3668
+ actionError: this.actionError,
5231
3669
  locale: this.locale,
5232
3670
  identifiedUser: this.identifiedUser,
5233
3671
  testerReputation: this.testerReputation,
@@ -5244,6 +3682,8 @@ var MushiWidget = class _MushiWidget {
5244
3682
  submitting: this.submitting,
5245
3683
  sdkFreshness: this.sdkFreshness,
5246
3684
  screenshotError: this.screenshotError,
3685
+ screenshotErrorReason: this.screenshotErrorReason,
3686
+ detailMode: this.detailMode(),
5247
3687
  reporterReports: this.reporterReports,
5248
3688
  magicLinkSending: this.magicLinkSending,
5249
3689
  magicLinkEmail: this.magicLinkEmail,
@@ -5320,11 +3760,6 @@ var MushiWidget = class _MushiWidget {
5320
3760
  this.step = "category";
5321
3761
  } else if (this.step === "cross-app-reports") {
5322
3762
  this.step = "account";
5323
- } else if (this.step === "success") {
5324
- this.step = "category";
5325
- this.selectedCategory = null;
5326
- this.selectedIntent = null;
5327
- this.viaFeatureRequest = false;
5328
3763
  }
5329
3764
  if (this.step === "category") {
5330
3765
  this.showAllCategories = false;
@@ -5452,6 +3887,9 @@ var MushiWidget = class _MushiWidget {
5452
3887
  this.callbacks.onTesterSignOut?.();
5453
3888
  this.render();
5454
3889
  });
3890
+ panel.querySelector('[data-action="retry-thread"]')?.addEventListener("click", () => {
3891
+ if (this.selectedReportId) void this.loadReporterComments(this.selectedReportId);
3892
+ });
5455
3893
  panel.querySelector('[data-action="reporter-reply"]')?.addEventListener("click", () => {
5456
3894
  void this.submitReporterReply(panel);
5457
3895
  });
@@ -5461,9 +3899,10 @@ var MushiWidget = class _MushiWidget {
5461
3899
  panel.querySelector('[data-action="reporter-not-fixed"]')?.addEventListener("click", () => {
5462
3900
  void this.submitReporterReopen();
5463
3901
  });
5464
- panel.querySelector('[data-action="view-my-reports"]')?.addEventListener("click", () => {
5465
- void this.loadReporterReports();
3902
+ panel.querySelector('[data-action="track-report"]')?.addEventListener("click", () => {
3903
+ if (this.lastReportId) void this.openTrackedReport(this.lastReportId);
5466
3904
  });
3905
+ panel.querySelector('[data-action="done"]')?.addEventListener("click", () => this.close());
5467
3906
  panel.querySelector('[data-action="copy-report-id"]')?.addEventListener("click", (e) => {
5468
3907
  const btn = e.currentTarget;
5469
3908
  const id = btn.dataset.copyId;
@@ -5502,18 +3941,13 @@ var MushiWidget = class _MushiWidget {
5502
3941
  });
5503
3942
  });
5504
3943
  const textarea = panel.querySelector(".mushi-textarea");
5505
- const charCurrentEl = panel.querySelector('[data-role="char-current"]');
5506
- if (textarea && charCurrentEl) {
3944
+ const counterEl = panel.querySelector('[data-role="char-counter"]');
3945
+ if (textarea && counterEl) {
5507
3946
  const minLen = this.effectiveMinLength();
5508
- const updateCounter = () => {
5509
- const len = textarea.value.trim().length;
5510
- charCurrentEl.textContent = String(len);
5511
- const counterEl = panel.querySelector('[data-role="char-counter"]');
5512
- if (counterEl) {
5513
- counterEl.style.color = len >= minLen ? "var(--mushi-ok, #22c55e)" : "";
5514
- }
5515
- };
5516
- 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
+ });
5517
3951
  }
5518
3952
  panel.querySelectorAll("[data-example]").forEach((chip) => {
5519
3953
  chip.addEventListener("click", () => {
@@ -5528,6 +3962,9 @@ var MushiWidget = class _MushiWidget {
5528
3962
  panel.querySelector('[data-action="screenshot"]')?.addEventListener("click", () => {
5529
3963
  this.callbacks.onScreenshotRequest();
5530
3964
  });
3965
+ panel.querySelector('[data-action="screenshot-share-tab"]')?.addEventListener("click", () => {
3966
+ this.callbacks.onScreenshotShareTabRequest?.();
3967
+ });
5531
3968
  panel.querySelector('[data-action="remove-screenshot"]')?.addEventListener("click", () => {
5532
3969
  this.callbacks.onScreenshotRemove?.();
5533
3970
  });
@@ -5547,7 +3984,7 @@ var MushiWidget = class _MushiWidget {
5547
3984
  const minLen = this.effectiveMinLength();
5548
3985
  if (description.length < minLen) {
5549
3986
  if (errorEl) {
5550
- const msg = `${t.step3.tooShort} (${description.length}/${minLen})`;
3987
+ const msg = `${t.step3.tooShort} (${charCounterText(description, minLen, t.step3.charsNeeded)})`;
5551
3988
  errorEl.textContent = msg;
5552
3989
  errorEl.style.display = "block";
5553
3990
  textarea2?.focus();
@@ -5566,9 +4003,10 @@ var MushiWidget = class _MushiWidget {
5566
4003
  const catId = this.selectedCategory;
5567
4004
  const baseCategory = this.resolveBaseCategory(catId);
5568
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;
5569
4007
  const ret = this.callbacks.onSubmit({
5570
4008
  category: baseCategory,
5571
- ...isCustomCat ? { userCategory: catId } : {},
4009
+ ...userCategory ? { userCategory } : {},
5572
4010
  description,
5573
4011
  intent: this.selectedIntent ?? void 0
5574
4012
  });
@@ -5588,22 +4026,12 @@ var MushiWidget = class _MushiWidget {
5588
4026
  this.render();
5589
4027
  this.draftDescription = "";
5590
4028
  void outcomeP.then((outcome) => {
5591
- if (this.step !== "success") return;
5592
- if (outcome) {
5593
- this.lastReportId = outcome.reportId ?? null;
5594
- this.lastSubmitQueuedOffline = Boolean(outcome.queuedOffline);
5595
- this.lastSubmitFailureKind = outcome.failureKind;
5596
- this.lastSubmitScreenshotDropped = Boolean(outcome.screenshotDropped);
5597
- this.render();
5598
- }
5599
- if (this.autoCloseTimer !== null) {
5600
- clearTimeout(this.autoCloseTimer);
5601
- }
5602
- const closeDelayMs = this.lastReportId && this.config.dashboardUrl ? 6e3 : 2800;
5603
- this.autoCloseTimer = setTimeout(() => {
5604
- this.autoCloseTimer = null;
5605
- if (this.step === "success") this.close();
5606
- }, 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();
5607
4035
  });
5608
4036
  }, 500);
5609
4037
  };
@@ -5635,7 +4063,7 @@ var MushiWidget = class _MushiWidget {
5635
4063
  }
5636
4064
  async loadFeatureBoard() {
5637
4065
  this.step = "roadmap";
5638
- this.reporterLoading = true;
4066
+ this.listLoading = true;
5639
4067
  this.reporterError = null;
5640
4068
  this.render();
5641
4069
  try {
@@ -5643,13 +4071,13 @@ var MushiWidget = class _MushiWidget {
5643
4071
  } catch (err) {
5644
4072
  this.reporterError = err instanceof Error ? err.message : "Could not load community ideas.";
5645
4073
  } finally {
5646
- this.reporterLoading = false;
4074
+ this.listLoading = false;
5647
4075
  this.render();
5648
4076
  }
5649
4077
  }
5650
4078
  async voteFeatureBoard(requestId) {
5651
- if (!this.callbacks.onFeatureBoardVote || this.reporterLoading) return;
5652
- this.reporterLoading = true;
4079
+ if (!this.callbacks.onFeatureBoardVote || this.actionPending) return;
4080
+ this.actionPending = true;
5653
4081
  this.render();
5654
4082
  try {
5655
4083
  await this.callbacks.onFeatureBoardVote(requestId);
@@ -5657,33 +4085,48 @@ var MushiWidget = class _MushiWidget {
5657
4085
  } catch (err) {
5658
4086
  this.reporterError = err instanceof Error ? err.message : "Could not update vote.";
5659
4087
  } finally {
5660
- this.reporterLoading = false;
4088
+ this.actionPending = false;
5661
4089
  this.render();
5662
4090
  }
5663
4091
  }
5664
- 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) {
5665
4098
  const reportId = this.selectedReportId;
5666
- if (!reportId || this.reporterLoading) return;
5667
- this.reporterLoading = true;
4099
+ if (!reportId || this.actionPending) return false;
4100
+ this.actionPending = true;
4101
+ this.actionError = null;
5668
4102
  this.render();
5669
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) => {
5670
4118
  if (this.callbacks.onReporterReopen) {
5671
4119
  await this.callbacks.onReporterReopen(reportId, "Not fixed for me");
5672
4120
  } else {
5673
4121
  await this.callbacks.onReporterFeedback?.(reportId, "not_fixed", "Not fixed for me");
5674
4122
  }
5675
- await this.loadReporterReports();
5676
- } catch (err) {
5677
- this.reporterError = err instanceof Error ? err.message : "Could not reopen report.";
5678
- } finally {
5679
- this.reporterLoading = false;
5680
- this.render();
5681
- }
4123
+ });
5682
4124
  }
5683
4125
  /** Refresh My Reports data for unread badges without opening the inbox panel. */
5684
4126
  async refreshReporterInboxQuiet() {
5685
4127
  try {
5686
- this.reporterReports = await this.callbacks.onReporterReportsRequest?.() ?? [];
4128
+ const req = this.callbacks.onReporterReportsRequest?.();
4129
+ this.reporterReports = req ? await withDeadline(req, REPORTER_READ_DEADLINE_MS) : [];
5687
4130
  if (!this.isOpen) return;
5688
4131
  if (this.step === "reports") {
5689
4132
  this.render();
@@ -5703,70 +4146,68 @@ var MushiWidget = class _MushiWidget {
5703
4146
  }
5704
4147
  async loadReporterReports() {
5705
4148
  this.step = "reports";
5706
- this.reporterLoading = true;
4149
+ this.listLoading = true;
5707
4150
  this.reporterError = null;
5708
4151
  this.render();
5709
4152
  try {
5710
- this.reporterReports = await this.callbacks.onReporterReportsRequest?.() ?? [];
4153
+ const req = this.callbacks.onReporterReportsRequest?.();
4154
+ this.reporterReports = req ? await withDeadline(req, REPORTER_READ_DEADLINE_MS) : [];
5711
4155
  } catch (err) {
5712
4156
  this.reporterError = err instanceof Error ? err.message : "Could not load reports.";
5713
4157
  } finally {
5714
- this.reporterLoading = false;
4158
+ this.listLoading = false;
5715
4159
  this.render();
5716
4160
  }
5717
4161
  }
5718
- 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) {
5719
4173
  if (this.selectedReportId !== reportId) {
5720
4174
  this.draftReply = "";
4175
+ this.reporterComments = [];
4176
+ this.actionError = null;
4177
+ quiet = false;
5721
4178
  }
5722
4179
  this.selectedReportId = reportId;
5723
4180
  this.step = "report-detail";
5724
- this.reporterLoading = true;
5725
- this.reporterError = null;
5726
- this.render();
4181
+ this.threadError = null;
4182
+ if (!quiet) {
4183
+ this.threadLoading = true;
4184
+ this.render();
4185
+ }
5727
4186
  try {
5728
- this.reporterComments = await this.callbacks.onReporterCommentsRequest?.(reportId) ?? [];
5729
- } catch (err) {
5730
- 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;
5731
4192
  } finally {
5732
- this.reporterLoading = false;
4193
+ this.threadLoading = false;
5733
4194
  this.render();
5734
4195
  }
5735
4196
  }
5736
4197
  async submitReporterFeedback(signal) {
5737
- const reportId = this.selectedReportId;
5738
- if (!reportId || this.reporterLoading) return;
5739
- this.reporterLoading = true;
5740
- this.render();
5741
- try {
5742
- await this.callbacks.onReporterFeedback?.(reportId, signal);
5743
- await this.loadReporterReports();
5744
- if (reportId) await this.loadReporterComments(reportId);
5745
- } catch (err) {
5746
- this.reporterError = err instanceof Error ? err.message : "Could not send feedback.";
5747
- this.reporterLoading = false;
5748
- this.render();
5749
- }
4198
+ await this.runThreadAction("Could not send feedback.", (reportId) => Promise.resolve(this.callbacks.onReporterFeedback?.(reportId, signal)));
5750
4199
  }
5751
4200
  async submitReporterReply(panel) {
5752
- const reportId = this.selectedReportId;
5753
4201
  const textarea = panel.querySelector('[data-role="reporter-reply"]');
5754
- const replyButton = panel.querySelector('[data-action="reporter-reply"]');
5755
4202
  const body = textarea?.value.trim() ?? "";
5756
- if (!reportId || !body || this.reporterLoading) return;
5757
- this.reporterLoading = true;
5758
- if (replyButton) replyButton.disabled = true;
5759
- this.render();
5760
- try {
4203
+ if (!body) return;
4204
+ this.draftReply = textarea?.value ?? "";
4205
+ await this.runThreadAction("Could not send reply.", async (reportId) => {
5761
4206
  await this.callbacks.onReporterReply?.(reportId, body);
5762
- if (textarea) textarea.value = "";
5763
4207
  this.draftReply = "";
5764
- await this.loadReporterComments(reportId);
5765
- } catch (err) {
5766
- this.reporterError = err instanceof Error ? err.message : "Could not send reply.";
5767
- this.reporterLoading = false;
5768
- this.render();
5769
- }
4208
+ const live = this.shadow.querySelector('[data-role="reporter-reply"]');
4209
+ if (live) live.value = "";
4210
+ });
5770
4211
  }
5771
4212
  /* ── Community: magic-link sign-in ───────────────────────────────── */
5772
4213
  async handleMagicLinkSend(panel) {
@@ -6765,7 +5206,11 @@ function createScreenshotCapture(options = {}) {
6765
5206
  if (typeof document === "undefined") return null;
6766
5207
  const canvas = document.createElement("canvas");
6767
5208
  const ctx = canvas.getContext("2d");
6768
- if (!ctx) return null;
5209
+ if (!ctx) {
5210
+ activeOptions.onFailed?.("unsupported");
5211
+ emitScreenshotFailed("unsupported");
5212
+ return null;
5213
+ }
6769
5214
  const width = window.innerWidth;
6770
5215
  const height = window.innerHeight;
6771
5216
  const dpr = Math.min(window.devicePixelRatio || 1, 2);
@@ -6783,27 +5228,32 @@ function createScreenshotCapture(options = {}) {
6783
5228
  </svg>
6784
5229
  `;
6785
5230
  const img = new Image();
6786
- const blob = new Blob([svgData], { type: "image/svg+xml;charset=utf-8" });
6787
- 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);
6788
5238
  return new Promise((resolve) => {
6789
5239
  let settled = false;
6790
5240
  const settle = (value, reason) => {
6791
5241
  if (settled) return;
6792
5242
  settled = true;
6793
5243
  clearTimeout(timer);
6794
- URL.revokeObjectURL(url);
5244
+ document.removeEventListener("securitypolicyviolation", onViolation);
6795
5245
  if (reason) {
6796
5246
  activeOptions.onFailed?.(reason);
6797
5247
  emitScreenshotFailed(reason);
6798
5248
  }
6799
5249
  resolve(value);
6800
5250
  };
6801
- const timer = setTimeout(() => settle(null, "error"), 5e3);
5251
+ const timer = setTimeout(() => settle(null, "timeout"), 5e3);
6802
5252
  img.onload = () => {
6803
5253
  try {
6804
5254
  ctx.drawImage(img, 0, 0, width, height);
6805
5255
  if (isCanvasBlank(ctx, width, height)) {
6806
- settle(null, "error");
5256
+ settle(null, "unsupported");
6807
5257
  return;
6808
5258
  }
6809
5259
  settle(canvas.toDataURL("image/jpeg", 0.7));
@@ -6811,7 +5261,7 @@ function createScreenshotCapture(options = {}) {
6811
5261
  settle(null, "taint");
6812
5262
  }
6813
5263
  };
6814
- img.onerror = () => settle(null, "error");
5264
+ img.onerror = () => setTimeout(() => settle(null, cspBlocked ? "csp" : "error"), 0);
6815
5265
  img.src = url;
6816
5266
  });
6817
5267
  } catch {
@@ -6833,16 +5283,17 @@ function emitScreenshotFailed(reason) {
6833
5283
  } catch {
6834
5284
  }
6835
5285
  }
6836
- var DEFAULT_REDACT_SELECTORS = [
6837
- 'input[type="password"]',
6838
- "[data-mushi-redact]"
6839
- ];
5286
+ var ALWAYS_REDACT_SELECTORS = 'input[type="password"],input[autocomplete^="cc-"],[data-private],[data-mushi-mask]';
5287
+ var DEFAULT_REDACT_SELECTORS = ["[data-mushi-redact]"];
6840
5288
  function buildPrivacySafeDocument(privacy) {
6841
5289
  const clone = document.documentElement.cloneNode(true);
6842
5290
  clone.querySelector("#mushi-mushi-widget")?.remove();
6843
5291
  stripTaintSources(clone);
6844
5292
  inlineDocumentStyles(clone);
6845
- 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
+ ];
6846
5297
  for (const selector of redactSelectors) {
6847
5298
  for (const el of safeQueryAll(clone, selector)) {
6848
5299
  redactElement(el);
@@ -7718,135 +6169,6 @@ async function createReplayCapture(opts) {
7718
6169
  };
7719
6170
  }
7720
6171
 
7721
- // src/capture/screenshot-annotation.ts
7722
- function createScreenshotAnnotation(imageDataUrl, container) {
7723
- return new Promise((resolve, reject) => {
7724
- const img = new Image();
7725
- img.onload = () => {
7726
- const wrap = document.createElement("div");
7727
- wrap.style.position = "relative";
7728
- wrap.style.display = "inline-block";
7729
- wrap.style.maxWidth = "100%";
7730
- const base = document.createElement("canvas");
7731
- const overlay = document.createElement("canvas");
7732
- const scale = Math.min(1, 720 / img.width);
7733
- const w = Math.round(img.width * scale);
7734
- const h = Math.round(img.height * scale);
7735
- for (const c of [base, overlay]) {
7736
- c.width = w;
7737
- c.height = h;
7738
- c.style.width = "100%";
7739
- c.style.height = "auto";
7740
- c.style.display = "block";
7741
- }
7742
- overlay.style.position = "absolute";
7743
- overlay.style.left = "0";
7744
- overlay.style.top = "0";
7745
- overlay.style.cursor = "crosshair";
7746
- const bctx = base.getContext("2d");
7747
- const octx = overlay.getContext("2d");
7748
- if (!bctx || !octx) {
7749
- reject(new Error("Canvas not supported"));
7750
- return;
7751
- }
7752
- bctx.drawImage(img, 0, 0, w, h);
7753
- wrap.appendChild(base);
7754
- wrap.appendChild(overlay);
7755
- container.appendChild(wrap);
7756
- let tool = "highlight";
7757
- let drawing = false;
7758
- let start = null;
7759
- const strokes = [];
7760
- const toLocal = (ev) => {
7761
- const rect = overlay.getBoundingClientRect();
7762
- const touch = "touches" in ev ? ev.touches[0] ?? ev.changedTouches[0] : null;
7763
- const clientX = touch ? touch.clientX : ev.clientX;
7764
- const clientY = touch ? touch.clientY : ev.clientY;
7765
- return {
7766
- x: (clientX - rect.left) / rect.width * w,
7767
- y: (clientY - rect.top) / rect.height * h
7768
- };
7769
- };
7770
- const redraw = () => {
7771
- octx.clearRect(0, 0, w, h);
7772
- for (const s of strokes) {
7773
- if (s.tool === "highlight" && s.points.length >= 2) {
7774
- const [a, b] = s.points;
7775
- octx.fillStyle = "rgba(255, 230, 0, 0.35)";
7776
- octx.fillRect(
7777
- Math.min(a.x, b.x),
7778
- Math.min(a.y, b.y),
7779
- Math.abs(b.x - a.x),
7780
- Math.abs(b.y - a.y)
7781
- );
7782
- } else if (s.tool === "arrow" && s.points.length >= 2) {
7783
- const [a, b] = s.points;
7784
- octx.strokeStyle = "#ef4444";
7785
- octx.lineWidth = 3;
7786
- octx.beginPath();
7787
- octx.moveTo(a.x, a.y);
7788
- octx.lineTo(b.x, b.y);
7789
- octx.stroke();
7790
- }
7791
- }
7792
- };
7793
- const onDown = (ev) => {
7794
- drawing = true;
7795
- start = toLocal(ev);
7796
- };
7797
- const onUp = (ev) => {
7798
- if (!drawing || !start) return;
7799
- drawing = false;
7800
- const end = toLocal(ev);
7801
- if (tool === "blur") {
7802
- const x = Math.min(start.x, end.x);
7803
- const y = Math.min(start.y, end.y);
7804
- const bw = Math.abs(end.x - start.x);
7805
- const bh = Math.abs(end.y - start.y);
7806
- if (bw >= 1 && bh >= 1) {
7807
- bctx.filter = "blur(8px)";
7808
- bctx.drawImage(base, x, y, bw, bh, x, y, bw, bh);
7809
- bctx.filter = "none";
7810
- }
7811
- } else {
7812
- strokes.push({ tool, points: [start, end] });
7813
- }
7814
- start = null;
7815
- redraw();
7816
- };
7817
- overlay.addEventListener("mousedown", onDown);
7818
- overlay.addEventListener("mouseup", onUp);
7819
- overlay.addEventListener("touchstart", onDown, { passive: true });
7820
- overlay.addEventListener("touchend", onUp);
7821
- resolve({
7822
- canvas: base,
7823
- setTool(t) {
7824
- tool = t;
7825
- },
7826
- getDataUrl() {
7827
- const out = document.createElement("canvas");
7828
- out.width = w;
7829
- out.height = h;
7830
- const ctx = out.getContext("2d");
7831
- if (!ctx) return imageDataUrl;
7832
- ctx.drawImage(base, 0, 0);
7833
- ctx.drawImage(overlay, 0, 0);
7834
- return out.toDataURL("image/jpeg", 0.85);
7835
- },
7836
- destroy() {
7837
- overlay.removeEventListener("mousedown", onDown);
7838
- overlay.removeEventListener("mouseup", onUp);
7839
- overlay.removeEventListener("touchstart", onDown);
7840
- overlay.removeEventListener("touchend", onUp);
7841
- wrap.remove();
7842
- }
7843
- });
7844
- };
7845
- img.onerror = () => reject(new Error("Failed to load screenshot"));
7846
- img.src = imageDataUrl;
7847
- });
7848
- }
7849
-
7850
6172
  // src/sentry.ts
7851
6173
  function getSentryGlobal() {
7852
6174
  try {
@@ -8540,7 +6862,7 @@ function createInstance(config) {
8540
6862
  privacy: activeConfig.privacy,
8541
6863
  // Surface capture failures (canvas taint, CSP) in the widget UI —
8542
6864
  // an invisible failure looks identical to a broken button.
8543
- onFailed: () => widget.setScreenshotError(true)
6865
+ onFailed: (reason) => widget.setScreenshotError(true, reason)
8544
6866
  };
8545
6867
  if (activeConfig.capture?.screenshotProvider) {
8546
6868
  screenshotCap = null;
@@ -8650,6 +6972,7 @@ function createInstance(config) {
8650
6972
  let detachAutoBreadcrumbs = null;
8651
6973
  detachAutoBreadcrumbs = installAutoBreadcrumbs(breadcrumbs);
8652
6974
  let screenshotCaptureInFlight = false;
6975
+ let screenshotProviderDenied = false;
8653
6976
  function syncReporterInboxQuiet() {
8654
6977
  void widget.refreshReporterInboxQuiet();
8655
6978
  }
@@ -8705,6 +7028,7 @@ function createInstance(config) {
8705
7028
  }
8706
7029
  async function takeScreenshotWithoutChrome() {
8707
7030
  if (screenshotCaptureInFlight) return null;
7031
+ screenshotProviderDenied = false;
8708
7032
  const provider = activeConfig.capture?.screenshotProvider;
8709
7033
  if (provider) {
8710
7034
  screenshotCaptureInFlight = true;
@@ -8715,6 +7039,7 @@ function createInstance(config) {
8715
7039
  log.warn("screenshotProvider threw, falling back to built-in capturer", {
8716
7040
  error: err instanceof Error ? err.message : String(err)
8717
7041
  });
7042
+ screenshotProviderDenied = err instanceof Error && (err.name === "NotAllowedError" || err.name === "SecurityError" || /permission|denied/i.test(err.message));
8718
7043
  } finally {
8719
7044
  screenshotCaptureInFlight = false;
8720
7045
  }
@@ -8790,9 +7115,10 @@ function createInstance(config) {
8790
7115
  const hasCapture = !!screenshotCap || !!activeConfig.capture?.screenshotProvider;
8791
7116
  if (!hasCapture || activeConfig.capture?.screenshot === "off") {
8792
7117
  log.warn("Screenshot requested but capture is disabled");
8793
- widget.setScreenshotError(true);
7118
+ widget.setScreenshotError(true, "unsupported");
8794
7119
  return;
8795
7120
  }
7121
+ if (screenshotCaptureInFlight) return;
8796
7122
  log.debug("Taking screenshot");
8797
7123
  widget.setScreenshotCapturing(true);
8798
7124
  try {
@@ -8805,8 +7131,45 @@ function createInstance(config) {
8805
7131
  }
8806
7132
  widget.setScreenshotAttached(pendingScreenshot !== null);
8807
7133
  widget.setScreenshotPreview(pendingScreenshot);
8808
- if (pendingScreenshot === null) widget.setScreenshotError(true);
8809
- },
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,
8810
7173
  onScreenshotRemove: () => {
8811
7174
  log.debug("Screenshot attachment removed");
8812
7175
  pendingScreenshot = null;
@@ -8817,6 +7180,7 @@ function createInstance(config) {
8817
7180
  if (container.childElementCount > 0) return;
8818
7181
  let session;
8819
7182
  try {
7183
+ const { createScreenshotAnnotation } = await import('./chunks/screenshot-annotation-IG7C5B6Z.js');
8820
7184
  session = await createScreenshotAnnotation(pendingScreenshot, container);
8821
7185
  } catch (err) {
8822
7186
  log.warn("Screenshot annotation failed", {
@@ -9119,7 +7483,11 @@ function createInstance(config) {
9119
7483
  deprecated: info.deprecated,
9120
7484
  message
9121
7485
  });
9122
- 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
+ )) {
9123
7491
  widget.setSdkFreshness({
9124
7492
  latest,
9125
7493
  current: MUSHI_SDK_VERSION,