diff --git a/.env.example b/.env.example index 9371883d..f431a103 100644 --- a/.env.example +++ b/.env.example @@ -54,6 +54,8 @@ SUPERMETRY_HTTP_WRITE_TIMEOUT=60s # --- Tracking (rename paths to dodge ad-blockers) --- SUPERMETRY_EVENT_PATH=/api/public/v1/events SUPERMETRY_TRACKER_PATH=/js/script.js +# Per-site scripts loaded from SUPERMETRY_BASE_URL send to /e/ paths. false keeps the paths above. +# SUPERMETRY_NEUTRAL_PATHS=true # Exact operator-reviewed public path literals only; no globs, IDs, or secrets. # Absent or [] denies all anonymous paths. Changes require a coordinated restart. # Example: SUPERMETRY_TRACKING_PUBLIC_PATHS='["/","/pricing"]' diff --git a/CHANGELOG.md b/CHANGELOG.md index 19ecde85..bfff3069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ Supermetry is a self-hosted web analytics product: one Go binary and PostgreSQL, ## Unreleased +### Added + +- Neutral per-site intake paths to get past ad blocker rules for analytics URLs. Events go to `POST /e/`. Replay uses `/e//r.js` for the recorder, `/e//s` to start, `/e//c` for chunks and `/e//k/` for stylesheets. A site's script uses them when it is loaded straight from `SUPERMETRY_BASE_URL`, and keeps the classic paths behind a first-party proxy. Requests whose body or `?s=` names another site are rejected. The classic paths are unchanged. `SUPERMETRY_NEUTRAL_PATHS=false` turns this off. + +### Changed + +- The tracker's lazy-module loader requests `?m=v,h,r` instead of `?module=vitals,heatmap,replay`. The long form is still accepted. + ## v0.1.19 (2026-10-28) ### Changed diff --git a/cmd/supermetry/serve.go b/cmd/supermetry/serve.go index da1efb57..fc310199 100644 --- a/cmd/supermetry/serve.go +++ b/cmd/supermetry/serve.go @@ -903,6 +903,11 @@ func classifySecurityRoute(cfg config.Config, requestPath string) securityRouteC if requestPath == "/replay.js" || isTrackerPath(cfg.TrackerPath, requestPath) { return securityRouteTracker } + if intake, recorder := api.NeutralPathKind(requestPath); intake { + return securityRouteCrossOriginIntake + } else if recorder { + return securityRouteTracker + } if strings.HasPrefix(requestPath, "/share/") { return securityRouteShare } diff --git a/cmd/supermetry/serve_http_test.go b/cmd/supermetry/serve_http_test.go index 86412f60..3755c13d 100644 --- a/cmd/supermetry/serve_http_test.go +++ b/cmd/supermetry/serve_http_test.go @@ -260,6 +260,10 @@ func TestSecurityHeadersByRouteClass(t *testing.T) { {name: "tracker event", path: "/api/public/v1/events", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, {name: "replay chunk", path: "/api/replay/chunk", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, {name: "replay CSS", path: "/api/replay/css/abc", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, + {name: "neutral event", path: "/e/abc123", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, + {name: "neutral replay start", path: "/e/abc123/s", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, + {name: "neutral replay CSS", path: "/e/abc123/k/abc", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, + {name: "neutral recorder", path: "/e/abc123/r.js", want: with(map[string]string{"Cross-Origin-Resource-Policy": "cross-origin"})}, {name: "health", path: "/healthz", want: with(map[string]string{"Content-Security-Policy": apiCSP, "X-Frame-Options": "DENY", "Cross-Origin-Resource-Policy": "same-origin"})}, {name: "metrics", path: "/metrics", want: with(map[string]string{"Content-Security-Policy": apiCSP, "X-Frame-Options": "DENY", "Cross-Origin-Resource-Policy": "same-origin"})}, {name: "share-link page", path: "/share/shr_example", want: with(map[string]string{"Content-Security-Policy": shareCSP, "Permissions-Policy": appPermissions, "X-Frame-Options": "DENY", "Cross-Origin-Resource-Policy": "same-origin"})}, diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index 5f901992..94a4fb0b 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -73,10 +73,27 @@ To check the setup, set `SUPERMETRY_INGEST_DIAG=1` (below) and look at `peer_tru |---|---|---|---| | `SUPERMETRY_EVENT_PATH` | URL path the tracker posts events to. Must start with `/`. | `/api/public/v1/events` | `/a/e` | | `SUPERMETRY_TRACKER_PATH` | URL path the tracker script is served from. Must start with `/`. | `/js/script.js` | `/a/t.js` | +| `SUPERMETRY_NEUTRAL_PATHS` | Per-site scripts loaded straight from `SUPERMETRY_BASE_URL` send events and replay to the site's own `/e/` paths (see below). `false` keeps the classic paths. The `/e/` routes are served either way. | `true` | `false` | | `SUPERMETRY_TRACKING_MODE` | `identified` collects real page paths, referrers and campaigns, and new projects start with profiles on. `anonymous` is the strictest mode. See [Tracking and privacy](../tracking-privacy.md). Changing it needs a restart. | `identified` | `anonymous` | Ad blockers match on well-known names such as `script.js` or `/events`. Changing both paths to neutral values avoids those filters. The tracking snippet shown in the dashboard is built from `SUPERMETRY_BASE_URL` plus these paths, so reinstall the snippet on your sites after changing them. Whether the old paths keep working after a change: see source (`internal/api/router.go`). If a proxy routes only specific paths to Supermetry, update it to match. +### Neutral per-site paths + +Each site also has its own intake paths under `/e/`. None of them contains a word that ad blocker rules look for: + +| Classic path | Neutral path | +|---|---| +| `POST /api/public/v1/events` (`SUPERMETRY_EVENT_PATH`) | `POST /e/` | +| `GET /replay.js` | `GET /e//r.js` | +| `POST /api/replay/start` | `POST /e//s` | +| `POST /api/replay/chunk?s=` | `POST /e//c?s=` | +| `PUT /api/replay/css/?s=` | `PUT /e//k/?s=` | + +A site's script (`/js/.js`) uses the neutral paths when it is loaded straight from `SUPERMETRY_BASE_URL`. When it is loaded from any other origin, such as a first-party proxy that forwards only the classic paths, it keeps the classic paths, so existing proxies keep working. The script names its lazily loaded modules by short code (`?m=v,h,r`), so its URL never contains `replay` or `heatmap`. The server rejects a request whose body or `?s=` names a site other than the one in the path. The classic paths stay available. + +Neutral paths do not help when a filter list blocks the Supermetry host itself. Only a first-party proxy on your own domain avoids that. + ### Referrer spam list Supermetry ships a list of referrer-spam domains that changes only with a release. To add your own domains without waiting for one, set `SUPERMETRY_REFERRER_SPAM_FILE` to a text file with one hostname per line (blank lines and lines starting with `#` are ignored; no inline comments). The file is limited to 1 MiB. It is validated as a whole: one invalid line rejects the file and the server refuses to start. It is read at startup only, so restart Supermetry after changing it. A listed domain also blocks its subdomains (`evil.example` blocks `a.evil.example`, not `notevil.example`). diff --git a/internal/api/neutral.go b/internal/api/neutral.go new file mode 100644 index 00000000..2352d042 --- /dev/null +++ b/internal/api/neutral.go @@ -0,0 +1,155 @@ +package api + +import ( + "net/http" + "strconv" + "strings" + + "supermetry/internal/ingest" + "supermetry/internal/replay" +) + +// Neutral intake paths give every site its own URLs under /e/{site}, so ad +// blocker rules written for well-known analytics paths (/api/.../events, +// /replay.js, /api/replay/...) do not match. Each one is an alias that +// rewrites the request to the legacy path and hands it to the legacy handler, +// which also rejects a request whose body or query names another site. +// +// POST /e/{site} events +// GET /e/{site}/r.js replay recorder +// POST /e/{site}/s replay start +// POST /e/{site}/c?s=... replay chunk +// PUT /e/{site}/k/{hash} replay stylesheet +const neutralPrefix = "/e/" + +// NeutralPathKind reports whether p is a neutral intake path (events or +// replay uploads) or the neutral replay recorder script. +func NeutralPathKind(p string) (intake, recorder bool) { + _, rest, ok := splitNeutralPath(p) + if !ok { + return false, false + } + switch { + case rest == "", rest == "s", rest == "c": + return true, false + case rest == "r.js": + return false, true + case strings.HasPrefix(rest, "k/") && validNeutralSegment(rest[2:]): + return true, false + } + return false, false +} + +// splitNeutralPath splits /e/{site}[/{rest}] and validates the site segment. +func splitNeutralPath(p string) (site, rest string, ok bool) { + tail, found := strings.CutPrefix(p, neutralPrefix) + if !found { + return "", "", false + } + site, rest, hasRest := strings.Cut(tail, "/") + if !validNeutralSegment(site) || hasRest && rest == "" { + return "", "", false + } + return site, rest, true +} + +func validNeutralSegment(value string) bool { + if value == "" || len(value) > 64 { + return false + } + for _, c := range value { + if !(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '-' || c == '_') { + return false + } + } + return true +} + +type neutralDeps struct { + ingest http.Handler // already wrapped in trackerCORS; nil when ingest is off + eventPath string + replay http.Handler // start and chunk; nil when replay is off + replayCSS http.Handler + recorder http.Handler + replayEnabled bool +} + +func neutralHandler(deps neutralDeps) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + site, rest, ok := splitNeutralPath(r.URL.Path) + if !ok { + http.NotFound(w, r) + return + } + replayOn := deps.replayEnabled && deps.replay != nil + switch { + case rest == "": + if deps.ingest == nil { + http.NotFound(w, r) + return + } + if r.Method != http.MethodPost && r.Method != http.MethodOptions { + w.Header().Set("Allow", "POST, OPTIONS") + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + deps.ingest.ServeHTTP(w, neutralRequest(r, site, deps.eventPath)) + case rest == "s" && replayOn: + deps.replay.ServeHTTP(w, neutralRequest(r, site, "/api/replay/start")) + case rest == "c" && replayOn: + if !neutralQuerySite(w, r, site) { + return + } + deps.replay.ServeHTTP(w, neutralRequest(r, site, "/api/replay/chunk")) + case strings.HasPrefix(rest, "k/") && validNeutralSegment(rest[2:]) && deps.replayEnabled && deps.replayCSS != nil: + if !neutralQuerySite(w, r, site) { + return + } + deps.replayCSS.ServeHTTP(w, neutralRequest(r, site, "/api/replay/css/"+rest[2:])) + case rest == "r.js" && deps.replayEnabled: + deps.recorder.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// neutralQuerySite checks that a replay upload's ?s= names the path's site. +// Preflights carry no query worth checking. +func neutralQuerySite(w http.ResponseWriter, r *http.Request, site string) bool { + if r.Method == http.MethodOptions || r.URL.Query().Get("s") == site { + return true + } + http.Error(w, "site does not match path", http.StatusBadRequest) + return false +} + +func neutralRequest(r *http.Request, site, legacyPath string) *http.Request { + clone := r.Clone(ingest.WithPathSite(r.Context(), site)) + clone.URL.Path = legacyPath + clone.URL.RawPath = "" + return clone +} + +// recorderHandler serves the replay recorder script (/replay.js and its +// neutral alias). +func recorderHandler(enabled bool) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, request *http.Request) { + if !enabled { + http.NotFound(w, request) + return + } + body, etag := replay.ReplayJS() + w.Header().Set("Content-Type", "application/javascript") + w.Header().Set("Cache-Control", "public, max-age=86400") + w.Header().Set("ETag", etag) + if request.Header.Get("If-None-Match") == etag { + w.WriteHeader(http.StatusNotModified) + return + } + w.Header().Set("Content-Length", strconv.Itoa(len(body))) + if request.Method != http.MethodHead { + _, _ = w.Write(body) + } + }) +} diff --git a/internal/api/neutral_test.go b/internal/api/neutral_test.go new file mode 100644 index 00000000..50098224 --- /dev/null +++ b/internal/api/neutral_test.go @@ -0,0 +1,154 @@ +package api_test + +import ( + "net/http" + "net/http/httptest" + "strings" + "testing" + + "supermetry/internal/api" + "supermetry/internal/config" + "supermetry/internal/ingest" +) + +type seenRequest struct { + path, site string + called bool +} + +func recordingHandler(seen *seenRequest) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + seen.called = true + seen.path = r.URL.Path + seen.site, _ = ingest.PathSite(r.Context()) + w.WriteHeader(http.StatusAccepted) + }) +} + +func neutralRouter(replayEnabled bool) (http.Handler, *seenRequest, *seenRequest, *seenRequest) { + events, replay, css := &seenRequest{}, &seenRequest{}, &seenRequest{} + cfg := config.Config{EventPath: "/api/public/v1/events", AdminAPIKey: "test-key"} + cfg.Replay.Enabled = replayEnabled + router := api.NewRouter(api.Deps{ + Config: cfg, + Ingest: recordingHandler(events), + Replay: recordingHandler(replay), + ReplayCSS: recordingHandler(css), + }) + return router, events, replay, css +} + +func TestNeutralPathsReachLegacyHandlers(t *testing.T) { + router, events, replay, css := neutralRouter(true) + tests := []struct { + name, method, target string + seen *seenRequest + wantPath, wantSite string + }{ + {"events", http.MethodPost, "/e/abc123", events, "/api/public/v1/events", "abc123"}, + {"replay start", http.MethodPost, "/e/abc123/s", replay, "/api/replay/start", "abc123"}, + {"replay chunk", http.MethodPost, "/e/abc123/c?s=abc123&q=1", replay, "/api/replay/chunk", "abc123"}, + {"replay css", http.MethodPut, "/e/abc123/k/0123abcd?s=abc123", css, "/api/replay/css/0123abcd", "abc123"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + *tt.seen = seenRequest{} + response := httptest.NewRecorder() + router.ServeHTTP(response, httptest.NewRequest(tt.method, tt.target, strings.NewReader("{}"))) + if response.Code != http.StatusAccepted || !tt.seen.called { + t.Fatalf("status %d, called %v", response.Code, tt.seen.called) + } + if tt.seen.path != tt.wantPath || tt.seen.site != tt.wantSite { + t.Fatalf("handler saw path %q site %q, want %q %q", tt.seen.path, tt.seen.site, tt.wantPath, tt.wantSite) + } + }) + } +} + +func TestNeutralEventsPreflightAllowsCrossOrigin(t *testing.T) { + router, events, _, _ := neutralRouter(false) + response := httptest.NewRecorder() + router.ServeHTTP(response, httptest.NewRequest(http.MethodOptions, "/e/abc123", nil)) + if response.Code != http.StatusNoContent || response.Header().Get("Access-Control-Allow-Origin") != "*" { + t.Fatalf("preflight status %d, headers %v", response.Code, response.Header()) + } + if events.called { + t.Fatal("preflight reached the ingest handler") + } +} + +func TestNeutralPathsRejectMismatchedOrUnknownRoutes(t *testing.T) { + router, events, replay, css := neutralRouter(true) + tests := []struct { + name, method, target string + want int + }{ + {"chunk site mismatch", http.MethodPost, "/e/abc123/c?s=other", http.StatusBadRequest}, + {"chunk site missing", http.MethodPost, "/e/abc123/c", http.StatusBadRequest}, + {"css site mismatch", http.MethodPut, "/e/abc123/k/0123abcd?s=other", http.StatusBadRequest}, + {"unknown sub-path", http.MethodPost, "/e/abc123/zzz", http.StatusNotFound}, + {"trailing slash", http.MethodPost, "/e/abc123/", http.StatusNotFound}, + {"bad id", http.MethodPost, "/e/a.b", http.StatusNotFound}, + {"events wrong method", http.MethodGet, "/e/abc123", http.StatusMethodNotAllowed}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + *events, *replay, *css = seenRequest{}, seenRequest{}, seenRequest{} + response := httptest.NewRecorder() + router.ServeHTTP(response, httptest.NewRequest(tt.method, tt.target, strings.NewReader("{}"))) + if response.Code != tt.want { + t.Fatalf("status %d, want %d", response.Code, tt.want) + } + if events.called || replay.called || css.called { + t.Fatal("request reached a handler") + } + }) + } +} + +func TestNeutralReplayRoutesOffWhenReplayDisabled(t *testing.T) { + router, _, replay, _ := neutralRouter(false) + for _, target := range []string{"/e/abc123/s", "/e/abc123/r.js"} { + method := http.MethodPost + if strings.HasSuffix(target, ".js") { + method = http.MethodGet + } + response := httptest.NewRecorder() + router.ServeHTTP(response, httptest.NewRequest(method, target, nil)) + if response.Code != http.StatusNotFound || replay.called { + t.Fatalf("%s: status %d, called %v", target, response.Code, replay.called) + } + } +} + +func TestNeutralRecorderServesReplayScript(t *testing.T) { + router, _, _, _ := neutralRouter(true) + legacy, neutral := httptest.NewRecorder(), httptest.NewRecorder() + router.ServeHTTP(legacy, httptest.NewRequest(http.MethodGet, "/replay.js", nil)) + router.ServeHTTP(neutral, httptest.NewRequest(http.MethodGet, "/e/abc123/r.js", nil)) + if neutral.Code != http.StatusOK || neutral.Body.String() != legacy.Body.String() || neutral.Header().Get("ETag") != legacy.Header().Get("ETag") { + t.Fatalf("neutral recorder status %d, same body %v", neutral.Code, neutral.Body.String() == legacy.Body.String()) + } +} + +func TestNeutralPathClassification(t *testing.T) { + tests := []struct { + path string + intake, recorder bool + }{ + {"/e/abc123", true, false}, + {"/e/abc123/s", true, false}, + {"/e/abc123/c", true, false}, + {"/e/abc123/k/0123abcd", true, false}, + {"/e/abc123/r.js", false, true}, + {"/e/abc123/zzz", false, false}, + {"/e/", false, false}, + {"/events", false, false}, + } + for _, tt := range tests { + intake, recorder := api.NeutralPathKind(tt.path) + if intake != tt.intake || recorder != tt.recorder { + t.Errorf("%s: intake %v recorder %v, want %v %v", tt.path, intake, recorder, tt.intake, tt.recorder) + } + } +} diff --git a/internal/api/router.go b/internal/api/router.go index 99baf32c..5033bebe 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -29,7 +29,6 @@ import ( "supermetry/internal/opencounters" "supermetry/internal/privacy" "supermetry/internal/realtime" - "supermetry/internal/replay" "supermetry/internal/routehits" "supermetry/internal/session" "supermetry/internal/sites" @@ -177,11 +176,15 @@ func NewRouter(deps Deps) http.Handler { mux.Handle(privatePrefix+"/", authenticate(deps.PrivateAuth, deps.Sites, requireCSRF(trackingReads(deps.Config.Tracking.Mode, routehits.WrapFile(private, routehits.File(deps.Config.RouteHitsFile)))))) registerPlatformRoutes(mux, deps.Platform, deps.PublicAuth, deps.Sites, deps.RateLimiter, apiLimiter, deps.Config.TrustedProxies, rateLimitNow) + neutral := neutralDeps{replay: deps.Replay, replayCSS: deps.ReplayCSS, recorder: recorderHandler(deps.Config.Replay.Enabled), replayEnabled: deps.Config.Replay.Enabled, eventPath: deps.Config.EventPath} if deps.Ingest != nil && deps.Config.EventPath != "" { ingest := trackerCORS(deps.Ingest) mux.Handle("POST "+deps.Config.EventPath, ingest) mux.Handle("OPTIONS "+deps.Config.EventPath, ingest) + neutral.ingest = ingest } + mux.Handle(neutralPrefix+"{site}", neutralHandler(neutral)) + mux.Handle(neutralPrefix+"{site}/{rest...}", neutralHandler(neutral)) if deps.Links != nil { mux.HandleFunc("GET /l/{slug}", deps.Links.ServeRedirect) if deps.Pixels != nil { @@ -217,28 +220,16 @@ func NewRouter(deps Deps) http.Handler { mux.Handle("GET "+tracker.FullPath(deps.Config.TrackerPath), tracker.FullHandler()) if deps.Sites != nil { tracker.SetEventPath(deps.Config.EventPath) + if deps.Config.NeutralPaths { + tracker.SetNeutralBase(deps.Config.BaseURL) + } else { + tracker.SetNeutralBase("") + } tracker.SetScriptDir(path.Dir(deps.Config.TrackerPath)) mux.Handle("GET "+path.Dir(deps.Config.TrackerPath)+"/", tracker.SiteHandlerWithPolicy(deps.Sites, deps.Config.Replay, deps.Config.Tracking.Mode)) } } - mux.HandleFunc("GET /replay.js", func(w http.ResponseWriter, request *http.Request) { - if !deps.Config.Replay.Enabled { - http.NotFound(w, request) - return - } - body, etag := replay.ReplayJS() - w.Header().Set("Content-Type", "application/javascript") - w.Header().Set("Cache-Control", "public, max-age=86400") - w.Header().Set("ETag", etag) - if request.Header.Get("If-None-Match") == etag { - w.WriteHeader(http.StatusNotModified) - return - } - w.Header().Set("Content-Length", strconv.Itoa(len(body))) - if request.Method != http.MethodHead { - _, _ = w.Write(body) - } - }) + mux.Handle("GET /replay.js", recorderHandler(deps.Config.Replay.Enabled)) mux.HandleFunc("GET /api/public/openapi.json", serveOpenAPI) if deps.UI != nil { // Least specific pattern: API, intake, tracker and ops routes above take precedence. diff --git a/internal/config/config.go b/internal/config/config.go index c930fc95..3a675071 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -83,13 +83,17 @@ type Config struct { OpenCounterBlocklist string EventPath string TrackerPath string - GeoIPPath string - DataDir string - MaxMindAccountID string - MaxMindLicenseKey string - MaxMindEditions []string - SitesFile string - QueueSize int + // NeutralPaths makes per-site scripts loaded straight from BaseURL send to + // /e/ instead of the classic intake paths (SUPERMETRY_NEUTRAL_PATHS, + // default on). The /e/ routes are served either way. + NeutralPaths bool + GeoIPPath string + DataDir string + MaxMindAccountID string + MaxMindLicenseKey string + MaxMindEditions []string + SitesFile string + QueueSize int // MaxOrgsPerUser and MaxSitesPerOrg limit what a user who is not an instance // admin may create. Instance admins are unlimited. MaxOrgsPerUser int @@ -198,6 +202,7 @@ func LoadLookup(lookup func(string) (string, bool)) (Config, error) { OpenCounterBlocklist: strings.TrimSpace(getenv("SUPERMETRY_OPEN_COUNTER_BLOCKLIST")), EventPath: valueOrDefault(getenv("SUPERMETRY_EVENT_PATH"), defaultEventPath), TrackerPath: valueOrDefault(getenv("SUPERMETRY_TRACKER_PATH"), defaultTrackerPath), + NeutralPaths: true, GeoIPPath: geo.GeoIPPath, DataDir: geo.DataDir, MaxMindAccountID: geo.MaxMindAccountID, @@ -293,6 +298,7 @@ func LoadLookup(lookup func(string) (string, bool)) (Config, error) { } } parseOptionalBool(getenv("SUPERMETRY_REPLAY_ENABLED"), "SUPERMETRY_REPLAY_ENABLED", &c.Replay.Enabled, &errs) + parseOptionalBool(getenv("SUPERMETRY_NEUTRAL_PATHS"), "SUPERMETRY_NEUTRAL_PATHS", &c.NeutralPaths, &errs) parseOptionalBool(getenv("SUPERMETRY_MANAGED"), "SUPERMETRY_MANAGED", &c.Managed, &errs) parseOptionalBool(getenv("SUPERMETRY_RETENTION_FOREVER"), "SUPERMETRY_RETENTION_FOREVER", &c.RetentionForever, &errs) if raw := strings.TrimSpace(getenv("SUPERMETRY_DEFAULT_RETENTION_DAYS")); raw != "" { diff --git a/internal/config/config_test.go b/internal/config/config_test.go index e3114ccf..1ccd2155 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -736,3 +736,25 @@ func TestLoadSMTPHello(t *testing.T) { t.Fatalf("invalid SUPERMETRY_SMTP_HELO error = %v", err) } } + +func TestNeutralPathsOnByDefaultAndSwitchable(t *testing.T) { + load := func(raw string) (Config, error) { + values := baseEnv() + if raw != "" { + values["SUPERMETRY_NEUTRAL_PATHS"] = raw + } + return LoadLookup(func(key string) (string, bool) { + value, ok := values[key] + return value, ok + }) + } + if c, err := load(""); err != nil || !c.NeutralPaths { + t.Fatalf("default: NeutralPaths=%v err=%v, want on", c.NeutralPaths, err) + } + if c, err := load("false"); err != nil || c.NeutralPaths { + t.Fatalf("false: NeutralPaths=%v err=%v, want off", c.NeutralPaths, err) + } + if _, err := load("maybe"); err == nil || !strings.Contains(err.Error(), "SUPERMETRY_NEUTRAL_PATHS") { + t.Fatalf("invalid value error = %v", err) + } +} diff --git a/internal/ingest/handler.go b/internal/ingest/handler.go index f8a8989d..32104d65 100644 --- a/internal/ingest/handler.go +++ b/internal/ingest/handler.go @@ -100,6 +100,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.invalid(w) return } + if pathSite, ok := PathSite(r.Context()); ok && pathSite != payload.Site { + h.invalid(w) + return + } if h.Sites == nil || h.Enricher == nil || h.Salts == nil || h.Dict == nil || h.Sessions == nil || h.Writer == nil { h.unavailable(w) return diff --git a/internal/ingest/handler_test.go b/internal/ingest/handler_test.go index 97e58b81..e26d8477 100644 --- a/internal/ingest/handler_test.go +++ b/internal/ingest/handler_test.go @@ -1539,3 +1539,27 @@ func TestBackgroundPingsAfterIdleDoNotStartSessions(t *testing.T) { t.Fatalf("sessions=%d events=%d, want 2 sessions (pageview, signup) and 2 stored events", sessions, events) } } + +func TestNeutralPathSiteMustMatchBody(t *testing.T) { + f := newHandlerFixture(t, 32, nil) + for _, tt := range []struct { + name, pathSite string + want int + }{ + {"matching path site", "abc123", http.StatusAccepted}, + {"other path site", "zzz999", http.StatusBadRequest}, + } { + t.Run(tt.name, func(t *testing.T) { + req := httptest.NewRequest(http.MethodPost, "/api/public/v1/events", strings.NewReader(okBody)) + req = req.WithContext(ingest.WithPathSite(req.Context(), tt.pathSite)) + req.Header.Set("User-Agent", testUA) + req.RemoteAddr = "198.51.100.7:5555" + rr := httptest.NewRecorder() + f.h.ServeHTTP(rr, req) + if rr.Code != tt.want { + t.Fatalf("code=%d, want %d; body=%q", rr.Code, tt.want, rr.Body.String()) + } + }) + } + f.stop(t) +} diff --git a/internal/ingest/pathsite.go b/internal/ingest/pathsite.go new file mode 100644 index 00000000..46d7e4da --- /dev/null +++ b/internal/ingest/pathsite.go @@ -0,0 +1,18 @@ +package ingest + +import "context" + +type pathSiteKey struct{} + +// WithPathSite records the site public ID named by a neutral intake path +// (/e/{site}). Handlers that read the site from the request body or query +// reject a request whose site differs from it. +func WithPathSite(ctx context.Context, publicID string) context.Context { + return context.WithValue(ctx, pathSiteKey{}, publicID) +} + +// PathSite returns the site public ID set by WithPathSite. +func PathSite(ctx context.Context) (string, bool) { + publicID, ok := ctx.Value(pathSiteKey{}).(string) + return publicID, ok +} diff --git a/internal/replay/handler.go b/internal/replay/handler.go index bee0e878..89188430 100644 --- a/internal/replay/handler.go +++ b/internal/replay/handler.go @@ -182,6 +182,10 @@ func (h *Handler) Start(w http.ResponseWriter, r *http.Request) { h.reject(w, http.StatusBadRequest) return } + if pathSite, ok := ingest.PathSite(r.Context()); ok && pathSite != request.Site { + h.reject(w, http.StatusBadRequest) + return + } if err := ensureJSONEnd(decoder); err != nil { h.reject(w, http.StatusBadRequest) return diff --git a/internal/replay/handler_test.go b/internal/replay/handler_test.go index 64f8b663..8d7b933a 100644 --- a/internal/replay/handler_test.go +++ b/internal/replay/handler_test.go @@ -17,6 +17,7 @@ import ( "supermetry/internal/config" "supermetry/internal/health" + "supermetry/internal/ingest" "supermetry/internal/salts" "supermetry/internal/session" "supermetry/internal/sites" @@ -944,3 +945,28 @@ func TestChunkRechecksPolicyAfterBodyWait(t *testing.T) { t.Fatalf("status=%d writes=%d", response.Code, len(blob.bodies)) } } + +func TestStartRejectsSiteOtherThanNeutralPath(t *testing.T) { + h, _, _, _, _ := newReplayTestHandler(t, replayInput(100)) + for _, tt := range []struct { + pathSite string + want int + }{ + {"site-public", http.StatusOK}, + {"other-site", http.StatusBadRequest}, + } { + body, err := json.Marshal(map[string]string{"s": "site-public", "u": "https://supermetry.com/page"}) + if err != nil { + t.Fatal(err) + } + request := httptest.NewRequest(http.MethodPost, "/api/replay/start", bytes.NewReader(body)) + request = request.WithContext(ingest.WithPathSite(request.Context(), tt.pathSite)) + request.RemoteAddr = "192.0.2.1:1234" + request.Header.Set("User-Agent", "test-agent") + response := httptest.NewRecorder() + h.Start(response, request) + if response.Code != tt.want { + t.Fatalf("path site %s: status %d, want %d", tt.pathSite, response.Code, tt.want) + } + } +} diff --git a/internal/replay/static/dist/replay.js b/internal/replay/static/dist/replay.js index 6e98a348..ec052048 100644 --- a/internal/replay/static/dist/replay.js +++ b/internal/replay/static/dist/replay.js @@ -1,9 +1,9 @@ -(()=>{var En=Object.defineProperty,xn=(e,t,o)=>(t in e)?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,O=(e,t,o)=>xn(e,typeof t!=="symbol"?t+"":t,o),Zr,Mn=Object.defineProperty,Rn=(e,t,o)=>(t in e)?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Kr=(e,t,o)=>Rn(e,typeof t!=="symbol"?t+"":t,o),ee=((e)=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ee||{}),es={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ts={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ve={},vi={},Nn=()=>!!globalThis.Zone;function Tr(e){if(Ve[e])return Ve[e];let t=globalThis[e],o=t.prototype,r=e in es?es[e]:void 0,a=Boolean(r&&r.every((l)=>{var c,i;return Boolean((i=(c=Object.getOwnPropertyDescriptor(o,l))==null?void 0:c.get)==null?void 0:i.toString().includes("[native code]"))})),u=e in ts?ts[e]:void 0,p=Boolean(u&&u.every((l)=>{var c;return typeof o[l]==="function"&&((c=o[l])==null?void 0:c.toString().includes("[native code]"))}));if(a&&p&&!Nn())return Ve[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let c=l.contentWindow;if(!c)return t.prototype;let i=c[e].prototype;if(!i)return l.remove(),o;let d=navigator.userAgent;if(d.includes("Safari")&&!d.includes("Chrome"))l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),vi[e]=()=>l.remove();else l.remove();return Ve[e]=i}catch{return o}}var St={};function ce(e,t,o){var r,a;let u=(r=St[e])==null?void 0:r[o];if(u)return u.call(t);let p=Tr(e),l=(a=Object.getOwnPropertyDescriptor(p,o))==null?void 0:a.get;if(!l)return t[o];return(St[e]||(St[e]={}))[o]=l,l.call(t)}var Ct={};function Si(e,t,o){let r=`${e}.${String(o)}`;if(Ct[r])return Ct[r].bind(t);let u=Tr(e)[o];if(typeof u!=="function")return t[o];return Ct[r]=u,u.bind(t)}function On(e){return ce("Node",e,"ownerDocument")}function In(e){return ce("Node",e,"childNodes")}function An(e){return ce("Node",e,"parentNode")}function Dn(e){return ce("Node",e,"parentElement")}function Tn(e){return ce("Node",e,"textContent")}function _n(e){return ce("Node",e,"firstChild")}function kn(e){return ce("Node",e,"lastChild")}function Pn(e){return ce("Node",e,"nextSibling")}function Ln(e){return ce("Node",e,"previousSibling")}function Fn(e,t){return Si("Node",e,"contains")(t)}function Un(e){return Si("Node",e,"getRootNode")()}function Bn(e){if(!e||!("host"in e))return null;return ce("ShadowRoot",e,"host")}function $n(e){return e.styleSheets}function Wn(e){if(!e||!("shadowRoot"in e))return null;return ce("Element",e,"shadowRoot")}function zn(e,t){return ce("Element",e,"querySelector")(t)}function qn(e,t){return ce("Element",e,"querySelectorAll")(t)}function jn(){return[Tr("MutationObserver").constructor,vi.MutationObserver??(()=>{})]}var Ci=Date.now;if(!/[1-9][0-9]{12}/.test(Date.now().toString()))Ci=()=>new Date().getTime();function Vn(e,t,o){try{if(!(t in e))return()=>{};let r=e[t],a=o(r);if(typeof a==="function")a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:r}});return e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var ie={ownerDocument:On,childNodes:In,parentNode:An,parentElement:Dn,textContent:Tn,firstChild:_n,lastChild:kn,nextSibling:Pn,previousSibling:Ln,contains:Fn,getRootNode:Un,host:Bn,styleSheets:$n,shadowRoot:Wn,querySelector:zn,querySelectorAll:qn,nowTimestamp:Ci,mutationObserverCtor:jn,patch:Vn};function Ei(e){return e.nodeType===e.ELEMENT_NODE}function Fe(e){let t=e&&"host"in e&&"mode"in e&&ie.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ie.shadowRoot(t)===e)}function Ue(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Gn(e){if(e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;"))e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;");return e}function Hn(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let o=["@import",`url(${JSON.stringify(e.href)})`];if(e.layerName==="")o.push("layer");else if(e.layerName)o.push(`layer(${e.layerName})`);if(e.supportsText)o.push(`supports(${e.supportsText})`);if(e.media.length)o.push(e.media.mediaText);return o.join(" ")+";"}function Nr(e){try{let t=e.rules||e.cssRules;if(!t)return null;let o=e.href;if(!o&&e.ownerNode)o=e.ownerNode.baseURI;let r=Array.from(t,(a)=>xi(a,o)).join("");return Gn(r)}catch(t){return null}}function xi(e,t){if(Jn(e)){let o;try{o=Nr(e.styleSheet)||Hn(e)}catch(r){o=e.cssText}if(e.styleSheet.href)return it(o,e.styleSheet.href);return o}else{let o=e.cssText;if(Xn(e)&&e.selectorText.includes(":"))o=Yn(o);if(t)return it(o,t);return o}}function Yn(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Jn(e){return"styleSheet"in e}function Xn(e){return"selectorText"in e}class _r{constructor(){Kr(this,"idNodeMap",new Map),Kr(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return((t=this.getMeta(e))==null?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes)e.childNodes.forEach((o)=>this.removeNodeFromMap(o))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let o=t.id;this.idNodeMap.set(o,e),this.nodeMetaMap.set(e,t)}replace(e,t){let o=this.getNode(e);if(o){let r=this.nodeMetaMap.get(o);if(r)this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Qn(){return new _r}function rt({element:e,maskInputOptions:t,tagName:o,type:r,value:a,maskInputFn:u}){let p=a||"",l=r&&Ce(r);if(t[o.toLowerCase()]||l&&t[l])if(u)p=u(p,e);else p="*".repeat(p.length);return p}function Ce(e){return e.toLowerCase()}var rs="__rrweb_original__";function Zn(e){let t=e.getContext("2d");if(!t)return!0;let o=50;for(let r=0;rc!==0))return!1}return!0}function st(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function Mi(e,t){let o;try{o=new URL(e,t??window.location.href)}catch(u){return null}let r=/\.([0-9a-z]+)(?:$)/i,a=o.pathname.match(r);return(a==null?void 0:a[1])??null}function Kn(e){let t="";if(e.indexOf("//")>-1)t=e.split("/").slice(0,3).join("/");else t=e.split("/")[0];return t=t.split("?")[0],t}var eo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,to=/^(?:[a-z+]+:)?\/\//i,ro=/^www\..*/i,so=/^(data:)([^,]*),(.*)/i;function it(e,t){return(e||"").replace(eo,(o,r,a,u,p,l)=>{let c=a||p||l,i=r||u||"";if(!c)return o;if(to.test(c)||ro.test(c))return`url(${i}${c}${i})`;if(so.test(c))return`url(${i}${c}${i})`;if(c[0]==="/")return`url(${i}${Kn(t)+c}${i})`;let d=c.split("#")[0],n=c.substring(d.length),s=t.split("#")[0].split("/"),h=d.split("/");s.pop();for(let f of h)if(f===".")continue;else if(f==="..")s.pop();else s.push(f);return`url(${i}${s.join("/")}${n}${i})`})}var Ri="(?:/\\*[^*]*\\*/)|[\\s;]",io=new RegExp(`${Ri}|\\b(0)px?`,"g"),no=new RegExp(Ri,"g");function Ge(e,t=!1){return t?e.replace(no,""):e.replace(io,"$1")}function oo(e,t,o=!1){let r=Array.from(t.childNodes),a=[],u=0;if(r.length>1&&e&&typeof e==="string"){let p=Ge(e,o),l=p.length/e.length;for(let c=1;c2&&h[0]===""&&r[c-1].textContent!=="")f=p.indexOf(s,1);else if(h.length===1){if(s=s.substring(0,s.length-1),h=p.split(s),h.length<=1)return a.push(e),a;n=101}else if(n===i.length-1)f=p.indexOf(s);if(h.length>=2&&n>100){let m=r[c-1].textContent;if(m&&typeof m==="string"){let w=Ge(m).length;f=p.indexOf(s,w)}if(f===-1)f=h[0].length}if(f!==-1){let m=Math.floor(f/l);for(;m>0&&m50*r.length)return a.push(e),a;let w=Ge(e.substring(0,m),o);if(w.length===f){a.push(e.substring(0,m)),e=e.substring(m),p=p.substring(f);break}else if(w.length=t.length)break;let u=r(ho);if(u.slice(-1)===",")u=_e(e,u.substring(0,u.length-1)),a.push(u);else{let p="";u=_e(e,u);let l=!1;while(!0){let c=t.charAt(o);if(c===""){a.push((u+p).trim());break}else if(!l){if(c===","){o+=1,a.push((u+p).trim());break}else if(c==="(")l=!0}else if(c===")")l=!1;p+=c,o+=1}}}return a.join(", ")}var is=new WeakMap;function _e(e,t){if(!t||t.trim()==="")return t;return kr(e,t)}function mo(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function kr(e,t){let o=is.get(e);if(!o)o=e.createElement("a"),is.set(e,o);if(!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return o.setAttribute("href",t),o.href}function Oi(e,t,o,r){if(!r)return r;if(o==="src"||o==="href"&&!(t==="use"&&r[0]==="#"))return _e(e,r);else if(o==="xlink:href"&&r[0]!=="#")return _e(e,r);else if(o==="background"&&["table","td","th"].includes(t))return _e(e,r);else if(o==="srcset")return po(e,r);else if(o==="style")return it(r,kr(e));else if(t==="object"&&o==="data")return _e(e,r);return r}function Ii(e,t,o){return["video","audio"].includes(e)&&Ce(t)==="autoplay"}function go(e,t,o){try{if(typeof t==="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let a=e.classList[r];if(t.test(a))return!0}if(o)return e.matches(o)}catch(r){}return!1}function ot(e,t,o){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE){if(!o)return!1;return ot(ie.parentNode(e),t,o)}for(let r=e.classList.length;r--;){let a=e.classList[r];if(t.test(a))return!0}if(!o)return!1;return ot(ie.parentNode(e),t,o)}function Ai(e,t,o,r){let a;if(Ei(e)){if(a=e,!ie.childNodes(a).length)return!1}else if(ie.parentElement(e)===null)return!1;else a=ie.parentElement(e);try{if(typeof t==="string"){if(r){if(a.closest(`.${t}`))return!0}else if(a.classList.contains(t))return!0}else if(ot(a,t,r))return!0;if(o){if(r){if(a.closest(o))return!0}else if(a.matches(o))return!0}}catch(u){}return!1}function yo(e,t,o){let r=e.contentWindow;if(!r)return;let a=!1,u;try{u=r.document.readyState}catch(l){return}if(u!=="complete"){let l=setTimeout(()=>{if(!a)t(),a=!0},o);e.addEventListener("load",()=>{clearTimeout(l),a=!0,t()});return}let p="about:blank";if(r.location.href!==p||e.src===p||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wo(e,t,o){let r=!1,a;try{a=e.sheet}catch(p){return}if(a)return;let u=setTimeout(()=>{if(!r)t(),r=!0},o);e.addEventListener("load",()=>{clearTimeout(u),r=!0,t()})}function bo(e,t){let{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:p,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:i,maskInputFn:d,dataURLOptions:n={},inlineImages:s,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:w=!1}=t,C=vo(o,r);switch(e.nodeType){case e.DOCUMENT_NODE:if(e.compatMode!=="CSS1Compat")return{type:ee.Document,childNodes:[],compatMode:e.compatMode};else return{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Co(e,{doc:o,blockClass:a,blockSelector:u,inlineStylesheet:l,maskInputOptions:c,maskInputFn:d,dataURLOptions:n,inlineImages:s,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:C});case e.TEXT_NODE:return So(e,{doc:o,needsMask:p,maskTextFn:i,rootId:C,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:ee.Comment,textContent:ie.textContent(e)||"",rootId:C};default:return!1}}function vo(e,t){if(!t.hasNode(e))return;let o=t.getId(e);return o===1?void 0:o}function So(e,t){let{needsMask:o,maskTextFn:r,rootId:a,cssCaptured:u}=t,p=ie.parentNode(e),l=p&&p.tagName,c="",i=l==="STYLE"?!0:void 0,d=l==="SCRIPT"?!0:void 0;if(d)c="SCRIPT_PLACEHOLDER";else if(!u){if(c=ie.textContent(e),i&&c)c=it(c,kr(t.doc))}if(!i&&!d&&c&&o)c=r?r(c,ie.parentElement(e)):c.replace(/[\S]/g,"*");return{type:ee.Text,textContent:c||"",rootId:a}}function Co(e,t){let{doc:o,blockClass:r,blockSelector:a,inlineStylesheet:u,maskInputOptions:p={},maskInputFn:l,dataURLOptions:c={},inlineImages:i,recordCanvas:d,keepIframeSrcFn:n,newlyAddedElement:s=!1,rootId:h}=t,f=go(e,r,a),m=co(e),w={},C=e.attributes.length;for(let v=0;vy.href===e.href),g=null;if(v)g=Nr(v);if(g)delete w.rel,delete w.href,w._cssText=g}if(m==="style"&&e.sheet){let v=Nr(e.sheet);if(v){if(e.childNodes.length>1)v=ao(v,e);w._cssText=v}}if(["input","textarea","select"].includes(m)){let{value:v,checked:g}=e;if(w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&v)w.value=rt({element:e,type:st(e),tagName:m,value:v,maskInputOptions:p,maskInputFn:l});else if(g)w.checked=g}if(m==="option")if(e.selected&&!p.select)w.selected=!0;else delete w.selected;if(m==="dialog"&&e.open)w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";if(m==="canvas"&&d){if(e.__context==="2d"){if(!Zn(e))w.rr_dataURL=e.toDataURL(c.type,c.quality)}else if(!("__context"in e)){let v=e.toDataURL(c.type,c.quality),g=o.createElement("canvas");g.width=e.width,g.height=e.height;let y=g.toDataURL(c.type,c.quality);if(v!==y)w.rr_dataURL=v}}if(m==="img"&&i){if(!Ie)Ie=o.createElement("canvas"),ss=Ie.getContext("2d");let v=e,g=v.currentSrc||v.getAttribute("src")||"",y=v.crossOrigin,S=()=>{v.removeEventListener("load",S);try{Ie.width=v.naturalWidth,Ie.height=v.naturalHeight,ss.drawImage(v,0,0),w.rr_dataURL=Ie.toDataURL(c.type,c.quality)}catch(x){if(v.crossOrigin!=="anonymous"){if(v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0)S();else v.addEventListener("load",S);return}else console.warn(`Cannot inline img src=${g}! Error: ${x}`)}if(v.crossOrigin==="anonymous")y?w.crossOrigin=y:v.removeAttribute("crossorigin")};if(v.complete&&v.naturalWidth!==0)S();else v.addEventListener("load",S)}if(["audio","video"].includes(m)){let v=w;v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime,v.rr_mediaPlaybackRate=e.playbackRate,v.rr_mediaMuted=e.muted,v.rr_mediaLoop=e.loop,v.rr_mediaVolume=e.volume}if(!s){if(e.scrollLeft)w.rr_scrollLeft=e.scrollLeft;if(e.scrollTop)w.rr_scrollTop=e.scrollTop}if(f){let{width:v,height:g}=e.getBoundingClientRect();w={class:w.class,rr_width:`${v}px`,rr_height:`${g}px`}}if(m==="iframe"&&!n(w.src)){if(!e.contentDocument)w.rr_src=w.src;delete w.src}let b;try{if(customElements.get(m))b=!0}catch(v){}return{type:ee.Element,tagName:m,attributes:w,childNodes:[],isSVG:mo(e)||void 0,needBlock:f,rootId:h,isCustom:b}}function G(e){if(e===void 0||e===null)return"";else return e.toLowerCase()}function Di(e){if(e===!0||e==="all")return{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"};else if(e)return e;return{}}function Eo(e,t){if(t.comment&&e.type===ee.Comment)return!0;else if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href==="string"&&Mi(e.attributes.href)==="js"))return!0;else if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(G(e.attributes.name).match(/^msapplication-tile(image|color)$/)||G(e.attributes.name)==="application-name"||G(e.attributes.rel)==="icon"||G(e.attributes.rel)==="apple-touch-icon"||G(e.attributes.rel)==="shortcut icon")))return!0;else if(e.tagName==="meta"){if(t.headMetaDescKeywords&&G(e.attributes.name).match(/^description|keywords$/))return!0;else if(t.headMetaSocial&&(G(e.attributes.property).match(/^(og|twitter|fb):/)||G(e.attributes.name).match(/^(og|twitter):/)||G(e.attributes.name)==="pinterest"))return!0;else if(t.headMetaRobots&&(G(e.attributes.name)==="robots"||G(e.attributes.name)==="googlebot"||G(e.attributes.name)==="bingbot"))return!0;else if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;else if(t.headMetaAuthorship&&(G(e.attributes.name)==="author"||G(e.attributes.name)==="generator"||G(e.attributes.name)==="framework"||G(e.attributes.name)==="publisher"||G(e.attributes.name)==="progid"||G(e.attributes.property).match(/^article:/)||G(e.attributes.property).match(/^product:/)))return!0;else if(t.headMetaVerification&&(G(e.attributes.name)==="google-site-verification"||G(e.attributes.name)==="yandex-verification"||G(e.attributes.name)==="csrf-token"||G(e.attributes.name)==="p:domain_verify"||G(e.attributes.name)==="verify-v1"||G(e.attributes.name)==="verification"||G(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ke(e,t){let{doc:o,mirror:r,blockClass:a,blockSelector:u,maskTextClass:p,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:i=!0,maskInputOptions:d={},maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:w=!1,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v=5000,onStylesheetLoad:g,stylesheetLoadTimeout:y=5000,keepIframeSrcFn:S=()=>!1,newlyAddedElement:x=!1,cssCaptured:N=!1}=t,{needsMask:A}=t,{preserveWhiteSpace:M=!0}=t;if(!A)A=Ai(e,p,l,A===void 0);let k=bo(e,{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,dataURLOptions:f,inlineImages:m,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:x,cssCaptured:N});if(!k)return console.warn(e,"not serialized"),null;let D;if(r.hasNode(e))D=r.getId(e);else if(Eo(k,h)||!M&&k.type===ee.Text&&!k.textContent.replace(/^\s+|\s+$/gm,"").length)D=nt;else D=Ni();let E=Object.assign(k,{id:D});if(r.add(e,E),D===nt)return null;if(C)C(e);let Z=!c;if(E.type===ee.Element){Z=Z&&!E.needBlock,delete E.needBlock;let q=ie.shadowRoot(e);if(q&&Ue(q))E.isShadowHost=!0}if((E.type===ee.Document||E.type===ee.Element)&&Z){if(h.headWhitespace&&E.type===ee.Element&&E.tagName==="head")M=!1;let q={doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:c,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S,cssCaptured:!1};if(E.type===ee.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0);else{if(E.type===ee.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText==="string")q.cssCaptured=!0;for(let I of Array.from(ie.childNodes(e))){let P=ke(I,q);if(P)E.childNodes.push(P)}}let W=null;if(Ei(e)&&(W=ie.shadowRoot(e)))for(let I of Array.from(ie.childNodes(W))){let P=ke(I,q);if(P)Ue(W)&&(P.isShadow=!0),E.childNodes.push(P)}}let re=ie.parentNode(e);if(re&&Fe(re)&&Ue(re))E.isShadow=!0;if(E.type===ee.Element&&E.tagName==="iframe")yo(e,()=>{let q=e.contentDocument;if(q&&b){let W=ke(q,{doc:q,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S});if(W)b(e,W)}},v);if(E.type===ee.Element&&E.tagName==="link"&&typeof E.attributes.rel==="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href==="string"&&Mi(E.attributes.href)==="css"))wo(e,()=>{if(g){let q=ke(e,{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S});if(q)g(e,q)}},y);return E}function xo(e,t){let{mirror:o=new _r,blockClass:r="rr-block",blockSelector:a=null,maskTextClass:u="rr-mask",maskTextSelector:p=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:i=!1,maskAllInputs:d=!1,maskTextFn:n,maskInputFn:s,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:g,keepIframeSrcFn:y=()=>!1}=t,S=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d===!1?{password:!0}:d,x=Di(h);return ke(e,{doc:e,mirror:o,blockClass:r,blockSelector:a,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:l,maskInputOptions:S,maskTextFn:n,maskInputFn:s,slimDOMOptions:x,dataURLOptions:f,inlineImages:c,recordCanvas:i,preserveWhiteSpace:m,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:g,keepIframeSrcFn:y,newlyAddedElement:!1})}var Mo=/(max|min)-device-(width|height)/,Ya=new RegExp(Mo.source,"g");function Ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function No(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var o=function r(){if(this instanceof r)return Reflect.construct(t,arguments,this.constructor);return t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),o}var He={exports:{}},ns;function Oo(){if(ns)return He.exports;ns=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return He.exports=t(),He.exports.createColors=t,He.exports}var Io={},Ao=Object.freeze(Object.defineProperty({__proto__:null,default:Io},Symbol.toStringTag,{value:"Module"})),me=No(Ao),Et,os;function Pr(){if(os)return Et;os=1;let e=Oo(),t=me;class o extends Error{constructor(r,a,u,p,l,c){super(r);if(this.name="CssSyntaxError",this.reason=r,l)this.file=l;if(p)this.source=p;if(c)this.plugin=c;if(typeof a<"u"&&typeof u<"u")if(typeof a==="number")this.line=a,this.column=u;else this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,o)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let a=this.source;if(r==null)r=e.isColorSupported;if(t){if(r)a=t(a)}let u=a.split(/\r?\n/),p=Math.max(this.line-3,0),l=Math.min(this.line+2,u.length),c=String(l).length,i,d;if(r){let{bold:n,gray:s,red:h}=e.createColors(!0);i=(f)=>n(h(f)),d=(f)=>s(f)}else i=d=(n)=>n;return u.slice(p,l).map((n,s)=>{let h=p+1+s,f=" "+(" "+h).slice(-c)+" | ";if(h===this.line){let m=d(f.replace(/\d/g," "))+n.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+d(f)+n+` +(()=>{var xn=Object.defineProperty,Mn=(e,t,o)=>(t in e)?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,O=(e,t,o)=>Mn(e,typeof t!=="symbol"?t+"":t,o),es,Rn=Object.defineProperty,Nn=(e,t,o)=>(t in e)?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ts=(e,t,o)=>Nn(e,typeof t!=="symbol"?t+"":t,o),ee=((e)=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ee||{}),rs={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ss={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Ci={},On=()=>!!globalThis.Zone;function _r(e){if(Ge[e])return Ge[e];let t=globalThis[e],o=t.prototype,r=e in rs?rs[e]:void 0,a=Boolean(r&&r.every((l)=>{var c,i;return Boolean((i=(c=Object.getOwnPropertyDescriptor(o,l))==null?void 0:c.get)==null?void 0:i.toString().includes("[native code]"))})),u=e in ss?ss[e]:void 0,p=Boolean(u&&u.every((l)=>{var c;return typeof o[l]==="function"&&((c=o[l])==null?void 0:c.toString().includes("[native code]"))}));if(a&&p&&!On())return Ge[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let c=l.contentWindow;if(!c)return t.prototype;let i=c[e].prototype;if(!i)return l.remove(),o;let d=navigator.userAgent;if(d.includes("Safari")&&!d.includes("Chrome"))l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Ci[e]=()=>l.remove();else l.remove();return Ge[e]=i}catch{return o}}var Ct={};function ce(e,t,o){var r,a;let u=(r=Ct[e])==null?void 0:r[o];if(u)return u.call(t);let p=_r(e),l=(a=Object.getOwnPropertyDescriptor(p,o))==null?void 0:a.get;if(!l)return t[o];return(Ct[e]||(Ct[e]={}))[o]=l,l.call(t)}var Et={};function Ei(e,t,o){let r=`${e}.${String(o)}`;if(Et[r])return Et[r].bind(t);let u=_r(e)[o];if(typeof u!=="function")return t[o];return Et[r]=u,u.bind(t)}function In(e){return ce("Node",e,"ownerDocument")}function An(e){return ce("Node",e,"childNodes")}function Dn(e){return ce("Node",e,"parentNode")}function Tn(e){return ce("Node",e,"parentElement")}function _n(e){return ce("Node",e,"textContent")}function kn(e){return ce("Node",e,"firstChild")}function Pn(e){return ce("Node",e,"lastChild")}function Ln(e){return ce("Node",e,"nextSibling")}function Fn(e){return ce("Node",e,"previousSibling")}function Un(e,t){return Ei("Node",e,"contains")(t)}function Bn(e){return Ei("Node",e,"getRootNode")()}function $n(e){if(!e||!("host"in e))return null;return ce("ShadowRoot",e,"host")}function Wn(e){return e.styleSheets}function zn(e){if(!e||!("shadowRoot"in e))return null;return ce("Element",e,"shadowRoot")}function qn(e,t){return ce("Element",e,"querySelector")(t)}function jn(e,t){return ce("Element",e,"querySelectorAll")(t)}function Vn(){return[_r("MutationObserver").constructor,Ci.MutationObserver??(()=>{})]}var xi=Date.now;if(!/[1-9][0-9]{12}/.test(Date.now().toString()))xi=()=>new Date().getTime();function Gn(e,t,o){try{if(!(t in e))return()=>{};let r=e[t],a=o(r);if(typeof a==="function")a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:r}});return e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var ie={ownerDocument:In,childNodes:An,parentNode:Dn,parentElement:Tn,textContent:_n,firstChild:kn,lastChild:Pn,nextSibling:Ln,previousSibling:Fn,contains:Un,getRootNode:Bn,host:$n,styleSheets:Wn,shadowRoot:zn,querySelector:qn,querySelectorAll:jn,nowTimestamp:xi,mutationObserverCtor:Vn,patch:Gn};function Mi(e){return e.nodeType===e.ELEMENT_NODE}function Fe(e){let t=e&&"host"in e&&"mode"in e&&ie.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ie.shadowRoot(t)===e)}function Ue(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Hn(e){if(e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;"))e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;");return e}function Yn(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let o=["@import",`url(${JSON.stringify(e.href)})`];if(e.layerName==="")o.push("layer");else if(e.layerName)o.push(`layer(${e.layerName})`);if(e.supportsText)o.push(`supports(${e.supportsText})`);if(e.media.length)o.push(e.media.mediaText);return o.join(" ")+";"}function Or(e){try{let t=e.rules||e.cssRules;if(!t)return null;let o=e.href;if(!o&&e.ownerNode)o=e.ownerNode.baseURI;let r=Array.from(t,(a)=>Ri(a,o)).join("");return Hn(r)}catch(t){return null}}function Ri(e,t){if(Xn(e)){let o;try{o=Or(e.styleSheet)||Yn(e)}catch(r){o=e.cssText}if(e.styleSheet.href)return nt(o,e.styleSheet.href);return o}else{let o=e.cssText;if(Qn(e)&&e.selectorText.includes(":"))o=Jn(o);if(t)return nt(o,t);return o}}function Jn(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Xn(e){return"styleSheet"in e}function Qn(e){return"selectorText"in e}class kr{constructor(){ts(this,"idNodeMap",new Map),ts(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return((t=this.getMeta(e))==null?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes)e.childNodes.forEach((o)=>this.removeNodeFromMap(o))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let o=t.id;this.idNodeMap.set(o,e),this.nodeMetaMap.set(e,t)}replace(e,t){let o=this.getNode(e);if(o){let r=this.nodeMetaMap.get(o);if(r)this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Zn(){return new kr}function st({element:e,maskInputOptions:t,tagName:o,type:r,value:a,maskInputFn:u}){let p=a||"",l=r&&Ce(r);if(t[o.toLowerCase()]||l&&t[l])if(u)p=u(p,e);else p="*".repeat(p.length);return p}function Ce(e){return e.toLowerCase()}var is="__rrweb_original__";function Kn(e){let t=e.getContext("2d");if(!t)return!0;let o=50;for(let r=0;rc!==0))return!1}return!0}function it(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function Ni(e,t){let o;try{o=new URL(e,t??window.location.href)}catch(u){return null}let r=/\.([0-9a-z]+)(?:$)/i,a=o.pathname.match(r);return(a==null?void 0:a[1])??null}function eo(e){let t="";if(e.indexOf("//")>-1)t=e.split("/").slice(0,3).join("/");else t=e.split("/")[0];return t=t.split("?")[0],t}var to=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ro=/^(?:[a-z+]+:)?\/\//i,so=/^www\..*/i,io=/^(data:)([^,]*),(.*)/i;function nt(e,t){return(e||"").replace(to,(o,r,a,u,p,l)=>{let c=a||p||l,i=r||u||"";if(!c)return o;if(ro.test(c)||so.test(c))return`url(${i}${c}${i})`;if(io.test(c))return`url(${i}${c}${i})`;if(c[0]==="/")return`url(${i}${eo(t)+c}${i})`;let d=c.split("#")[0],n=c.substring(d.length),s=t.split("#")[0].split("/"),h=d.split("/");s.pop();for(let f of h)if(f===".")continue;else if(f==="..")s.pop();else s.push(f);return`url(${i}${s.join("/")}${n}${i})`})}var Oi="(?:/\\*[^*]*\\*/)|[\\s;]",no=new RegExp(`${Oi}|\\b(0)px?`,"g"),oo=new RegExp(Oi,"g");function He(e,t=!1){return t?e.replace(oo,""):e.replace(no,"$1")}function ao(e,t,o=!1){let r=Array.from(t.childNodes),a=[],u=0;if(r.length>1&&e&&typeof e==="string"){let p=He(e,o),l=p.length/e.length;for(let c=1;c2&&h[0]===""&&r[c-1].textContent!=="")f=p.indexOf(s,1);else if(h.length===1){if(s=s.substring(0,s.length-1),h=p.split(s),h.length<=1)return a.push(e),a;n=101}else if(n===i.length-1)f=p.indexOf(s);if(h.length>=2&&n>100){let m=r[c-1].textContent;if(m&&typeof m==="string"){let w=He(m).length;f=p.indexOf(s,w)}if(f===-1)f=h[0].length}if(f!==-1){let m=Math.floor(f/l);for(;m>0&&m50*r.length)return a.push(e),a;let w=He(e.substring(0,m),o);if(w.length===f){a.push(e.substring(0,m)),e=e.substring(m),p=p.substring(f);break}else if(w.length=t.length)break;let u=r(fo);if(u.slice(-1)===",")u=_e(e,u.substring(0,u.length-1)),a.push(u);else{let p="";u=_e(e,u);let l=!1;while(!0){let c=t.charAt(o);if(c===""){a.push((u+p).trim());break}else if(!l){if(c===","){o+=1,a.push((u+p).trim());break}else if(c==="(")l=!0}else if(c===")")l=!1;p+=c,o+=1}}}return a.join(", ")}var os=new WeakMap;function _e(e,t){if(!t||t.trim()==="")return t;return Pr(e,t)}function go(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Pr(e,t){let o=os.get(e);if(!o)o=e.createElement("a"),os.set(e,o);if(!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return o.setAttribute("href",t),o.href}function Ai(e,t,o,r){if(!r)return r;if(o==="src"||o==="href"&&!(t==="use"&&r[0]==="#"))return _e(e,r);else if(o==="xlink:href"&&r[0]!=="#")return _e(e,r);else if(o==="background"&&["table","td","th"].includes(t))return _e(e,r);else if(o==="srcset")return mo(e,r);else if(o==="style")return nt(r,Pr(e));else if(t==="object"&&o==="data")return _e(e,r);return r}function Di(e,t,o){return["video","audio"].includes(e)&&Ce(t)==="autoplay"}function yo(e,t,o){try{if(typeof t==="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let a=e.classList[r];if(t.test(a))return!0}if(o)return e.matches(o)}catch(r){}return!1}function at(e,t,o){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE){if(!o)return!1;return at(ie.parentNode(e),t,o)}for(let r=e.classList.length;r--;){let a=e.classList[r];if(t.test(a))return!0}if(!o)return!1;return at(ie.parentNode(e),t,o)}function Ti(e,t,o,r){let a;if(Mi(e)){if(a=e,!ie.childNodes(a).length)return!1}else if(ie.parentElement(e)===null)return!1;else a=ie.parentElement(e);try{if(typeof t==="string"){if(r){if(a.closest(`.${t}`))return!0}else if(a.classList.contains(t))return!0}else if(at(a,t,r))return!0;if(o){if(r){if(a.closest(o))return!0}else if(a.matches(o))return!0}}catch(u){}return!1}function wo(e,t,o){let r=e.contentWindow;if(!r)return;let a=!1,u;try{u=r.document.readyState}catch(l){return}if(u!=="complete"){let l=setTimeout(()=>{if(!a)t(),a=!0},o);e.addEventListener("load",()=>{clearTimeout(l),a=!0,t()});return}let p="about:blank";if(r.location.href!==p||e.src===p||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function bo(e,t,o){let r=!1,a;try{a=e.sheet}catch(p){return}if(a)return;let u=setTimeout(()=>{if(!r)t(),r=!0},o);e.addEventListener("load",()=>{clearTimeout(u),r=!0,t()})}function vo(e,t){let{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:p,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:i,maskInputFn:d,dataURLOptions:n={},inlineImages:s,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:w=!1}=t,C=So(o,r);switch(e.nodeType){case e.DOCUMENT_NODE:if(e.compatMode!=="CSS1Compat")return{type:ee.Document,childNodes:[],compatMode:e.compatMode};else return{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Eo(e,{doc:o,blockClass:a,blockSelector:u,inlineStylesheet:l,maskInputOptions:c,maskInputFn:d,dataURLOptions:n,inlineImages:s,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:C});case e.TEXT_NODE:return Co(e,{doc:o,needsMask:p,maskTextFn:i,rootId:C,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:ee.Comment,textContent:ie.textContent(e)||"",rootId:C};default:return!1}}function So(e,t){if(!t.hasNode(e))return;let o=t.getId(e);return o===1?void 0:o}function Co(e,t){let{needsMask:o,maskTextFn:r,rootId:a,cssCaptured:u}=t,p=ie.parentNode(e),l=p&&p.tagName,c="",i=l==="STYLE"?!0:void 0,d=l==="SCRIPT"?!0:void 0;if(d)c="SCRIPT_PLACEHOLDER";else if(!u){if(c=ie.textContent(e),i&&c)c=nt(c,Pr(t.doc))}if(!i&&!d&&c&&o)c=r?r(c,ie.parentElement(e)):c.replace(/[\S]/g,"*");return{type:ee.Text,textContent:c||"",rootId:a}}function Eo(e,t){let{doc:o,blockClass:r,blockSelector:a,inlineStylesheet:u,maskInputOptions:p={},maskInputFn:l,dataURLOptions:c={},inlineImages:i,recordCanvas:d,keepIframeSrcFn:n,newlyAddedElement:s=!1,rootId:h}=t,f=yo(e,r,a),m=ho(e),w={},C=e.attributes.length;for(let v=0;vy.href===e.href),g=null;if(v)g=Or(v);if(g)delete w.rel,delete w.href,w._cssText=g}if(m==="style"&&e.sheet){let v=Or(e.sheet);if(v){if(e.childNodes.length>1)v=lo(v,e);w._cssText=v}}if(["input","textarea","select"].includes(m)){let{value:v,checked:g}=e;if(w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&v)w.value=st({element:e,type:it(e),tagName:m,value:v,maskInputOptions:p,maskInputFn:l});else if(g)w.checked=g}if(m==="option")if(e.selected&&!p.select)w.selected=!0;else delete w.selected;if(m==="dialog"&&e.open)w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";if(m==="canvas"&&d){if(e.__context==="2d"){if(!Kn(e))w.rr_dataURL=e.toDataURL(c.type,c.quality)}else if(!("__context"in e)){let v=e.toDataURL(c.type,c.quality),g=o.createElement("canvas");g.width=e.width,g.height=e.height;let y=g.toDataURL(c.type,c.quality);if(v!==y)w.rr_dataURL=v}}if(m==="img"&&i){if(!Ie)Ie=o.createElement("canvas"),ns=Ie.getContext("2d");let v=e,g=v.currentSrc||v.getAttribute("src")||"",y=v.crossOrigin,S=()=>{v.removeEventListener("load",S);try{Ie.width=v.naturalWidth,Ie.height=v.naturalHeight,ns.drawImage(v,0,0),w.rr_dataURL=Ie.toDataURL(c.type,c.quality)}catch(x){if(v.crossOrigin!=="anonymous"){if(v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0)S();else v.addEventListener("load",S);return}else console.warn(`Cannot inline img src=${g}! Error: ${x}`)}if(v.crossOrigin==="anonymous")y?w.crossOrigin=y:v.removeAttribute("crossorigin")};if(v.complete&&v.naturalWidth!==0)S();else v.addEventListener("load",S)}if(["audio","video"].includes(m)){let v=w;v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime,v.rr_mediaPlaybackRate=e.playbackRate,v.rr_mediaMuted=e.muted,v.rr_mediaLoop=e.loop,v.rr_mediaVolume=e.volume}if(!s){if(e.scrollLeft)w.rr_scrollLeft=e.scrollLeft;if(e.scrollTop)w.rr_scrollTop=e.scrollTop}if(f){let{width:v,height:g}=e.getBoundingClientRect();w={class:w.class,rr_width:`${v}px`,rr_height:`${g}px`}}if(m==="iframe"&&!n(w.src)){if(!e.contentDocument)w.rr_src=w.src;delete w.src}let b;try{if(customElements.get(m))b=!0}catch(v){}return{type:ee.Element,tagName:m,attributes:w,childNodes:[],isSVG:go(e)||void 0,needBlock:f,rootId:h,isCustom:b}}function G(e){if(e===void 0||e===null)return"";else return e.toLowerCase()}function _i(e){if(e===!0||e==="all")return{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"};else if(e)return e;return{}}function xo(e,t){if(t.comment&&e.type===ee.Comment)return!0;else if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href==="string"&&Ni(e.attributes.href)==="js"))return!0;else if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(G(e.attributes.name).match(/^msapplication-tile(image|color)$/)||G(e.attributes.name)==="application-name"||G(e.attributes.rel)==="icon"||G(e.attributes.rel)==="apple-touch-icon"||G(e.attributes.rel)==="shortcut icon")))return!0;else if(e.tagName==="meta"){if(t.headMetaDescKeywords&&G(e.attributes.name).match(/^description|keywords$/))return!0;else if(t.headMetaSocial&&(G(e.attributes.property).match(/^(og|twitter|fb):/)||G(e.attributes.name).match(/^(og|twitter):/)||G(e.attributes.name)==="pinterest"))return!0;else if(t.headMetaRobots&&(G(e.attributes.name)==="robots"||G(e.attributes.name)==="googlebot"||G(e.attributes.name)==="bingbot"))return!0;else if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;else if(t.headMetaAuthorship&&(G(e.attributes.name)==="author"||G(e.attributes.name)==="generator"||G(e.attributes.name)==="framework"||G(e.attributes.name)==="publisher"||G(e.attributes.name)==="progid"||G(e.attributes.property).match(/^article:/)||G(e.attributes.property).match(/^product:/)))return!0;else if(t.headMetaVerification&&(G(e.attributes.name)==="google-site-verification"||G(e.attributes.name)==="yandex-verification"||G(e.attributes.name)==="csrf-token"||G(e.attributes.name)==="p:domain_verify"||G(e.attributes.name)==="verify-v1"||G(e.attributes.name)==="verification"||G(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ke(e,t){let{doc:o,mirror:r,blockClass:a,blockSelector:u,maskTextClass:p,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:i=!0,maskInputOptions:d={},maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:w=!1,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v=5000,onStylesheetLoad:g,stylesheetLoadTimeout:y=5000,keepIframeSrcFn:S=()=>!1,newlyAddedElement:x=!1,cssCaptured:N=!1}=t,{needsMask:A}=t,{preserveWhiteSpace:M=!0}=t;if(!A)A=Ti(e,p,l,A===void 0);let k=vo(e,{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,dataURLOptions:f,inlineImages:m,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:x,cssCaptured:N});if(!k)return console.warn(e,"not serialized"),null;let D;if(r.hasNode(e))D=r.getId(e);else if(xo(k,h)||!M&&k.type===ee.Text&&!k.textContent.replace(/^\s+|\s+$/gm,"").length)D=ot;else D=Ii();let E=Object.assign(k,{id:D});if(r.add(e,E),D===ot)return null;if(C)C(e);let Z=!c;if(E.type===ee.Element){Z=Z&&!E.needBlock,delete E.needBlock;let q=ie.shadowRoot(e);if(q&&Ue(q))E.isShadowHost=!0}if((E.type===ee.Document||E.type===ee.Element)&&Z){if(h.headWhitespace&&E.type===ee.Element&&E.tagName==="head")M=!1;let q={doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:c,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S,cssCaptured:!1};if(E.type===ee.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0);else{if(E.type===ee.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText==="string")q.cssCaptured=!0;for(let I of Array.from(ie.childNodes(e))){let P=ke(I,q);if(P)E.childNodes.push(P)}}let W=null;if(Mi(e)&&(W=ie.shadowRoot(e)))for(let I of Array.from(ie.childNodes(W))){let P=ke(I,q);if(P)Ue(W)&&(P.isShadow=!0),E.childNodes.push(P)}}let re=ie.parentNode(e);if(re&&Fe(re)&&Ue(re))E.isShadow=!0;if(E.type===ee.Element&&E.tagName==="iframe")wo(e,()=>{let q=e.contentDocument;if(q&&b){let W=ke(q,{doc:q,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S});if(W)b(e,W)}},v);if(E.type===ee.Element&&E.tagName==="link"&&typeof E.attributes.rel==="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href==="string"&&Ni(E.attributes.href)==="css"))bo(e,()=>{if(g){let q=ke(e,{doc:o,mirror:r,blockClass:a,blockSelector:u,needsMask:A,maskTextClass:p,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d,maskTextFn:n,maskInputFn:s,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:w,preserveWhiteSpace:M,onSerialize:C,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:g,stylesheetLoadTimeout:y,keepIframeSrcFn:S});if(q)g(e,q)}},y);return E}function Mo(e,t){let{mirror:o=new kr,blockClass:r="rr-block",blockSelector:a=null,maskTextClass:u="rr-mask",maskTextSelector:p=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:i=!1,maskAllInputs:d=!1,maskTextFn:n,maskInputFn:s,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:g,keepIframeSrcFn:y=()=>!1}=t,S=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d===!1?{password:!0}:d,x=_i(h);return ke(e,{doc:e,mirror:o,blockClass:r,blockSelector:a,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:l,maskInputOptions:S,maskTextFn:n,maskInputFn:s,slimDOMOptions:x,dataURLOptions:f,inlineImages:c,recordCanvas:i,preserveWhiteSpace:m,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:g,keepIframeSrcFn:y,newlyAddedElement:!1})}var Ro=/(max|min)-device-(width|height)/,Ja=new RegExp(Ro.source,"g");function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Oo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var o=function r(){if(this instanceof r)return Reflect.construct(t,arguments,this.constructor);return t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),o}var Ye={exports:{}},as;function Io(){if(as)return Ye.exports;as=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Ye.exports=t(),Ye.exports.createColors=t,Ye.exports}var Ao={},Do=Object.freeze(Object.defineProperty({__proto__:null,default:Ao},Symbol.toStringTag,{value:"Module"})),me=Oo(Do),xt,ls;function Lr(){if(ls)return xt;ls=1;let e=Io(),t=me;class o extends Error{constructor(r,a,u,p,l,c){super(r);if(this.name="CssSyntaxError",this.reason=r,l)this.file=l;if(p)this.source=p;if(c)this.plugin=c;if(typeof a<"u"&&typeof u<"u")if(typeof a==="number")this.line=a,this.column=u;else this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,o)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let a=this.source;if(r==null)r=e.isColorSupported;if(t){if(r)a=t(a)}let u=a.split(/\r?\n/),p=Math.max(this.line-3,0),l=Math.min(this.line+2,u.length),c=String(l).length,i,d;if(r){let{bold:n,gray:s,red:h}=e.createColors(!0);i=(f)=>n(h(f)),d=(f)=>s(f)}else i=d=(n)=>n;return u.slice(p,l).map((n,s)=>{let h=p+1+s,f=" "+(" "+h).slice(-c)+" | ";if(h===this.line){let m=d(f.replace(/\d/g," "))+n.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+d(f)+n+` `+m+i("^")}return" "+d(f)+n}).join(` `)}toString(){let r=this.showSourceCode();if(r)r=` `+r+` -`;return this.name+": "+this.message+r}}return Et=o,o.default=o,Et}var Ye={},as;function Lr(){if(as)return Ye;return as=1,Ye.isClean=Symbol("isClean"),Ye.my=Symbol("my"),Ye}var xt,ls;function Ti(){if(ls)return xt;ls=1;let e={after:` +`;return this.name+": "+this.message+r}}return xt=o,o.default=o,xt}var Je={},us;function Fr(){if(us)return Je;return us=1,Je.isClean=Symbol("isClean"),Je.my=Symbol("my"),Je}var Mt,cs;function ki(){if(cs)return Mt;cs=1;let e={after:` `,beforeClose:` `,beforeComment:` `,beforeDecl:` @@ -14,24 +14,24 @@ `))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u>"u")u=this.raw(a,null,"beforeDecl");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeDecl(r,a){let u;if(r.walkDecls((p)=>{if(typeof p.raws.before<"u"){if(u=p.raws.before,u.includes(` `))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u>"u")u=this.raw(a,null,"beforeRule");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeOpen(r){let a;return r.walk((u)=>{if(u.type!=="decl"){if(a=u.raws.between,typeof a<"u")return!1}}),a}rawBeforeRule(r){let a;if(r.walk((u)=>{if(u.nodes&&(u.parent!==r||r.first!==u)){if(typeof u.raws.before<"u"){if(a=u.raws.before,a.includes(` `))a=a.replace(/[^\n]+$/,"");return!1}}}),a)a=a.replace(/\S/g,"");return a}rawColon(r){let a;return r.walkDecls((u)=>{if(typeof u.raws.between<"u")return a=u.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length===0){if(a=u.raws.after,typeof a<"u")return!1}}),a}rawIndent(r){if(r.raws.indent)return r.raws.indent;let a;return r.walk((u)=>{let p=u.parent;if(p&&p!==r&&p.parent&&p.parent===r){if(typeof u.raws.before<"u"){let l=u.raws.before.split(` -`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}}),a}rawSemicolon(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length&&u.last.type==="decl"){if(a=u.raws.semicolon,typeof a<"u")return!1}}),a}rawValue(r,a){let u=r[a],p=r.raws[a];if(p&&p.value===u)return p.raw;return u}root(r){if(this.body(r),r.raws.after)this.builder(r.raws.after)}rule(r){if(this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon)this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,a){if(!this[r.type])throw Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,a)}}return xt=o,o.default=o,xt}var Mt,us;function ut(){if(us)return Mt;us=1;let e=Ti();function t(o,r){new e(r).stringify(o)}return Mt=t,t.default=t,Mt}var Rt,cs;function ct(){if(cs)return Rt;cs=1;let{isClean:e,my:t}=Lr(),o=Pr(),r=Ti(),a=ut();function u(l,c){let i=new l.constructor;for(let d in l){if(!Object.prototype.hasOwnProperty.call(l,d))continue;if(d==="proxyCache")continue;let n=l[d],s=typeof n;if(d==="parent"&&s==="object"){if(c)i[d]=c}else if(d==="source")i[d]=n;else if(Array.isArray(n))i[d]=n.map((h)=>u(h,i));else{if(s==="object"&&n!==null)n=u(n);i[d]=n}}return i}class p{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let i of l[c])if(typeof i.clone==="function")this.append(i.clone());else this.append(i)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){if(delete this.raws.before,delete this.raws.after,!l)delete this.raws.between}clone(l={}){let c=u(this);for(let i in l)c[i]=l[i];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:i,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:i.column,line:i.line},c)}return new o(l)}getProxyProcessor(){return{get(l,c){if(c==="proxyOf")return l;else if(c==="root")return()=>l.root().toProxy();else return l[c]},set(l,c,i){if(l[c]===i)return!0;if(l[c]=i,c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")l.markDirty();return!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;while(l=l.parent)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let i=this.source.start;if(l.index)i=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);if(d!==-1)i=this.positionInside(d,c)}return i}positionInside(l,c){let i=c||this.toString(),d=this.source.start.column,n=this.source.start.line;for(let s=0;s{if(typeof f==="object"&&f.toJSON)return f.toJSON(null,c);else return f});else if(typeof h==="object"&&h.toJSON)i[s]=h.toJSON(null,c);else if(s==="source"){let f=c.get(h.input);if(f==null)f=n,c.set(h.input,n),n++;i[s]={end:h.end,inputId:f,start:h.start}}else i[s]=h}if(d)i.inputs=[...c.keys()].map((s)=>s.toJSON());return i}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(l=a){if(l.stringify)l=l.stringify;let c="";return l(this,(i)=>{c+=i}),c}warn(l,c,i){let d={node:this};for(let n in i)d[n]=i[n];return l.warn(c,d)}get proxyOf(){return this}}return Rt=p,p.default=p,Rt}var Nt,hs;function ht(){if(hs)return Nt;hs=1;let e=ct();class t extends e{constructor(o){if(o&&typeof o.value<"u"&&typeof o.value!=="string")o={...o,value:String(o.value)};super(o);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Nt=t,t.default=t,Nt}var Ot,fs;function Do(){if(fs)return Ot;fs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Ot={nanoid:(r=21)=>{let a="",u=r;while(u--)a+=e[Math.random()*64|0];return a},customAlphabet:(r,a=21)=>(u=a)=>{let p="",l=u;while(l--)p+=r[Math.random()*r.length|0];return p}},Ot}var It,ds;function _i(){if(ds)return It;ds=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{existsSync:o,readFileSync:r}=me,{dirname:a,join:u}=me;function p(c){if(Buffer)return Buffer.from(c,"base64").toString();else return window.atob(c)}class l{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=i.map?i.map.prev:void 0,n=this.loadMap(i.from,d);if(!this.mapFile&&i.from)this.mapFile=i.from;if(this.mapFile)this.root=a(this.mapFile);if(n)this.text=n}consumer(){if(!this.consumerCache)this.consumerCache=new e(this.text);return this.consumerCache}decodeInline(c){let i=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(n.test(c)||s.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||d.test(c))return p(c.substr(RegExp.lastMatch.length));let h=c.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+h)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){if(typeof c!=="object")return!1;return typeof c.mappings==="string"||typeof c._mappings==="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let d=c.lastIndexOf(i.pop()),n=c.indexOf("*/",d);if(d>-1&&n>-1)this.annotation=this.getAnnotationURL(c.substring(d,n))}loadFile(c){if(this.root=a(c),o(c))return this.mapFile=c,r(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i)if(typeof i==="string")return i;else if(typeof i==="function"){let d=i(c);if(d){let n=this.loadFile(d);if(!n)throw Error("Unable to load previous source map: "+d.toString());return n}}else if(i instanceof e)return t.fromSourceMap(i).toString();else if(i instanceof t)return i.toString();else if(this.isMap(i))return JSON.stringify(i);else throw Error("Unsupported previous source map format: "+i.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let d=this.annotation;if(c)d=u(a(c),d);return this.loadFile(d)}}startWith(c,i){if(!c)return!1;return c.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return It=l,l.default=l,It}var At,ps;function ft(){if(ps)return At;ps=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{fileURLToPath:o,pathToFileURL:r}=me,{isAbsolute:a,resolve:u}=me,{nanoid:p}=Do(),l=me,c=Pr(),i=_i(),d=Symbol("fromOffsetCache"),n=Boolean(e&&t),s=Boolean(u&&a);class h{constructor(f,m={}){if(f===null||typeof f>"u"||typeof f==="object"&&!f.toString)throw Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(m.from)if(!s||/^\w+:\/\//.test(m.from)||a(m.from))this.file=m.from;else this.file=u(m.from);if(s&&n){let w=new i(this.css,m);if(w.text){this.map=w;let C=w.consumer().file;if(!this.file&&C)this.file=this.mapResolve(C)}}if(!this.file)this.id="";if(this.map)this.map.file=this.from}error(f,m,w,C={}){let b,v,g;if(m&&typeof m==="object"){let S=m,x=w;if(typeof S.offset==="number"){let N=this.fromOffset(S.offset);m=N.line,w=N.col}else m=S.line,w=S.column;if(typeof x.offset==="number"){let N=this.fromOffset(x.offset);v=N.line,g=N.col}else v=x.line,g=x.column}else if(!w){let S=this.fromOffset(m);m=S.line,w=S.col}let y=this.origin(m,w,v,g);if(y)b=new c(f,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,C.plugin);else b=new c(f,v===void 0?m:{column:w,line:m},v===void 0?w:{column:g,line:v},this.css,this.file,C.plugin);if(b.input={column:w,endColumn:g,endLine:v,line:m,source:this.css},this.file){if(r)b.input.url=r(this.file).toString();b.input.file=this.file}return b}fromOffset(f){let m,w;if(!this[d]){let b=this.css.split(` -`);w=Array(b.length);let v=0;for(let g=0,y=b.length;g=m)C=w.length-1;else{let b=w.length-2,v;while(C>1),f=w[v+1])C=v+1;else{C=v;break}}return{col:f-w[C]+1,line:C+1}}mapResolve(f){if(/^\w+:\/\//.test(f))return f;return u(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,m,w,C){if(!this.map)return!1;let b=this.map.consumer(),v=b.originalPositionFor({column:m,line:f});if(!v.source)return!1;let g;if(typeof w==="number")g=b.originalPositionFor({column:C,line:w});let y;if(a(v.source))y=r(v.source);else y=new URL(v.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let S={column:v.column,endColumn:g&&g.column,endLine:g&&g.line,line:v.line,url:y.toString()};if(y.protocol==="file:")if(o)S.file=o(y);else throw Error("file: protocol is not available in this PostCSS build");let x=b.sourceContentFor(v.source);if(x)S.source=x;return S}toJSON(){let f={};for(let m of["hasBOM","css","file","id"])if(this[m]!=null)f[m]=this[m];if(this.map){if(f.map={...this.map},f.map.consumerCache)f.map.consumerCache=void 0}return f}get from(){return this.file||this.id}}if(At=h,h.default=h,l&&l.registerInput)l.registerInput(h);return At}var Dt,ms;function ki(){if(ms)return Dt;ms=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{dirname:o,relative:r,resolve:a,sep:u}=me,{pathToFileURL:p}=me,l=ft(),c=Boolean(e&&t),i=Boolean(o&&a&&r&&u);class d{constructor(n,s,h,f){this.stringify=n,this.mapOpts=h.map||{},this.root=s,this.opts=h,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;if(this.isInline())n="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")n=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")n=this.mapOpts.annotation(this.opts.to,this.root);else n=this.outputFile()+".map";let s=` +`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}}),a}rawSemicolon(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length&&u.last.type==="decl"){if(a=u.raws.semicolon,typeof a<"u")return!1}}),a}rawValue(r,a){let u=r[a],p=r.raws[a];if(p&&p.value===u)return p.raw;return u}root(r){if(this.body(r),r.raws.after)this.builder(r.raws.after)}rule(r){if(this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon)this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,a){if(!this[r.type])throw Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,a)}}return Mt=o,o.default=o,Mt}var Rt,hs;function ct(){if(hs)return Rt;hs=1;let e=ki();function t(o,r){new e(r).stringify(o)}return Rt=t,t.default=t,Rt}var Nt,fs;function ht(){if(fs)return Nt;fs=1;let{isClean:e,my:t}=Fr(),o=Lr(),r=ki(),a=ct();function u(l,c){let i=new l.constructor;for(let d in l){if(!Object.prototype.hasOwnProperty.call(l,d))continue;if(d==="proxyCache")continue;let n=l[d],s=typeof n;if(d==="parent"&&s==="object"){if(c)i[d]=c}else if(d==="source")i[d]=n;else if(Array.isArray(n))i[d]=n.map((h)=>u(h,i));else{if(s==="object"&&n!==null)n=u(n);i[d]=n}}return i}class p{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let i of l[c])if(typeof i.clone==="function")this.append(i.clone());else this.append(i)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){if(delete this.raws.before,delete this.raws.after,!l)delete this.raws.between}clone(l={}){let c=u(this);for(let i in l)c[i]=l[i];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:i,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:i.column,line:i.line},c)}return new o(l)}getProxyProcessor(){return{get(l,c){if(c==="proxyOf")return l;else if(c==="root")return()=>l.root().toProxy();else return l[c]},set(l,c,i){if(l[c]===i)return!0;if(l[c]=i,c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")l.markDirty();return!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;while(l=l.parent)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let i=this.source.start;if(l.index)i=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);if(d!==-1)i=this.positionInside(d,c)}return i}positionInside(l,c){let i=c||this.toString(),d=this.source.start.column,n=this.source.start.line;for(let s=0;s{if(typeof f==="object"&&f.toJSON)return f.toJSON(null,c);else return f});else if(typeof h==="object"&&h.toJSON)i[s]=h.toJSON(null,c);else if(s==="source"){let f=c.get(h.input);if(f==null)f=n,c.set(h.input,n),n++;i[s]={end:h.end,inputId:f,start:h.start}}else i[s]=h}if(d)i.inputs=[...c.keys()].map((s)=>s.toJSON());return i}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(l=a){if(l.stringify)l=l.stringify;let c="";return l(this,(i)=>{c+=i}),c}warn(l,c,i){let d={node:this};for(let n in i)d[n]=i[n];return l.warn(c,d)}get proxyOf(){return this}}return Nt=p,p.default=p,Nt}var Ot,ds;function ft(){if(ds)return Ot;ds=1;let e=ht();class t extends e{constructor(o){if(o&&typeof o.value<"u"&&typeof o.value!=="string")o={...o,value:String(o.value)};super(o);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Ot=t,t.default=t,Ot}var It,ps;function To(){if(ps)return It;ps=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return It={nanoid:(r=21)=>{let a="",u=r;while(u--)a+=e[Math.random()*64|0];return a},customAlphabet:(r,a=21)=>(u=a)=>{let p="",l=u;while(l--)p+=r[Math.random()*r.length|0];return p}},It}var At,ms;function Pi(){if(ms)return At;ms=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{existsSync:o,readFileSync:r}=me,{dirname:a,join:u}=me;function p(c){if(Buffer)return Buffer.from(c,"base64").toString();else return window.atob(c)}class l{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=i.map?i.map.prev:void 0,n=this.loadMap(i.from,d);if(!this.mapFile&&i.from)this.mapFile=i.from;if(this.mapFile)this.root=a(this.mapFile);if(n)this.text=n}consumer(){if(!this.consumerCache)this.consumerCache=new e(this.text);return this.consumerCache}decodeInline(c){let i=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(n.test(c)||s.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||d.test(c))return p(c.substr(RegExp.lastMatch.length));let h=c.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+h)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){if(typeof c!=="object")return!1;return typeof c.mappings==="string"||typeof c._mappings==="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let d=c.lastIndexOf(i.pop()),n=c.indexOf("*/",d);if(d>-1&&n>-1)this.annotation=this.getAnnotationURL(c.substring(d,n))}loadFile(c){if(this.root=a(c),o(c))return this.mapFile=c,r(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i)if(typeof i==="string")return i;else if(typeof i==="function"){let d=i(c);if(d){let n=this.loadFile(d);if(!n)throw Error("Unable to load previous source map: "+d.toString());return n}}else if(i instanceof e)return t.fromSourceMap(i).toString();else if(i instanceof t)return i.toString();else if(this.isMap(i))return JSON.stringify(i);else throw Error("Unsupported previous source map format: "+i.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let d=this.annotation;if(c)d=u(a(c),d);return this.loadFile(d)}}startWith(c,i){if(!c)return!1;return c.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return At=l,l.default=l,At}var Dt,gs;function dt(){if(gs)return Dt;gs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{fileURLToPath:o,pathToFileURL:r}=me,{isAbsolute:a,resolve:u}=me,{nanoid:p}=To(),l=me,c=Lr(),i=Pi(),d=Symbol("fromOffsetCache"),n=Boolean(e&&t),s=Boolean(u&&a);class h{constructor(f,m={}){if(f===null||typeof f>"u"||typeof f==="object"&&!f.toString)throw Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(m.from)if(!s||/^\w+:\/\//.test(m.from)||a(m.from))this.file=m.from;else this.file=u(m.from);if(s&&n){let w=new i(this.css,m);if(w.text){this.map=w;let C=w.consumer().file;if(!this.file&&C)this.file=this.mapResolve(C)}}if(!this.file)this.id="";if(this.map)this.map.file=this.from}error(f,m,w,C={}){let b,v,g;if(m&&typeof m==="object"){let S=m,x=w;if(typeof S.offset==="number"){let N=this.fromOffset(S.offset);m=N.line,w=N.col}else m=S.line,w=S.column;if(typeof x.offset==="number"){let N=this.fromOffset(x.offset);v=N.line,g=N.col}else v=x.line,g=x.column}else if(!w){let S=this.fromOffset(m);m=S.line,w=S.col}let y=this.origin(m,w,v,g);if(y)b=new c(f,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,C.plugin);else b=new c(f,v===void 0?m:{column:w,line:m},v===void 0?w:{column:g,line:v},this.css,this.file,C.plugin);if(b.input={column:w,endColumn:g,endLine:v,line:m,source:this.css},this.file){if(r)b.input.url=r(this.file).toString();b.input.file=this.file}return b}fromOffset(f){let m,w;if(!this[d]){let b=this.css.split(` +`);w=Array(b.length);let v=0;for(let g=0,y=b.length;g=m)C=w.length-1;else{let b=w.length-2,v;while(C>1),f=w[v+1])C=v+1;else{C=v;break}}return{col:f-w[C]+1,line:C+1}}mapResolve(f){if(/^\w+:\/\//.test(f))return f;return u(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,m,w,C){if(!this.map)return!1;let b=this.map.consumer(),v=b.originalPositionFor({column:m,line:f});if(!v.source)return!1;let g;if(typeof w==="number")g=b.originalPositionFor({column:C,line:w});let y;if(a(v.source))y=r(v.source);else y=new URL(v.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let S={column:v.column,endColumn:g&&g.column,endLine:g&&g.line,line:v.line,url:y.toString()};if(y.protocol==="file:")if(o)S.file=o(y);else throw Error("file: protocol is not available in this PostCSS build");let x=b.sourceContentFor(v.source);if(x)S.source=x;return S}toJSON(){let f={};for(let m of["hasBOM","css","file","id"])if(this[m]!=null)f[m]=this[m];if(this.map){if(f.map={...this.map},f.map.consumerCache)f.map.consumerCache=void 0}return f}get from(){return this.file||this.id}}if(Dt=h,h.default=h,l&&l.registerInput)l.registerInput(h);return Dt}var Tt,ys;function Li(){if(ys)return Tt;ys=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{dirname:o,relative:r,resolve:a,sep:u}=me,{pathToFileURL:p}=me,l=dt(),c=Boolean(e&&t),i=Boolean(o&&a&&r&&u);class d{constructor(n,s,h,f){this.stringify=n,this.mapOpts=h.map||{},this.root=s,this.opts=h,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;if(this.isInline())n="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")n=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")n=this.mapOpts.annotation(this.opts.to,this.root);else n=this.outputFile()+".map";let s=` `;if(this.css.includes(`\r `))s=`\r `;this.css+=s+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let s=this.toUrl(this.path(n.file)),h=n.root||o(n.file),f;if(this.mapOpts.sourcesContent===!1){if(f=new e(n.text),f.sourcesContent)f.sourcesContent=null}else f=n.consumer();this.map.applySourceMap(f,s,this.toUrl(this.path(h)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let n;for(let s=this.root.nodes.length-1;s>=0;s--){if(n=this.root.nodes[s],n.type!=="comment")continue;if(n.text.indexOf("# sourceMappingURL=")===0)this.root.removeChild(s)}}else if(this.css)this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,"")}generate(){if(this.clearAnnotation(),i&&c&&this.isMap())return this.generateMap();else{let n="";return this.stringify(this.root,(s)=>{n+=s}),[n]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let n=this.previous()[0].consumer();n.file=this.outputFile(),this.map=t.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,s=1,h="",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},m,w;this.stringify(this.root,(C,b,v)=>{if(this.css+=C,b&&v!=="end")if(f.generated.line=n,f.generated.column=s-1,b.source&&b.source.start)f.source=this.sourcePath(b),f.original.line=b.source.start.line,f.original.column=b.source.start.column-1,this.map.addMapping(f);else f.source=h,f.original.line=1,f.original.column=0,this.map.addMapping(f);if(m=C.match(/\n/g),m)n+=m.length,w=C.lastIndexOf(` -`),s=C.length-w;else s+=C.length;if(b&&v!=="start"){let g=b.parent||{raws:{}};if(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==g.last||g.raws.semicolon)if(b.source&&b.source.end)f.source=this.sourcePath(b),f.original.line=b.source.end.line,f.original.column=b.source.end.column-1,f.generated.line=n,f.generated.column=s-2,this.map.addMapping(f);else f.source=h,f.original.line=1,f.original.column=0,f.generated.line=n,f.generated.column=s-1,this.map.addMapping(f)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation<"u")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((n)=>n.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let n=this.mapOpts.annotation;if(typeof n<"u"&&n!==!0)return!1;if(this.previous().length)return this.previous().some((s)=>s.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((n)=>n.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(n){if(this.mapOpts.absolute)return n;if(n.charCodeAt(0)===60)return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let h=this.opts.to?o(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")h=o(a(h,this.mapOpts.annotation));let f=r(h,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((n)=>{if(n.source&&n.source.input.map){let s=n.source.input.map;if(!this.previousMaps.includes(s))this.previousMaps.push(s)}});else{let n=new l(this.originalCSS,this.opts);if(n.map)this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk((s)=>{if(s.source){let h=s.source.input.from;if(h&&!n[h]){n[h]=!0;let f=this.usesFileUrls?this.toFileUrl(h):this.toUrl(this.path(h));this.map.setSourceContent(f,s.source.input.css)}}});else if(this.css){let s=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(s,this.css)}}sourcePath(n){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(n.source.input.from);else return this.toUrl(this.path(n.source.input.from))}toBase64(n){if(Buffer)return Buffer.from(n).toString("base64");else return window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let s=this.memoizedFileURLs.get(n);if(s)return s;if(p){let h=p(n).toString();return this.memoizedFileURLs.set(n,h),h}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let s=this.memoizedURLs.get(n);if(s)return s;if(u==="\\")n=n.replace(/\\/g,"/");let h=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,h),h}}return Dt=d,Dt}var Tt,gs;function dt(){if(gs)return Tt;gs=1;let e=ct();class t extends e{constructor(o){super(o);this.type="comment"}}return Tt=t,t.default=t,Tt}var _t,ys;function Re(){if(ys)return _t;ys=1;let{isClean:e,my:t}=Lr(),o=ht(),r=dt(),a=ct(),u,p,l,c;function i(s){return s.map((h)=>{if(h.nodes)h.nodes=i(h.nodes);return delete h.source,h})}function d(s){if(s[e]=!1,s.proxyOf.nodes)for(let h of s.proxyOf.nodes)d(h)}class n extends a{append(...s){for(let h of s){let f=this.normalize(h,this.last);for(let m of f)this.proxyOf.nodes.push(m)}return this.markDirty(),this}cleanRaws(s){if(super.cleanRaws(s),this.nodes)for(let h of this.nodes)h.cleanRaws(s)}each(s){if(!this.proxyOf.nodes)return;let h=this.getIterator(),f,m;while(this.indexes[h]s[h](...f.map((m)=>{if(typeof m==="function")return(w,C)=>m(w.toProxy(),C);else return m}));else if(h==="every"||h==="some")return(f)=>s[h]((m,...w)=>f(m.toProxy(),...w));else if(h==="root")return()=>s.root().toProxy();else if(h==="nodes")return s.nodes.map((f)=>f.toProxy());else if(h==="first"||h==="last")return s[h].toProxy();else return s[h]},set(s,h,f){if(s[h]===f)return!0;if(s[h]=f,h==="name"||h==="params"||h==="selector")s.markDirty();return!0}}}index(s){if(typeof s==="number")return s;if(s.proxyOf)s=s.proxyOf;return this.proxyOf.nodes.indexOf(s)}insertAfter(s,h){let f=this.index(s),m=this.normalize(h,this.proxyOf.nodes[f]).reverse();f=this.index(s);for(let C of m)this.proxyOf.nodes.splice(f+1,0,C);let w;for(let C in this.indexes)if(w=this.indexes[C],f"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw Error("Value field is missed in node creation");else if(typeof s.value!=="string")s.value=String(s.value);s=[new o(s)]}else if(s.selector)s=[new p(s)];else if(s.name)s=[new l(s)];else if(s.text)s=[new r(s)];else throw Error("Unknown node type in node creation");return s.map((m)=>{if(!m[t])n.rebuild(m);if(m=m.proxyOf,m.parent)m.parent.removeChild(m);if(m[e])d(m);if(typeof m.raws.before>"u"){if(h&&typeof h.raws.before<"u")m.raws.before=h.raws.before.replace(/\S/g,"")}return m.parent=this.proxyOf,m})}prepend(...s){s=s.reverse();for(let h of s){let f=this.normalize(h,this.first,"prepend").reverse();for(let m of f)this.proxyOf.nodes.unshift(m);for(let m in this.indexes)this.indexes[m]=this.indexes[m]+f.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let h;for(let f in this.indexes)if(h=this.indexes[f],h>=s)this.indexes[f]=h-1;return this.markDirty(),this}replaceValues(s,h,f){if(!f)f=h,h={};return this.walkDecls((m)=>{if(h.props&&!h.props.includes(m.prop))return;if(h.fast&&!m.value.includes(h.fast))return;m.value=m.value.replace(s,f)}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){return this.each((h,f)=>{let m;try{m=s(h,f)}catch(w){throw h.addToError(w)}if(m!==!1&&h.walk)m=h.walk(s);return m})}walkAtRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="atrule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="atrule"&&s.test(f.name))return h(f,m)});return this.walk((f,m)=>{if(f.type==="atrule"&&f.name===s)return h(f,m)})}walkComments(s){return this.walk((h,f)=>{if(h.type==="comment")return s(h,f)})}walkDecls(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="decl")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="decl"&&s.test(f.prop))return h(f,m)});return this.walk((f,m)=>{if(f.type==="decl"&&f.prop===s)return h(f,m)})}walkRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="rule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="rule"&&s.test(f.selector))return h(f,m)});return this.walk((f,m)=>{if(f.type==="rule"&&f.selector===s)return h(f,m)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return n.registerParse=(s)=>{u=s},n.registerRule=(s)=>{p=s},n.registerAtRule=(s)=>{l=s},n.registerRoot=(s)=>{c=s},_t=n,n.default=n,n.rebuild=(s)=>{if(s.type==="atrule")Object.setPrototypeOf(s,l.prototype);else if(s.type==="rule")Object.setPrototypeOf(s,p.prototype);else if(s.type==="decl")Object.setPrototypeOf(s,o.prototype);else if(s.type==="comment")Object.setPrototypeOf(s,r.prototype);else if(s.type==="root")Object.setPrototypeOf(s,c.prototype);if(s[t]=!0,s.nodes)s.nodes.forEach((h)=>{n.rebuild(h)})},_t}var kt,ws;function Fr(){if(ws)return kt;ws=1;let e=Re(),t,o;class r extends e{constructor(a){super({type:"document",...a});if(!this.nodes)this.nodes=[]}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},kt=r,r.default=r,kt}var Pt,bs;function Pi(){if(bs)return Pt;bs=1;let e={};return Pt=function(o){if(e[o])return;if(e[o]=!0,typeof console<"u"&&console.warn)console.warn(o)},Pt}var Lt,vs;function Li(){if(vs)return Lt;vs=1;class e{constructor(t,o={}){if(this.type="warning",this.text=t,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}return Lt=e,e.default=e,Lt}var Ft,Ss;function Ur(){if(Ss)return Ft;Ss=1;let e=Li();class t{constructor(o,r,a){this.processor=o,this.messages=[],this.root=r,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){if(!r.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)r.plugin=this.lastPlugin.postcssPlugin}let a=new e(o,r);return this.messages.push(a),a}warnings(){return this.messages.filter((o)=>o.type==="warning")}get content(){return this.css}}return Ft=t,t.default=t,Ft}var Ut,Cs;function To(){if(Cs)return Ut;Cs=1;let e=39,t=34,o=92,r=47,a=10,u=32,p=12,l=9,c=13,i=91,d=93,n=40,s=41,h=123,f=125,m=59,w=42,C=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return Ut=function(N,A={}){let M=N.css.valueOf(),k=A.ignoreErrors,D,E,Z,re,q,W,I,P,F,T,J=M.length,R=0,ne=[],se=[];function Ee(){return R}function te(_){throw N.error("Unclosed "+_,R)}function de(){return se.length===0&&R>=J}function xe(_){if(se.length)return se.pop();if(R>=J)return;let K=_?_.ignoreUnclosed:!1;switch(D=M.charCodeAt(R),D){case a:case u:case l:case c:case p:{E=R;do E+=1,D=M.charCodeAt(E);while(D===u||D===a||D===l||D===c||D===p);T=["space",M.slice(R,E)],R=E-1;break}case i:case d:case h:case f:case C:case m:case s:{let j=String.fromCharCode(D);T=[j,j,R];break}case n:{if(P=ne.length?ne.pop()[1]:"",F=M.charCodeAt(R+1),P==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==l&&F!==p&&F!==c){E=R;do{if(W=!1,E=M.indexOf(")",E+1),E===-1)if(k||K){E=R;break}else te("bracket");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["brackets",M.slice(R,E+1),R,E],R=E}else if(E=M.indexOf(")",R+1),re=M.slice(R,E+1),E===-1||y.test(re))T=["(","(",R];else T=["brackets",re,R,E],R=E;break}case e:case t:{Z=D===e?"'":'"',E=R;do{if(W=!1,E=M.indexOf(Z,E+1),E===-1)if(k||K){E=R+1;break}else te("string");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["string",M.slice(R,E+1),R,E],R=E;break}case b:{if(v.lastIndex=R+1,v.test(M),v.lastIndex===0)E=M.length-1;else E=v.lastIndex-2;T=["at-word",M.slice(R,E+1),R,E],R=E;break}case o:{E=R,q=!0;while(M.charCodeAt(E+1)===o)E+=1,q=!q;if(D=M.charCodeAt(E+1),q&&D!==r&&D!==u&&D!==a&&D!==l&&D!==c&&D!==p){if(E+=1,S.test(M.charAt(E))){while(S.test(M.charAt(E+1)))E+=1;if(M.charCodeAt(E+1)===u)E+=1}}T=["word",M.slice(R,E+1),R,E],R=E;break}default:{if(D===r&&M.charCodeAt(R+1)===w){if(E=M.indexOf("*/",R+2)+1,E===0)if(k||K)E=M.length;else te("comment");T=["comment",M.slice(R,E+1),R,E],R=E}else{if(g.lastIndex=R+1,g.test(M),g.lastIndex===0)E=M.length-1;else E=g.lastIndex-2;T=["word",M.slice(R,E+1),R,E],ne.push(T),R=E}break}}return R++,T}function ve(_){se.push(_)}return{back:ve,endOfFile:de,nextToken:xe,position:Ee}},Ut}var Bt,Es;function Br(){if(Es)return Bt;Es=1;let e=Re();class t extends e{constructor(o){super(o);this.type="atrule"}append(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...o)}prepend(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...o)}}return Bt=t,t.default=t,e.registerAtRule(t),Bt}var $t,xs;function ze(){if(xs)return $t;xs=1;let e=Re(),t,o;class r extends e{constructor(a){super(a);if(this.type="root",!this.nodes)this.nodes=[]}normalize(a,u,p){let l=super.normalize(a);if(u){if(p==="prepend")if(this.nodes.length>1)u.raws.before=this.nodes[1].raws.before;else delete u.raws.before;else if(this.first!==u)for(let c of l)c.raws.before=u.raws.before}return l}removeChild(a,u){let p=this.index(a);if(!u&&p===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[p].raws.before;return super.removeChild(a)}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},$t=r,r.default=r,e.registerRoot(r),$t}var Wt,Ms;function Fi(){if(Ms)return Wt;Ms=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let o=[" ",` -`,"\t"];return e.split(t,o)},split(t,o,r){let a=[],u="",p=!1,l=0,c=!1,i="",d=!1;for(let n of t){if(d)d=!1;else if(n==="\\")d=!0;else if(c){if(n===i)c=!1}else if(n==='"'||n==="'")c=!0,i=n;else if(n==="(")l+=1;else if(n===")"){if(l>0)l-=1}else if(l===0){if(o.includes(n))p=!0}if(p){if(u!=="")a.push(u.trim());u="",p=!1}else u+=n}if(r||u!=="")a.push(u.trim());return a}};return Wt=e,e.default=e,Wt}var zt,Rs;function $r(){if(Rs)return zt;Rs=1;let e=Re(),t=Fi();class o extends e{constructor(r){super(r);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return t.comma(this.selector)}set selectors(r){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=r.join(u)}}return zt=o,o.default=o,e.registerRule(o),zt}var qt,Ns;function _o(){if(Ns)return qt;Ns=1;let e=ht(),t=To(),o=dt(),r=Br(),a=ze(),u=$r(),p={empty:!0,space:!0};function l(i){for(let d=i.length-1;d>=0;d--){let n=i[d],s=n[3]||n[2];if(s)return s}}class c{constructor(i){this.input=i,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let d=new r;if(d.name=i[1].slice(1),d.name==="")this.unnamedAtrule(d,i);this.init(d,i[2]);let n,s,h,f=!1,m=!1,w=[],C=[];while(!this.tokenizer.endOfFile()){if(i=this.tokenizer.nextToken(),n=i[0],n==="("||n==="[")C.push(n==="("?")":"]");else if(n==="{"&&C.length>0)C.push("}");else if(n===C[C.length-1])C.pop();if(C.length===0)if(n===";"){d.source.end=this.getPosition(i[2]),d.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){m=!0;break}else if(n==="}"){if(w.length>0){h=w.length-1,s=w[h];while(s&&s[0]==="space")s=w[--h];if(s)d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++}this.end(i);break}else w.push(i);else w.push(i);if(this.tokenizer.endOfFile()){f=!0;break}}if(d.raws.between=this.spacesAndCommentsFromEnd(w),w.length){if(d.raws.afterName=this.spacesAndCommentsFromStart(w),this.raw(d,"params",w),f)i=w[w.length-1],d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between=""}else d.raws.afterName="",d.params="";if(m)d.nodes=[],this.current=d}checkMissedSemicolon(i){let d=this.colon(i);if(d===!1)return;let n=0,s;for(let h=d-1;h>=0;h--)if(s=i[h],s[0]!=="space"){if(n+=1,n===2)break}throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(i){let d=0,n,s,h;for(let[f,m]of i.entries()){if(n=m,s=n[0],s==="(")d+=1;if(s===")")d-=1;if(d===0&&s===":")if(!h)this.doubleColon(n);else if(h[0]==="word"&&h[1]==="progid")continue;else return f;h=n}return!1}comment(i){let d=new o;this.init(d,i[2]),d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++;let n=i[1].slice(2,-2);if(/^\s*$/.test(n))d.text="",d.raws.left=n,d.raws.right="";else{let s=n.match(/^(\s*)([^]*\S)(\s*)$/);d.text=s[2],d.raws.left=s[1],d.raws.right=s[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,d){let n=new e;this.init(n,i[0][2]);let s=i[i.length-1];if(s[0]===";")this.semicolon=!0,i.pop();n.source.end=this.getPosition(s[3]||s[2]||l(i)),n.source.end.offset++;while(i[0][0]!=="word"){if(i.length===1)this.unknownWord(i);n.raws.before+=i.shift()[1]}n.source.start=this.getPosition(i[0][2]),n.prop="";while(i.length){let C=i[0][0];if(C===":"||C==="space"||C==="comment")break;n.prop+=i.shift()[1]}n.raws.between="";let h;while(i.length)if(h=i.shift(),h[0]===":"){n.raws.between+=h[1];break}else{if(h[0]==="word"&&/\w/.test(h[1]))this.unknownWord([h]);n.raws.between+=h[1]}if(n.prop[0]==="_"||n.prop[0]==="*")n.raws.before+=n.prop[0],n.prop=n.prop.slice(1);let f=[],m;while(i.length){if(m=i[0][0],m!=="space"&&m!=="comment")break;f.push(i.shift())}this.precheckMissedSemicolon(i);for(let C=i.length-1;C>=0;C--){if(h=i[C],h[1].toLowerCase()==="!important"){n.important=!0;let b=this.stringFrom(i,C);if(b=this.spacesFromEnd(i)+b,b!==" !important")n.raws.important=b;break}else if(h[1].toLowerCase()==="important"){let b=i.slice(0),v="";for(let g=C;g>0;g--){let y=b[g][0];if(v.trim().indexOf("!")===0&&y!=="space")break;v=b.pop()[1]+v}if(v.trim().indexOf("!")===0)n.important=!0,n.raws.important=v,i=b}if(h[0]!=="space"&&h[0]!=="comment")break}if(i.some((C)=>C[0]!=="space"&&C[0]!=="comment"))n.raws.between+=f.map((C)=>C[1]).join(""),f=[];if(this.raw(n,"value",f.concat(i),d),n.value.includes(":")&&!d)this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let d=new u;this.init(d,i[2]),d.selector="",d.raws.between="",this.current=d}end(i){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(i)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];if(d&&d.type==="rule"&&!d.raws.ownSemicolon)d.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(i){let d=this.input.fromOffset(i);return{column:d.col,line:d.line,offset:i}}init(i,d){if(this.current.push(i),i.source={input:this.input,start:this.getPosition(d)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment")this.semicolon=!1}other(i){let d=!1,n=null,s=!1,h=null,f=[],m=i[1].startsWith("--"),w=[],C=i;while(C){if(n=C[0],w.push(C),n==="("||n==="["){if(!h)h=C;f.push(n==="("?")":"]")}else if(m&&s&&n==="{"){if(!h)h=C;f.push("}")}else if(f.length===0){if(n===";")if(s){this.decl(w,m);return}else break;else if(n==="{"){this.rule(w);return}else if(n==="}"){this.tokenizer.back(w.pop()),d=!0;break}else if(n===":")s=!0}else if(n===f[f.length-1]){if(f.pop(),f.length===0)h=null}C=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())d=!0;if(f.length>0)this.unclosedBracket(h);if(d&&s){if(!m)while(w.length){if(C=w[w.length-1][0],C!=="space"&&C!=="comment")break;this.tokenizer.back(w.pop())}this.decl(w,m)}else this.unknownWord(w)}parse(){let i;while(!this.tokenizer.endOfFile())switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,d,n,s){let h,f,m=n.length,w="",C=!0,b,v;for(let g=0;gy+S[1],"");i.raws[d]={raw:g,value:w}}i[d]=w}rule(i){i.pop();let d=new u;this.init(d,i[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(d,"selector",i),this.current=d}spacesAndCommentsFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space"&&d!=="comment")break;n=i.pop()[1]+n}return n}spacesAndCommentsFromStart(i){let d,n="";while(i.length){if(d=i[0][0],d!=="space"&&d!=="comment")break;n+=i.shift()[1]}return n}spacesFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space")break;n=i.pop()[1]+n}return n}stringFrom(i,d){let n="";for(let s=d;sn.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let n=this.mapOpts.annotation;if(typeof n<"u"&&n!==!0)return!1;if(this.previous().length)return this.previous().some((s)=>s.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((n)=>n.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(n){if(this.mapOpts.absolute)return n;if(n.charCodeAt(0)===60)return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let h=this.opts.to?o(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")h=o(a(h,this.mapOpts.annotation));let f=r(h,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((n)=>{if(n.source&&n.source.input.map){let s=n.source.input.map;if(!this.previousMaps.includes(s))this.previousMaps.push(s)}});else{let n=new l(this.originalCSS,this.opts);if(n.map)this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk((s)=>{if(s.source){let h=s.source.input.from;if(h&&!n[h]){n[h]=!0;let f=this.usesFileUrls?this.toFileUrl(h):this.toUrl(this.path(h));this.map.setSourceContent(f,s.source.input.css)}}});else if(this.css){let s=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(s,this.css)}}sourcePath(n){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(n.source.input.from);else return this.toUrl(this.path(n.source.input.from))}toBase64(n){if(Buffer)return Buffer.from(n).toString("base64");else return window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let s=this.memoizedFileURLs.get(n);if(s)return s;if(p){let h=p(n).toString();return this.memoizedFileURLs.set(n,h),h}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let s=this.memoizedURLs.get(n);if(s)return s;if(u==="\\")n=n.replace(/\\/g,"/");let h=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,h),h}}return Tt=d,Tt}var _t,ws;function pt(){if(ws)return _t;ws=1;let e=ht();class t extends e{constructor(o){super(o);this.type="comment"}}return _t=t,t.default=t,_t}var kt,bs;function Re(){if(bs)return kt;bs=1;let{isClean:e,my:t}=Fr(),o=ft(),r=pt(),a=ht(),u,p,l,c;function i(s){return s.map((h)=>{if(h.nodes)h.nodes=i(h.nodes);return delete h.source,h})}function d(s){if(s[e]=!1,s.proxyOf.nodes)for(let h of s.proxyOf.nodes)d(h)}class n extends a{append(...s){for(let h of s){let f=this.normalize(h,this.last);for(let m of f)this.proxyOf.nodes.push(m)}return this.markDirty(),this}cleanRaws(s){if(super.cleanRaws(s),this.nodes)for(let h of this.nodes)h.cleanRaws(s)}each(s){if(!this.proxyOf.nodes)return;let h=this.getIterator(),f,m;while(this.indexes[h]s[h](...f.map((m)=>{if(typeof m==="function")return(w,C)=>m(w.toProxy(),C);else return m}));else if(h==="every"||h==="some")return(f)=>s[h]((m,...w)=>f(m.toProxy(),...w));else if(h==="root")return()=>s.root().toProxy();else if(h==="nodes")return s.nodes.map((f)=>f.toProxy());else if(h==="first"||h==="last")return s[h].toProxy();else return s[h]},set(s,h,f){if(s[h]===f)return!0;if(s[h]=f,h==="name"||h==="params"||h==="selector")s.markDirty();return!0}}}index(s){if(typeof s==="number")return s;if(s.proxyOf)s=s.proxyOf;return this.proxyOf.nodes.indexOf(s)}insertAfter(s,h){let f=this.index(s),m=this.normalize(h,this.proxyOf.nodes[f]).reverse();f=this.index(s);for(let C of m)this.proxyOf.nodes.splice(f+1,0,C);let w;for(let C in this.indexes)if(w=this.indexes[C],f"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw Error("Value field is missed in node creation");else if(typeof s.value!=="string")s.value=String(s.value);s=[new o(s)]}else if(s.selector)s=[new p(s)];else if(s.name)s=[new l(s)];else if(s.text)s=[new r(s)];else throw Error("Unknown node type in node creation");return s.map((m)=>{if(!m[t])n.rebuild(m);if(m=m.proxyOf,m.parent)m.parent.removeChild(m);if(m[e])d(m);if(typeof m.raws.before>"u"){if(h&&typeof h.raws.before<"u")m.raws.before=h.raws.before.replace(/\S/g,"")}return m.parent=this.proxyOf,m})}prepend(...s){s=s.reverse();for(let h of s){let f=this.normalize(h,this.first,"prepend").reverse();for(let m of f)this.proxyOf.nodes.unshift(m);for(let m in this.indexes)this.indexes[m]=this.indexes[m]+f.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let h;for(let f in this.indexes)if(h=this.indexes[f],h>=s)this.indexes[f]=h-1;return this.markDirty(),this}replaceValues(s,h,f){if(!f)f=h,h={};return this.walkDecls((m)=>{if(h.props&&!h.props.includes(m.prop))return;if(h.fast&&!m.value.includes(h.fast))return;m.value=m.value.replace(s,f)}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){return this.each((h,f)=>{let m;try{m=s(h,f)}catch(w){throw h.addToError(w)}if(m!==!1&&h.walk)m=h.walk(s);return m})}walkAtRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="atrule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="atrule"&&s.test(f.name))return h(f,m)});return this.walk((f,m)=>{if(f.type==="atrule"&&f.name===s)return h(f,m)})}walkComments(s){return this.walk((h,f)=>{if(h.type==="comment")return s(h,f)})}walkDecls(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="decl")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="decl"&&s.test(f.prop))return h(f,m)});return this.walk((f,m)=>{if(f.type==="decl"&&f.prop===s)return h(f,m)})}walkRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="rule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="rule"&&s.test(f.selector))return h(f,m)});return this.walk((f,m)=>{if(f.type==="rule"&&f.selector===s)return h(f,m)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return n.registerParse=(s)=>{u=s},n.registerRule=(s)=>{p=s},n.registerAtRule=(s)=>{l=s},n.registerRoot=(s)=>{c=s},kt=n,n.default=n,n.rebuild=(s)=>{if(s.type==="atrule")Object.setPrototypeOf(s,l.prototype);else if(s.type==="rule")Object.setPrototypeOf(s,p.prototype);else if(s.type==="decl")Object.setPrototypeOf(s,o.prototype);else if(s.type==="comment")Object.setPrototypeOf(s,r.prototype);else if(s.type==="root")Object.setPrototypeOf(s,c.prototype);if(s[t]=!0,s.nodes)s.nodes.forEach((h)=>{n.rebuild(h)})},kt}var Pt,vs;function Ur(){if(vs)return Pt;vs=1;let e=Re(),t,o;class r extends e{constructor(a){super({type:"document",...a});if(!this.nodes)this.nodes=[]}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},Pt=r,r.default=r,Pt}var Lt,Ss;function Fi(){if(Ss)return Lt;Ss=1;let e={};return Lt=function(o){if(e[o])return;if(e[o]=!0,typeof console<"u"&&console.warn)console.warn(o)},Lt}var Ft,Cs;function Ui(){if(Cs)return Ft;Cs=1;class e{constructor(t,o={}){if(this.type="warning",this.text=t,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}return Ft=e,e.default=e,Ft}var Ut,Es;function Br(){if(Es)return Ut;Es=1;let e=Ui();class t{constructor(o,r,a){this.processor=o,this.messages=[],this.root=r,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){if(!r.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)r.plugin=this.lastPlugin.postcssPlugin}let a=new e(o,r);return this.messages.push(a),a}warnings(){return this.messages.filter((o)=>o.type==="warning")}get content(){return this.css}}return Ut=t,t.default=t,Ut}var Bt,xs;function _o(){if(xs)return Bt;xs=1;let e=39,t=34,o=92,r=47,a=10,u=32,p=12,l=9,c=13,i=91,d=93,n=40,s=41,h=123,f=125,m=59,w=42,C=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return Bt=function(N,A={}){let M=N.css.valueOf(),k=A.ignoreErrors,D,E,Z,re,q,W,I,P,F,T,J=M.length,R=0,ne=[],se=[];function Ee(){return R}function te(_){throw N.error("Unclosed "+_,R)}function de(){return se.length===0&&R>=J}function xe(_){if(se.length)return se.pop();if(R>=J)return;let K=_?_.ignoreUnclosed:!1;switch(D=M.charCodeAt(R),D){case a:case u:case l:case c:case p:{E=R;do E+=1,D=M.charCodeAt(E);while(D===u||D===a||D===l||D===c||D===p);T=["space",M.slice(R,E)],R=E-1;break}case i:case d:case h:case f:case C:case m:case s:{let j=String.fromCharCode(D);T=[j,j,R];break}case n:{if(P=ne.length?ne.pop()[1]:"",F=M.charCodeAt(R+1),P==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==l&&F!==p&&F!==c){E=R;do{if(W=!1,E=M.indexOf(")",E+1),E===-1)if(k||K){E=R;break}else te("bracket");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["brackets",M.slice(R,E+1),R,E],R=E}else if(E=M.indexOf(")",R+1),re=M.slice(R,E+1),E===-1||y.test(re))T=["(","(",R];else T=["brackets",re,R,E],R=E;break}case e:case t:{Z=D===e?"'":'"',E=R;do{if(W=!1,E=M.indexOf(Z,E+1),E===-1)if(k||K){E=R+1;break}else te("string");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["string",M.slice(R,E+1),R,E],R=E;break}case b:{if(v.lastIndex=R+1,v.test(M),v.lastIndex===0)E=M.length-1;else E=v.lastIndex-2;T=["at-word",M.slice(R,E+1),R,E],R=E;break}case o:{E=R,q=!0;while(M.charCodeAt(E+1)===o)E+=1,q=!q;if(D=M.charCodeAt(E+1),q&&D!==r&&D!==u&&D!==a&&D!==l&&D!==c&&D!==p){if(E+=1,S.test(M.charAt(E))){while(S.test(M.charAt(E+1)))E+=1;if(M.charCodeAt(E+1)===u)E+=1}}T=["word",M.slice(R,E+1),R,E],R=E;break}default:{if(D===r&&M.charCodeAt(R+1)===w){if(E=M.indexOf("*/",R+2)+1,E===0)if(k||K)E=M.length;else te("comment");T=["comment",M.slice(R,E+1),R,E],R=E}else{if(g.lastIndex=R+1,g.test(M),g.lastIndex===0)E=M.length-1;else E=g.lastIndex-2;T=["word",M.slice(R,E+1),R,E],ne.push(T),R=E}break}}return R++,T}function ve(_){se.push(_)}return{back:ve,endOfFile:de,nextToken:xe,position:Ee}},Bt}var $t,Ms;function $r(){if(Ms)return $t;Ms=1;let e=Re();class t extends e{constructor(o){super(o);this.type="atrule"}append(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...o)}prepend(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...o)}}return $t=t,t.default=t,e.registerAtRule(t),$t}var Wt,Rs;function ze(){if(Rs)return Wt;Rs=1;let e=Re(),t,o;class r extends e{constructor(a){super(a);if(this.type="root",!this.nodes)this.nodes=[]}normalize(a,u,p){let l=super.normalize(a);if(u){if(p==="prepend")if(this.nodes.length>1)u.raws.before=this.nodes[1].raws.before;else delete u.raws.before;else if(this.first!==u)for(let c of l)c.raws.before=u.raws.before}return l}removeChild(a,u){let p=this.index(a);if(!u&&p===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[p].raws.before;return super.removeChild(a)}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},Wt=r,r.default=r,e.registerRoot(r),Wt}var zt,Ns;function Bi(){if(Ns)return zt;Ns=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let o=[" ",` +`,"\t"];return e.split(t,o)},split(t,o,r){let a=[],u="",p=!1,l=0,c=!1,i="",d=!1;for(let n of t){if(d)d=!1;else if(n==="\\")d=!0;else if(c){if(n===i)c=!1}else if(n==='"'||n==="'")c=!0,i=n;else if(n==="(")l+=1;else if(n===")"){if(l>0)l-=1}else if(l===0){if(o.includes(n))p=!0}if(p){if(u!=="")a.push(u.trim());u="",p=!1}else u+=n}if(r||u!=="")a.push(u.trim());return a}};return zt=e,e.default=e,zt}var qt,Os;function Wr(){if(Os)return qt;Os=1;let e=Re(),t=Bi();class o extends e{constructor(r){super(r);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return t.comma(this.selector)}set selectors(r){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=r.join(u)}}return qt=o,o.default=o,e.registerRule(o),qt}var jt,Is;function ko(){if(Is)return jt;Is=1;let e=ft(),t=_o(),o=pt(),r=$r(),a=ze(),u=Wr(),p={empty:!0,space:!0};function l(i){for(let d=i.length-1;d>=0;d--){let n=i[d],s=n[3]||n[2];if(s)return s}}class c{constructor(i){this.input=i,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let d=new r;if(d.name=i[1].slice(1),d.name==="")this.unnamedAtrule(d,i);this.init(d,i[2]);let n,s,h,f=!1,m=!1,w=[],C=[];while(!this.tokenizer.endOfFile()){if(i=this.tokenizer.nextToken(),n=i[0],n==="("||n==="[")C.push(n==="("?")":"]");else if(n==="{"&&C.length>0)C.push("}");else if(n===C[C.length-1])C.pop();if(C.length===0)if(n===";"){d.source.end=this.getPosition(i[2]),d.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){m=!0;break}else if(n==="}"){if(w.length>0){h=w.length-1,s=w[h];while(s&&s[0]==="space")s=w[--h];if(s)d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++}this.end(i);break}else w.push(i);else w.push(i);if(this.tokenizer.endOfFile()){f=!0;break}}if(d.raws.between=this.spacesAndCommentsFromEnd(w),w.length){if(d.raws.afterName=this.spacesAndCommentsFromStart(w),this.raw(d,"params",w),f)i=w[w.length-1],d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between=""}else d.raws.afterName="",d.params="";if(m)d.nodes=[],this.current=d}checkMissedSemicolon(i){let d=this.colon(i);if(d===!1)return;let n=0,s;for(let h=d-1;h>=0;h--)if(s=i[h],s[0]!=="space"){if(n+=1,n===2)break}throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(i){let d=0,n,s,h;for(let[f,m]of i.entries()){if(n=m,s=n[0],s==="(")d+=1;if(s===")")d-=1;if(d===0&&s===":")if(!h)this.doubleColon(n);else if(h[0]==="word"&&h[1]==="progid")continue;else return f;h=n}return!1}comment(i){let d=new o;this.init(d,i[2]),d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++;let n=i[1].slice(2,-2);if(/^\s*$/.test(n))d.text="",d.raws.left=n,d.raws.right="";else{let s=n.match(/^(\s*)([^]*\S)(\s*)$/);d.text=s[2],d.raws.left=s[1],d.raws.right=s[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,d){let n=new e;this.init(n,i[0][2]);let s=i[i.length-1];if(s[0]===";")this.semicolon=!0,i.pop();n.source.end=this.getPosition(s[3]||s[2]||l(i)),n.source.end.offset++;while(i[0][0]!=="word"){if(i.length===1)this.unknownWord(i);n.raws.before+=i.shift()[1]}n.source.start=this.getPosition(i[0][2]),n.prop="";while(i.length){let C=i[0][0];if(C===":"||C==="space"||C==="comment")break;n.prop+=i.shift()[1]}n.raws.between="";let h;while(i.length)if(h=i.shift(),h[0]===":"){n.raws.between+=h[1];break}else{if(h[0]==="word"&&/\w/.test(h[1]))this.unknownWord([h]);n.raws.between+=h[1]}if(n.prop[0]==="_"||n.prop[0]==="*")n.raws.before+=n.prop[0],n.prop=n.prop.slice(1);let f=[],m;while(i.length){if(m=i[0][0],m!=="space"&&m!=="comment")break;f.push(i.shift())}this.precheckMissedSemicolon(i);for(let C=i.length-1;C>=0;C--){if(h=i[C],h[1].toLowerCase()==="!important"){n.important=!0;let b=this.stringFrom(i,C);if(b=this.spacesFromEnd(i)+b,b!==" !important")n.raws.important=b;break}else if(h[1].toLowerCase()==="important"){let b=i.slice(0),v="";for(let g=C;g>0;g--){let y=b[g][0];if(v.trim().indexOf("!")===0&&y!=="space")break;v=b.pop()[1]+v}if(v.trim().indexOf("!")===0)n.important=!0,n.raws.important=v,i=b}if(h[0]!=="space"&&h[0]!=="comment")break}if(i.some((C)=>C[0]!=="space"&&C[0]!=="comment"))n.raws.between+=f.map((C)=>C[1]).join(""),f=[];if(this.raw(n,"value",f.concat(i),d),n.value.includes(":")&&!d)this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let d=new u;this.init(d,i[2]),d.selector="",d.raws.between="",this.current=d}end(i){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(i)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];if(d&&d.type==="rule"&&!d.raws.ownSemicolon)d.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(i){let d=this.input.fromOffset(i);return{column:d.col,line:d.line,offset:i}}init(i,d){if(this.current.push(i),i.source={input:this.input,start:this.getPosition(d)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment")this.semicolon=!1}other(i){let d=!1,n=null,s=!1,h=null,f=[],m=i[1].startsWith("--"),w=[],C=i;while(C){if(n=C[0],w.push(C),n==="("||n==="["){if(!h)h=C;f.push(n==="("?")":"]")}else if(m&&s&&n==="{"){if(!h)h=C;f.push("}")}else if(f.length===0){if(n===";")if(s){this.decl(w,m);return}else break;else if(n==="{"){this.rule(w);return}else if(n==="}"){this.tokenizer.back(w.pop()),d=!0;break}else if(n===":")s=!0}else if(n===f[f.length-1]){if(f.pop(),f.length===0)h=null}C=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())d=!0;if(f.length>0)this.unclosedBracket(h);if(d&&s){if(!m)while(w.length){if(C=w[w.length-1][0],C!=="space"&&C!=="comment")break;this.tokenizer.back(w.pop())}this.decl(w,m)}else this.unknownWord(w)}parse(){let i;while(!this.tokenizer.endOfFile())switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,d,n,s){let h,f,m=n.length,w="",C=!0,b,v;for(let g=0;gy+S[1],"");i.raws[d]={raw:g,value:w}}i[d]=w}rule(i){i.pop();let d=new u;this.init(d,i[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(d,"selector",i),this.current=d}spacesAndCommentsFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space"&&d!=="comment")break;n=i.pop()[1]+n}return n}spacesAndCommentsFromStart(i){let d,n="";while(i.length){if(d=i[0][0],d!=="space"&&d!=="comment")break;n+=i.shift()[1]}return n}spacesFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space")break;n=i.pop()[1]+n}return n}stringFrom(i,d){let n="";for(let s=d;sC(y));return g}let b={};class v{constructor(g,y,S){this.stringified=!1,this.processed=!1;let x;if(typeof y==="object"&&y!==null&&(y.type==="root"||y.type==="document"))x=C(y);else if(y instanceof v||y instanceof l){if(x=C(y.root),y.map){if(typeof S.map>"u")S.map={};if(!S.map.inline)S.map.inline=!1;S.map.prev=y.map}}else{let N=c;if(S.syntax)N=S.syntax.parse;if(S.parser)N=S.parser;if(N.parse)N=N.parse;try{x=N(y,S)}catch(A){this.processed=!0,this.error=A}if(x&&!x[t])a.rebuild(x)}this.result=new l(g,x,S),this.helpers={...b,postcss:b,result:this.result},this.plugins=this.processor.plugins.map((N)=>{if(typeof N==="object"&&N.prepare)return{...N,...N.prepare(this.result)};else return N})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(g,y){let S=this.result.lastPlugin;try{if(y)y.addToError(g);if(this.error=g,g.name==="CssSyntaxError"&&!g.plugin)g.plugin=S.postcssPlugin,g.setMessage();else if(S.postcssVersion){let{postcssPlugin:x,postcssVersion:N}=S,A=this.result.processor.version,M=N.split("."),k=A.split(".");if(M[0]!==k[0]||parseInt(M[1])>parseInt(k[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+A+", but "+x+" uses "+N+". Perhaps this is the source of the error below.")}}catch(x){if(console&&console.error)console.error(x)}return g}prepareVisitors(){this.listeners={};let g=(y,S,x)=>{if(!this.listeners[S])this.listeners[S]=[];this.listeners[S].push([y,x])};for(let y of this.plugins)if(typeof y==="object")for(let S in y){if(!n[S]&&/^[A-Z]/.test(S))throw Error(`Unknown event ${S} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!s[S]){if(typeof y[S]==="object")for(let x in y[S])if(x==="*")g(y,S,y[S][x]);else g(y,S+"-"+x.toLowerCase(),y[S][x]);else if(typeof y[S]==="function")g(y,S,y[S])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g0){let S=this.visitTick(y);if(f(S))try{await S}catch(x){let N=y[y.length-1].node;throw this.handleError(x,N)}}}if(this.listeners.OnceExit)for(let[y,S]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(g.type==="document"){let x=g.nodes.map((N)=>S(N,this.helpers));await Promise.all(x)}else await S(g,this.helpers)}catch(x){throw this.handleError(x)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g==="object"&&g.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map((S)=>g.Once(S,this.helpers));if(f(y[0]))return Promise.all(y);return y}return g.Once(this.result.root,this.helpers)}else if(typeof g==="function")return g(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,y=r;if(g.syntax)y=g.syntax.stringify;if(g.stringifier)y=g.stringifier;if(y.stringify)y=y.stringify;let x=new o(y,this.result.root,this.result.opts).generate();return this.result.css=x[0],this.result.map=x[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let g of this.plugins){let y=this.runOnRoot(g);if(f(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;while(!g[e])g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let y of g.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,y){if(!("from"in this.opts))p("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(g,y)}toString(){return this.css}visitSync(g,y){for(let[S,x]of g){this.result.lastPlugin=S;let N;try{N=x(y,this.helpers)}catch(A){throw this.handleError(A,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let y=g[g.length-1],{node:S,visitors:x}=y;if(S.type!=="root"&&S.type!=="document"&&!S.parent){g.pop();return}if(x.length>0&&y.visitorIndex{if(!x[e])this.walkSync(x)})}else{let x=this.listeners[S];if(x){if(this.visitSync(x,g.toProxy()))return}}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=(g)=>{b=g},Vt=v,v.default=v,i.registerLazyResult(v),u.registerLazyResult(v),Vt}var Gt,As;function ko(){if(As)return Gt;As=1;let e=ki(),t=ut(),o=Pi(),r=Wr(),a=Ur();class u{constructor(p,l,c){l=l.toString(),this.stringified=!1,this._processor=p,this._css=l,this._opts=c,this._map=void 0;let i,d=t;this.result=new a(this._processor,i,this._opts),this.result.css=l;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let s=new e(d,i,this._opts,l);if(s.isMap()){let[h,f]=s.generate();if(h)this.result.css=h;if(f)this.result.map=f}else s.clearAnnotation(),this.result.css=s.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,l){if(!("from"in this._opts))o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(p,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let p,l=r;try{p=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;else return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}}return Gt=u,u.default=u,Gt}var Ht,Ds;function Po(){if(Ds)return Ht;Ds=1;let e=ko(),t=Ui(),o=Fr(),r=ze();class a{constructor(u=[]){this.version="8.4.38",this.plugins=this.normalize(u)}normalize(u){let p=[];for(let l of u){if(l.postcss===!0)l=l();else if(l.postcss)l=l.postcss;if(typeof l==="object"&&Array.isArray(l.plugins))p=p.concat(l.plugins);else if(typeof l==="object"&&l.postcssPlugin)p.push(l);else if(typeof l==="function")p.push(l);else if(typeof l==="object"&&(l.parse||l.stringify))throw Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw Error(l+" is not a PostCSS plugin")}return p}process(u,p={}){if(!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax)return new e(this,u,p);else return new t(this,u,p)}use(u){return this.plugins=this.plugins.concat(this.normalize([u])),this}}return Ht=a,a.default=a,r.registerProcessor(a),o.registerProcessor(a),Ht}var Yt,Ts;function Lo(){if(Ts)return Yt;Ts=1;let e=ht(),t=_i(),o=dt(),r=Br(),a=ft(),u=ze(),p=$r();function l(c,i){if(Array.isArray(c))return c.map((s)=>l(s));let{inputs:d,...n}=c;if(d){i=[];for(let s of d){let h={...s,__proto__:a.prototype};if(h.map)h.map={...h.map,__proto__:t.prototype};i.push(h)}}if(n.nodes)n.nodes=c.nodes.map((s)=>l(s,i));if(n.source){let{inputId:s,...h}=n.source;if(n.source=h,s!=null)n.source.input=i[s]}if(n.type==="root")return new u(n);else if(n.type==="decl")return new e(n);else if(n.type==="rule")return new p(n);else if(n.type==="comment")return new o(n);else if(n.type==="atrule")return new r(n);else throw Error("Unknown node type: "+c.type)}return Yt=l,l.default=l,Yt}var Jt,_s;function Fo(){if(_s)return Jt;_s=1;let e=Pr(),t=ht(),o=Ui(),r=Re(),a=Po(),u=ut(),p=Lo(),l=Fr(),c=Li(),i=dt(),d=Br(),n=Ur(),s=ft(),h=Wr(),f=Fi(),m=$r(),w=ze(),C=ct();function b(...v){if(v.length===1&&Array.isArray(v[0]))v=v[0];return new a(v)}return b.plugin=function(g,y){let S=!1;function x(...A){if(console&&console.warn&&!S){if(S=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide: +You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw c}return l.root}return Vt=r,r.default=r,e.registerParse(r),Vt}var Gt,Ds;function $i(){if(Ds)return Gt;Ds=1;let{isClean:e,my:t}=Fr(),o=Li(),r=ct(),a=Re(),u=Ur(),p=Fi(),l=Br(),c=zr(),i=ze(),d={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},n={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},s={Once:!0,postcssPlugin:!0,prepare:!0},h=0;function f(g){return typeof g==="object"&&typeof g.then==="function"}function m(g){let y=!1,S=d[g.type];if(g.type==="decl")y=g.prop.toLowerCase();else if(g.type==="atrule")y=g.name.toLowerCase();if(y&&g.append)return[S,S+"-"+y,h,S+"Exit",S+"Exit-"+y];else if(y)return[S,S+"-"+y,S+"Exit",S+"Exit-"+y];else if(g.append)return[S,h,S+"Exit"];else return[S,S+"Exit"]}function w(g){let y;if(g.type==="document")y=["Document",h,"DocumentExit"];else if(g.type==="root")y=["Root",h,"RootExit"];else y=m(g);return{eventIndex:0,events:y,iterator:0,node:g,visitorIndex:0,visitors:[]}}function C(g){if(g[e]=!1,g.nodes)g.nodes.forEach((y)=>C(y));return g}let b={};class v{constructor(g,y,S){this.stringified=!1,this.processed=!1;let x;if(typeof y==="object"&&y!==null&&(y.type==="root"||y.type==="document"))x=C(y);else if(y instanceof v||y instanceof l){if(x=C(y.root),y.map){if(typeof S.map>"u")S.map={};if(!S.map.inline)S.map.inline=!1;S.map.prev=y.map}}else{let N=c;if(S.syntax)N=S.syntax.parse;if(S.parser)N=S.parser;if(N.parse)N=N.parse;try{x=N(y,S)}catch(A){this.processed=!0,this.error=A}if(x&&!x[t])a.rebuild(x)}this.result=new l(g,x,S),this.helpers={...b,postcss:b,result:this.result},this.plugins=this.processor.plugins.map((N)=>{if(typeof N==="object"&&N.prepare)return{...N,...N.prepare(this.result)};else return N})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(g,y){let S=this.result.lastPlugin;try{if(y)y.addToError(g);if(this.error=g,g.name==="CssSyntaxError"&&!g.plugin)g.plugin=S.postcssPlugin,g.setMessage();else if(S.postcssVersion){let{postcssPlugin:x,postcssVersion:N}=S,A=this.result.processor.version,M=N.split("."),k=A.split(".");if(M[0]!==k[0]||parseInt(M[1])>parseInt(k[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+A+", but "+x+" uses "+N+". Perhaps this is the source of the error below.")}}catch(x){if(console&&console.error)console.error(x)}return g}prepareVisitors(){this.listeners={};let g=(y,S,x)=>{if(!this.listeners[S])this.listeners[S]=[];this.listeners[S].push([y,x])};for(let y of this.plugins)if(typeof y==="object")for(let S in y){if(!n[S]&&/^[A-Z]/.test(S))throw Error(`Unknown event ${S} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!s[S]){if(typeof y[S]==="object")for(let x in y[S])if(x==="*")g(y,S,y[S][x]);else g(y,S+"-"+x.toLowerCase(),y[S][x]);else if(typeof y[S]==="function")g(y,S,y[S])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g0){let S=this.visitTick(y);if(f(S))try{await S}catch(x){let N=y[y.length-1].node;throw this.handleError(x,N)}}}if(this.listeners.OnceExit)for(let[y,S]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(g.type==="document"){let x=g.nodes.map((N)=>S(N,this.helpers));await Promise.all(x)}else await S(g,this.helpers)}catch(x){throw this.handleError(x)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g==="object"&&g.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map((S)=>g.Once(S,this.helpers));if(f(y[0]))return Promise.all(y);return y}return g.Once(this.result.root,this.helpers)}else if(typeof g==="function")return g(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,y=r;if(g.syntax)y=g.syntax.stringify;if(g.stringifier)y=g.stringifier;if(y.stringify)y=y.stringify;let x=new o(y,this.result.root,this.result.opts).generate();return this.result.css=x[0],this.result.map=x[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let g of this.plugins){let y=this.runOnRoot(g);if(f(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;while(!g[e])g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let y of g.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,y){if(!("from"in this.opts))p("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(g,y)}toString(){return this.css}visitSync(g,y){for(let[S,x]of g){this.result.lastPlugin=S;let N;try{N=x(y,this.helpers)}catch(A){throw this.handleError(A,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let y=g[g.length-1],{node:S,visitors:x}=y;if(S.type!=="root"&&S.type!=="document"&&!S.parent){g.pop();return}if(x.length>0&&y.visitorIndex{if(!x[e])this.walkSync(x)})}else{let x=this.listeners[S];if(x){if(this.visitSync(x,g.toProxy()))return}}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=(g)=>{b=g},Gt=v,v.default=v,i.registerLazyResult(v),u.registerLazyResult(v),Gt}var Ht,Ts;function Po(){if(Ts)return Ht;Ts=1;let e=Li(),t=ct(),o=Fi(),r=zr(),a=Br();class u{constructor(p,l,c){l=l.toString(),this.stringified=!1,this._processor=p,this._css=l,this._opts=c,this._map=void 0;let i,d=t;this.result=new a(this._processor,i,this._opts),this.result.css=l;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let s=new e(d,i,this._opts,l);if(s.isMap()){let[h,f]=s.generate();if(h)this.result.css=h;if(f)this.result.map=f}else s.clearAnnotation(),this.result.css=s.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,l){if(!("from"in this._opts))o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(p,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let p,l=r;try{p=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;else return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}}return Ht=u,u.default=u,Ht}var Yt,_s;function Lo(){if(_s)return Yt;_s=1;let e=Po(),t=$i(),o=Ur(),r=ze();class a{constructor(u=[]){this.version="8.4.38",this.plugins=this.normalize(u)}normalize(u){let p=[];for(let l of u){if(l.postcss===!0)l=l();else if(l.postcss)l=l.postcss;if(typeof l==="object"&&Array.isArray(l.plugins))p=p.concat(l.plugins);else if(typeof l==="object"&&l.postcssPlugin)p.push(l);else if(typeof l==="function")p.push(l);else if(typeof l==="object"&&(l.parse||l.stringify))throw Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw Error(l+" is not a PostCSS plugin")}return p}process(u,p={}){if(!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax)return new e(this,u,p);else return new t(this,u,p)}use(u){return this.plugins=this.plugins.concat(this.normalize([u])),this}}return Yt=a,a.default=a,r.registerProcessor(a),o.registerProcessor(a),Yt}var Jt,ks;function Fo(){if(ks)return Jt;ks=1;let e=ft(),t=Pi(),o=pt(),r=$r(),a=dt(),u=ze(),p=Wr();function l(c,i){if(Array.isArray(c))return c.map((s)=>l(s));let{inputs:d,...n}=c;if(d){i=[];for(let s of d){let h={...s,__proto__:a.prototype};if(h.map)h.map={...h.map,__proto__:t.prototype};i.push(h)}}if(n.nodes)n.nodes=c.nodes.map((s)=>l(s,i));if(n.source){let{inputId:s,...h}=n.source;if(n.source=h,s!=null)n.source.input=i[s]}if(n.type==="root")return new u(n);else if(n.type==="decl")return new e(n);else if(n.type==="rule")return new p(n);else if(n.type==="comment")return new o(n);else if(n.type==="atrule")return new r(n);else throw Error("Unknown node type: "+c.type)}return Jt=l,l.default=l,Jt}var Xt,Ps;function Uo(){if(Ps)return Xt;Ps=1;let e=Lr(),t=ft(),o=$i(),r=Re(),a=Lo(),u=ct(),p=Fo(),l=Ur(),c=Ui(),i=pt(),d=$r(),n=Br(),s=dt(),h=zr(),f=Bi(),m=Wr(),w=ze(),C=ht();function b(...v){if(v.length===1&&Array.isArray(v[0]))v=v[0];return new a(v)}return b.plugin=function(g,y){let S=!1;function x(...A){if(console&&console.warn&&!S){if(S=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn"))console.warn(g+`: 里面 postcss.plugin 被弃用. 迁移指南: -https://www.w3ctech.com/topic/2226`)}let M=y(...A);return M.postcssPlugin=g,M.postcssVersion=new a().version,M}let N;return Object.defineProperty(x,"postcss",{get(){if(!N)N=x();return N}}),x.process=function(A,M,k){return b([x(k)]).process(A,M)},x},b.stringify=u,b.parse=h,b.fromJSON=p,b.list=f,b.comment=(v)=>new i(v),b.atRule=(v)=>new d(v),b.decl=(v)=>new t(v),b.rule=(v)=>new m(v),b.root=(v)=>new w(v),b.document=(v)=>new l(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=r,b.Processor=a,b.Document=l,b.Comment=i,b.Warning=c,b.AtRule=d,b.Result=n,b.Input=s,b.Rule=m,b.Root=w,b.Node=C,o.registerPostcss(b),Jt=b,b.default=b,Jt}var Uo=Fo(),H=Ro(Uo);H.stringify;H.fromJSON;H.plugin;H.parse;H.list;H.document;H.comment;H.atRule;H.rule;H.decl;H.root;H.CssSyntaxError;H.Declaration;H.Container;H.Processor;H.Document;H.Comment;H.Warning;H.AtRule;H.Result;H.Input;H.Rule;H.Root;H.Node;var Bo=Object.defineProperty,$o=(e,t,o)=>(t in e)?Bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,fe=(e,t,o)=>$o(e,typeof t!=="symbol"?t+"":t,o);if(!/[1-9][0-9]{12}/.test(Date.now().toString()));function Wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var o=function r(){if(this instanceof r)return Reflect.construct(t,arguments,this.constructor);return t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),o}var Je={exports:{}},ks;function qo(){if(ks)return Je.exports;ks=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Je.exports=t(),Je.exports.createColors=t,Je.exports}var jo={},Vo=Object.freeze(Object.defineProperty({__proto__:null,default:jo},Symbol.toStringTag,{value:"Module"})),ge=zo(Vo),Xt,Ps;function zr(){if(Ps)return Xt;Ps=1;let e=qo(),t=ge;class o extends Error{constructor(r,a,u,p,l,c){super(r);if(this.name="CssSyntaxError",this.reason=r,l)this.file=l;if(p)this.source=p;if(c)this.plugin=c;if(typeof a<"u"&&typeof u<"u")if(typeof a==="number")this.line=a,this.column=u;else this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,o)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let a=this.source;if(r==null)r=e.isColorSupported;if(t){if(r)a=t(a)}let u=a.split(/\r?\n/),p=Math.max(this.line-3,0),l=Math.min(this.line+2,u.length),c=String(l).length,i,d;if(r){let{bold:n,gray:s,red:h}=e.createColors(!0);i=(f)=>n(h(f)),d=(f)=>s(f)}else i=d=(n)=>n;return u.slice(p,l).map((n,s)=>{let h=p+1+s,f=" "+(" "+h).slice(-c)+" | ";if(h===this.line){let m=d(f.replace(/\d/g," "))+n.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+d(f)+n+` +https://www.w3ctech.com/topic/2226`)}let M=y(...A);return M.postcssPlugin=g,M.postcssVersion=new a().version,M}let N;return Object.defineProperty(x,"postcss",{get(){if(!N)N=x();return N}}),x.process=function(A,M,k){return b([x(k)]).process(A,M)},x},b.stringify=u,b.parse=h,b.fromJSON=p,b.list=f,b.comment=(v)=>new i(v),b.atRule=(v)=>new d(v),b.decl=(v)=>new t(v),b.rule=(v)=>new m(v),b.root=(v)=>new w(v),b.document=(v)=>new l(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=r,b.Processor=a,b.Document=l,b.Comment=i,b.Warning=c,b.AtRule=d,b.Result=n,b.Input=s,b.Rule=m,b.Root=w,b.Node=C,o.registerPostcss(b),Xt=b,b.default=b,Xt}var Bo=Uo(),H=No(Bo);H.stringify;H.fromJSON;H.plugin;H.parse;H.list;H.document;H.comment;H.atRule;H.rule;H.decl;H.root;H.CssSyntaxError;H.Declaration;H.Container;H.Processor;H.Document;H.Comment;H.Warning;H.AtRule;H.Result;H.Input;H.Rule;H.Root;H.Node;var $o=Object.defineProperty,Wo=(e,t,o)=>(t in e)?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,fe=(e,t,o)=>Wo(e,typeof t!=="symbol"?t+"":t,o);if(!/[1-9][0-9]{12}/.test(Date.now().toString()));function zo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var o=function r(){if(this instanceof r)return Reflect.construct(t,arguments,this.constructor);return t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),o}var Xe={exports:{}},Ls;function jo(){if(Ls)return Xe.exports;Ls=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Xe.exports=t(),Xe.exports.createColors=t,Xe.exports}var Vo={},Go=Object.freeze(Object.defineProperty({__proto__:null,default:Vo},Symbol.toStringTag,{value:"Module"})),ge=qo(Go),Qt,Fs;function qr(){if(Fs)return Qt;Fs=1;let e=jo(),t=ge;class o extends Error{constructor(r,a,u,p,l,c){super(r);if(this.name="CssSyntaxError",this.reason=r,l)this.file=l;if(p)this.source=p;if(c)this.plugin=c;if(typeof a<"u"&&typeof u<"u")if(typeof a==="number")this.line=a,this.column=u;else this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,o)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let a=this.source;if(r==null)r=e.isColorSupported;if(t){if(r)a=t(a)}let u=a.split(/\r?\n/),p=Math.max(this.line-3,0),l=Math.min(this.line+2,u.length),c=String(l).length,i,d;if(r){let{bold:n,gray:s,red:h}=e.createColors(!0);i=(f)=>n(h(f)),d=(f)=>s(f)}else i=d=(n)=>n;return u.slice(p,l).map((n,s)=>{let h=p+1+s,f=" "+(" "+h).slice(-c)+" | ";if(h===this.line){let m=d(f.replace(/\d/g," "))+n.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+d(f)+n+` `+m+i("^")}return" "+d(f)+n}).join(` `)}toString(){let r=this.showSourceCode();if(r)r=` `+r+` -`;return this.name+": "+this.message+r}}return Xt=o,o.default=o,Xt}var Xe={},Ls;function qr(){if(Ls)return Xe;return Ls=1,Xe.isClean=Symbol("isClean"),Xe.my=Symbol("my"),Xe}var Qt,Fs;function Bi(){if(Fs)return Qt;Fs=1;let e={after:` +`;return this.name+": "+this.message+r}}return Qt=o,o.default=o,Qt}var Qe={},Us;function jr(){if(Us)return Qe;return Us=1,Qe.isClean=Symbol("isClean"),Qe.my=Symbol("my"),Qe}var Zt,Bs;function Wi(){if(Bs)return Zt;Bs=1;let e={after:` `,beforeClose:` `,beforeComment:` `,beforeDecl:` @@ -42,21 +42,21 @@ https://www.w3ctech.com/topic/2226`)}let M=y(...A);return M.postcssPlugin=g,M.po `))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u>"u")u=this.raw(a,null,"beforeDecl");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeDecl(r,a){let u;if(r.walkDecls((p)=>{if(typeof p.raws.before<"u"){if(u=p.raws.before,u.includes(` `))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u>"u")u=this.raw(a,null,"beforeRule");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeOpen(r){let a;return r.walk((u)=>{if(u.type!=="decl"){if(a=u.raws.between,typeof a<"u")return!1}}),a}rawBeforeRule(r){let a;if(r.walk((u)=>{if(u.nodes&&(u.parent!==r||r.first!==u)){if(typeof u.raws.before<"u"){if(a=u.raws.before,a.includes(` `))a=a.replace(/[^\n]+$/,"");return!1}}}),a)a=a.replace(/\S/g,"");return a}rawColon(r){let a;return r.walkDecls((u)=>{if(typeof u.raws.between<"u")return a=u.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length===0){if(a=u.raws.after,typeof a<"u")return!1}}),a}rawIndent(r){if(r.raws.indent)return r.raws.indent;let a;return r.walk((u)=>{let p=u.parent;if(p&&p!==r&&p.parent&&p.parent===r){if(typeof u.raws.before<"u"){let l=u.raws.before.split(` -`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}}),a}rawSemicolon(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length&&u.last.type==="decl"){if(a=u.raws.semicolon,typeof a<"u")return!1}}),a}rawValue(r,a){let u=r[a],p=r.raws[a];if(p&&p.value===u)return p.raw;return u}root(r){if(this.body(r),r.raws.after)this.builder(r.raws.after)}rule(r){if(this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon)this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,a){if(!this[r.type])throw Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,a)}}return Qt=o,o.default=o,Qt}var Zt,Us;function pt(){if(Us)return Zt;Us=1;let e=Bi();function t(o,r){new e(r).stringify(o)}return Zt=t,t.default=t,Zt}var Kt,Bs;function mt(){if(Bs)return Kt;Bs=1;let{isClean:e,my:t}=qr(),o=zr(),r=Bi(),a=pt();function u(l,c){let i=new l.constructor;for(let d in l){if(!Object.prototype.hasOwnProperty.call(l,d))continue;if(d==="proxyCache")continue;let n=l[d],s=typeof n;if(d==="parent"&&s==="object"){if(c)i[d]=c}else if(d==="source")i[d]=n;else if(Array.isArray(n))i[d]=n.map((h)=>u(h,i));else{if(s==="object"&&n!==null)n=u(n);i[d]=n}}return i}class p{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let i of l[c])if(typeof i.clone==="function")this.append(i.clone());else this.append(i)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){if(delete this.raws.before,delete this.raws.after,!l)delete this.raws.between}clone(l={}){let c=u(this);for(let i in l)c[i]=l[i];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:i,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:i.column,line:i.line},c)}return new o(l)}getProxyProcessor(){return{get(l,c){if(c==="proxyOf")return l;else if(c==="root")return()=>l.root().toProxy();else return l[c]},set(l,c,i){if(l[c]===i)return!0;if(l[c]=i,c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")l.markDirty();return!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;while(l=l.parent)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let i=this.source.start;if(l.index)i=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);if(d!==-1)i=this.positionInside(d,c)}return i}positionInside(l,c){let i=c||this.toString(),d=this.source.start.column,n=this.source.start.line;for(let s=0;s{if(typeof f==="object"&&f.toJSON)return f.toJSON(null,c);else return f});else if(typeof h==="object"&&h.toJSON)i[s]=h.toJSON(null,c);else if(s==="source"){let f=c.get(h.input);if(f==null)f=n,c.set(h.input,n),n++;i[s]={end:h.end,inputId:f,start:h.start}}else i[s]=h}if(d)i.inputs=[...c.keys()].map((s)=>s.toJSON());return i}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(l=a){if(l.stringify)l=l.stringify;let c="";return l(this,(i)=>{c+=i}),c}warn(l,c,i){let d={node:this};for(let n in i)d[n]=i[n];return l.warn(c,d)}get proxyOf(){return this}}return Kt=p,p.default=p,Kt}var er,$s;function gt(){if($s)return er;$s=1;let e=mt();class t extends e{constructor(o){if(o&&typeof o.value<"u"&&typeof o.value!=="string")o={...o,value:String(o.value)};super(o);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return er=t,t.default=t,er}var tr,Ws;function Go(){if(Ws)return tr;Ws=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return tr={nanoid:(r=21)=>{let a="",u=r;while(u--)a+=e[Math.random()*64|0];return a},customAlphabet:(r,a=21)=>(u=a)=>{let p="",l=u;while(l--)p+=r[Math.random()*r.length|0];return p}},tr}var rr,zs;function $i(){if(zs)return rr;zs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{existsSync:o,readFileSync:r}=ge,{dirname:a,join:u}=ge;function p(c){if(Buffer)return Buffer.from(c,"base64").toString();else return window.atob(c)}class l{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=i.map?i.map.prev:void 0,n=this.loadMap(i.from,d);if(!this.mapFile&&i.from)this.mapFile=i.from;if(this.mapFile)this.root=a(this.mapFile);if(n)this.text=n}consumer(){if(!this.consumerCache)this.consumerCache=new e(this.text);return this.consumerCache}decodeInline(c){let i=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(n.test(c)||s.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||d.test(c))return p(c.substr(RegExp.lastMatch.length));let h=c.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+h)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){if(typeof c!=="object")return!1;return typeof c.mappings==="string"||typeof c._mappings==="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let d=c.lastIndexOf(i.pop()),n=c.indexOf("*/",d);if(d>-1&&n>-1)this.annotation=this.getAnnotationURL(c.substring(d,n))}loadFile(c){if(this.root=a(c),o(c))return this.mapFile=c,r(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i)if(typeof i==="string")return i;else if(typeof i==="function"){let d=i(c);if(d){let n=this.loadFile(d);if(!n)throw Error("Unable to load previous source map: "+d.toString());return n}}else if(i instanceof e)return t.fromSourceMap(i).toString();else if(i instanceof t)return i.toString();else if(this.isMap(i))return JSON.stringify(i);else throw Error("Unsupported previous source map format: "+i.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let d=this.annotation;if(c)d=u(a(c),d);return this.loadFile(d)}}startWith(c,i){if(!c)return!1;return c.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return rr=l,l.default=l,rr}var sr,qs;function yt(){if(qs)return sr;qs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{fileURLToPath:o,pathToFileURL:r}=ge,{isAbsolute:a,resolve:u}=ge,{nanoid:p}=Go(),l=ge,c=zr(),i=$i(),d=Symbol("fromOffsetCache"),n=Boolean(e&&t),s=Boolean(u&&a);class h{constructor(f,m={}){if(f===null||typeof f>"u"||typeof f==="object"&&!f.toString)throw Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(m.from)if(!s||/^\w+:\/\//.test(m.from)||a(m.from))this.file=m.from;else this.file=u(m.from);if(s&&n){let w=new i(this.css,m);if(w.text){this.map=w;let C=w.consumer().file;if(!this.file&&C)this.file=this.mapResolve(C)}}if(!this.file)this.id="";if(this.map)this.map.file=this.from}error(f,m,w,C={}){let b,v,g;if(m&&typeof m==="object"){let S=m,x=w;if(typeof S.offset==="number"){let N=this.fromOffset(S.offset);m=N.line,w=N.col}else m=S.line,w=S.column;if(typeof x.offset==="number"){let N=this.fromOffset(x.offset);v=N.line,g=N.col}else v=x.line,g=x.column}else if(!w){let S=this.fromOffset(m);m=S.line,w=S.col}let y=this.origin(m,w,v,g);if(y)b=new c(f,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,C.plugin);else b=new c(f,v===void 0?m:{column:w,line:m},v===void 0?w:{column:g,line:v},this.css,this.file,C.plugin);if(b.input={column:w,endColumn:g,endLine:v,line:m,source:this.css},this.file){if(r)b.input.url=r(this.file).toString();b.input.file=this.file}return b}fromOffset(f){let m,w;if(!this[d]){let b=this.css.split(` -`);w=Array(b.length);let v=0;for(let g=0,y=b.length;g=m)C=w.length-1;else{let b=w.length-2,v;while(C>1),f=w[v+1])C=v+1;else{C=v;break}}return{col:f-w[C]+1,line:C+1}}mapResolve(f){if(/^\w+:\/\//.test(f))return f;return u(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,m,w,C){if(!this.map)return!1;let b=this.map.consumer(),v=b.originalPositionFor({column:m,line:f});if(!v.source)return!1;let g;if(typeof w==="number")g=b.originalPositionFor({column:C,line:w});let y;if(a(v.source))y=r(v.source);else y=new URL(v.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let S={column:v.column,endColumn:g&&g.column,endLine:g&&g.line,line:v.line,url:y.toString()};if(y.protocol==="file:")if(o)S.file=o(y);else throw Error("file: protocol is not available in this PostCSS build");let x=b.sourceContentFor(v.source);if(x)S.source=x;return S}toJSON(){let f={};for(let m of["hasBOM","css","file","id"])if(this[m]!=null)f[m]=this[m];if(this.map){if(f.map={...this.map},f.map.consumerCache)f.map.consumerCache=void 0}return f}get from(){return this.file||this.id}}if(sr=h,h.default=h,l&&l.registerInput)l.registerInput(h);return sr}var ir,js;function Wi(){if(js)return ir;js=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{dirname:o,relative:r,resolve:a,sep:u}=ge,{pathToFileURL:p}=ge,l=yt(),c=Boolean(e&&t),i=Boolean(o&&a&&r&&u);class d{constructor(n,s,h,f){this.stringify=n,this.mapOpts=h.map||{},this.root=s,this.opts=h,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;if(this.isInline())n="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")n=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")n=this.mapOpts.annotation(this.opts.to,this.root);else n=this.outputFile()+".map";let s=` +`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}}),a}rawSemicolon(r){let a;return r.walk((u)=>{if(u.nodes&&u.nodes.length&&u.last.type==="decl"){if(a=u.raws.semicolon,typeof a<"u")return!1}}),a}rawValue(r,a){let u=r[a],p=r.raws[a];if(p&&p.value===u)return p.raw;return u}root(r){if(this.body(r),r.raws.after)this.builder(r.raws.after)}rule(r){if(this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon)this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,a){if(!this[r.type])throw Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,a)}}return Zt=o,o.default=o,Zt}var Kt,$s;function mt(){if($s)return Kt;$s=1;let e=Wi();function t(o,r){new e(r).stringify(o)}return Kt=t,t.default=t,Kt}var er,Ws;function gt(){if(Ws)return er;Ws=1;let{isClean:e,my:t}=jr(),o=qr(),r=Wi(),a=mt();function u(l,c){let i=new l.constructor;for(let d in l){if(!Object.prototype.hasOwnProperty.call(l,d))continue;if(d==="proxyCache")continue;let n=l[d],s=typeof n;if(d==="parent"&&s==="object"){if(c)i[d]=c}else if(d==="source")i[d]=n;else if(Array.isArray(n))i[d]=n.map((h)=>u(h,i));else{if(s==="object"&&n!==null)n=u(n);i[d]=n}}return i}class p{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let i of l[c])if(typeof i.clone==="function")this.append(i.clone());else this.append(i)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){if(delete this.raws.before,delete this.raws.after,!l)delete this.raws.between}clone(l={}){let c=u(this);for(let i in l)c[i]=l[i];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:i,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:i.column,line:i.line},c)}return new o(l)}getProxyProcessor(){return{get(l,c){if(c==="proxyOf")return l;else if(c==="root")return()=>l.root().toProxy();else return l[c]},set(l,c,i){if(l[c]===i)return!0;if(l[c]=i,c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")l.markDirty();return!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;while(l=l.parent)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let i=this.source.start;if(l.index)i=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);if(d!==-1)i=this.positionInside(d,c)}return i}positionInside(l,c){let i=c||this.toString(),d=this.source.start.column,n=this.source.start.line;for(let s=0;s{if(typeof f==="object"&&f.toJSON)return f.toJSON(null,c);else return f});else if(typeof h==="object"&&h.toJSON)i[s]=h.toJSON(null,c);else if(s==="source"){let f=c.get(h.input);if(f==null)f=n,c.set(h.input,n),n++;i[s]={end:h.end,inputId:f,start:h.start}}else i[s]=h}if(d)i.inputs=[...c.keys()].map((s)=>s.toJSON());return i}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(l=a){if(l.stringify)l=l.stringify;let c="";return l(this,(i)=>{c+=i}),c}warn(l,c,i){let d={node:this};for(let n in i)d[n]=i[n];return l.warn(c,d)}get proxyOf(){return this}}return er=p,p.default=p,er}var tr,zs;function yt(){if(zs)return tr;zs=1;let e=gt();class t extends e{constructor(o){if(o&&typeof o.value<"u"&&typeof o.value!=="string")o={...o,value:String(o.value)};super(o);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return tr=t,t.default=t,tr}var rr,qs;function Ho(){if(qs)return rr;qs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return rr={nanoid:(r=21)=>{let a="",u=r;while(u--)a+=e[Math.random()*64|0];return a},customAlphabet:(r,a=21)=>(u=a)=>{let p="",l=u;while(l--)p+=r[Math.random()*r.length|0];return p}},rr}var sr,js;function zi(){if(js)return sr;js=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{existsSync:o,readFileSync:r}=ge,{dirname:a,join:u}=ge;function p(c){if(Buffer)return Buffer.from(c,"base64").toString();else return window.atob(c)}class l{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=i.map?i.map.prev:void 0,n=this.loadMap(i.from,d);if(!this.mapFile&&i.from)this.mapFile=i.from;if(this.mapFile)this.root=a(this.mapFile);if(n)this.text=n}consumer(){if(!this.consumerCache)this.consumerCache=new e(this.text);return this.consumerCache}decodeInline(c){let i=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(n.test(c)||s.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||d.test(c))return p(c.substr(RegExp.lastMatch.length));let h=c.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+h)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){if(typeof c!=="object")return!1;return typeof c.mappings==="string"||typeof c._mappings==="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let d=c.lastIndexOf(i.pop()),n=c.indexOf("*/",d);if(d>-1&&n>-1)this.annotation=this.getAnnotationURL(c.substring(d,n))}loadFile(c){if(this.root=a(c),o(c))return this.mapFile=c,r(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i)if(typeof i==="string")return i;else if(typeof i==="function"){let d=i(c);if(d){let n=this.loadFile(d);if(!n)throw Error("Unable to load previous source map: "+d.toString());return n}}else if(i instanceof e)return t.fromSourceMap(i).toString();else if(i instanceof t)return i.toString();else if(this.isMap(i))return JSON.stringify(i);else throw Error("Unsupported previous source map format: "+i.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let d=this.annotation;if(c)d=u(a(c),d);return this.loadFile(d)}}startWith(c,i){if(!c)return!1;return c.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return sr=l,l.default=l,sr}var ir,Vs;function wt(){if(Vs)return ir;Vs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{fileURLToPath:o,pathToFileURL:r}=ge,{isAbsolute:a,resolve:u}=ge,{nanoid:p}=Ho(),l=ge,c=qr(),i=zi(),d=Symbol("fromOffsetCache"),n=Boolean(e&&t),s=Boolean(u&&a);class h{constructor(f,m={}){if(f===null||typeof f>"u"||typeof f==="object"&&!f.toString)throw Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(m.from)if(!s||/^\w+:\/\//.test(m.from)||a(m.from))this.file=m.from;else this.file=u(m.from);if(s&&n){let w=new i(this.css,m);if(w.text){this.map=w;let C=w.consumer().file;if(!this.file&&C)this.file=this.mapResolve(C)}}if(!this.file)this.id="";if(this.map)this.map.file=this.from}error(f,m,w,C={}){let b,v,g;if(m&&typeof m==="object"){let S=m,x=w;if(typeof S.offset==="number"){let N=this.fromOffset(S.offset);m=N.line,w=N.col}else m=S.line,w=S.column;if(typeof x.offset==="number"){let N=this.fromOffset(x.offset);v=N.line,g=N.col}else v=x.line,g=x.column}else if(!w){let S=this.fromOffset(m);m=S.line,w=S.col}let y=this.origin(m,w,v,g);if(y)b=new c(f,y.endLine===void 0?y.line:{column:y.column,line:y.line},y.endLine===void 0?y.column:{column:y.endColumn,line:y.endLine},y.source,y.file,C.plugin);else b=new c(f,v===void 0?m:{column:w,line:m},v===void 0?w:{column:g,line:v},this.css,this.file,C.plugin);if(b.input={column:w,endColumn:g,endLine:v,line:m,source:this.css},this.file){if(r)b.input.url=r(this.file).toString();b.input.file=this.file}return b}fromOffset(f){let m,w;if(!this[d]){let b=this.css.split(` +`);w=Array(b.length);let v=0;for(let g=0,y=b.length;g=m)C=w.length-1;else{let b=w.length-2,v;while(C>1),f=w[v+1])C=v+1;else{C=v;break}}return{col:f-w[C]+1,line:C+1}}mapResolve(f){if(/^\w+:\/\//.test(f))return f;return u(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,m,w,C){if(!this.map)return!1;let b=this.map.consumer(),v=b.originalPositionFor({column:m,line:f});if(!v.source)return!1;let g;if(typeof w==="number")g=b.originalPositionFor({column:C,line:w});let y;if(a(v.source))y=r(v.source);else y=new URL(v.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let S={column:v.column,endColumn:g&&g.column,endLine:g&&g.line,line:v.line,url:y.toString()};if(y.protocol==="file:")if(o)S.file=o(y);else throw Error("file: protocol is not available in this PostCSS build");let x=b.sourceContentFor(v.source);if(x)S.source=x;return S}toJSON(){let f={};for(let m of["hasBOM","css","file","id"])if(this[m]!=null)f[m]=this[m];if(this.map){if(f.map={...this.map},f.map.consumerCache)f.map.consumerCache=void 0}return f}get from(){return this.file||this.id}}if(ir=h,h.default=h,l&&l.registerInput)l.registerInput(h);return ir}var nr,Gs;function qi(){if(Gs)return nr;Gs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{dirname:o,relative:r,resolve:a,sep:u}=ge,{pathToFileURL:p}=ge,l=wt(),c=Boolean(e&&t),i=Boolean(o&&a&&r&&u);class d{constructor(n,s,h,f){this.stringify=n,this.mapOpts=h.map||{},this.root=s,this.opts=h,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let n;if(this.isInline())n="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")n=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")n=this.mapOpts.annotation(this.opts.to,this.root);else n=this.outputFile()+".map";let s=` `;if(this.css.includes(`\r `))s=`\r `;this.css+=s+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let s=this.toUrl(this.path(n.file)),h=n.root||o(n.file),f;if(this.mapOpts.sourcesContent===!1){if(f=new e(n.text),f.sourcesContent)f.sourcesContent=null}else f=n.consumer();this.map.applySourceMap(f,s,this.toUrl(this.path(h)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let n;for(let s=this.root.nodes.length-1;s>=0;s--){if(n=this.root.nodes[s],n.type!=="comment")continue;if(n.text.indexOf("# sourceMappingURL=")===0)this.root.removeChild(s)}}else if(this.css)this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,"")}generate(){if(this.clearAnnotation(),i&&c&&this.isMap())return this.generateMap();else{let n="";return this.stringify(this.root,(s)=>{n+=s}),[n]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let n=this.previous()[0].consumer();n.file=this.outputFile(),this.map=t.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,s=1,h="",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},m,w;this.stringify(this.root,(C,b,v)=>{if(this.css+=C,b&&v!=="end")if(f.generated.line=n,f.generated.column=s-1,b.source&&b.source.start)f.source=this.sourcePath(b),f.original.line=b.source.start.line,f.original.column=b.source.start.column-1,this.map.addMapping(f);else f.source=h,f.original.line=1,f.original.column=0,this.map.addMapping(f);if(m=C.match(/\n/g),m)n+=m.length,w=C.lastIndexOf(` -`),s=C.length-w;else s+=C.length;if(b&&v!=="start"){let g=b.parent||{raws:{}};if(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==g.last||g.raws.semicolon)if(b.source&&b.source.end)f.source=this.sourcePath(b),f.original.line=b.source.end.line,f.original.column=b.source.end.column-1,f.generated.line=n,f.generated.column=s-2,this.map.addMapping(f);else f.source=h,f.original.line=1,f.original.column=0,f.generated.line=n,f.generated.column=s-1,this.map.addMapping(f)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation<"u")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((n)=>n.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let n=this.mapOpts.annotation;if(typeof n<"u"&&n!==!0)return!1;if(this.previous().length)return this.previous().some((s)=>s.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((n)=>n.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(n){if(this.mapOpts.absolute)return n;if(n.charCodeAt(0)===60)return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let h=this.opts.to?o(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")h=o(a(h,this.mapOpts.annotation));let f=r(h,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((n)=>{if(n.source&&n.source.input.map){let s=n.source.input.map;if(!this.previousMaps.includes(s))this.previousMaps.push(s)}});else{let n=new l(this.originalCSS,this.opts);if(n.map)this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk((s)=>{if(s.source){let h=s.source.input.from;if(h&&!n[h]){n[h]=!0;let f=this.usesFileUrls?this.toFileUrl(h):this.toUrl(this.path(h));this.map.setSourceContent(f,s.source.input.css)}}});else if(this.css){let s=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(s,this.css)}}sourcePath(n){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(n.source.input.from);else return this.toUrl(this.path(n.source.input.from))}toBase64(n){if(Buffer)return Buffer.from(n).toString("base64");else return window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let s=this.memoizedFileURLs.get(n);if(s)return s;if(p){let h=p(n).toString();return this.memoizedFileURLs.set(n,h),h}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let s=this.memoizedURLs.get(n);if(s)return s;if(u==="\\")n=n.replace(/\\/g,"/");let h=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,h),h}}return ir=d,ir}var nr,Vs;function wt(){if(Vs)return nr;Vs=1;let e=mt();class t extends e{constructor(o){super(o);this.type="comment"}}return nr=t,t.default=t,nr}var or,Gs;function Ne(){if(Gs)return or;Gs=1;let{isClean:e,my:t}=qr(),o=gt(),r=wt(),a=mt(),u,p,l,c;function i(s){return s.map((h)=>{if(h.nodes)h.nodes=i(h.nodes);return delete h.source,h})}function d(s){if(s[e]=!1,s.proxyOf.nodes)for(let h of s.proxyOf.nodes)d(h)}class n extends a{append(...s){for(let h of s){let f=this.normalize(h,this.last);for(let m of f)this.proxyOf.nodes.push(m)}return this.markDirty(),this}cleanRaws(s){if(super.cleanRaws(s),this.nodes)for(let h of this.nodes)h.cleanRaws(s)}each(s){if(!this.proxyOf.nodes)return;let h=this.getIterator(),f,m;while(this.indexes[h]s[h](...f.map((m)=>{if(typeof m==="function")return(w,C)=>m(w.toProxy(),C);else return m}));else if(h==="every"||h==="some")return(f)=>s[h]((m,...w)=>f(m.toProxy(),...w));else if(h==="root")return()=>s.root().toProxy();else if(h==="nodes")return s.nodes.map((f)=>f.toProxy());else if(h==="first"||h==="last")return s[h].toProxy();else return s[h]},set(s,h,f){if(s[h]===f)return!0;if(s[h]=f,h==="name"||h==="params"||h==="selector")s.markDirty();return!0}}}index(s){if(typeof s==="number")return s;if(s.proxyOf)s=s.proxyOf;return this.proxyOf.nodes.indexOf(s)}insertAfter(s,h){let f=this.index(s),m=this.normalize(h,this.proxyOf.nodes[f]).reverse();f=this.index(s);for(let C of m)this.proxyOf.nodes.splice(f+1,0,C);let w;for(let C in this.indexes)if(w=this.indexes[C],f"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw Error("Value field is missed in node creation");else if(typeof s.value!=="string")s.value=String(s.value);s=[new o(s)]}else if(s.selector)s=[new p(s)];else if(s.name)s=[new l(s)];else if(s.text)s=[new r(s)];else throw Error("Unknown node type in node creation");return s.map((m)=>{if(!m[t])n.rebuild(m);if(m=m.proxyOf,m.parent)m.parent.removeChild(m);if(m[e])d(m);if(typeof m.raws.before>"u"){if(h&&typeof h.raws.before<"u")m.raws.before=h.raws.before.replace(/\S/g,"")}return m.parent=this.proxyOf,m})}prepend(...s){s=s.reverse();for(let h of s){let f=this.normalize(h,this.first,"prepend").reverse();for(let m of f)this.proxyOf.nodes.unshift(m);for(let m in this.indexes)this.indexes[m]=this.indexes[m]+f.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let h;for(let f in this.indexes)if(h=this.indexes[f],h>=s)this.indexes[f]=h-1;return this.markDirty(),this}replaceValues(s,h,f){if(!f)f=h,h={};return this.walkDecls((m)=>{if(h.props&&!h.props.includes(m.prop))return;if(h.fast&&!m.value.includes(h.fast))return;m.value=m.value.replace(s,f)}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){return this.each((h,f)=>{let m;try{m=s(h,f)}catch(w){throw h.addToError(w)}if(m!==!1&&h.walk)m=h.walk(s);return m})}walkAtRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="atrule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="atrule"&&s.test(f.name))return h(f,m)});return this.walk((f,m)=>{if(f.type==="atrule"&&f.name===s)return h(f,m)})}walkComments(s){return this.walk((h,f)=>{if(h.type==="comment")return s(h,f)})}walkDecls(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="decl")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="decl"&&s.test(f.prop))return h(f,m)});return this.walk((f,m)=>{if(f.type==="decl"&&f.prop===s)return h(f,m)})}walkRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="rule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="rule"&&s.test(f.selector))return h(f,m)});return this.walk((f,m)=>{if(f.type==="rule"&&f.selector===s)return h(f,m)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return n.registerParse=(s)=>{u=s},n.registerRule=(s)=>{p=s},n.registerAtRule=(s)=>{l=s},n.registerRoot=(s)=>{c=s},or=n,n.default=n,n.rebuild=(s)=>{if(s.type==="atrule")Object.setPrototypeOf(s,l.prototype);else if(s.type==="rule")Object.setPrototypeOf(s,p.prototype);else if(s.type==="decl")Object.setPrototypeOf(s,o.prototype);else if(s.type==="comment")Object.setPrototypeOf(s,r.prototype);else if(s.type==="root")Object.setPrototypeOf(s,c.prototype);if(s[t]=!0,s.nodes)s.nodes.forEach((h)=>{n.rebuild(h)})},or}var ar,Hs;function jr(){if(Hs)return ar;Hs=1;let e=Ne(),t,o;class r extends e{constructor(a){super({type:"document",...a});if(!this.nodes)this.nodes=[]}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},ar=r,r.default=r,ar}var lr,Ys;function zi(){if(Ys)return lr;Ys=1;let e={};return lr=function(o){if(e[o])return;if(e[o]=!0,typeof console<"u"&&console.warn)console.warn(o)},lr}var ur,Js;function qi(){if(Js)return ur;Js=1;class e{constructor(t,o={}){if(this.type="warning",this.text=t,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}return ur=e,e.default=e,ur}var cr,Xs;function Vr(){if(Xs)return cr;Xs=1;let e=qi();class t{constructor(o,r,a){this.processor=o,this.messages=[],this.root=r,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){if(!r.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)r.plugin=this.lastPlugin.postcssPlugin}let a=new e(o,r);return this.messages.push(a),a}warnings(){return this.messages.filter((o)=>o.type==="warning")}get content(){return this.css}}return cr=t,t.default=t,cr}var hr,Qs;function Ho(){if(Qs)return hr;Qs=1;let e=39,t=34,o=92,r=47,a=10,u=32,p=12,l=9,c=13,i=91,d=93,n=40,s=41,h=123,f=125,m=59,w=42,C=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return hr=function(N,A={}){let M=N.css.valueOf(),k=A.ignoreErrors,D,E,Z,re,q,W,I,P,F,T,J=M.length,R=0,ne=[],se=[];function Ee(){return R}function te(_){throw N.error("Unclosed "+_,R)}function de(){return se.length===0&&R>=J}function xe(_){if(se.length)return se.pop();if(R>=J)return;let K=_?_.ignoreUnclosed:!1;switch(D=M.charCodeAt(R),D){case a:case u:case l:case c:case p:{E=R;do E+=1,D=M.charCodeAt(E);while(D===u||D===a||D===l||D===c||D===p);T=["space",M.slice(R,E)],R=E-1;break}case i:case d:case h:case f:case C:case m:case s:{let j=String.fromCharCode(D);T=[j,j,R];break}case n:{if(P=ne.length?ne.pop()[1]:"",F=M.charCodeAt(R+1),P==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==l&&F!==p&&F!==c){E=R;do{if(W=!1,E=M.indexOf(")",E+1),E===-1)if(k||K){E=R;break}else te("bracket");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["brackets",M.slice(R,E+1),R,E],R=E}else if(E=M.indexOf(")",R+1),re=M.slice(R,E+1),E===-1||y.test(re))T=["(","(",R];else T=["brackets",re,R,E],R=E;break}case e:case t:{Z=D===e?"'":'"',E=R;do{if(W=!1,E=M.indexOf(Z,E+1),E===-1)if(k||K){E=R+1;break}else te("string");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["string",M.slice(R,E+1),R,E],R=E;break}case b:{if(v.lastIndex=R+1,v.test(M),v.lastIndex===0)E=M.length-1;else E=v.lastIndex-2;T=["at-word",M.slice(R,E+1),R,E],R=E;break}case o:{E=R,q=!0;while(M.charCodeAt(E+1)===o)E+=1,q=!q;if(D=M.charCodeAt(E+1),q&&D!==r&&D!==u&&D!==a&&D!==l&&D!==c&&D!==p){if(E+=1,S.test(M.charAt(E))){while(S.test(M.charAt(E+1)))E+=1;if(M.charCodeAt(E+1)===u)E+=1}}T=["word",M.slice(R,E+1),R,E],R=E;break}default:{if(D===r&&M.charCodeAt(R+1)===w){if(E=M.indexOf("*/",R+2)+1,E===0)if(k||K)E=M.length;else te("comment");T=["comment",M.slice(R,E+1),R,E],R=E}else{if(g.lastIndex=R+1,g.test(M),g.lastIndex===0)E=M.length-1;else E=g.lastIndex-2;T=["word",M.slice(R,E+1),R,E],ne.push(T),R=E}break}}return R++,T}function ve(_){se.push(_)}return{back:ve,endOfFile:de,nextToken:xe,position:Ee}},hr}var fr,Zs;function Gr(){if(Zs)return fr;Zs=1;let e=Ne();class t extends e{constructor(o){super(o);this.type="atrule"}append(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...o)}prepend(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...o)}}return fr=t,t.default=t,e.registerAtRule(t),fr}var dr,Ks;function qe(){if(Ks)return dr;Ks=1;let e=Ne(),t,o;class r extends e{constructor(a){super(a);if(this.type="root",!this.nodes)this.nodes=[]}normalize(a,u,p){let l=super.normalize(a);if(u){if(p==="prepend")if(this.nodes.length>1)u.raws.before=this.nodes[1].raws.before;else delete u.raws.before;else if(this.first!==u)for(let c of l)c.raws.before=u.raws.before}return l}removeChild(a,u){let p=this.index(a);if(!u&&p===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[p].raws.before;return super.removeChild(a)}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},dr=r,r.default=r,e.registerRoot(r),dr}var pr,ei;function ji(){if(ei)return pr;ei=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let o=[" ",` -`,"\t"];return e.split(t,o)},split(t,o,r){let a=[],u="",p=!1,l=0,c=!1,i="",d=!1;for(let n of t){if(d)d=!1;else if(n==="\\")d=!0;else if(c){if(n===i)c=!1}else if(n==='"'||n==="'")c=!0,i=n;else if(n==="(")l+=1;else if(n===")"){if(l>0)l-=1}else if(l===0){if(o.includes(n))p=!0}if(p){if(u!=="")a.push(u.trim());u="",p=!1}else u+=n}if(r||u!=="")a.push(u.trim());return a}};return pr=e,e.default=e,pr}var mr,ti;function Hr(){if(ti)return mr;ti=1;let e=Ne(),t=ji();class o extends e{constructor(r){super(r);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return t.comma(this.selector)}set selectors(r){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=r.join(u)}}return mr=o,o.default=o,e.registerRule(o),mr}var gr,ri;function Yo(){if(ri)return gr;ri=1;let e=gt(),t=Ho(),o=wt(),r=Gr(),a=qe(),u=Hr(),p={empty:!0,space:!0};function l(i){for(let d=i.length-1;d>=0;d--){let n=i[d],s=n[3]||n[2];if(s)return s}}class c{constructor(i){this.input=i,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let d=new r;if(d.name=i[1].slice(1),d.name==="")this.unnamedAtrule(d,i);this.init(d,i[2]);let n,s,h,f=!1,m=!1,w=[],C=[];while(!this.tokenizer.endOfFile()){if(i=this.tokenizer.nextToken(),n=i[0],n==="("||n==="[")C.push(n==="("?")":"]");else if(n==="{"&&C.length>0)C.push("}");else if(n===C[C.length-1])C.pop();if(C.length===0)if(n===";"){d.source.end=this.getPosition(i[2]),d.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){m=!0;break}else if(n==="}"){if(w.length>0){h=w.length-1,s=w[h];while(s&&s[0]==="space")s=w[--h];if(s)d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++}this.end(i);break}else w.push(i);else w.push(i);if(this.tokenizer.endOfFile()){f=!0;break}}if(d.raws.between=this.spacesAndCommentsFromEnd(w),w.length){if(d.raws.afterName=this.spacesAndCommentsFromStart(w),this.raw(d,"params",w),f)i=w[w.length-1],d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between=""}else d.raws.afterName="",d.params="";if(m)d.nodes=[],this.current=d}checkMissedSemicolon(i){let d=this.colon(i);if(d===!1)return;let n=0,s;for(let h=d-1;h>=0;h--)if(s=i[h],s[0]!=="space"){if(n+=1,n===2)break}throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(i){let d=0,n,s,h;for(let[f,m]of i.entries()){if(n=m,s=n[0],s==="(")d+=1;if(s===")")d-=1;if(d===0&&s===":")if(!h)this.doubleColon(n);else if(h[0]==="word"&&h[1]==="progid")continue;else return f;h=n}return!1}comment(i){let d=new o;this.init(d,i[2]),d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++;let n=i[1].slice(2,-2);if(/^\s*$/.test(n))d.text="",d.raws.left=n,d.raws.right="";else{let s=n.match(/^(\s*)([^]*\S)(\s*)$/);d.text=s[2],d.raws.left=s[1],d.raws.right=s[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,d){let n=new e;this.init(n,i[0][2]);let s=i[i.length-1];if(s[0]===";")this.semicolon=!0,i.pop();n.source.end=this.getPosition(s[3]||s[2]||l(i)),n.source.end.offset++;while(i[0][0]!=="word"){if(i.length===1)this.unknownWord(i);n.raws.before+=i.shift()[1]}n.source.start=this.getPosition(i[0][2]),n.prop="";while(i.length){let C=i[0][0];if(C===":"||C==="space"||C==="comment")break;n.prop+=i.shift()[1]}n.raws.between="";let h;while(i.length)if(h=i.shift(),h[0]===":"){n.raws.between+=h[1];break}else{if(h[0]==="word"&&/\w/.test(h[1]))this.unknownWord([h]);n.raws.between+=h[1]}if(n.prop[0]==="_"||n.prop[0]==="*")n.raws.before+=n.prop[0],n.prop=n.prop.slice(1);let f=[],m;while(i.length){if(m=i[0][0],m!=="space"&&m!=="comment")break;f.push(i.shift())}this.precheckMissedSemicolon(i);for(let C=i.length-1;C>=0;C--){if(h=i[C],h[1].toLowerCase()==="!important"){n.important=!0;let b=this.stringFrom(i,C);if(b=this.spacesFromEnd(i)+b,b!==" !important")n.raws.important=b;break}else if(h[1].toLowerCase()==="important"){let b=i.slice(0),v="";for(let g=C;g>0;g--){let y=b[g][0];if(v.trim().indexOf("!")===0&&y!=="space")break;v=b.pop()[1]+v}if(v.trim().indexOf("!")===0)n.important=!0,n.raws.important=v,i=b}if(h[0]!=="space"&&h[0]!=="comment")break}if(i.some((C)=>C[0]!=="space"&&C[0]!=="comment"))n.raws.between+=f.map((C)=>C[1]).join(""),f=[];if(this.raw(n,"value",f.concat(i),d),n.value.includes(":")&&!d)this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let d=new u;this.init(d,i[2]),d.selector="",d.raws.between="",this.current=d}end(i){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(i)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];if(d&&d.type==="rule"&&!d.raws.ownSemicolon)d.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(i){let d=this.input.fromOffset(i);return{column:d.col,line:d.line,offset:i}}init(i,d){if(this.current.push(i),i.source={input:this.input,start:this.getPosition(d)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment")this.semicolon=!1}other(i){let d=!1,n=null,s=!1,h=null,f=[],m=i[1].startsWith("--"),w=[],C=i;while(C){if(n=C[0],w.push(C),n==="("||n==="["){if(!h)h=C;f.push(n==="("?")":"]")}else if(m&&s&&n==="{"){if(!h)h=C;f.push("}")}else if(f.length===0){if(n===";")if(s){this.decl(w,m);return}else break;else if(n==="{"){this.rule(w);return}else if(n==="}"){this.tokenizer.back(w.pop()),d=!0;break}else if(n===":")s=!0}else if(n===f[f.length-1]){if(f.pop(),f.length===0)h=null}C=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())d=!0;if(f.length>0)this.unclosedBracket(h);if(d&&s){if(!m)while(w.length){if(C=w[w.length-1][0],C!=="space"&&C!=="comment")break;this.tokenizer.back(w.pop())}this.decl(w,m)}else this.unknownWord(w)}parse(){let i;while(!this.tokenizer.endOfFile())switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,d,n,s){let h,f,m=n.length,w="",C=!0,b,v;for(let g=0;gy+S[1],"");i.raws[d]={raw:g,value:w}}i[d]=w}rule(i){i.pop();let d=new u;this.init(d,i[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(d,"selector",i),this.current=d}spacesAndCommentsFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space"&&d!=="comment")break;n=i.pop()[1]+n}return n}spacesAndCommentsFromStart(i){let d,n="";while(i.length){if(d=i[0][0],d!=="space"&&d!=="comment")break;n+=i.shift()[1]}return n}spacesFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space")break;n=i.pop()[1]+n}return n}stringFrom(i,d){let n="";for(let s=d;sn.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let n=this.mapOpts.annotation;if(typeof n<"u"&&n!==!0)return!1;if(this.previous().length)return this.previous().some((s)=>s.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((n)=>n.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(n){if(this.mapOpts.absolute)return n;if(n.charCodeAt(0)===60)return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let h=this.opts.to?o(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")h=o(a(h,this.mapOpts.annotation));let f=r(h,n);return this.memoizedPaths.set(n,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((n)=>{if(n.source&&n.source.input.map){let s=n.source.input.map;if(!this.previousMaps.includes(s))this.previousMaps.push(s)}});else{let n=new l(this.originalCSS,this.opts);if(n.map)this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk((s)=>{if(s.source){let h=s.source.input.from;if(h&&!n[h]){n[h]=!0;let f=this.usesFileUrls?this.toFileUrl(h):this.toUrl(this.path(h));this.map.setSourceContent(f,s.source.input.css)}}});else if(this.css){let s=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(s,this.css)}}sourcePath(n){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(n.source.input.from);else return this.toUrl(this.path(n.source.input.from))}toBase64(n){if(Buffer)return Buffer.from(n).toString("base64");else return window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let s=this.memoizedFileURLs.get(n);if(s)return s;if(p){let h=p(n).toString();return this.memoizedFileURLs.set(n,h),h}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let s=this.memoizedURLs.get(n);if(s)return s;if(u==="\\")n=n.replace(/\\/g,"/");let h=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,h),h}}return nr=d,nr}var or,Hs;function bt(){if(Hs)return or;Hs=1;let e=gt();class t extends e{constructor(o){super(o);this.type="comment"}}return or=t,t.default=t,or}var ar,Ys;function Ne(){if(Ys)return ar;Ys=1;let{isClean:e,my:t}=jr(),o=yt(),r=bt(),a=gt(),u,p,l,c;function i(s){return s.map((h)=>{if(h.nodes)h.nodes=i(h.nodes);return delete h.source,h})}function d(s){if(s[e]=!1,s.proxyOf.nodes)for(let h of s.proxyOf.nodes)d(h)}class n extends a{append(...s){for(let h of s){let f=this.normalize(h,this.last);for(let m of f)this.proxyOf.nodes.push(m)}return this.markDirty(),this}cleanRaws(s){if(super.cleanRaws(s),this.nodes)for(let h of this.nodes)h.cleanRaws(s)}each(s){if(!this.proxyOf.nodes)return;let h=this.getIterator(),f,m;while(this.indexes[h]s[h](...f.map((m)=>{if(typeof m==="function")return(w,C)=>m(w.toProxy(),C);else return m}));else if(h==="every"||h==="some")return(f)=>s[h]((m,...w)=>f(m.toProxy(),...w));else if(h==="root")return()=>s.root().toProxy();else if(h==="nodes")return s.nodes.map((f)=>f.toProxy());else if(h==="first"||h==="last")return s[h].toProxy();else return s[h]},set(s,h,f){if(s[h]===f)return!0;if(s[h]=f,h==="name"||h==="params"||h==="selector")s.markDirty();return!0}}}index(s){if(typeof s==="number")return s;if(s.proxyOf)s=s.proxyOf;return this.proxyOf.nodes.indexOf(s)}insertAfter(s,h){let f=this.index(s),m=this.normalize(h,this.proxyOf.nodes[f]).reverse();f=this.index(s);for(let C of m)this.proxyOf.nodes.splice(f+1,0,C);let w;for(let C in this.indexes)if(w=this.indexes[C],f"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let m of s)if(m.parent)m.parent.removeChild(m,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw Error("Value field is missed in node creation");else if(typeof s.value!=="string")s.value=String(s.value);s=[new o(s)]}else if(s.selector)s=[new p(s)];else if(s.name)s=[new l(s)];else if(s.text)s=[new r(s)];else throw Error("Unknown node type in node creation");return s.map((m)=>{if(!m[t])n.rebuild(m);if(m=m.proxyOf,m.parent)m.parent.removeChild(m);if(m[e])d(m);if(typeof m.raws.before>"u"){if(h&&typeof h.raws.before<"u")m.raws.before=h.raws.before.replace(/\S/g,"")}return m.parent=this.proxyOf,m})}prepend(...s){s=s.reverse();for(let h of s){let f=this.normalize(h,this.first,"prepend").reverse();for(let m of f)this.proxyOf.nodes.unshift(m);for(let m in this.indexes)this.indexes[m]=this.indexes[m]+f.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let h;for(let f in this.indexes)if(h=this.indexes[f],h>=s)this.indexes[f]=h-1;return this.markDirty(),this}replaceValues(s,h,f){if(!f)f=h,h={};return this.walkDecls((m)=>{if(h.props&&!h.props.includes(m.prop))return;if(h.fast&&!m.value.includes(h.fast))return;m.value=m.value.replace(s,f)}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){return this.each((h,f)=>{let m;try{m=s(h,f)}catch(w){throw h.addToError(w)}if(m!==!1&&h.walk)m=h.walk(s);return m})}walkAtRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="atrule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="atrule"&&s.test(f.name))return h(f,m)});return this.walk((f,m)=>{if(f.type==="atrule"&&f.name===s)return h(f,m)})}walkComments(s){return this.walk((h,f)=>{if(h.type==="comment")return s(h,f)})}walkDecls(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="decl")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="decl"&&s.test(f.prop))return h(f,m)});return this.walk((f,m)=>{if(f.type==="decl"&&f.prop===s)return h(f,m)})}walkRules(s,h){if(!h)return h=s,this.walk((f,m)=>{if(f.type==="rule")return h(f,m)});if(s instanceof RegExp)return this.walk((f,m)=>{if(f.type==="rule"&&s.test(f.selector))return h(f,m)});return this.walk((f,m)=>{if(f.type==="rule"&&f.selector===s)return h(f,m)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return n.registerParse=(s)=>{u=s},n.registerRule=(s)=>{p=s},n.registerAtRule=(s)=>{l=s},n.registerRoot=(s)=>{c=s},ar=n,n.default=n,n.rebuild=(s)=>{if(s.type==="atrule")Object.setPrototypeOf(s,l.prototype);else if(s.type==="rule")Object.setPrototypeOf(s,p.prototype);else if(s.type==="decl")Object.setPrototypeOf(s,o.prototype);else if(s.type==="comment")Object.setPrototypeOf(s,r.prototype);else if(s.type==="root")Object.setPrototypeOf(s,c.prototype);if(s[t]=!0,s.nodes)s.nodes.forEach((h)=>{n.rebuild(h)})},ar}var lr,Js;function Vr(){if(Js)return lr;Js=1;let e=Ne(),t,o;class r extends e{constructor(a){super({type:"document",...a});if(!this.nodes)this.nodes=[]}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},lr=r,r.default=r,lr}var ur,Xs;function ji(){if(Xs)return ur;Xs=1;let e={};return ur=function(o){if(e[o])return;if(e[o]=!0,typeof console<"u"&&console.warn)console.warn(o)},ur}var cr,Qs;function Vi(){if(Qs)return cr;Qs=1;class e{constructor(t,o={}){if(this.type="warning",this.text=t,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}return cr=e,e.default=e,cr}var hr,Zs;function Gr(){if(Zs)return hr;Zs=1;let e=Vi();class t{constructor(o,r,a){this.processor=o,this.messages=[],this.root=r,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){if(!r.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)r.plugin=this.lastPlugin.postcssPlugin}let a=new e(o,r);return this.messages.push(a),a}warnings(){return this.messages.filter((o)=>o.type==="warning")}get content(){return this.css}}return hr=t,t.default=t,hr}var fr,Ks;function Yo(){if(Ks)return fr;Ks=1;let e=39,t=34,o=92,r=47,a=10,u=32,p=12,l=9,c=13,i=91,d=93,n=40,s=41,h=123,f=125,m=59,w=42,C=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,y=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return fr=function(N,A={}){let M=N.css.valueOf(),k=A.ignoreErrors,D,E,Z,re,q,W,I,P,F,T,J=M.length,R=0,ne=[],se=[];function Ee(){return R}function te(_){throw N.error("Unclosed "+_,R)}function de(){return se.length===0&&R>=J}function xe(_){if(se.length)return se.pop();if(R>=J)return;let K=_?_.ignoreUnclosed:!1;switch(D=M.charCodeAt(R),D){case a:case u:case l:case c:case p:{E=R;do E+=1,D=M.charCodeAt(E);while(D===u||D===a||D===l||D===c||D===p);T=["space",M.slice(R,E)],R=E-1;break}case i:case d:case h:case f:case C:case m:case s:{let j=String.fromCharCode(D);T=[j,j,R];break}case n:{if(P=ne.length?ne.pop()[1]:"",F=M.charCodeAt(R+1),P==="url"&&F!==e&&F!==t&&F!==u&&F!==a&&F!==l&&F!==p&&F!==c){E=R;do{if(W=!1,E=M.indexOf(")",E+1),E===-1)if(k||K){E=R;break}else te("bracket");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["brackets",M.slice(R,E+1),R,E],R=E}else if(E=M.indexOf(")",R+1),re=M.slice(R,E+1),E===-1||y.test(re))T=["(","(",R];else T=["brackets",re,R,E],R=E;break}case e:case t:{Z=D===e?"'":'"',E=R;do{if(W=!1,E=M.indexOf(Z,E+1),E===-1)if(k||K){E=R+1;break}else te("string");I=E;while(M.charCodeAt(I-1)===o)I-=1,W=!W}while(W);T=["string",M.slice(R,E+1),R,E],R=E;break}case b:{if(v.lastIndex=R+1,v.test(M),v.lastIndex===0)E=M.length-1;else E=v.lastIndex-2;T=["at-word",M.slice(R,E+1),R,E],R=E;break}case o:{E=R,q=!0;while(M.charCodeAt(E+1)===o)E+=1,q=!q;if(D=M.charCodeAt(E+1),q&&D!==r&&D!==u&&D!==a&&D!==l&&D!==c&&D!==p){if(E+=1,S.test(M.charAt(E))){while(S.test(M.charAt(E+1)))E+=1;if(M.charCodeAt(E+1)===u)E+=1}}T=["word",M.slice(R,E+1),R,E],R=E;break}default:{if(D===r&&M.charCodeAt(R+1)===w){if(E=M.indexOf("*/",R+2)+1,E===0)if(k||K)E=M.length;else te("comment");T=["comment",M.slice(R,E+1),R,E],R=E}else{if(g.lastIndex=R+1,g.test(M),g.lastIndex===0)E=M.length-1;else E=g.lastIndex-2;T=["word",M.slice(R,E+1),R,E],ne.push(T),R=E}break}}return R++,T}function ve(_){se.push(_)}return{back:ve,endOfFile:de,nextToken:xe,position:Ee}},fr}var dr,ei;function Hr(){if(ei)return dr;ei=1;let e=Ne();class t extends e{constructor(o){super(o);this.type="atrule"}append(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...o)}prepend(...o){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...o)}}return dr=t,t.default=t,e.registerAtRule(t),dr}var pr,ti;function qe(){if(ti)return pr;ti=1;let e=Ne(),t,o;class r extends e{constructor(a){super(a);if(this.type="root",!this.nodes)this.nodes=[]}normalize(a,u,p){let l=super.normalize(a);if(u){if(p==="prepend")if(this.nodes.length>1)u.raws.before=this.nodes[1].raws.before;else delete u.raws.before;else if(this.first!==u)for(let c of l)c.raws.before=u.raws.before}return l}removeChild(a,u){let p=this.index(a);if(!u&&p===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[p].raws.before;return super.removeChild(a)}toResult(a={}){return new t(new o,this,a).stringify()}}return r.registerLazyResult=(a)=>{t=a},r.registerProcessor=(a)=>{o=a},pr=r,r.default=r,e.registerRoot(r),pr}var mr,ri;function Gi(){if(ri)return mr;ri=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let o=[" ",` +`,"\t"];return e.split(t,o)},split(t,o,r){let a=[],u="",p=!1,l=0,c=!1,i="",d=!1;for(let n of t){if(d)d=!1;else if(n==="\\")d=!0;else if(c){if(n===i)c=!1}else if(n==='"'||n==="'")c=!0,i=n;else if(n==="(")l+=1;else if(n===")"){if(l>0)l-=1}else if(l===0){if(o.includes(n))p=!0}if(p){if(u!=="")a.push(u.trim());u="",p=!1}else u+=n}if(r||u!=="")a.push(u.trim());return a}};return mr=e,e.default=e,mr}var gr,si;function Yr(){if(si)return gr;si=1;let e=Ne(),t=Gi();class o extends e{constructor(r){super(r);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return t.comma(this.selector)}set selectors(r){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=r.join(u)}}return gr=o,o.default=o,e.registerRule(o),gr}var yr,ii;function Jo(){if(ii)return yr;ii=1;let e=yt(),t=Yo(),o=bt(),r=Hr(),a=qe(),u=Yr(),p={empty:!0,space:!0};function l(i){for(let d=i.length-1;d>=0;d--){let n=i[d],s=n[3]||n[2];if(s)return s}}class c{constructor(i){this.input=i,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let d=new r;if(d.name=i[1].slice(1),d.name==="")this.unnamedAtrule(d,i);this.init(d,i[2]);let n,s,h,f=!1,m=!1,w=[],C=[];while(!this.tokenizer.endOfFile()){if(i=this.tokenizer.nextToken(),n=i[0],n==="("||n==="[")C.push(n==="("?")":"]");else if(n==="{"&&C.length>0)C.push("}");else if(n===C[C.length-1])C.pop();if(C.length===0)if(n===";"){d.source.end=this.getPosition(i[2]),d.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){m=!0;break}else if(n==="}"){if(w.length>0){h=w.length-1,s=w[h];while(s&&s[0]==="space")s=w[--h];if(s)d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++}this.end(i);break}else w.push(i);else w.push(i);if(this.tokenizer.endOfFile()){f=!0;break}}if(d.raws.between=this.spacesAndCommentsFromEnd(w),w.length){if(d.raws.afterName=this.spacesAndCommentsFromStart(w),this.raw(d,"params",w),f)i=w[w.length-1],d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between=""}else d.raws.afterName="",d.params="";if(m)d.nodes=[],this.current=d}checkMissedSemicolon(i){let d=this.colon(i);if(d===!1)return;let n=0,s;for(let h=d-1;h>=0;h--)if(s=i[h],s[0]!=="space"){if(n+=1,n===2)break}throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(i){let d=0,n,s,h;for(let[f,m]of i.entries()){if(n=m,s=n[0],s==="(")d+=1;if(s===")")d-=1;if(d===0&&s===":")if(!h)this.doubleColon(n);else if(h[0]==="word"&&h[1]==="progid")continue;else return f;h=n}return!1}comment(i){let d=new o;this.init(d,i[2]),d.source.end=this.getPosition(i[3]||i[2]),d.source.end.offset++;let n=i[1].slice(2,-2);if(/^\s*$/.test(n))d.text="",d.raws.left=n,d.raws.right="";else{let s=n.match(/^(\s*)([^]*\S)(\s*)$/);d.text=s[2],d.raws.left=s[1],d.raws.right=s[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,d){let n=new e;this.init(n,i[0][2]);let s=i[i.length-1];if(s[0]===";")this.semicolon=!0,i.pop();n.source.end=this.getPosition(s[3]||s[2]||l(i)),n.source.end.offset++;while(i[0][0]!=="word"){if(i.length===1)this.unknownWord(i);n.raws.before+=i.shift()[1]}n.source.start=this.getPosition(i[0][2]),n.prop="";while(i.length){let C=i[0][0];if(C===":"||C==="space"||C==="comment")break;n.prop+=i.shift()[1]}n.raws.between="";let h;while(i.length)if(h=i.shift(),h[0]===":"){n.raws.between+=h[1];break}else{if(h[0]==="word"&&/\w/.test(h[1]))this.unknownWord([h]);n.raws.between+=h[1]}if(n.prop[0]==="_"||n.prop[0]==="*")n.raws.before+=n.prop[0],n.prop=n.prop.slice(1);let f=[],m;while(i.length){if(m=i[0][0],m!=="space"&&m!=="comment")break;f.push(i.shift())}this.precheckMissedSemicolon(i);for(let C=i.length-1;C>=0;C--){if(h=i[C],h[1].toLowerCase()==="!important"){n.important=!0;let b=this.stringFrom(i,C);if(b=this.spacesFromEnd(i)+b,b!==" !important")n.raws.important=b;break}else if(h[1].toLowerCase()==="important"){let b=i.slice(0),v="";for(let g=C;g>0;g--){let y=b[g][0];if(v.trim().indexOf("!")===0&&y!=="space")break;v=b.pop()[1]+v}if(v.trim().indexOf("!")===0)n.important=!0,n.raws.important=v,i=b}if(h[0]!=="space"&&h[0]!=="comment")break}if(i.some((C)=>C[0]!=="space"&&C[0]!=="comment"))n.raws.between+=f.map((C)=>C[1]).join(""),f=[];if(this.raw(n,"value",f.concat(i),d),n.value.includes(":")&&!d)this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let d=new u;this.init(d,i[2]),d.selector="",d.raws.between="",this.current=d}end(i){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(i[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(i)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(i){if(this.spaces+=i[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];if(d&&d.type==="rule"&&!d.raws.ownSemicolon)d.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(i){let d=this.input.fromOffset(i);return{column:d.col,line:d.line,offset:i}}init(i,d){if(this.current.push(i),i.source={input:this.input,start:this.getPosition(d)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment")this.semicolon=!1}other(i){let d=!1,n=null,s=!1,h=null,f=[],m=i[1].startsWith("--"),w=[],C=i;while(C){if(n=C[0],w.push(C),n==="("||n==="["){if(!h)h=C;f.push(n==="("?")":"]")}else if(m&&s&&n==="{"){if(!h)h=C;f.push("}")}else if(f.length===0){if(n===";")if(s){this.decl(w,m);return}else break;else if(n==="{"){this.rule(w);return}else if(n==="}"){this.tokenizer.back(w.pop()),d=!0;break}else if(n===":")s=!0}else if(n===f[f.length-1]){if(f.pop(),f.length===0)h=null}C=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())d=!0;if(f.length>0)this.unclosedBracket(h);if(d&&s){if(!m)while(w.length){if(C=w[w.length-1][0],C!=="space"&&C!=="comment")break;this.tokenizer.back(w.pop())}this.decl(w,m)}else this.unknownWord(w)}parse(){let i;while(!this.tokenizer.endOfFile())switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,d,n,s){let h,f,m=n.length,w="",C=!0,b,v;for(let g=0;gy+S[1],"");i.raws[d]={raw:g,value:w}}i[d]=w}rule(i){i.pop();let d=new u;this.init(d,i[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(d,"selector",i),this.current=d}spacesAndCommentsFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space"&&d!=="comment")break;n=i.pop()[1]+n}return n}spacesAndCommentsFromStart(i){let d,n="";while(i.length){if(d=i[0][0],d!=="space"&&d!=="comment")break;n+=i.shift()[1]}return n}spacesFromEnd(i){let d,n="";while(i.length){if(d=i[i.length-1][0],d!=="space")break;n=i.pop()[1]+n}return n}stringFrom(i,d){let n="";for(let s=d;sC(y));return g}let b={};class v{constructor(g,y,S){this.stringified=!1,this.processed=!1;let x;if(typeof y==="object"&&y!==null&&(y.type==="root"||y.type==="document"))x=C(y);else if(y instanceof v||y instanceof l){if(x=C(y.root),y.map){if(typeof S.map>"u")S.map={};if(!S.map.inline)S.map.inline=!1;S.map.prev=y.map}}else{let N=c;if(S.syntax)N=S.syntax.parse;if(S.parser)N=S.parser;if(N.parse)N=N.parse;try{x=N(y,S)}catch(A){this.processed=!0,this.error=A}if(x&&!x[t])a.rebuild(x)}this.result=new l(g,x,S),this.helpers={...b,postcss:b,result:this.result},this.plugins=this.processor.plugins.map((N)=>{if(typeof N==="object"&&N.prepare)return{...N,...N.prepare(this.result)};else return N})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(g,y){let S=this.result.lastPlugin;try{if(y)y.addToError(g);if(this.error=g,g.name==="CssSyntaxError"&&!g.plugin)g.plugin=S.postcssPlugin,g.setMessage();else if(S.postcssVersion){let{postcssPlugin:x,postcssVersion:N}=S,A=this.result.processor.version,M=N.split("."),k=A.split(".");if(M[0]!==k[0]||parseInt(M[1])>parseInt(k[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+A+", but "+x+" uses "+N+". Perhaps this is the source of the error below.")}}catch(x){if(console&&console.error)console.error(x)}return g}prepareVisitors(){this.listeners={};let g=(y,S,x)=>{if(!this.listeners[S])this.listeners[S]=[];this.listeners[S].push([y,x])};for(let y of this.plugins)if(typeof y==="object")for(let S in y){if(!n[S]&&/^[A-Z]/.test(S))throw Error(`Unknown event ${S} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!s[S]){if(typeof y[S]==="object")for(let x in y[S])if(x==="*")g(y,S,y[S][x]);else g(y,S+"-"+x.toLowerCase(),y[S][x]);else if(typeof y[S]==="function")g(y,S,y[S])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g0){let S=this.visitTick(y);if(f(S))try{await S}catch(x){let N=y[y.length-1].node;throw this.handleError(x,N)}}}if(this.listeners.OnceExit)for(let[y,S]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(g.type==="document"){let x=g.nodes.map((N)=>S(N,this.helpers));await Promise.all(x)}else await S(g,this.helpers)}catch(x){throw this.handleError(x)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g==="object"&&g.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map((S)=>g.Once(S,this.helpers));if(f(y[0]))return Promise.all(y);return y}return g.Once(this.result.root,this.helpers)}else if(typeof g==="function")return g(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,y=r;if(g.syntax)y=g.syntax.stringify;if(g.stringifier)y=g.stringifier;if(y.stringify)y=y.stringify;let x=new o(y,this.result.root,this.result.opts).generate();return this.result.css=x[0],this.result.map=x[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let g of this.plugins){let y=this.runOnRoot(g);if(f(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;while(!g[e])g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let y of g.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,y){if(!("from"in this.opts))p("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(g,y)}toString(){return this.css}visitSync(g,y){for(let[S,x]of g){this.result.lastPlugin=S;let N;try{N=x(y,this.helpers)}catch(A){throw this.handleError(A,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let y=g[g.length-1],{node:S,visitors:x}=y;if(S.type!=="root"&&S.type!=="document"&&!S.parent){g.pop();return}if(x.length>0&&y.visitorIndex{if(!x[e])this.walkSync(x)})}else{let x=this.listeners[S];if(x){if(this.visitSync(x,g.toProxy()))return}}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=(g)=>{b=g},wr=v,v.default=v,i.registerLazyResult(v),u.registerLazyResult(v),wr}var br,ni;function Jo(){if(ni)return br;ni=1;let e=Wi(),t=pt(),o=zi(),r=Yr(),a=Vr();class u{constructor(p,l,c){l=l.toString(),this.stringified=!1,this._processor=p,this._css=l,this._opts=c,this._map=void 0;let i,d=t;this.result=new a(this._processor,i,this._opts),this.result.css=l;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let s=new e(d,i,this._opts,l);if(s.isMap()){let[h,f]=s.generate();if(h)this.result.css=h;if(f)this.result.map=f}else s.clearAnnotation(),this.result.css=s.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,l){if(!("from"in this._opts))o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(p,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let p,l=r;try{p=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;else return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}}return br=u,u.default=u,br}var vr,oi;function Xo(){if(oi)return vr;oi=1;let e=Jo(),t=Vi(),o=jr(),r=qe();class a{constructor(u=[]){this.version="8.4.38",this.plugins=this.normalize(u)}normalize(u){let p=[];for(let l of u){if(l.postcss===!0)l=l();else if(l.postcss)l=l.postcss;if(typeof l==="object"&&Array.isArray(l.plugins))p=p.concat(l.plugins);else if(typeof l==="object"&&l.postcssPlugin)p.push(l);else if(typeof l==="function")p.push(l);else if(typeof l==="object"&&(l.parse||l.stringify))throw Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw Error(l+" is not a PostCSS plugin")}return p}process(u,p={}){if(!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax)return new e(this,u,p);else return new t(this,u,p)}use(u){return this.plugins=this.plugins.concat(this.normalize([u])),this}}return vr=a,a.default=a,r.registerProcessor(a),o.registerProcessor(a),vr}var Sr,ai;function Qo(){if(ai)return Sr;ai=1;let e=gt(),t=$i(),o=wt(),r=Gr(),a=yt(),u=qe(),p=Hr();function l(c,i){if(Array.isArray(c))return c.map((s)=>l(s));let{inputs:d,...n}=c;if(d){i=[];for(let s of d){let h={...s,__proto__:a.prototype};if(h.map)h.map={...h.map,__proto__:t.prototype};i.push(h)}}if(n.nodes)n.nodes=c.nodes.map((s)=>l(s,i));if(n.source){let{inputId:s,...h}=n.source;if(n.source=h,s!=null)n.source.input=i[s]}if(n.type==="root")return new u(n);else if(n.type==="decl")return new e(n);else if(n.type==="rule")return new p(n);else if(n.type==="comment")return new o(n);else if(n.type==="atrule")return new r(n);else throw Error("Unknown node type: "+c.type)}return Sr=l,l.default=l,Sr}var Cr,li;function Zo(){if(li)return Cr;li=1;let e=zr(),t=gt(),o=Vi(),r=Ne(),a=Xo(),u=pt(),p=Qo(),l=jr(),c=qi(),i=wt(),d=Gr(),n=Vr(),s=yt(),h=Yr(),f=ji(),m=Hr(),w=qe(),C=mt();function b(...v){if(v.length===1&&Array.isArray(v[0]))v=v[0];return new a(v)}return b.plugin=function(g,y){let S=!1;function x(...A){if(console&&console.warn&&!S){if(S=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide: +You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw c}return l.root}return wr=r,r.default=r,e.registerParse(r),wr}var br,oi;function Hi(){if(oi)return br;oi=1;let{isClean:e,my:t}=jr(),o=qi(),r=mt(),a=Ne(),u=Vr(),p=ji(),l=Gr(),c=Jr(),i=qe(),d={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},n={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},s={Once:!0,postcssPlugin:!0,prepare:!0},h=0;function f(g){return typeof g==="object"&&typeof g.then==="function"}function m(g){let y=!1,S=d[g.type];if(g.type==="decl")y=g.prop.toLowerCase();else if(g.type==="atrule")y=g.name.toLowerCase();if(y&&g.append)return[S,S+"-"+y,h,S+"Exit",S+"Exit-"+y];else if(y)return[S,S+"-"+y,S+"Exit",S+"Exit-"+y];else if(g.append)return[S,h,S+"Exit"];else return[S,S+"Exit"]}function w(g){let y;if(g.type==="document")y=["Document",h,"DocumentExit"];else if(g.type==="root")y=["Root",h,"RootExit"];else y=m(g);return{eventIndex:0,events:y,iterator:0,node:g,visitorIndex:0,visitors:[]}}function C(g){if(g[e]=!1,g.nodes)g.nodes.forEach((y)=>C(y));return g}let b={};class v{constructor(g,y,S){this.stringified=!1,this.processed=!1;let x;if(typeof y==="object"&&y!==null&&(y.type==="root"||y.type==="document"))x=C(y);else if(y instanceof v||y instanceof l){if(x=C(y.root),y.map){if(typeof S.map>"u")S.map={};if(!S.map.inline)S.map.inline=!1;S.map.prev=y.map}}else{let N=c;if(S.syntax)N=S.syntax.parse;if(S.parser)N=S.parser;if(N.parse)N=N.parse;try{x=N(y,S)}catch(A){this.processed=!0,this.error=A}if(x&&!x[t])a.rebuild(x)}this.result=new l(g,x,S),this.helpers={...b,postcss:b,result:this.result},this.plugins=this.processor.plugins.map((N)=>{if(typeof N==="object"&&N.prepare)return{...N,...N.prepare(this.result)};else return N})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(g,y){let S=this.result.lastPlugin;try{if(y)y.addToError(g);if(this.error=g,g.name==="CssSyntaxError"&&!g.plugin)g.plugin=S.postcssPlugin,g.setMessage();else if(S.postcssVersion){let{postcssPlugin:x,postcssVersion:N}=S,A=this.result.processor.version,M=N.split("."),k=A.split(".");if(M[0]!==k[0]||parseInt(M[1])>parseInt(k[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+A+", but "+x+" uses "+N+". Perhaps this is the source of the error below.")}}catch(x){if(console&&console.error)console.error(x)}return g}prepareVisitors(){this.listeners={};let g=(y,S,x)=>{if(!this.listeners[S])this.listeners[S]=[];this.listeners[S].push([y,x])};for(let y of this.plugins)if(typeof y==="object")for(let S in y){if(!n[S]&&/^[A-Z]/.test(S))throw Error(`Unknown event ${S} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!s[S]){if(typeof y[S]==="object")for(let x in y[S])if(x==="*")g(y,S,y[S][x]);else g(y,S+"-"+x.toLowerCase(),y[S][x]);else if(typeof y[S]==="function")g(y,S,y[S])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g0){let S=this.visitTick(y);if(f(S))try{await S}catch(x){let N=y[y.length-1].node;throw this.handleError(x,N)}}}if(this.listeners.OnceExit)for(let[y,S]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(g.type==="document"){let x=g.nodes.map((N)=>S(N,this.helpers));await Promise.all(x)}else await S(g,this.helpers)}catch(x){throw this.handleError(x)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g==="object"&&g.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map((S)=>g.Once(S,this.helpers));if(f(y[0]))return Promise.all(y);return y}return g.Once(this.result.root,this.helpers)}else if(typeof g==="function")return g(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,y=r;if(g.syntax)y=g.syntax.stringify;if(g.stringifier)y=g.stringifier;if(y.stringify)y=y.stringify;let x=new o(y,this.result.root,this.result.opts).generate();return this.result.css=x[0],this.result.map=x[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let g of this.plugins){let y=this.runOnRoot(g);if(f(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;while(!g[e])g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let y of g.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,y){if(!("from"in this.opts))p("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(g,y)}toString(){return this.css}visitSync(g,y){for(let[S,x]of g){this.result.lastPlugin=S;let N;try{N=x(y,this.helpers)}catch(A){throw this.handleError(A,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let y=g[g.length-1],{node:S,visitors:x}=y;if(S.type!=="root"&&S.type!=="document"&&!S.parent){g.pop();return}if(x.length>0&&y.visitorIndex{if(!x[e])this.walkSync(x)})}else{let x=this.listeners[S];if(x){if(this.visitSync(x,g.toProxy()))return}}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=(g)=>{b=g},br=v,v.default=v,i.registerLazyResult(v),u.registerLazyResult(v),br}var vr,ai;function Xo(){if(ai)return vr;ai=1;let e=qi(),t=mt(),o=ji(),r=Jr(),a=Gr();class u{constructor(p,l,c){l=l.toString(),this.stringified=!1,this._processor=p,this._css=l,this._opts=c,this._map=void 0;let i,d=t;this.result=new a(this._processor,i,this._opts),this.result.css=l;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let s=new e(d,i,this._opts,l);if(s.isMap()){let[h,f]=s.generate();if(h)this.result.css=h;if(f)this.result.map=f}else s.clearAnnotation(),this.result.css=s.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().then(p,p)}sync(){if(this.error)throw this.error;return this.result}then(p,l){if(!("from"in this._opts))o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(p,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let p,l=r;try{p=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;else return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}}return vr=u,u.default=u,vr}var Sr,li;function Qo(){if(li)return Sr;li=1;let e=Xo(),t=Hi(),o=Vr(),r=qe();class a{constructor(u=[]){this.version="8.4.38",this.plugins=this.normalize(u)}normalize(u){let p=[];for(let l of u){if(l.postcss===!0)l=l();else if(l.postcss)l=l.postcss;if(typeof l==="object"&&Array.isArray(l.plugins))p=p.concat(l.plugins);else if(typeof l==="object"&&l.postcssPlugin)p.push(l);else if(typeof l==="function")p.push(l);else if(typeof l==="object"&&(l.parse||l.stringify))throw Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw Error(l+" is not a PostCSS plugin")}return p}process(u,p={}){if(!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax)return new e(this,u,p);else return new t(this,u,p)}use(u){return this.plugins=this.plugins.concat(this.normalize([u])),this}}return Sr=a,a.default=a,r.registerProcessor(a),o.registerProcessor(a),Sr}var Cr,ui;function Zo(){if(ui)return Cr;ui=1;let e=yt(),t=zi(),o=bt(),r=Hr(),a=wt(),u=qe(),p=Yr();function l(c,i){if(Array.isArray(c))return c.map((s)=>l(s));let{inputs:d,...n}=c;if(d){i=[];for(let s of d){let h={...s,__proto__:a.prototype};if(h.map)h.map={...h.map,__proto__:t.prototype};i.push(h)}}if(n.nodes)n.nodes=c.nodes.map((s)=>l(s,i));if(n.source){let{inputId:s,...h}=n.source;if(n.source=h,s!=null)n.source.input=i[s]}if(n.type==="root")return new u(n);else if(n.type==="decl")return new e(n);else if(n.type==="rule")return new p(n);else if(n.type==="comment")return new o(n);else if(n.type==="atrule")return new r(n);else throw Error("Unknown node type: "+c.type)}return Cr=l,l.default=l,Cr}var Er,ci;function Ko(){if(ci)return Er;ci=1;let e=qr(),t=yt(),o=Hi(),r=Ne(),a=Qo(),u=mt(),p=Zo(),l=Vr(),c=Vi(),i=bt(),d=Hr(),n=Gr(),s=wt(),h=Jr(),f=Gi(),m=Yr(),w=qe(),C=gt();function b(...v){if(v.length===1&&Array.isArray(v[0]))v=v[0];return new a(v)}return b.plugin=function(g,y){let S=!1;function x(...A){if(console&&console.warn&&!S){if(S=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn"))console.warn(g+`: 里面 postcss.plugin 被弃用. 迁移指南: -https://www.w3ctech.com/topic/2226`)}let M=y(...A);return M.postcssPlugin=g,M.postcssVersion=new a().version,M}let N;return Object.defineProperty(x,"postcss",{get(){if(!N)N=x();return N}}),x.process=function(A,M,k){return b([x(k)]).process(A,M)},x},b.stringify=u,b.parse=h,b.fromJSON=p,b.list=f,b.comment=(v)=>new i(v),b.atRule=(v)=>new d(v),b.decl=(v)=>new t(v),b.rule=(v)=>new m(v),b.root=(v)=>new w(v),b.document=(v)=>new l(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=r,b.Processor=a,b.Document=l,b.Comment=i,b.Warning=c,b.AtRule=d,b.Result=n,b.Input=s,b.Rule=m,b.Root=w,b.Node=C,o.registerPostcss(b),Cr=b,b.default=b,Cr}var Ko=Zo(),Y=Wo(Ko);Y.stringify;Y.fromJSON;Y.plugin;Y.parse;Y.list;Y.document;Y.comment;Y.atRule;Y.rule;Y.decl;Y.root;Y.CssSyntaxError;Y.Declaration;Y.Container;Y.Processor;Y.Document;Y.Comment;Y.Warning;Y.AtRule;Y.Result;Y.Input;Y.Rule;Y.Root;Y.Node;class Jr{constructor(...e){fe(this,"parentElement",null),fe(this,"parentNode",null),fe(this,"ownerDocument"),fe(this,"firstChild",null),fe(this,"lastChild",null),fe(this,"previousSibling",null),fe(this,"nextSibling",null),fe(this,"ELEMENT_NODE",1),fe(this,"TEXT_NODE",3),fe(this,"nodeType"),fe(this,"nodeName"),fe(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;while(t)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Jr))return!1;else if(e.ownerDocument!==this.ownerDocument)return!1;else if(e===this)return!0;while(e.parentNode){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var ui={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ci={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Qe={},Gi={},ea=()=>!!globalThis.Zone;function Xr(e){if(Qe[e])return Qe[e];let t=globalThis[e],o=t.prototype,r=e in ui?ui[e]:void 0,a=Boolean(r&&r.every((l)=>{var c,i;return Boolean((i=(c=Object.getOwnPropertyDescriptor(o,l))==null?void 0:c.get)==null?void 0:i.toString().includes("[native code]"))})),u=e in ci?ci[e]:void 0,p=Boolean(u&&u.every((l)=>{var c;return typeof o[l]==="function"&&((c=o[l])==null?void 0:c.toString().includes("[native code]"))}));if(a&&p&&!ea())return Qe[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let c=l.contentWindow;if(!c)return t.prototype;let i=c[e].prototype;if(!i)return l.remove(),o;let d=navigator.userAgent;if(d.includes("Safari")&&!d.includes("Chrome"))l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Gi[e]=()=>l.remove();else l.remove();return Qe[e]=i}catch{return o}}var Er={};function he(e,t,o){var r,a;let u=(r=Er[e])==null?void 0:r[o];if(u)return u.call(t);let p=Xr(e),l=(a=Object.getOwnPropertyDescriptor(p,o))==null?void 0:a.get;if(!l)return t[o];return(Er[e]||(Er[e]={}))[o]=l,l.call(t)}var xr={};function Hi(e,t,o){let r=`${e}.${String(o)}`;if(xr[r])return xr[r].bind(t);let u=Xr(e)[o];if(typeof u!=="function")return t[o];return xr[r]=u,u.bind(t)}function ta(e){return he("Node",e,"ownerDocument")}function ra(e){return he("Node",e,"childNodes")}function sa(e){return he("Node",e,"parentNode")}function ia(e){return he("Node",e,"parentElement")}function na(e){return he("Node",e,"textContent")}function oa(e){return he("Node",e,"firstChild")}function aa(e){return he("Node",e,"lastChild")}function la(e){return he("Node",e,"nextSibling")}function ua(e){return he("Node",e,"previousSibling")}function ca(e,t){return Hi("Node",e,"contains")(t)}function ha(e){return Hi("Node",e,"getRootNode")()}function fa(e){if(!e||!("host"in e))return null;return he("ShadowRoot",e,"host")}function da(e){return e.styleSheets}function pa(e){if(!e||!("shadowRoot"in e))return null;return he("Element",e,"shadowRoot")}function ma(e,t){return he("Element",e,"querySelector")(t)}function ga(e,t){return he("Element",e,"querySelectorAll")(t)}function Yi(){return[Xr("MutationObserver").constructor,Gi.MutationObserver??(()=>{})]}var $e=Date.now;if(!/[1-9][0-9]{12}/.test(Date.now().toString()))$e=()=>new Date().getTime();function Oe(e,t,o){try{if(!(t in e))return()=>{};let r=e[t],a=o(r);if(typeof a==="function")a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:r}});return e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var L={ownerDocument:ta,childNodes:ra,parentNode:sa,parentElement:ia,textContent:na,firstChild:oa,lastChild:aa,nextSibling:la,previousSibling:ua,contains:ca,getRootNode:ha,host:fa,styleSheets:da,shadowRoot:pa,querySelector:ma,querySelectorAll:ga,nowTimestamp:$e,mutationObserverCtor:Yi,patch:Oe};function oe(e,t,o=document){let r={capture:!0,passive:!0};return o.addEventListener(e,t,r),()=>o.removeEventListener(e,t,r)}var Ae=`Please stop import mirror directly. Instead of that,\r +https://www.w3ctech.com/topic/2226`)}let M=y(...A);return M.postcssPlugin=g,M.postcssVersion=new a().version,M}let N;return Object.defineProperty(x,"postcss",{get(){if(!N)N=x();return N}}),x.process=function(A,M,k){return b([x(k)]).process(A,M)},x},b.stringify=u,b.parse=h,b.fromJSON=p,b.list=f,b.comment=(v)=>new i(v),b.atRule=(v)=>new d(v),b.decl=(v)=>new t(v),b.rule=(v)=>new m(v),b.root=(v)=>new w(v),b.document=(v)=>new l(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=r,b.Processor=a,b.Document=l,b.Comment=i,b.Warning=c,b.AtRule=d,b.Result=n,b.Input=s,b.Rule=m,b.Root=w,b.Node=C,o.registerPostcss(b),Er=b,b.default=b,Er}var ea=Ko(),Y=zo(ea);Y.stringify;Y.fromJSON;Y.plugin;Y.parse;Y.list;Y.document;Y.comment;Y.atRule;Y.rule;Y.decl;Y.root;Y.CssSyntaxError;Y.Declaration;Y.Container;Y.Processor;Y.Document;Y.Comment;Y.Warning;Y.AtRule;Y.Result;Y.Input;Y.Rule;Y.Root;Y.Node;class Xr{constructor(...e){fe(this,"parentElement",null),fe(this,"parentNode",null),fe(this,"ownerDocument"),fe(this,"firstChild",null),fe(this,"lastChild",null),fe(this,"previousSibling",null),fe(this,"nextSibling",null),fe(this,"ELEMENT_NODE",1),fe(this,"TEXT_NODE",3),fe(this,"nodeType"),fe(this,"nodeName"),fe(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;while(t)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Xr))return!1;else if(e.ownerDocument!==this.ownerDocument)return!1;else if(e===this)return!0;while(e.parentNode){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var hi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ze={},Yi={},ta=()=>!!globalThis.Zone;function Qr(e){if(Ze[e])return Ze[e];let t=globalThis[e],o=t.prototype,r=e in hi?hi[e]:void 0,a=Boolean(r&&r.every((l)=>{var c,i;return Boolean((i=(c=Object.getOwnPropertyDescriptor(o,l))==null?void 0:c.get)==null?void 0:i.toString().includes("[native code]"))})),u=e in fi?fi[e]:void 0,p=Boolean(u&&u.every((l)=>{var c;return typeof o[l]==="function"&&((c=o[l])==null?void 0:c.toString().includes("[native code]"))}));if(a&&p&&!ta())return Ze[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let c=l.contentWindow;if(!c)return t.prototype;let i=c[e].prototype;if(!i)return l.remove(),o;let d=navigator.userAgent;if(d.includes("Safari")&&!d.includes("Chrome"))l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Yi[e]=()=>l.remove();else l.remove();return Ze[e]=i}catch{return o}}var xr={};function he(e,t,o){var r,a;let u=(r=xr[e])==null?void 0:r[o];if(u)return u.call(t);let p=Qr(e),l=(a=Object.getOwnPropertyDescriptor(p,o))==null?void 0:a.get;if(!l)return t[o];return(xr[e]||(xr[e]={}))[o]=l,l.call(t)}var Mr={};function Ji(e,t,o){let r=`${e}.${String(o)}`;if(Mr[r])return Mr[r].bind(t);let u=Qr(e)[o];if(typeof u!=="function")return t[o];return Mr[r]=u,u.bind(t)}function ra(e){return he("Node",e,"ownerDocument")}function sa(e){return he("Node",e,"childNodes")}function ia(e){return he("Node",e,"parentNode")}function na(e){return he("Node",e,"parentElement")}function oa(e){return he("Node",e,"textContent")}function aa(e){return he("Node",e,"firstChild")}function la(e){return he("Node",e,"lastChild")}function ua(e){return he("Node",e,"nextSibling")}function ca(e){return he("Node",e,"previousSibling")}function ha(e,t){return Ji("Node",e,"contains")(t)}function fa(e){return Ji("Node",e,"getRootNode")()}function da(e){if(!e||!("host"in e))return null;return he("ShadowRoot",e,"host")}function pa(e){return e.styleSheets}function ma(e){if(!e||!("shadowRoot"in e))return null;return he("Element",e,"shadowRoot")}function ga(e,t){return he("Element",e,"querySelector")(t)}function ya(e,t){return he("Element",e,"querySelectorAll")(t)}function Xi(){return[Qr("MutationObserver").constructor,Yi.MutationObserver??(()=>{})]}var $e=Date.now;if(!/[1-9][0-9]{12}/.test(Date.now().toString()))$e=()=>new Date().getTime();function Oe(e,t,o){try{if(!(t in e))return()=>{};let r=e[t],a=o(r);if(typeof a==="function")a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:r}});return e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var L={ownerDocument:ra,childNodes:sa,parentNode:ia,parentElement:na,textContent:oa,firstChild:aa,lastChild:la,nextSibling:ua,previousSibling:ca,contains:ha,getRootNode:fa,host:da,styleSheets:pa,shadowRoot:ma,querySelector:ga,querySelectorAll:ya,nowTimestamp:$e,mutationObserverCtor:Xi,patch:Oe};function oe(e,t,o=document){let r={capture:!0,passive:!0};return o.addEventListener(e,t,r),()=>o.removeEventListener(e,t,r)}var Ae=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r -or you can use record.mirror to access the mirror instance during recording.`,hi={map:{},getId(){return console.error(Ae),-1},getNode(){return console.error(Ae),null},removeNodeFromMap(){console.error(Ae)},has(){return console.error(Ae),!1},reset(){console.error(Ae)}};if(typeof window<"u"&&window.Proxy&&window.Reflect)hi=new Proxy(hi,{get(e,t,o){if(t==="map")console.error(Ae);return Reflect.get(e,t,o)}});function We(e,t,o={}){let r=null,a=0;return function(...u){let p=Date.now();if(!a&&o.leading===!1)a=p;let l=t-(p-a),c=this;if(l<=0||l>t){if(r)clearTimeout(r),r=null;a=p,e.apply(c,u)}else if(!r&&o.trailing!==!1)r=setTimeout(()=>{a=o.leading===!1?0:Date.now(),r=null,e.apply(c,u)},l)}}function bt(e,t,o,r,a=window){let u=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,r?o:{set(p){if(setTimeout(()=>{o.set.call(this,p)},0),u&&u.set)u.set.call(this,p)}}),()=>bt(e,t,u||{},!0)}function Ji(e){var t,o,r,a;let u=e.document;return{left:u.scrollingElement?u.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:u.documentElement.scrollLeft||(u==null?void 0:u.body)&&((t=L.parentElement(u.body))==null?void 0:t.scrollLeft)||((o=u==null?void 0:u.body)==null?void 0:o.scrollLeft)||0,top:u.scrollingElement?u.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(u==null?void 0:u.documentElement.scrollTop)||(u==null?void 0:u.body)&&((r=L.parentElement(u.body))==null?void 0:r.scrollTop)||((a=u==null?void 0:u.body)==null?void 0:a.scrollTop)||0}}function Xi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Zi(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:L.parentElement(e)}function ae(e,t,o,r){if(!e)return!1;let a=Zi(e);if(!a)return!1;try{if(typeof t==="string"){if(a.classList.contains(t))return!0;if(r&&a.closest("."+t)!==null)return!0}else if(ot(a,t,r))return!0}catch(u){}if(o){if(a.matches(o))return!0;if(r&&a.closest(o)!==null)return!0}return!1}function ya(e,t){return t.getId(e)!==-1}function Mr(e,t,o){if(e.tagName==="TITLE"&&o.headTitleMutations)return!0;return t.getId(e)===nt}function Ki(e,t){if(Fe(e))return!1;let o=t.getId(e);if(!t.has(o))return!0;let r=L.parentNode(e);if(r&&r.nodeType===e.DOCUMENT_NODE)return!1;if(!r)return!0;return Ki(r,t)}function Or(e){return Boolean(e.changedTouches)}function wa(e=window){if("NodeList"in e&&!e.NodeList.prototype.forEach)e.NodeList.prototype.forEach=Array.prototype.forEach;if("DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach)e.DOMTokenList.prototype.forEach=Array.prototype.forEach}function en(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function tn(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ir(e){if(!e)return!1;if(e instanceof Jr&&"shadowRoot"in e)return Boolean(e.shadowRoot);return Boolean(L.shadowRoot(e))}class rn{constructor(){O(this,"id",1),O(this,"styleIDMap",new WeakMap),O(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let o;if(t===void 0)o=this.id++;else o=t;return this.styleIDMap.set(e,o),this.idStyleMap.set(o,e),o}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function sn(e){var t;let o=null;if("getRootNode"in e&&((t=L.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&L.host(L.getRootNode(e)))o=L.host(L.getRootNode(e));return o}function ba(e){let t=e,o;while(o=sn(t))t=o;return t}function va(e){let t=L.ownerDocument(e);if(!t)return!1;let o=ba(e);return L.contains(t,o)}function nn(e){let t=L.ownerDocument(e);if(!t)return!1;return L.contains(t,e)||va(e)}var z=((e)=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(z||{}),U=((e)=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(U||{}),le=((e)=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(le||{}),we=((e)=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(we||{}),Le=((e)=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Le||{}),De=((e)=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(De||{});var on=((e)=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(on||{}),fi=(e,t)=>`${e}@${t}`;class an{constructor(){O(this,"frozen",!1),O(this,"locked",!1),O(this,"texts",[]),O(this,"attributes",[]),O(this,"attributeMap",new WeakMap),O(this,"removes",[]),O(this,"mapRemoves",[]),O(this,"movedMap",{}),O(this,"addedSet",new Set),O(this,"movedSet",new Set),O(this,"droppedSet",new Set),O(this,"removesSubTreeCache",new Set),O(this,"mutationCb"),O(this,"blockClass"),O(this,"blockSelector"),O(this,"maskTextClass"),O(this,"maskTextSelector"),O(this,"inlineStylesheet"),O(this,"maskInputOptions"),O(this,"maskTextFn"),O(this,"maskInputFn"),O(this,"keepIframeSrcFn"),O(this,"recordCanvas"),O(this,"inlineImages"),O(this,"slimDOMOptions"),O(this,"dataURLOptions"),O(this,"doc"),O(this,"mirror"),O(this,"iframeManager"),O(this,"stylesheetManager"),O(this,"shadowDomManager"),O(this,"canvasManager"),O(this,"processedNodeManager"),O(this,"unattachedDoc"),O(this,"processMutations",(e)=>{e.forEach(this.processMutation),this.emit()}),O(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;while(this.mapRemoves.length)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let n of this.movedSet){let s=L.parentNode(n);if(this.removesSubTreeCache.has(s)&&!this.movedSet.has(s))continue;this.addedSet.add(n)}let o=null,r=null,a=-1,u=null,p=!1,l=new Set,c=this.addedSet.values(),i=c.next();while(this.addedSet.size){if(o!==null&&this.addedSet.has(L.previousSibling(o)))u=o,o=L.previousSibling(o);else{if(!this.addedSet.has(i.value))i=c.next();o=i.value;while(!0){if(r=L.parentNode(o),this.addedSet.has(r)){o=r;continue}break}if(l.has(r))r=null;else if(r){if(!nn(r))p=!0;else if(p=di(this.droppedSet,r)||this.removesSubTreeCache.has(r),p&&di(this.movedSet,o))p=!1;if(this.addedSet.has(L.lastChild(r)))o=L.lastChild(r),u=null;else while(!0){if(u=L.nextSibling(o),this.addedSet.has(u)){o=u;continue}break}if(a=Fe(r)?this.mirror.getId(sn(o)):this.mirror.getId(r),a===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=L.host(r);a=this.mirror.getId(f)}}}if(this.addedSet.delete(o),!r||a===-1){l.add(o);continue}else if(p){this.droppedSet.add(o);continue}let n=!1;if(o.nodeType===Node.TEXT_NODE){let f=r.tagName;if(f==="TEXTAREA")continue;else if(f==="STYLE"&&t.has(a))n=!0}let s=u?this.mirror.getId(u):null;while(s===nt)u=u&&L.nextSibling(u),s=u&&this.mirror.getId(u);if(s===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",u),o=null;continue}let h=ke(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:(f)=>{if(en(f,this.mirror))this.iframeManager.addIframe(f);if(tn(f,this.mirror))this.stylesheetManager.trackLinkElement(f);if(Ir(o))this.shadowDomManager.addShadowRoot(L.shadowRoot(o),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:n});if(h)e.push({parentId:a,nextId:s,node:h}),t.add(h.id)}let d={texts:this.texts.map((n)=>{let s=n.node,h=L.parentNode(s);if(h&&h.tagName==="TEXTAREA")this.genTextAreaValueMutation(h);return{id:this.mirror.getId(s),value:n.value}}).filter((n)=>!t.has(n.id)).filter((n)=>this.mirror.has(n.id)),attributes:this.attributes.map((n)=>{let{attributes:s}=n;if(typeof s.style==="string"){let h=JSON.stringify(n.styleDiff),f=JSON.stringify(n._unchangedStyles);if(h.length!t.has(n.id)).filter((n)=>this.mirror.has(n.id)),removes:this.removes,adds:e};if(!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length)return;this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d)}),O(this,"genTextAreaValueMutation",(e)=>{let t=this.attributeMap.get(e);if(!t)t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t);let o=Array.from(L.childNodes(e),(r)=>L.textContent(r)||"").join("");t.attributes.value=rt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:st(e),value:o,maskInputFn:this.maskInputFn})}),O(this,"processMutation",(e)=>{if(Mr(e.target,this.mirror,this.slimDOMOptions))return;switch(e.type){case"characterData":{let t=L.textContent(e.target);if(!ae(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue)this.texts.push({value:Ai(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Zi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,o=Ce(t.tagName),r=e.attributeName,a=e.target.getAttribute(r);if(r==="value"){let p=st(t);a=rt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:p,value:a,maskInputFn:this.maskInputFn})}if(ae(e.target,this.blockClass,this.blockSelector,!1)||a===e.oldValue)return;let u=this.attributeMap.get(e.target);if(o==="iframe"&&r==="src"&&!this.keepIframeSrcFn(a))if(!t.contentDocument)r="rr_src";else return;if(!u)u={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(e.target,u);if(r==="type"&&o==="input"&&(e.oldValue||"").toLowerCase()==="password")t.setAttribute("data-rr-is-password","true");if(!Ii(o,r)){if(u.attributes[r]=Oi(this.doc,o,Ce(r),a),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(l){this.unattachedDoc=this.doc}let p=this.unattachedDoc.createElement("span");if(e.oldValue)p.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let c=t.style.getPropertyValue(l),i=t.style.getPropertyPriority(l);if(c!==p.style.getPropertyValue(l)||i!==p.style.getPropertyPriority(l))if(i==="")u.styleDiff[l]=c;else u.styleDiff[l]=[c,i];else u._unchangedStyles[l]=[c,i]}for(let l of Array.from(p.style))if(t.style.getPropertyValue(l)==="")u.styleDiff[l]=!1}else if(r==="open"&&t.tagName==="DIALOG")if(t.matches("dialog:modal"))u.attributes.rr_open_mode="modal";else u.attributes.rr_open_mode="non-modal"}break}case"childList":{if(ae(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach((t)=>this.genAdds(t,e.target)),e.removedNodes.forEach((t)=>{let o=this.mirror.getId(t),r=Fe(e.target)?this.mirror.getId(L.host(e.target)):this.mirror.getId(e.target);if(ae(e.target,this.blockClass,this.blockSelector,!1)||Mr(t,this.mirror,this.slimDOMOptions)||!ya(t,this.mirror))return;if(this.addedSet.has(t))Ar(this.addedSet,t),this.droppedSet.add(t);else if(this.addedSet.has(e.target)&&o===-1);else if(Ki(e.target,this.mirror));else if(this.movedSet.has(t)&&this.movedMap[fi(o,r)])Ar(this.movedSet,t);else this.removes.push({parentId:r,id:o,isShadow:Fe(e.target)&&Ue(e.target)?!0:void 0}),Sa(t,this.removesSubTreeCache);this.mapRemoves.push(t)});break}}}),O(this,"genAdds",(e,t)=>{if(this.processedNodeManager.inOtherBuffer(e,this))return;if(this.addedSet.has(e)||this.movedSet.has(e))return;if(this.mirror.hasNode(e)){if(Mr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let o=null;if(t&&this.mirror.hasNode(t))o=this.mirror.getId(t);if(o&&o!==-1)this.movedMap[fi(this.mirror.getId(e),o)]=!0}else this.addedSet.add(e),this.droppedSet.delete(e);if(!ae(e,this.blockClass,this.blockSelector,!1)){if(L.childNodes(e).forEach((o)=>this.genAdds(o)),Ir(e))L.childNodes(L.shadowRoot(e)).forEach((o)=>{this.processedNodeManager.add(o,this),this.genAdds(o,e)})}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t)=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ar(e,t){e.delete(t),L.childNodes(t).forEach((o)=>Ar(e,o))}function Sa(e,t){let o=[e];while(o.length){let r=o.pop();if(t.has(r))continue;t.add(r),L.childNodes(r).forEach((a)=>o.push(a))}return}function di(e,t){if(e.size===0)return!1;return ln(e,t)}function ln(e,t){if(e.has(t))return!0;let o=L.parentNode(t);if(!o)return!1;return ln(e,o)}var Be;function Ca(e){Be=e}function Ea(){Be=void 0}var B=(e)=>{if(!Be)return e;return(...o)=>{try{return e(...o)}catch(r){if(Be&&Be(r)===!0)return;throw r}}},Me=[];function je(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function un(e,t){let o=new an;Me.push(o),o.init(e);let[r,a]=Yi(),u=new r(B(o.processMutations.bind(o)));return u.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[u,a]}function xa({mousemoveCb:e,sampling:t,doc:o,mirror:r}){if(t.mousemove===!1)return()=>{};let a=typeof t.mousemove==="number"?t.mousemove:50,u=typeof t.mousemoveCallback==="number"?t.mousemoveCallback:500,p=[],l,c=We(B((n)=>{let s=Date.now()-l;e(p.map((h)=>(h.timeOffset-=s,h)),n),p=[],l=null}),u),i=B(We(B((n)=>{let s=je(n),{clientX:h,clientY:f}=Or(n)?n.changedTouches[0]:n;if(!l)l=$e();p.push({x:h,y:f,id:r.getId(s),timeOffset:$e()-l}),c(typeof DragEvent<"u"&&n instanceof DragEvent?U.Drag:n instanceof MouseEvent?U.MouseMove:U.TouchMove)}),a,{trailing:!1})),d=[oe("mousemove",i,o),oe("touchmove",i,o),oe("drag",i,o)];return B(()=>{d.forEach((n)=>n())})}function Ma({mouseInteractionCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,sampling:u}){if(u.mouseInteraction===!1)return()=>{};let p=u.mouseInteraction===!0||u.mouseInteraction===void 0?{}:u.mouseInteraction,l=[],c=null,i=(d)=>(n)=>{let s=je(n);if(ae(s,r,a,!0))return;let h=null,f=d;if("pointerType"in n){switch(n.pointerType){case"mouse":h=we.Mouse;break;case"touch":h=we.Touch;break;case"pen":h=we.Pen;break}if(h===we.Touch){if(le[d]===le.MouseDown)f="TouchStart";else if(le[d]===le.MouseUp)f="TouchEnd"}else if(h===we.Pen);}else if(Or(n))h=we.Touch;if(h!==null){if(c=h,f.startsWith("Touch")&&h===we.Touch||f.startsWith("Mouse")&&h===we.Mouse)h=null}else if(le[d]===le.Click)h=c,c=null;let m=Or(n)?n.changedTouches[0]:n;if(!m)return;let w=o.getId(s),{clientX:C,clientY:b}=m;B(e)({type:le[f],id:w,x:C,y:b,...h!==null&&{pointerType:h}})};return Object.keys(le).filter((d)=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&p[d]!==!1).forEach((d)=>{let n=Ce(d),s=i(d);if(window.PointerEvent)switch(le[d]){case le.MouseDown:case le.MouseUp:n=n.replace("mouse","pointer");break;case le.TouchStart:case le.TouchEnd:return}l.push(oe(n,s,t))}),B(()=>{l.forEach((d)=>d())})}function cn({scrollCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,sampling:u}){let p=B(We(B((l)=>{let c=je(l);if(!c||ae(c,r,a,!0))return;let i=o.getId(c);if(c===t&&t.defaultView){let d=Ji(t.defaultView);e({id:i,x:d.left,y:d.top})}else e({id:i,x:c.scrollLeft,y:c.scrollTop})}),u.scroll||100));return oe("scroll",p,t)}function Ra({viewportResizeCb:e},{win:t}){let o=-1,r=-1,a=B(We(B(()=>{let u=Xi(),p=Qi();if(o!==u||r!==p)e({width:Number(p),height:Number(u)}),o=u,r=p}),200));return oe("resize",a,t)}var Na=["INPUT","TEXTAREA","SELECT"],pi=new WeakMap;function Oa({inputCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,ignoreClass:u,ignoreSelector:p,maskInputOptions:l,maskInputFn:c,sampling:i,userTriggeredOnInput:d}){function n(b){let v=je(b),g=b.isTrusted,y=v&&v.tagName;if(v&&y==="OPTION")v=L.parentElement(v);if(!v||!y||Na.indexOf(y)<0||ae(v,r,a,!0))return;if(v.classList.contains(u)||p&&v.matches(p))return;let S=v.value,x=!1,N=st(v)||"";if(N==="radio"||N==="checkbox")x=v.checked;else if(l[y.toLowerCase()]||l[N])S=rt({element:v,maskInputOptions:l,tagName:y,type:N,value:S,maskInputFn:c});s(v,d?{text:S,isChecked:x,userTriggered:g}:{text:S,isChecked:x});let A=v.name;if(N==="radio"&&A&&x)t.querySelectorAll(`input[type="radio"][name="${A}"]`).forEach((M)=>{if(M!==v){let k=M.value;s(M,d?{text:k,isChecked:!x,userTriggered:!1}:{text:k,isChecked:!x})}})}function s(b,v){let g=pi.get(b);if(!g||g.text!==v.text||g.isChecked!==v.isChecked){pi.set(b,v);let y=o.getId(b);B(e)({...v,id:y})}}let f=(i.input==="last"?["change"]:["input","change"]).map((b)=>oe(b,B(n),t)),m=t.defaultView;if(!m)return()=>{f.forEach((b)=>b())};let w=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),C=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];if(w&&w.set)f.push(...C.map((b)=>bt(b[0],b[1],{set(){B(n)({target:this,isTrusted:!1})}},!1,m)));return B(()=>{f.forEach((b)=>b())})}function at(e){let t=[];function o(r,a){if(Ze("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ze("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ze("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ze("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let p=Array.from(r.parentRule.cssRules).indexOf(r);return a.unshift(p),o(r.parentRule,a)}else if(r.parentStyleSheet){let p=Array.from(r.parentStyleSheet.cssRules).indexOf(r);a.unshift(p)}return a}return o(e,t)}function Se(e,t,o){let r,a;if(!e)return{};if(e.ownerNode)r=t.getId(e.ownerNode);else a=o.getId(e);return{styleId:a,id:r}}function Ia({styleSheetRuleCb:e,mirror:t,stylesheetManager:o},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let a=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:B((d,n,s)=>{let[h,f]=s,{id:m,styleId:w}=Se(n,t,o.styleMirror);if(m&&m!==-1||w&&w!==-1)e({id:m,styleId:w,adds:[{rule:h,index:f}]});return d.apply(n,s)})}),r.CSSStyleSheet.prototype.addRule=function(d,n,s=this.cssRules.length){let h=`${d} { ${n} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[h,s])};let u=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,removes:[{index:h}]});return d.apply(n,s)})}),r.CSSStyleSheet.prototype.removeRule=function(d){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};let p;if(r.CSSStyleSheet.prototype.replace)p=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(p,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,replace:h});return d.apply(n,s)})});let l;if(r.CSSStyleSheet.prototype.replaceSync)l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,replaceSync:h});return d.apply(n,s)})});let c={};if(Ke("CSSGroupingRule"))c.CSSGroupingRule=r.CSSGroupingRule;else{if(Ke("CSSMediaRule"))c.CSSMediaRule=r.CSSMediaRule;if(Ke("CSSConditionRule"))c.CSSConditionRule=r.CSSConditionRule;if(Ke("CSSSupportsRule"))c.CSSSupportsRule=r.CSSSupportsRule}let i={};return Object.entries(c).forEach(([d,n])=>{i[d]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(i[d].insertRule,{apply:B((s,h,f)=>{let[m,w]=f,{id:C,styleId:b}=Se(h.parentStyleSheet,t,o.styleMirror);if(C&&C!==-1||b&&b!==-1)e({id:C,styleId:b,adds:[{rule:m,index:[...at(h),w||0]}]});return s.apply(h,f)})}),n.prototype.deleteRule=new Proxy(i[d].deleteRule,{apply:B((s,h,f)=>{let[m]=f,{id:w,styleId:C}=Se(h.parentStyleSheet,t,o.styleMirror);if(w&&w!==-1||C&&C!==-1)e({id:w,styleId:C,removes:[{index:[...at(h),m]}]});return s.apply(h,f)})})}),B(()=>{r.CSSStyleSheet.prototype.insertRule=a,r.CSSStyleSheet.prototype.deleteRule=u,p&&(r.CSSStyleSheet.prototype.replace=p),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([d,n])=>{n.prototype.insertRule=i[d].insertRule,n.prototype.deleteRule=i[d].deleteRule})})}function hn({mirror:e,stylesheetManager:t},o){var r,a,u;let p=null;if(o.nodeName==="#document")p=e.getId(o);else p=e.getId(L.host(o));let l=o.nodeName==="#document"?(r=o.defaultView)==null?void 0:r.Document:(u=(a=o.ownerDocument)==null?void 0:a.defaultView)==null?void 0:u.ShadowRoot,c=(l==null?void 0:l.prototype)?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;if(p===null||p===-1||!l||!c)return()=>{};return Object.defineProperty(o,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var i;return(i=c.get)==null?void 0:i.call(this)},set(i){var d;let n=(d=c.set)==null?void 0:d.call(this,i);if(p!==null&&p!==-1)try{t.adoptStyleSheets(i,p)}catch(s){}return n}}),B(()=>{Object.defineProperty(o,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function Aa({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:o,stylesheetManager:r},{win:a}){let u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:B((l,c,i)=>{var d;let[n,s,h]=i;if(o.has(n))return u.apply(c,[n,s,h]);let{id:f,styleId:m}=Se((d=c.parentRule)==null?void 0:d.parentStyleSheet,t,r.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,set:{property:n,value:s,priority:h},index:at(c.parentRule)});return l.apply(c,i)})});let p=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(p,{apply:B((l,c,i)=>{var d;let[n]=i;if(o.has(n))return p.apply(c,[n]);let{id:s,styleId:h}=Se((d=c.parentRule)==null?void 0:d.parentStyleSheet,t,r.styleMirror);if(s&&s!==-1||h&&h!==-1)e({id:s,styleId:h,remove:{property:n},index:at(c.parentRule)});return l.apply(c,i)})}),B(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=p})}function Da({mediaInteractionCb:e,blockClass:t,blockSelector:o,mirror:r,sampling:a,doc:u}){let p=B((c)=>We(B((i)=>{let d=je(i);if(!d||ae(d,t,o,!0))return;let{currentTime:n,volume:s,muted:h,playbackRate:f,loop:m}=d;e({type:c,id:r.getId(d),currentTime:n,volume:s,muted:h,playbackRate:f,loop:m})}),a.media||500)),l=[oe("play",p(De.Play),u),oe("pause",p(De.Pause),u),oe("seeked",p(De.Seeked),u),oe("volumechange",p(De.VolumeChange),u),oe("ratechange",p(De.RateChange),u)];return B(()=>{l.forEach((c)=>c())})}function Ta({fontCb:e,doc:t}){let o=t.defaultView;if(!o)return()=>{};let r=[],a=new WeakMap,u=o.FontFace;o.FontFace=function(c,i,d){let n=new u(c,i,d);return a.set(n,{family:c,buffer:typeof i!=="string",descriptors:d,fontSource:typeof i==="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),n};let p=Oe(t.fonts,"add",function(l){return function(c){return setTimeout(B(()=>{let i=a.get(c);if(i)e(i),a.delete(c)}),0),l.apply(this,[c])}});return r.push(()=>{o.FontFace=u}),r.push(p),B(()=>{r.forEach((l)=>l())})}function _a(e){let{doc:t,mirror:o,blockClass:r,blockSelector:a,selectionCb:u}=e,p=!0,l=B(()=>{let c=t.getSelection();if(!c||p&&(c==null?void 0:c.isCollapsed))return;p=c.isCollapsed||!1;let i=[],d=c.rangeCount||0;for(let n=0;n{};return Oe(o.customElements,"define",function(a){return function(u,p,l){try{t({define:{name:u}})}catch(c){console.warn(`Custom element callback failed for ${u}`)}return a.apply(this,[u,p,l])}})}function Pa(e,t){let{mutationCb:o,mousemoveCb:r,mouseInteractionCb:a,scrollCb:u,viewportResizeCb:p,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:d,canvasMutationCb:n,fontCb:s,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{if(t.mutation)t.mutation(...m);o(...m)},e.mousemoveCb=(...m)=>{if(t.mousemove)t.mousemove(...m);r(...m)},e.mouseInteractionCb=(...m)=>{if(t.mouseInteraction)t.mouseInteraction(...m);a(...m)},e.scrollCb=(...m)=>{if(t.scroll)t.scroll(...m);u(...m)},e.viewportResizeCb=(...m)=>{if(t.viewportResize)t.viewportResize(...m);p(...m)},e.inputCb=(...m)=>{if(t.input)t.input(...m);l(...m)},e.mediaInteractionCb=(...m)=>{if(t.mediaInteaction)t.mediaInteaction(...m);c(...m)},e.styleSheetRuleCb=(...m)=>{if(t.styleSheetRule)t.styleSheetRule(...m);i(...m)},e.styleDeclarationCb=(...m)=>{if(t.styleDeclaration)t.styleDeclaration(...m);d(...m)},e.canvasMutationCb=(...m)=>{if(t.canvasMutation)t.canvasMutation(...m);n(...m)},e.fontCb=(...m)=>{if(t.font)t.font(...m);s(...m)},e.selectionCb=(...m)=>{if(t.selection)t.selection(...m);h(...m)},e.customElementCb=(...m)=>{if(t.customElement)t.customElement(...m);f(...m)}}function La(e,t={}){let o=e.doc.defaultView;if(!o)return()=>{};Pa(e,t);let r,a=()=>{};if(e.recordDOM)[r,a]=un(e,e.doc);let u=xa(e),p=Ma(e),l=cn(e),c=Ra(e,{win:o}),i=Oa(e),d=Da(e),n=()=>{},s=()=>{},h=()=>{},f=()=>{};if(e.recordDOM){if(n=Ia(e,{win:o}),s=hn(e,e.doc),h=Aa(e,{win:o}),e.collectFonts)f=Ta(e)}let m=_a(e),w=ka(e),C=[];for(let b of e.plugins)C.push(b.observer(b.callback,o,b.options));return B(()=>{Me.forEach((b)=>b.reset()),r==null||r.disconnect(),a(),u(),p(),l(),c(),i(),d(),n(),s(),h(),f(),m(),w(),C.forEach((b)=>b())})}function Ze(e){return typeof window[e]<"u"}function Ke(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Dr{constructor(e){O(this,"iframeIdToRemoteIdMap",new WeakMap),O(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,o,r){let a=o||this.getIdToRemoteIdMap(e),u=r||this.getRemoteIdToIdMap(e),p=a.get(t);if(!p)p=this.generateIdFn(),a.set(t,p),u.set(p,t);return p}getIds(e,t){let o=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((a)=>this.getId(e,a,o,r))}getRemoteId(e,t,o){let r=o||this.getRemoteIdToIdMap(e);if(typeof t!=="number")return t;let a=r.get(t);if(!a)return-1;return a}getRemoteIds(e,t){let o=this.getRemoteIdToIdMap(e);return t.map((r)=>this.getRemoteId(e,r,o))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);if(!t)t=new Map,this.iframeIdToRemoteIdMap.set(e,t);return t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);if(!t)t=new Map,this.iframeRemoteIdToIdMap.set(e,t);return t}}class fn{constructor(e){if(O(this,"iframes",new WeakMap),O(this,"crossOriginIframeMap",new WeakMap),O(this,"crossOriginIframeMirror",new Dr(Ni)),O(this,"crossOriginIframeStyleMirror"),O(this,"crossOriginIframeRootIdMap",new WeakMap),O(this,"mirror"),O(this,"mutationCb"),O(this,"wrappedEmit"),O(this,"loadListener"),O(this,"stylesheetManager"),O(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes)window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){if(this.iframes.set(e,!0),e.contentWindow)this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var o,r;if(this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes)(o=e.contentWindow)==null||o.addEventListener("message",this.handleMessage.bind(this));if((r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0)this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin)return;if(!e.source)return;let r=this.crossOriginIframeMap.get(e.source);if(!r)return;let a=this.transformCrossOriginEvent(r,t.data.event);if(a)this.wrappedEmit(a,t.data.isCheckout)}transformCrossOriginEvent(e,t){var o;switch(t.type){case z.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:z.IncrementalSnapshot,data:{source:U.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case z.Meta:case z.Load:case z.DomContentLoaded:return!1;case z.Plugin:return t;case z.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case z.IncrementalSnapshot:switch(t.data.source){case U.Mutation:return t.data.adds.forEach((r)=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let a=this.crossOriginIframeRootIdMap.get(e);a&&this.patchRootIdOnNode(r.node,a)}),t.data.removes.forEach((r)=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach((r)=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach((r)=>{this.replaceIds(r,e,["id"])}),t;case U.Drag:case U.TouchMove:case U.MouseMove:return t.data.positions.forEach((r)=>{this.replaceIds(r,e,["id"])}),t;case U.ViewportResize:return!1;case U.MediaInteraction:case U.MouseInteraction:case U.Scroll:case U.CanvasMutation:case U.Input:return this.replaceIds(t.data,e,["id"]),t;case U.StyleSheetRule:case U.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case U.Font:return t;case U.Selection:return t.data.ranges.forEach((r)=>{this.replaceIds(r,e,["start","end"])}),t;case U.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(o=t.data.styles)==null||o.forEach((r)=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,o,r){for(let a of r){if(!Array.isArray(t[a])&&typeof t[a]!=="number")continue;if(Array.isArray(t[a]))t[a]=e.getIds(o,t[a]);else t[a]=e.getId(o,t[a])}return t}replaceIds(e,t,o){return this.replace(this.crossOriginIframeMirror,e,t,o)}replaceStyleIds(e,t,o){return this.replace(this.crossOriginIframeStyleMirror,e,t,o)}replaceIdOnNode(e,t){if(this.replaceIds(e,t,["id","rootId"]),"childNodes"in e)e.childNodes.forEach((o)=>{this.replaceIdOnNode(o,t)})}patchRootIdOnNode(e,t){if(e.type!==on.Document&&!e.rootId)e.rootId=t;if("childNodes"in e)e.childNodes.forEach((o)=>{this.patchRootIdOnNode(o,t)})}}class dn{constructor(e){O(this,"shadowDoms",new WeakSet),O(this,"mutationCb"),O(this,"scrollCb"),O(this,"bypassOptions"),O(this,"mirror"),O(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ue(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[o]=un({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>o.disconnect()),this.restoreHandlers.push(cn({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{if(e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0)this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(L.host(e)));this.restoreHandlers.push(hn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){if(!e.contentWindow||!e.contentDocument)return;this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let o=this;this.restoreHandlers.push(Oe(e.prototype,"attachShadow",function(r){return function(a){let u=r.call(this,a),p=L.shadowRoot(this);if(p&&nn(this))o.addShadowRoot(p,t);return u}}))}reset(){this.restoreHandlers.forEach((e)=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Te=0;Te>2],a+=Pe[(t[o]&3)<<4|t[o+1]>>4],a+=Pe[(t[o+1]&15)<<2|t[o+2]>>6],a+=Pe[t[o+2]&63];if(r%3===2)a=a.substring(0,a.length-1)+"=";else if(r%3===1)a=a.substring(0,a.length-2)+"==";return a};var mi=new Map;function Ba(e,t){let o=mi.get(e);if(!o)o=new Map,mi.set(e,o);if(!o.has(t))o.set(t,[]);return o.get(t)}var pn=(e,t,o)=>{if(!e||!(gn(e,t)||typeof e==="object"))return;let r=e.constructor.name,a=Ba(o,r),u=a.indexOf(e);if(u===-1)u=a.length,a.push(e);return u};function et(e,t,o){if(e instanceof Array)return e.map((r)=>et(r,t,o));else if(e===null)return e;else if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};else if(e instanceof ArrayBuffer){let r=e.constructor.name,a=Ua(e);return{rr_type:r,base64:a}}else if(e instanceof DataView)return{rr_type:e.constructor.name,args:[et(e.buffer,t,o),e.byteOffset,e.byteLength]};else if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:a}=e;return{rr_type:r,src:a}}else if(e instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[et(e.data,t,o),e.width,e.height]};else if(gn(e,t)||typeof e==="object"){let r=e.constructor.name,a=pn(e,t,o);return{rr_type:r,index:a}}return e}var mn=(e,t,o)=>e.map((r)=>et(r,t,o)),gn=(e,t)=>{let r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((a)=>typeof t[a]==="function");return Boolean(r.find((a)=>e instanceof t[a]))};function $a(e,t,o,r){let a=[],u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let p of u)try{if(typeof t.CanvasRenderingContext2D.prototype[p]!=="function")continue;let l=Oe(t.CanvasRenderingContext2D.prototype,p,function(c){return function(...i){if(!ae(this.canvas,o,r,!0))setTimeout(()=>{let d=mn(i,t,this);e(this.canvas,{type:Le["2D"],property:p,args:d})},0);return c.apply(this,i)}});a.push(l)}catch{let l=bt(t.CanvasRenderingContext2D.prototype,p,{set(c){e(this.canvas,{type:Le["2D"],property:p,args:[c],setter:!0})}});a.push(l)}return()=>{a.forEach((p)=>p())}}function Wa(e){return e==="experimental-webgl"?"webgl":e}function gi(e,t,o,r){let a=[];try{let u=Oe(e.HTMLCanvasElement.prototype,"getContext",function(p){return function(l,...c){if(!ae(this,t,o,!0)){let i=Wa(l);if(!("__context"in this))this.__context=i;if(r&&["webgl","webgl2"].includes(i))if(c[0]&&typeof c[0]==="object"){let d=c[0];if(!d.preserveDrawingBuffer)d.preserveDrawingBuffer=!0}else c.splice(0,1,{preserveDrawingBuffer:!0})}return p.apply(this,[l,...c])}});a.push(u)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((u)=>u())}}function yi(e,t,o,r,a,u){let p=[],l=Object.getOwnPropertyNames(e);for(let c of l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))continue;try{if(typeof e[c]!=="function")continue;let i=Oe(e,c,function(d){return function(...n){let s=d.apply(this,n);if(pn(s,u,this),"tagName"in this.canvas&&!ae(this.canvas,r,a,!0)){let h=mn(n,u,this),f={type:t,property:c,args:h};o(this.canvas,f)}return s}});p.push(i)}catch{let i=bt(e,c,{set(d){o(this.canvas,{type:t,property:c,args:[d],setter:!0})}});p.push(i)}}return p}function za(e,t,o,r){let a=[];if(typeof t.WebGLRenderingContext<"u")a.push(...yi(t.WebGLRenderingContext.prototype,Le.WebGL,e,o,r,t));if(typeof t.WebGL2RenderingContext<"u")a.push(...yi(t.WebGL2RenderingContext.prototype,Le.WebGL2,e,o,r,t));return()=>{a.forEach((u)=>u())}}var yn=`(function() { +or you can use record.mirror to access the mirror instance during recording.`,di={map:{},getId(){return console.error(Ae),-1},getNode(){return console.error(Ae),null},removeNodeFromMap(){console.error(Ae)},has(){return console.error(Ae),!1},reset(){console.error(Ae)}};if(typeof window<"u"&&window.Proxy&&window.Reflect)di=new Proxy(di,{get(e,t,o){if(t==="map")console.error(Ae);return Reflect.get(e,t,o)}});function We(e,t,o={}){let r=null,a=0;return function(...u){let p=Date.now();if(!a&&o.leading===!1)a=p;let l=t-(p-a),c=this;if(l<=0||l>t){if(r)clearTimeout(r),r=null;a=p,e.apply(c,u)}else if(!r&&o.trailing!==!1)r=setTimeout(()=>{a=o.leading===!1?0:Date.now(),r=null,e.apply(c,u)},l)}}function vt(e,t,o,r,a=window){let u=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,r?o:{set(p){if(setTimeout(()=>{o.set.call(this,p)},0),u&&u.set)u.set.call(this,p)}}),()=>vt(e,t,u||{},!0)}function Qi(e){var t,o,r,a;let u=e.document;return{left:u.scrollingElement?u.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:u.documentElement.scrollLeft||(u==null?void 0:u.body)&&((t=L.parentElement(u.body))==null?void 0:t.scrollLeft)||((o=u==null?void 0:u.body)==null?void 0:o.scrollLeft)||0,top:u.scrollingElement?u.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(u==null?void 0:u.documentElement.scrollTop)||(u==null?void 0:u.body)&&((r=L.parentElement(u.body))==null?void 0:r.scrollTop)||((a=u==null?void 0:u.body)==null?void 0:a.scrollTop)||0}}function Zi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ki(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function en(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:L.parentElement(e)}function ae(e,t,o,r){if(!e)return!1;let a=en(e);if(!a)return!1;try{if(typeof t==="string"){if(a.classList.contains(t))return!0;if(r&&a.closest("."+t)!==null)return!0}else if(at(a,t,r))return!0}catch(u){}if(o){if(a.matches(o))return!0;if(r&&a.closest(o)!==null)return!0}return!1}function wa(e,t){return t.getId(e)!==-1}function Rr(e,t,o){if(e.tagName==="TITLE"&&o.headTitleMutations)return!0;return t.getId(e)===ot}function tn(e,t){if(Fe(e))return!1;let o=t.getId(e);if(!t.has(o))return!0;let r=L.parentNode(e);if(r&&r.nodeType===e.DOCUMENT_NODE)return!1;if(!r)return!0;return tn(r,t)}function Ir(e){return Boolean(e.changedTouches)}function ba(e=window){if("NodeList"in e&&!e.NodeList.prototype.forEach)e.NodeList.prototype.forEach=Array.prototype.forEach;if("DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach)e.DOMTokenList.prototype.forEach=Array.prototype.forEach}function rn(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function sn(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ar(e){if(!e)return!1;if(e instanceof Xr&&"shadowRoot"in e)return Boolean(e.shadowRoot);return Boolean(L.shadowRoot(e))}class nn{constructor(){O(this,"id",1),O(this,"styleIDMap",new WeakMap),O(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let o;if(t===void 0)o=this.id++;else o=t;return this.styleIDMap.set(e,o),this.idStyleMap.set(o,e),o}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function on(e){var t;let o=null;if("getRootNode"in e&&((t=L.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&L.host(L.getRootNode(e)))o=L.host(L.getRootNode(e));return o}function va(e){let t=e,o;while(o=on(t))t=o;return t}function Sa(e){let t=L.ownerDocument(e);if(!t)return!1;let o=va(e);return L.contains(t,o)}function an(e){let t=L.ownerDocument(e);if(!t)return!1;return L.contains(t,e)||Sa(e)}var z=((e)=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(z||{}),U=((e)=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(U||{}),le=((e)=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(le||{}),we=((e)=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(we||{}),Le=((e)=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Le||{}),De=((e)=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(De||{});var ln=((e)=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ln||{}),pi=(e,t)=>`${e}@${t}`;class un{constructor(){O(this,"frozen",!1),O(this,"locked",!1),O(this,"texts",[]),O(this,"attributes",[]),O(this,"attributeMap",new WeakMap),O(this,"removes",[]),O(this,"mapRemoves",[]),O(this,"movedMap",{}),O(this,"addedSet",new Set),O(this,"movedSet",new Set),O(this,"droppedSet",new Set),O(this,"removesSubTreeCache",new Set),O(this,"mutationCb"),O(this,"blockClass"),O(this,"blockSelector"),O(this,"maskTextClass"),O(this,"maskTextSelector"),O(this,"inlineStylesheet"),O(this,"maskInputOptions"),O(this,"maskTextFn"),O(this,"maskInputFn"),O(this,"keepIframeSrcFn"),O(this,"recordCanvas"),O(this,"inlineImages"),O(this,"slimDOMOptions"),O(this,"dataURLOptions"),O(this,"doc"),O(this,"mirror"),O(this,"iframeManager"),O(this,"stylesheetManager"),O(this,"shadowDomManager"),O(this,"canvasManager"),O(this,"processedNodeManager"),O(this,"unattachedDoc"),O(this,"processMutations",(e)=>{e.forEach(this.processMutation),this.emit()}),O(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;while(this.mapRemoves.length)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let n of this.movedSet){let s=L.parentNode(n);if(this.removesSubTreeCache.has(s)&&!this.movedSet.has(s))continue;this.addedSet.add(n)}let o=null,r=null,a=-1,u=null,p=!1,l=new Set,c=this.addedSet.values(),i=c.next();while(this.addedSet.size){if(o!==null&&this.addedSet.has(L.previousSibling(o)))u=o,o=L.previousSibling(o);else{if(!this.addedSet.has(i.value))i=c.next();o=i.value;while(!0){if(r=L.parentNode(o),this.addedSet.has(r)){o=r;continue}break}if(l.has(r))r=null;else if(r){if(!an(r))p=!0;else if(p=mi(this.droppedSet,r)||this.removesSubTreeCache.has(r),p&&mi(this.movedSet,o))p=!1;if(this.addedSet.has(L.lastChild(r)))o=L.lastChild(r),u=null;else while(!0){if(u=L.nextSibling(o),this.addedSet.has(u)){o=u;continue}break}if(a=Fe(r)?this.mirror.getId(on(o)):this.mirror.getId(r),a===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=L.host(r);a=this.mirror.getId(f)}}}if(this.addedSet.delete(o),!r||a===-1){l.add(o);continue}else if(p){this.droppedSet.add(o);continue}let n=!1;if(o.nodeType===Node.TEXT_NODE){let f=r.tagName;if(f==="TEXTAREA")continue;else if(f==="STYLE"&&t.has(a))n=!0}let s=u?this.mirror.getId(u):null;while(s===ot)u=u&&L.nextSibling(u),s=u&&this.mirror.getId(u);if(s===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",u),o=null;continue}let h=ke(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:(f)=>{if(rn(f,this.mirror))this.iframeManager.addIframe(f);if(sn(f,this.mirror))this.stylesheetManager.trackLinkElement(f);if(Ar(o))this.shadowDomManager.addShadowRoot(L.shadowRoot(o),this.doc)},onIframeLoad:(f,m)=>{this.iframeManager.attachIframe(f,m),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,m)=>{this.stylesheetManager.attachLinkElement(f,m)},cssCaptured:n});if(h)e.push({parentId:a,nextId:s,node:h}),t.add(h.id)}let d={texts:this.texts.map((n)=>{let s=n.node,h=L.parentNode(s);if(h&&h.tagName==="TEXTAREA")this.genTextAreaValueMutation(h);return{id:this.mirror.getId(s),value:n.value}}).filter((n)=>!t.has(n.id)).filter((n)=>this.mirror.has(n.id)),attributes:this.attributes.map((n)=>{let{attributes:s}=n;if(typeof s.style==="string"){let h=JSON.stringify(n.styleDiff),f=JSON.stringify(n._unchangedStyles);if(h.length!t.has(n.id)).filter((n)=>this.mirror.has(n.id)),removes:this.removes,adds:e};if(!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.adds.length)return;this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(d)}),O(this,"genTextAreaValueMutation",(e)=>{let t=this.attributeMap.get(e);if(!t)t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t);let o=Array.from(L.childNodes(e),(r)=>L.textContent(r)||"").join("");t.attributes.value=st({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:it(e),value:o,maskInputFn:this.maskInputFn})}),O(this,"processMutation",(e)=>{if(Rr(e.target,this.mirror,this.slimDOMOptions))return;switch(e.type){case"characterData":{let t=L.textContent(e.target);if(!ae(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue)this.texts.push({value:Ti(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,en(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,o=Ce(t.tagName),r=e.attributeName,a=e.target.getAttribute(r);if(r==="value"){let p=it(t);a=st({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:p,value:a,maskInputFn:this.maskInputFn})}if(ae(e.target,this.blockClass,this.blockSelector,!1)||a===e.oldValue)return;let u=this.attributeMap.get(e.target);if(o==="iframe"&&r==="src"&&!this.keepIframeSrcFn(a))if(!t.contentDocument)r="rr_src";else return;if(!u)u={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(e.target,u);if(r==="type"&&o==="input"&&(e.oldValue||"").toLowerCase()==="password")t.setAttribute("data-rr-is-password","true");if(!Di(o,r)){if(u.attributes[r]=Ai(this.doc,o,Ce(r),a),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(l){this.unattachedDoc=this.doc}let p=this.unattachedDoc.createElement("span");if(e.oldValue)p.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let c=t.style.getPropertyValue(l),i=t.style.getPropertyPriority(l);if(c!==p.style.getPropertyValue(l)||i!==p.style.getPropertyPriority(l))if(i==="")u.styleDiff[l]=c;else u.styleDiff[l]=[c,i];else u._unchangedStyles[l]=[c,i]}for(let l of Array.from(p.style))if(t.style.getPropertyValue(l)==="")u.styleDiff[l]=!1}else if(r==="open"&&t.tagName==="DIALOG")if(t.matches("dialog:modal"))u.attributes.rr_open_mode="modal";else u.attributes.rr_open_mode="non-modal"}break}case"childList":{if(ae(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach((t)=>this.genAdds(t,e.target)),e.removedNodes.forEach((t)=>{let o=this.mirror.getId(t),r=Fe(e.target)?this.mirror.getId(L.host(e.target)):this.mirror.getId(e.target);if(ae(e.target,this.blockClass,this.blockSelector,!1)||Rr(t,this.mirror,this.slimDOMOptions)||!wa(t,this.mirror))return;if(this.addedSet.has(t))Dr(this.addedSet,t),this.droppedSet.add(t);else if(this.addedSet.has(e.target)&&o===-1);else if(tn(e.target,this.mirror));else if(this.movedSet.has(t)&&this.movedMap[pi(o,r)])Dr(this.movedSet,t);else this.removes.push({parentId:r,id:o,isShadow:Fe(e.target)&&Ue(e.target)?!0:void 0}),Ca(t,this.removesSubTreeCache);this.mapRemoves.push(t)});break}}}),O(this,"genAdds",(e,t)=>{if(this.processedNodeManager.inOtherBuffer(e,this))return;if(this.addedSet.has(e)||this.movedSet.has(e))return;if(this.mirror.hasNode(e)){if(Rr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let o=null;if(t&&this.mirror.hasNode(t))o=this.mirror.getId(t);if(o&&o!==-1)this.movedMap[pi(this.mirror.getId(e),o)]=!0}else this.addedSet.add(e),this.droppedSet.delete(e);if(!ae(e,this.blockClass,this.blockSelector,!1)){if(L.childNodes(e).forEach((o)=>this.genAdds(o)),Ar(e))L.childNodes(L.shadowRoot(e)).forEach((o)=>{this.processedNodeManager.add(o,this),this.genAdds(o,e)})}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t)=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Dr(e,t){e.delete(t),L.childNodes(t).forEach((o)=>Dr(e,o))}function Ca(e,t){let o=[e];while(o.length){let r=o.pop();if(t.has(r))continue;t.add(r),L.childNodes(r).forEach((a)=>o.push(a))}return}function mi(e,t){if(e.size===0)return!1;return cn(e,t)}function cn(e,t){if(e.has(t))return!0;let o=L.parentNode(t);if(!o)return!1;return cn(e,o)}var Be;function Ea(e){Be=e}function xa(){Be=void 0}var B=(e)=>{if(!Be)return e;return(...o)=>{try{return e(...o)}catch(r){if(Be&&Be(r)===!0)return;throw r}}},Me=[];function je(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function hn(e,t){let o=new un;Me.push(o),o.init(e);let[r,a]=Xi(),u=new r(B(o.processMutations.bind(o)));return u.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[u,a]}function Ma({mousemoveCb:e,sampling:t,doc:o,mirror:r}){if(t.mousemove===!1)return()=>{};let a=typeof t.mousemove==="number"?t.mousemove:50,u=typeof t.mousemoveCallback==="number"?t.mousemoveCallback:500,p=[],l,c=We(B((n)=>{let s=Date.now()-l;e(p.map((h)=>(h.timeOffset-=s,h)),n),p=[],l=null}),u),i=B(We(B((n)=>{let s=je(n),{clientX:h,clientY:f}=Ir(n)?n.changedTouches[0]:n;if(!l)l=$e();p.push({x:h,y:f,id:r.getId(s),timeOffset:$e()-l}),c(typeof DragEvent<"u"&&n instanceof DragEvent?U.Drag:n instanceof MouseEvent?U.MouseMove:U.TouchMove)}),a,{trailing:!1})),d=[oe("mousemove",i,o),oe("touchmove",i,o),oe("drag",i,o)];return B(()=>{d.forEach((n)=>n())})}function Ra({mouseInteractionCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,sampling:u}){if(u.mouseInteraction===!1)return()=>{};let p=u.mouseInteraction===!0||u.mouseInteraction===void 0?{}:u.mouseInteraction,l=[],c=null,i=(d)=>(n)=>{let s=je(n);if(ae(s,r,a,!0))return;let h=null,f=d;if("pointerType"in n){switch(n.pointerType){case"mouse":h=we.Mouse;break;case"touch":h=we.Touch;break;case"pen":h=we.Pen;break}if(h===we.Touch){if(le[d]===le.MouseDown)f="TouchStart";else if(le[d]===le.MouseUp)f="TouchEnd"}else if(h===we.Pen);}else if(Ir(n))h=we.Touch;if(h!==null){if(c=h,f.startsWith("Touch")&&h===we.Touch||f.startsWith("Mouse")&&h===we.Mouse)h=null}else if(le[d]===le.Click)h=c,c=null;let m=Ir(n)?n.changedTouches[0]:n;if(!m)return;let w=o.getId(s),{clientX:C,clientY:b}=m;B(e)({type:le[f],id:w,x:C,y:b,...h!==null&&{pointerType:h}})};return Object.keys(le).filter((d)=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&p[d]!==!1).forEach((d)=>{let n=Ce(d),s=i(d);if(window.PointerEvent)switch(le[d]){case le.MouseDown:case le.MouseUp:n=n.replace("mouse","pointer");break;case le.TouchStart:case le.TouchEnd:return}l.push(oe(n,s,t))}),B(()=>{l.forEach((d)=>d())})}function fn({scrollCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,sampling:u}){let p=B(We(B((l)=>{let c=je(l);if(!c||ae(c,r,a,!0))return;let i=o.getId(c);if(c===t&&t.defaultView){let d=Qi(t.defaultView);e({id:i,x:d.left,y:d.top})}else e({id:i,x:c.scrollLeft,y:c.scrollTop})}),u.scroll||100));return oe("scroll",p,t)}function Na({viewportResizeCb:e},{win:t}){let o=-1,r=-1,a=B(We(B(()=>{let u=Zi(),p=Ki();if(o!==u||r!==p)e({width:Number(p),height:Number(u)}),o=u,r=p}),200));return oe("resize",a,t)}var Oa=["INPUT","TEXTAREA","SELECT"],gi=new WeakMap;function Ia({inputCb:e,doc:t,mirror:o,blockClass:r,blockSelector:a,ignoreClass:u,ignoreSelector:p,maskInputOptions:l,maskInputFn:c,sampling:i,userTriggeredOnInput:d}){function n(b){let v=je(b),g=b.isTrusted,y=v&&v.tagName;if(v&&y==="OPTION")v=L.parentElement(v);if(!v||!y||Oa.indexOf(y)<0||ae(v,r,a,!0))return;if(v.classList.contains(u)||p&&v.matches(p))return;let S=v.value,x=!1,N=it(v)||"";if(N==="radio"||N==="checkbox")x=v.checked;else if(l[y.toLowerCase()]||l[N])S=st({element:v,maskInputOptions:l,tagName:y,type:N,value:S,maskInputFn:c});s(v,d?{text:S,isChecked:x,userTriggered:g}:{text:S,isChecked:x});let A=v.name;if(N==="radio"&&A&&x)t.querySelectorAll(`input[type="radio"][name="${A}"]`).forEach((M)=>{if(M!==v){let k=M.value;s(M,d?{text:k,isChecked:!x,userTriggered:!1}:{text:k,isChecked:!x})}})}function s(b,v){let g=gi.get(b);if(!g||g.text!==v.text||g.isChecked!==v.isChecked){gi.set(b,v);let y=o.getId(b);B(e)({...v,id:y})}}let f=(i.input==="last"?["change"]:["input","change"]).map((b)=>oe(b,B(n),t)),m=t.defaultView;if(!m)return()=>{f.forEach((b)=>b())};let w=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),C=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];if(w&&w.set)f.push(...C.map((b)=>vt(b[0],b[1],{set(){B(n)({target:this,isTrusted:!1})}},!1,m)));return B(()=>{f.forEach((b)=>b())})}function lt(e){let t=[];function o(r,a){if(Ke("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let p=Array.from(r.parentRule.cssRules).indexOf(r);return a.unshift(p),o(r.parentRule,a)}else if(r.parentStyleSheet){let p=Array.from(r.parentStyleSheet.cssRules).indexOf(r);a.unshift(p)}return a}return o(e,t)}function Se(e,t,o){let r,a;if(!e)return{};if(e.ownerNode)r=t.getId(e.ownerNode);else a=o.getId(e);return{styleId:a,id:r}}function Aa({styleSheetRuleCb:e,mirror:t,stylesheetManager:o},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let a=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:B((d,n,s)=>{let[h,f]=s,{id:m,styleId:w}=Se(n,t,o.styleMirror);if(m&&m!==-1||w&&w!==-1)e({id:m,styleId:w,adds:[{rule:h,index:f}]});return d.apply(n,s)})}),r.CSSStyleSheet.prototype.addRule=function(d,n,s=this.cssRules.length){let h=`${d} { ${n} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[h,s])};let u=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,removes:[{index:h}]});return d.apply(n,s)})}),r.CSSStyleSheet.prototype.removeRule=function(d){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};let p;if(r.CSSStyleSheet.prototype.replace)p=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(p,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,replace:h});return d.apply(n,s)})});let l;if(r.CSSStyleSheet.prototype.replaceSync)l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:B((d,n,s)=>{let[h]=s,{id:f,styleId:m}=Se(n,t,o.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,replaceSync:h});return d.apply(n,s)})});let c={};if(et("CSSGroupingRule"))c.CSSGroupingRule=r.CSSGroupingRule;else{if(et("CSSMediaRule"))c.CSSMediaRule=r.CSSMediaRule;if(et("CSSConditionRule"))c.CSSConditionRule=r.CSSConditionRule;if(et("CSSSupportsRule"))c.CSSSupportsRule=r.CSSSupportsRule}let i={};return Object.entries(c).forEach(([d,n])=>{i[d]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(i[d].insertRule,{apply:B((s,h,f)=>{let[m,w]=f,{id:C,styleId:b}=Se(h.parentStyleSheet,t,o.styleMirror);if(C&&C!==-1||b&&b!==-1)e({id:C,styleId:b,adds:[{rule:m,index:[...lt(h),w||0]}]});return s.apply(h,f)})}),n.prototype.deleteRule=new Proxy(i[d].deleteRule,{apply:B((s,h,f)=>{let[m]=f,{id:w,styleId:C}=Se(h.parentStyleSheet,t,o.styleMirror);if(w&&w!==-1||C&&C!==-1)e({id:w,styleId:C,removes:[{index:[...lt(h),m]}]});return s.apply(h,f)})})}),B(()=>{r.CSSStyleSheet.prototype.insertRule=a,r.CSSStyleSheet.prototype.deleteRule=u,p&&(r.CSSStyleSheet.prototype.replace=p),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([d,n])=>{n.prototype.insertRule=i[d].insertRule,n.prototype.deleteRule=i[d].deleteRule})})}function dn({mirror:e,stylesheetManager:t},o){var r,a,u;let p=null;if(o.nodeName==="#document")p=e.getId(o);else p=e.getId(L.host(o));let l=o.nodeName==="#document"?(r=o.defaultView)==null?void 0:r.Document:(u=(a=o.ownerDocument)==null?void 0:a.defaultView)==null?void 0:u.ShadowRoot,c=(l==null?void 0:l.prototype)?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;if(p===null||p===-1||!l||!c)return()=>{};return Object.defineProperty(o,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var i;return(i=c.get)==null?void 0:i.call(this)},set(i){var d;let n=(d=c.set)==null?void 0:d.call(this,i);if(p!==null&&p!==-1)try{t.adoptStyleSheets(i,p)}catch(s){}return n}}),B(()=>{Object.defineProperty(o,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function Da({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:o,stylesheetManager:r},{win:a}){let u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:B((l,c,i)=>{var d;let[n,s,h]=i;if(o.has(n))return u.apply(c,[n,s,h]);let{id:f,styleId:m}=Se((d=c.parentRule)==null?void 0:d.parentStyleSheet,t,r.styleMirror);if(f&&f!==-1||m&&m!==-1)e({id:f,styleId:m,set:{property:n,value:s,priority:h},index:lt(c.parentRule)});return l.apply(c,i)})});let p=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(p,{apply:B((l,c,i)=>{var d;let[n]=i;if(o.has(n))return p.apply(c,[n]);let{id:s,styleId:h}=Se((d=c.parentRule)==null?void 0:d.parentStyleSheet,t,r.styleMirror);if(s&&s!==-1||h&&h!==-1)e({id:s,styleId:h,remove:{property:n},index:lt(c.parentRule)});return l.apply(c,i)})}),B(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=p})}function Ta({mediaInteractionCb:e,blockClass:t,blockSelector:o,mirror:r,sampling:a,doc:u}){let p=B((c)=>We(B((i)=>{let d=je(i);if(!d||ae(d,t,o,!0))return;let{currentTime:n,volume:s,muted:h,playbackRate:f,loop:m}=d;e({type:c,id:r.getId(d),currentTime:n,volume:s,muted:h,playbackRate:f,loop:m})}),a.media||500)),l=[oe("play",p(De.Play),u),oe("pause",p(De.Pause),u),oe("seeked",p(De.Seeked),u),oe("volumechange",p(De.VolumeChange),u),oe("ratechange",p(De.RateChange),u)];return B(()=>{l.forEach((c)=>c())})}function _a({fontCb:e,doc:t}){let o=t.defaultView;if(!o)return()=>{};let r=[],a=new WeakMap,u=o.FontFace;o.FontFace=function(c,i,d){let n=new u(c,i,d);return a.set(n,{family:c,buffer:typeof i!=="string",descriptors:d,fontSource:typeof i==="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),n};let p=Oe(t.fonts,"add",function(l){return function(c){return setTimeout(B(()=>{let i=a.get(c);if(i)e(i),a.delete(c)}),0),l.apply(this,[c])}});return r.push(()=>{o.FontFace=u}),r.push(p),B(()=>{r.forEach((l)=>l())})}function ka(e){let{doc:t,mirror:o,blockClass:r,blockSelector:a,selectionCb:u}=e,p=!0,l=B(()=>{let c=t.getSelection();if(!c||p&&(c==null?void 0:c.isCollapsed))return;p=c.isCollapsed||!1;let i=[],d=c.rangeCount||0;for(let n=0;n{};return Oe(o.customElements,"define",function(a){return function(u,p,l){try{t({define:{name:u}})}catch(c){console.warn(`Custom element callback failed for ${u}`)}return a.apply(this,[u,p,l])}})}function La(e,t){let{mutationCb:o,mousemoveCb:r,mouseInteractionCb:a,scrollCb:u,viewportResizeCb:p,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:d,canvasMutationCb:n,fontCb:s,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...m)=>{if(t.mutation)t.mutation(...m);o(...m)},e.mousemoveCb=(...m)=>{if(t.mousemove)t.mousemove(...m);r(...m)},e.mouseInteractionCb=(...m)=>{if(t.mouseInteraction)t.mouseInteraction(...m);a(...m)},e.scrollCb=(...m)=>{if(t.scroll)t.scroll(...m);u(...m)},e.viewportResizeCb=(...m)=>{if(t.viewportResize)t.viewportResize(...m);p(...m)},e.inputCb=(...m)=>{if(t.input)t.input(...m);l(...m)},e.mediaInteractionCb=(...m)=>{if(t.mediaInteaction)t.mediaInteaction(...m);c(...m)},e.styleSheetRuleCb=(...m)=>{if(t.styleSheetRule)t.styleSheetRule(...m);i(...m)},e.styleDeclarationCb=(...m)=>{if(t.styleDeclaration)t.styleDeclaration(...m);d(...m)},e.canvasMutationCb=(...m)=>{if(t.canvasMutation)t.canvasMutation(...m);n(...m)},e.fontCb=(...m)=>{if(t.font)t.font(...m);s(...m)},e.selectionCb=(...m)=>{if(t.selection)t.selection(...m);h(...m)},e.customElementCb=(...m)=>{if(t.customElement)t.customElement(...m);f(...m)}}function Fa(e,t={}){let o=e.doc.defaultView;if(!o)return()=>{};La(e,t);let r,a=()=>{};if(e.recordDOM)[r,a]=hn(e,e.doc);let u=Ma(e),p=Ra(e),l=fn(e),c=Na(e,{win:o}),i=Ia(e),d=Ta(e),n=()=>{},s=()=>{},h=()=>{},f=()=>{};if(e.recordDOM){if(n=Aa(e,{win:o}),s=dn(e,e.doc),h=Da(e,{win:o}),e.collectFonts)f=_a(e)}let m=ka(e),w=Pa(e),C=[];for(let b of e.plugins)C.push(b.observer(b.callback,o,b.options));return B(()=>{Me.forEach((b)=>b.reset()),r==null||r.disconnect(),a(),u(),p(),l(),c(),i(),d(),n(),s(),h(),f(),m(),w(),C.forEach((b)=>b())})}function Ke(e){return typeof window[e]<"u"}function et(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Tr{constructor(e){O(this,"iframeIdToRemoteIdMap",new WeakMap),O(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,o,r){let a=o||this.getIdToRemoteIdMap(e),u=r||this.getRemoteIdToIdMap(e),p=a.get(t);if(!p)p=this.generateIdFn(),a.set(t,p),u.set(p,t);return p}getIds(e,t){let o=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((a)=>this.getId(e,a,o,r))}getRemoteId(e,t,o){let r=o||this.getRemoteIdToIdMap(e);if(typeof t!=="number")return t;let a=r.get(t);if(!a)return-1;return a}getRemoteIds(e,t){let o=this.getRemoteIdToIdMap(e);return t.map((r)=>this.getRemoteId(e,r,o))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);if(!t)t=new Map,this.iframeIdToRemoteIdMap.set(e,t);return t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);if(!t)t=new Map,this.iframeRemoteIdToIdMap.set(e,t);return t}}class pn{constructor(e){if(O(this,"iframes",new WeakMap),O(this,"crossOriginIframeMap",new WeakMap),O(this,"crossOriginIframeMirror",new Tr(Ii)),O(this,"crossOriginIframeStyleMirror"),O(this,"crossOriginIframeRootIdMap",new WeakMap),O(this,"mirror"),O(this,"mutationCb"),O(this,"wrappedEmit"),O(this,"loadListener"),O(this,"stylesheetManager"),O(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes)window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){if(this.iframes.set(e,!0),e.contentWindow)this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var o,r;if(this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes)(o=e.contentWindow)==null||o.addEventListener("message",this.handleMessage.bind(this));if((r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0)this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin)return;if(!e.source)return;let r=this.crossOriginIframeMap.get(e.source);if(!r)return;let a=this.transformCrossOriginEvent(r,t.data.event);if(a)this.wrappedEmit(a,t.data.isCheckout)}transformCrossOriginEvent(e,t){var o;switch(t.type){case z.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:z.IncrementalSnapshot,data:{source:U.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case z.Meta:case z.Load:case z.DomContentLoaded:return!1;case z.Plugin:return t;case z.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case z.IncrementalSnapshot:switch(t.data.source){case U.Mutation:return t.data.adds.forEach((r)=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let a=this.crossOriginIframeRootIdMap.get(e);a&&this.patchRootIdOnNode(r.node,a)}),t.data.removes.forEach((r)=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach((r)=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach((r)=>{this.replaceIds(r,e,["id"])}),t;case U.Drag:case U.TouchMove:case U.MouseMove:return t.data.positions.forEach((r)=>{this.replaceIds(r,e,["id"])}),t;case U.ViewportResize:return!1;case U.MediaInteraction:case U.MouseInteraction:case U.Scroll:case U.CanvasMutation:case U.Input:return this.replaceIds(t.data,e,["id"]),t;case U.StyleSheetRule:case U.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case U.Font:return t;case U.Selection:return t.data.ranges.forEach((r)=>{this.replaceIds(r,e,["start","end"])}),t;case U.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(o=t.data.styles)==null||o.forEach((r)=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,o,r){for(let a of r){if(!Array.isArray(t[a])&&typeof t[a]!=="number")continue;if(Array.isArray(t[a]))t[a]=e.getIds(o,t[a]);else t[a]=e.getId(o,t[a])}return t}replaceIds(e,t,o){return this.replace(this.crossOriginIframeMirror,e,t,o)}replaceStyleIds(e,t,o){return this.replace(this.crossOriginIframeStyleMirror,e,t,o)}replaceIdOnNode(e,t){if(this.replaceIds(e,t,["id","rootId"]),"childNodes"in e)e.childNodes.forEach((o)=>{this.replaceIdOnNode(o,t)})}patchRootIdOnNode(e,t){if(e.type!==ln.Document&&!e.rootId)e.rootId=t;if("childNodes"in e)e.childNodes.forEach((o)=>{this.patchRootIdOnNode(o,t)})}}class mn{constructor(e){O(this,"shadowDoms",new WeakSet),O(this,"mutationCb"),O(this,"scrollCb"),O(this,"bypassOptions"),O(this,"mirror"),O(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ue(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[o]=hn({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>o.disconnect()),this.restoreHandlers.push(fn({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{if(e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0)this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(L.host(e)));this.restoreHandlers.push(dn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){if(!e.contentWindow||!e.contentDocument)return;this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let o=this;this.restoreHandlers.push(Oe(e.prototype,"attachShadow",function(r){return function(a){let u=r.call(this,a),p=L.shadowRoot(this);if(p&&an(this))o.addShadowRoot(p,t);return u}}))}reset(){this.restoreHandlers.forEach((e)=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ua=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Te=0;Te>2],a+=Pe[(t[o]&3)<<4|t[o+1]>>4],a+=Pe[(t[o+1]&15)<<2|t[o+2]>>6],a+=Pe[t[o+2]&63];if(r%3===2)a=a.substring(0,a.length-1)+"=";else if(r%3===1)a=a.substring(0,a.length-2)+"==";return a};var yi=new Map;function $a(e,t){let o=yi.get(e);if(!o)o=new Map,yi.set(e,o);if(!o.has(t))o.set(t,[]);return o.get(t)}var gn=(e,t,o)=>{if(!e||!(wn(e,t)||typeof e==="object"))return;let r=e.constructor.name,a=$a(o,r),u=a.indexOf(e);if(u===-1)u=a.length,a.push(e);return u};function tt(e,t,o){if(e instanceof Array)return e.map((r)=>tt(r,t,o));else if(e===null)return e;else if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};else if(e instanceof ArrayBuffer){let r=e.constructor.name,a=Ba(e);return{rr_type:r,base64:a}}else if(e instanceof DataView)return{rr_type:e.constructor.name,args:[tt(e.buffer,t,o),e.byteOffset,e.byteLength]};else if(e instanceof HTMLImageElement){let r=e.constructor.name,{src:a}=e;return{rr_type:r,src:a}}else if(e instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[tt(e.data,t,o),e.width,e.height]};else if(wn(e,t)||typeof e==="object"){let r=e.constructor.name,a=gn(e,t,o);return{rr_type:r,index:a}}return e}var yn=(e,t,o)=>e.map((r)=>tt(r,t,o)),wn=(e,t)=>{let r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((a)=>typeof t[a]==="function");return Boolean(r.find((a)=>e instanceof t[a]))};function Wa(e,t,o,r){let a=[],u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let p of u)try{if(typeof t.CanvasRenderingContext2D.prototype[p]!=="function")continue;let l=Oe(t.CanvasRenderingContext2D.prototype,p,function(c){return function(...i){if(!ae(this.canvas,o,r,!0))setTimeout(()=>{let d=yn(i,t,this);e(this.canvas,{type:Le["2D"],property:p,args:d})},0);return c.apply(this,i)}});a.push(l)}catch{let l=vt(t.CanvasRenderingContext2D.prototype,p,{set(c){e(this.canvas,{type:Le["2D"],property:p,args:[c],setter:!0})}});a.push(l)}return()=>{a.forEach((p)=>p())}}function za(e){return e==="experimental-webgl"?"webgl":e}function wi(e,t,o,r){let a=[];try{let u=Oe(e.HTMLCanvasElement.prototype,"getContext",function(p){return function(l,...c){if(!ae(this,t,o,!0)){let i=za(l);if(!("__context"in this))this.__context=i;if(r&&["webgl","webgl2"].includes(i))if(c[0]&&typeof c[0]==="object"){let d=c[0];if(!d.preserveDrawingBuffer)d.preserveDrawingBuffer=!0}else c.splice(0,1,{preserveDrawingBuffer:!0})}return p.apply(this,[l,...c])}});a.push(u)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach((u)=>u())}}function bi(e,t,o,r,a,u){let p=[],l=Object.getOwnPropertyNames(e);for(let c of l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))continue;try{if(typeof e[c]!=="function")continue;let i=Oe(e,c,function(d){return function(...n){let s=d.apply(this,n);if(gn(s,u,this),"tagName"in this.canvas&&!ae(this.canvas,r,a,!0)){let h=yn(n,u,this),f={type:t,property:c,args:h};o(this.canvas,f)}return s}});p.push(i)}catch{let i=vt(e,c,{set(d){o(this.canvas,{type:t,property:c,args:[d],setter:!0})}});p.push(i)}}return p}function qa(e,t,o,r){let a=[];if(typeof t.WebGLRenderingContext<"u")a.push(...bi(t.WebGLRenderingContext.prototype,Le.WebGL,e,o,r,t));if(typeof t.WebGL2RenderingContext<"u")a.push(...bi(t.WebGL2RenderingContext.prototype,Le.WebGL2,e,o,r,t));return()=>{a.forEach((u)=>u())}}var bn=`(function() { "use strict"; var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); @@ -131,7 +131,7 @@ or you can use record.mirror to access the mirror instance during recording.`,hi }; })(); //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map -`,wi=typeof self<"u"&&self.Blob&&new Blob([yn],{type:"text/javascript;charset=utf-8"});function qa(e){let t;try{if(t=wi&&(self.URL||self.webkitURL).createObjectURL(wi),!t)throw"";let o=new Worker(t,{name:e==null?void 0:e.name});return o.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),o}catch(o){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(yn),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class wn{constructor(e){O(this,"pendingCanvasMutations",new Map),O(this,"rafStamps",{latestId:0,invokeId:null}),O(this,"mirror"),O(this,"mutationCb"),O(this,"resetObservers"),O(this,"frozen",!1),O(this,"locked",!1),O(this,"processMutation",(l,c)=>{if(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)this.rafStamps.invokeId=this.rafStamps.latestId;if(!this.pendingCanvasMutations.has(l))this.pendingCanvasMutations.set(l,[]);this.pendingCanvasMutations.get(l).push(c)});let{sampling:t="all",win:o,blockClass:r,blockSelector:a,recordCanvas:u,dataURLOptions:p}=e;if(this.mutationCb=e.mutationCb,this.mirror=e.mirror,u&&t==="all")this.initCanvasMutationObserver(o,r,a);if(u&&typeof t==="number")this.initCanvasFPSObserver(t,o,r,a,{dataURLOptions:p})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,o,r,a){let u=gi(t,o,r,!0),p=new Map,l=new qa;l.onmessage=(h)=>{let{id:f}=h.data;if(p.set(f,!1),!("base64"in h.data))return;let{base64:m,type:w,width:C,height:b}=h.data;this.mutationCb({id:f,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,C,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:w}]},0,0]}]})};let c=1000/e,i=0,d,n=()=>{let h=[];return t.document.querySelectorAll("canvas").forEach((f)=>{if(!ae(f,o,r,!0))h.push(f)}),h},s=(h)=>{if(i&&h-i{var m;let w=this.mirror.getId(f);if(p.get(w))return;if(f.width===0||f.height===0)return;if(p.set(w,!0),["webgl","webgl2"].includes(f.__context)){let b=f.getContext(f.__context);if(((m=b==null?void 0:b.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1)b.clear(b.COLOR_BUFFER_BIT)}let C=await createImageBitmap(f);l.postMessage({id:w,bitmap:C,width:f.width,height:f.height,dataURLOptions:a.dataURLOptions},[C])}),d=requestAnimationFrame(s)};d=requestAnimationFrame(s),this.resetObservers=()=>{u(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,o){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=gi(e,t,o,!1),a=$a(this.processMutation.bind(this),e,t,o),u=za(this.processMutation.bind(this),e,t,o);this.resetObservers=()=>{r(),a(),u()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=(t)=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let o=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,o)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let o=this.pendingCanvasMutations.get(e);if(!o||t===-1)return;let r=o.map((u)=>{let{type:p,...l}=u;return l}),{type:a}=o[0];this.mutationCb({id:t,type:a,commands:r}),this.pendingCanvasMutations.delete(e)}}class bn{constructor(e){O(this,"trackedLinkElements",new WeakSet),O(this,"mutationCb"),O(this,"adoptedStyleSheetCb"),O(this,"styleMirror",new rn),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){if("_cssText"in t.attributes)this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]});this.trackLinkElement(e)}trackLinkElement(e){if(this.trackedLinkElements.has(e))return;this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e)}adoptStyleSheets(e,t){if(e.length===0)return;let o={id:t,styleIds:[]},r=[];for(let a of e){let u;if(!this.styleMirror.has(a))u=this.styleMirror.add(a),r.push({styleId:u,rules:Array.from(a.rules||CSSRule,(p,l)=>({rule:xi(p,a.href),index:l}))});else u=this.styleMirror.getId(a);o.styleIds.push(u)}if(r.length>0)o.styles=r;this.adoptedStyleSheetCb(o)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class vn{constructor(){O(this,"nodeMap",new WeakMap),O(this,"active",!1)}inOtherBuffer(e,t){let o=this.nodeMap.get(e);return o&&Array.from(o).some((r)=>r!==t)}add(e,t){if(!this.active)this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1});this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Q,tt,Rr,lt=!1;try{if(Array.from([1],(e)=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Zr=e.contentWindow)==null?void 0:Zr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var pe=Qn();function ye(e={}){let{emit:t,checkoutEveryNms:o,checkoutEveryNth:r,blockClass:a="rr-block",blockSelector:u=null,ignoreClass:p="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:i=null,inlineStylesheet:d=!0,maskAllInputs:n,maskInputOptions:s,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:w,packFn:C,sampling:b={},dataURLOptions:v={},mousemoveWait:g,recordDOM:y=!0,recordCanvas:S=!1,recordCrossOriginIframes:x=!1,recordAfter:N=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:A=!1,collectFonts:M=!1,inlineImages:k=!1,plugins:D,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:Z=new Set([]),errorHandler:re}=e;Ca(re);let q=x?window.parent===window:!0,W=!1;if(!q)try{if(window.parent.document)W=!1}catch(_){W=!0}if(q&&!t)throw Error("emit function is required");if(!q&&!W)return()=>{};if(g!==void 0&&b.mousemove===void 0)b.mousemove=g;pe.reset();let I=n===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:s!==void 0?s:{password:!0},P=Di(h);wa();let F,T=0,J=(_)=>{for(let K of D||[])if(K.eventProcessor)_=K.eventProcessor(_);if(C&&!W)_=C(_);return _};Q=(_,K)=>{var j;let X=_;if(X.timestamp=$e(),((j=Me[0])==null?void 0:j.isFrozen())&&X.type!==z.FullSnapshot&&!(X.type===z.IncrementalSnapshot&&X.data.source===U.Mutation))Me.forEach((ue)=>ue.unfreeze());if(q)t==null||t(J(X),K);else if(W){let ue={type:"rrweb",event:J(X),origin:window.location.origin,isCheckout:K};window.parent.postMessage(ue,"*")}if(X.type===z.FullSnapshot)F=X,T=0;else if(X.type===z.IncrementalSnapshot){if(X.data.source===U.Mutation&&X.data.isAttachIframe)return;T++;let ue=r&&T>=r,V=o&&X.timestamp-F.timestamp>o;if(ue||V)tt(!0)}};let R=(_)=>{Q({type:z.IncrementalSnapshot,data:{source:U.Mutation,..._}})},ne=(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.Scroll,..._}}),se=(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.CanvasMutation,..._}}),te=new bn({mutationCb:R,adoptedStyleSheetCb:(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.AdoptedStyleSheet,..._}})}),de=new fn({mirror:pe,mutationCb:R,stylesheetManager:te,recordCrossOriginIframes:x,wrappedEmit:Q});for(let _ of D||[])if(_.getMirror)_.getMirror({nodeMirror:pe,crossOriginIframeMirror:de.crossOriginIframeMirror,crossOriginIframeStyleMirror:de.crossOriginIframeStyleMirror});let xe=new vn;Rr=new wn({recordCanvas:S,mutationCb:se,win:window,blockClass:a,blockSelector:u,mirror:pe,sampling:b.canvas,dataURLOptions:v});let ve=new dn({mutationCb:R,scrollCb:ne,bypassOptions:{blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:i,inlineStylesheet:d,maskInputOptions:I,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:S,inlineImages:k,sampling:b,slimDOMOptions:P,iframeManager:de,stylesheetManager:te,canvasManager:Rr,keepIframeSrcFn:E,processedNodeManager:xe},mirror:pe});tt=(_=!1)=>{if(!y)return;Q({type:z.Meta,data:{href:window.location.href,width:Qi(),height:Xi()}},_),te.reset(),ve.init(),Me.forEach((j)=>j.lock());let K=xo(document,{mirror:pe,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:i,inlineStylesheet:d,maskAllInputs:I,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:v,recordCanvas:S,inlineImages:k,onSerialize:(j)=>{if(en(j,pe))de.addIframe(j);if(tn(j,pe))te.trackLinkElement(j);if(Ir(j))ve.addShadowRoot(L.shadowRoot(j),document)},onIframeLoad:(j,X)=>{de.attachIframe(j,X),ve.observeAttachShadow(j)},onStylesheetLoad:(j,X)=>{te.attachLinkElement(j,X)},keepIframeSrcFn:E});if(!K)return console.warn("Failed to snapshot the document");if(Q({type:z.FullSnapshot,data:{node:K,initialOffset:Ji(window)}},_),Me.forEach((j)=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0)te.adoptStyleSheets(document.adoptedStyleSheets,pe.getId(document))};try{let _=[],K=(X)=>{var ue;return B(La)({mutationCb:R,mousemoveCb:(V,vt)=>Q({type:z.IncrementalSnapshot,data:{source:vt,positions:V}}),mouseInteractionCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.MouseInteraction,...V}}),scrollCb:ne,viewportResizeCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.ViewportResize,...V}}),inputCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.Input,...V}}),mediaInteractionCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.MediaInteraction,...V}}),styleSheetRuleCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.StyleSheetRule,...V}}),styleDeclarationCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.StyleDeclaration,...V}}),canvasMutationCb:se,fontCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.Font,...V}}),selectionCb:(V)=>{Q({type:z.IncrementalSnapshot,data:{source:U.Selection,...V}})},customElementCb:(V)=>{Q({type:z.IncrementalSnapshot,data:{source:U.CustomElement,...V}})},blockClass:a,ignoreClass:p,ignoreSelector:l,maskTextClass:c,maskTextSelector:i,maskInputOptions:I,inlineStylesheet:d,sampling:b,recordDOM:y,recordCanvas:S,inlineImages:k,userTriggeredOnInput:A,collectFonts:M,doc:X,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:E,blockSelector:u,slimDOMOptions:P,dataURLOptions:v,mirror:pe,iframeManager:de,stylesheetManager:te,shadowDomManager:ve,processedNodeManager:xe,canvasManager:Rr,ignoreCSSAttributes:Z,plugins:((ue=D==null?void 0:D.filter((V)=>V.observer))==null?void 0:ue.map((V)=>({observer:V.observer,options:V.options,callback:(vt)=>Q({type:z.Plugin,data:{plugin:V.name,payload:vt}})})))||[]},w)};de.addLoadListener((X)=>{try{_.push(K(X.contentDocument))}catch(ue){console.warn(ue)}});let j=()=>{tt(),_.push(K(document)),lt=!0};if(["interactive","complete"].includes(document.readyState))j();else _.push(oe("DOMContentLoaded",()=>{if(Q({type:z.DomContentLoaded,data:{}}),N==="DOMContentLoaded")j()})),_.push(oe("load",()=>{if(Q({type:z.Load,data:{}}),N==="load")j()},window));return()=>{_.forEach((X)=>{try{X()}catch(ue){if(!String(ue).toLowerCase().includes("cross-origin"))console.warn(ue)}}),xe.destroy(),lt=!1,Ea()}}catch(_){console.warn(_)}}ye.addCustomEvent=(e,t)=>{if(!lt)throw Error("please add custom event after start recording");Q({type:z.Custom,data:{tag:e,payload:t}})};ye.freezePage=()=>{Me.forEach((e)=>e.freeze())};ye.takeFullSnapshot=(e)=>{if(!lt)throw Error("please take full snapshot after start recording");tt(e)};ye.mirror=pe;/*! ***************************************************************************** +`,vi=typeof self<"u"&&self.Blob&&new Blob([bn],{type:"text/javascript;charset=utf-8"});function ja(e){let t;try{if(t=vi&&(self.URL||self.webkitURL).createObjectURL(vi),!t)throw"";let o=new Worker(t,{name:e==null?void 0:e.name});return o.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),o}catch(o){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bn),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class vn{constructor(e){O(this,"pendingCanvasMutations",new Map),O(this,"rafStamps",{latestId:0,invokeId:null}),O(this,"mirror"),O(this,"mutationCb"),O(this,"resetObservers"),O(this,"frozen",!1),O(this,"locked",!1),O(this,"processMutation",(l,c)=>{if(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)this.rafStamps.invokeId=this.rafStamps.latestId;if(!this.pendingCanvasMutations.has(l))this.pendingCanvasMutations.set(l,[]);this.pendingCanvasMutations.get(l).push(c)});let{sampling:t="all",win:o,blockClass:r,blockSelector:a,recordCanvas:u,dataURLOptions:p}=e;if(this.mutationCb=e.mutationCb,this.mirror=e.mirror,u&&t==="all")this.initCanvasMutationObserver(o,r,a);if(u&&typeof t==="number")this.initCanvasFPSObserver(t,o,r,a,{dataURLOptions:p})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,o,r,a){let u=wi(t,o,r,!0),p=new Map,l=new ja;l.onmessage=(h)=>{let{id:f}=h.data;if(p.set(f,!1),!("base64"in h.data))return;let{base64:m,type:w,width:C,height:b}=h.data;this.mutationCb({id:f,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,C,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:w}]},0,0]}]})};let c=1000/e,i=0,d,n=()=>{let h=[];return t.document.querySelectorAll("canvas").forEach((f)=>{if(!ae(f,o,r,!0))h.push(f)}),h},s=(h)=>{if(i&&h-i{var m;let w=this.mirror.getId(f);if(p.get(w))return;if(f.width===0||f.height===0)return;if(p.set(w,!0),["webgl","webgl2"].includes(f.__context)){let b=f.getContext(f.__context);if(((m=b==null?void 0:b.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1)b.clear(b.COLOR_BUFFER_BIT)}let C=await createImageBitmap(f);l.postMessage({id:w,bitmap:C,width:f.width,height:f.height,dataURLOptions:a.dataURLOptions},[C])}),d=requestAnimationFrame(s)};d=requestAnimationFrame(s),this.resetObservers=()=>{u(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,o){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=wi(e,t,o,!1),a=Wa(this.processMutation.bind(this),e,t,o),u=qa(this.processMutation.bind(this),e,t,o);this.resetObservers=()=>{r(),a(),u()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=(t)=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let o=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,o)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let o=this.pendingCanvasMutations.get(e);if(!o||t===-1)return;let r=o.map((u)=>{let{type:p,...l}=u;return l}),{type:a}=o[0];this.mutationCb({id:t,type:a,commands:r}),this.pendingCanvasMutations.delete(e)}}class Sn{constructor(e){O(this,"trackedLinkElements",new WeakSet),O(this,"mutationCb"),O(this,"adoptedStyleSheetCb"),O(this,"styleMirror",new nn),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){if("_cssText"in t.attributes)this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]});this.trackLinkElement(e)}trackLinkElement(e){if(this.trackedLinkElements.has(e))return;this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e)}adoptStyleSheets(e,t){if(e.length===0)return;let o={id:t,styleIds:[]},r=[];for(let a of e){let u;if(!this.styleMirror.has(a))u=this.styleMirror.add(a),r.push({styleId:u,rules:Array.from(a.rules||CSSRule,(p,l)=>({rule:Ri(p,a.href),index:l}))});else u=this.styleMirror.getId(a);o.styleIds.push(u)}if(r.length>0)o.styles=r;this.adoptedStyleSheetCb(o)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Cn{constructor(){O(this,"nodeMap",new WeakMap),O(this,"active",!1)}inOtherBuffer(e,t){let o=this.nodeMap.get(e);return o&&Array.from(o).some((r)=>r!==t)}add(e,t){if(!this.active)this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1});this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Q,rt,Nr,ut=!1;try{if(Array.from([1],(e)=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((es=e.contentWindow)==null?void 0:es.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var pe=Zn();function ye(e={}){let{emit:t,checkoutEveryNms:o,checkoutEveryNth:r,blockClass:a="rr-block",blockSelector:u=null,ignoreClass:p="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:i=null,inlineStylesheet:d=!0,maskAllInputs:n,maskInputOptions:s,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:w,packFn:C,sampling:b={},dataURLOptions:v={},mousemoveWait:g,recordDOM:y=!0,recordCanvas:S=!1,recordCrossOriginIframes:x=!1,recordAfter:N=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:A=!1,collectFonts:M=!1,inlineImages:k=!1,plugins:D,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:Z=new Set([]),errorHandler:re}=e;Ea(re);let q=x?window.parent===window:!0,W=!1;if(!q)try{if(window.parent.document)W=!1}catch(_){W=!0}if(q&&!t)throw Error("emit function is required");if(!q&&!W)return()=>{};if(g!==void 0&&b.mousemove===void 0)b.mousemove=g;pe.reset();let I=n===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:s!==void 0?s:{password:!0},P=_i(h);ba();let F,T=0,J=(_)=>{for(let K of D||[])if(K.eventProcessor)_=K.eventProcessor(_);if(C&&!W)_=C(_);return _};Q=(_,K)=>{var j;let X=_;if(X.timestamp=$e(),((j=Me[0])==null?void 0:j.isFrozen())&&X.type!==z.FullSnapshot&&!(X.type===z.IncrementalSnapshot&&X.data.source===U.Mutation))Me.forEach((ue)=>ue.unfreeze());if(q)t==null||t(J(X),K);else if(W){let ue={type:"rrweb",event:J(X),origin:window.location.origin,isCheckout:K};window.parent.postMessage(ue,"*")}if(X.type===z.FullSnapshot)F=X,T=0;else if(X.type===z.IncrementalSnapshot){if(X.data.source===U.Mutation&&X.data.isAttachIframe)return;T++;let ue=r&&T>=r,V=o&&X.timestamp-F.timestamp>o;if(ue||V)rt(!0)}};let R=(_)=>{Q({type:z.IncrementalSnapshot,data:{source:U.Mutation,..._}})},ne=(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.Scroll,..._}}),se=(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.CanvasMutation,..._}}),te=new Sn({mutationCb:R,adoptedStyleSheetCb:(_)=>Q({type:z.IncrementalSnapshot,data:{source:U.AdoptedStyleSheet,..._}})}),de=new pn({mirror:pe,mutationCb:R,stylesheetManager:te,recordCrossOriginIframes:x,wrappedEmit:Q});for(let _ of D||[])if(_.getMirror)_.getMirror({nodeMirror:pe,crossOriginIframeMirror:de.crossOriginIframeMirror,crossOriginIframeStyleMirror:de.crossOriginIframeStyleMirror});let xe=new Cn;Nr=new vn({recordCanvas:S,mutationCb:se,win:window,blockClass:a,blockSelector:u,mirror:pe,sampling:b.canvas,dataURLOptions:v});let ve=new mn({mutationCb:R,scrollCb:ne,bypassOptions:{blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:i,inlineStylesheet:d,maskInputOptions:I,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:S,inlineImages:k,sampling:b,slimDOMOptions:P,iframeManager:de,stylesheetManager:te,canvasManager:Nr,keepIframeSrcFn:E,processedNodeManager:xe},mirror:pe});rt=(_=!1)=>{if(!y)return;Q({type:z.Meta,data:{href:window.location.href,width:Ki(),height:Zi()}},_),te.reset(),ve.init(),Me.forEach((j)=>j.lock());let K=Mo(document,{mirror:pe,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:i,inlineStylesheet:d,maskAllInputs:I,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:v,recordCanvas:S,inlineImages:k,onSerialize:(j)=>{if(rn(j,pe))de.addIframe(j);if(sn(j,pe))te.trackLinkElement(j);if(Ar(j))ve.addShadowRoot(L.shadowRoot(j),document)},onIframeLoad:(j,X)=>{de.attachIframe(j,X),ve.observeAttachShadow(j)},onStylesheetLoad:(j,X)=>{te.attachLinkElement(j,X)},keepIframeSrcFn:E});if(!K)return console.warn("Failed to snapshot the document");if(Q({type:z.FullSnapshot,data:{node:K,initialOffset:Qi(window)}},_),Me.forEach((j)=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0)te.adoptStyleSheets(document.adoptedStyleSheets,pe.getId(document))};try{let _=[],K=(X)=>{var ue;return B(Fa)({mutationCb:R,mousemoveCb:(V,St)=>Q({type:z.IncrementalSnapshot,data:{source:St,positions:V}}),mouseInteractionCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.MouseInteraction,...V}}),scrollCb:ne,viewportResizeCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.ViewportResize,...V}}),inputCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.Input,...V}}),mediaInteractionCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.MediaInteraction,...V}}),styleSheetRuleCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.StyleSheetRule,...V}}),styleDeclarationCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.StyleDeclaration,...V}}),canvasMutationCb:se,fontCb:(V)=>Q({type:z.IncrementalSnapshot,data:{source:U.Font,...V}}),selectionCb:(V)=>{Q({type:z.IncrementalSnapshot,data:{source:U.Selection,...V}})},customElementCb:(V)=>{Q({type:z.IncrementalSnapshot,data:{source:U.CustomElement,...V}})},blockClass:a,ignoreClass:p,ignoreSelector:l,maskTextClass:c,maskTextSelector:i,maskInputOptions:I,inlineStylesheet:d,sampling:b,recordDOM:y,recordCanvas:S,inlineImages:k,userTriggeredOnInput:A,collectFonts:M,doc:X,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:E,blockSelector:u,slimDOMOptions:P,dataURLOptions:v,mirror:pe,iframeManager:de,stylesheetManager:te,shadowDomManager:ve,processedNodeManager:xe,canvasManager:Nr,ignoreCSSAttributes:Z,plugins:((ue=D==null?void 0:D.filter((V)=>V.observer))==null?void 0:ue.map((V)=>({observer:V.observer,options:V.options,callback:(St)=>Q({type:z.Plugin,data:{plugin:V.name,payload:St}})})))||[]},w)};de.addLoadListener((X)=>{try{_.push(K(X.contentDocument))}catch(ue){console.warn(ue)}});let j=()=>{rt(),_.push(K(document)),ut=!0};if(["interactive","complete"].includes(document.readyState))j();else _.push(oe("DOMContentLoaded",()=>{if(Q({type:z.DomContentLoaded,data:{}}),N==="DOMContentLoaded")j()})),_.push(oe("load",()=>{if(Q({type:z.Load,data:{}}),N==="load")j()},window));return()=>{_.forEach((X)=>{try{X()}catch(ue){if(!String(ue).toLowerCase().includes("cross-origin"))console.warn(ue)}}),xe.destroy(),ut=!1,xa()}}catch(_){console.warn(_)}}ye.addCustomEvent=(e,t)=>{if(!ut)throw Error("please add custom event after start recording");Q({type:z.Custom,data:{tag:e,payload:t}})};ye.freezePage=()=>{Me.forEach((e)=>e.freeze())};ye.takeFullSnapshot=(e)=>{if(!ut)throw Error("please take full snapshot after start recording");rt(e)};ye.mirror=pe;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -144,6 +144,6 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var bi;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(bi||(bi={}));var{addCustomEvent:Ja}=ye,{freezePage:Xa}=ye,{takeFullSnapshot:Qa}=ye;var Qr=window.supermetry,Sn=Qr?._replay;if(Qr&&Sn)ja(Qr,Sn);async function ja(e,t){if(!be(e))return;let o;try{o=await fetch(t.o+"/api/replay/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({s:t.s,u:location.href,c:!!e._replayConsent})})}catch{e._replay=void 0;return}if(!o.ok){e._replay=void 0;return}let r=await o.json();if(r.m==="off")return;if(!be(e)){e._replay=void 0;return}t.v=r.v;let a=r.m,u=0,p=!0,l=!1,c=0,i=[],d=0,n=Date.now(),s=[[]],h=[0],f=n,m,w=!1,C=Promise.resolve(),b=!1,v,g=n,y=Promise.resolve(),S=new Set,x=(I,P)=>{let F=P,T=F.type==="password"||F.type==="hidden"||(F.autocomplete||"").toLowerCase().startsWith("cc-");return r.mask||T?"*".repeat(I.length):I},N;if(N=ye({emit(I){if(l||!be(e))return;y=y.then(async()=>{if(b||!be(e))return;if(await Va(I,S,t,e,()=>!b&&be(e)),b||!be(e))return;A(I)})},sampling:{mousemove:100,scroll:150,input:"last"},recordCanvas:!1,inlineImages:!1,collectFonts:!1,checkoutEveryNms:300000,maskAllInputs:r.mask,maskTextSelector:r.mask?"*":void 0,maskInputOptions:{color:!0,date:!0,"datetime-local":!0,email:!0,hidden:!0,month:!0,number:!0,password:!0,range:!0,search:!0,select:!0,tel:!0,text:!0,textarea:!0,time:!0,url:!0,week:!0},maskInputFn:x}),l){N?.();return}function A(I){if(b||!be(e)){E(!1,!0);return}if(Date.now()-n>=1800000||Date.now()-g>=120000||c>=5242880){E(!0);return}let P=JSON.stringify(I).length+1;if(a==="trigger"){if(P>5242880){E(!1,!0);return}if(I.type===4)m=I;let F=h.reduce((T,J)=>T+J,0);if(!w&&(Date.now()-f>=60000||F+P>5242880)){if(w=!0,f=Date.now(),s.push([]),h.push(0),m)M({...m,timestamp:I.timestamp});ye.takeFullSnapshot(),w=!1;while(s.length>2||s.length>1&&h.reduce((T,J)=>T+J,0)>5242880)s.shift(),h.shift();if(h.reduce((T,J)=>T+J,0)>5242880)E(!1,!0);return}M(I,P);return}if(i.push(I),d+=P,d>=65536)k(!1)}function M(I,P=JSON.stringify(I).length+1){s[s.length-1].push(I),h[h.length-1]+=P}function k(I,P,F){let T=y,J=p;p=!1,C=Promise.all([C,T]).then(async()=>{let R=F??i;if(!F)i=[],d=0;if(!R.length)return;let ne=R.map((te)=>JSON.stringify(te)).join(` +***************************************************************************** */var Si;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Si||(Si={}));var{addCustomEvent:Xa}=ye,{freezePage:Qa}=ye,{takeFullSnapshot:Za}=ye;var Zr=window.supermetry,Ve=Zr?._replay,Kr=(e,t)=>Ve?.p?Ve.p+t:Ve?.o+e;if(Zr&&Ve)Va(Zr,Ve);async function Va(e,t){if(!be(e))return;let o;try{o=await fetch(Kr("/api/replay/start","/s"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({s:t.s,u:location.href,c:!!e._replayConsent})})}catch{e._replay=void 0;return}if(!o.ok){e._replay=void 0;return}let r=await o.json();if(r.m==="off")return;if(!be(e)){e._replay=void 0;return}t.v=r.v;let a=r.m,u=0,p=!0,l=!1,c=0,i=[],d=0,n=Date.now(),s=[[]],h=[0],f=n,m,w=!1,C=Promise.resolve(),b=!1,v,g=n,y=Promise.resolve(),S=new Set,x=(I,P)=>{let F=P,T=F.type==="password"||F.type==="hidden"||(F.autocomplete||"").toLowerCase().startsWith("cc-");return r.mask||T?"*".repeat(I.length):I},N;if(N=ye({emit(I){if(l||!be(e))return;y=y.then(async()=>{if(b||!be(e))return;if(await Ga(I,S,t,e,()=>!b&&be(e)),b||!be(e))return;A(I)})},sampling:{mousemove:100,scroll:150,input:"last"},recordCanvas:!1,inlineImages:!1,collectFonts:!1,checkoutEveryNms:300000,maskAllInputs:r.mask,maskTextSelector:r.mask?"*":void 0,maskInputOptions:{color:!0,date:!0,"datetime-local":!0,email:!0,hidden:!0,month:!0,number:!0,password:!0,range:!0,search:!0,select:!0,tel:!0,text:!0,textarea:!0,time:!0,url:!0,week:!0},maskInputFn:x}),l){N?.();return}function A(I){if(b||!be(e)){E(!1,!0);return}if(Date.now()-n>=1800000||Date.now()-g>=120000||c>=5242880){E(!0);return}let P=JSON.stringify(I).length+1;if(a==="trigger"){if(P>5242880){E(!1,!0);return}if(I.type===4)m=I;let F=h.reduce((T,J)=>T+J,0);if(!w&&(Date.now()-f>=60000||F+P>5242880)){if(w=!0,f=Date.now(),s.push([]),h.push(0),m)M({...m,timestamp:I.timestamp});ye.takeFullSnapshot(),w=!1;while(s.length>2||s.length>1&&h.reduce((T,J)=>T+J,0)>5242880)s.shift(),h.shift();if(h.reduce((T,J)=>T+J,0)>5242880)E(!1,!0);return}M(I,P);return}if(i.push(I),d+=P,d>=65536)k(!1)}function M(I,P=JSON.stringify(I).length+1){s[s.length-1].push(I),h[h.length-1]+=P}function k(I,P,F){let T=y,J=p;p=!1,C=Promise.all([C,T]).then(async()=>{let R=F??i;if(!F)i=[],d=0;if(!R.length)return;let ne=R.map((te)=>JSON.stringify(te)).join(` `)+` -`,se=await Cn(ne);if(b||!be(e))return;if(c+se.byteLength>5242880){E(!1,!0);return}let Ee=new URLSearchParams({s:t.s,q:String(u++),p:J?"1":"0",c:e._replayConsent?"1":"0",v:r.v});if(P)Ee.set("t",P);c+=se.byteLength,await fetch(t.o+"/api/replay/chunk?"+Ee,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:se,keepalive:I}).catch(()=>{return})})}function D(I,P,F){let T=[],J=0;for(let R of I){let ne=JSON.stringify(R).length+1;if(T.length&&J+ne>65536)k(P,F,T),F=void 0,T=[],J=0;T.push(R),J+=ne}k(P,F,T)}function E(I,P=!1){if(P)b=!0,i=[],d=0,s=[[]],h=[0];if(l)return;if(I&&a==="full")k(!0);if(P)b=!0;if(l=!0,P)i=[],d=0;if(s=[[]],h=[0],N?.(),v)clearInterval(v);if(P)e._replay=void 0,e._replayStop=void 0}function Z(I="manual"){if(!be(e)){E(!1,!0);return}if(l||a!=="trigger")return;let P=s.flat();s=[[]],h=[0],a="full",D(P,!1,I)}if(e.replay={trigger:(I)=>{if(r.t.x)Z(I)}},e._replayStop=()=>E(!1,!0),e._replayTrigger&&r.t.x)Z(e._replayTrigger);if(r.t.e)addEventListener("error",()=>Z("error")),addEventListener("unhandledrejection",()=>Z("error"));if(r.t.r){let I=[];addEventListener("click",(P)=>{g=Date.now(),I.push({x:P.clientX,y:P.clientY,at:g});while(I.length&&g-I[0].at>1000)I.shift();if(I.length>=3){let F=I[I.length-3];if(I.slice(-3).every((J)=>Math.hypot(J.x-F.x,J.y-F.y)<=30))Z("rage-click")}},{passive:!0})}for(let I of["pointerdown","keydown","scroll"])addEventListener(I,()=>{g=Date.now()},{passive:!0});let re=()=>r.t.u.some((I)=>Ha(I).test(location.href));if(re())Z("url");let q=location.href,W=()=>{if(l)return;if(location.href===q)return;if(a==="full")k(!1);if(p=!0,q=location.href,ye.takeFullSnapshot(),re())Z("url")};for(let I of["pushState","replaceState"]){let P=history[I];history[I]=function(...F){let T=P.apply(history,F);return W(),T}}addEventListener("popstate",W),v=setInterval(()=>{if(Date.now()-n>=1800000||Date.now()-g>=120000){E(!0);return}k(!1)},1e4),document.addEventListener("visibilitychange",()=>{if(document.hidden&&a==="full")k(!0)}),addEventListener("pagehide",()=>{if(a==="trigger"){E(!1);return}k(!0),E(!1)},{once:!0})}async function Cn(e){let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())}async function Va(e,t,o,r,a){if(e.type!==2)return;let u=e.data.node;if(!u)return;let p=[u];while(p.length){let l=p.pop();if(l.childNodes)p.push(...l.childNodes);let c=l.attributes?._cssText;if(typeof c!=="string"||c.length<=1024)continue;try{let i=await Ga(c);if(!t.has(i)){let d=await Cn(c);if(!a())return;if(!(await fetch(o.o+"/api/replay/css/"+i+"?s="+encodeURIComponent(o.s)+"&c="+(r._replayConsent?"1":"0")+"&v="+encodeURIComponent(o.v||""),{method:"PUT",headers:{"Content-Type":"application/gzip"},body:d})).ok)continue;t.add(i)}l.attributes._cssRef=i,delete l.attributes._cssText}catch{}}}async function Ga(e){let t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),(o)=>o.toString(16).padStart(2,"0")).join("")}function Ha(e){let t=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp("^"+t+"$")}function be(e){return!e._replayDenied&&!navigator.globalPrivacyControl&&navigator.doNotTrack!=="1"&&(e._allowed?.()??!0)}})(); +`,se=await En(ne);if(b||!be(e))return;if(c+se.byteLength>5242880){E(!1,!0);return}let Ee=new URLSearchParams({s:t.s,q:String(u++),p:J?"1":"0",c:e._replayConsent?"1":"0",v:r.v});if(P)Ee.set("t",P);c+=se.byteLength,await fetch(Kr("/api/replay/chunk","/c")+"?"+Ee,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:se,keepalive:I}).catch(()=>{return})})}function D(I,P,F){let T=[],J=0;for(let R of I){let ne=JSON.stringify(R).length+1;if(T.length&&J+ne>65536)k(P,F,T),F=void 0,T=[],J=0;T.push(R),J+=ne}k(P,F,T)}function E(I,P=!1){if(P)b=!0,i=[],d=0,s=[[]],h=[0];if(l)return;if(I&&a==="full")k(!0);if(P)b=!0;if(l=!0,P)i=[],d=0;if(s=[[]],h=[0],N?.(),v)clearInterval(v);if(P)e._replay=void 0,e._replayStop=void 0}function Z(I="manual"){if(!be(e)){E(!1,!0);return}if(l||a!=="trigger")return;let P=s.flat();s=[[]],h=[0],a="full",D(P,!1,I)}if(e.replay={trigger:(I)=>{if(r.t.x)Z(I)}},e._replayStop=()=>E(!1,!0),e._replayTrigger&&r.t.x)Z(e._replayTrigger);if(r.t.e)addEventListener("error",()=>Z("error")),addEventListener("unhandledrejection",()=>Z("error"));if(r.t.r){let I=[];addEventListener("click",(P)=>{g=Date.now(),I.push({x:P.clientX,y:P.clientY,at:g});while(I.length&&g-I[0].at>1000)I.shift();if(I.length>=3){let F=I[I.length-3];if(I.slice(-3).every((J)=>Math.hypot(J.x-F.x,J.y-F.y)<=30))Z("rage-click")}},{passive:!0})}for(let I of["pointerdown","keydown","scroll"])addEventListener(I,()=>{g=Date.now()},{passive:!0});let re=()=>r.t.u.some((I)=>Ya(I).test(location.href));if(re())Z("url");let q=location.href,W=()=>{if(l)return;if(location.href===q)return;if(a==="full")k(!1);if(p=!0,q=location.href,ye.takeFullSnapshot(),re())Z("url")};for(let I of["pushState","replaceState"]){let P=history[I];history[I]=function(...F){let T=P.apply(history,F);return W(),T}}addEventListener("popstate",W),v=setInterval(()=>{if(Date.now()-n>=1800000||Date.now()-g>=120000){E(!0);return}k(!1)},1e4),document.addEventListener("visibilitychange",()=>{if(document.hidden&&a==="full")k(!0)}),addEventListener("pagehide",()=>{if(a==="trigger"){E(!1);return}k(!0),E(!1)},{once:!0})}async function En(e){let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())}async function Ga(e,t,o,r,a){if(e.type!==2)return;let u=e.data.node;if(!u)return;let p=[u];while(p.length){let l=p.pop();if(l.childNodes)p.push(...l.childNodes);let c=l.attributes?._cssText;if(typeof c!=="string"||c.length<=1024)continue;try{let i=await Ha(c);if(!t.has(i)){let d=await En(c);if(!a())return;if(!(await fetch(Kr("/api/replay/css/","/k/")+i+"?s="+encodeURIComponent(o.s)+"&c="+(r._replayConsent?"1":"0")+"&v="+encodeURIComponent(o.v||""),{method:"PUT",headers:{"Content-Type":"application/gzip"},body:d})).ok)continue;t.add(i)}l.attributes._cssRef=i,delete l.attributes._cssText}catch{}}}async function Ha(e){let t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),(o)=>o.toString(16).padStart(2,"0")).join("")}function Ya(e){let t=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replaceAll("*",".*");return new RegExp("^"+t+"$")}function be(e){return!e._replayDenied&&!navigator.globalPrivacyControl&&navigator.doNotTrack!=="1"&&(e._allowed?.()??!0)}})(); diff --git a/internal/replay/static/src/replay.ts b/internal/replay/static/src/replay.ts index 9370feca..86e39333 100644 --- a/internal/replay/static/src/replay.ts +++ b/internal/replay/static/src/replay.ts @@ -3,6 +3,9 @@ import { record, type eventWithTime } from "rrweb"; type ReplayConfig = { s: string; o: string; + // Neutral base (/e/) when the tracker posts to the site's + // neutral path; uploads then avoid the classic "replay" URLs. + p?: string; v?: string; }; @@ -29,6 +32,7 @@ declare global { const supermetry = window.supermetry; const config = supermetry?._replay; +const endpoint = (classic: string, neutral: string) => (config?.p ? config.p + neutral : config?.o + classic); if (supermetry && config) void start(supermetry, config); @@ -36,7 +40,7 @@ async function start(supermetry: NonNullable, config: Repl if (!allowed(supermetry)) return; let response: Response; try { - response = await fetch(config.o + "/api/replay/start", { + response = await fetch(endpoint("/api/replay/start", "/s"), { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ s: config.s, u: location.href, c: !!supermetry._replayConsent }), @@ -186,7 +190,7 @@ async function start(supermetry: NonNullable, config: Repl }); if (trigger) query.set("t", trigger); totalBytes += compressed.byteLength; - await fetch(config.o + "/api/replay/chunk?" + query, { + await fetch(endpoint("/api/replay/chunk", "/c") + "?" + query, { method: "POST", headers: { "Content-Type": "application/octet-stream" }, body: compressed, @@ -334,7 +338,7 @@ async function deduplicateSnapshotCSS(event: eventWithTime, sent: Set, c if (!sent.has(hash)) { const body = await gzip(css); if (!canUpload()) return; - const response = await fetch(config.o + "/api/replay/css/" + hash + "?s=" + encodeURIComponent(config.s) + "&c=" + (supermetry._replayConsent ? "1" : "0") + "&v=" + encodeURIComponent(config.v || ""), { + const response = await fetch(endpoint("/api/replay/css/", "/k/") + hash + "?s=" + encodeURIComponent(config.s) + "&c=" + (supermetry._replayConsent ? "1" : "0") + "&v=" + encodeURIComponent(config.v || ""), { method: "PUT", headers: { "Content-Type": "application/gzip" }, body, diff --git a/internal/tracker/script.go b/internal/tracker/script.go index 77a7b79f..587735a5 100644 --- a/internal/tracker/script.go +++ b/internal/tracker/script.go @@ -82,8 +82,35 @@ func buildScript(publicID string, settings sites.TrackerSettings, replaySettings return Script{Body: body, ETag: etag} } +// moduleCodes are the short names the lazy-module loader puts in ?m=, so the +// script URL never spells out a module name a filter list could match. +var moduleCodes = map[string]string{"vitals": "v", "heatmap": "h", "replay": "r"} + func moduleLoader(names string) []byte { - return []byte(`(()=>{var s=document.currentScript.cloneNode(),u=new URL(s.src);u.searchParams.set("module",` + strconv.Quote(names) + `);s.src=u;document.head.appendChild(s)})()`) + codes := strings.Split(names, ",") + for index, name := range codes { + codes[index] = moduleCodes[name] + } + return []byte(`(()=>{var s=document.currentScript.cloneNode(),u=new URL(s.src);u.searchParams.set("m",` + strconv.Quote(strings.Join(codes, ",")) + `);s.src=u;document.head.appendChild(s)})()`) +} + +// moduleNames turns ?m= codes back into module names; ok is false for an +// unknown code. +func moduleNames(codes string) (string, bool) { + names := strings.Split(codes, ",") + for index, code := range names { + found := false + for name, short := range moduleCodes { + if short == code { + names[index], found = name, true + break + } + } + if !found { + return "", false + } + } + return strings.Join(names, ","), true } func buildModuleScript(names string, settings sites.TrackerSettings, replaySettings replay.SiteSettings) (Script, bool) { @@ -144,6 +171,23 @@ func SetEventPath(p string) { eventPath.Store(p) } +var neutralBase atomic.Value // string + +// SetNeutralBase sets the Supermetry base URL (SUPERMETRY_BASE_URL) that +// per-site scripts compare their own URL with. A script loaded directly from +// "