@mushi-mushi/web 1.25.0 → 1.27.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/README.md +2 -2
- package/SECURITY.md +49 -0
- package/dist/headless.cjs +1206 -0
- package/dist/headless.cjs.map +1 -0
- package/dist/headless.d.cts +88 -0
- package/dist/headless.d.ts +88 -0
- package/dist/headless.js +1194 -0
- package/dist/headless.js.map +1 -0
- package/dist/i18n/index.cjs +40 -0
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +12 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/i18n/index.js +40 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +593 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -62
- package/dist/index.d.ts +53 -62
- package/dist/index.js +594 -150
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +333 -282
- package/dist/mushi.loader.global.js.map +1 -1
- package/dist/otel.cjs +60 -0
- package/dist/otel.cjs.map +1 -0
- package/dist/otel.d.cts +80 -0
- package/dist/otel.d.ts +80 -0
- package/dist/otel.js +58 -0
- package/dist/otel.js.map +1 -0
- package/dist/timeline-BuqAn2FH.d.cts +63 -0
- package/dist/timeline-BuqAn2FH.d.ts +63 -0
- package/package.json +27 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT,
|
|
1
|
+
import { mushiPalette, resolveWidgetAccent, MUSHI_REPORTER_STATUS, MUSHI_GEOMETRY, MUSHI_Z, MUSHI_MOTION, MUSHI_TYPE, MUSHI_BANNER_BRAND_BORDER, MUSHI_BANNER_NEON, MUSHI_INVERSE, MUSHI_ON_ACCENT, MUSHI_ACCENT_SHADOW, MUSHI_TIER_COLORS, readPageFaviconHref, scrubUrl, resolveEnvConfig, diagnoseEnvConfig, validateConfig, expandPreset, createLogger, noopLogger, createApiClient, initSessionTracker, getReporterToken, createPreFilter, createOfflineQueue, createRateLimiter, createPiiScrubber, createBreadcrumbBuffer, getDeviceFingerprintHash, MAX_SCREENSHOT_DATA_URL_BYTES, captureEnvironment, getSessionId, newUuid, DEFAULT_API_ENDPOINT, MUSHI_DURATION, MUSHI_SPACING, MUSHI_RADIUS, isLikelyGenericFavicon, MUSHI_INTERNAL_INIT_MARKER, MUSHI_INTERNAL_HEADER, MUSHI_COLORS_LIGHT, parseIdentityToken, updateSessionIdentity, normaliseThrown, destroySessionTracker, resolveProjectDomain, projectInitials, projectFaviconUrlCandidates, sha256Hex } from '@mushi-mushi/core';
|
|
2
2
|
|
|
3
3
|
// src/capture/compress-screenshot.ts
|
|
4
4
|
async function compressScreenshotDataUrl(dataUrl, maxBytes = MAX_SCREENSHOT_DATA_URL_BYTES) {
|
|
@@ -116,6 +116,8 @@ var en = {
|
|
|
116
116
|
sendAriaLabel: "Send",
|
|
117
117
|
hubDescription: "Get help using this app",
|
|
118
118
|
thinking: "Thinking\u2026",
|
|
119
|
+
fileReportCta: "File a report instead",
|
|
120
|
+
stillStuckCta: "Still stuck? File a report",
|
|
119
121
|
errors: {
|
|
120
122
|
noResponse: "No response \u2014 check your connection and try again.",
|
|
121
123
|
generic: "Could not reach the assistant. Try again in a moment."
|
|
@@ -194,6 +196,14 @@ var en = {
|
|
|
194
196
|
delivering: "Delivering to the team\u2026",
|
|
195
197
|
queuedOffline: "Queued offline",
|
|
196
198
|
queuedHint: "We'll send it the moment you're back online.",
|
|
199
|
+
rateLimited: "Sending too fast",
|
|
200
|
+
rateLimitedHint: "Wait about a minute \u2014 we queued this report and will retry automatically.",
|
|
201
|
+
quotaBlocked: "Could not accept this report",
|
|
202
|
+
quotaBlockedHint: "This project's quota or plan blocked the send. Ask the app owner to check Billing.",
|
|
203
|
+
permanentFailed: "Could not send this report",
|
|
204
|
+
permanentFailedHint: "The payload was rejected (often too large). Try again with a shorter note or without a screenshot.",
|
|
205
|
+
retrying: "Queued \u2014 retrying",
|
|
206
|
+
retryingHint: "We could not reach the server just now. We'll keep trying in the background.",
|
|
197
207
|
trackOnMushi: "Track on Mushi",
|
|
198
208
|
slaDefault: "We will review your report.",
|
|
199
209
|
screenshotDropped: "Sent without the screenshot \u2014 it was too large to attach."
|
|
@@ -286,6 +296,8 @@ var ja = {
|
|
|
286
296
|
sendAriaLabel: "\u9001\u4FE1",
|
|
287
297
|
hubDescription: "\u3053\u306E\u30A2\u30D7\u30EA\u306E\u4F7F\u3044\u65B9\u3092\u805E\u304F",
|
|
288
298
|
thinking: "\u8003\u3048\u4E2D\u2026",
|
|
299
|
+
fileReportCta: "\u4EE3\u308F\u308A\u306B\u30D0\u30B0\u3092\u5831\u544A",
|
|
300
|
+
stillStuckCta: "\u89E3\u6C7A\u3057\u306A\u3044\u5834\u5408\u306F\u5831\u544A\u3059\u308B",
|
|
289
301
|
errors: {
|
|
290
302
|
noResponse: "\u5FDC\u7B54\u304C\u3042\u308A\u307E\u305B\u3093 \u2014 \u63A5\u7D9A\u3092\u78BA\u8A8D\u3057\u3066\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
291
303
|
generic: "\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
@@ -364,6 +376,14 @@ var ja = {
|
|
|
364
376
|
delivering: "\u30C1\u30FC\u30E0\u306B\u9001\u4FE1\u4E2D\u2026",
|
|
365
377
|
queuedOffline: "\u30AA\u30D5\u30E9\u30A4\u30F3\u5F85\u6A5F\u4E2D",
|
|
366
378
|
queuedHint: "\u30AA\u30F3\u30E9\u30A4\u30F3\u306B\u623B\u308A\u6B21\u7B2C\u9001\u4FE1\u3057\u307E\u3059\u3002",
|
|
379
|
+
rateLimited: "\u9001\u4FE1\u304C\u65E9\u3059\u304E\u307E\u3059",
|
|
380
|
+
rateLimitedHint: "\u7D041\u5206\u5F85\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u30EC\u30DD\u30FC\u30C8\u306F\u30AD\u30E5\u30FC\u306B\u5165\u308A\u3001\u81EA\u52D5\u3067\u518D\u9001\u3057\u307E\u3059\u3002",
|
|
381
|
+
quotaBlocked: "\u3053\u306E\u30EC\u30DD\u30FC\u30C8\u306F\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
382
|
+
quotaBlockedHint: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u67A0\u307E\u305F\u306F\u30D7\u30E9\u30F3\u3067\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002\u30A2\u30D7\u30EA\u7BA1\u7406\u8005\u306B Billing \u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
383
|
+
permanentFailed: "\u30EC\u30DD\u30FC\u30C8\u3092\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
384
|
+
permanentFailedHint: "\u30DA\u30A4\u30ED\u30FC\u30C9\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\uFF08\u30B5\u30A4\u30BA\u8D85\u904E\u306A\u3069\uFF09\u3002\u77ED\u3044\u6587\u9762\u304B\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306A\u3057\u3067\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
385
|
+
retrying: "\u30AD\u30E5\u30FC \u2014 \u518D\u8A66\u884C\u4E2D",
|
|
386
|
+
retryingHint: "\u3044\u307E\u30B5\u30FC\u30D0\u30FC\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u3067\u518D\u9001\u3057\u307E\u3059\u3002",
|
|
367
387
|
trackOnMushi: "Mushi\u3067\u8FFD\u8DE1",
|
|
368
388
|
slaDefault: "\u30EC\u30DD\u30FC\u30C8\u3092\u78BA\u8A8D\u3057\u307E\u3059\u3002",
|
|
369
389
|
screenshotDropped: "\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u306F\u30B5\u30A4\u30BA\u8D85\u904E\u306E\u305F\u3081\u6DFB\u4ED8\u3067\u304D\u305A\u3001\u30EC\u30DD\u30FC\u30C8\u306E\u307F\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002"
|
|
@@ -456,6 +476,8 @@ var th = {
|
|
|
456
476
|
sendAriaLabel: "\u0E2A\u0E48\u0E07",
|
|
457
477
|
hubDescription: "\u0E02\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E43\u0E19\u0E01\u0E32\u0E23\u0E43\u0E0A\u0E49\u0E41\u0E2D\u0E1B",
|
|
458
478
|
thinking: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E34\u0E14\u2026",
|
|
479
|
+
fileReportCta: "\u0E2A\u0E48\u0E07\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E41\u0E17\u0E19",
|
|
480
|
+
stillStuckCta: "\u0E22\u0E31\u0E07\u0E41\u0E01\u0E49\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49? \u0E2A\u0E48\u0E07\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19",
|
|
459
481
|
errors: {
|
|
460
482
|
noResponse: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A \u2014 \u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E01\u0E32\u0E23\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E41\u0E25\u0E49\u0E27\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
|
|
461
483
|
generic: "\u0E40\u0E0A\u0E37\u0E48\u0E2D\u0E21\u0E15\u0E48\u0E2D\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07\u0E43\u0E19\u0E2D\u0E35\u0E01\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48"
|
|
@@ -534,6 +556,14 @@ var th = {
|
|
|
534
556
|
delivering: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E17\u0E35\u0E21\u2026",
|
|
535
557
|
queuedOffline: "\u0E04\u0E34\u0E27\u0E2D\u0E2D\u0E1F\u0E44\u0E25\u0E19\u0E4C",
|
|
536
558
|
queuedHint: "\u0E08\u0E30\u0E2A\u0E48\u0E07\u0E17\u0E31\u0E19\u0E17\u0E35\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E01\u0E25\u0E31\u0E1A\u0E21\u0E32\u0E2D\u0E2D\u0E19\u0E44\u0E25\u0E19\u0E4C",
|
|
559
|
+
rateLimited: "\u0E2A\u0E48\u0E07\u0E16\u0E35\u0E48\u0E40\u0E01\u0E34\u0E19\u0E44\u0E1B",
|
|
560
|
+
rateLimitedHint: "\u0E23\u0E2D\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E19\u0E32\u0E17\u0E35 \u2014 \u0E40\u0E23\u0E32\u0E08\u0E31\u0E14\u0E04\u0E34\u0E27\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49\u0E44\u0E27\u0E49\u0E41\u0E25\u0E30\u0E08\u0E30\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E43\u0E2B\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",
|
|
561
|
+
quotaBlocked: "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E23\u0E31\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49\u0E44\u0E14\u0E49",
|
|
562
|
+
quotaBlockedHint: "\u0E42\u0E04\u0E27\u0E15\u0E49\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E41\u0E1E\u0E25\u0E19\u0E02\u0E2D\u0E07\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E1A\u0E25\u0E47\u0E2D\u0E01\u0E01\u0E32\u0E23\u0E2A\u0E48\u0E07 \u0E02\u0E2D\u0E43\u0E2B\u0E49\u0E40\u0E08\u0E49\u0E32\u0E02\u0E2D\u0E07\u0E41\u0E2D\u0E1B\u0E15\u0E23\u0E27\u0E08 Billing",
|
|
563
|
+
permanentFailed: "\u0E2A\u0E48\u0E07\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E19\u0E35\u0E49\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49",
|
|
564
|
+
permanentFailedHint: "\u0E40\u0E1E\u0E22\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E16\u0E39\u0E01\u0E1B\u0E0F\u0E34\u0E40\u0E2A\u0E18 (\u0E21\u0E31\u0E01\u0E40\u0E1E\u0E23\u0E32\u0E30\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19\u0E44\u0E1B) \u0E25\u0E2D\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E31\u0E49\u0E19\u0E25\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48\u0E41\u0E19\u0E1A\u0E20\u0E32\u0E1E\u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D",
|
|
565
|
+
retrying: "\u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E04\u0E34\u0E27 \u2014 \u0E01\u0E33\u0E25\u0E31\u0E07\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48",
|
|
566
|
+
retryingHint: "\u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E40\u0E0B\u0E34\u0E23\u0E4C\u0E1F\u0E40\u0E27\u0E2D\u0E23\u0E4C\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E40\u0E23\u0E32\u0E08\u0E30\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E43\u0E19\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07",
|
|
537
567
|
trackOnMushi: "\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E1A\u0E19 Mushi",
|
|
538
568
|
slaDefault: "\u0E40\u0E23\u0E32\u0E08\u0E30\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
|
|
539
569
|
screenshotDropped: "\u0E2A\u0E48\u0E07\u0E23\u0E32\u0E22\u0E07\u0E32\u0E19\u0E42\u0E14\u0E22\u0E44\u0E21\u0E48\u0E21\u0E35\u0E20\u0E32\u0E1E\u0E2B\u0E19\u0E49\u0E32\u0E08\u0E2D \u2014 \u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19\u0E01\u0E27\u0E48\u0E32\u0E08\u0E30\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49"
|
|
@@ -626,6 +656,8 @@ var es = {
|
|
|
626
656
|
sendAriaLabel: "Enviar",
|
|
627
657
|
hubDescription: "Obt\xE9n ayuda para usar esta app",
|
|
628
658
|
thinking: "Pensando\u2026",
|
|
659
|
+
fileReportCta: "Enviar un informe en su lugar",
|
|
660
|
+
stillStuckCta: "\xBFSigues atascado? Env\xEDa un informe",
|
|
629
661
|
errors: {
|
|
630
662
|
noResponse: "Sin respuesta \u2014 revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",
|
|
631
663
|
generic: "No se pudo contactar al asistente. Int\xE9ntalo en un momento."
|
|
@@ -704,6 +736,14 @@ var es = {
|
|
|
704
736
|
delivering: "Enviando al equipo\u2026",
|
|
705
737
|
queuedOffline: "En cola sin conexi\xF3n",
|
|
706
738
|
queuedHint: "Lo enviaremos en cuanto vuelvas a estar en l\xEDnea.",
|
|
739
|
+
rateLimited: "Demasiado r\xE1pido",
|
|
740
|
+
rateLimitedHint: "Espera un minuto \u2014 encolamos el reporte y lo reintentaremos autom\xE1ticamente.",
|
|
741
|
+
quotaBlocked: "No se pudo aceptar este reporte",
|
|
742
|
+
quotaBlockedHint: "La cuota o el plan del proyecto bloque\xF3 el env\xEDo. Pide al due\xF1o que revise Billing.",
|
|
743
|
+
permanentFailed: "No se pudo enviar este reporte",
|
|
744
|
+
permanentFailedHint: "El payload fue rechazado (a menudo por tama\xF1o). Intenta con un texto m\xE1s corto o sin captura.",
|
|
745
|
+
retrying: "En cola \u2014 reintentando",
|
|
746
|
+
retryingHint: "No pudimos llegar al servidor ahora. Seguiremos intentando en segundo plano.",
|
|
707
747
|
trackOnMushi: "Seguir en Mushi",
|
|
708
748
|
slaDefault: "Revisaremos tu reporte.",
|
|
709
749
|
screenshotDropped: "Enviado sin la captura de pantalla \u2014 era demasiado grande para adjuntarla."
|
|
@@ -727,6 +767,14 @@ function getLocale(code) {
|
|
|
727
767
|
function getAvailableLocales() {
|
|
728
768
|
return Object.keys(locales);
|
|
729
769
|
}
|
|
770
|
+
function hexToRgbTriplet(hex) {
|
|
771
|
+
const h = hex.replace("#", "");
|
|
772
|
+
const full = h.length === 3 ? h[0] + h[0] + h[1] + h[1] + h[2] + h[2] : h.slice(0, 6);
|
|
773
|
+
const r = parseInt(full.slice(0, 2), 16);
|
|
774
|
+
const g = parseInt(full.slice(2, 4), 16);
|
|
775
|
+
const b = parseInt(full.slice(4, 6), 16);
|
|
776
|
+
return `${r},${g},${b}`;
|
|
777
|
+
}
|
|
730
778
|
function getWidgetThemeVars(theme, accent = "", accentText = "") {
|
|
731
779
|
const isDark = theme === "dark";
|
|
732
780
|
const mode = isDark ? "dark" : "light";
|
|
@@ -747,6 +795,8 @@ function getWidgetThemeVars(theme, accent = "", accentText = "") {
|
|
|
747
795
|
widgetAccentWash: accentResolved.accentWash,
|
|
748
796
|
widgetAccentInk: accentResolved.accentInk,
|
|
749
797
|
widgetAccentShadow: isDark ? MUSHI_ACCENT_SHADOW.dark : MUSHI_ACCENT_SHADOW.light,
|
|
798
|
+
accentRgb: hexToRgbTriplet(accentResolved.accent),
|
|
799
|
+
shadowInk: isDark ? "0,0,0" : "14,13,11",
|
|
750
800
|
ok: pal.ok,
|
|
751
801
|
danger: pal.danger,
|
|
752
802
|
onAccent: MUSHI_ON_ACCENT,
|
|
@@ -806,6 +856,8 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
806
856
|
widgetAccentWash,
|
|
807
857
|
widgetAccentInk,
|
|
808
858
|
widgetAccentShadow,
|
|
859
|
+
accentRgb,
|
|
860
|
+
shadowInk,
|
|
809
861
|
ok,
|
|
810
862
|
danger,
|
|
811
863
|
onAccent,
|
|
@@ -826,12 +878,31 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
826
878
|
zBanner,
|
|
827
879
|
fabSize
|
|
828
880
|
} = v;
|
|
829
|
-
const { sizeBody, lineBody } = MUSHI_TYPE;
|
|
881
|
+
const { sizeBody, sizeLabel, lineBody } = MUSHI_TYPE;
|
|
830
882
|
const { durationFast } = MUSHI_MOTION;
|
|
883
|
+
const {
|
|
884
|
+
instant: durInstant,
|
|
885
|
+
fast: durFast,
|
|
886
|
+
base: durBase,
|
|
887
|
+
panel: durPanel,
|
|
888
|
+
slow: durSlow,
|
|
889
|
+
ring: durRing
|
|
890
|
+
} = MUSHI_DURATION;
|
|
831
891
|
const { bannerHeight, gutter, panelWidth, panelMaxHeight, panelSheetBreakpoint, edgeTabWidth } = MUSHI_GEOMETRY;
|
|
832
|
-
const panelLauncherGap = fabSize +
|
|
892
|
+
const panelLauncherGap = fabSize + MUSHI_SPACING.comfy;
|
|
833
893
|
const { base: zBase } = MUSHI_Z;
|
|
834
894
|
const controlRadius = MUSHI_RADIUS.control;
|
|
895
|
+
const cardRadius = MUSHI_RADIUS.card;
|
|
896
|
+
const {
|
|
897
|
+
tight: spaceTight,
|
|
898
|
+
snug: spaceSnug,
|
|
899
|
+
comfy: spaceComfy,
|
|
900
|
+
roomy: spaceRoomy,
|
|
901
|
+
lounge: spaceLounge,
|
|
902
|
+
open: spaceOpen,
|
|
903
|
+
wide: spaceWide
|
|
904
|
+
} = MUSHI_SPACING;
|
|
905
|
+
const touchMin = 44;
|
|
835
906
|
return `
|
|
836
907
|
:host {
|
|
837
908
|
all: initial;
|
|
@@ -843,6 +914,23 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
843
914
|
-moz-osx-font-smoothing: grayscale;
|
|
844
915
|
font-feature-settings: 'ss01', 'cv11'; /* nicer system-ui glyphs where supported */
|
|
845
916
|
--mushi-ok: ${ok};
|
|
917
|
+
/* Spacing + radius scales (MUSHI_SPACING / MUSHI_RADIUS) \u2014 prefer these
|
|
918
|
+
over literal px so web + RN stay aligned with brand.tokens.json. */
|
|
919
|
+
--mushi-space-tight: ${spaceTight}px;
|
|
920
|
+
--mushi-space-snug: ${spaceSnug}px;
|
|
921
|
+
--mushi-space-comfy: ${spaceComfy}px;
|
|
922
|
+
--mushi-space-roomy: ${spaceRoomy}px;
|
|
923
|
+
--mushi-space-lounge: ${spaceLounge}px;
|
|
924
|
+
--mushi-space-open: ${spaceOpen}px;
|
|
925
|
+
--mushi-space-wide: ${spaceWide}px;
|
|
926
|
+
--mushi-radius-control: ${controlRadius}px;
|
|
927
|
+
--mushi-radius-card: ${cardRadius}px;
|
|
928
|
+
--mushi-touch-min: ${touchMin}px;
|
|
929
|
+
/* Derived channel vars \u2014 accent RGB triplet + shadow-ink triplet.
|
|
930
|
+
Lets Shadow-DOM CSS compose rgba() values that respect host-accent
|
|
931
|
+
overrides and dark-mode ink without repeating the hex guard. */
|
|
932
|
+
--mushi-accent-rgb: ${accentRgb};
|
|
933
|
+
--mushi-shadow-ink: ${shadowInk};
|
|
846
934
|
/* SDK contract: the host element is always pass-through. Only the
|
|
847
935
|
interactive surfaces (.mushi-trigger, .mushi-banner, .mushi-panel)
|
|
848
936
|
opt back into pointer events so the widget never creates an
|
|
@@ -862,6 +950,8 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
862
950
|
position: fixed;
|
|
863
951
|
width: ${fabSize}px;
|
|
864
952
|
height: ${fabSize}px;
|
|
953
|
+
min-width: var(--mushi-touch-min);
|
|
954
|
+
min-height: var(--mushi-touch-min);
|
|
865
955
|
border: 1px solid ${ruleStrong};
|
|
866
956
|
border-radius: ${controlRadius}px;
|
|
867
957
|
background: ${paper};
|
|
@@ -875,9 +965,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
875
965
|
line-height: 1;
|
|
876
966
|
box-shadow:
|
|
877
967
|
0 1px 0 ${rule},
|
|
878
|
-
0 6px 14px -8px rgba(
|
|
968
|
+
0 6px 14px -8px rgba(${shadowInk},0.35),
|
|
879
969
|
inset 0 -3px 0 ${widgetAccent};
|
|
880
|
-
transition: transform ${durationFast}ms ${easeStamp},
|
|
970
|
+
transition: transform ${durationFast}ms ${easeStamp}, opacity ${durationFast}ms ${easeStamp};
|
|
881
971
|
overflow: visible;
|
|
882
972
|
isolation: isolate;
|
|
883
973
|
}
|
|
@@ -897,14 +987,15 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
897
987
|
transform: translateY(-2px) rotate(-1.5deg);
|
|
898
988
|
box-shadow:
|
|
899
989
|
0 1px 0 ${rule},
|
|
900
|
-
0 14px 24px -10px rgba(
|
|
990
|
+
0 14px 24px -10px rgba(${shadowInk},0.45),
|
|
991
|
+
0 0 20px -6px rgba(${accentRgb},0.22),
|
|
901
992
|
inset 0 -3px 0 ${widgetAccent};
|
|
902
993
|
}
|
|
903
994
|
.mushi-trigger:active {
|
|
904
995
|
transform: translateY(0) rotate(0);
|
|
905
996
|
box-shadow:
|
|
906
997
|
0 1px 0 ${rule},
|
|
907
|
-
0 2px 4px -2px rgba(
|
|
998
|
+
0 2px 4px -2px rgba(${shadowInk},0.35),
|
|
908
999
|
inset 0 -2px 0 ${widgetAccent};
|
|
909
1000
|
}
|
|
910
1001
|
.mushi-trigger:focus-visible {
|
|
@@ -916,9 +1007,9 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
916
1007
|
can compose with the hover transform without fighting it. Respects
|
|
917
1008
|
prefers-reduced-motion. */
|
|
918
1009
|
@keyframes mushi-trigger-pulse {
|
|
919
|
-
0% { box-shadow: 0 0 0 0 rgba(
|
|
920
|
-
70% { box-shadow: 0 0 0 16px rgba(
|
|
921
|
-
100% { box-shadow: 0 0 0 0 rgba(
|
|
1010
|
+
0% { box-shadow: 0 0 0 0 rgba(${accentRgb},0.55), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
|
|
1011
|
+
70% { box-shadow: 0 0 0 16px rgba(${accentRgb},0), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
|
|
1012
|
+
100% { box-shadow: 0 0 0 0 rgba(${accentRgb},0), 0 1px 0 ${rule}, 0 10px 24px -14px rgba(${shadowInk},0.45); }
|
|
922
1013
|
}
|
|
923
1014
|
.mushi-trigger-pulse {
|
|
924
1015
|
animation: mushi-trigger-pulse 800ms ${easeStamp} 3;
|
|
@@ -945,13 +1036,13 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
945
1036
|
.mushi-trigger.edge-tab {
|
|
946
1037
|
width: ${edgeTabWidth}px;
|
|
947
1038
|
height: 88px;
|
|
948
|
-
border-radius:
|
|
1039
|
+
border-radius: ${controlRadius}px 0 0 ${controlRadius}px;
|
|
949
1040
|
writing-mode: vertical-rl;
|
|
950
1041
|
text-orientation: upright;
|
|
951
1042
|
font-size: 16px;
|
|
952
1043
|
box-shadow:
|
|
953
1044
|
0 1px 0 ${rule},
|
|
954
|
-
0 10px 24px -14px rgba(
|
|
1045
|
+
0 10px 24px -14px rgba(${shadowInk},0.45),
|
|
955
1046
|
inset -3px 0 0 ${widgetAccent};
|
|
956
1047
|
}
|
|
957
1048
|
.mushi-trigger.edge-tab.bottom-right,
|
|
@@ -961,10 +1052,10 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
961
1052
|
.mushi-trigger.edge-tab.bottom-left,
|
|
962
1053
|
.mushi-trigger.edge-tab.top-left {
|
|
963
1054
|
left: var(--mushi-left, 0);
|
|
964
|
-
border-radius: 0
|
|
1055
|
+
border-radius: 0 ${controlRadius}px ${controlRadius}px 0;
|
|
965
1056
|
box-shadow:
|
|
966
1057
|
0 1px 0 ${rule},
|
|
967
|
-
0 10px 24px -14px rgba(
|
|
1058
|
+
0 10px 24px -14px rgba(${shadowInk},0.45),
|
|
968
1059
|
inset 3px 0 0 ${widgetAccent};
|
|
969
1060
|
}
|
|
970
1061
|
.mushi-trigger.shrunk {
|
|
@@ -993,7 +1084,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
993
1084
|
transition: none !important;
|
|
994
1085
|
box-shadow:
|
|
995
1086
|
0 1px 0 ${rule},
|
|
996
|
-
0 20px 40px -12px rgba(
|
|
1087
|
+
0 20px 40px -12px rgba(${shadowInk},0.55),
|
|
997
1088
|
inset 0 -3px 0 ${widgetAccent};
|
|
998
1089
|
opacity: 0.92;
|
|
999
1090
|
}
|
|
@@ -1017,13 +1108,14 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1017
1108
|
border-radius: 6px;
|
|
1018
1109
|
box-shadow:
|
|
1019
1110
|
0 1px 0 ${rule},
|
|
1020
|
-
0 24px 56px -20px rgba(
|
|
1021
|
-
0 8px 16px -8px rgba(
|
|
1111
|
+
0 24px 56px -20px rgba(${shadowInk},0.30),
|
|
1112
|
+
0 8px 16px -8px rgba(${shadowInk},0.20);
|
|
1022
1113
|
overflow: hidden;
|
|
1023
1114
|
display: flex;
|
|
1024
1115
|
flex-direction: column;
|
|
1025
1116
|
transform-origin: var(--mushi-origin, bottom right);
|
|
1026
|
-
|
|
1117
|
+
/* Keyboard inset \u2014 layout exception (IME), not decorative (docs/MOTION.md) */
|
|
1118
|
+
transition: bottom ${durInstant}ms ease, top ${durInstant}ms ease, max-height ${durInstant}ms ease;
|
|
1027
1119
|
}
|
|
1028
1120
|
/* Keyboard-safe: on narrow viewports lift above the keyboard */
|
|
1029
1121
|
.mushi-panel.keyboard-open {
|
|
@@ -1044,7 +1136,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1044
1136
|
bottom: calc(var(--mushi-keyboard-inset, 0px) + 4px) !important;
|
|
1045
1137
|
}
|
|
1046
1138
|
}
|
|
1047
|
-
.mushi-panel.open { animation: mushi-stamp-in
|
|
1139
|
+
.mushi-panel.open { animation: mushi-stamp-in ${durPanel}ms ${easeStamp} both; }
|
|
1048
1140
|
.mushi-panel.closed { display: none; }
|
|
1049
1141
|
.mushi-panel.bottom-right {
|
|
1050
1142
|
bottom: var(--mushi-panel-bottom, calc(var(--mushi-bottom, ${gutter}px) + ${panelLauncherGap}px));
|
|
@@ -1170,7 +1262,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1170
1262
|
font-size: 16px;
|
|
1171
1263
|
line-height: 1;
|
|
1172
1264
|
border-radius: 0;
|
|
1173
|
-
transition:
|
|
1265
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
1174
1266
|
}
|
|
1175
1267
|
.mushi-back {
|
|
1176
1268
|
align-self: flex-start;
|
|
@@ -1191,7 +1283,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1191
1283
|
display: inline-flex;
|
|
1192
1284
|
align-items: center;
|
|
1193
1285
|
gap: 4px;
|
|
1194
|
-
transition:
|
|
1286
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
1195
1287
|
white-space: nowrap;
|
|
1196
1288
|
}
|
|
1197
1289
|
.mushi-close:hover { color: ${widgetAccent}; }
|
|
@@ -1225,24 +1317,29 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1225
1317
|
display: grid;
|
|
1226
1318
|
grid-template-columns: auto 1fr auto;
|
|
1227
1319
|
align-items: center;
|
|
1228
|
-
gap:
|
|
1320
|
+
gap: ${spaceComfy}px;
|
|
1229
1321
|
width: 100%;
|
|
1230
|
-
|
|
1322
|
+
min-height: var(--mushi-touch-min);
|
|
1323
|
+
padding: ${spaceComfy}px 0;
|
|
1231
1324
|
border: none;
|
|
1232
1325
|
border-bottom: 1px solid ${rule};
|
|
1233
1326
|
background: transparent;
|
|
1234
1327
|
cursor: pointer;
|
|
1235
1328
|
color: inherit;
|
|
1236
1329
|
text-align: left;
|
|
1237
|
-
transition:
|
|
1330
|
+
transition: transform ${durBase}ms ${easeStamp}, opacity ${durBase}ms ${easeStamp};
|
|
1238
1331
|
position: relative;
|
|
1239
1332
|
}
|
|
1240
1333
|
.mushi-option-btn:last-child { border-bottom: none; }
|
|
1241
|
-
.mushi-option-btn:hover {
|
|
1334
|
+
.mushi-option-btn:hover {
|
|
1335
|
+
transform: translateX(6px);
|
|
1336
|
+
color: ${widgetAccent};
|
|
1337
|
+
background: linear-gradient(90deg, rgba(${accentRgb},0.07), transparent 55%);
|
|
1338
|
+
}
|
|
1242
1339
|
.mushi-option-btn:hover .mushi-option-arrow { opacity: 1; transform: translateX(0); color: ${widgetAccent}; }
|
|
1243
1340
|
.mushi-option-btn:focus-visible {
|
|
1244
1341
|
outline: none;
|
|
1245
|
-
|
|
1342
|
+
transform: translateX(6px);
|
|
1246
1343
|
box-shadow: inset 2px 0 0 ${widgetAccent};
|
|
1247
1344
|
}
|
|
1248
1345
|
.mushi-option-icon {
|
|
@@ -1270,7 +1367,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1270
1367
|
color: ${inkFaint};
|
|
1271
1368
|
opacity: 0;
|
|
1272
1369
|
transform: translateX(-4px);
|
|
1273
|
-
transition: opacity
|
|
1370
|
+
transition: opacity ${durBase}ms ${easeStamp}, transform ${durBase}ms ${easeStamp};
|
|
1274
1371
|
}
|
|
1275
1372
|
/* Feature-request and Reports-inbox entries sit above the five
|
|
1276
1373
|
category cards as discoverable shortcuts. We give them a subtle
|
|
@@ -1281,7 +1378,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1281
1378
|
.mushi-reports-entry {
|
|
1282
1379
|
padding-left: 10px;
|
|
1283
1380
|
border-left: 2px solid ${inkFaint};
|
|
1284
|
-
transition:
|
|
1381
|
+
transition: opacity ${durBase}ms ${easeStamp}, transform ${durBase}ms ${easeStamp};
|
|
1285
1382
|
}
|
|
1286
1383
|
.mushi-feature-entry:hover,
|
|
1287
1384
|
.mushi-reports-entry:hover {
|
|
@@ -1304,7 +1401,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1304
1401
|
color: ${ink};
|
|
1305
1402
|
cursor: pointer;
|
|
1306
1403
|
text-align: left;
|
|
1307
|
-
transition:
|
|
1404
|
+
transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
|
|
1308
1405
|
}
|
|
1309
1406
|
.mushi-report-row:hover,
|
|
1310
1407
|
.mushi-report-row:focus-visible {
|
|
@@ -1391,7 +1488,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1391
1488
|
font-size: 18px;
|
|
1392
1489
|
line-height: 1;
|
|
1393
1490
|
color: ${inkFaint};
|
|
1394
|
-
transition:
|
|
1491
|
+
transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
|
|
1395
1492
|
}
|
|
1396
1493
|
.mushi-report-row:hover .mushi-report-chevron,
|
|
1397
1494
|
.mushi-report-row:focus-visible .mushi-report-chevron {
|
|
@@ -1481,7 +1578,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1481
1578
|
font-family: ${fontBody};
|
|
1482
1579
|
font-size: 11px;
|
|
1483
1580
|
cursor: pointer;
|
|
1484
|
-
transition:
|
|
1581
|
+
transition: opacity ${durInstant}ms ${easeStamp}, transform ${durInstant}ms ${easeStamp};
|
|
1485
1582
|
white-space: nowrap;
|
|
1486
1583
|
}
|
|
1487
1584
|
.mushi-example-chip:hover {
|
|
@@ -1507,7 +1604,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1507
1604
|
letter-spacing: 0.04em;
|
|
1508
1605
|
color: ${inkFaint};
|
|
1509
1606
|
pointer-events: none;
|
|
1510
|
-
transition:
|
|
1607
|
+
transition: opacity ${durFast}ms ${easeStamp};
|
|
1511
1608
|
}
|
|
1512
1609
|
|
|
1513
1610
|
.mushi-textarea {
|
|
@@ -1523,7 +1620,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1523
1620
|
line-height: 1.5;
|
|
1524
1621
|
resize: vertical;
|
|
1525
1622
|
outline: none;
|
|
1526
|
-
transition:
|
|
1623
|
+
transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
|
|
1527
1624
|
}
|
|
1528
1625
|
.mushi-textarea::placeholder {
|
|
1529
1626
|
color: ${inkFaint};
|
|
@@ -1551,7 +1648,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1551
1648
|
letter-spacing: 0.04em;
|
|
1552
1649
|
text-transform: uppercase;
|
|
1553
1650
|
cursor: pointer;
|
|
1554
|
-
transition:
|
|
1651
|
+
transition: opacity ${durFast}ms ${easeStamp}, transform ${durFast}ms ${easeStamp};
|
|
1555
1652
|
}
|
|
1556
1653
|
.mushi-attach-btn:hover {
|
|
1557
1654
|
color: ${ink};
|
|
@@ -1645,7 +1742,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1645
1742
|
border: 1.5px solid currentColor;
|
|
1646
1743
|
border-top-color: transparent;
|
|
1647
1744
|
border-radius: 50%;
|
|
1648
|
-
animation: mushi-spin
|
|
1745
|
+
animation: mushi-spin ${durRing}ms linear infinite;
|
|
1649
1746
|
}
|
|
1650
1747
|
|
|
1651
1748
|
.mushi-footer {
|
|
@@ -1667,19 +1764,20 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1667
1764
|
position: relative;
|
|
1668
1765
|
display: inline-flex;
|
|
1669
1766
|
align-items: center;
|
|
1670
|
-
gap:
|
|
1671
|
-
|
|
1767
|
+
gap: ${spaceSnug}px;
|
|
1768
|
+
min-height: var(--mushi-touch-min);
|
|
1769
|
+
padding: ${spaceComfy}px ${spaceLounge}px;
|
|
1672
1770
|
border: 1px solid ${widgetAccent};
|
|
1673
|
-
border-radius:
|
|
1674
|
-
background: ${widgetAccent};
|
|
1771
|
+
border-radius: ${controlRadius}px;
|
|
1772
|
+
background: linear-gradient(160deg, ${widgetAccent} 0%, ${widgetAccentShadow} 100%);
|
|
1675
1773
|
color: ${onAccent};
|
|
1676
1774
|
font-family: ${fontMono};
|
|
1677
|
-
font-size:
|
|
1775
|
+
font-size: ${sizeLabel}px;
|
|
1678
1776
|
letter-spacing: 0.16em;
|
|
1679
1777
|
text-transform: uppercase;
|
|
1680
1778
|
cursor: pointer;
|
|
1681
1779
|
overflow: hidden;
|
|
1682
|
-
transition: transform
|
|
1780
|
+
transition: transform ${durFast}ms ${easeStamp}, opacity ${durFast}ms ${easeStamp};
|
|
1683
1781
|
box-shadow: 0 2px 0 ${widgetAccentShadow};
|
|
1684
1782
|
}
|
|
1685
1783
|
.mushi-submit::after {
|
|
@@ -1689,12 +1787,15 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1689
1787
|
background: radial-gradient(circle at center, rgba(255,255,255,0.35) 0%, transparent 60%);
|
|
1690
1788
|
opacity: 0;
|
|
1691
1789
|
transform: scale(0.4);
|
|
1692
|
-
transition: opacity
|
|
1790
|
+
transition: opacity ${durPanel}ms ${easeStamp}, transform ${durSlow}ms ${easeStamp};
|
|
1693
1791
|
pointer-events: none;
|
|
1694
1792
|
}
|
|
1695
1793
|
.mushi-submit:hover {
|
|
1696
1794
|
transform: translateY(-1px);
|
|
1697
|
-
box-shadow:
|
|
1795
|
+
box-shadow:
|
|
1796
|
+
0 3px 0 ${widgetAccentShadow},
|
|
1797
|
+
0 0 0 3px rgba(${accentRgb},0.18),
|
|
1798
|
+
0 4px 16px -4px rgba(${accentRgb},0.35);
|
|
1698
1799
|
}
|
|
1699
1800
|
.mushi-submit:hover::after { opacity: 1; transform: scale(1.4); }
|
|
1700
1801
|
.mushi-submit:active { transform: translateY(1px); box-shadow: 0 1px 0 ${widgetAccentShadow}; }
|
|
@@ -1708,7 +1809,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1708
1809
|
}
|
|
1709
1810
|
.mushi-submit-arrow {
|
|
1710
1811
|
display: inline-block;
|
|
1711
|
-
transition: transform
|
|
1812
|
+
transition: transform ${durBase}ms ${easeStamp};
|
|
1712
1813
|
}
|
|
1713
1814
|
.mushi-submit:hover .mushi-submit-arrow { transform: translateX(3px); }
|
|
1714
1815
|
|
|
@@ -1738,7 +1839,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1738
1839
|
display: inline-flex;
|
|
1739
1840
|
align-items: baseline;
|
|
1740
1841
|
gap: 4px;
|
|
1741
|
-
transition:
|
|
1842
|
+
transition: opacity ${durFast}ms ${easeStamp};
|
|
1742
1843
|
}
|
|
1743
1844
|
.mushi-step-num.done { color: ${inkMuted}; text-decoration: line-through; text-decoration-color: ${inkFaint}; }
|
|
1744
1845
|
.mushi-step-num.active {
|
|
@@ -1778,6 +1879,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1778
1879
|
transform: rotate(-90deg);
|
|
1779
1880
|
transform-origin: center;
|
|
1780
1881
|
animation: mushi-stamp-ring 700ms ${easeStamp} 80ms forwards;
|
|
1882
|
+
filter: drop-shadow(0 0 6px rgba(${accentRgb},0.5));
|
|
1781
1883
|
}
|
|
1782
1884
|
.mushi-success-stamp-label {
|
|
1783
1885
|
font-family: ${fontDisplay};
|
|
@@ -1846,11 +1948,11 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1846
1948
|
font-size: 12px;
|
|
1847
1949
|
letter-spacing: 0.02em;
|
|
1848
1950
|
cursor: pointer;
|
|
1849
|
-
transition:
|
|
1951
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
1850
1952
|
}
|
|
1851
1953
|
.mushi-success-receipt-id:hover,
|
|
1852
1954
|
.mushi-success-receipt-id:focus-visible {
|
|
1853
|
-
background: rgba(
|
|
1955
|
+
background: rgba(${accentRgb},0.06);
|
|
1854
1956
|
border-color: ${widgetAccent};
|
|
1855
1957
|
color: ${widgetAccent};
|
|
1856
1958
|
outline: none;
|
|
@@ -1873,7 +1975,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1873
1975
|
letter-spacing: 0.10em;
|
|
1874
1976
|
text-transform: uppercase;
|
|
1875
1977
|
text-decoration: none;
|
|
1876
|
-
transition: filter
|
|
1978
|
+
transition: filter ${durInstant}ms ease;
|
|
1877
1979
|
}
|
|
1878
1980
|
.mushi-success-receipt-track:hover,
|
|
1879
1981
|
.mushi-success-receipt-track:focus-visible {
|
|
@@ -1991,9 +2093,13 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
1991
2093
|
}
|
|
1992
2094
|
.mushi-tier-bar-fill {
|
|
1993
2095
|
height: 100%;
|
|
2096
|
+
width: 100%;
|
|
1994
2097
|
background: ${widgetAccent};
|
|
1995
2098
|
border-radius: 2px;
|
|
1996
|
-
|
|
2099
|
+
/* Meter fill \u2014 scaleX keeps compositor-friendly motion (docs/MOTION.md). */
|
|
2100
|
+
transform-origin: left center;
|
|
2101
|
+
transform: scaleX(var(--mushi-tier-pct, 0));
|
|
2102
|
+
transition: transform ${durSlow}ms ${easeStamp};
|
|
1997
2103
|
}
|
|
1998
2104
|
.mushi-rewards-next-label {
|
|
1999
2105
|
font-family: ${fontMono};
|
|
@@ -2019,7 +2125,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2019
2125
|
letter-spacing: 0.06em;
|
|
2020
2126
|
margin-bottom: 10px;
|
|
2021
2127
|
opacity: 0;
|
|
2022
|
-
animation: mushi-pts-pop
|
|
2128
|
+
animation: mushi-pts-pop ${durSlow}ms ${easeStamp} 900ms forwards;
|
|
2023
2129
|
}
|
|
2024
2130
|
.success-bar { margin: 0 0 5px; }
|
|
2025
2131
|
|
|
@@ -2038,7 +2144,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2038
2144
|
margin: 0 16px 2px;
|
|
2039
2145
|
padding: 9px 12px;
|
|
2040
2146
|
background: ${widgetAccentWash};
|
|
2041
|
-
border: 1px solid ${isDark ? "
|
|
2147
|
+
border: 1px solid rgba(${accentRgb},${isDark ? "0.22" : "0.16"});
|
|
2042
2148
|
border-radius: 4px;
|
|
2043
2149
|
display: flex;
|
|
2044
2150
|
flex-direction: column;
|
|
@@ -2117,7 +2223,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2117
2223
|
content: '\u25B6';
|
|
2118
2224
|
font-size: 7px;
|
|
2119
2225
|
opacity: 0.6;
|
|
2120
|
-
transition: transform
|
|
2226
|
+
transition: transform ${durInstant}ms ${easeStamp};
|
|
2121
2227
|
}
|
|
2122
2228
|
|
|
2123
2229
|
.mushi-changelog[open] .mushi-changelog-summary::before {
|
|
@@ -2145,7 +2251,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2145
2251
|
margin-top: 14px;
|
|
2146
2252
|
padding: 10px 14px;
|
|
2147
2253
|
background: ${widgetAccentWash};
|
|
2148
|
-
border: 1px solid ${isDark ? "
|
|
2254
|
+
border: 1px solid rgba(${accentRgb},${isDark ? "0.18" : "0.14"});
|
|
2149
2255
|
border-radius: 4px;
|
|
2150
2256
|
display: flex;
|
|
2151
2257
|
flex-direction: column;
|
|
@@ -2188,7 +2294,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2188
2294
|
white-space: nowrap;
|
|
2189
2295
|
overflow: hidden;
|
|
2190
2296
|
z-index: var(--mushi-banner-z, ${zBanner});
|
|
2191
|
-
animation: mushi-banner-slide-in
|
|
2297
|
+
animation: mushi-banner-slide-in ${durPanel}ms ${easeStamp} both;
|
|
2192
2298
|
}
|
|
2193
2299
|
|
|
2194
2300
|
.mushi-banner.top { top: 0; padding-top: env(safe-area-inset-top, 0px); }
|
|
@@ -2345,7 +2451,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2345
2451
|
letter-spacing: inherit;
|
|
2346
2452
|
text-decoration: none;
|
|
2347
2453
|
opacity: 0.88;
|
|
2348
|
-
transition: opacity
|
|
2454
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
2349
2455
|
flex-shrink: 0;
|
|
2350
2456
|
}
|
|
2351
2457
|
.mushi-banner-link:hover { opacity: 1; }
|
|
@@ -2373,7 +2479,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2373
2479
|
cursor: pointer;
|
|
2374
2480
|
font: inherit;
|
|
2375
2481
|
letter-spacing: inherit;
|
|
2376
|
-
transition:
|
|
2482
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
2377
2483
|
flex-shrink: 0;
|
|
2378
2484
|
height: 24px;
|
|
2379
2485
|
line-height: 1;
|
|
@@ -2395,7 +2501,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2395
2501
|
flex-shrink: 0;
|
|
2396
2502
|
color: inherit;
|
|
2397
2503
|
border-radius: 3px;
|
|
2398
|
-
transition: opacity
|
|
2504
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
2399
2505
|
}
|
|
2400
2506
|
.mushi-banner-dismiss:hover {
|
|
2401
2507
|
opacity: 1;
|
|
@@ -2416,7 +2522,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2416
2522
|
border-radius: 3px;
|
|
2417
2523
|
white-space: nowrap;
|
|
2418
2524
|
flex-shrink: 0;
|
|
2419
|
-
transition: opacity
|
|
2525
|
+
transition: opacity ${durInstant}ms ${easeStamp};
|
|
2420
2526
|
margin-left: 4px;
|
|
2421
2527
|
}
|
|
2422
2528
|
.mushi-banner-my-reports:hover {
|
|
@@ -2478,7 +2584,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2478
2584
|
font-family: ${fontBody};
|
|
2479
2585
|
font-size: 13px;
|
|
2480
2586
|
text-align: left;
|
|
2481
|
-
transition:
|
|
2587
|
+
transition: opacity ${durFast}ms ${easeStamp};
|
|
2482
2588
|
}
|
|
2483
2589
|
.mushi-more-toggle:hover { color: ${widgetAccent}; }
|
|
2484
2590
|
.mushi-more-toggle:hover .mushi-more-toggle-arrow { transform: translateX(3px); }
|
|
@@ -2496,7 +2602,7 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2496
2602
|
.mushi-more-toggle-arrow {
|
|
2497
2603
|
font-size: 14px;
|
|
2498
2604
|
opacity: 0.5;
|
|
2499
|
-
transition: transform
|
|
2605
|
+
transition: transform ${durFast}ms ${easeStamp};
|
|
2500
2606
|
}
|
|
2501
2607
|
/* \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 */
|
|
2502
2608
|
@keyframes mushi-step-in {
|
|
@@ -2511,12 +2617,12 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2511
2617
|
}
|
|
2512
2618
|
/* Expanded secondary categories animate in */
|
|
2513
2619
|
.mushi-categories-expanded {
|
|
2514
|
-
animation: mushi-step-in
|
|
2620
|
+
animation: mushi-step-in ${durFast}ms ${easeStamp} both;
|
|
2515
2621
|
}
|
|
2516
2622
|
.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}
|
|
2517
2623
|
.mushi-link-btn:hover{opacity:0.8}
|
|
2518
2624
|
.mushi-link-btn:focus-visible,.mushi-nav-item:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px;border-radius:2px}
|
|
2519
|
-
.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:
|
|
2625
|
+
.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}}
|
|
2520
2626
|
.mushi-nav-item:hover{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(0,0,0,0.07)"}}
|
|
2521
2627
|
.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}
|
|
2522
2628
|
.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}
|
|
@@ -2539,14 +2645,22 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2539
2645
|
.mushi-assistant-log{flex:1;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px 8px}
|
|
2540
2646
|
.mushi-assistant-greeting{font:400 14px/1.5 ${fontBody};color:${inkMuted};padding:6px 2px}
|
|
2541
2647
|
.mushi-assistant-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
|
|
2542
|
-
.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:
|
|
2543
|
-
.mushi-assistant-chip:hover{background
|
|
2648
|
+
.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}}
|
|
2649
|
+
.mushi-assistant-chip:hover{background:rgba(${accentRgb},${isDark ? "0.22" : "0.14"})}
|
|
2544
2650
|
.mushi-assistant-chip:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
|
|
2545
2651
|
.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}
|
|
2546
2652
|
.mushi-assistant-msg-user{align-self:flex-end;background:${widgetAccent};color:${inverse};border-bottom-right-radius:4px}
|
|
2547
2653
|
.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}
|
|
2548
2654
|
.mushi-assistant-thinking{opacity:0.6;font-size:18px;letter-spacing:2px}
|
|
2549
|
-
.mushi-assistant-error{align-self:flex-start;color:${danger};font-size:12px;padding:4px 2px}
|
|
2655
|
+
.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}
|
|
2656
|
+
.mushi-assistant-recovery{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
|
|
2657
|
+
.mushi-assistant-recovery-footer{margin-top:4px;padding-top:4px}
|
|
2658
|
+
.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}
|
|
2659
|
+
.mushi-assistant-report-cta:hover{opacity:0.92}
|
|
2660
|
+
.mushi-assistant-report-cta:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
|
|
2661
|
+
.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}
|
|
2662
|
+
.mushi-assistant-report-link:hover{opacity:0.85}
|
|
2663
|
+
.mushi-assistant-report-link:focus-visible{outline:2px solid ${widgetAccent};outline-offset:2px}
|
|
2550
2664
|
.mushi-assistant-form{display:flex;align-items:flex-end;gap:8px;border-top:1px solid ${rule};padding-top:8px}
|
|
2551
2665
|
.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}}
|
|
2552
2666
|
.mushi-assistant-input:focus-visible{outline:2px solid ${widgetAccent};outline-offset:1px}
|
|
@@ -2559,7 +2673,56 @@ function getWidgetStyles(theme, accent = "", accentText = "") {
|
|
|
2559
2673
|
|
|
2560
2674
|
// src/version.ts
|
|
2561
2675
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
2562
|
-
var MUSHI_SDK_VERSION = "1.
|
|
2676
|
+
var MUSHI_SDK_VERSION = "1.27.0" ;
|
|
2677
|
+
var ASSISTANT_SESSION_STORAGE_KEY = "mushi-assistant-session-v1";
|
|
2678
|
+
function loadAssistantSession() {
|
|
2679
|
+
try {
|
|
2680
|
+
if (typeof sessionStorage === "undefined") return null;
|
|
2681
|
+
const raw = sessionStorage.getItem(ASSISTANT_SESSION_STORAGE_KEY);
|
|
2682
|
+
if (!raw) return null;
|
|
2683
|
+
const parsed = JSON.parse(raw);
|
|
2684
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
2685
|
+
const record = parsed;
|
|
2686
|
+
const turns = Array.isArray(record.turns) ? record.turns : null;
|
|
2687
|
+
if (!turns) return null;
|
|
2688
|
+
const normalized = [];
|
|
2689
|
+
for (const item of turns) {
|
|
2690
|
+
if (!item || typeof item !== "object") continue;
|
|
2691
|
+
const t = item;
|
|
2692
|
+
if (t.role !== "user" && t.role !== "assistant") continue;
|
|
2693
|
+
if (typeof t.text !== "string") continue;
|
|
2694
|
+
const turn = { role: t.role, text: t.text };
|
|
2695
|
+
if (Array.isArray(t.options)) {
|
|
2696
|
+
const options = t.options.filter((o) => typeof o === "string");
|
|
2697
|
+
if (options.length) turn.options = options;
|
|
2698
|
+
}
|
|
2699
|
+
if (t.offerReport === true) turn.offerReport = true;
|
|
2700
|
+
normalized.push(turn);
|
|
2701
|
+
}
|
|
2702
|
+
const threadId = typeof record.threadId === "string" && record.threadId.length > 0 ? record.threadId : null;
|
|
2703
|
+
return { turns: normalized, threadId };
|
|
2704
|
+
} catch {
|
|
2705
|
+
return null;
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
function saveAssistantSession(snapshot) {
|
|
2709
|
+
try {
|
|
2710
|
+
if (typeof sessionStorage === "undefined") return;
|
|
2711
|
+
if (!snapshot.turns.length && !snapshot.threadId) {
|
|
2712
|
+
sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
|
|
2713
|
+
return;
|
|
2714
|
+
}
|
|
2715
|
+
sessionStorage.setItem(ASSISTANT_SESSION_STORAGE_KEY, JSON.stringify(snapshot));
|
|
2716
|
+
} catch {
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
function clearAssistantSession() {
|
|
2720
|
+
try {
|
|
2721
|
+
if (typeof sessionStorage === "undefined") return;
|
|
2722
|
+
sessionStorage.removeItem(ASSISTANT_SESSION_STORAGE_KEY);
|
|
2723
|
+
} catch {
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2563
2726
|
var CATEGORY_ICONS = {
|
|
2564
2727
|
bug: "\u26A0\uFE0F",
|
|
2565
2728
|
slow: "\u{1F40C}",
|
|
@@ -2767,10 +2930,18 @@ function renderAssistantStep(ctx) {
|
|
|
2767
2930
|
${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) => {
|
|
2768
2931
|
const cls = turn.role === "user" ? "mushi-assistant-msg-user" : "mushi-assistant-msg-bot";
|
|
2769
2932
|
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>` : "";
|
|
2770
|
-
|
|
2933
|
+
const reportCta = turn.offerReport ? `<div class="mushi-assistant-recovery">
|
|
2934
|
+
<button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
|
|
2935
|
+
</div>` : "";
|
|
2936
|
+
return `<div class="mushi-assistant-msg ${cls}">${escapeHtml(turn.text)}</div>${opts}${reportCta}`;
|
|
2771
2937
|
}).join("");
|
|
2772
2938
|
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>` : "";
|
|
2773
|
-
const error = ctx.assistantError ? `<div class="mushi-assistant-error" role="alert">${escapeHtml(ctx.assistantError)}
|
|
2939
|
+
const error = ctx.assistantError ? `<div class="mushi-assistant-error" role="alert">${escapeHtml(ctx.assistantError)}
|
|
2940
|
+
<button type="button" class="mushi-assistant-report-cta" data-action="assistant-report">${escapeHtml(t.assistant.fileReportCta)}</button>
|
|
2941
|
+
</div>` : "";
|
|
2942
|
+
const stillStuck = !empty && !ctx.assistantSending && !ctx.assistantError ? `<div class="mushi-assistant-recovery mushi-assistant-recovery-footer">
|
|
2943
|
+
<button type="button" class="mushi-assistant-report-link" data-action="assistant-report">${escapeHtml(t.assistant.stillStuckCta)}</button>
|
|
2944
|
+
</div>` : "";
|
|
2774
2945
|
return `
|
|
2775
2946
|
${renderHeader(ctx, { title: label, showBack: true })}
|
|
2776
2947
|
<div class="mushi-assistant">
|
|
@@ -2778,6 +2949,7 @@ function renderAssistantStep(ctx) {
|
|
|
2778
2949
|
${transcript}
|
|
2779
2950
|
${thinking}
|
|
2780
2951
|
${error}
|
|
2952
|
+
${stillStuck}
|
|
2781
2953
|
</div>
|
|
2782
2954
|
<form class="mushi-assistant-form" data-action="assistant-send">
|
|
2783
2955
|
<textarea
|
|
@@ -3305,6 +3477,7 @@ function renderDetailsStep(ctx) {
|
|
|
3305
3477
|
class="mushi-textarea"
|
|
3306
3478
|
placeholder="${escapeHtml(t.step3.descriptionPlaceholder)}"
|
|
3307
3479
|
rows="4"
|
|
3480
|
+
maxlength="4000"
|
|
3308
3481
|
aria-label="${escapeHtml(t.step3.heading)}"
|
|
3309
3482
|
autofocus
|
|
3310
3483
|
></textarea>
|
|
@@ -3374,12 +3547,15 @@ function renderSuccessStep(ctx) {
|
|
|
3374
3547
|
}
|
|
3375
3548
|
function renderSuccessReceipt(ctx) {
|
|
3376
3549
|
const s = ctx.locale.flows.success;
|
|
3377
|
-
|
|
3550
|
+
const failureKind = ctx.lastSubmitFailureKind;
|
|
3551
|
+
if (failureKind === "rate_limited" || failureKind === "quota" || failureKind === "permanent" || failureKind === "retrying" || ctx.lastSubmitQueuedOffline) {
|
|
3552
|
+
const label = failureKind === "rate_limited" ? s.rateLimited : failureKind === "quota" ? s.quotaBlocked : failureKind === "permanent" ? s.permanentFailed : failureKind === "retrying" ? s.retrying : s.queuedOffline;
|
|
3553
|
+
const hint = failureKind === "rate_limited" ? s.rateLimitedHint : failureKind === "quota" ? s.quotaBlockedHint : failureKind === "permanent" ? s.permanentFailedHint : failureKind === "retrying" ? s.retryingHint : s.queuedHint;
|
|
3378
3554
|
return `
|
|
3379
3555
|
<div class="mushi-success-receipt" role="status">
|
|
3380
3556
|
<div class="mushi-success-receipt-row mushi-success-receipt-warn">
|
|
3381
|
-
<span class="mushi-success-receipt-label">${escapeHtml(
|
|
3382
|
-
<span class="mushi-success-receipt-hint">${escapeHtml(
|
|
3557
|
+
<span class="mushi-success-receipt-label">${escapeHtml(label)}</span>
|
|
3558
|
+
<span class="mushi-success-receipt-hint">${escapeHtml(hint)}</span>
|
|
3383
3559
|
</div>
|
|
3384
3560
|
</div>
|
|
3385
3561
|
`;
|
|
@@ -3470,7 +3646,7 @@ function renderRewardsNudge(ctx) {
|
|
|
3470
3646
|
</div>
|
|
3471
3647
|
${nextTier ? `
|
|
3472
3648
|
<div class="mushi-tier-bar-track" role="progressbar" aria-valuenow="${pct}" aria-valuemin="0" aria-valuemax="100" aria-label="Progress to ${escapeHtml(nextTier.displayName)}">
|
|
3473
|
-
<div class="mushi-tier-bar-fill" style="
|
|
3649
|
+
<div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pct / 100}"></div>
|
|
3474
3650
|
</div>
|
|
3475
3651
|
<div class="mushi-rewards-next-label">${nextLabel}</div>
|
|
3476
3652
|
` : ""}
|
|
@@ -3494,7 +3670,7 @@ function renderSuccessRewards(ctx) {
|
|
|
3494
3670
|
<div class="mushi-success-pts-award">+${pointsForReport} pts</div>
|
|
3495
3671
|
${nextTier ? `
|
|
3496
3672
|
<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)}">
|
|
3497
|
-
<div class="mushi-tier-bar-fill" style="
|
|
3673
|
+
<div class="mushi-tier-bar-fill" style="--mushi-tier-pct:${pctAfter / 100}"></div>
|
|
3498
3674
|
</div>
|
|
3499
3675
|
<div class="mushi-rewards-next-label">${nextLabel}</div>
|
|
3500
3676
|
` : ""}
|
|
@@ -3503,6 +3679,12 @@ function renderSuccessRewards(ctx) {
|
|
|
3503
3679
|
}
|
|
3504
3680
|
|
|
3505
3681
|
// src/widget.ts
|
|
3682
|
+
function looksUnsureAssistantAnswer(text) {
|
|
3683
|
+
const lower = text.toLowerCase();
|
|
3684
|
+
return /i('m| am) not sure|i don't know|not sure|cannot help|can't help|unable to|don't have enough|outside (my|of) (scope|knowledge)|file a (bug )?report|報告/.test(
|
|
3685
|
+
lower
|
|
3686
|
+
) || /わかりません|分かりません|不明|報告して/.test(text);
|
|
3687
|
+
}
|
|
3506
3688
|
var MushiWidget = class _MushiWidget {
|
|
3507
3689
|
constructor(config = {}, callbacks, sdkVersion = MUSHI_SDK_VERSION) {
|
|
3508
3690
|
this.sdkVersion = sdkVersion;
|
|
@@ -3549,6 +3731,11 @@ var MushiWidget = class _MushiWidget {
|
|
|
3549
3731
|
};
|
|
3550
3732
|
this.callbacks = callbacks;
|
|
3551
3733
|
this.locale = getLocale(this.config.locale === "auto" ? void 0 : this.config.locale);
|
|
3734
|
+
const saved = loadAssistantSession();
|
|
3735
|
+
if (saved?.turns.length) {
|
|
3736
|
+
this.assistantTurns = saved.turns;
|
|
3737
|
+
this.assistantThreadId = saved.threadId;
|
|
3738
|
+
}
|
|
3552
3739
|
this.host = document.createElement("div");
|
|
3553
3740
|
this.host.id = "mushi-mushi-widget";
|
|
3554
3741
|
this.shadow = this.host.attachShadow({ mode: "open" });
|
|
@@ -3556,6 +3743,9 @@ var MushiWidget = class _MushiWidget {
|
|
|
3556
3743
|
sdkVersion;
|
|
3557
3744
|
host;
|
|
3558
3745
|
shadow;
|
|
3746
|
+
/** Re-inject styles when OS light/dark flips while theme=auto|inherit. */
|
|
3747
|
+
colorSchemeMq = null;
|
|
3748
|
+
onColorSchemeChange = null;
|
|
3559
3749
|
config;
|
|
3560
3750
|
callbacks;
|
|
3561
3751
|
locale;
|
|
@@ -3654,6 +3844,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3654
3844
|
* Drives a different success copy so the user knows the report
|
|
3655
3845
|
* hasn't actually reached the console yet. */
|
|
3656
3846
|
lastSubmitQueuedOffline = false;
|
|
3847
|
+
lastSubmitFailureKind;
|
|
3657
3848
|
lastSubmitScreenshotDropped = false;
|
|
3658
3849
|
/** Whether the user has clicked ✕ on the header banner this session. */
|
|
3659
3850
|
bannerDismissed = false;
|
|
@@ -3698,6 +3889,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3698
3889
|
document.body.appendChild(this.host);
|
|
3699
3890
|
this.syncAttachedLaunchers();
|
|
3700
3891
|
this.syncSmartHide();
|
|
3892
|
+
this.bindColorSchemeListener();
|
|
3701
3893
|
this.render();
|
|
3702
3894
|
this.mountedAt = Date.now();
|
|
3703
3895
|
}
|
|
@@ -3798,6 +3990,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3798
3990
|
this.removeSelectorHint();
|
|
3799
3991
|
this.lastReportId = null;
|
|
3800
3992
|
this.lastSubmitQueuedOffline = false;
|
|
3993
|
+
this.lastSubmitFailureKind = void 0;
|
|
3801
3994
|
this.lastSubmitScreenshotDropped = false;
|
|
3802
3995
|
this.viaFeatureRequest = false;
|
|
3803
3996
|
this.clearFormDrafts();
|
|
@@ -3859,6 +4052,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
3859
4052
|
this.assistantSending = true;
|
|
3860
4053
|
this.assistantError = null;
|
|
3861
4054
|
this.assistantTurns.push({ role: "user", text });
|
|
4055
|
+
this.persistAssistantSession();
|
|
3862
4056
|
this.render();
|
|
3863
4057
|
try {
|
|
3864
4058
|
const reply = await this.callbacks.onAssistantAsk(text, this.assistantThreadId);
|
|
@@ -3868,11 +4062,19 @@ var MushiWidget = class _MushiWidget {
|
|
|
3868
4062
|
this.assistantTurns.push({
|
|
3869
4063
|
role: "assistant",
|
|
3870
4064
|
text: reply.question ?? "Could you tell me a bit more?",
|
|
3871
|
-
...reply.options && reply.options.length ? { options: reply.options } : {}
|
|
4065
|
+
...reply.options && reply.options.length ? { options: reply.options } : {},
|
|
4066
|
+
offerReport: true
|
|
3872
4067
|
});
|
|
3873
4068
|
} else {
|
|
3874
|
-
|
|
4069
|
+
const answerText = reply.text ?? "\u2026";
|
|
4070
|
+
const unsure = looksUnsureAssistantAnswer(answerText);
|
|
4071
|
+
this.assistantTurns.push({
|
|
4072
|
+
role: "assistant",
|
|
4073
|
+
text: answerText,
|
|
4074
|
+
...unsure ? { offerReport: true } : {}
|
|
4075
|
+
});
|
|
3875
4076
|
}
|
|
4077
|
+
this.persistAssistantSession();
|
|
3876
4078
|
} else {
|
|
3877
4079
|
this.assistantError = this.locale.assistant.errors.noResponse;
|
|
3878
4080
|
}
|
|
@@ -3887,6 +4089,33 @@ var MushiWidget = class _MushiWidget {
|
|
|
3887
4089
|
}, 0);
|
|
3888
4090
|
}
|
|
3889
4091
|
}
|
|
4092
|
+
/** Persist Ask turns for same-tab reload survival (UX only). */
|
|
4093
|
+
persistAssistantSession() {
|
|
4094
|
+
saveAssistantSession({
|
|
4095
|
+
turns: this.assistantTurns,
|
|
4096
|
+
threadId: this.assistantThreadId
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4099
|
+
/** Clear Ask transcript (e.g. host reset). Keeps Ask login-free. */
|
|
4100
|
+
clearAssistantTranscript() {
|
|
4101
|
+
this.assistantTurns = [];
|
|
4102
|
+
this.assistantThreadId = null;
|
|
4103
|
+
this.assistantError = null;
|
|
4104
|
+
clearAssistantSession();
|
|
4105
|
+
if (this.step === "assistant") this.render();
|
|
4106
|
+
}
|
|
4107
|
+
/** Escape hatch from Ask → report category picker (no login required). */
|
|
4108
|
+
openReportFromAssistant() {
|
|
4109
|
+
this.selectedCategory = null;
|
|
4110
|
+
this.selectedIntent = null;
|
|
4111
|
+
this.viaFeatureRequest = false;
|
|
4112
|
+
this.step = "category";
|
|
4113
|
+
if (!this.isOpen) {
|
|
4114
|
+
this.isOpen = true;
|
|
4115
|
+
this.callbacks.onOpen();
|
|
4116
|
+
}
|
|
4117
|
+
this.render();
|
|
4118
|
+
}
|
|
3890
4119
|
/**
|
|
3891
4120
|
* Briefly highlight the trigger button (a soft pulse + tooltip) without
|
|
3892
4121
|
* opening the full reporter panel. Use for first-session welcome nudges
|
|
@@ -4136,6 +4365,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
4136
4365
|
clearTimeout(this.smartHideTimer);
|
|
4137
4366
|
this.smartHideTimer = null;
|
|
4138
4367
|
}
|
|
4368
|
+
this.unbindColorSchemeListener();
|
|
4139
4369
|
this.smartHideCleanup?.();
|
|
4140
4370
|
this.smartHideCleanup = null;
|
|
4141
4371
|
this.teardownViewportHandlers();
|
|
@@ -4146,6 +4376,33 @@ var MushiWidget = class _MushiWidget {
|
|
|
4146
4376
|
this.removeBodyNudge();
|
|
4147
4377
|
this.host.remove();
|
|
4148
4378
|
}
|
|
4379
|
+
/** Live-restyle when OS prefers-color-scheme changes (theme auto/inherit only). */
|
|
4380
|
+
bindColorSchemeListener() {
|
|
4381
|
+
this.unbindColorSchemeListener();
|
|
4382
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
4383
|
+
const theme = this.config.theme;
|
|
4384
|
+
if (theme !== "auto" && theme !== "inherit") return;
|
|
4385
|
+
this.colorSchemeMq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4386
|
+
this.onColorSchemeChange = () => {
|
|
4387
|
+
if (this.host.isConnected) this.render();
|
|
4388
|
+
};
|
|
4389
|
+
if (typeof this.colorSchemeMq.addEventListener === "function") {
|
|
4390
|
+
this.colorSchemeMq.addEventListener("change", this.onColorSchemeChange);
|
|
4391
|
+
} else if (typeof this.colorSchemeMq.addListener === "function") {
|
|
4392
|
+
this.colorSchemeMq.addListener(this.onColorSchemeChange);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
unbindColorSchemeListener() {
|
|
4396
|
+
if (this.colorSchemeMq && this.onColorSchemeChange) {
|
|
4397
|
+
if (typeof this.colorSchemeMq.removeEventListener === "function") {
|
|
4398
|
+
this.colorSchemeMq.removeEventListener("change", this.onColorSchemeChange);
|
|
4399
|
+
} else if (typeof this.colorSchemeMq.removeListener === "function") {
|
|
4400
|
+
this.colorSchemeMq.removeListener(this.onColorSchemeChange);
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
this.colorSchemeMq = null;
|
|
4404
|
+
this.onColorSchemeChange = null;
|
|
4405
|
+
}
|
|
4149
4406
|
/* ── Host chrome contract ────────────────────────────────────────────────
|
|
4150
4407
|
The host element must never create an invisible full-screen touch blocker.
|
|
4151
4408
|
We own these inline styles — consumer CSS can only win with `!important`,
|
|
@@ -4931,6 +5188,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
4931
5188
|
leaderboardLoading: this.leaderboardLoading,
|
|
4932
5189
|
leaderboardEntries: this.leaderboardEntries,
|
|
4933
5190
|
lastSubmitQueuedOffline: this.lastSubmitQueuedOffline,
|
|
5191
|
+
lastSubmitFailureKind: this.lastSubmitFailureKind,
|
|
4934
5192
|
lastSubmitScreenshotDropped: this.lastSubmitScreenshotDropped,
|
|
4935
5193
|
featureBoard: this.featureBoard,
|
|
4936
5194
|
crossAppReports: this.crossAppReports,
|
|
@@ -5011,6 +5269,11 @@ var MushiWidget = class _MushiWidget {
|
|
|
5011
5269
|
if (value) void this.sendAssistantMessage(value);
|
|
5012
5270
|
});
|
|
5013
5271
|
});
|
|
5272
|
+
panel.querySelectorAll('[data-action="assistant-report"]').forEach((btn) => {
|
|
5273
|
+
btn.addEventListener("click", () => {
|
|
5274
|
+
this.openReportFromAssistant();
|
|
5275
|
+
});
|
|
5276
|
+
});
|
|
5014
5277
|
{
|
|
5015
5278
|
const form = panel.querySelector('[data-action="assistant-send"]');
|
|
5016
5279
|
if (form) {
|
|
@@ -5215,6 +5478,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
5215
5478
|
this.submittedAt = /* @__PURE__ */ new Date();
|
|
5216
5479
|
this.lastReportId = null;
|
|
5217
5480
|
this.lastSubmitQueuedOffline = false;
|
|
5481
|
+
this.lastSubmitFailureKind = void 0;
|
|
5218
5482
|
this.lastSubmitScreenshotDropped = false;
|
|
5219
5483
|
this.render();
|
|
5220
5484
|
const outcomeP = (async () => {
|
|
@@ -5248,6 +5512,7 @@ var MushiWidget = class _MushiWidget {
|
|
|
5248
5512
|
if (outcome) {
|
|
5249
5513
|
this.lastReportId = outcome.reportId ?? null;
|
|
5250
5514
|
this.lastSubmitQueuedOffline = Boolean(outcome.queuedOffline);
|
|
5515
|
+
this.lastSubmitFailureKind = outcome.failureKind;
|
|
5251
5516
|
this.lastSubmitScreenshotDropped = Boolean(outcome.screenshotDropped);
|
|
5252
5517
|
this.render();
|
|
5253
5518
|
}
|
|
@@ -6068,59 +6333,6 @@ function renderConsentBanner(projectId, config) {
|
|
|
6068
6333
|
});
|
|
6069
6334
|
document.body.appendChild(consentHost);
|
|
6070
6335
|
}
|
|
6071
|
-
|
|
6072
|
-
// src/capture/console.ts
|
|
6073
|
-
var MAX_ENTRIES = 50;
|
|
6074
|
-
var MAX_MESSAGE_LENGTH = 500;
|
|
6075
|
-
function createConsoleCapture() {
|
|
6076
|
-
const entries = [];
|
|
6077
|
-
const originals = {};
|
|
6078
|
-
const wrappers = {};
|
|
6079
|
-
const levels = ["log", "warn", "error", "info", "debug"];
|
|
6080
|
-
for (const level of levels) {
|
|
6081
|
-
const original = console[level];
|
|
6082
|
-
originals[level] = original;
|
|
6083
|
-
const wrapper = (...args) => {
|
|
6084
|
-
const message = args.map((arg) => {
|
|
6085
|
-
try {
|
|
6086
|
-
return typeof arg === "string" ? arg : JSON.stringify(arg);
|
|
6087
|
-
} catch {
|
|
6088
|
-
return String(arg);
|
|
6089
|
-
}
|
|
6090
|
-
}).join(" ").slice(0, MAX_MESSAGE_LENGTH);
|
|
6091
|
-
const entry = {
|
|
6092
|
-
level,
|
|
6093
|
-
message,
|
|
6094
|
-
timestamp: Date.now()
|
|
6095
|
-
};
|
|
6096
|
-
if (level === "error" && args[0] instanceof Error) {
|
|
6097
|
-
entry.stack = args[0].stack?.slice(0, 1e3);
|
|
6098
|
-
}
|
|
6099
|
-
entries.push(entry);
|
|
6100
|
-
if (entries.length > MAX_ENTRIES) {
|
|
6101
|
-
entries.shift();
|
|
6102
|
-
}
|
|
6103
|
-
original.call(console, ...args);
|
|
6104
|
-
};
|
|
6105
|
-
wrappers[level] = wrapper;
|
|
6106
|
-
console[level] = wrapper;
|
|
6107
|
-
}
|
|
6108
|
-
return {
|
|
6109
|
-
getEntries() {
|
|
6110
|
-
return [...entries];
|
|
6111
|
-
},
|
|
6112
|
-
clear() {
|
|
6113
|
-
entries.length = 0;
|
|
6114
|
-
},
|
|
6115
|
-
destroy() {
|
|
6116
|
-
for (const level of levels) {
|
|
6117
|
-
if (originals[level] && console[level] === wrappers[level]) {
|
|
6118
|
-
console[level] = originals[level];
|
|
6119
|
-
}
|
|
6120
|
-
}
|
|
6121
|
-
}
|
|
6122
|
-
};
|
|
6123
|
-
}
|
|
6124
6336
|
var DEFAULT_INTERNAL_URL_MATCHERS = [
|
|
6125
6337
|
/\/v1\/sdk(?:\/|$)/,
|
|
6126
6338
|
/\/v1\/reports(?:\/|$)/,
|
|
@@ -6184,7 +6396,7 @@ function readHeader(headers, name) {
|
|
|
6184
6396
|
}
|
|
6185
6397
|
|
|
6186
6398
|
// src/capture/network.ts
|
|
6187
|
-
var
|
|
6399
|
+
var MAX_ENTRIES = 30;
|
|
6188
6400
|
var TRACEPARENT_VERSION = "00";
|
|
6189
6401
|
function generateTraceparent() {
|
|
6190
6402
|
const traceBytes = crypto.getRandomValues(new Uint8Array(16));
|
|
@@ -6208,9 +6420,21 @@ function matchesCorsUrls(url, corsUrls) {
|
|
|
6208
6420
|
}
|
|
6209
6421
|
return false;
|
|
6210
6422
|
}
|
|
6423
|
+
var _activeCorrelationStack = [];
|
|
6424
|
+
function getActiveCorrelationId() {
|
|
6425
|
+
return _activeCorrelationStack[_activeCorrelationStack.length - 1];
|
|
6426
|
+
}
|
|
6427
|
+
function generateCorrelationId() {
|
|
6428
|
+
const bytes = crypto.getRandomValues(new Uint8Array(4));
|
|
6429
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
6430
|
+
}
|
|
6211
6431
|
function createNetworkCapture(options = {}) {
|
|
6212
6432
|
const entries = [];
|
|
6213
6433
|
const originalFetch = globalThis.fetch;
|
|
6434
|
+
const OriginalXHR = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : null;
|
|
6435
|
+
const originalXhrOpen = OriginalXHR ? XMLHttpRequest.prototype.open : null;
|
|
6436
|
+
const originalXhrSend = OriginalXHR ? XMLHttpRequest.prototype.send : null;
|
|
6437
|
+
const originalXhrSetRequestHeader = OriginalXHR ? XMLHttpRequest.prototype.setRequestHeader : null;
|
|
6214
6438
|
let activeOptions = options;
|
|
6215
6439
|
let fetchWrapper;
|
|
6216
6440
|
globalThis.fetch = fetchWrapper = async function mushiFetchInterceptor(input, init) {
|
|
@@ -6219,6 +6443,7 @@ function createNetworkCapture(options = {}) {
|
|
|
6219
6443
|
const url = getRequestUrl(input);
|
|
6220
6444
|
const internalKind = getInternalRequestKind(input, init);
|
|
6221
6445
|
const shouldRecord = !internalKind && !shouldIgnoreMushiUrl(url, activeOptions);
|
|
6446
|
+
const correlationId = shouldRecord ? generateCorrelationId() : void 0;
|
|
6222
6447
|
let traceId;
|
|
6223
6448
|
let patchedInit = init;
|
|
6224
6449
|
const tp = activeOptions.tracePropagation;
|
|
@@ -6232,6 +6457,7 @@ function createNetworkCapture(options = {}) {
|
|
|
6232
6457
|
}
|
|
6233
6458
|
patchedInit = { ...init, headers: existingHeaders };
|
|
6234
6459
|
}
|
|
6460
|
+
if (correlationId) _activeCorrelationStack.push(correlationId);
|
|
6235
6461
|
try {
|
|
6236
6462
|
const response = await originalFetch.call(globalThis, input, patchedInit);
|
|
6237
6463
|
if (shouldRecord) {
|
|
@@ -6241,7 +6467,9 @@ function createNetworkCapture(options = {}) {
|
|
|
6241
6467
|
status: response.status,
|
|
6242
6468
|
duration: Date.now() - startTime,
|
|
6243
6469
|
timestamp: startTime,
|
|
6244
|
-
|
|
6470
|
+
captureMethod: "fetch",
|
|
6471
|
+
...traceId ? { traceId } : {},
|
|
6472
|
+
...correlationId ? { correlationId } : {}
|
|
6245
6473
|
});
|
|
6246
6474
|
}
|
|
6247
6475
|
return response;
|
|
@@ -6254,15 +6482,99 @@ function createNetworkCapture(options = {}) {
|
|
|
6254
6482
|
duration: Date.now() - startTime,
|
|
6255
6483
|
timestamp: startTime,
|
|
6256
6484
|
error: error instanceof Error ? error.message : "Network error",
|
|
6257
|
-
|
|
6485
|
+
captureMethod: "fetch",
|
|
6486
|
+
...traceId ? { traceId } : {},
|
|
6487
|
+
...correlationId ? { correlationId } : {}
|
|
6258
6488
|
});
|
|
6259
6489
|
}
|
|
6260
6490
|
throw error;
|
|
6491
|
+
} finally {
|
|
6492
|
+
if (correlationId) {
|
|
6493
|
+
const idx = _activeCorrelationStack.lastIndexOf(correlationId);
|
|
6494
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
6495
|
+
}
|
|
6261
6496
|
}
|
|
6262
6497
|
};
|
|
6498
|
+
const xhrStateMap = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : null;
|
|
6499
|
+
if (OriginalXHR && originalXhrOpen && originalXhrSend && originalXhrSetRequestHeader && xhrStateMap) {
|
|
6500
|
+
const _originalOpen = originalXhrOpen;
|
|
6501
|
+
XMLHttpRequest.prototype.open = function mushiXhrOpen(...args) {
|
|
6502
|
+
const [method, url] = args;
|
|
6503
|
+
const urlStr = typeof url === "string" ? url : String(url);
|
|
6504
|
+
const shouldRecord = !shouldIgnoreMushiUrl(urlStr, activeOptions);
|
|
6505
|
+
const correlationId = shouldRecord ? generateCorrelationId() : void 0;
|
|
6506
|
+
let traceId;
|
|
6507
|
+
let storedTraceparent;
|
|
6508
|
+
const tp = activeOptions.tracePropagation;
|
|
6509
|
+
if (shouldRecord && tp?.enabled && tp.corsUrls?.length && matchesCorsUrls(urlStr, tp.corsUrls)) {
|
|
6510
|
+
const generated = generateTraceparent();
|
|
6511
|
+
traceId = generated.traceId;
|
|
6512
|
+
storedTraceparent = generated.traceparent;
|
|
6513
|
+
}
|
|
6514
|
+
const _prevXhrState = xhrStateMap.get(this);
|
|
6515
|
+
if (_prevXhrState?._listener) {
|
|
6516
|
+
this.removeEventListener("readystatechange", _prevXhrState._listener);
|
|
6517
|
+
}
|
|
6518
|
+
xhrStateMap.set(this, {
|
|
6519
|
+
method: String(method).toUpperCase(),
|
|
6520
|
+
url: truncateUrl(urlStr),
|
|
6521
|
+
startTime: 0,
|
|
6522
|
+
// set in .send()
|
|
6523
|
+
shouldRecord,
|
|
6524
|
+
...traceId ? { traceId } : {},
|
|
6525
|
+
...correlationId ? { correlationId } : {},
|
|
6526
|
+
// Attach the traceparent string as an extra prop for injection in .send().
|
|
6527
|
+
...storedTraceparent ? { _traceparent: storedTraceparent } : {}
|
|
6528
|
+
});
|
|
6529
|
+
_originalOpen.apply(this, args);
|
|
6530
|
+
};
|
|
6531
|
+
XMLHttpRequest.prototype.send = function mushiXhrSend(body) {
|
|
6532
|
+
const state = xhrStateMap.get(this);
|
|
6533
|
+
if (state) {
|
|
6534
|
+
state.startTime = Date.now();
|
|
6535
|
+
const xhrTraceparent = state._traceparent;
|
|
6536
|
+
if (xhrTraceparent) {
|
|
6537
|
+
originalXhrSetRequestHeader.call(this, "traceparent", xhrTraceparent);
|
|
6538
|
+
if (activeOptions.sessionId) {
|
|
6539
|
+
originalXhrSetRequestHeader.call(this, "x-mushi-session", activeOptions.sessionId);
|
|
6540
|
+
}
|
|
6541
|
+
}
|
|
6542
|
+
if (state.correlationId) _activeCorrelationStack.push(state.correlationId);
|
|
6543
|
+
const _readystateHandler = () => {
|
|
6544
|
+
if (this.readyState !== 4) return;
|
|
6545
|
+
if (state.shouldRecord) {
|
|
6546
|
+
const duration = Date.now() - state.startTime;
|
|
6547
|
+
const entry = {
|
|
6548
|
+
method: state.method,
|
|
6549
|
+
url: state.url,
|
|
6550
|
+
status: this.status,
|
|
6551
|
+
duration,
|
|
6552
|
+
timestamp: state.startTime,
|
|
6553
|
+
captureMethod: "xhr",
|
|
6554
|
+
...state.traceId ? { traceId: state.traceId } : {},
|
|
6555
|
+
...state.correlationId ? { correlationId: state.correlationId } : {}
|
|
6556
|
+
};
|
|
6557
|
+
if (this.status === 0) {
|
|
6558
|
+
entry.error = "XHR network error or aborted";
|
|
6559
|
+
}
|
|
6560
|
+
addEntry(entry);
|
|
6561
|
+
}
|
|
6562
|
+
if (state.correlationId) {
|
|
6563
|
+
const idx = _activeCorrelationStack.lastIndexOf(state.correlationId);
|
|
6564
|
+
if (idx !== -1) _activeCorrelationStack.splice(idx, 1);
|
|
6565
|
+
}
|
|
6566
|
+
};
|
|
6567
|
+
state._listener = _readystateHandler;
|
|
6568
|
+
this.addEventListener("readystatechange", _readystateHandler);
|
|
6569
|
+
}
|
|
6570
|
+
originalXhrSend.call(this, body);
|
|
6571
|
+
};
|
|
6572
|
+
}
|
|
6573
|
+
const xhrOpenWrapper = OriginalXHR ? XMLHttpRequest.prototype.open : null;
|
|
6574
|
+
const xhrSendWrapper = OriginalXHR ? XMLHttpRequest.prototype.send : null;
|
|
6263
6575
|
function addEntry(entry) {
|
|
6264
6576
|
entries.push(entry);
|
|
6265
|
-
if (entries.length >
|
|
6577
|
+
if (entries.length > MAX_ENTRIES) {
|
|
6266
6578
|
entries.shift();
|
|
6267
6579
|
}
|
|
6268
6580
|
}
|
|
@@ -6280,22 +6592,86 @@ function createNetworkCapture(options = {}) {
|
|
|
6280
6592
|
if (globalThis.fetch === fetchWrapper) {
|
|
6281
6593
|
globalThis.fetch = originalFetch;
|
|
6282
6594
|
}
|
|
6595
|
+
if (OriginalXHR && originalXhrOpen && originalXhrSend) {
|
|
6596
|
+
if (xhrOpenWrapper && XMLHttpRequest.prototype.open === xhrOpenWrapper) {
|
|
6597
|
+
XMLHttpRequest.prototype.open = originalXhrOpen;
|
|
6598
|
+
}
|
|
6599
|
+
if (xhrSendWrapper && XMLHttpRequest.prototype.send === xhrSendWrapper) {
|
|
6600
|
+
XMLHttpRequest.prototype.send = originalXhrSend;
|
|
6601
|
+
}
|
|
6602
|
+
}
|
|
6283
6603
|
}
|
|
6284
6604
|
};
|
|
6285
6605
|
}
|
|
6286
6606
|
function truncateUrl(url) {
|
|
6607
|
+
const scrubbed = scrubUrl(url);
|
|
6287
6608
|
try {
|
|
6288
|
-
const parsed = new URL(
|
|
6609
|
+
const parsed = new URL(scrubbed);
|
|
6289
6610
|
const path = parsed.pathname + parsed.search;
|
|
6290
6611
|
if (path.length > 200) {
|
|
6291
6612
|
return parsed.origin + path.slice(0, 200) + "...";
|
|
6292
6613
|
}
|
|
6293
6614
|
return parsed.origin + path;
|
|
6294
6615
|
} catch {
|
|
6295
|
-
return
|
|
6616
|
+
return scrubbed.slice(0, 200);
|
|
6296
6617
|
}
|
|
6297
6618
|
}
|
|
6298
6619
|
|
|
6620
|
+
// src/capture/console.ts
|
|
6621
|
+
var MAX_ENTRIES2 = 50;
|
|
6622
|
+
var MAX_MESSAGE_LENGTH = 500;
|
|
6623
|
+
function createConsoleCapture() {
|
|
6624
|
+
const entries = [];
|
|
6625
|
+
const originals = {};
|
|
6626
|
+
const wrappers = {};
|
|
6627
|
+
const levels = ["log", "warn", "error", "info", "debug"];
|
|
6628
|
+
for (const level of levels) {
|
|
6629
|
+
const original = console[level];
|
|
6630
|
+
originals[level] = original;
|
|
6631
|
+
const wrapper = (...args) => {
|
|
6632
|
+
const message = args.map((arg) => {
|
|
6633
|
+
try {
|
|
6634
|
+
return typeof arg === "string" ? arg : JSON.stringify(arg);
|
|
6635
|
+
} catch {
|
|
6636
|
+
return String(arg);
|
|
6637
|
+
}
|
|
6638
|
+
}).join(" ").slice(0, MAX_MESSAGE_LENGTH);
|
|
6639
|
+
const correlationId = getActiveCorrelationId();
|
|
6640
|
+
const entry = {
|
|
6641
|
+
level,
|
|
6642
|
+
message,
|
|
6643
|
+
timestamp: Date.now(),
|
|
6644
|
+
...correlationId ? { correlationId } : {}
|
|
6645
|
+
};
|
|
6646
|
+
if (level === "error" && args[0] instanceof Error) {
|
|
6647
|
+
entry.stack = args[0].stack?.slice(0, 1e3);
|
|
6648
|
+
}
|
|
6649
|
+
entries.push(entry);
|
|
6650
|
+
if (entries.length > MAX_ENTRIES2) {
|
|
6651
|
+
entries.shift();
|
|
6652
|
+
}
|
|
6653
|
+
original.call(console, ...args);
|
|
6654
|
+
};
|
|
6655
|
+
wrappers[level] = wrapper;
|
|
6656
|
+
console[level] = wrapper;
|
|
6657
|
+
}
|
|
6658
|
+
return {
|
|
6659
|
+
getEntries() {
|
|
6660
|
+
return [...entries];
|
|
6661
|
+
},
|
|
6662
|
+
clear() {
|
|
6663
|
+
entries.length = 0;
|
|
6664
|
+
},
|
|
6665
|
+
destroy() {
|
|
6666
|
+
for (const level of levels) {
|
|
6667
|
+
if (originals[level] && console[level] === wrappers[level]) {
|
|
6668
|
+
console[level] = originals[level];
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6671
|
+
}
|
|
6672
|
+
};
|
|
6673
|
+
}
|
|
6674
|
+
|
|
6299
6675
|
// src/capture/screenshot.ts
|
|
6300
6676
|
function createScreenshotCapture(options = {}) {
|
|
6301
6677
|
let activeOptions = options;
|
|
@@ -6829,8 +7205,6 @@ function createElementSelector() {
|
|
|
6829
7205
|
}
|
|
6830
7206
|
return { activate, deactivate, isActive: () => active };
|
|
6831
7207
|
}
|
|
6832
|
-
|
|
6833
|
-
// src/capture/timeline.ts
|
|
6834
7208
|
var MAX_TIMELINE_ENTRIES = 120;
|
|
6835
7209
|
function createTimelineCapture() {
|
|
6836
7210
|
const entries = [];
|
|
@@ -6847,8 +7221,11 @@ function createTimelineCapture() {
|
|
|
6847
7221
|
kind: "route",
|
|
6848
7222
|
payload: {
|
|
6849
7223
|
source,
|
|
6850
|
-
|
|
6851
|
-
|
|
7224
|
+
// Query VALUES are a PII channel (`?token=…`, `?email=…`) — scrub
|
|
7225
|
+
// them at capture, both in the search string and inside hash-router
|
|
7226
|
+
// fragments (`#/path?query`). Keys and paths are preserved.
|
|
7227
|
+
route: scrubUrl(`${location.pathname}${location.search}${location.hash}`),
|
|
7228
|
+
href: scrubUrl(location.href)
|
|
6852
7229
|
}
|
|
6853
7230
|
});
|
|
6854
7231
|
}
|
|
@@ -6935,6 +7312,18 @@ function normalizeSegment(seg) {
|
|
|
6935
7312
|
if (SLUG_HASHY_RE.test(seg) && /\d/.test(seg)) return "[id]";
|
|
6936
7313
|
return seg;
|
|
6937
7314
|
}
|
|
7315
|
+
function deriveRoute(pathname, hash, templates) {
|
|
7316
|
+
if (hash.startsWith("#/")) {
|
|
7317
|
+
const raw = hash.slice(1);
|
|
7318
|
+
const qIdx = raw.indexOf("?");
|
|
7319
|
+
const hashPath = qIdx === -1 ? raw : raw.slice(0, qIdx);
|
|
7320
|
+
const hashTemplates = templates?.map(
|
|
7321
|
+
(t) => t.startsWith("/#/") ? t.slice(2) : t
|
|
7322
|
+
);
|
|
7323
|
+
return "/#" + normalizeRoute(hashPath, hashTemplates);
|
|
7324
|
+
}
|
|
7325
|
+
return normalizeRoute(pathname, templates);
|
|
7326
|
+
}
|
|
6938
7327
|
function normalizeRoute(pathname, templates) {
|
|
6939
7328
|
const clean = pathname.length > 1 && pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
|
|
6940
7329
|
if (templates?.length) {
|
|
@@ -6978,9 +7367,14 @@ function readTestids() {
|
|
|
6978
7367
|
function readQueryParamKeys() {
|
|
6979
7368
|
if (typeof window === "undefined") return [];
|
|
6980
7369
|
try {
|
|
6981
|
-
const params = new URLSearchParams(window.location.search);
|
|
6982
7370
|
const out = /* @__PURE__ */ new Set();
|
|
6983
|
-
|
|
7371
|
+
const collect = (qs) => {
|
|
7372
|
+
new URLSearchParams(qs).forEach((_, key) => out.add(key));
|
|
7373
|
+
};
|
|
7374
|
+
collect(window.location.search);
|
|
7375
|
+
const hash = window.location.hash;
|
|
7376
|
+
const qIdx = hash.indexOf("?");
|
|
7377
|
+
if (hash.startsWith("#/") && qIdx !== -1) collect(hash.slice(qIdx + 1));
|
|
6984
7378
|
return Array.from(out).sort();
|
|
6985
7379
|
} catch {
|
|
6986
7380
|
return [];
|
|
@@ -7027,7 +7421,11 @@ function createDiscoveryCapture(opts) {
|
|
|
7027
7421
|
let pendingTimer = null;
|
|
7028
7422
|
async function emitForCurrent() {
|
|
7029
7423
|
if (typeof window === "undefined") return;
|
|
7030
|
-
const route =
|
|
7424
|
+
const route = deriveRoute(
|
|
7425
|
+
window.location.pathname,
|
|
7426
|
+
window.location.hash,
|
|
7427
|
+
config.routeTemplates
|
|
7428
|
+
);
|
|
7031
7429
|
const now = Date.now();
|
|
7032
7430
|
const last = lastEmittedAt.get(route) ?? 0;
|
|
7033
7431
|
if (now - last < throttleMs) return;
|
|
@@ -7059,7 +7457,8 @@ function createDiscoveryCapture(opts) {
|
|
|
7059
7457
|
}
|
|
7060
7458
|
function onMaybeNavigation() {
|
|
7061
7459
|
if (typeof window === "undefined") return;
|
|
7062
|
-
const
|
|
7460
|
+
const hashPart = window.location.hash.startsWith("#/") ? window.location.hash : "";
|
|
7461
|
+
const path = window.location.pathname + window.location.search + hashPart;
|
|
7063
7462
|
if (path === lastPath) return;
|
|
7064
7463
|
lastPath = path;
|
|
7065
7464
|
scheduleEmit();
|
|
@@ -7076,10 +7475,12 @@ function createDiscoveryCapture(opts) {
|
|
|
7076
7475
|
onReplace: onNav,
|
|
7077
7476
|
onPop: onNav
|
|
7078
7477
|
});
|
|
7478
|
+
window.addEventListener("hashchange", onNav);
|
|
7079
7479
|
scheduleEmit();
|
|
7080
7480
|
return {
|
|
7081
7481
|
destroy() {
|
|
7082
7482
|
unsubHistory();
|
|
7483
|
+
window.removeEventListener("hashchange", onNav);
|
|
7083
7484
|
if (pendingTimer) {
|
|
7084
7485
|
clearTimeout(pendingTimer);
|
|
7085
7486
|
pendingTimer = null;
|
|
@@ -7898,6 +8299,14 @@ function createInstance(config) {
|
|
|
7898
8299
|
return next;
|
|
7899
8300
|
});
|
|
7900
8301
|
}
|
|
8302
|
+
function scrubConsoleForWire(logs) {
|
|
8303
|
+
if (!logs) return logs;
|
|
8304
|
+
return logs.map((entry) => ({
|
|
8305
|
+
...entry,
|
|
8306
|
+
message: piiScrubber.scrub(entry.message),
|
|
8307
|
+
...entry.stack ? { stack: piiScrubber.scrub(entry.stack) } : {}
|
|
8308
|
+
}));
|
|
8309
|
+
}
|
|
7901
8310
|
function scrubTagsForWire(tags) {
|
|
7902
8311
|
if (!tags) return void 0;
|
|
7903
8312
|
const out = {};
|
|
@@ -8046,7 +8455,9 @@ function createInstance(config) {
|
|
|
8046
8455
|
discoveryCap = null;
|
|
8047
8456
|
}
|
|
8048
8457
|
const replayMode = activeConfig.capture?.replay ?? "off";
|
|
8049
|
-
|
|
8458
|
+
const replaySampleRate = activeConfig.replaySampleRate ?? 1;
|
|
8459
|
+
const replaySampled = replaySampleRate >= 1 || Math.random() < replaySampleRate;
|
|
8460
|
+
if ((replayMode === "rrweb" || replayMode === "lite") && replaySampled) {
|
|
8050
8461
|
const generation = ++replayGeneration;
|
|
8051
8462
|
void createReplayCapture({
|
|
8052
8463
|
redactSelectors: activeConfig.privacy?.redactSelectors
|
|
@@ -8585,6 +8996,13 @@ function createInstance(config) {
|
|
|
8585
8996
|
});
|
|
8586
8997
|
}
|
|
8587
8998
|
}
|
|
8999
|
+
const isAutomatic = pendingProactiveTrigger !== null;
|
|
9000
|
+
if (isAutomatic && config.sampleRate !== void 0 && config.sampleRate < 1) {
|
|
9001
|
+
if (config.sampleRate <= 0 || Math.random() > config.sampleRate) {
|
|
9002
|
+
log.debug("Report dropped by sampleRate", { sampleRate: config.sampleRate, trigger: pendingProactiveTrigger });
|
|
9003
|
+
return void 0;
|
|
9004
|
+
}
|
|
9005
|
+
}
|
|
8588
9006
|
if (!rateLimiter.tryConsume()) {
|
|
8589
9007
|
log.warn("Report throttled \u2014 rate limit exceeded");
|
|
8590
9008
|
return void 0;
|
|
@@ -8592,7 +9010,7 @@ function createInstance(config) {
|
|
|
8592
9010
|
const scrubbedDescription = piiScrubber.scrub(preFilter.truncate(description));
|
|
8593
9011
|
const sentryCtx = config.sentry ? captureSentryContext(config.sentry) : void 0;
|
|
8594
9012
|
const fingerprintHash = await getDeviceFingerprintHash().catch(() => null);
|
|
8595
|
-
const consoleLogs = activeConfig.capture?.console === false ? void 0 : consoleCap?.getEntries();
|
|
9013
|
+
const consoleLogs = activeConfig.capture?.console === false ? void 0 : scrubConsoleForWire(consoleCap?.getEntries());
|
|
8596
9014
|
const networkLogs = activeConfig.capture?.network === false ? void 0 : networkCap?.getEntries();
|
|
8597
9015
|
const reportBreadcrumbs = scrubBreadcrumbsForWire(breadcrumbs.getAll());
|
|
8598
9016
|
const stickyTagSnapshot = scrubTagsForWire(
|
|
@@ -8670,10 +9088,11 @@ function createInstance(config) {
|
|
|
8670
9088
|
config.integrations.custom(builder);
|
|
8671
9089
|
}
|
|
8672
9090
|
let finalReport = report;
|
|
8673
|
-
|
|
9091
|
+
const sendHook = config.beforeSend ?? config.beforeSendFeedback;
|
|
9092
|
+
if (sendHook) {
|
|
8674
9093
|
try {
|
|
8675
9094
|
const hookResult = await Promise.race([
|
|
8676
|
-
Promise.resolve(
|
|
9095
|
+
Promise.resolve(sendHook(report)),
|
|
8677
9096
|
// 2s timeout — async hooks must not block the user's "submit"
|
|
8678
9097
|
// for longer than the network would. Falls back to original.
|
|
8679
9098
|
new Promise(
|
|
@@ -8681,12 +9100,12 @@ function createInstance(config) {
|
|
|
8681
9100
|
)
|
|
8682
9101
|
]);
|
|
8683
9102
|
if (hookResult === null) {
|
|
8684
|
-
log.info("Report dropped by
|
|
9103
|
+
log.info("Report dropped by beforeSend hook", { reportId: report.id });
|
|
8685
9104
|
return;
|
|
8686
9105
|
}
|
|
8687
9106
|
finalReport = hookResult;
|
|
8688
9107
|
} catch (err) {
|
|
8689
|
-
log.warn("
|
|
9108
|
+
log.warn("beforeSend hook threw \u2014 sending unmodified report", {
|
|
8690
9109
|
error: err instanceof Error ? err.message : String(err)
|
|
8691
9110
|
});
|
|
8692
9111
|
}
|
|
@@ -8696,7 +9115,7 @@ function createInstance(config) {
|
|
|
8696
9115
|
await offlineQueue.enqueue(finalReport);
|
|
8697
9116
|
log.info("Offline \u2014 report queued", { reportId: finalReport.id });
|
|
8698
9117
|
emit("report:queued", { reportId: finalReport.id });
|
|
8699
|
-
return { reportId: null, queuedOffline: true };
|
|
9118
|
+
return { reportId: null, queuedOffline: true, failureKind: "offline" };
|
|
8700
9119
|
}
|
|
8701
9120
|
let result = await apiClient2.submitReport(finalReport);
|
|
8702
9121
|
if (!result.ok && result.error?.code === "PAYLOAD_TOO_LARGE") {
|
|
@@ -8750,7 +9169,32 @@ function createInstance(config) {
|
|
|
8750
9169
|
level: "error",
|
|
8751
9170
|
message: `Mushi report dropped \u2014 payload too large (${finalReport.id})`
|
|
8752
9171
|
});
|
|
9172
|
+
pendingScreenshot = null;
|
|
9173
|
+
pendingElement = null;
|
|
9174
|
+
pendingProactiveTrigger = null;
|
|
9175
|
+
return { reportId: null, queuedOffline: false, failureKind: "permanent", screenshotDropped };
|
|
8753
9176
|
} else {
|
|
9177
|
+
const code = result.error?.code ?? "";
|
|
9178
|
+
const isRateLimited = code === "HTTP_429" || code.includes("RATE_LIMIT");
|
|
9179
|
+
const isAuth = code === "HTTP_401" || code.includes("UNAUTHORIZED") || code.includes("INVALID_API_KEY") || code.includes("MISSING_API_KEY");
|
|
9180
|
+
const isQuota = code === "HTTP_403" || code.includes("QUOTA") || code.includes("FORBIDDEN") || code === "feature_not_in_plan";
|
|
9181
|
+
if (isAuth || isQuota) {
|
|
9182
|
+
log.warn("Report rejected \u2014 credentials/quota", { reportId: finalReport.id, error: result.error });
|
|
9183
|
+
emit("report:failed", { reportId: finalReport.id, error: result.error });
|
|
9184
|
+
pendingScreenshot = null;
|
|
9185
|
+
pendingElement = null;
|
|
9186
|
+
pendingProactiveTrigger = null;
|
|
9187
|
+
return { reportId: null, queuedOffline: false, failureKind: "quota" };
|
|
9188
|
+
}
|
|
9189
|
+
if (isRateLimited) {
|
|
9190
|
+
log.warn("Report rate-limited \u2014 queued for retry", { reportId: finalReport.id, error: result.error });
|
|
9191
|
+
await offlineQueue.enqueue(finalReport);
|
|
9192
|
+
emit("report:failed", { reportId: finalReport.id, error: result.error });
|
|
9193
|
+
pendingScreenshot = null;
|
|
9194
|
+
pendingElement = null;
|
|
9195
|
+
pendingProactiveTrigger = null;
|
|
9196
|
+
return { reportId: null, queuedOffline: true, failureKind: "rate_limited" };
|
|
9197
|
+
}
|
|
8754
9198
|
log.warn("Report failed, queuing for retry", { reportId: finalReport.id, error: result.error });
|
|
8755
9199
|
await offlineQueue.enqueue(finalReport);
|
|
8756
9200
|
emit("report:failed", { reportId: finalReport.id, error: result.error });
|
|
@@ -8767,7 +9211,7 @@ function createInstance(config) {
|
|
|
8767
9211
|
const serverId = result.data?.reportId ?? report.id;
|
|
8768
9212
|
return { reportId: serverId, queuedOffline: false, screenshotDropped };
|
|
8769
9213
|
}
|
|
8770
|
-
return { reportId: null, queuedOffline: true };
|
|
9214
|
+
return { reportId: null, queuedOffline: true, failureKind: "retrying" };
|
|
8771
9215
|
}
|
|
8772
9216
|
const sdk = {
|
|
8773
9217
|
report(options) {
|