From 9b197abcfa3a8f5e7c2aa72735e8bd0e82d8d595 Mon Sep 17 00:00:00 2001 From: zias Date: Tue, 31 Mar 2026 15:50:54 +0200 Subject: [PATCH] chore:little fixes and formating and linting and patches --- .zed/settings.json | 2 +- admin/src/cli.ts | 2 +- admin/src/commands/clear-cache.ts | 14 +- admin/src/commands/delete-organization.ts | 30 +- admin/src/commands/delete-user.ts | 34 +- admin/src/commands/lookup-client.ts | 3 +- admin/src/commands/lookup-email.ts | 7 +- admin/src/commands/lookup-org.ts | 3 +- admin/src/commands/lookup-project.ts | 3 +- admin/src/utils/display.ts | 32 +- admin/tsconfig.json | 5 +- apps/api/package.json | 2 +- apps/api/scripts/get-bots.ts | 12 +- apps/api/scripts/mock.ts | 12 +- apps/api/scripts/test-manage-api.ts | 80 +- apps/api/scripts/test.ts | 9 +- apps/api/src/controllers/ai.controller.ts | 12 +- apps/api/src/controllers/error.html | 47 +- apps/api/src/controllers/export.controller.ts | 30 +- apps/api/src/controllers/import.controller.ts | 7 +- .../src/controllers/insights.controller.ts | 30 +- apps/api/src/controllers/misc.controller.ts | 55 +- .../api/src/controllers/profile.controller.ts | 19 +- .../api/src/controllers/webhook.controller.ts | 20 +- apps/api/src/hooks/client.hook.ts | 4 +- apps/api/src/hooks/request-id.hook.ts | 6 +- apps/api/src/routes/ai.router.ts | 2 +- apps/api/src/routes/event.router.ts | 3 +- apps/api/src/routes/export.router.ts | 4 +- apps/api/src/routes/gsc-callback.router.ts | 2 +- apps/api/src/routes/import.router.ts | 5 +- apps/api/src/routes/insights.router.ts | 4 +- apps/api/src/routes/live.router.ts | 10 +- apps/api/src/routes/manage.router.ts | 4 +- apps/api/src/routes/misc.router.ts | 2 +- apps/api/src/routes/oauth-callback.router.ts | 2 +- apps/api/src/routes/profile.router.ts | 2 +- apps/api/src/routes/webhook.router.ts | 2 +- apps/api/src/utils/ai-tools.ts | 53 +- apps/api/src/utils/ai.ts | 6 +- apps/api/src/utils/auth.ts | 36 +- apps/api/src/utils/deduplicate.ts | 4 +- apps/api/src/utils/errors.ts | 4 +- apps/api/src/utils/graceful-shutdown.ts | 4 +- apps/api/src/utils/parse-zod-query-string.ts | 17 +- apps/api/src/utils/parseUrlMeta.ts | 2 +- apps/api/tsdown.config.ts | 2 +- apps/justfuckinguseopenpanel/index.html | 798 +- apps/justfuckinguseopenpanel/wrangler.jsonc | 2 +- .../components/sections/supporter-perks.tsx | 45 +- .../content/compare/ackee-alternative.json | 2 +- .../compare/amplitude-alternative.json | 9 +- .../compare/appsflyer-alternative.json | 2 +- .../compare/cabin-analytics-alternative.json | 2 +- .../content/compare/countly-alternative.json | 9 +- .../compare/crazy-egg-alternative.json | 6 +- apps/public/content/compare/ensure.ts | 12 +- .../content/compare/fathom-alternative.json | 9 +- .../compare/fullstory-alternative.json | 2 +- .../content/compare/funnelio-alternative.json | 2 +- .../compare/goatcounter-alternative.json | 2 +- .../compare/google-analytics-alternative.json | 2 +- .../content/compare/heap-alternative.json | 2 +- .../content/compare/matomo-alternative.json | 9 +- .../microsoft-clarity-alternative.json | 2 +- .../content/compare/mixpanel-alternative.json | 2 +- .../compare/mouseflow-alternative.json | 6 +- .../compare/pirsch-analytics-alternative.json | 2 +- .../compare/plausible-alternative.json | 2 +- .../compare/simple-analytics-alternative.json | 2 +- .../compare/smartlook-alternative.json | 2 +- .../content/compare/umami-alternative.json | 2 +- apps/public/content/docs/(tracking)/meta.json | 8 +- apps/public/content/docs/dashboard/meta.json | 7 +- apps/public/content/docs/meta.json | 2 +- .../content/docs/self-hosting/meta.json | 2 +- apps/public/content/features/conversion.json | 2 +- .../content/features/data-visualization.json | 2 +- .../content/features/event-tracking.json | 2 +- apps/public/content/features/funnels.json | 2 +- .../content/features/identify-users.json | 2 +- .../public/content/features/integrations.json | 2 +- .../content/features/notifications.json | 2 +- apps/public/content/features/retention.json | 7 +- .../content/features/revenue-tracking.json | 2 +- .../content/features/session-replay.json | 2 +- .../features/share-and-collaborate.json | 2 +- .../content/features/web-analytics.json | 2 +- apps/public/content/for/agencies.json | 30 +- apps/public/content/for/developers.json | 25 +- apps/public/content/for/nextjs.json | 10 +- apps/public/content/for/saas.json | 25 +- apps/public/content/for/shopify.json | 25 +- apps/public/content/for/startups.json | 35 +- apps/public/content/for/wordpress.json | 35 +- apps/public/package.json | 2 +- .../public/public/google30d28bbdbd56aa6e.html | 2 +- apps/public/public/op.js | 256 +- apps/public/public/op1-replay.js | 11610 +++++++++++++++- apps/public/public/op1.js | 495 +- apps/public/source.config.ts | 2 +- .../src/app/(content)/[...pages]/page.tsx | 12 +- .../(content)/articles/[articleSlug]/page.tsx | 67 +- .../src/app/(content)/articles/page.tsx | 22 +- .../[slug]/_components/benefits-section.tsx | 18 +- .../[slug]/_components/compare-hero.tsx | 18 +- .../[slug]/_components/compare-overview.tsx | 8 +- .../[slug]/_components/compare-toc.tsx | 18 +- .../[slug]/_components/comparison-table.tsx | 30 +- .../[slug]/_components/feature-comparison.tsx | 32 +- .../[slug]/_components/features-showcase.tsx | 23 +- .../[slug]/_components/highlights-grid.tsx | 19 +- .../[slug]/_components/migration-section.tsx | 46 +- .../[slug]/_components/pricing-comparison.tsx | 34 +- .../[slug]/_components/pricing-section.tsx | 103 +- .../[slug]/_components/problem-section.tsx | 25 +- .../[slug]/_components/related-links.tsx | 8 +- .../[slug]/_components/summary-comparison.tsx | 36 +- .../_components/technical-comparison.tsx | 22 +- .../[slug]/_components/trust-compliance.tsx | 50 +- .../compare/[slug]/_components/use-cases.tsx | 12 +- .../[slug]/_components/who-should-choose.tsx | 62 +- .../compare/[slug]/_components/why-switch.tsx | 27 +- .../compare/_components/compare-card.tsx | 22 +- .../public/src/app/(content)/compare/page.tsx | 28 +- .../[slug]/_components/capabilities.tsx | 20 +- .../[slug]/_components/feature-hero.tsx | 14 +- .../[slug]/_components/feature-use-cases.tsx | 14 +- .../[slug]/_components/how-it-works.tsx | 20 +- .../[slug]/_components/related-features.tsx | 28 +- .../[slug]/_components/what-it-is.tsx | 4 +- .../app/(content)/features/[slug]/page.tsx | 26 +- .../app/(content)/guides/[guideSlug]/page.tsx | 78 +- apps/public/src/app/(content)/guides/page.tsx | 30 +- apps/public/src/app/(content)/layout.tsx | 2 +- .../src/app/(content)/open-source/page.tsx | 138 +- .../public/src/app/(content)/pricing/page.tsx | 36 +- .../src/app/(content)/supporter/page.tsx | 76 +- .../(home)/_sections/collaboration-chart.tsx | 76 +- .../app/(home)/_sections/collaboration.tsx | 20 +- .../src/app/(home)/_sections/cta-banner.tsx | 31 +- apps/public/src/app/(home)/_sections/sdks.tsx | 14 +- .../src/app/(home)/_sections/testimonials.tsx | 28 +- apps/public/src/app/(home)/layout.tsx | 2 +- apps/public/src/app/(home)/page.tsx | 4 +- apps/public/src/app/api/headers/route.ts | 2 +- apps/public/src/app/api/search/route.ts | 2 +- .../src/app/api/tools/ip-lookup/route.ts | 32 +- .../src/app/api/tools/site-checker/route.ts | 66 +- apps/public/src/app/docs/[[...slug]]/page.tsx | 18 +- apps/public/src/app/docs/layout.tsx | 2 +- apps/public/src/app/dpa/download/page.tsx | 23 +- apps/public/src/app/global.css | 37 +- apps/public/src/app/llms-full.txt/route.ts | 11 +- apps/public/src/app/md/route.ts | 12 +- .../public/src/app/tools/ip-lookup/layout.tsx | 2 +- apps/public/src/app/tools/ip-lookup/page.tsx | 169 +- apps/public/src/app/tools/layout.tsx | 8 +- apps/public/src/app/tools/tools-sidebar.tsx | 16 +- apps/public/src/app/tools/tools.tsx | 8 +- .../src/app/tools/url-checker/layout.tsx | 2 +- .../public/src/app/tools/url-checker/page.tsx | 392 +- .../app/tools/url-checker/social-preview.tsx | 26 +- apps/public/src/components/article-card.tsx | 18 +- apps/public/src/components/competition.tsx | 12 +- apps/public/src/components/eu-flag.tsx | 2 +- apps/public/src/components/feature-card.tsx | 3 +- apps/public/src/components/figure.tsx | 17 +- apps/public/src/components/flow-step.tsx | 14 +- apps/public/src/components/github-button.tsx | 16 +- apps/public/src/components/guide-card.tsx | 22 +- .../components/illustrations/conversions.tsx | 6 +- .../illustrations/data-ownership.tsx | 32 +- .../src/components/illustrations/privacy.tsx | 45 +- .../illustrations/product-analytics.tsx | 30 +- .../components/illustrations/retention.tsx | 10 +- .../src/components/illustrations/revenue.tsx | 24 +- .../illustrations/session-replay.tsx | 20 +- .../illustrations/web-analytics.tsx | 34 +- .../src/components/infinite-moving-cards.tsx | 20 +- apps/public/src/components/logo.tsx | 18 +- apps/public/src/components/perks.tsx | 11 +- apps/public/src/components/pricing-slider.tsx | 15 +- apps/public/src/components/scroll-tracker.tsx | 3 +- apps/public/src/components/section.tsx | 10 +- apps/public/src/components/simple-chart.tsx | 8 +- apps/public/src/components/tag.tsx | 10 +- apps/public/src/components/toc.tsx | 8 +- apps/public/src/components/twitter-card.tsx | 19 +- apps/public/src/components/ui/accordion.tsx | 19 +- apps/public/src/components/ui/button.tsx | 9 +- apps/public/src/components/ui/input.tsx | 9 +- apps/public/src/components/ui/slider.tsx | 13 +- apps/public/src/components/ui/tooltip.tsx | 9 +- apps/public/src/components/window-image.tsx | 26 +- apps/public/src/lib/compare.ts | 4 +- apps/public/src/lib/dark-mode.ts | 4 +- apps/public/src/lib/features.ts | 12 +- apps/public/src/lib/github.ts | 2 +- apps/public/src/lib/metadata.ts | 9 +- apps/public/src/lib/source.ts | 2 +- apps/public/src/lib/utils.ts | 4 +- apps/public/src/mdx-components.tsx | 6 +- apps/public/src/middleware.ts | 2 +- apps/public/tsconfig.json | 20 +- apps/public/wrangler.jsonc | 4 +- apps/start/package.json | 3 +- apps/start/src/components/animate-height.tsx | 2 +- apps/start/src/components/auth/or.tsx | 2 +- .../components/auth/reset-password-form.tsx | 10 +- .../components/auth/share-enter-password.tsx | 10 +- .../components/auth/sign-in-email-form.tsx | 23 +- .../src/components/auth/sign-in-github.tsx | 32 +- .../components/auth/sign-up-email-form.tsx | 28 +- apps/start/src/components/card.tsx | 6 +- .../src/components/charts/chart-tooltip.tsx | 22 +- .../src/components/charts/common-bar.tsx | 23 +- apps/start/src/components/chat/chat-form.tsx | 24 +- .../src/components/chat/chat-message.tsx | 56 +- .../src/components/chat/chat-messages.tsx | 27 +- apps/start/src/components/chat/chat.tsx | 20 +- apps/start/src/components/click-to-copy.tsx | 5 +- .../clients/create-client-success.tsx | 9 +- apps/start/src/components/color-square.tsx | 4 +- .../src/components/column-created-at.tsx | 6 +- apps/start/src/components/delta-chip.tsx | 14 +- apps/start/src/components/dot.tsx | 10 +- .../src/components/events/event-icon.tsx | 7 +- .../src/components/events/table/item.tsx | 70 +- .../components/facehash/avatar-fallback.tsx | 18 +- .../src/components/facehash/avatar-image.tsx | 12 +- apps/start/src/components/facehash/avatar.tsx | 6 +- .../src/components/facehash/facehash.tsx | 64 +- apps/start/src/components/facehash/faces.tsx | 82 +- apps/start/src/components/facehash/index.ts | 11 +- apps/start/src/components/fade-in.tsx | 2 +- .../src/components/forms/checkbox-item.tsx | 21 +- .../start/src/components/forms/copy-input.tsx | 9 +- .../src/components/forms/input-with-label.tsx | 11 +- .../src/components/full-page-empty-state.tsx | 8 +- .../src/components/full-page-error-state.tsx | 9 +- .../components/full-page-loading-state.tsx | 8 +- .../src/components/full-width-navbar.tsx | 7 +- .../src/components/fullscreen-toggle.tsx | 23 +- apps/start/src/components/grafana-grid.tsx | 24 +- apps/start/src/components/grid-table.tsx | 6 +- .../components/groups/group-member-growth.tsx | 4 +- .../src/components/groups/table/columns.tsx | 12 +- .../src/components/groups/table/index.tsx | 13 +- .../src/components/insights/insight-card.tsx | 59 +- .../integrations/active-integrations.tsx | 25 +- .../integrations/all-integrations.tsx | 14 +- .../forms/discord-integration.tsx | 26 +- .../integrations/forms/slack-integration.tsx | 14 +- .../forms/webhook-integration.tsx | 77 +- .../integrations/integration-card.tsx | 22 +- .../components/integrations/integrations.tsx | 4 +- apps/start/src/components/json-editor.tsx | 44 +- apps/start/src/components/lazy-component.tsx | 4 +- apps/start/src/components/links.tsx | 8 +- .../start/src/components/login-left-panel.tsx | 24 +- apps/start/src/components/logo.tsx | 6 +- apps/start/src/components/markdown.tsx | 4 +- apps/start/src/components/mock-event-list.tsx | 15 +- .../notifications/notification-provider.tsx | 12 +- .../notifications/notification-rules.tsx | 16 +- .../notifications/notifications.tsx | 6 +- .../components/notifications/rule-card.tsx | 43 +- .../notifications/table/columns.tsx | 9 +- .../components/notifications/table/index.tsx | 5 +- .../src/components/onboarding-left-panel.tsx | 26 +- .../components/onboarding/skip-onboarding.tsx | 19 +- .../start/src/components/onboarding/steps.tsx | 18 +- .../organization/edit-organization.tsx | 31 +- .../components/organization/organization.tsx | 2 +- .../components/organization/prompt-card.tsx | 20 +- .../overview/filters/origin-filter.tsx | 19 +- .../filters/overview-filters-buttons.tsx | 54 +- .../overview/overview-chart-toggle.tsx | 8 +- .../overview/overview-details-button.tsx | 1 - .../components/overview/overview-insights.tsx | 22 +- .../components/overview/overview-interval.tsx | 12 +- .../overview/overview-line-chart-tooltip.tsx | 20 +- .../overview/overview-line-chart.tsx | 69 +- .../overview/overview-list-modal.tsx | 63 +- .../overview/overview-live-histogram.tsx | 50 +- .../src/components/overview/overview-map.tsx | 22 +- .../components/overview/overview-metrics.tsx | 257 +- .../components/overview/overview-share.tsx | 22 +- .../overview/overview-top-devices.tsx | 74 +- .../overview/overview-top-events.tsx | 45 +- .../overview/overview-top-generic-modal.tsx | 26 +- .../components/overview/overview-top-geo.tsx | 48 +- .../overview/overview-top-pages-modal.tsx | 35 +- .../overview/overview-top-pages.tsx | 27 +- .../overview/overview-top-sources.tsx | 33 +- .../overview/overview-user-journey.tsx | 217 +- .../overview/overview-view-toggle.tsx | 14 +- .../overview/overview-weekly-trends.tsx | 213 +- .../overview/overview-widget-table.tsx | 162 +- .../components/overview/overview-widget.tsx | 79 +- .../components/overview/useOverviewOptions.ts | 29 +- .../components/overview/useOverviewWidget.tsx | 15 +- apps/start/src/components/page-header.tsx | 6 +- .../components/page/gsc-breakdown-table.tsx | 71 +- .../components/page/gsc-position-chart.tsx | 8 +- .../src/components/page/page-views-chart.tsx | 2 +- .../src/components/pages/table/index.tsx | 28 +- .../src/components/pagination-floating.tsx | 4 +- apps/start/src/components/pagination.tsx | 41 +- apps/start/src/components/ping.tsx | 15 +- .../src/components/profiles/latest-events.tsx | 16 +- .../src/components/profiles/most-events.tsx | 8 +- .../components/profiles/popular-routes.tsx | 8 +- .../components/profiles/profile-activity.tsx | 52 +- .../components/profiles/profile-avatar.tsx | 10 +- .../components/profiles/profile-charts.tsx | 9 +- .../components/profiles/profile-groups.tsx | 10 +- .../profiles/profile-properties.tsx | 23 +- apps/start/src/components/project-mapper.tsx | 41 +- .../src/components/projects/project-card.tsx | 55 +- .../src/components/projects/project-chart.tsx | 86 +- apps/start/src/components/providers.tsx | 10 +- .../start/src/components/public-page-card.tsx | 12 +- .../src/components/realtime/realtime-geo.tsx | 26 +- .../components/realtime/realtime-paths.tsx | 30 +- .../realtime/realtime-referrals.tsx | 24 +- .../components/realtime/realtime-reloader.tsx | 8 +- .../components/report-chart/area/chart.tsx | 75 +- .../components/report-chart/area/index.tsx | 7 +- .../report-chart/aspect-container.tsx | 4 +- .../src/components/report-chart/bar/chart.tsx | 71 +- .../src/components/report-chart/bar/index.tsx | 11 +- .../components/report-chart/common/axis.tsx | 11 +- .../report-chart/common/chart-click-menu.tsx | 24 +- .../components/report-chart/common/empty.tsx | 26 +- .../components/report-chart/common/error.tsx | 8 +- .../report-chart/common/linear-gradient.tsx | 6 +- .../report-chart/common/loading.tsx | 16 +- .../common/previous-diff-indicator.tsx | 31 +- .../common/report-chart-tooltip.tsx | 36 +- .../common/report-table-toolbar.tsx | 20 +- .../report-chart/common/report-table-utils.ts | 56 +- .../report-chart/common/report-table.tsx | 412 +- .../report-chart/common/serie-icon.tsx | 14 +- .../report-chart/common/serie-name.tsx | 8 +- .../src/components/report-chart/context.tsx | 5 +- .../report-chart/conversion/chart.tsx | 119 +- .../conversion/conversion-table.tsx | 104 +- .../report-chart/conversion/index.tsx | 8 +- .../report-chart/conversion/summary.tsx | 42 +- .../report-chart/funnel/breakdown-list.tsx | 52 +- .../components/report-chart/funnel/chart.tsx | 12 +- .../components/report-chart/funnel/index.tsx | 14 +- .../report-chart/histogram/chart.tsx | 49 +- .../report-chart/histogram/index.tsx | 7 +- .../src/components/report-chart/index.tsx | 6 +- .../components/report-chart/line/chart.tsx | 97 +- .../components/report-chart/line/index.tsx | 7 +- .../src/components/report-chart/map/chart.tsx | 17 +- .../src/components/report-chart/map/index.tsx | 7 +- .../components/report-chart/metric/chart.tsx | 9 +- .../components/report-chart/metric/index.tsx | 7 +- .../report-chart/metric/metric-card.tsx | 48 +- .../src/components/report-chart/pie/chart.tsx | 54 +- .../src/components/report-chart/pie/index.tsx | 7 +- .../report-chart/retention/chart.tsx | 45 +- .../report-chart/retention/index.tsx | 10 +- .../report-chart/retention/table.tsx | 37 +- .../report-chart/retention/tooltip.tsx | 3 +- .../components/report-chart/sankey/chart.tsx | 179 +- .../components/report-chart/sankey/index.tsx | 8 +- .../src/components/report-chart/shortcut.tsx | 2 +- .../src/components/report/ReportChartType.tsx | 18 +- .../src/components/report/ReportInterval.tsx | 14 +- .../src/components/report/ReportLineType.tsx | 21 +- .../components/report/ReportSaveButton.tsx | 27 +- .../components/report/edit-report-name.tsx | 18 +- .../src/components/report/report-item.tsx | 58 +- .../src/components/report/reportSlice.ts | 23 +- .../report/sidebar/ReportBreakdownMore.tsx | 8 +- .../report/sidebar/ReportBreakdowns.tsx | 35 +- .../report/sidebar/ReportEventMore.tsx | 8 +- .../report/sidebar/ReportSeries.tsx | 138 +- .../report/sidebar/ReportSeriesItem.tsx | 22 +- .../report/sidebar/ReportSettings.tsx | 105 +- .../report/sidebar/ReportSidebar.tsx | 7 +- .../report/sidebar/filters/FilterItem.tsx | 57 +- .../sidebar/filters/FilterOperatorSelect.tsx | 8 +- .../report/sidebar/filters/FiltersList.tsx | 5 +- .../report/sidebar/report-fixed-events.tsx | 105 +- apps/start/src/components/selling-points.tsx | 14 +- .../sessions/replay/browser-chrome.tsx | 14 +- .../sessions/replay/replay-context.tsx | 24 +- .../sessions/replay/replay-controls.tsx | 19 +- .../sessions/replay/replay-event-feed.tsx | 38 +- .../sessions/replay/replay-event-item.tsx | 12 +- .../sessions/replay/replay-player.tsx | 69 +- .../sessions/replay/replay-timeline.tsx | 151 +- .../sessions/replay/replay-utils.ts | 2 +- .../src/components/sessions/table/columns.tsx | 6 +- .../components/settings/delete-project.tsx | 30 +- .../settings/edit-project-details.tsx | 66 +- .../settings/edit-project-filters.tsx | 98 +- .../components/settings/invites/columns.tsx | 20 +- .../src/components/settings/invites/index.tsx | 12 +- .../components/settings/members/columns.tsx | 26 +- .../src/components/settings/members/index.tsx | 7 +- apps/start/src/components/sidebar-link.tsx | 9 +- apps/start/src/components/stats.tsx | 6 +- apps/start/src/components/theme-provider.tsx | 16 +- .../start/src/components/tooltip-complete.tsx | 2 +- apps/start/src/components/ui/RenderDots.tsx | 9 +- apps/start/src/components/ui/accordion.tsx | 12 +- apps/start/src/components/ui/alert-dialog.tsx | 28 +- apps/start/src/components/ui/alert.tsx | 16 +- apps/start/src/components/ui/avatar.tsx | 14 +- apps/start/src/components/ui/badge.tsx | 11 +- apps/start/src/components/ui/carousel.tsx | 62 +- apps/start/src/components/ui/checkbox.tsx | 10 +- .../src/components/ui/combobox-advanced.tsx | 21 +- .../src/components/ui/combobox-events.tsx | 56 +- apps/start/src/components/ui/combobox.tsx | 42 +- apps/start/src/components/ui/command.tsx | 45 +- .../data-table/data-table-column-header.tsx | 20 +- .../ui/data-table/data-table-date-filter.tsx | 59 +- .../data-table/data-table-faceted-filter.tsx | 52 +- .../ui/data-table/data-table-helpers.tsx | 6 +- .../ui/data-table/data-table-hooks.tsx | 14 +- .../ui/data-table/data-table-parsers.ts | 18 +- .../data-table/data-table-slider-filter.tsx | 64 +- .../ui/data-table/data-table-view-options.tsx | 66 +- .../components/ui/data-table/data-table.tsx | 36 +- .../components/ui/data-table/use-table.tsx | 48 +- .../ui/data-table/virtualized-data-table.tsx | 23 +- apps/start/src/components/ui/date-time.tsx | 46 +- apps/start/src/components/ui/dialog.tsx | 27 +- .../start/src/components/ui/dropdown-menu.tsx | 53 +- .../src/components/ui/gradient-background.tsx | 4 +- .../src/components/ui/input-date-time.tsx | 16 +- apps/start/src/components/ui/input-enter.tsx | 14 +- apps/start/src/components/ui/input-otp.tsx | 18 +- .../src/components/ui/input-with-toggle.tsx | 3 +- apps/start/src/components/ui/input.tsx | 14 +- .../src/components/ui/key-value-grid.tsx | 50 +- apps/start/src/components/ui/key-value.tsx | 10 +- apps/start/src/components/ui/label.tsx | 8 +- apps/start/src/components/ui/popover.tsx | 10 +- apps/start/src/components/ui/progress.tsx | 12 +- apps/start/src/components/ui/radio-group.tsx | 6 +- apps/start/src/components/ui/scroll-area.tsx | 17 +- apps/start/src/components/ui/separator.tsx | 9 +- apps/start/src/components/ui/sheet.tsx | 38 +- apps/start/src/components/ui/slider.tsx | 25 +- apps/start/src/components/ui/sonner.tsx | 4 +- apps/start/src/components/ui/spinner.tsx | 122 +- apps/start/src/components/ui/switch.tsx | 8 +- apps/start/src/components/ui/table.tsx | 37 +- apps/start/src/components/ui/tabs.tsx | 20 +- apps/start/src/components/ui/textarea.tsx | 8 +- apps/start/src/components/ui/toast.tsx | 32 +- apps/start/src/components/ui/toaster.tsx | 4 +- apps/start/src/components/ui/toggle-group.tsx | 10 +- apps/start/src/components/ui/toggle.tsx | 10 +- apps/start/src/components/ui/tooltip.tsx | 22 +- apps/start/src/components/widget-table.tsx | 42 +- apps/start/src/components/widget.tsx | 8 +- apps/start/src/hooks/use-breakpoint.ts | 1 + apps/start/src/hooks/use-callback-ref.ts | 4 +- .../use-conversion-rechart-data-model.ts | 7 +- apps/start/src/hooks/use-dashed-stroke.tsx | 15 +- apps/start/src/hooks/use-debounce-state.ts | 4 +- .../start/src/hooks/use-debounced-callback.ts | 9 +- apps/start/src/hooks/use-event-names.ts | 6 +- apps/start/src/hooks/use-event-properties.ts | 6 +- .../src/hooks/use-event-query-filters.ts | 19 +- .../src/hooks/use-format-date-interval.ts | 3 +- apps/start/src/hooks/use-logout.ts | 4 +- apps/start/src/hooks/use-numer-formatter.ts | 14 +- .../start/src/hooks/use-profile-properties.ts | 4 +- apps/start/src/hooks/use-profile-values.ts | 6 +- apps/start/src/hooks/use-property-values.ts | 4 +- .../start/src/hooks/use-rechart-data-model.ts | 4 +- apps/start/src/hooks/use-scroll-anchor.ts | 10 +- .../start/src/hooks/use-search-query-state.ts | 2 +- apps/start/src/hooks/use-session-extension.ts | 12 +- apps/start/src/hooks/use-session-filters.ts | 22 +- apps/start/src/hooks/use-throttle.ts | 2 +- .../hooks/use-visible-conversion-series.ts | 9 +- .../hooks/use-visible-funnel-breakdowns.ts | 6 +- apps/start/src/hooks/use-visible-series.ts | 6 +- apps/start/src/hooks/use-ws.ts | 9 +- apps/start/src/modals/Instructions.tsx | 24 +- apps/start/src/modals/Modal/Container.tsx | 15 +- .../src/modals/Modal/scrollable-modal.tsx | 12 +- apps/start/src/modals/add-client.tsx | 46 +- apps/start/src/modals/add-dashboard.tsx | 18 +- apps/start/src/modals/add-import.tsx | 77 +- apps/start/src/modals/add-integration.tsx | 22 +- apps/start/src/modals/add-project.tsx | 63 +- apps/start/src/modals/add-reference.tsx | 25 +- apps/start/src/modals/billing-success.tsx | 18 +- apps/start/src/modals/confirm.tsx | 9 +- apps/start/src/modals/create-invite.tsx | 54 +- apps/start/src/modals/date-time-picker.tsx | 47 +- apps/start/src/modals/edit-client.tsx | 20 +- apps/start/src/modals/edit-dashboard.tsx | 26 +- apps/start/src/modals/edit-event.tsx | 80 +- apps/start/src/modals/edit-member.tsx | 29 +- apps/start/src/modals/edit-reference.tsx | 31 +- apps/start/src/modals/edit-report.tsx | 11 +- apps/start/src/modals/gsc-details.tsx | 3 +- .../src/modals/overview-chart-details.tsx | 6 +- apps/start/src/modals/overview-filters.tsx | 107 +- .../src/modals/request-reset-password.tsx | 22 +- apps/start/src/modals/save-report.tsx | 107 +- apps/start/src/modals/select-billing-plan.tsx | 95 +- .../src/modals/share-dashboard-modal.tsx | 47 +- .../start/src/modals/share-overview-modal.tsx | 49 +- apps/start/src/modals/share-report-modal.tsx | 49 +- apps/start/src/modals/view-chart-users.tsx | 106 +- apps/start/src/router.tsx | 1 - .../_app.$organizationId.$projectId.chat.tsx | 18 +- ....$organizationId.$projectId.dashboards.tsx | 54 +- ...Id.$projectId.dashboards_.$dashboardId.tsx | 95 +- ...Id.$projectId.events._tabs.conversions.tsx | 14 +- ...ationId.$projectId.events._tabs.events.tsx | 12 +- ...zationId.$projectId.events._tabs.index.tsx | 2 +- ...zationId.$projectId.events._tabs.stats.tsx | 68 +- ...organizationId.$projectId.events._tabs.tsx | 12 +- ...rojectId.groups_.$groupId._tabs.events.tsx | 6 +- ...projectId.groups_.$groupId._tabs.index.tsx | 1 - ...ojectId.groups_.$groupId._tabs.members.tsx | 4 +- ...pp.$organizationId.$projectId.insights.tsx | 99 +- ...d.$projectId.notifications._tabs.index.tsx | 2 +- ...ctId.notifications._tabs.notifications.tsx | 10 +- ...d.$projectId.notifications._tabs.rules.tsx | 24 +- ...ationId.$projectId.notifications._tabs.tsx | 12 +- .../_app.$organizationId.$projectId.pages.tsx | 12 +- ...ectId.profiles.$profileId._tabs.events.tsx | 14 +- ...jectId.profiles.$profileId._tabs.index.tsx | 30 +- ...tId.profiles.$profileId._tabs.sessions.tsx | 10 +- ...d.$projectId.profiles.$profileId._tabs.tsx | 28 +- ...Id.$projectId.profiles._tabs.anonymous.tsx | 12 +- ...d.$projectId.profiles._tabs.identified.tsx | 14 +- ...tionId.$projectId.profiles._tabs.index.tsx | 2 +- ....$projectId.profiles._tabs.power-users.tsx | 12 +- ...ganizationId.$projectId.profiles._tabs.tsx | 12 +- ....$organizationId.$projectId.references.tsx | 44 +- ...app.$organizationId.$projectId.reports.tsx | 6 +- ...zationId.$projectId.reports_.$reportId.tsx | 10 +- ...tionId.$projectId.sessions_.$sessionId.tsx | 6 +- ...onId.$projectId.settings._tabs.clients.tsx | 6 +- ...onId.$projectId.settings._tabs.details.tsx | 8 +- ...ionId.$projectId.settings._tabs.events.tsx | 8 +- ...tionId.$projectId.settings._tabs.index.tsx | 2 +- ...onId.$projectId.settings._tabs.widgets.tsx | 144 +- .../_app.$organizationId.$projectId.tsx | 12 +- .../routes/_app.$organizationId.billing.tsx | 20 +- .../src/routes/_app.$organizationId.index.tsx | 28 +- ...izationId.integrations._tabs.available.tsx | 4 +- ...rganizationId.integrations._tabs.index.tsx | 5 +- ...izationId.integrations._tabs.installed.tsx | 4 +- ...app.$organizationId.integrations._tabs.tsx | 16 +- ...ganizationId.members._tabs.invitations.tsx | 11 +- ....$organizationId.members._tabs.members.tsx | 8 +- .../_app.$organizationId.members._tabs.tsx | 10 +- ...tionId.profile._tabs.email-preferences.tsx | 53 +- ...pp.$organizationId.profile._tabs.index.tsx | 31 +- .../_app.$organizationId.profile._tabs.tsx | 11 +- .../routes/_app.$organizationId.settings.tsx | 36 +- .../start/src/routes/_app.$organizationId.tsx | 48 +- .../src/routes/_login.reset-password.tsx | 8 +- apps/start/src/routes/_public.tsx | 6 +- .../src/routes/share.dashboard.$shareId.tsx | 34 +- .../src/routes/share.overview.$shareId.tsx | 18 +- .../src/routes/share.report.$shareId.tsx | 20 +- apps/start/src/routes/unsubscribe.tsx | 18 +- apps/start/src/routes/widget/badge.tsx | 22 +- apps/start/src/routes/widget/test.tsx | 28 +- apps/start/src/styles.css | 94 +- apps/start/src/trpc/client.ts | 8 +- apps/start/src/types/data-table.ts | 2 +- apps/start/src/types/react-simple-map.d.ts | 8 +- apps/start/src/types/rrweb-player.d.ts | 8 +- apps/start/src/utils/are-props-equal.ts | 4 +- apps/start/src/utils/clipboard.ts | 2 +- apps/start/src/utils/cn.ts | 2 +- apps/start/src/utils/date.ts | 2 +- apps/start/src/utils/getDbId.ts | 1 - apps/start/src/utils/getters.ts | 2 +- apps/start/src/utils/truncate.ts | 2 +- apps/start/vite.config.ts | 2 +- apps/testbed/index.html | 4 +- apps/testbed/src/pages/Cart.tsx | 18 +- apps/testbed/src/pages/Checkout.tsx | 30 +- apps/testbed/src/pages/Login.tsx | 26 +- apps/testbed/src/pages/Product.tsx | 6 +- apps/testbed/src/pages/Shop.tsx | 8 +- apps/testbed/src/styles.css | 8 +- apps/worker/package.json | 2 +- apps/worker/scripts/get-referrers.ts | 9 +- apps/worker/src/boot-cron.ts | 5 +- apps/worker/src/jobs/cron.delete-projects.ts | 2 +- apps/worker/src/jobs/cron.onboarding.ts | 20 +- apps/worker/src/jobs/cron.ping.ts | 4 +- apps/worker/src/jobs/cron.salt.ts | 2 +- apps/worker/src/jobs/cron.ts | 15 +- apps/worker/src/jobs/insights.ts | 4 +- .../worker/src/jobs/misc.trail-ending-soon.ts | 2 +- apps/worker/src/jobs/misc.ts | 4 +- apps/worker/src/jobs/notification.ts | 11 +- apps/worker/src/jobs/sessions.ts | 10 +- apps/worker/tsdown.config.ts | 2 +- apps/worker/vitest.config.ts | 2 +- biome.json | 16 +- docker-compose.yml | 2 - package.json | 3 +- packages/auth/constants.ts | 2 +- packages/auth/index.ts | 2 +- packages/auth/package.json | 2 +- packages/auth/parse-cookie-domain.test.ts | 8 +- packages/auth/src/password.ts | 8 +- packages/auth/src/session.ts | 8 +- packages/common/index.ts | 18 +- packages/common/server/crypto.ts | 13 +- packages/common/server/get-client-ip.ts | 6 +- packages/common/server/index.ts | 6 +- packages/common/server/parse-referrer.test.ts | 2 +- packages/common/server/parse-referrer.ts | 5 +- .../common/server/parser-user-agent.test.ts | 8 +- packages/common/server/parser-user-agent.ts | 20 +- packages/common/src/get-previous-metric.ts | 8 +- packages/common/src/group-by-labels.ts | 2 +- packages/common/src/math.ts | 12 +- packages/common/src/object.test.ts | 2 +- packages/common/src/object.ts | 4 +- packages/common/src/slug.test.ts | 2 +- packages/common/src/slug.ts | 2 +- packages/common/src/url.ts | 8 +- packages/common/vitest.config.ts | 2 +- packages/db/code-migrations/12-add-gsc.ts | 11 +- packages/db/code-migrations/2-accounts.ts | 8 +- packages/db/code-migrations/3-init-ch.ts | 28 +- packages/db/code-migrations/4-add-sessions.ts | 8 +- .../db/code-migrations/5-add-imports-table.ts | 9 +- .../code-migrations/6-add-revenue-column.ts | 8 +- .../7-migrate-events-to-series.ts | 8 +- packages/db/code-migrations/8-order-keys.ts | 26 +- .../db/code-migrations/9-migrate-options.ts | 2 +- packages/db/code-migrations/migrate.ts | 20 +- packages/db/prisma/prisma-json-types.ts | 29 +- packages/db/scripts/ch-copy-from-remote.ts | 22 +- .../ch-update-sessions-with-revenue.ts | 8 +- packages/db/src/buffers/base-buffer.ts | 8 +- packages/db/src/buffers/bot-buffer.ts | 13 +- packages/db/src/buffers/event-buffer.test.ts | 12 +- packages/db/src/buffers/group-buffer.ts | 17 +- packages/db/src/buffers/partial-json-match.ts | 5 +- .../db/src/buffers/profile-backfill-buffer.ts | 20 +- .../db/src/buffers/profile-buffer.test.ts | 23 +- packages/db/src/buffers/replay-buffer.ts | 2 +- .../db/src/buffers/session-buffer.test.ts | 18 +- packages/db/src/clickhouse/migration.ts | 53 +- packages/db/src/clickhouse/query-builder.ts | 4 +- packages/db/src/engine/compute.ts | 12 +- packages/db/src/engine/fetch.ts | 6 +- packages/db/src/engine/normalize.ts | 8 +- packages/db/src/engine/types.ts | 7 +- packages/db/src/gsc.ts | 114 +- packages/db/src/prisma-client.ts | 22 +- packages/db/src/services/access.service.ts | 12 +- packages/db/src/services/clients.service.ts | 2 +- .../db/src/services/conversion.service.ts | 30 +- packages/db/src/services/delete.service.ts | 5 +- packages/db/src/services/funnel.service.ts | 51 +- packages/db/src/services/id.service.ts | 3 +- packages/db/src/services/insights.service.ts | 34 +- .../db/src/services/insights/cached-clix.ts | 4 +- packages/db/src/services/insights/engine.ts | 44 +- packages/db/src/services/insights/index.ts | 12 +- packages/db/src/services/insights/material.ts | 2 +- .../insights/modules/devices.module.ts | 22 +- .../insights/modules/entry-pages.module.ts | 28 +- .../services/insights/modules/geo.module.ts | 32 +- .../db/src/services/insights/modules/index.ts | 8 +- .../insights/modules/page-trends.module.ts | 32 +- .../insights/modules/referrers.module.ts | 28 +- packages/db/src/services/insights/scoring.ts | 14 +- packages/db/src/services/insights/store.ts | 14 +- packages/db/src/services/insights/types.ts | 11 +- packages/db/src/services/insights/utils.ts | 26 +- .../db/src/services/notification.service.ts | 2 +- .../db/src/services/organization.service.ts | 22 +- packages/db/src/services/reference.service.ts | 2 +- packages/db/src/services/reports.service.ts | 9 +- packages/db/src/services/retention.service.ts | 3 +- packages/db/src/services/salt.service.ts | 5 +- packages/db/src/services/sankey.service.ts | 78 +- packages/db/src/services/share.service.ts | 12 +- packages/db/src/services/user.service.ts | 6 +- packages/db/src/session-consistency.ts | 20 +- packages/db/src/session-context.ts | 2 +- packages/db/src/sql-builder.ts | 6 +- packages/db/src/types.ts | 2 +- packages/email/src/components/button.tsx | 6 +- packages/email/src/components/footer.tsx | 19 +- packages/email/src/components/layout.tsx | 22 +- packages/email/src/emails/email-invite.tsx | 1 - .../email/src/emails/email-reset-password.tsx | 1 - .../src/emails/onboarding-dashboards.tsx | 5 +- .../src/emails/onboarding-feature-request.tsx | 1 - .../src/emails/onboarding-trial-ended.tsx | 1 - .../src/emails/onboarding-trial-ending.tsx | 1 - .../email/src/emails/onboarding-welcome.tsx | 7 +- .../src/emails/onboarding-what-to-track.tsx | 1 - .../email/src/emails/trial-ending-soon.tsx | 1 - packages/email/src/index.tsx | 8 +- packages/email/src/unsubscribe.ts | 7 +- packages/geo/scripts/download.ts | 6 +- packages/geo/src/geo.ts | 3 +- packages/importer/src/base-provider.ts | 8 +- packages/importer/src/index.ts | 10 +- packages/importer/src/providers/mixpanel.ts | 21 +- packages/importer/src/providers/umami.ts | 4 +- packages/importer/src/types.ts | 6 +- packages/importer/vitest.config.ts | 2 +- packages/integrations/src/slack.ts | 7 +- packages/js-runtime/src/ast-walker.ts | 22 +- packages/js-runtime/src/execute.ts | 4 +- packages/js-runtime/src/index.ts | 2 +- packages/js-runtime/src/validate.test.ts | 18 +- packages/js-runtime/src/validate.ts | 34 +- packages/payments/package.json | 2 +- .../payments/scripts/create-checkout-link.ts | 24 +- .../payments/scripts/create-custom-pricing.ts | 28 +- packages/payments/scripts/create-products.ts | 10 +- packages/payments/src/polar.ts | 9 +- packages/payments/src/prices.ts | 6 +- packages/queue/index.ts | 4 +- packages/queue/package.json | 2 +- packages/redis/cachable.test.ts | 20 +- packages/redis/index.ts | 4 +- packages/redis/publisher.ts | 15 +- packages/redis/redis.ts | 8 +- packages/sdks/_info/frameworks.tsx | 4 +- packages/sdks/_info/icons/astro-icon.tsx | 6 +- packages/sdks/_info/icons/express-icon.tsx | 10 +- packages/sdks/_info/icons/flutter-icon.tsx | 6 +- packages/sdks/_info/icons/html-icon.tsx | 8 +- packages/sdks/_info/icons/kotlin-icon.tsx | 8 +- packages/sdks/_info/icons/laravel-icon.tsx | 6 +- packages/sdks/_info/icons/nextjs-icon.tsx | 8 +- packages/sdks/_info/icons/node-icon.tsx | 6 +- packages/sdks/_info/icons/python-icon.tsx | 10 +- packages/sdks/_info/icons/react-icon.tsx | 6 +- packages/sdks/_info/icons/remix-icon.tsx | 10 +- packages/sdks/_info/icons/rest-icon.tsx | 6 +- packages/sdks/_info/icons/ruby-icon.tsx | 8 +- packages/sdks/_info/icons/rust-icon.tsx | 12 +- packages/sdks/_info/icons/swift-icon.tsx | 8 +- packages/sdks/_info/icons/vue-icon.tsx | 6 +- packages/sdks/astro/index.ts | 2 +- .../sdks/astro/src/IdentifyComponent.astro | 2 +- .../sdks/astro/src/OpenPanelComponent.astro | 3 +- .../src/SetGlobalPropertiesComponent.astro | 2 - packages/sdks/astro/src/asto-utils.ts | 2 +- packages/sdks/express/index.ts | 3 +- .../sdks/nextjs/createNextRouteHandler.ts | 12 +- .../src/runtime/server/api/[...openpanel].ts | 8 +- packages/sdks/nuxt/tsconfig.json | 9 +- packages/sdks/sdk/src/api.ts | 8 +- packages/sdks/web/index.ts | 2 +- packages/sdks/web/src/replay/index.ts | 2 +- packages/sdks/web/src/replay/recorder.ts | 21 +- packages/sdks/web/src/tracker.ts | 2 +- packages/trpc/index.ts | 2 +- packages/trpc/src/access.ts | 2 +- packages/trpc/src/routers/chat.ts | 4 +- packages/trpc/src/routers/client.ts | 14 +- packages/trpc/src/routers/dashboard.ts | 20 +- packages/trpc/src/routers/email.ts | 8 +- packages/trpc/src/routers/event.ts | 53 +- packages/trpc/src/routers/group.ts | 8 +- packages/trpc/src/routers/import.ts | 14 +- packages/trpc/src/routers/insight.ts | 4 +- packages/trpc/src/routers/integration.ts | 10 +- packages/trpc/src/routers/notification.ts | 14 +- packages/trpc/src/routers/onboarding.ts | 24 +- packages/trpc/src/routers/organization.ts | 22 +- packages/trpc/src/routers/overview.ts | 44 +- packages/trpc/src/routers/profile.ts | 34 +- packages/trpc/src/routers/project.ts | 19 +- packages/trpc/src/routers/realtime.ts | 2 +- packages/trpc/src/routers/reference.ts | 12 +- packages/trpc/src/routers/report.ts | 34 +- packages/trpc/src/routers/share.ts | 24 +- packages/trpc/src/routers/subscription.ts | 7 +- packages/trpc/src/routers/user.ts | 12 +- packages/trpc/src/routers/widget.ts | 33 +- packages/trpc/src/trpc.ts | 24 +- packages/trpc/vitest.config.ts | 2 +- packages/validation/index.ts | 2 +- packages/validation/src/event-blocklist.ts | 8 +- packages/validation/src/index.ts | 33 +- packages/validation/src/types.validation.ts | 2 +- .../buffer-equal-constant-time@1.0.1.patch | 42 + pnpm-lock.yaml | 7 +- scripts/add-internal-links.mjs | 110 +- scripts/seed-events.mjs | 1142 +- self-hosting/quiz.ts | 42 +- tooling/publish/generate-readme.ts | 128 +- tooling/publish/publish.ts | 17 +- tooling/typescript/package.json | 6 +- vitest.shared.ts | 4 +- 815 files changed, 22960 insertions(+), 8982 deletions(-) create mode 100644 patches/buffer-equal-constant-time@1.0.1.patch diff --git a/.zed/settings.json b/.zed/settings.json index 2226f4fb..b669e38c 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -47,4 +47,4 @@ } } } -} \ No newline at end of file +} diff --git a/admin/src/cli.ts b/admin/src/cli.ts index ad1b3b9f..a1ec7fdd 100644 --- a/admin/src/cli.ts +++ b/admin/src/cli.ts @@ -24,7 +24,7 @@ async function main() { const CLICKHOUSE_URL = process.env.CLICKHOUSE_URL; const REDIS_URL = process.env.REDIS_URL; - if (!DATABASE_URL || !CLICKHOUSE_URL || !REDIS_URL) { + if (!(DATABASE_URL && CLICKHOUSE_URL && REDIS_URL)) { console.error('Environment variables are not set'); process.exit(1); } diff --git a/admin/src/commands/clear-cache.ts b/admin/src/commands/clear-cache.ts index 5eb2b8cf..e9584f46 100644 --- a/admin/src/commands/clear-cache.ts +++ b/admin/src/commands/clear-cache.ts @@ -40,7 +40,7 @@ export async function clearCache() { displayText: `${org.name} ${chalk.gray(`(${org.id})`)}`, })); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: OrgSearchItem) => `${item.name} ${item.id}`, }); @@ -94,7 +94,7 @@ export async function clearCache() { console.log(chalk.yellow('\nšŸ“Š Projects:\n')); for (const project of organization.projects) { console.log( - ` - ${project.name} ${chalk.gray(`(${project.id})`)} - ${chalk.cyan(`${project.eventsCount.toLocaleString()} events`)}`, + ` - ${project.name} ${chalk.gray(`(${project.id})`)} - ${chalk.cyan(`${project.eventsCount.toLocaleString()} events`)}` ); } } @@ -119,9 +119,11 @@ export async function clearCache() { for (const project of organization.projects) { // Clear project access cache for each member for (const member of organization.members) { - if (!member.user?.id) continue; + if (!member.user?.id) { + continue; + } console.log( - `Clearing cache for project: ${project.name} and member: ${member.user?.email}`, + `Clearing cache for project: ${project.name} and member: ${member.user?.email}` ); await getProjectAccess.clear({ userId: member.user?.id, @@ -141,8 +143,8 @@ export async function clearCache() { console.log(chalk.gray(`Organization ID: ${organization.id}`)); console.log( chalk.gray( - `Project IDs: ${organization.projects.map((p) => p.id).join(', ')}`, - ), + `Project IDs: ${organization.projects.map((p) => p.id).join(', ')}` + ) ); // Example of what you might do: diff --git a/admin/src/commands/delete-organization.ts b/admin/src/commands/delete-organization.ts index 22cec740..43c8cc68 100644 --- a/admin/src/commands/delete-organization.ts +++ b/admin/src/commands/delete-organization.ts @@ -21,8 +21,8 @@ export async function deleteOrganization() { console.log(chalk.red('\nšŸ—‘ļø Delete Organization\n')); console.log( chalk.yellow( - 'āš ļø WARNING: This will permanently delete the organization and all its data!\n', - ), + 'āš ļø WARNING: This will permanently delete the organization and all its data!\n' + ) ); console.log('Loading organizations...\n'); @@ -51,7 +51,7 @@ export async function deleteOrganization() { displayText: `${org.name} ${chalk.gray(`(${org.id})`)} ${chalk.cyan(`- ${org.projects.length} projects, ${org.members.length} members`)}`, })); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: OrgSearchItem) => `${item.name} ${item.id}`, }); @@ -107,7 +107,7 @@ export async function deleteOrganization() { console.log(chalk.red('\n Projects that will be deleted:')); for (const project of organization.projects) { console.log( - ` - ${project.name} ${chalk.gray(`(${project.eventsCount.toLocaleString()} events, ${project.clients.length} clients)`)}`, + ` - ${project.name} ${chalk.gray(`(${project.eventsCount.toLocaleString()} events, ${project.clients.length} clients)`)}` ); } } @@ -122,8 +122,8 @@ export async function deleteOrganization() { console.log( chalk.red( - '\nāš ļø This will delete ALL projects, clients, events, and data associated with this organization!', - ), + '\nāš ļø This will delete ALL projects, clients, events, and data associated with this organization!' + ) ); // First confirmation @@ -132,7 +132,7 @@ export async function deleteOrganization() { type: 'confirm', name: 'confirmFirst', message: chalk.red( - `Are you ABSOLUTELY SURE you want to delete "${organization.name}"?`, + `Are you ABSOLUTELY SURE you want to delete "${organization.name}"?` ), default: false, }, @@ -154,7 +154,7 @@ export async function deleteOrganization() { if (confirmName !== organization.name) { console.log( - chalk.red('\nāŒ Organization name does not match. Deletion cancelled.'), + chalk.red('\nāŒ Organization name does not match. Deletion cancelled.') ); return; } @@ -165,7 +165,7 @@ export async function deleteOrganization() { type: 'confirm', name: 'confirmFinal', message: chalk.red( - 'FINAL WARNING: This action CANNOT be undone. Delete now?', + 'FINAL WARNING: This action CANNOT be undone. Delete now?' ), default: false, }, @@ -185,8 +185,8 @@ export async function deleteOrganization() { if (projectIds.length > 0) { console.log( chalk.yellow( - `Deleting data from ClickHouse for ${projectIds.length} projects...`, - ), + `Deleting data from ClickHouse for ${projectIds.length} projects...` + ) ); await deleteFromClickhouse(projectIds); console.log(chalk.green('āœ“ ClickHouse data deletion initiated')); @@ -200,13 +200,13 @@ export async function deleteOrganization() { console.log(chalk.green('\nāœ… Organization deleted successfully!')); console.log( chalk.gray( - `Deleted: ${organization.name} with ${organization.projects.length} projects and ${organization.members.length} members`, - ), + `Deleted: ${organization.name} with ${organization.projects.length} projects and ${organization.members.length} members` + ) ); console.log( chalk.gray( - '\nNote: ClickHouse deletions are processed asynchronously and may take a few moments to complete.', - ), + '\nNote: ClickHouse deletions are processed asynchronously and may take a few moments to complete.' + ) ); } catch (error) { console.error(chalk.red('\nāŒ Error deleting organization:'), error); diff --git a/admin/src/commands/delete-user.ts b/admin/src/commands/delete-user.ts index dfe04d96..ac7accbd 100644 --- a/admin/src/commands/delete-user.ts +++ b/admin/src/commands/delete-user.ts @@ -19,8 +19,8 @@ export async function deleteUser() { console.log(chalk.red('\nšŸ—‘ļø Delete User\n')); console.log( chalk.yellow( - 'āš ļø WARNING: This will permanently delete the user and remove them from all organizations!\n', - ), + 'āš ļø WARNING: This will permanently delete the user and remove them from all organizations!\n' + ) ); console.log('Loading users...\n'); @@ -59,7 +59,7 @@ export async function deleteUser() { }; }); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: UserSearchItem) => `${item.email} ${item.firstName || ''} ${item.lastName || ''}`, @@ -107,46 +107,46 @@ export async function deleteUser() { console.log(` ${chalk.bold('User:')} ${user.email}`); if (user.firstName || user.lastName) { console.log( - ` ${chalk.gray('Name:')} ${user.firstName || ''} ${user.lastName || ''}`, + ` ${chalk.gray('Name:')} ${user.firstName || ''} ${user.lastName || ''}` ); } console.log(` ${chalk.gray('ID:')} ${user.id}`); console.log( - ` ${chalk.gray('Member of:')} ${user.membership.length} organizations`, + ` ${chalk.gray('Member of:')} ${user.membership.length} organizations` ); console.log(` ${chalk.gray('Auth accounts:')} ${user.accounts.length}`); if (user.createdOrganizations.length > 0) { console.log( chalk.red( - `\n āš ļø This user CREATED ${user.createdOrganizations.length} organization(s):`, - ), + `\n āš ļø This user CREATED ${user.createdOrganizations.length} organization(s):` + ) ); for (const org of user.createdOrganizations) { console.log(` - ${org.name} ${chalk.gray(`(${org.id})`)}`); } console.log( chalk.yellow( - ' Note: These organizations will NOT be deleted, only the user reference.', - ), + ' Note: These organizations will NOT be deleted, only the user reference.' + ) ); } if (user.membership.length > 0) { console.log( - chalk.red('\n Organizations where user will be removed from:'), + chalk.red('\n Organizations where user will be removed from:') ); for (const member of user.membership) { console.log( - ` - ${member.organization.name} ${chalk.gray(`(${member.role})`)}`, + ` - ${member.organization.name} ${chalk.gray(`(${member.role})`)}` ); } } console.log( chalk.red( - '\nāš ļø This will delete the user account, all sessions, and remove them from all organizations!', - ), + '\nāš ļø This will delete the user account, all sessions, and remove them from all organizations!' + ) ); // First confirmation @@ -155,7 +155,7 @@ export async function deleteUser() { type: 'confirm', name: 'confirmFirst', message: chalk.red( - `Are you ABSOLUTELY SURE you want to delete user "${user.email}"?`, + `Are you ABSOLUTELY SURE you want to delete user "${user.email}"?` ), default: false, }, @@ -186,7 +186,7 @@ export async function deleteUser() { type: 'confirm', name: 'confirmFinal', message: chalk.red( - 'FINAL WARNING: This action CANNOT be undone. Delete now?', + 'FINAL WARNING: This action CANNOT be undone. Delete now?' ), default: false, }, @@ -210,8 +210,8 @@ export async function deleteUser() { console.log(chalk.green('\nāœ… User deleted successfully!')); console.log( chalk.gray( - `Deleted: ${user.email} (removed from ${user.membership.length} organizations)`, - ), + `Deleted: ${user.email} (removed from ${user.membership.length} organizations)` + ) ); } catch (error) { console.error(chalk.red('\nāŒ Error deleting user:'), error); diff --git a/admin/src/commands/lookup-client.ts b/admin/src/commands/lookup-client.ts index 634dfd6b..25eebd58 100644 --- a/admin/src/commands/lookup-client.ts +++ b/admin/src/commands/lookup-client.ts @@ -47,7 +47,7 @@ export async function lookupByClient() { displayText: `${client.organization.name} → ${client.project?.name || '[No Project]'} → ${client.name} ${chalk.gray(`(${client.id})`)}`, })); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: ClientSearchItem) => `${item.organizationName} ${item.projectName || ''} ${item.name} ${item.id}`, @@ -101,4 +101,3 @@ export async function lookupByClient() { highlightClientId: selectedClient.id, }); } - diff --git a/admin/src/commands/lookup-email.ts b/admin/src/commands/lookup-email.ts index fd9695a7..642c85f2 100644 --- a/admin/src/commands/lookup-email.ts +++ b/admin/src/commands/lookup-email.ts @@ -52,7 +52,7 @@ export async function lookupByEmail() { }; }); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: EmailSearchItem) => `${item.email} ${item.organizationName}`, @@ -103,10 +103,9 @@ export async function lookupByEmail() { console.log( chalk.yellow( - `\nShowing organization for: ${selectedMember.email} (${selectedMember.role})\n`, - ), + `\nShowing organization for: ${selectedMember.email} (${selectedMember.role})\n` + ) ); displayOrganizationDetails(organization); } - diff --git a/admin/src/commands/lookup-org.ts b/admin/src/commands/lookup-org.ts index 120ce47e..c1a21394 100644 --- a/admin/src/commands/lookup-org.ts +++ b/admin/src/commands/lookup-org.ts @@ -35,7 +35,7 @@ export async function lookupByOrg() { displayText: `${org.name} ${chalk.gray(`(${org.id})`)}`, })); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: OrgSearchItem) => `${item.name} ${item.id}`, }); @@ -85,4 +85,3 @@ export async function lookupByOrg() { displayOrganizationDetails(organization); } - diff --git a/admin/src/commands/lookup-project.ts b/admin/src/commands/lookup-project.ts index 0f6ddbe4..809df07f 100644 --- a/admin/src/commands/lookup-project.ts +++ b/admin/src/commands/lookup-project.ts @@ -42,7 +42,7 @@ export async function lookupByProject() { displayText: `${project.organization.name} → ${project.name} ${chalk.gray(`(${project.id})`)}`, })); - const searchFunction = async (_answers: unknown, input = '') => { + const searchFunction = (_answers: unknown, input = '') => { const fuzzyResult = fuzzy.filter(input, searchItems, { extract: (item: ProjectSearchItem) => `${item.organizationName} ${item.name} ${item.id}`, @@ -95,4 +95,3 @@ export async function lookupByProject() { highlightProjectId: selectedProject.id, }); } - diff --git a/admin/src/utils/display.ts b/admin/src/utils/display.ts index c10e26c4..002fa379 100644 --- a/admin/src/utils/display.ts +++ b/admin/src/utils/display.ts @@ -23,7 +23,7 @@ interface DisplayOptions { export function displayOrganizationDetails( organization: OrganizationWithDetails, - options: DisplayOptions = {}, + options: DisplayOptions = {} ) { console.log(`\n${'='.repeat(80)}`); console.log(chalk.bold.yellow(`\nšŸ“Š ORGANIZATION: ${organization.name}`)); @@ -34,18 +34,18 @@ export function displayOrganizationDetails( console.log(` ${chalk.gray('ID:')} ${organization.id}`); console.log(` ${chalk.gray('Name:')} ${organization.name}`); console.log( - ` ${chalk.gray('Created:')} ${organization.createdAt.toISOString()}`, + ` ${chalk.gray('Created:')} ${organization.createdAt.toISOString()}` ); console.log(` ${chalk.gray('Timezone:')} ${organization.timezone || 'UTC'}`); // Subscription info if (organization.subscriptionStatus) { console.log( - ` ${chalk.gray('Subscription Status:')} ${getSubscriptionStatusColor(organization.subscriptionStatus)}`, + ` ${chalk.gray('Subscription Status:')} ${getSubscriptionStatusColor(organization.subscriptionStatus)}` ); if (organization.subscriptionPriceId) { console.log( - ` ${chalk.gray('Price ID:')} ${organization.subscriptionPriceId}`, + ` ${chalk.gray('Price ID:')} ${organization.subscriptionPriceId}` ); } if (organization.subscriptionPeriodEventsLimit) { @@ -61,24 +61,24 @@ export function displayOrganizationDetails( ? chalk.yellow : chalk.green; console.log( - ` ${chalk.gray('Event Usage:')} ${color(usage)} (${percentage.toFixed(1)}%)`, + ` ${chalk.gray('Event Usage:')} ${color(usage)} (${percentage.toFixed(1)}%)` ); } if (organization.subscriptionStartsAt) { console.log( - ` ${chalk.gray('Starts:')} ${organization.subscriptionStartsAt.toISOString()}`, + ` ${chalk.gray('Starts:')} ${organization.subscriptionStartsAt.toISOString()}` ); } if (organization.subscriptionEndsAt) { console.log( - ` ${chalk.gray('Ends:')} ${organization.subscriptionEndsAt.toISOString()}`, + ` ${chalk.gray('Ends:')} ${organization.subscriptionEndsAt.toISOString()}` ); } } if (organization.deleteAt) { console.log( - ` ${chalk.red.bold('āš ļø Scheduled for deletion:')} ${organization.deleteAt.toISOString()}`, + ` ${chalk.red.bold('āš ļø Scheduled for deletion:')} ${organization.deleteAt.toISOString()}` ); } @@ -90,7 +90,7 @@ export function displayOrganizationDetails( for (const member of organization.members) { const roleBadge = getRoleBadge(member.role); console.log( - ` ${roleBadge} ${member.user?.email || member.email || 'Unknown'} ${chalk.gray(`(${member.role})`)}`, + ` ${roleBadge} ${member.user?.email || member.email || 'Unknown'} ${chalk.gray(`(${member.role})`)}` ); } } @@ -108,7 +108,7 @@ export function displayOrganizationDetails( console.log(`\n${projectPrefix}${chalk.bold.green(project.name)}`); console.log(` ${chalk.gray('ID:')} ${project.id}`); console.log( - ` ${chalk.gray('Events Count:')} ${project.eventsCount.toLocaleString()}`, + ` ${chalk.gray('Events Count:')} ${project.eventsCount.toLocaleString()}` ); if (project.domain) { @@ -120,15 +120,15 @@ export function displayOrganizationDetails( } console.log( - ` ${chalk.gray('Cross Domain:')} ${project.crossDomain ? chalk.green('āœ“') : chalk.red('āœ—')}`, + ` ${chalk.gray('Cross Domain:')} ${project.crossDomain ? chalk.green('āœ“') : chalk.red('āœ—')}` ); console.log( - ` ${chalk.gray('Created:')} ${project.createdAt.toISOString()}`, + ` ${chalk.gray('Created:')} ${project.createdAt.toISOString()}` ); if (project.deleteAt) { console.log( - ` ${chalk.red.bold('āš ļø Scheduled for deletion:')} ${project.deleteAt.toISOString()}`, + ` ${chalk.red.bold('āš ļø Scheduled for deletion:')} ${project.deleteAt.toISOString()}` ); } @@ -146,10 +146,10 @@ export function displayOrganizationDetails( console.log(` ${chalk.gray('ID:')} ${client.id}`); console.log(` ${chalk.gray('Type:')} ${client.type}`); console.log( - ` ${chalk.gray('Has Secret:')} ${client.secret ? chalk.green('āœ“') : chalk.red('āœ—')}`, + ` ${chalk.gray('Has Secret:')} ${client.secret ? chalk.green('āœ“') : chalk.red('āœ—')}` ); console.log( - ` ${chalk.gray('Ignore CORS/Secret:')} ${client.ignoreCorsAndSecret ? chalk.yellow('āœ“') : chalk.gray('āœ—')}`, + ` ${chalk.gray('Ignore CORS/Secret:')} ${client.ignoreCorsAndSecret ? chalk.yellow('āœ“') : chalk.gray('āœ—')}` ); } } else { @@ -159,7 +159,7 @@ export function displayOrganizationDetails( } // Clients without projects (organization-level clients) - const orgLevelClients = organization.projects.length > 0 ? [] : []; // We need to query these separately + const _orgLevelClients = organization.projects.length > 0 ? [] : []; // We need to query these separately console.log(`\n${'='.repeat(80)}\n`); } diff --git a/admin/tsconfig.json b/admin/tsconfig.json index 57984ba8..b2691e3a 100644 --- a/admin/tsconfig.json +++ b/admin/tsconfig.json @@ -5,11 +5,8 @@ "rootDir": "src", "target": "ES2022", "lib": ["ES2022"], - "types": [ - "node" - ], + "types": ["node"], "strictNullChecks": true }, "include": ["src"] } - diff --git a/apps/api/package.json b/apps/api/package.json index 5f63bc5d..4f44db80 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -65,4 +65,4 @@ "tsdown": "0.14.2", "typescript": "catalog:" } -} \ No newline at end of file +} diff --git a/apps/api/scripts/get-bots.ts b/apps/api/scripts/get-bots.ts index 2dfe32e2..855f81a4 100644 --- a/apps/api/scripts/get-bots.ts +++ b/apps/api/scripts/get-bots.ts @@ -1,14 +1,14 @@ import fs from 'node:fs'; -import path from 'node:path'; -import { dirname } from 'node:path'; +import path, { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); + import yaml from 'js-yaml'; // Regex special characters that indicate we need actual regex -const regexSpecialChars = /[|^$.*+?(){}\[\]\\]/; +const regexSpecialChars = /[|^$.*+?(){}[\]\\]/; function transformBots(bots: any[]): any[] { return bots.map((bot) => { @@ -28,7 +28,7 @@ async function main() { // Get document, or throw exception on error try { const data = await fetch( - 'https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes/bots.yml', + 'https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes/bots.yml' ).then((res) => res.text()); const parsedData = yaml.load(data) as any[]; @@ -45,11 +45,11 @@ async function main() { 'export default bots;', '', ].join('\n'), - 'utf-8', + 'utf-8' ); console.log( - `āœ… Generated bots.ts with ${transformedBots.length} bot entries`, + `āœ… Generated bots.ts with ${transformedBots.length} bot entries` ); const regexCount = transformedBots.filter((b) => 'regex' in b).length; const includesCount = transformedBots.filter((b) => 'includes' in b).length; diff --git a/apps/api/scripts/mock.ts b/apps/api/scripts/mock.ts index a4bdbf7c..8a3243d4 100644 --- a/apps/api/scripts/mock.ts +++ b/apps/api/scripts/mock.ts @@ -133,7 +133,7 @@ function generateEvents(): Event[] { clientId, profile: profiles[i % PROFILE_COUNT]!, eventsCount: Math.floor(Math.random() * 10), - }), + }) ); } }); @@ -150,7 +150,7 @@ let lastTriggeredIndex = 0; async function triggerEvents(generatedEvents: any[]) { const EVENTS_PER_SECOND = Number.parseInt( process.env.EVENTS_PER_SECOND || '100', - 10, + 10 ); const INTERVAL_MS = 1000 / EVENTS_PER_SECOND; @@ -164,7 +164,7 @@ async function triggerEvents(generatedEvents: any[]) { await trackit(event); console.log(`Event ${lastTriggeredIndex + 1} sent successfully`); console.log( - `sending ${event.track.payload?.properties?.__path} from user ${event.headers['user-agent']}`, + `sending ${event.track.payload?.properties?.__path} from user ${event.headers['user-agent']}` ); } catch (error) { console.error(`Failed to send event ${lastTriggeredIndex + 1}:`, error); @@ -174,7 +174,7 @@ async function triggerEvents(generatedEvents: any[]) { const remainingEvents = generatedEvents.length - lastTriggeredIndex; console.log( - `Triggered ${lastTriggeredIndex} events. Remaining: ${remainingEvents}`, + `Triggered ${lastTriggeredIndex} events. Remaining: ${remainingEvents}` ); if (remainingEvents > 0) { @@ -215,7 +215,7 @@ async function createMock(file: string) { fs.writeFileSync( file, JSON.stringify(insertFakeEvents(scrambleEvents(generateEvents())), null, 2), - 'utf-8', + 'utf-8' ); } @@ -438,7 +438,7 @@ async function simultaneousRequests() { if (group.parallel && group.tracks.length > 1) { // Parallel execution for same-flagged tracks console.log( - `Firing ${group.tracks.length} parallel requests with flag '${group.parallel}'`, + `Firing ${group.tracks.length} parallel requests with flag '${group.parallel}'` ); const promises = group.tracks.map(async (track) => { const { name, parallel, ...properties } = track; diff --git a/apps/api/scripts/test-manage-api.ts b/apps/api/scripts/test-manage-api.ts index 77b6a8f8..2b2236fa 100644 --- a/apps/api/scripts/test-manage-api.ts +++ b/apps/api/scripts/test-manage-api.ts @@ -14,7 +14,7 @@ const CLIENT_ID = process.env.CLIENT_ID!; const CLIENT_SECRET = process.env.CLIENT_SECRET!; const API_BASE_URL = process.env.API_URL || 'http://localhost:3333'; -if (!CLIENT_ID || !CLIENT_SECRET) { +if (!(CLIENT_ID && CLIENT_SECRET)) { console.error('CLIENT_ID and CLIENT_SECRET must be set'); process.exit(1); } @@ -34,7 +34,7 @@ const results: TestResult[] = []; async function makeRequest( method: string, path: string, - body?: any, + body?: any ): Promise { const url = `${API_BASE_URL}${path}`; const headers: Record = { @@ -90,9 +90,11 @@ async function testProjects() { }); results.push(createResult); console.log( - `āœ“ POST /manage/projects: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}`, + `āœ“ POST /manage/projects: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}` ); - if (createResult.error) console.log(` Error: ${createResult.error}`); + if (createResult.error) { + console.log(` Error: ${createResult.error}`); + } const projectId = createResult.data?.data?.id; const clientId = createResult.data?.data?.client?.id; @@ -100,15 +102,19 @@ async function testProjects() { if (projectId) { console.log(` Created project: ${projectId}`); - if (clientId) console.log(` Created client: ${clientId}`); - if (clientSecret) console.log(` Client secret: ${clientSecret}`); + if (clientId) { + console.log(` Created client: ${clientId}`); + } + if (clientSecret) { + console.log(` Client secret: ${clientSecret}`); + } } // List projects const listResult = await makeRequest('GET', '/manage/projects'); results.push(listResult); console.log( - `āœ“ GET /manage/projects: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}`, + `āœ“ GET /manage/projects: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}` ); if (listResult.data?.data?.length) { console.log(` Found ${listResult.data.data.length} projects`); @@ -119,7 +125,7 @@ async function testProjects() { const getResult = await makeRequest('GET', `/manage/projects/${projectId}`); results.push(getResult); console.log( - `āœ“ GET /manage/projects/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}`, + `āœ“ GET /manage/projects/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}` ); // Update project @@ -129,21 +135,21 @@ async function testProjects() { { name: 'Updated Test Project', crossDomain: true, - }, + } ); results.push(updateResult); console.log( - `āœ“ PATCH /manage/projects/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}`, + `āœ“ PATCH /manage/projects/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}` ); // Delete project (soft delete) const deleteResult = await makeRequest( 'DELETE', - `/manage/projects/${projectId}`, + `/manage/projects/${projectId}` ); results.push(deleteResult); console.log( - `āœ“ DELETE /manage/projects/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}`, + `āœ“ DELETE /manage/projects/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}` ); } @@ -161,26 +167,30 @@ async function testClients(projectId?: string) { }); results.push(createResult); console.log( - `āœ“ POST /manage/clients: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}`, + `āœ“ POST /manage/clients: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}` ); - if (createResult.error) console.log(` Error: ${createResult.error}`); + if (createResult.error) { + console.log(` Error: ${createResult.error}`); + } const clientId = createResult.data?.data?.id; const clientSecret = createResult.data?.data?.secret; if (clientId) { console.log(` Created client: ${clientId}`); - if (clientSecret) console.log(` Client secret: ${clientSecret}`); + if (clientSecret) { + console.log(` Client secret: ${clientSecret}`); + } } // List clients const listResult = await makeRequest( 'GET', - projectId ? `/manage/clients?projectId=${projectId}` : '/manage/clients', + projectId ? `/manage/clients?projectId=${projectId}` : '/manage/clients' ); results.push(listResult); console.log( - `āœ“ GET /manage/clients: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}`, + `āœ“ GET /manage/clients: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}` ); if (listResult.data?.data?.length) { console.log(` Found ${listResult.data.data.length} clients`); @@ -191,7 +201,7 @@ async function testClients(projectId?: string) { const getResult = await makeRequest('GET', `/manage/clients/${clientId}`); results.push(getResult); console.log( - `āœ“ GET /manage/clients/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}`, + `āœ“ GET /manage/clients/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}` ); // Update client @@ -200,21 +210,21 @@ async function testClients(projectId?: string) { `/manage/clients/${clientId}`, { name: 'Updated Test Client', - }, + } ); results.push(updateResult); console.log( - `āœ“ PATCH /manage/clients/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}`, + `āœ“ PATCH /manage/clients/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}` ); // Delete client const deleteResult = await makeRequest( 'DELETE', - `/manage/clients/${clientId}`, + `/manage/clients/${clientId}` ); results.push(deleteResult); console.log( - `āœ“ DELETE /manage/clients/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}`, + `āœ“ DELETE /manage/clients/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}` ); } } @@ -236,9 +246,11 @@ async function testReferences(projectId?: string) { }); results.push(createResult); console.log( - `āœ“ POST /manage/references: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}`, + `āœ“ POST /manage/references: ${createResult.success ? 'āœ…' : 'āŒ'} ${createResult.status}` ); - if (createResult.error) console.log(` Error: ${createResult.error}`); + if (createResult.error) { + console.log(` Error: ${createResult.error}`); + } const referenceId = createResult.data?.data?.id; @@ -249,11 +261,11 @@ async function testReferences(projectId?: string) { // List references const listResult = await makeRequest( 'GET', - `/manage/references?projectId=${projectId}`, + `/manage/references?projectId=${projectId}` ); results.push(listResult); console.log( - `āœ“ GET /manage/references: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}`, + `āœ“ GET /manage/references: ${listResult.success ? 'āœ…' : 'āŒ'} ${listResult.status}` ); if (listResult.data?.data?.length) { console.log(` Found ${listResult.data.data.length} references`); @@ -263,11 +275,11 @@ async function testReferences(projectId?: string) { // Get reference const getResult = await makeRequest( 'GET', - `/manage/references/${referenceId}`, + `/manage/references/${referenceId}` ); results.push(getResult); console.log( - `āœ“ GET /manage/references/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}`, + `āœ“ GET /manage/references/:id: ${getResult.success ? 'āœ…' : 'āŒ'} ${getResult.status}` ); // Update reference @@ -278,21 +290,21 @@ async function testReferences(projectId?: string) { title: 'Updated Test Reference', description: 'Updated description', datetime: new Date().toISOString(), - }, + } ); results.push(updateResult); console.log( - `āœ“ PATCH /manage/references/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}`, + `āœ“ PATCH /manage/references/:id: ${updateResult.success ? 'āœ…' : 'āŒ'} ${updateResult.status}` ); // Delete reference const deleteResult = await makeRequest( 'DELETE', - `/manage/references/${referenceId}`, + `/manage/references/${referenceId}` ); results.push(deleteResult); console.log( - `āœ“ DELETE /manage/references/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}`, + `āœ“ DELETE /manage/references/:id: ${deleteResult.success ? 'āœ…' : 'āŒ'} ${deleteResult.status}` ); } } @@ -328,7 +340,9 @@ async function main() { .filter((r) => !r.success) .forEach((r) => { console.log(` āŒ ${r.name} (${r.status})`); - if (r.error) console.log(` Error: ${r.error}`); + if (r.error) { + console.log(` Error: ${r.error}`); + } }); } } catch (error) { diff --git a/apps/api/scripts/test.ts b/apps/api/scripts/test.ts index 08fe47e7..c084f951 100644 --- a/apps/api/scripts/test.ts +++ b/apps/api/scripts/test.ts @@ -1,11 +1,10 @@ -import { type IClickhouseEvent, ch, createEvent } from '@openpanel/db'; -import { formatClickhouseDate } from '@openpanel/db'; +import { ch, formatClickhouseDate, type IClickhouseEvent } from '@openpanel/db'; import { v4 as uuid } from 'uuid'; async function main() { const startDate = new Date('2025-01-01T00:00:00Z'); const endDate = new Date(); - const eventsPerDay = 25000; + const eventsPerDay = 25_000; const variance = 3000; // Event names to randomly choose from @@ -36,7 +35,7 @@ async function main() { device_id: `device_${Math.floor(Math.random() * 1000)}`, profile_id: `profile_${Math.floor(Math.random() * 1000)}`, project_id: 'testing', - session_id: `session_${Math.floor(Math.random() * 10000)}`, + session_id: `session_${Math.floor(Math.random() * 10_000)}`, properties: { hash: 'test-hash', 'query.utm_source': 'test', @@ -75,7 +74,7 @@ async function main() { // Log progress console.log( - `Created ${dailyEvents} events for ${currentDate.toISOString().split('T')[0]}`, + `Created ${dailyEvents} events for ${currentDate.toISOString().split('T')[0]}` ); } } diff --git a/apps/api/src/controllers/ai.controller.ts b/apps/api/src/controllers/ai.controller.ts index 02ede1ce..64b707cc 100644 --- a/apps/api/src/controllers/ai.controller.ts +++ b/apps/api/src/controllers/ai.controller.ts @@ -1,3 +1,7 @@ +import { db, getOrganizationByProjectIdCached } from '@openpanel/db'; +import { getProjectAccess } from '@openpanel/trpc/src/access'; +import { appendResponseMessages, type Message, streamText } from 'ai'; +import type { FastifyReply, FastifyRequest } from 'fastify'; import { getChatModel, getChatSystemPrompt } from '@/utils/ai'; import { getAllEventNames, @@ -8,10 +12,6 @@ import { getReport, } from '@/utils/ai-tools'; import { HttpError } from '@/utils/errors'; -import { db, getOrganizationByProjectIdCached } from '@openpanel/db'; -import { getProjectAccess } from '@openpanel/trpc/src/access'; -import { type Message, appendResponseMessages, streamText } from 'ai'; -import type { FastifyReply, FastifyRequest } from 'fastify'; export async function chat( request: FastifyRequest<{ @@ -22,7 +22,7 @@ export async function chat( messages: Message[]; }; }>, - reply: FastifyReply, + reply: FastifyReply ) { const { session } = request.session; const { messages } = request.body; @@ -117,7 +117,7 @@ export async function chat( }, }); }, - onError: async (error) => { + onError: (error) => { request.log.error('chat error', { error }); }, }); diff --git a/apps/api/src/controllers/error.html b/apps/api/src/controllers/error.html index b174d613..52f05b9a 100644 --- a/apps/api/src/controllers/error.html +++ b/apps/api/src/controllers/error.html @@ -1,18 +1,20 @@ - - - - - Error - OpenPanel - - - + + - -
- -

Oops! Something went wrong

-

We encountered an error while processing your request. Please try again later or contact support if the problem - persists.

-
- - - \ No newline at end of file + +
+ +

Oops! Something went wrong

+

+ We encountered an error while processing your request. Please try again + later or contact support if the problem persists. +

+
+ + diff --git a/apps/api/src/controllers/export.controller.ts b/apps/api/src/controllers/export.controller.ts index d568439b..6558f3bc 100644 --- a/apps/api/src/controllers/export.controller.ts +++ b/apps/api/src/controllers/export.controller.ts @@ -71,22 +71,22 @@ const eventsScheme = z.object({ page: z.coerce.number().optional().default(1), limit: z.coerce.number().optional().default(50), includes: z - .preprocess( - (arg) => { - if (arg == null) { - return undefined; - } - if (Array.isArray(arg)) { - return arg; - } - if (typeof arg === 'string') { - const parts = arg.split(',').map((s) => s.trim()).filter(Boolean); - return parts; - } + .preprocess((arg) => { + if (arg == null) { + return undefined; + } + if (Array.isArray(arg)) { return arg; - }, - z.array(z.string()) - ) + } + if (typeof arg === 'string') { + const parts = arg + .split(',') + .map((s) => s.trim()) + .filter(Boolean); + return parts; + } + return arg; + }, z.array(z.string())) .optional(), }); diff --git a/apps/api/src/controllers/import.controller.ts b/apps/api/src/controllers/import.controller.ts index 188aa725..d97019fe 100644 --- a/apps/api/src/controllers/import.controller.ts +++ b/apps/api/src/controllers/import.controller.ts @@ -1,14 +1,13 @@ -import type { FastifyReply, FastifyRequest } from 'fastify'; - import { toDots } from '@openpanel/common'; import type { IClickhouseEvent } from '@openpanel/db'; -import { TABLE_NAMES, ch, formatClickhouseDate } from '@openpanel/db'; +import { ch, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db'; +import type { FastifyReply, FastifyRequest } from 'fastify'; export async function importEvents( request: FastifyRequest<{ Body: IClickhouseEvent[]; }>, - reply: FastifyReply, + reply: FastifyReply ) { const projectId = request.client?.projectId; if (!projectId) { diff --git a/apps/api/src/controllers/insights.controller.ts b/apps/api/src/controllers/insights.controller.ts index b8051ae3..94537ad5 100644 --- a/apps/api/src/controllers/insights.controller.ts +++ b/apps/api/src/controllers/insights.controller.ts @@ -1,4 +1,3 @@ -import { parseQueryString } from '@/utils/parse-zod-query-string'; import { getDefaultIntervalByDates } from '@openpanel/constants'; import { eventBuffer, @@ -9,6 +8,7 @@ import { import { zChartEventFilter, zRange } from '@openpanel/validation'; import type { FastifyReply, FastifyRequest } from 'fastify'; import { z } from 'zod'; +import { parseQueryString } from '@/utils/parse-zod-query-string'; const zGetMetricsQuery = z.object({ startDate: z.string().nullish(), @@ -22,7 +22,7 @@ export async function getMetrics( Params: { projectId: string }; Querystring: z.infer; }>, - reply: FastifyReply, + reply: FastifyReply ) { const { timezone } = await getSettingsForProject(request.params.projectId); const parsed = zGetMetricsQuery.safeParse(parseQueryString(request.query)); @@ -41,11 +41,11 @@ export async function getMetrics( await overviewService.getMetrics({ projectId: request.params.projectId, filters: parsed.data.filters, - startDate: startDate, - endDate: endDate, + startDate, + endDate, interval: getDefaultIntervalByDates(startDate, endDate) ?? 'day', timezone, - }), + }) ); } @@ -54,7 +54,7 @@ export async function getLiveVisitors( request: FastifyRequest<{ Params: { projectId: string }; }>, - reply: FastifyReply, + reply: FastifyReply ) { reply.send({ visitors: await eventBuffer.getActiveVisitorCount(request.params.projectId), @@ -76,7 +76,7 @@ export async function getPages( Params: { projectId: string }; Querystring: z.infer; }>, - reply: FastifyReply, + reply: FastifyReply ) { const { timezone } = await getSettingsForProject(request.params.projectId); const { startDate, endDate } = getChartStartEndDate(request.query, timezone); @@ -93,8 +93,8 @@ export async function getPages( return overviewService.getTopPages({ projectId: request.params.projectId, filters: parsed.data.filters, - startDate: startDate, - endDate: endDate, + startDate, + endDate, timezone, }); } @@ -132,19 +132,19 @@ const zGetOverviewGenericQuery = z.object({ }); export function getOverviewGeneric( - column: z.infer['column'], + column: z.infer['column'] ) { return async ( request: FastifyRequest<{ Params: { projectId: string; key: string }; Querystring: z.infer; }>, - reply: FastifyReply, + reply: FastifyReply ) => { const { timezone } = await getSettingsForProject(request.params.projectId); const { startDate, endDate } = getChartStartEndDate( request.query, - timezone, + timezone ); const parsed = zGetOverviewGenericQuery.safeParse({ ...parseQueryString(request.query), @@ -165,10 +165,10 @@ export function getOverviewGeneric( column, projectId: request.params.projectId, filters: parsed.data.filters, - startDate: startDate, - endDate: endDate, + startDate, + endDate, timezone, - }), + }) ); }; } diff --git a/apps/api/src/controllers/misc.controller.ts b/apps/api/src/controllers/misc.controller.ts index 48057356..c004936d 100644 --- a/apps/api/src/controllers/misc.controller.ts +++ b/apps/api/src/controllers/misc.controller.ts @@ -1,16 +1,15 @@ import crypto from 'node:crypto'; -import { logger } from '@/utils/logger'; -import { parseUrlMeta } from '@/utils/parseUrlMeta'; -import type { FastifyReply, FastifyRequest } from 'fastify'; -import sharp from 'sharp'; - import { DEFAULT_IP_HEADER_ORDER, getClientIpFromHeaders, } from '@openpanel/common/server/get-client-ip'; -import { TABLE_NAMES, ch, chQuery, formatClickhouseDate } from '@openpanel/db'; +import { ch, chQuery, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db'; import { type GeoLocation, getGeoLocation } from '@openpanel/geo'; import { getCache, getRedisCache } from '@openpanel/redis'; +import type { FastifyReply, FastifyRequest } from 'fastify'; +import sharp from 'sharp'; +import { logger } from '@/utils/logger'; +import { parseUrlMeta } from '@/utils/parseUrlMeta'; interface GetFaviconParams { url: string; @@ -29,7 +28,9 @@ function createCacheKey(url: string, prefix = 'favicon'): string { function validateUrl(raw?: string): URL | null { try { - if (!raw) throw new Error('Missing ?url'); + if (!raw) { + throw new Error('Missing ?url'); + } const url = new URL(raw); if (url.protocol !== 'http:' && url.protocol !== 'https:') { throw new Error('Only http/https URLs are allowed'); @@ -42,7 +43,7 @@ function validateUrl(raw?: string): URL | null { // Binary cache functions (more efficient than base64) async function getFromCacheBinary( - key: string, + key: string ): Promise<{ buffer: Buffer; contentType: string } | null> { const redis = getRedisCache(); const [bufferBase64, contentType] = await Promise.all([ @@ -50,14 +51,16 @@ async function getFromCacheBinary( redis.get(`${key}:ctype`), ]); - if (!bufferBase64 || !contentType) return null; + if (!(bufferBase64 && contentType)) { + return null; + } return { buffer: Buffer.from(bufferBase64, 'base64'), contentType }; } async function setToCacheBinary( key: string, buffer: Buffer, - contentType: string, + contentType: string ): Promise { const redis = getRedisCache(); await Promise.all([ @@ -68,7 +71,7 @@ async function setToCacheBinary( // Fetch image with timeout and size limits async function fetchImage( - url: URL, + url: URL ): Promise<{ buffer: Buffer; contentType: string; status: number }> { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 1000); // 10s timeout @@ -132,7 +135,7 @@ function isSvgFile(url: string, contentType?: string): boolean { async function processImage( buffer: Buffer, originalUrl?: string, - contentType?: string, + contentType?: string ): Promise { // If it's an ICO file, just return it as-is (no conversion needed) if (originalUrl && isIcoFile(originalUrl, contentType)) { @@ -183,10 +186,10 @@ async function processImage( async function processOgImage( buffer: Buffer, originalUrl?: string, - contentType?: string, + contentType?: string ): Promise { // If buffer is small enough, return it as-is - if (buffer.length < 10000) { + if (buffer.length < 10_000) { logger.debug('Serving OG image directly without processing', { originalUrl, bufferSize: buffer.length, @@ -227,7 +230,7 @@ export async function getFavicon( request: FastifyRequest<{ Querystring: GetFaviconParams; }>, - reply: FastifyReply, + reply: FastifyReply ) { try { logger.info('getFavicon', { @@ -295,7 +298,7 @@ export async function getFavicon( if (buffer.length === 0 && !imageUrl.hostname.includes('duckduckgo.com')) { const { hostname } = url; const duckduckgoUrl = new URL( - `https://icons.duckduckgo.com/ip3/${hostname}.ico`, + `https://icons.duckduckgo.com/ip3/${hostname}.ico` ); logger.info('Trying DuckDuckGo favicon service', { @@ -328,7 +331,7 @@ export async function getFavicon( const processedBuffer = await processImage( buffer, imageUrl.toString(), - contentType, + contentType ); logger.info('Favicon processing result', { @@ -380,7 +383,7 @@ export async function getFavicon( export async function clearFavicons( request: FastifyRequest, - reply: FastifyReply, + reply: FastifyReply ) { const redis = getRedisCache(); const keys = await redis.keys('favicon:*'); @@ -396,7 +399,7 @@ export async function clearFavicons( export async function clearOgImages( request: FastifyRequest, - reply: FastifyReply, + reply: FastifyReply ) { const redis = getRedisCache(); const keys = await redis.keys('og:*'); @@ -417,7 +420,7 @@ export async function ping( count: number; }; }>, - reply: FastifyReply, + reply: FastifyReply ) { try { await ch.insert({ @@ -449,10 +452,10 @@ export async function ping( export async function stats(request: FastifyRequest, reply: FastifyReply) { const res = await getCache('api:stats', 60 * 60, async () => { const projects = await chQuery<{ project_id: string; count: number }>( - `SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()`, + `SELECT project_id, count(*) as count from ${TABLE_NAMES.events} GROUP by project_id order by count()` ); const last24h = await chQuery<{ count: number }>( - `SELECT count(*) as count from ${TABLE_NAMES.events} WHERE created_at > now() - interval '24 hours'`, + `SELECT count(*) as count from ${TABLE_NAMES.events} WHERE created_at > now() - interval '24 hours'` ); return { projects, last24hCount: last24h[0]?.count || 0 }; }); @@ -474,7 +477,7 @@ export async function getGeo(request: FastifyRequest, reply: FastifyReply) { ip, geo: await getGeoLocation(ip), }; - }), + }) ); if (!ip) { @@ -492,7 +495,7 @@ export async function getGeo(request: FastifyRequest, reply: FastifyReply) { acc[other.header] = other; return acc; }, - {} as Record, + {} as Record ), }); } @@ -503,7 +506,7 @@ export async function getOgImage( url: string; }; }>, - reply: FastifyReply, + reply: FastifyReply ) { try { const url = validateUrl(request.query.url); @@ -547,7 +550,7 @@ export async function getOgImage( const processedBuffer = await processOgImage( buffer, imageUrl.toString(), - contentType, + contentType ); // Cache the result diff --git a/apps/api/src/controllers/profile.controller.ts b/apps/api/src/controllers/profile.controller.ts index 9dd5efd7..ad00e5e3 100644 --- a/apps/api/src/controllers/profile.controller.ts +++ b/apps/api/src/controllers/profile.controller.ts @@ -1,6 +1,3 @@ -import type { FastifyReply, FastifyRequest } from 'fastify'; -import { assocPath, pathOr } from 'ramda'; - import { parseUserAgent } from '@openpanel/common/server'; import { getProfileById, upsertProfile } from '@openpanel/db'; import { getGeoLocation } from '@openpanel/geo'; @@ -8,12 +5,14 @@ import type { DeprecatedIncrementProfilePayload, DeprecatedUpdateProfilePayload, } from '@openpanel/validation'; +import type { FastifyReply, FastifyRequest } from 'fastify'; +import { assocPath, pathOr } from 'ramda'; export async function updateProfile( request: FastifyRequest<{ Body: DeprecatedUpdateProfilePayload; }>, - reply: FastifyReply, + reply: FastifyReply ) { const payload = request.body; const projectId = request.client!.projectId; @@ -54,7 +53,7 @@ export async function incrementProfileProperty( request: FastifyRequest<{ Body: DeprecatedIncrementProfilePayload; }>, - reply: FastifyReply, + reply: FastifyReply ) { const { profileId, property, value } = request.body; const projectId = request.client!.projectId; @@ -69,7 +68,7 @@ export async function incrementProfileProperty( const parsed = Number.parseInt( pathOr('0', property.split('.'), profile.properties), - 10, + 10 ); if (Number.isNaN(parsed)) { @@ -79,7 +78,7 @@ export async function incrementProfileProperty( profile.properties = assocPath( property.split('.'), parsed + value, - profile.properties, + profile.properties ); await upsertProfile({ @@ -96,7 +95,7 @@ export async function decrementProfileProperty( request: FastifyRequest<{ Body: DeprecatedIncrementProfilePayload; }>, - reply: FastifyReply, + reply: FastifyReply ) { const { profileId, property, value } = request.body; const projectId = request.client?.projectId; @@ -111,7 +110,7 @@ export async function decrementProfileProperty( const parsed = Number.parseInt( pathOr('0', property.split('.'), profile.properties), - 10, + 10 ); if (Number.isNaN(parsed)) { @@ -121,7 +120,7 @@ export async function decrementProfileProperty( profile.properties = assocPath( property.split('.'), parsed - value, - profile.properties, + profile.properties ); await upsertProfile({ diff --git a/apps/api/src/controllers/webhook.controller.ts b/apps/api/src/controllers/webhook.controller.ts index 788e2741..c007e342 100644 --- a/apps/api/src/controllers/webhook.controller.ts +++ b/apps/api/src/controllers/webhook.controller.ts @@ -1,18 +1,18 @@ import fs from 'node:fs'; -import path from 'node:path'; -import { dirname } from 'node:path'; +import path, { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); + import { db, getOrganizationByProjectIdCached } from '@openpanel/db'; import { sendSlackNotification, slackInstaller, } from '@openpanel/integrations/src/slack'; import { - PolarWebhookVerificationError, getProduct, + PolarWebhookVerificationError, validatePolarEvent, } from '@openpanel/payments'; import { publishEvent } from '@openpanel/redis'; @@ -34,7 +34,7 @@ export async function slackWebhook( request: FastifyRequest<{ Querystring: unknown; }>, - reply: FastifyReply, + reply: FastifyReply ) { const parsedParams = paramsSchema.safeParse(request.query); @@ -45,10 +45,10 @@ export async function slackWebhook( const veryfiedState = await slackInstaller.stateStore?.verifyStateParam( new Date(), - parsedParams.data.state, + parsedParams.data.state ); const parsedMetadata = metadataSchema.safeParse( - JSON.parse(veryfiedState?.metadata ?? '{}'), + JSON.parse(veryfiedState?.metadata ?? '{}') ); if (!parsedMetadata.success) { @@ -75,7 +75,7 @@ export async function slackWebhook( zod: parsedJson, json, }, - 'Failed to parse slack auth response', + 'Failed to parse slack auth response' ); const html = fs.readFileSync(path.join(__dirname, 'error.html'), 'utf8'); return reply.status(500).header('Content-Type', 'text/html').send(html); @@ -104,7 +104,7 @@ export async function slackWebhook( }); return reply.redirect( - `${process.env.DASHBOARD_URL || process.env.NEXT_PUBLIC_DASHBOARD_URL}/${organizationId}/integrations/installed`, + `${process.env.DASHBOARD_URL || process.env.NEXT_PUBLIC_DASHBOARD_URL}/${organizationId}/integrations/installed` ); } catch (err) { request.log.error(err); @@ -128,13 +128,13 @@ export async function polarWebhook( request: FastifyRequest<{ Querystring: unknown; }>, - reply: FastifyReply, + reply: FastifyReply ) { try { const event = validatePolarEvent( request.rawBody!, request.headers as Record, - process.env.POLAR_WEBHOOK_SECRET ?? '', + process.env.POLAR_WEBHOOK_SECRET ?? '' ); switch (event.type) { diff --git a/apps/api/src/hooks/client.hook.ts b/apps/api/src/hooks/client.hook.ts index a58db7b3..b188b866 100644 --- a/apps/api/src/hooks/client.hook.ts +++ b/apps/api/src/hooks/client.hook.ts @@ -1,15 +1,15 @@ -import { SdkAuthError, validateSdkRequest } from '@/utils/auth'; import type { DeprecatedPostEventPayload, ITrackHandlerPayload, } from '@openpanel/validation'; import type { FastifyReply, FastifyRequest } from 'fastify'; +import { SdkAuthError, validateSdkRequest } from '@/utils/auth'; export async function clientHook( req: FastifyRequest<{ Body: ITrackHandlerPayload | DeprecatedPostEventPayload; }>, - reply: FastifyReply, + reply: FastifyReply ) { try { const client = await validateSdkRequest(req); diff --git a/apps/api/src/hooks/request-id.hook.ts b/apps/api/src/hooks/request-id.hook.ts index 7d074646..9121e2dd 100644 --- a/apps/api/src/hooks/request-id.hook.ts +++ b/apps/api/src/hooks/request-id.hook.ts @@ -1,8 +1,4 @@ -import type { - FastifyReply, - FastifyRequest, - HookHandlerDoneFunction, -} from 'fastify'; +import type { FastifyRequest } from 'fastify'; export async function requestIdHook(request: FastifyRequest) { if (!request.headers['request-id']) { diff --git a/apps/api/src/routes/ai.router.ts b/apps/api/src/routes/ai.router.ts index e396a2cf..6983cf4b 100644 --- a/apps/api/src/routes/ai.router.ts +++ b/apps/api/src/routes/ai.router.ts @@ -1,6 +1,6 @@ +import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; import * as controller from '@/controllers/ai.controller'; import { activateRateLimiter } from '@/utils/rate-limiter'; -import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; const aiRouter: FastifyPluginCallback = async (fastify) => { await activateRateLimiter< diff --git a/apps/api/src/routes/event.router.ts b/apps/api/src/routes/event.router.ts index 5efa52ad..01cd6191 100644 --- a/apps/api/src/routes/event.router.ts +++ b/apps/api/src/routes/event.router.ts @@ -1,6 +1,5 @@ -import * as controller from '@/controllers/event.controller'; import type { FastifyPluginCallback } from 'fastify'; - +import * as controller from '@/controllers/event.controller'; import { clientHook } from '@/hooks/client.hook'; import { duplicateHook } from '@/hooks/duplicate.hook'; import { isBotHook } from '@/hooks/is-bot.hook'; diff --git a/apps/api/src/routes/export.router.ts b/apps/api/src/routes/export.router.ts index 3dafb42b..c4f182b0 100644 --- a/apps/api/src/routes/export.router.ts +++ b/apps/api/src/routes/export.router.ts @@ -1,8 +1,8 @@ +import { Prisma } from '@openpanel/db'; +import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; import * as controller from '@/controllers/export.controller'; import { validateExportRequest } from '@/utils/auth'; import { activateRateLimiter } from '@/utils/rate-limiter'; -import { Prisma } from '@openpanel/db'; -import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; const exportRouter: FastifyPluginCallback = async (fastify) => { await activateRateLimiter({ diff --git a/apps/api/src/routes/gsc-callback.router.ts b/apps/api/src/routes/gsc-callback.router.ts index 6ac0491d..0c61dea5 100644 --- a/apps/api/src/routes/gsc-callback.router.ts +++ b/apps/api/src/routes/gsc-callback.router.ts @@ -1,5 +1,5 @@ -import { gscGoogleCallback } from '@/controllers/gsc-oauth-callback.controller'; import type { FastifyPluginCallback } from 'fastify'; +import { gscGoogleCallback } from '@/controllers/gsc-oauth-callback.controller'; const router: FastifyPluginCallback = async (fastify) => { fastify.route({ diff --git a/apps/api/src/routes/import.router.ts b/apps/api/src/routes/import.router.ts index fbad804d..8acf7463 100644 --- a/apps/api/src/routes/import.router.ts +++ b/apps/api/src/routes/import.router.ts @@ -1,8 +1,7 @@ +import { Prisma } from '@openpanel/db'; +import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; import * as controller from '@/controllers/import.controller'; import { validateImportRequest } from '@/utils/auth'; -import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; - -import { Prisma } from '@openpanel/db'; const importRouter: FastifyPluginCallback = async (fastify) => { fastify.addHook('preHandler', async (req: FastifyRequest, reply) => { diff --git a/apps/api/src/routes/insights.router.ts b/apps/api/src/routes/insights.router.ts index ccd2dd39..e37ab351 100644 --- a/apps/api/src/routes/insights.router.ts +++ b/apps/api/src/routes/insights.router.ts @@ -1,8 +1,8 @@ +import { Prisma } from '@openpanel/db'; +import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; import * as controller from '@/controllers/insights.controller'; import { validateExportRequest } from '@/utils/auth'; import { activateRateLimiter } from '@/utils/rate-limiter'; -import { Prisma } from '@openpanel/db'; -import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; const insightsRouter: FastifyPluginCallback = async (fastify) => { await activateRateLimiter({ diff --git a/apps/api/src/routes/live.router.ts b/apps/api/src/routes/live.router.ts index d9181ef8..18da4d4f 100644 --- a/apps/api/src/routes/live.router.ts +++ b/apps/api/src/routes/live.router.ts @@ -1,6 +1,6 @@ -import * as controller from '@/controllers/live.controller'; import fastifyWS from '@fastify/websocket'; import type { FastifyPluginCallback } from 'fastify'; +import * as controller from '@/controllers/live.controller'; const liveRouter: FastifyPluginCallback = async (fastify) => { fastify.register(fastifyWS); @@ -9,22 +9,22 @@ const liveRouter: FastifyPluginCallback = async (fastify) => { fastify.get( '/organization/:organizationId', { websocket: true }, - controller.wsOrganizationEvents, + controller.wsOrganizationEvents ); fastify.get( '/visitors/:projectId', { websocket: true }, - controller.wsVisitors, + controller.wsVisitors ); fastify.get( '/events/:projectId', { websocket: true }, - controller.wsProjectEvents, + controller.wsProjectEvents ); fastify.get( '/notifications/:projectId', { websocket: true }, - controller.wsProjectNotifications, + controller.wsProjectNotifications ); }); }; diff --git a/apps/api/src/routes/manage.router.ts b/apps/api/src/routes/manage.router.ts index 70ecfd47..ee356b3d 100644 --- a/apps/api/src/routes/manage.router.ts +++ b/apps/api/src/routes/manage.router.ts @@ -1,8 +1,8 @@ +import { Prisma } from '@openpanel/db'; +import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; import * as controller from '@/controllers/manage.controller'; import { validateManageRequest } from '@/utils/auth'; import { activateRateLimiter } from '@/utils/rate-limiter'; -import { Prisma } from '@openpanel/db'; -import type { FastifyPluginCallback, FastifyRequest } from 'fastify'; const manageRouter: FastifyPluginCallback = async (fastify) => { await activateRateLimiter({ diff --git a/apps/api/src/routes/misc.router.ts b/apps/api/src/routes/misc.router.ts index db5ffba6..c28b79b5 100644 --- a/apps/api/src/routes/misc.router.ts +++ b/apps/api/src/routes/misc.router.ts @@ -1,5 +1,5 @@ -import * as controller from '@/controllers/misc.controller'; import type { FastifyPluginCallback } from 'fastify'; +import * as controller from '@/controllers/misc.controller'; const miscRouter: FastifyPluginCallback = async (fastify) => { fastify.route({ diff --git a/apps/api/src/routes/oauth-callback.router.ts b/apps/api/src/routes/oauth-callback.router.ts index 230ade47..6eab8800 100644 --- a/apps/api/src/routes/oauth-callback.router.ts +++ b/apps/api/src/routes/oauth-callback.router.ts @@ -1,5 +1,5 @@ -import * as controller from '@/controllers/oauth-callback.controller'; import type { FastifyPluginCallback } from 'fastify'; +import * as controller from '@/controllers/oauth-callback.controller'; const router: FastifyPluginCallback = async (fastify) => { fastify.route({ diff --git a/apps/api/src/routes/profile.router.ts b/apps/api/src/routes/profile.router.ts index 990f8b10..2ac30746 100644 --- a/apps/api/src/routes/profile.router.ts +++ b/apps/api/src/routes/profile.router.ts @@ -1,7 +1,7 @@ +import type { FastifyPluginCallback } from 'fastify'; import * as controller from '@/controllers/profile.controller'; import { clientHook } from '@/hooks/client.hook'; import { isBotHook } from '@/hooks/is-bot.hook'; -import type { FastifyPluginCallback } from 'fastify'; const eventRouter: FastifyPluginCallback = async (fastify) => { fastify.addHook('preHandler', clientHook); diff --git a/apps/api/src/routes/webhook.router.ts b/apps/api/src/routes/webhook.router.ts index dbe34658..a78c4c28 100644 --- a/apps/api/src/routes/webhook.router.ts +++ b/apps/api/src/routes/webhook.router.ts @@ -1,5 +1,5 @@ -import * as controller from '@/controllers/webhook.controller'; import type { FastifyPluginCallback } from 'fastify'; +import * as controller from '@/controllers/webhook.controller'; const webhookRouter: FastifyPluginCallback = async (fastify) => { fastify.route({ diff --git a/apps/api/src/utils/ai-tools.ts b/apps/api/src/utils/ai-tools.ts index 70f43d27..be51a73f 100644 --- a/apps/api/src/utils/ai-tools.ts +++ b/apps/api/src/utils/ai-tools.ts @@ -1,23 +1,18 @@ import { chartTypes } from '@openpanel/constants'; import type { IClickhouseSession } from '@openpanel/db'; import { + ch, + clix, type IClickhouseEvent, type IClickhouseProfile, TABLE_NAMES, - ch, - clix, } from '@openpanel/db'; -import { ChartEngine } from '@openpanel/db'; import { getCache } from '@openpanel/redis'; import { zReportInput } from '@openpanel/validation'; import { tool } from 'ai'; import { z } from 'zod'; -export function getReport({ - projectId, -}: { - projectId: string; -}) { +export function getReport({ projectId }: { projectId: string }) { return tool({ description: `Generate a report (a chart) for - ${chartTypes.area} @@ -67,11 +62,7 @@ export function getReport({ }, }); } -export function getConversionReport({ - projectId, -}: { - projectId: string; -}) { +export function getConversionReport({ projectId }: { projectId: string }) { return tool({ description: 'Generate a report (a chart) for conversions between two actions a unique user took.', @@ -92,11 +83,7 @@ export function getConversionReport({ }, }); } -export function getFunnelReport({ - projectId, -}: { - projectId: string; -}) { +export function getFunnelReport({ projectId }: { projectId: string }) { return tool({ description: 'Generate a report (a chart) for funnel between two or more actions a unique user (session_id or profile_id) took.', @@ -118,11 +105,7 @@ export function getFunnelReport({ }); } -export function getProfiles({ - projectId, -}: { - projectId: string; -}) { +export function getProfiles({ projectId }: { projectId: string }) { return tool({ description: 'Get profiles', parameters: z.object({ @@ -188,11 +171,7 @@ export function getProfiles({ }); } -export function getProfile({ - projectId, -}: { - projectId: string; -}) { +export function getProfile({ projectId }: { projectId: string }) { return tool({ description: 'Get a specific profile', parameters: z.object({ @@ -276,11 +255,7 @@ export function getProfile({ }); } -export function getEvents({ - projectId, -}: { - projectId: string; -}) { +export function getEvents({ projectId }: { projectId: string }) { return tool({ description: 'Get events for a project or specific profile', parameters: z.object({ @@ -369,11 +344,7 @@ export function getEvents({ }); } -export function getSessions({ - projectId, -}: { - projectId: string; -}) { +export function getSessions({ projectId }: { projectId: string }) { return tool({ description: 'Get sessions for a project or specific profile', parameters: z.object({ @@ -458,11 +429,7 @@ export function getSessions({ }); } -export function getAllEventNames({ - projectId, -}: { - projectId: string; -}) { +export function getAllEventNames({ projectId }: { projectId: string }) { return tool({ description: 'Get the top 50 event names in a comma separated list', parameters: z.object({}), diff --git a/apps/api/src/utils/ai.ts b/apps/api/src/utils/ai.ts index 0fcf69de..b1d90e52 100644 --- a/apps/api/src/utils/ai.ts +++ b/apps/api/src/utils/ai.ts @@ -14,11 +14,7 @@ export const getChatModel = () => { } }; -export const getChatSystemPrompt = ({ - projectId, -}: { - projectId: string; -}) => { +export const getChatSystemPrompt = ({ projectId }: { projectId: string }) => { return `You're an product and web analytics expert. Don't generate more than the user asks for. Follow all rules listed below! ## General: - projectId: \`${projectId}\` diff --git a/apps/api/src/utils/auth.ts b/apps/api/src/utils/auth.ts index 05df0513..e1ba3819 100644 --- a/apps/api/src/utils/auth.ts +++ b/apps/api/src/utils/auth.ts @@ -1,5 +1,3 @@ -import type { FastifyRequest, RawRequestDefaultExpression } from 'fastify'; - import { verifyPassword } from '@openpanel/common/server'; import type { IServiceClientWithProject } from '@openpanel/db'; import { ClientType, getClientByIdCached } from '@openpanel/db'; @@ -10,6 +8,7 @@ import type { IProjectFilterProfileId, ITrackHandlerPayload, } from '@openpanel/validation'; +import type { FastifyRequest, RawRequestDefaultExpression } from 'fastify'; import { path } from 'ramda'; const cleanDomain = (domain: string) => @@ -31,7 +30,7 @@ export class SdkAuthError extends Error { clientId?: string; clientSecret?: string; origin?: string; - }, + } ) { super(message); this.name = 'SdkAuthError'; @@ -43,7 +42,7 @@ export class SdkAuthError extends Error { export async function validateSdkRequest( req: FastifyRequest<{ Body: ITrackHandlerPayload | DeprecatedPostEventPayload; - }>, + }> ): Promise { const { headers, clientIp } = req; const clientIdNew = headers['openpanel-client-id'] as string; @@ -70,7 +69,7 @@ export async function validateSdkRequest( if ( !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test( - clientId, + clientId ) ) { throw createError('Ingestion: Client ID must be a valid UUIDv4'); @@ -88,7 +87,7 @@ export async function validateSdkRequest( // Filter out blocked IPs const ipFilter = client.project.filters.filter( - (filter): filter is IProjectFilterIp => filter.type === 'ip', + (filter): filter is IProjectFilterIp => filter.type === 'ip' ); if (ipFilter.some((filter) => filter.ip === clientIp)) { throw createError('Ingestion: IP address is blocked by project filter'); @@ -96,7 +95,7 @@ export async function validateSdkRequest( // Filter out blocked profile ids const profileFilter = client.project.filters.filter( - (filter): filter is IProjectFilterProfileId => filter.type === 'profile_id', + (filter): filter is IProjectFilterProfileId => filter.type === 'profile_id' ); const profileId = path(['payload', 'profileId'], req.body) || // Track handler @@ -113,12 +112,11 @@ export async function validateSdkRequest( // Only allow revenue tracking if it was sent with a client secret // or if the project has allowUnsafeRevenueTracking enabled if ( - !client.project.allowUnsafeRevenueTracking && - !clientSecret && + !(client.project.allowUnsafeRevenueTracking || clientSecret) && typeof revenue !== 'undefined' ) { throw createError( - 'Ingestion: Revenue tracking is not allowed without a client secret', + 'Ingestion: Revenue tracking is not allowed without a client secret' ); } @@ -132,7 +130,7 @@ export async function validateSdkRequest( // support wildcard domains `*.foo.com` if (cleanedDomain.includes('*')) { const regex = new RegExp( - `${cleanedDomain.replaceAll('.', '\\.').replaceAll('*', '.+?')}`, + `${cleanedDomain.replaceAll('.', '\\.').replaceAll('*', '.+?')}` ); return regex.test(origin || ''); @@ -157,7 +155,7 @@ export async function validateSdkRequest( `client:auth:${clientId}:${Buffer.from(clientSecret).toString('base64')}`, 60 * 5, async () => await verifyPassword(clientSecret, client.secret!), - true, + true ); if (isVerified) { return client; @@ -168,14 +166,14 @@ export async function validateSdkRequest( } export async function validateExportRequest( - headers: RawRequestDefaultExpression['headers'], + headers: RawRequestDefaultExpression['headers'] ): Promise { const clientId = headers['openpanel-client-id'] as string; const clientSecret = (headers['openpanel-client-secret'] as string) || ''; if ( !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test( - clientId, + clientId ) ) { throw new Error('Export: Client ID must be a valid UUIDv4'); @@ -203,14 +201,14 @@ export async function validateExportRequest( } export async function validateImportRequest( - headers: RawRequestDefaultExpression['headers'], + headers: RawRequestDefaultExpression['headers'] ): Promise { const clientId = headers['openpanel-client-id'] as string; const clientSecret = (headers['openpanel-client-secret'] as string) || ''; if ( !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test( - clientId, + clientId ) ) { throw new Error('Import: Client ID must be a valid UUIDv4'); @@ -238,14 +236,14 @@ export async function validateImportRequest( } export async function validateManageRequest( - headers: RawRequestDefaultExpression['headers'], + headers: RawRequestDefaultExpression['headers'] ): Promise { const clientId = headers['openpanel-client-id'] as string; const clientSecret = (headers['openpanel-client-secret'] as string) || ''; if ( !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test( - clientId, + clientId ) ) { throw new Error('Manage: Client ID must be a valid UUIDv4'); @@ -263,7 +261,7 @@ export async function validateManageRequest( if (client.type !== ClientType.root) { throw new Error( - 'Manage: Only root clients are allowed to manage resources', + 'Manage: Only root clients are allowed to manage resources' ); } diff --git a/apps/api/src/utils/deduplicate.ts b/apps/api/src/utils/deduplicate.ts index d45ac9ba..5a789158 100644 --- a/apps/api/src/utils/deduplicate.ts +++ b/apps/api/src/utils/deduplicate.ts @@ -20,10 +20,10 @@ export async function isDuplicatedEvent({ origin, projectId, }, - 'md5', + 'md5' )}`, '1', - 100, + 100 ); if (locked) { diff --git a/apps/api/src/utils/errors.ts b/apps/api/src/utils/errors.ts index 193a9611..90f708dc 100644 --- a/apps/api/src/utils/errors.ts +++ b/apps/api/src/utils/errors.ts @@ -4,7 +4,7 @@ export class LogError extends Error { constructor( message: string, payload?: Record, - options?: ErrorOptions, + options?: ErrorOptions ) { super(message, options); this.name = 'LogError'; @@ -26,7 +26,7 @@ export class HttpError extends Error { fingerprint?: string; extra?: Record; error?: Error | unknown; - }, + } ) { super(message); this.name = 'HttpError'; diff --git a/apps/api/src/utils/graceful-shutdown.ts b/apps/api/src/utils/graceful-shutdown.ts index 276762ae..9a54b13d 100644 --- a/apps/api/src/utils/graceful-shutdown.ts +++ b/apps/api/src/utils/graceful-shutdown.ts @@ -29,7 +29,7 @@ export function isShuttingDown() { export async function shutdown( fastify: FastifyInstance, signal: string, - exitCode = 0, + exitCode = 0 ) { if (isShuttingDown()) { logger.warn('Shutdown already in progress, ignoring signal', { signal }); @@ -96,7 +96,7 @@ export async function shutdown( if (redis.status === 'ready') { await redis.quit(); } - }), + }) ); logger.info('Redis connections closed'); } catch (error) { diff --git a/apps/api/src/utils/parse-zod-query-string.ts b/apps/api/src/utils/parse-zod-query-string.ts index b7e97685..6deeb5b4 100644 --- a/apps/api/src/utils/parse-zod-query-string.ts +++ b/apps/api/src/utils/parse-zod-query-string.ts @@ -3,14 +3,21 @@ import { getSafeJson } from '@openpanel/json'; export const parseQueryString = (obj: Record): any => { return Object.fromEntries( Object.entries(obj).map(([k, v]) => { - if (typeof v === 'object') return [k, parseQueryString(v)]; + if (typeof v === 'object') { + return [k, parseQueryString(v)]; + } if ( /^-?[0-9]+(\.[0-9]+)?$/i.test(v) && !Number.isNaN(Number.parseFloat(v)) - ) + ) { return [k, Number.parseFloat(v)]; - if (v === 'true') return [k, true]; - if (v === 'false') return [k, false]; + } + if (v === 'true') { + return [k, true]; + } + if (v === 'false') { + return [k, false]; + } if (typeof v === 'string') { if (getSafeJson(v) !== null) { return [k, getSafeJson(v)]; @@ -18,6 +25,6 @@ export const parseQueryString = (obj: Record): any => { return [k, v]; } return [k, null]; - }), + }) ); }; diff --git a/apps/api/src/utils/parseUrlMeta.ts b/apps/api/src/utils/parseUrlMeta.ts index f8b9f3b9..829022dc 100644 --- a/apps/api/src/utils/parseUrlMeta.ts +++ b/apps/api/src/utils/parseUrlMeta.ts @@ -19,7 +19,7 @@ function findBestFavicon(favicons: UrlMetaData['favicons']) { (favicon) => favicon.rel === 'shortcut icon' || favicon.rel === 'icon' || - favicon.rel === 'apple-touch-icon', + favicon.rel === 'apple-touch-icon' ); if (match) { diff --git a/apps/api/tsdown.config.ts b/apps/api/tsdown.config.ts index 80837b37..d28a7aa0 100644 --- a/apps/api/tsdown.config.ts +++ b/apps/api/tsdown.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'tsdown'; import type { Options } from 'tsdown'; +import { defineConfig } from 'tsdown'; const options: Options = { clean: true, diff --git a/apps/justfuckinguseopenpanel/index.html b/apps/justfuckinguseopenpanel/index.html index 7c880baf..5a9d9782 100644 --- a/apps/justfuckinguseopenpanel/index.html +++ b/apps/justfuckinguseopenpanel/index.html @@ -1,40 +1,61 @@ - - - - - - Just Fucking Use OpenPanel - Stop Overpaying for Analytics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Just Fucking Use OpenPanel

-

Stop settling for basic metrics. Get real insights that actually help you build a better product.

+ + + +
+
+

Just Fucking Use OpenPanel

+

+ Stop settling for basic metrics. Get real insights that actually help + you build a better product. +

+
+ +
+
+
+
+
+
+
+
+ OpenPanel Real-time Analytics +
+
+
+ Real-time analytics - see events as they happen. No waiting, no + delays. +
+
+ +

The PostHog/Mixpanel Problem (Volume Pricing Hell)

+ +

+ Let's talk about what happens when you have a + real product with real users. +

+ +

Real pricing at scale (20M+ events/month):

+
    +
  • Mixpanel: $2,300/month (and more with add-ons)
  • +
  • PostHog: $1,982/month (and more with add-ons)
  • +
+ +

+ "1 million free events!" they scream. Cute. Until you have an actual + product with actual users doing actual things. Then suddenly you need to + "talk to sales" and your wallet starts bleeding. +

+ +

+ Add-ons, add-ons everywhere. Session replay? +$X. Feature flags? +$X. + HIPAA compliance? +$250/month. A/B testing? That'll be extra. You're + hemorrhaging money just to understand what your users are doing, you + magnificent fool. +

+ +

The Web-Only Analytics Trap

+ +

+ You built a great fucking product. You have real traffic. Thousands, + tens of thousands of visitors. But you're flying blind. +

+ +
+ "Congrats, 50,000 visitors from France this month. Why didn't a single + one buy your baguette?" +
+ +

+ You see the traffic. You see the bounce rate. You see the referrers. You + see where they're from. You have NO FUCKING IDEA what + users actually do. +

+ +

+ Where do they drop off? Do they come back? What features do they use? + Why didn't they convert? Who the fuck knows! You're using a glorified + hit counter with a pretty dashboard that tells you everything about + geography and nothing about behavior. +

+ +

+ Plausible. Umami. Fathom. Simple Analytics. GoatCounter. Cabin. Pirsch. + They're all the same story: simple analytics with some goals you can + define. Page views, visitors, countries, basic funnels. That's it. No + retention analysis. No user profiles. No event tracking. No cohorts. No + revenue tracking. Just... basic web analytics. +

+ +

+ And when you finally need to understand your users—when you need to see + where they drop off in your signup flow, or which features drive + retention, or why your conversion rate is shit—you end up paying for a + SECOND tool on top. Now you're paying for two + subscriptions, managing two dashboards, and your users' data is split + across two platforms like a bad divorce. +

+ +

Counter One Dollar Stats

+ +

"$1/month for page views. Adorable."

+ +

+ Look, I get it. A dollar is cheap. But you're getting exactly what you + pay for: page views. That's it. No funnels. No retention. No user + profiles. No event tracking. Just... page views. +

+ +

+ Here's the thing: if you want to make good decisions + about your product, you need to understand + what your users are actually doing, not just where the + fuck they're from. +

+ +

+ OpenPanel gives you the full product analytics suite. Or self-host for + FREE with UNLIMITED events. +

+ +

You get:

+
    +
  • Funnels to see where users drop off
  • +
  • Retention analysis to see who comes back
  • +
  • Cohorts to segment your users
  • +
  • User profiles to understand individual behavior
  • +
  • Custom dashboards to see what matters to YOU
  • +
  • Revenue tracking to see what actually makes money
  • +
  • + All the web analytics (page views, visitors, referrers) that the other + tools give you +
  • +
+ +

+ One Dollar Stats tells you 50,000 people visited from France. OpenPanel + tells you why they didn't buy your baguette. That's the difference + between vanity metrics and actual insights. +

+ +

Why OpenPanel is the Answer

+ +

+ You want analytics that actually help you build a better product. Not + vanity metrics. Not enterprise pricing. Not two separate tools. +

+ +

+ To make good decisions, you need to understand + what your users are doing, not just where they're from. + You need to see where they drop off. You need to know which features + they use. You need to understand why they convert or why they don't. +

+ +
    +
  • + Open Source & Self-Hostable: AGPL-3.0 - fork it, + audit it, own it. Self-host for FREE with unlimited events, or use our + cloud +
  • +
  • + Price: Affordable pricing that scales, or FREE + self-hosted (unlimited events, forever) +
  • +
  • + SDK Size: 2.3KB (PostHog is 52KB+ - that's 22x + bigger, you performance-obsessed maniac) +
  • +
  • + Privacy: Cookie-free by default, EU-only hosting (or + your own servers if you self-host) +
  • +
  • + Full Suite: Web analytics + product analytics in one + tool. No need for two subscriptions. +
  • +
+ +
+
+
+
+
+
+
+
+ OpenPanel Overview Dashboard +
+
+
+ OpenPanel overview showing web analytics and product analytics in one + clean interface +
+
+ +

Open Source & Self-Hosting: The Ultimate Fuck You to Pricing Hell

+ +

+ Tired of watching your analytics bill grow every month? Tired of "talk + to sales" when you hit their arbitrary limits? Tired of paying + $2,000+/month just to understand your users? +

+ +

+ OpenPanel is open source. AGPL-3.0 licensed. You can + fork it. You can audit it. You can own it. And you can + self-host it for FREE with UNLIMITED events. +

+ +

+ That's right. Zero dollars. Unlimited events. All the features. Your + data on your servers. No vendor lock-in. No surprise bills. No + "enterprise sales" calls. +

+ +

+ Mixpanel at 20M events? $2,300/month. PostHog? $1,982/month. OpenPanel + self-hosted? $0/month. Forever. +

+ +

+ Don't want to manage infrastructure? That's fine. Use our cloud. But if + you want to escape the pricing hell entirely, self-hosting is a Docker + command away. Your data, your rules, your wallet. +

+ +

The Comparison Table (The Brutal Truth)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ToolPrice at 20M eventsWhat You Get
Mixpanel$2,300+/monthNot all feautres... since addons are extra
PostHog$1,982+/monthNot all feautres... since addons are extra
PlausibleVarious pricing + Simple analytics with basic goals. Page views and visitors. That's + it. +
One Dollar Stats$1/monthPage views (but cheaper!)
OpenPanel~$530/mo or FREE (self-hosted) + Web + Product analytics. The full package. Open source. Your + data. +
+ +
+
+
+
+
+
+
+
+ OpenPanel User Profiles +
+
+
+ User profiles - see individual user journeys and behavior. Something + web-only tools can't give you. +
+
+ +
+
+
+
+
+
+
+
+ OpenPanel Reports and Funnels +
+
+
+ Funnels, retention, and custom reports - the features you CAN'T get + with web-only tools +
+
+ +

The Bottom Fucking Line

+ +

+ If you want to make good decisions about your product, you need to + understand what your users are actually doing. Not just where they're + from. Not just how many page views you got. You need to see the full + picture: funnels, retention, user behavior, conversion paths. +

+ +

You have three choices:

+ +
    +
  1. + Keep using Google Analytics like a data-harvesting accomplice, adding + cookie banners, annoying your users, and contributing to the dystopian + surveillance economy +
  2. +
  3. + Pay $2,000+/month for Mixpanel or PostHog when you scale, or use + simple web-only analytics that tell you nothing about user + behavior—just where they're from +
  4. +
  5. + Use OpenPanel (affordable pricing or FREE self-hosted) and get the + full analytics suite: web analytics AND product analytics in one tool, + so you can actually understand what your users do +
  6. +
+ +

+ If you picked option 1 or 2, I can't help you. You're beyond saving. Go + enjoy your complicated, privacy-violating, overpriced analytics life + where you know everything about where your users are from but nothing + about what they actually do. +

+ +

+ But if you have even one functioning brain cell, you'll realize that + OpenPanel gives you everything you need—web analytics AND product + analytics—for a fraction of what the enterprise tools cost. You'll + finally understand what your users are doing, not just where the fuck + they're from. +

+ +
+

Ready to understand what your users actually do?

+

+ Stop settling for vanity metrics. Get the full analytics suite—web + analytics AND product analytics—so you can make better decisions. Or + self-host for free. +

+ Get Started with OpenPanel + Self-Host Guide +
+ +
+
+
+
+
+
+
+
+ OpenPanel Custom Dashboards +
+
+
+ Custom dashboards - build exactly what you need to understand your + product +
+
+ +
-
-
-
-
-
-
-
-
- OpenPanel Real-time Analytics -
-
-
Real-time analytics - see events as they happen. No waiting, no delays.
-
- -

The PostHog/Mixpanel Problem (Volume Pricing Hell)

- -

Let's talk about what happens when you have a real product with real users.

- -

Real pricing at scale (20M+ events/month):

-
    -
  • Mixpanel: $2,300/month (and more with add-ons)
  • -
  • PostHog: $1,982/month (and more with add-ons)
  • -
- -

"1 million free events!" they scream. Cute. Until you have an actual product with actual users doing actual things. Then suddenly you need to "talk to sales" and your wallet starts bleeding.

- -

Add-ons, add-ons everywhere. Session replay? +$X. Feature flags? +$X. HIPAA compliance? +$250/month. A/B testing? That'll be extra. You're hemorrhaging money just to understand what your users are doing, you magnificent fool.

- -

The Web-Only Analytics Trap

- -

You built a great fucking product. You have real traffic. Thousands, tens of thousands of visitors. But you're flying blind.

- -
- "Congrats, 50,000 visitors from France this month. Why didn't a single one buy your baguette?" -
- -

You see the traffic. You see the bounce rate. You see the referrers. You see where they're from. You have NO FUCKING IDEA what users actually do.

- -

Where do they drop off? Do they come back? What features do they use? Why didn't they convert? Who the fuck knows! You're using a glorified hit counter with a pretty dashboard that tells you everything about geography and nothing about behavior.

- -

Plausible. Umami. Fathom. Simple Analytics. GoatCounter. Cabin. Pirsch. They're all the same story: simple analytics with some goals you can define. Page views, visitors, countries, basic funnels. That's it. No retention analysis. No user profiles. No event tracking. No cohorts. No revenue tracking. Just... basic web analytics.

- -

And when you finally need to understand your users—when you need to see where they drop off in your signup flow, or which features drive retention, or why your conversion rate is shit—you end up paying for a SECOND tool on top. Now you're paying for two subscriptions, managing two dashboards, and your users' data is split across two platforms like a bad divorce.

- -

Counter One Dollar Stats

- -

"$1/month for page views. Adorable."

- -

Look, I get it. A dollar is cheap. But you're getting exactly what you pay for: page views. That's it. No funnels. No retention. No user profiles. No event tracking. Just... page views.

- -

Here's the thing: if you want to make good decisions about your product, you need to understand what your users are actually doing, not just where the fuck they're from.

- -

OpenPanel gives you the full product analytics suite. Or self-host for FREE with UNLIMITED events.

- -

You get:

-
    -
  • Funnels to see where users drop off
  • -
  • Retention analysis to see who comes back
  • -
  • Cohorts to segment your users
  • -
  • User profiles to understand individual behavior
  • -
  • Custom dashboards to see what matters to YOU
  • -
  • Revenue tracking to see what actually makes money
  • -
  • All the web analytics (page views, visitors, referrers) that the other tools give you
  • -
- -

One Dollar Stats tells you 50,000 people visited from France. OpenPanel tells you why they didn't buy your baguette. That's the difference between vanity metrics and actual insights.

- -

Why OpenPanel is the Answer

- -

You want analytics that actually help you build a better product. Not vanity metrics. Not enterprise pricing. Not two separate tools.

- -

To make good decisions, you need to understand what your users are doing, not just where they're from. You need to see where they drop off. You need to know which features they use. You need to understand why they convert or why they don't.

- -
    -
  • Open Source & Self-Hostable: AGPL-3.0 - fork it, audit it, own it. Self-host for FREE with unlimited events, or use our cloud
  • -
  • Price: Affordable pricing that scales, or FREE self-hosted (unlimited events, forever)
  • -
  • SDK Size: 2.3KB (PostHog is 52KB+ - that's 22x bigger, you performance-obsessed maniac)
  • -
  • Privacy: Cookie-free by default, EU-only hosting (or your own servers if you self-host)
  • -
  • Full Suite: Web analytics + product analytics in one tool. No need for two subscriptions.
  • -
- -
-
-
-
-
-
-
-
- OpenPanel Overview Dashboard -
-
-
OpenPanel overview showing web analytics and product analytics in one clean interface
-
- -

Open Source & Self-Hosting: The Ultimate Fuck You to Pricing Hell

- -

Tired of watching your analytics bill grow every month? Tired of "talk to sales" when you hit their arbitrary limits? Tired of paying $2,000+/month just to understand your users?

- -

OpenPanel is open source. AGPL-3.0 licensed. You can fork it. You can audit it. You can own it. And you can self-host it for FREE with UNLIMITED events.

- -

That's right. Zero dollars. Unlimited events. All the features. Your data on your servers. No vendor lock-in. No surprise bills. No "enterprise sales" calls.

- -

Mixpanel at 20M events? $2,300/month. PostHog? $1,982/month. OpenPanel self-hosted? $0/month. Forever.

- -

Don't want to manage infrastructure? That's fine. Use our cloud. But if you want to escape the pricing hell entirely, self-hosting is a Docker command away. Your data, your rules, your wallet.

- -

The Comparison Table (The Brutal Truth)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ToolPrice at 20M eventsWhat You Get
Mixpanel$2,300+/monthNot all feautres... since addons are extra
PostHog$1,982+/monthNot all feautres... since addons are extra
PlausibleVarious pricingSimple analytics with basic goals. Page views and visitors. That's it.
One Dollar Stats$1/monthPage views (but cheaper!)
OpenPanel~$530/mo or FREE (self-hosted)Web + Product analytics. The full package. Open source. Your data.
- -
-
-
-
-
-
-
-
- OpenPanel User Profiles -
-
-
User profiles - see individual user journeys and behavior. Something web-only tools can't give you.
-
- -
-
-
-
-
-
-
-
- OpenPanel Reports and Funnels -
-
-
Funnels, retention, and custom reports - the features you CAN'T get with web-only tools
-
- -

The Bottom Fucking Line

- -

If you want to make good decisions about your product, you need to understand what your users are actually doing. Not just where they're from. Not just how many page views you got. You need to see the full picture: funnels, retention, user behavior, conversion paths.

- -

You have three choices:

- -
    -
  1. Keep using Google Analytics like a data-harvesting accomplice, adding cookie banners, annoying your users, and contributing to the dystopian surveillance economy
  2. -
  3. Pay $2,000+/month for Mixpanel or PostHog when you scale, or use simple web-only analytics that tell you nothing about user behavior—just where they're from
  4. -
  5. Use OpenPanel (affordable pricing or FREE self-hosted) and get the full analytics suite: web analytics AND product analytics in one tool, so you can actually understand what your users do
  6. -
- -

If you picked option 1 or 2, I can't help you. You're beyond saving. Go enjoy your complicated, privacy-violating, overpriced analytics life where you know everything about where your users are from but nothing about what they actually do.

- -

But if you have even one functioning brain cell, you'll realize that OpenPanel gives you everything you need—web analytics AND product analytics—for a fraction of what the enterprise tools cost. You'll finally understand what your users are doing, not just where the fuck they're from.

- -
-

Ready to understand what your users actually do?

-

Stop settling for vanity metrics. Get the full analytics suite—web analytics AND product analytics—so you can make better decisions. Or self-host for free.

- Get Started with OpenPanel - Self-Host Guide -
- -
-
-
-
-
-
-
-
- OpenPanel Custom Dashboards -
-
-
Custom dashboards - build exactly what you need to understand your product
-
- - -
- - - - + + + diff --git a/apps/justfuckinguseopenpanel/wrangler.jsonc b/apps/justfuckinguseopenpanel/wrangler.jsonc index 005d95fb..37a524e5 100644 --- a/apps/justfuckinguseopenpanel/wrangler.jsonc +++ b/apps/justfuckinguseopenpanel/wrangler.jsonc @@ -4,4 +4,4 @@ "assets": { "directory": "." } -} \ No newline at end of file +} diff --git a/apps/public/components/sections/supporter-perks.tsx b/apps/public/components/sections/supporter-perks.tsx index 6cd91237..fdd3dff1 100644 --- a/apps/public/components/sections/supporter-perks.tsx +++ b/apps/public/components/sections/supporter-perks.tsx @@ -1,15 +1,15 @@ -import { cn } from '@/lib/utils'; import { CheckIcon, HeartHandshakeIcon, MessageSquareIcon, + PackageIcon, RocketIcon, SparklesIcon, StarIcon, ZapIcon, - PackageIcon, } from 'lucide-react'; import Link from 'next/link'; +import { cn } from '@/lib/utils'; const perks = [ { @@ -52,17 +52,17 @@ export function SupporterPerks({ className }: { className?: string }) { return (
-
-
+
+

Supporter Perks

-

+

Everything you get when you support OpenPanel

@@ -72,42 +72,42 @@ export function SupporterPerks({ className }: { className?: string }) { const Icon = perk.icon; return (
-
+
-
-
+
+

{perk.title}

{perk.highlight && ( - + )}
-

+

{perk.description}

{perk.href && ( Learn more → @@ -119,12 +119,11 @@ export function SupporterPerks({ className }: { className?: string }) { })}
-
-

+

+

Starting at $20/month

); } - diff --git a/apps/public/content/compare/ackee-alternative.json b/apps/public/content/compare/ackee-alternative.json index 4e11c41d..84a1b324 100644 --- a/apps/public/content/compare/ackee-alternative.json +++ b/apps/public/content/compare/ackee-alternative.json @@ -549,4 +549,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/amplitude-alternative.json b/apps/public/content/compare/amplitude-alternative.json index c539f399..bf1a6190 100644 --- a/apps/public/content/compare/amplitude-alternative.json +++ b/apps/public/content/compare/amplitude-alternative.json @@ -9,12 +9,7 @@ "hero": { "heading": "Best Amplitude Alternatives", "subheading": "OpenPanel is an open-source, privacy-first alternative to Amplitude. Get powerful product analytics with web analytics built in, cookie-free tracking, and the freedom to self-host or use our cloud.", - "badges": [ - "Open-source", - "Cookie-free", - "EU-only hosting", - "Self-hostable" - ] + "badges": ["Open-source", "Cookie-free", "EU-only hosting", "Self-hostable"] }, "competitor": { "name": "Amplitude", @@ -562,4 +557,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/appsflyer-alternative.json b/apps/public/content/compare/appsflyer-alternative.json index f913ac52..fda3d0f1 100644 --- a/apps/public/content/compare/appsflyer-alternative.json +++ b/apps/public/content/compare/appsflyer-alternative.json @@ -468,4 +468,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/cabin-analytics-alternative.json b/apps/public/content/compare/cabin-analytics-alternative.json index fd6b7007..aaf3ac36 100644 --- a/apps/public/content/compare/cabin-analytics-alternative.json +++ b/apps/public/content/compare/cabin-analytics-alternative.json @@ -520,4 +520,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/countly-alternative.json b/apps/public/content/compare/countly-alternative.json index 9eae416a..0757a257 100644 --- a/apps/public/content/compare/countly-alternative.json +++ b/apps/public/content/compare/countly-alternative.json @@ -9,12 +9,7 @@ "hero": { "heading": "Best Countly Alternative", "subheading": "Want Countly's product analytics without the complexity? OpenPanel offers a simpler, more affordable approach to user analytics with self-hosting, mobile SDKs, and modern product analytics - all with transparent pricing.", - "badges": [ - "Open-source", - "Simple Pricing", - "Lightweight", - "MIT License" - ] + "badges": ["Open-source", "Simple Pricing", "Lightweight", "MIT License"] }, "competitor": { "name": "Countly", @@ -560,4 +555,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/crazy-egg-alternative.json b/apps/public/content/compare/crazy-egg-alternative.json index 7c09b1da..17adb5fd 100644 --- a/apps/public/content/compare/crazy-egg-alternative.json +++ b/apps/public/content/compare/crazy-egg-alternative.json @@ -274,9 +274,7 @@ "Android", "Flutter" ], - "competitor": [ - "JavaScript (web only)" - ], + "competitor": ["JavaScript (web only)"], "notes": null }, { @@ -458,4 +456,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/ensure.ts b/apps/public/content/compare/ensure.ts index 495d1953..8ae02d83 100644 --- a/apps/public/content/compare/ensure.ts +++ b/apps/public/content/compare/ensure.ts @@ -1,4 +1,4 @@ -import { readFile, readdir } from 'node:fs/promises'; +import { readdir, readFile } from 'node:fs/promises'; import { join } from 'node:path'; interface FileStructure { @@ -10,7 +10,7 @@ interface FileStructure { } async function analyzeJsonFiles(): Promise { - const dirPath = join(import.meta.dirname || __dirname); + const dirPath = join(import.meta.dirname || import.meta.dirname); const files = await readdir(dirPath); const jsonFiles = files.filter((f) => f.endsWith('.json')); @@ -88,7 +88,7 @@ async function analyzeJsonFiles(): Promise { console.log(separator); const sortedGroups = Array.from(groups.entries()).sort( - (a, b) => b[1].length - a[1].length, + (a, b) => b[1].length - a[1].length ); sortedGroups.forEach(([structureKey, files], index) => { @@ -117,7 +117,7 @@ async function analyzeJsonFiles(): Promise { console.log(separator); const validFiles = structures.filter((s) => s.hasContent && !s.error); - const emptyFiles = structures.filter((s) => !s.hasContent && !s.error); + const emptyFiles = structures.filter((s) => !(s.hasContent || s.error)); const errorFiles = structures.filter((s) => s.error); console.log(` Total files: ${structures.length}`); @@ -148,7 +148,9 @@ async function analyzeJsonFiles(): Promise { console.log(separator); sortedGroups.forEach(([structureKey, files], index) => { - if (structureKey === 'empty' || structureKey === 'error') return; + if (structureKey === 'empty' || structureKey === 'error') { + return; + } const groupNum = index + 1; console.log(`\nGroup ${groupNum} structure:`); diff --git a/apps/public/content/compare/fathom-alternative.json b/apps/public/content/compare/fathom-alternative.json index 7df0890c..c4135a39 100644 --- a/apps/public/content/compare/fathom-alternative.json +++ b/apps/public/content/compare/fathom-alternative.json @@ -9,12 +9,7 @@ "hero": { "heading": "Best Fathom Alternative", "subheading": "Love Fathom's simplicity and privacy focus? OpenPanel adds product analytics capabilities - funnels, cohorts, retention, and user identification - plus self-hosting options and a free tier.", - "badges": [ - "Open-source", - "Privacy-first", - "Self-hostable", - "Free Tier" - ] + "badges": ["Open-source", "Privacy-first", "Self-hostable", "Free Tier"] }, "competitor": { "name": "Fathom Analytics", @@ -513,4 +508,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/fullstory-alternative.json b/apps/public/content/compare/fullstory-alternative.json index aed8aefd..73e6a9c7 100644 --- a/apps/public/content/compare/fullstory-alternative.json +++ b/apps/public/content/compare/fullstory-alternative.json @@ -468,4 +468,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/funnelio-alternative.json b/apps/public/content/compare/funnelio-alternative.json index f59f7337..d232d9ae 100644 --- a/apps/public/content/compare/funnelio-alternative.json +++ b/apps/public/content/compare/funnelio-alternative.json @@ -514,4 +514,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/goatcounter-alternative.json b/apps/public/content/compare/goatcounter-alternative.json index 50df7948..e1a6ece8 100644 --- a/apps/public/content/compare/goatcounter-alternative.json +++ b/apps/public/content/compare/goatcounter-alternative.json @@ -588,4 +588,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/google-analytics-alternative.json b/apps/public/content/compare/google-analytics-alternative.json index 6fc90535..6764efd9 100644 --- a/apps/public/content/compare/google-analytics-alternative.json +++ b/apps/public/content/compare/google-analytics-alternative.json @@ -587,4 +587,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/heap-alternative.json b/apps/public/content/compare/heap-alternative.json index e659e152..cb557747 100644 --- a/apps/public/content/compare/heap-alternative.json +++ b/apps/public/content/compare/heap-alternative.json @@ -472,4 +472,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/matomo-alternative.json b/apps/public/content/compare/matomo-alternative.json index 0c11c2df..6f8e0ed3 100644 --- a/apps/public/content/compare/matomo-alternative.json +++ b/apps/public/content/compare/matomo-alternative.json @@ -9,12 +9,7 @@ "hero": { "heading": "Best Matomo Alternative", "subheading": "OpenPanel is a modern, open-source alternative to Matomo. Get powerful web and product analytics with a cleaner interface, truly cookie-free tracking by default, and no premium plugins required for essential features.", - "badges": [ - "Open-source", - "Cookie-free", - "EU-only hosting", - "Self-hostable" - ] + "badges": ["Open-source", "Cookie-free", "EU-only hosting", "Self-hostable"] }, "competitor": { "name": "Matomo", @@ -511,4 +506,4 @@ } ] } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/microsoft-clarity-alternative.json b/apps/public/content/compare/microsoft-clarity-alternative.json index 0554ffb3..bfaf80a7 100644 --- a/apps/public/content/compare/microsoft-clarity-alternative.json +++ b/apps/public/content/compare/microsoft-clarity-alternative.json @@ -533,4 +533,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/mixpanel-alternative.json b/apps/public/content/compare/mixpanel-alternative.json index e5ad53b7..5d2442b1 100644 --- a/apps/public/content/compare/mixpanel-alternative.json +++ b/apps/public/content/compare/mixpanel-alternative.json @@ -525,4 +525,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/mouseflow-alternative.json b/apps/public/content/compare/mouseflow-alternative.json index d311a5f3..e57fdb5a 100644 --- a/apps/public/content/compare/mouseflow-alternative.json +++ b/apps/public/content/compare/mouseflow-alternative.json @@ -280,9 +280,7 @@ "Android", "Flutter" ], - "competitor": [ - "JavaScript (web only)" - ], + "competitor": ["JavaScript (web only)"], "notes": null }, { @@ -464,4 +462,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/pirsch-analytics-alternative.json b/apps/public/content/compare/pirsch-analytics-alternative.json index af770113..86878f48 100644 --- a/apps/public/content/compare/pirsch-analytics-alternative.json +++ b/apps/public/content/compare/pirsch-analytics-alternative.json @@ -514,4 +514,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/plausible-alternative.json b/apps/public/content/compare/plausible-alternative.json index eb7c0e91..217dad0e 100644 --- a/apps/public/content/compare/plausible-alternative.json +++ b/apps/public/content/compare/plausible-alternative.json @@ -519,4 +519,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/simple-analytics-alternative.json b/apps/public/content/compare/simple-analytics-alternative.json index b5c3c9a2..b38db47a 100644 --- a/apps/public/content/compare/simple-analytics-alternative.json +++ b/apps/public/content/compare/simple-analytics-alternative.json @@ -518,4 +518,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/smartlook-alternative.json b/apps/public/content/compare/smartlook-alternative.json index 351519cb..07424817 100644 --- a/apps/public/content/compare/smartlook-alternative.json +++ b/apps/public/content/compare/smartlook-alternative.json @@ -447,4 +447,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/compare/umami-alternative.json b/apps/public/content/compare/umami-alternative.json index db705571..8fa195fc 100644 --- a/apps/public/content/compare/umami-alternative.json +++ b/apps/public/content/compare/umami-alternative.json @@ -548,4 +548,4 @@ "href": "https://github.com/Openpanel-dev/openpanel" } } -} \ No newline at end of file +} diff --git a/apps/public/content/docs/(tracking)/meta.json b/apps/public/content/docs/(tracking)/meta.json index 6b9bbd29..fc35f197 100644 --- a/apps/public/content/docs/(tracking)/meta.json +++ b/apps/public/content/docs/(tracking)/meta.json @@ -1,3 +1,9 @@ { - "pages": ["sdks", "how-it-works", "session-replay", "consent-management", "..."] + "pages": [ + "sdks", + "how-it-works", + "session-replay", + "consent-management", + "..." + ] } diff --git a/apps/public/content/docs/dashboard/meta.json b/apps/public/content/docs/dashboard/meta.json index 2a272033..d79252ee 100644 --- a/apps/public/content/docs/dashboard/meta.json +++ b/apps/public/content/docs/dashboard/meta.json @@ -1,7 +1,4 @@ { "title": "Dashboard", - "pages": [ - "understand-the-overview", - "..." - ] -} \ No newline at end of file + "pages": ["understand-the-overview", "..."] +} diff --git a/apps/public/content/docs/meta.json b/apps/public/content/docs/meta.json index 654afdb9..d80f06e9 100644 --- a/apps/public/content/docs/meta.json +++ b/apps/public/content/docs/meta.json @@ -15,4 +15,4 @@ "---Migration---", "...migration" ] -} \ No newline at end of file +} diff --git a/apps/public/content/docs/self-hosting/meta.json b/apps/public/content/docs/self-hosting/meta.json index 4f9548fc..302788b1 100644 --- a/apps/public/content/docs/self-hosting/meta.json +++ b/apps/public/content/docs/self-hosting/meta.json @@ -12,4 +12,4 @@ "supporter-access-latest-docker-images", "changelog" ] -} \ No newline at end of file +} diff --git a/apps/public/content/features/conversion.json b/apps/public/content/features/conversion.json index 19f355c4..e8202b9e 100644 --- a/apps/public/content/features/conversion.json +++ b/apps/public/content/features/conversion.json @@ -164,4 +164,4 @@ "label": "Track your first conversion", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/data-visualization.json b/apps/public/content/features/data-visualization.json index 509ef877..301b402f 100644 --- a/apps/public/content/features/data-visualization.json +++ b/apps/public/content/features/data-visualization.json @@ -172,4 +172,4 @@ "label": "Start visualizing your data", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/event-tracking.json b/apps/public/content/features/event-tracking.json index d12a31a9..9ce62b4b 100644 --- a/apps/public/content/features/event-tracking.json +++ b/apps/public/content/features/event-tracking.json @@ -136,4 +136,4 @@ "label": "Track events in minutes", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/funnels.json b/apps/public/content/features/funnels.json index d8d4e524..bb981bc8 100644 --- a/apps/public/content/features/funnels.json +++ b/apps/public/content/features/funnels.json @@ -136,4 +136,4 @@ "label": "Build your first funnel", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/identify-users.json b/apps/public/content/features/identify-users.json index 9ff49bd8..965991a8 100644 --- a/apps/public/content/features/identify-users.json +++ b/apps/public/content/features/identify-users.json @@ -155,4 +155,4 @@ "label": "Start identifying users today", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/integrations.json b/apps/public/content/features/integrations.json index 8f5d1b97..f126e3fb 100644 --- a/apps/public/content/features/integrations.json +++ b/apps/public/content/features/integrations.json @@ -165,4 +165,4 @@ "label": "Set up your first integration", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/notifications.json b/apps/public/content/features/notifications.json index 262f0300..161a56d6 100644 --- a/apps/public/content/features/notifications.json +++ b/apps/public/content/features/notifications.json @@ -164,4 +164,4 @@ "label": "Set up your first notification rule", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/retention.json b/apps/public/content/features/retention.json index 48ade2c4..b34e2f09 100644 --- a/apps/public/content/features/retention.json +++ b/apps/public/content/features/retention.json @@ -4,10 +4,7 @@ "seo": { "title": "Retention & Cohort Analysis", "description": "User retention analytics and cohort analysis that show who comes back. See product stickiness at a glance-no sampling, no guesswork. Built on your events.", - "keywords": [ - "user retention analytics", - "cohort analysis" - ] + "keywords": ["user retention analytics", "cohort analysis"] }, "hero": { "heading": "Retention: Who comes back?", @@ -135,4 +132,4 @@ "label": "See your retention in minutes", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/revenue-tracking.json b/apps/public/content/features/revenue-tracking.json index 05f819b5..8bd2d8a8 100644 --- a/apps/public/content/features/revenue-tracking.json +++ b/apps/public/content/features/revenue-tracking.json @@ -154,4 +154,4 @@ "label": "Start tracking revenue", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/session-replay.json b/apps/public/content/features/session-replay.json index 28637d6b..c3713769 100644 --- a/apps/public/content/features/session-replay.json +++ b/apps/public/content/features/session-replay.json @@ -163,4 +163,4 @@ "label": "Start recording sessions", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/share-and-collaborate.json b/apps/public/content/features/share-and-collaborate.json index fde5e5ba..65dac273 100644 --- a/apps/public/content/features/share-and-collaborate.json +++ b/apps/public/content/features/share-and-collaborate.json @@ -165,4 +165,4 @@ "label": "Invite your team and share your first dashboard", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/features/web-analytics.json b/apps/public/content/features/web-analytics.json index 1e954022..80bbc43a 100644 --- a/apps/public/content/features/web-analytics.json +++ b/apps/public/content/features/web-analytics.json @@ -178,4 +178,4 @@ "label": "Add analytics in 2 minutes", "href": "https://dashboard.openpanel.dev/onboarding" } -} \ No newline at end of file +} diff --git a/apps/public/content/for/agencies.json b/apps/public/content/for/agencies.json index ac7e1007..019395c2 100644 --- a/apps/public/content/for/agencies.json +++ b/apps/public/content/for/agencies.json @@ -151,16 +151,34 @@ "related_links": { "guides": [ { "title": "Script tag SDK setup", "url": "/docs/sdks/script" }, - { "title": "Migrate from Google Analytics", "url": "/guides/migrate-from-google-analytics" } + { + "title": "Migrate from Google Analytics", + "url": "/guides/migrate-from-google-analytics" + } ], "articles": [ - { "title": "Cookieless analytics explained", "url": "/articles/cookieless-analytics" }, - { "title": "How to self-host OpenPanel", "url": "/articles/how-to-self-host-openpanel" }, - { "title": "Best open source analytics tools", "url": "/articles/open-source-web-analytics" } + { + "title": "Cookieless analytics explained", + "url": "/articles/cookieless-analytics" + }, + { + "title": "How to self-host OpenPanel", + "url": "/articles/how-to-self-host-openpanel" + }, + { + "title": "Best open source analytics tools", + "url": "/articles/open-source-web-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Google Analytics", "url": "/compare/google-analytics-alternative" }, - { "title": "OpenPanel vs Plausible", "url": "/compare/plausible-alternative" }, + { + "title": "OpenPanel vs Google Analytics", + "url": "/compare/google-analytics-alternative" + }, + { + "title": "OpenPanel vs Plausible", + "url": "/compare/plausible-alternative" + }, { "title": "OpenPanel vs Matomo", "url": "/compare/matomo-alternative" } ] }, diff --git a/apps/public/content/for/developers.json b/apps/public/content/for/developers.json index 62980b13..e4370f16 100644 --- a/apps/public/content/for/developers.json +++ b/apps/public/content/for/developers.json @@ -156,13 +156,28 @@ { "title": "Python analytics setup", "url": "/guides/python-analytics" } ], "articles": [ - { "title": "How to self-host OpenPanel", "url": "/articles/how-to-self-host-openpanel" }, - { "title": "Best open source analytics tools", "url": "/articles/open-source-web-analytics" }, - { "title": "Cookieless analytics explained", "url": "/articles/cookieless-analytics" } + { + "title": "How to self-host OpenPanel", + "url": "/articles/how-to-self-host-openpanel" + }, + { + "title": "Best open source analytics tools", + "url": "/articles/open-source-web-analytics" + }, + { + "title": "Cookieless analytics explained", + "url": "/articles/cookieless-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs PostHog", "url": "/compare/posthog-alternative" }, - { "title": "OpenPanel vs Plausible", "url": "/compare/plausible-alternative" }, + { + "title": "OpenPanel vs PostHog", + "url": "/compare/posthog-alternative" + }, + { + "title": "OpenPanel vs Plausible", + "url": "/compare/plausible-alternative" + }, { "title": "OpenPanel vs Umami", "url": "/compare/umami-alternative" } ] }, diff --git a/apps/public/content/for/nextjs.json b/apps/public/content/for/nextjs.json index afd40204..9954b0d1 100644 --- a/apps/public/content/for/nextjs.json +++ b/apps/public/content/for/nextjs.json @@ -135,10 +135,16 @@ { "title": "Track custom events", "url": "/guides/track-custom-events" } ], "articles": [ - { "title": "Self-hosted web analytics", "url": "/articles/self-hosted-web-analytics" } + { + "title": "Self-hosted web analytics", + "url": "/articles/self-hosted-web-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Google Analytics", "url": "/compare/google-analytics-alternative" }, + { + "title": "OpenPanel vs Google Analytics", + "url": "/compare/google-analytics-alternative" + }, { "title": "OpenPanel vs PostHog", "url": "/compare/posthog-alternative" } ] }, diff --git a/apps/public/content/for/saas.json b/apps/public/content/for/saas.json index 7886ec2d..b0ac4a67 100644 --- a/apps/public/content/for/saas.json +++ b/apps/public/content/for/saas.json @@ -143,13 +143,28 @@ { "title": "React analytics setup", "url": "/guides/react-analytics" } ], "articles": [ - { "title": "How to create a funnel", "url": "/articles/how-to-create-a-funnel" }, - { "title": "Self-hosted web analytics", "url": "/articles/self-hosted-web-analytics" } + { + "title": "How to create a funnel", + "url": "/articles/how-to-create-a-funnel" + }, + { + "title": "Self-hosted web analytics", + "url": "/articles/self-hosted-web-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Mixpanel", "url": "/compare/mixpanel-alternative" }, - { "title": "OpenPanel vs PostHog", "url": "/compare/posthog-alternative" }, - { "title": "OpenPanel vs Amplitude", "url": "/compare/amplitude-alternative" } + { + "title": "OpenPanel vs Mixpanel", + "url": "/compare/mixpanel-alternative" + }, + { + "title": "OpenPanel vs PostHog", + "url": "/compare/posthog-alternative" + }, + { + "title": "OpenPanel vs Amplitude", + "url": "/compare/amplitude-alternative" + } ] }, "ctas": { diff --git a/apps/public/content/for/shopify.json b/apps/public/content/for/shopify.json index 6f4ee880..49780b36 100644 --- a/apps/public/content/for/shopify.json +++ b/apps/public/content/for/shopify.json @@ -134,15 +134,30 @@ }, "related_links": { "guides": [ - { "title": "Ecommerce tracking setup", "url": "/guides/ecommerce-tracking" } + { + "title": "Ecommerce tracking setup", + "url": "/guides/ecommerce-tracking" + } ], "articles": [ - { "title": "Cookieless analytics explained", "url": "/articles/cookieless-analytics" }, - { "title": "Best open source analytics tools", "url": "/articles/open-source-web-analytics" } + { + "title": "Cookieless analytics explained", + "url": "/articles/cookieless-analytics" + }, + { + "title": "Best open source analytics tools", + "url": "/articles/open-source-web-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Google Analytics", "url": "/compare/google-analytics-alternative" }, - { "title": "OpenPanel vs Plausible", "url": "/compare/plausible-alternative" } + { + "title": "OpenPanel vs Google Analytics", + "url": "/compare/google-analytics-alternative" + }, + { + "title": "OpenPanel vs Plausible", + "url": "/compare/plausible-alternative" + } ] }, "ctas": { diff --git a/apps/public/content/for/startups.json b/apps/public/content/for/startups.json index 2d9b2d3c..37bc352b 100644 --- a/apps/public/content/for/startups.json +++ b/apps/public/content/for/startups.json @@ -152,17 +152,38 @@ "guides": [ { "title": "Next.js analytics setup", "url": "/guides/nextjs-analytics" }, { "title": "React analytics setup", "url": "/guides/react-analytics" }, - { "title": "Migrate from Google Analytics", "url": "/guides/migrate-from-google-analytics" } + { + "title": "Migrate from Google Analytics", + "url": "/guides/migrate-from-google-analytics" + } ], "articles": [ - { "title": "Best open source analytics tools", "url": "/articles/open-source-web-analytics" }, - { "title": "How to create a funnel", "url": "/articles/how-to-create-a-funnel" }, - { "title": "Cookieless analytics guide", "url": "/articles/cookieless-analytics" } + { + "title": "Best open source analytics tools", + "url": "/articles/open-source-web-analytics" + }, + { + "title": "How to create a funnel", + "url": "/articles/how-to-create-a-funnel" + }, + { + "title": "Cookieless analytics guide", + "url": "/articles/cookieless-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Mixpanel", "url": "/compare/mixpanel-alternative" }, - { "title": "OpenPanel vs PostHog", "url": "/compare/posthog-alternative" }, - { "title": "OpenPanel vs Amplitude", "url": "/compare/amplitude-alternative" } + { + "title": "OpenPanel vs Mixpanel", + "url": "/compare/mixpanel-alternative" + }, + { + "title": "OpenPanel vs PostHog", + "url": "/compare/posthog-alternative" + }, + { + "title": "OpenPanel vs Amplitude", + "url": "/compare/amplitude-alternative" + } ] }, "ctas": { diff --git a/apps/public/content/for/wordpress.json b/apps/public/content/for/wordpress.json index ed2b6a5b..082f1f12 100644 --- a/apps/public/content/for/wordpress.json +++ b/apps/public/content/for/wordpress.json @@ -130,17 +130,38 @@ }, "related_links": { "guides": [ - { "title": "Ecommerce tracking setup", "url": "/guides/ecommerce-tracking" }, - { "title": "Website analytics setup", "url": "/guides/website-analytics-setup" }, - { "title": "OpenPanel WordPress plugin", "url": "https://sv.wordpress.org/plugins/openpanel/" } + { + "title": "Ecommerce tracking setup", + "url": "/guides/ecommerce-tracking" + }, + { + "title": "Website analytics setup", + "url": "/guides/website-analytics-setup" + }, + { + "title": "OpenPanel WordPress plugin", + "url": "https://sv.wordpress.org/plugins/openpanel/" + } ], "articles": [ - { "title": "Cookieless analytics explained", "url": "/articles/cookieless-analytics" }, - { "title": "How to self-host OpenPanel", "url": "/articles/self-hosted-web-analytics" } + { + "title": "Cookieless analytics explained", + "url": "/articles/cookieless-analytics" + }, + { + "title": "How to self-host OpenPanel", + "url": "/articles/self-hosted-web-analytics" + } ], "comparisons": [ - { "title": "OpenPanel vs Google Analytics", "url": "/compare/google-analytics-alternative" }, - { "title": "OpenPanel vs Plausible", "url": "/compare/plausible-alternative" }, + { + "title": "OpenPanel vs Google Analytics", + "url": "/compare/google-analytics-alternative" + }, + { + "title": "OpenPanel vs Plausible", + "url": "/compare/plausible-alternative" + }, { "title": "OpenPanel vs Matomo", "url": "/compare/matomo-alternative" } ] }, diff --git a/apps/public/package.json b/apps/public/package.json index 8819edac..fbd2fa66 100644 --- a/apps/public/package.json +++ b/apps/public/package.json @@ -61,4 +61,4 @@ "typescript": "catalog:", "wrangler": "^4.65.0" } -} \ No newline at end of file +} diff --git a/apps/public/public/google30d28bbdbd56aa6e.html b/apps/public/public/google30d28bbdbd56aa6e.html index 7438696c..0fcdb25c 100644 --- a/apps/public/public/google30d28bbdbd56aa6e.html +++ b/apps/public/public/google30d28bbdbd56aa6e.html @@ -1 +1 @@ -google-site-verification: google30d28bbdbd56aa6e.html \ No newline at end of file +google-site-verification: google30d28bbdbd56aa6e.html diff --git a/apps/public/public/op.js b/apps/public/public/op.js index 3bf91422..8b774577 100644 --- a/apps/public/public/op.js +++ b/apps/public/public/op.js @@ -1,2 +1,254 @@ -"use strict";(()=>{function v(r){return Promise.all(Object.entries(r).map(async([e,i])=>[e,await i??""])).then(e=>Object.fromEntries(e))}function m(r){let e={"Content-Type":"application/json"};return{headers:e,async fetch(i,t,n){let s=`${r}${i}`,o,a=await v(e);return new Promise(p=>{let c=l=>{clearTimeout(o),fetch(s,{headers:a,method:"POST",body:JSON.stringify(t??{}),keepalive:!0,...n??{}}).then(async d=>{if(d.status===401)return null;if(d.status!==200&&d.status!==202)return h(l,p);let g=await d.text();if(!g)return p(null);p(g)}).catch(()=>h(l,p))};function h(l,d){if(l>1)return d(null);o=setTimeout(()=>{c(l+1)},Math.pow(2,l)*500)}c(0)})}}}var u=class{constructor(e){this.state={properties:{}};this.options=e,this.api=m(e.url??"https://api.openpanel.dev"),this.api.headers["openpanel-client-id"]=e.clientId,this.options.clientSecret&&(this.api.headers["openpanel-client-secret"]=this.options.clientSecret)}setProfileId(e){this.state.profileId=e}setProfile(e){this.setProfileId(e.profileId),this.api.fetch("/profile",{...e,properties:{...this.state.properties,...e.properties}})}increment(e,i,t){let n=t?.profileId??this.state.profileId;if(!n)return console.log("No profile id");this.api.fetch("/profile/increment",{profileId:n,property:e,value:i})}decrement(e,i,t){let n=t?.profileId??this.state.profileId;if(!n)return console.log("No profile id");this.api.fetch("/profile/decrement",{profileId:n,property:e,value:i})}event(e,i){let t=i?.profileId??this.state.profileId;delete i?.profileId,this.api.fetch("/event",{name:e,properties:{...this.state.properties,...i??{}},timestamp:this.timestamp(),deviceId:this.getDeviceId(),profileId:t}).then(n=>{this.options.setDeviceId&&n&&this.options.setDeviceId(n)})}setGlobalProperties(e){this.state.properties={...this.state.properties,...e}}clear(){this.state.deviceId=void 0,this.state.profileId=void 0,this.options.removeDeviceId&&this.options.removeDeviceId()}timestamp(){return new Date().toISOString()}getDeviceId(){if(this.state.deviceId)return this.state.deviceId;this.options.getDeviceId&&(this.state.deviceId=this.options.getDeviceId()||void 0)}};function b(r){return r.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""))}var f=class extends u{constructor(i){super(i);this.lastPath="";this.isServer()||(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackScreenViews&&this.trackScreenViews(),this.options.trackAttributes&&this.trackAttributes())}debounce(i,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(i,t)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",i=>{let t=i.target,n=t.closest("a");if(n&&t){let s=n.getAttribute("href");s?.startsWith("http")&&super.event("link_out",{href:s,text:n.innerText||n.getAttribute("title")||t.getAttribute("alt")||t.getAttribute("title")})}})}trackScreenViews(){if(this.isServer())return;let i=history.pushState;history.pushState=function(...o){let a=i.apply(this,o);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),a};let t=history.replaceState;history.replaceState=function(...o){let a=t.apply(this,o);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),a},window.addEventListener("popstate",function(){window.dispatchEvent(new Event("locationchange"))});let n=()=>this.debounce(()=>this.screenView(),50);this.options.hash?window.addEventListener("hashchange",n):window.addEventListener("locationchange",n),setTimeout(()=>n(),50)}trackAttributes(){this.isServer()||document.addEventListener("click",i=>{let t=i.target,n=t.closest("button"),s=t.closest("a"),o=n?.getAttribute("data-event")?n:s?.getAttribute("data-event")?s:null;if(o){let a={};for(let c of o.attributes)c.name.startsWith("data-")&&c.name!=="data-event"&&(a[b(c.name.replace(/^data-/,""))]=c.value);let p=o.getAttribute("data-event");p&&super.event(p,a)}})}screenView(i){if(this.isServer())return;let t=window.location.href;this.lastPath!==t&&(this.lastPath=t,super.event("screen_view",{...i??{},__path:t,__title:document.title}))}};(r=>{if(r.op&&"q"in r.op){let e=r.op.q||[],i=new f(e.shift()[1]);e.forEach(t=>{t[0]in i&&i[t[0]](...t.slice(1))}),r.op=(t,...n)=>{let s=i[t].bind(i);typeof s=="function"&&s(...n)}}})(window);})(); -//# sourceMappingURL=cdn.global.js.map \ No newline at end of file +(() => { + function v(r) { + return Promise.all( + Object.entries(r).map(async ([e, i]) => [e, (await i) ?? '']) + ).then((e) => Object.fromEntries(e)); + } + function m(r) { + const e = { 'Content-Type': 'application/json' }; + return { + headers: e, + async fetch(i, t, n) { + let s = `${r}${i}`, + o, + a = await v(e); + return new Promise((p) => { + const c = (l) => { + clearTimeout(o), + fetch(s, { + headers: a, + method: 'POST', + body: JSON.stringify(t ?? {}), + keepalive: !0, + ...(n ?? {}), + }) + .then(async (d) => { + if (d.status === 401) { + return null; + } + if (d.status !== 200 && d.status !== 202) { + return h(l, p); + } + const g = await d.text(); + if (!g) { + return p(null); + } + p(g); + }) + .catch(() => h(l, p)); + }; + function h(l, d) { + if (l > 1) { + return d(null); + } + o = setTimeout( + () => { + c(l + 1); + }, + 2 ** l * 500 + ); + } + c(0); + }); + }, + }; + } + var u = class { + constructor(e) { + this.state = { properties: {} }; + (this.options = e), + (this.api = m(e.url ?? 'https://api.openpanel.dev')), + (this.api.headers['openpanel-client-id'] = e.clientId), + this.options.clientSecret && + (this.api.headers['openpanel-client-secret'] = + this.options.clientSecret); + } + setProfileId(e) { + this.state.profileId = e; + } + setProfile(e) { + this.setProfileId(e.profileId), + this.api.fetch('/profile', { + ...e, + properties: { ...this.state.properties, ...e.properties }, + }); + } + increment(e, i, t) { + const n = t?.profileId ?? this.state.profileId; + if (!n) { + return console.log('No profile id'); + } + this.api.fetch('/profile/increment', { + profileId: n, + property: e, + value: i, + }); + } + decrement(e, i, t) { + const n = t?.profileId ?? this.state.profileId; + if (!n) { + return console.log('No profile id'); + } + this.api.fetch('/profile/decrement', { + profileId: n, + property: e, + value: i, + }); + } + event(e, i) { + const t = i?.profileId ?? this.state.profileId; + delete i?.profileId, + this.api + .fetch('/event', { + name: e, + properties: { ...this.state.properties, ...(i ?? {}) }, + timestamp: this.timestamp(), + deviceId: this.getDeviceId(), + profileId: t, + }) + .then((n) => { + this.options.setDeviceId && n && this.options.setDeviceId(n); + }); + } + setGlobalProperties(e) { + this.state.properties = { ...this.state.properties, ...e }; + } + clear() { + (this.state.deviceId = void 0), + (this.state.profileId = void 0), + this.options.removeDeviceId && this.options.removeDeviceId(); + } + timestamp() { + return new Date().toISOString(); + } + getDeviceId() { + if (this.state.deviceId) { + return this.state.deviceId; + } + this.options.getDeviceId && + (this.state.deviceId = this.options.getDeviceId() || void 0); + } + }; + function b(r) { + return r.replace(/([-_][a-z])/gi, (e) => + e.toUpperCase().replace('-', '').replace('_', '') + ); + } + var f = class extends u { + constructor(i) { + super(i); + this.lastPath = ''; + this.isServer() || + (this.setGlobalProperties({ __referrer: document.referrer }), + this.options.trackOutgoingLinks && this.trackOutgoingLinks(), + this.options.trackScreenViews && this.trackScreenViews(), + this.options.trackAttributes && this.trackAttributes()); + } + debounce(i, t) { + clearTimeout(this.debounceTimer), (this.debounceTimer = setTimeout(i, t)); + } + isServer() { + return typeof document > 'u'; + } + trackOutgoingLinks() { + this.isServer() || + document.addEventListener('click', (i) => { + const t = i.target, + n = t.closest('a'); + if (n && t) { + const s = n.getAttribute('href'); + s?.startsWith('http') && + super.event('link_out', { + href: s, + text: + n.innerText || + n.getAttribute('title') || + t.getAttribute('alt') || + t.getAttribute('title'), + }); + } + }); + } + trackScreenViews() { + if (this.isServer()) { + return; + } + const i = history.pushState; + history.pushState = function (...o) { + const a = i.apply(this, o); + return ( + window.dispatchEvent(new Event('pushstate')), + window.dispatchEvent(new Event('locationchange')), + a + ); + }; + const t = history.replaceState; + (history.replaceState = function (...o) { + const a = t.apply(this, o); + return ( + window.dispatchEvent(new Event('replacestate')), + window.dispatchEvent(new Event('locationchange')), + a + ); + }), + window.addEventListener('popstate', () => { + window.dispatchEvent(new Event('locationchange')); + }); + const n = () => this.debounce(() => this.screenView(), 50); + this.options.hash + ? window.addEventListener('hashchange', n) + : window.addEventListener('locationchange', n), + setTimeout(() => n(), 50); + } + trackAttributes() { + this.isServer() || + document.addEventListener('click', (i) => { + const t = i.target, + n = t.closest('button'), + s = t.closest('a'), + o = n?.getAttribute('data-event') + ? n + : s?.getAttribute('data-event') + ? s + : null; + if (o) { + const a = {}; + for (const c of o.attributes) { + c.name.startsWith('data-') && + c.name !== 'data-event' && + (a[b(c.name.replace(/^data-/, ''))] = c.value); + } + const p = o.getAttribute('data-event'); + p && super.event(p, a); + } + }); + } + screenView(i) { + if (this.isServer()) { + return; + } + const t = window.location.href; + this.lastPath !== t && + ((this.lastPath = t), + super.event('screen_view', { + ...(i ?? {}), + __path: t, + __title: document.title, + })); + } + }; + ((r) => { + if (r.op && 'q' in r.op) { + const e = r.op.q || [], + i = new f(e.shift()[1]); + e.forEach((t) => { + t[0] in i && i[t[0]](...t.slice(1)); + }), + (r.op = (t, ...n) => { + const s = i[t].bind(i); + typeof s == 'function' && s(...n); + }); + } + })(window); +})(); +//# sourceMappingURL=cdn.global.js.map diff --git a/apps/public/public/op1-replay.js b/apps/public/public/op1-replay.js index ab25171b..88110fb9 100644 --- a/apps/public/public/op1-replay.js +++ b/apps/public/public/op1-replay.js @@ -1,62 +1,11560 @@ -"use strict";var __openpanel_replay=(()=>{var yr=Object.defineProperty;var Zo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var Jo=Object.prototype.hasOwnProperty;var Ko=(s,e)=>{for(var t in e)yr(s,t,{get:e[t],enumerable:!0})},Qo=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Xo(e))!Jo.call(s,i)&&i!==t&&yr(s,i,{get:()=>e[i],enumerable:!(r=Zo(e,i))||r.enumerable});return s};var qo=s=>Qo(yr({},"__esModule",{value:!0}),s);var If={};Ko(If,{startReplayRecorder:()=>jo,stopReplayRecorder:()=>Ho});var ea=Object.defineProperty,ta=(s,e,t)=>e in s?ea(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>ta(s,typeof e!="symbol"?e+"":e,t),Zs,ra=Object.defineProperty,sa=(s,e,t)=>e in s?ra(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Xs=(s,e,t)=>sa(s,typeof e!="symbol"?e+"":e,t),j=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(j||{}),Js={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ks={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ht={},ia=()=>!!globalThis.Zone;function vs(s){if(ht[s])return ht[s];let e=globalThis[s],t=e.prototype,r=s in Js?Js[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in Ks?Ks[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!ia())return ht[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?ht[s]=u:t}catch{return t}}var wr={};function fe(s,e,t){var r;let i=`${s}.${String(t)}`;if(wr[i])return wr[i].call(e);let n=vs(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(wr[i]=o,o.call(e)):e[t]}var br={};function Zi(s,e,t){let r=`${s}.${String(t)}`;if(br[r])return br[r].bind(e);let n=vs(s)[t];return typeof n!="function"?e[t]:(br[r]=n,n.bind(e))}function na(s){return fe("Node",s,"ownerDocument")}function oa(s){return fe("Node",s,"childNodes")}function aa(s){return fe("Node",s,"parentNode")}function la(s){return fe("Node",s,"parentElement")}function ua(s){return fe("Node",s,"textContent")}function ca(s,e){return Zi("Node",s,"contains")(e)}function ha(s){return Zi("Node",s,"getRootNode")()}function fa(s){return!s||!("host"in s)?null:fe("ShadowRoot",s,"host")}function da(s){return s.styleSheets}function pa(s){return!s||!("shadowRoot"in s)?null:fe("Element",s,"shadowRoot")}function ma(s,e){return fe("Element",s,"querySelector")(e)}function ga(s,e){return fe("Element",s,"querySelectorAll")(e)}function ya(){return vs("MutationObserver").constructor}function wa(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var Y={ownerDocument:na,childNodes:oa,parentNode:aa,parentElement:la,textContent:ua,contains:ca,getRootNode:ha,host:fa,styleSheets:da,shadowRoot:pa,querySelector:ma,querySelectorAll:ga,mutationObserver:ya,patch:wa};function Xi(s){return s.nodeType===s.ELEMENT_NODE}function je(s){let e=s&&"host"in s&&"mode"in s&&Y.host(s)||null;return!!(e&&"shadowRoot"in e&&Y.shadowRoot(e)===s)}function He(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function ba(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function Sa(s){let{cssText:e}=s;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function Tr(s){try{let e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&(t=s.ownerNode.baseURI);let r=Array.from(e,i=>Ji(i,t)).join("");return ba(r)}catch{return null}}function Ji(s,e){if(Ca(s)){let t;try{t=Tr(s.styleSheet)||Sa(s)}catch{t=s.cssText}return s.styleSheet.href?Vt(t,s.styleSheet.href):t}else{let t=s.cssText;return Ia(s)&&s.selectorText.includes(":")&&(t=va(t)),e?Vt(t,e):t}}function va(s){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Ca(s){return"styleSheet"in s}function Ia(s){return"selectorText"in s}var Bt=class{constructor(){Xs(this,"idNodeMap",new Map),Xs(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-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);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ea(){return new Bt}function Wt({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"",l=r&&Se(r);return(e[t.toLowerCase()]||l&&e[l])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Se(s){return s.toLowerCase()}var Qs="__rrweb_original__";function xa(s){let e=s.getContext("2d");if(!e)return!0;let t=50;for(let r=0;ra!==0))return!1}return!0}function zt(s){let e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Se(e):null}function Ki(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return i?.[1]??null}function Ma(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}var Na=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ra=/^(?:[a-z+]+:)?\/\//i,Aa=/^www\..*/i,Oa=/^(data:)([^,]*),(.*)/i;function Vt(s,e){return(s||"").replace(Na,(t,r,i,n,o,l)=>{let a=i||o||l,u=r||n||"";if(!a)return t;if(Ra.test(a)||Aa.test(a))return`url(${u}${a}${u})`;if(Oa.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${Ma(e)+a}${u})`;let c=e.split("/"),f=a.split("/");c.pop();for(let p of f)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function ft(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Da(s,e,t=!1){let r=Array.from(e.childNodes),i=[],n=0;if(r.length>1&&s&&typeof s=="string"){let o=ft(s,t),l=o.length/s.length;for(let a=1;a2&&g[0]===""&&r[a-1].textContent!=="")m=o.indexOf(p,1);else if(g.length===1){if(p=p.substring(0,p.length-1),g=o.split(p),g.length<=1)return i.push(s),i;f=c+1}else f===u.length-1&&(m=o.indexOf(p));if(g.length>=2&&f>c){let d=r[a-1].textContent;if(d&&typeof d=="string"){let h=ft(d).length;m=o.indexOf(p,h)}m===-1&&(m=g[0].length)}if(m!==-1){let d=Math.floor(m/l);for(;d>0&&d50*r.length)return i.push(s),i;let h=ft(s.substring(0,d),t);if(h.length===m){i.push(s.substring(0,d)),s=s.substring(d),o=o.substring(m);break}else h.length=e.length);){let n=r($a);if(n.slice(-1)===",")n=Ne(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Ne(s,n);let l=!1;for(;;){let a=e.charAt(t);if(a===""){i.push((n+o).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,i.push((n+o).trim());break}else a==="("&&(l=!0);o+=a,t+=1}}}return i.join(", ")}var ei=new WeakMap;function Ne(s,e){return!e||e.trim()===""?e:Cs(s,e)}function Ua(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Cs(s,e){let t=ei.get(s);if(t||(t=s.createElement("a"),ei.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function qi(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&["table","td","th"].includes(e)?Ne(s,r):t==="srcset"?Fa(s,r):t==="style"?Vt(r,Cs(s)):e==="object"&&t==="data"?Ne(s,r):r)}function en(s,e,t){return["video","audio"].includes(s)&&e==="autoplay"}function Ba(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){let i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch{}return!1}function Gt(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Gt(Y.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){let i=s.classList[r];if(e.test(i))return!0}return t?Gt(Y.parentNode(s),e,t):!1}function tn(s,e,t,r){let i;if(Xi(s)){if(i=s,!Y.childNodes(i).length)return!1}else{if(Y.parentElement(s)===null)return!1;i=Y.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(Gt(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function Wa(s,e,t){let r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch{return}if(n!=="complete"){let l=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),i=!0,e()});return}let o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function za(s,e,t){let r=!1,i;try{i=s.sheet}catch{return}if(i)return;let n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Va(s,e){let{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,dataURLOptions:f={},inlineImages:p,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:h=!1}=e,b=Ga(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:j.Document,childNodes:[],compatMode:s.compatMode}:{type:j.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:j.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:b};case s.ELEMENT_NODE:return Ha(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,dataURLOptions:f,inlineImages:p,recordCanvas:g,keepIframeSrcFn:m,newlyAddedElement:d,rootId:b});case s.TEXT_NODE:return ja(s,{doc:t,needsMask:o,maskTextFn:u,rootId:b,cssCaptured:h});case s.CDATA_SECTION_NODE:return{type:j.CDATA,textContent:"",rootId:b};case s.COMMENT_NODE:return{type:j.Comment,textContent:Y.textContent(s)||"",rootId:b};default:return!1}}function Ga(s,e){if(!e.hasNode(s))return;let t=e.getId(s);return t===1?void 0:t}function ja(s,e){let{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=Y.parentNode(s),l=o&&o.tagName,a="",u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":n||(a=Y.textContent(s),u&&a&&(a=Vt(a,Cs(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,Y.parentElement(s)):a.replace(/[\S]/g,"*")),{type:j.Text,textContent:a||"",rootId:i}}function Ha(s,e){let{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,dataURLOptions:a={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:g}=e,m=Ba(s,r,i),d=Pa(s),h={},b=s.attributes.length;for(let y=0;yN.href===s.href),v=null;y&&(v=Tr(y)),v&&(delete h.rel,delete h.href,h._cssText=v)}if(d==="style"&&s.sheet){let y=Tr(s.sheet);y&&(s.childNodes.length>1&&(y=Ta(y,s)),h._cssText=y)}if(["input","textarea","select"].includes(d)){let y=s.value,v=s.checked;h.type!=="radio"&&h.type!=="checkbox"&&h.type!=="submit"&&h.type!=="button"&&y?h.value=Wt({element:s,type:zt(s),tagName:d,value:y,maskInputOptions:o,maskInputFn:l}):v&&(h.checked=v)}if(d==="option"&&(s.selected&&!o.select?h.selected=!0:delete h.selected),d==="dialog"&&s.open&&(h.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&c){if(s.__context==="2d")xa(s)||(h.rr_dataURL=s.toDataURL(a.type,a.quality));else if(!("__context"in s)){let y=s.toDataURL(a.type,a.quality),v=t.createElement("canvas");v.width=s.width,v.height=s.height;let N=v.toDataURL(a.type,a.quality);y!==N&&(h.rr_dataURL=y)}}if(d==="img"&&u){Ee||(Ee=t.createElement("canvas"),qs=Ee.getContext("2d"));let y=s,v=y.currentSrc||y.getAttribute("src")||"",N=y.crossOrigin,D=()=>{y.removeEventListener("load",D);try{Ee.width=y.naturalWidth,Ee.height=y.naturalHeight,qs.drawImage(y,0,0),h.rr_dataURL=Ee.toDataURL(a.type,a.quality)}catch(z){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?D():y.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${v}! Error: ${z}`)}y.crossOrigin==="anonymous"&&(N?h.crossOrigin=N:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?D():y.addEventListener("load",D)}if(["audio","video"].includes(d)){let y=h;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(p||(s.scrollLeft&&(h.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(h.rr_scrollTop=s.scrollTop)),m){let{width:y,height:v}=s.getBoundingClientRect();h={class:h.class,rr_width:`${y}px`,rr_height:`${v}px`}}d==="iframe"&&!f(h.src)&&(s.contentDocument||(h.rr_src=h.src),delete h.src);let S;try{customElements.get(d)&&(S=!0)}catch{}return{type:j.Element,tagName:d,attributes:h,childNodes:[],isSVG:Ua(s)||void 0,needBlock:m,rootId:g,isCustom:S}}function k(s){return s==null?"":s.toLowerCase()}function rn(s){return s===!0||s==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:s==="all",headMetaDescKeywords:s==="all",headTitleMutations:s==="all"}:s||{}}function Ya(s,e){if(e.comment&&s.type===j.Comment)return!0;if(s.type===j.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Ki(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(k(s.attributes.name).match(/^msapplication-tile(image|color)$/)||k(s.attributes.name)==="application-name"||k(s.attributes.rel)==="icon"||k(s.attributes.rel)==="apple-touch-icon"||k(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&k(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(k(s.attributes.property).match(/^(og|twitter|fb):/)||k(s.attributes.name).match(/^(og|twitter):/)||k(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(k(s.attributes.name)==="robots"||k(s.attributes.name)==="googlebot"||k(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(k(s.attributes.name)==="author"||k(s.attributes.name)==="generator"||k(s.attributes.name)==="framework"||k(s.attributes.name)==="publisher"||k(s.attributes.name)==="progid"||k(s.attributes.property).match(/^article:/)||k(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(k(s.attributes.name)==="google-site-verification"||k(s.attributes.name)==="yandex-verification"||k(s.attributes.name)==="csrf-token"||k(s.attributes.name)==="p:domain_verify"||k(s.attributes.name)==="verify-v1"||k(s.attributes.name)==="verification"||k(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Re(s,e){let{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:h=!1,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:z=!1,cssCaptured:_=!1}=e,{needsMask:V}=e,{preserveWhiteSpace:H=!0}=e;V||(V=tn(s,o,l,V===void 0));let Q=Va(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:V,inlineStylesheet:u,maskInputOptions:c,maskTextFn:f,maskInputFn:p,dataURLOptions:m,inlineImages:d,recordCanvas:h,keepIframeSrcFn:D,newlyAddedElement:z,cssCaptured:_});if(!Q)return console.warn(s,"not serialized"),null;let ne;r.hasNode(s)?ne=r.getId(s):Ya(Q,g)||!H&&Q.type===j.Text&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ne=Ze:ne=Qi();let M=Object.assign(Q,{id:ne});if(r.add(s,M),ne===Ze)return null;b&&b(s);let Fe=!a;if(M.type===j.Element){Fe=Fe&&!M.needBlock,delete M.needBlock;let G=Y.shadowRoot(s);G&&He(G)&&(M.isShadowHost=!0)}if((M.type===j.Document||M.type===j.Element)&&Fe){g.headWhitespace&&M.type===j.Element&&M.tagName==="head"&&(H=!1);let G={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:V,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:m,inlineImages:d,recordCanvas:h,preserveWhiteSpace:H,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D,cssCaptured:!1};if(!(M.type===j.Element&&M.tagName==="textarea"&&M.attributes.value!==void 0)){M.type===j.Element&&M.attributes._cssText!==void 0&&typeof M.attributes._cssText=="string"&&(G.cssCaptured=!0);for(let ge of Array.from(Y.childNodes(s))){let oe=Re(ge,G);oe&&M.childNodes.push(oe)}}let q=null;if(Xi(s)&&(q=Y.shadowRoot(s)))for(let ge of Array.from(Y.childNodes(q))){let oe=Re(ge,G);oe&&(He(q)&&(oe.isShadow=!0),M.childNodes.push(oe))}}let Ue=Y.parentNode(s);return Ue&&je(Ue)&&He(Ue)&&(M.isShadow=!0),M.type===j.Element&&M.tagName==="iframe"&&Wa(s,()=>{let G=s.contentDocument;if(G&&S){let q=Re(G,{doc:G,mirror:r,blockClass:i,blockSelector:n,needsMask:V,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:m,inlineImages:d,recordCanvas:h,preserveWhiteSpace:H,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D});q&&S(s,q)}},y),M.type===j.Element&&M.tagName==="link"&&typeof M.attributes.rel=="string"&&(M.attributes.rel==="stylesheet"||M.attributes.rel==="preload"&&typeof M.attributes.href=="string"&&Ki(M.attributes.href)==="css")&&za(s,()=>{if(v){let G=Re(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:V,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:m,inlineImages:d,recordCanvas:h,preserveWhiteSpace:H,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:y,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D});G&&v(s,G)}},N),M}function Za(s,e){let{mirror:t=new Bt,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:f,maskInputFn:p,slimDOM:g=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:h,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:y,stylesheetLoadTimeout:v,keepIframeSrcFn:N=()=>!1}=e||{},D=c===!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}:c===!1?{password:!0}:c,z=rn(g);return Re(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:D,maskTextFn:f,maskInputFn:p,slimDOMOptions:z,dataURLOptions:m,inlineImages:a,recordCanvas:u,preserveWhiteSpace:d,onSerialize:h,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:y,stylesheetLoadTimeout:v,keepIframeSrcFn:N,newlyAddedElement:!1})}var Xa=/(max|min)-device-(width|height)/,xf=new RegExp(Xa.source,"g");function Ja(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ka(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Is={exports:{}},P=String,sn=function(){return{isColorSupported:!1,reset:P,bold:P,dim:P,italic:P,underline:P,inverse:P,hidden:P,strikethrough:P,black:P,red:P,green:P,yellow:P,blue:P,magenta:P,cyan:P,white:P,gray:P,bgBlack:P,bgRed:P,bgGreen:P,bgYellow:P,bgBlue:P,bgMagenta:P,bgCyan:P,bgWhite:P}};Is.exports=sn();Is.exports.createColors=sn;var Qa=Is.exports,qa={},el=Object.freeze(Object.defineProperty({__proto__:null,default:qa},Symbol.toStringTag,{value:"Module"})),se=Ka(el),ti=Qa,ri=se,_r=class nn extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,nn)}setMessage(){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(e){if(!this.source)return"";let t=this.source;e==null&&(e=ti.isColorSupported),ri&&e&&(t=ri(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:f}=ti.createColors(!0);l=p=>u(f(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let f=i+1+c,p=" "+(" "+f).slice(-o)+" | ";if(f===this.line){let g=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+` - `+g+l("^")}return" "+a(p)+u}).join(` -`)}toString(){let e=this.showSourceCode();return e&&(e=` +var __openpanel_replay = (() => { + var yr = Object.defineProperty; + var Zo = Object.getOwnPropertyDescriptor; + var Xo = Object.getOwnPropertyNames; + var Jo = Object.prototype.hasOwnProperty; + var Ko = (s, e) => { + for (var t in e) { + yr(s, t, { get: e[t], enumerable: !0 }); + } + }, + Qo = (s, e, t, r) => { + if ((e && typeof e == 'object') || typeof e == 'function') { + for (const i of Xo(e)) { + !Jo.call(s, i) && + i !== t && + yr(s, i, { + get: () => e[i], + enumerable: !(r = Zo(e, i)) || r.enumerable, + }); + } + } + return s; + }; + var qo = (s) => Qo(yr({}, '__esModule', { value: !0 }), s); + var If = {}; + Ko(If, { startReplayRecorder: () => jo, stopReplayRecorder: () => Ho }); + var ea = Object.defineProperty, + ta = (s, e, t) => + e in s + ? ea(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) + : (s[e] = t), + w = (s, e, t) => ta(s, typeof e != 'symbol' ? e + '' : e, t), + Zs, + ra = Object.defineProperty, + sa = (s, e, t) => + e in s + ? ra(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) + : (s[e] = t), + Xs = (s, e, t) => sa(s, typeof e != 'symbol' ? e + '' : e, t), + j = ((s) => ( + (s[(s.Document = 0)] = 'Document'), + (s[(s.DocumentType = 1)] = 'DocumentType'), + (s[(s.Element = 2)] = 'Element'), + (s[(s.Text = 3)] = 'Text'), + (s[(s.CDATA = 4)] = 'CDATA'), + (s[(s.Comment = 5)] = 'Comment'), + s + ))(j || {}), + Js = { + Node: [ + 'childNodes', + 'parentNode', + 'parentElement', + 'textContent', + 'ownerDocument', + ], + ShadowRoot: ['host', 'styleSheets'], + Element: ['shadowRoot', 'querySelector', 'querySelectorAll'], + MutationObserver: [], + }, + Ks = { + Node: ['contains', 'getRootNode'], + ShadowRoot: ['getSelection'], + Element: [], + MutationObserver: ['constructor'], + }, + ht = {}, + ia = () => !!globalThis.Zone; + function vs(s) { + if (ht[s]) { + return ht[s]; + } + const e = globalThis[s], + t = e.prototype, + r = s in Js ? Js[s] : void 0, + i = !!( + r && + r.every((l) => { + var a, u; + return !!( + (u = + (a = Object.getOwnPropertyDescriptor(t, l)) == null + ? void 0 + : a.get) != null && u.toString().includes('[native code]') + ); + }) + ), + n = s in Ks ? Ks[s] : void 0, + o = !!( + n && + n.every((l) => { + var a; + return ( + typeof t[l] == 'function' && + ((a = t[l]) == null + ? void 0 + : a.toString().includes('[native code]')) + ); + }) + ); + if (i && o && !ia()) { + return (ht[s] = e.prototype), e.prototype; + } + try { + const l = document.createElement('iframe'); + document.body.appendChild(l); + const a = l.contentWindow; + if (!a) { + return e.prototype; + } + const u = a[s].prototype; + return document.body.removeChild(l), u ? (ht[s] = u) : t; + } catch { + return t; + } + } + var wr = {}; + function fe(s, e, t) { + var r; + const i = `${s}.${String(t)}`; + if (wr[i]) { + return wr[i].call(e); + } + const n = vs(s), + o = (r = Object.getOwnPropertyDescriptor(n, t)) == null ? void 0 : r.get; + return o ? ((wr[i] = o), o.call(e)) : e[t]; + } + var br = {}; + function Zi(s, e, t) { + const r = `${s}.${String(t)}`; + if (br[r]) { + return br[r].bind(e); + } + const n = vs(s)[t]; + return typeof n != 'function' ? e[t] : ((br[r] = n), n.bind(e)); + } + function na(s) { + return fe('Node', s, 'ownerDocument'); + } + function oa(s) { + return fe('Node', s, 'childNodes'); + } + function aa(s) { + return fe('Node', s, 'parentNode'); + } + function la(s) { + return fe('Node', s, 'parentElement'); + } + function ua(s) { + return fe('Node', s, 'textContent'); + } + function ca(s, e) { + return Zi('Node', s, 'contains')(e); + } + function ha(s) { + return Zi('Node', s, 'getRootNode')(); + } + function fa(s) { + return s && 'host' in s ? fe('ShadowRoot', s, 'host') : null; + } + function da(s) { + return s.styleSheets; + } + function pa(s) { + return s && 'shadowRoot' in s ? fe('Element', s, 'shadowRoot') : null; + } + function ma(s, e) { + return fe('Element', s, 'querySelector')(e); + } + function ga(s, e) { + return fe('Element', s, 'querySelectorAll')(e); + } + function ya() { + return vs('MutationObserver').constructor; + } + function wa(s, e, t) { + try { + if (!(e in s)) { + return () => {}; + } + const r = s[e], + i = t(r); + return ( + typeof i == 'function' && + ((i.prototype = i.prototype || {}), + Object.defineProperties(i, { + __rrweb_original__: { enumerable: !1, value: r }, + })), + (s[e] = i), + () => { + s[e] = r; + } + ); + } catch { + return () => {}; + } + } + var Y = { + ownerDocument: na, + childNodes: oa, + parentNode: aa, + parentElement: la, + textContent: ua, + contains: ca, + getRootNode: ha, + host: fa, + styleSheets: da, + shadowRoot: pa, + querySelector: ma, + querySelectorAll: ga, + mutationObserver: ya, + patch: wa, + }; + function Xi(s) { + return s.nodeType === s.ELEMENT_NODE; + } + function je(s) { + const e = (s && 'host' in s && 'mode' in s && Y.host(s)) || null; + return !!(e && 'shadowRoot' in e && Y.shadowRoot(e) === s); + } + function He(s) { + return Object.prototype.toString.call(s) === '[object ShadowRoot]'; + } + function ba(s) { + return ( + s.includes(' background-clip: text;') && + !s.includes(' -webkit-background-clip: text;') && + (s = s.replace( + /\sbackground-clip:\s*text;/g, + ' -webkit-background-clip: text; background-clip: text;' + )), + s + ); + } + function Sa(s) { + const { cssText: e } = s; + if (e.split('"').length < 3) { + return e; + } + const t = ['@import', `url(${JSON.stringify(s.href)})`]; + return ( + s.layerName === '' + ? t.push('layer') + : s.layerName && t.push(`layer(${s.layerName})`), + s.supportsText && t.push(`supports(${s.supportsText})`), + s.media.length && t.push(s.media.mediaText), + t.join(' ') + ';' + ); + } + function Tr(s) { + try { + const e = s.rules || s.cssRules; + if (!e) { + return null; + } + let t = s.href; + !t && s.ownerNode && (t = s.ownerNode.baseURI); + const r = Array.from(e, (i) => Ji(i, t)).join(''); + return ba(r); + } catch { + return null; + } + } + function Ji(s, e) { + if (Ca(s)) { + let t; + try { + t = Tr(s.styleSheet) || Sa(s); + } catch { + t = s.cssText; + } + return s.styleSheet.href ? Vt(t, s.styleSheet.href) : t; + } + let t = s.cssText; + return ( + Ia(s) && s.selectorText.includes(':') && (t = va(t)), e ? Vt(t, e) : t + ); + } + function va(s) { + const e = /(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm; + return s.replace(e, '$1\\$2'); + } + function Ca(s) { + return 'styleSheet' in s; + } + function Ia(s) { + return 'selectorText' in s; + } + var Bt = class { + constructor() { + Xs(this, 'idNodeMap', new Map()), Xs(this, 'nodeMetaMap', new WeakMap()); + } + getId(e) { + var t; + return e ? (((t = this.getMeta(e)) == null ? void 0 : t.id) ?? -1) : -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) { + const t = this.getId(e); + this.idNodeMap.delete(t), + e.childNodes && e.childNodes.forEach((r) => this.removeNodeFromMap(r)); + } + has(e) { + return this.idNodeMap.has(e); + } + hasNode(e) { + return this.nodeMetaMap.has(e); + } + add(e, t) { + const r = t.id; + this.idNodeMap.set(r, e), this.nodeMetaMap.set(e, t); + } + replace(e, t) { + const r = this.getNode(e); + if (r) { + const i = this.nodeMetaMap.get(r); + i && this.nodeMetaMap.set(t, i); + } + this.idNodeMap.set(e, t); + } + reset() { + (this.idNodeMap = new Map()), (this.nodeMetaMap = new WeakMap()); + } + }; + function Ea() { + return new Bt(); + } + function Wt({ + element: s, + maskInputOptions: e, + tagName: t, + type: r, + value: i, + maskInputFn: n, + }) { + let o = i || '', + l = r && Se(r); + return ( + (e[t.toLowerCase()] || (l && e[l])) && + (n ? (o = n(o, s)) : (o = '*'.repeat(o.length))), + o + ); + } + function Se(s) { + return s.toLowerCase(); + } + var Qs = '__rrweb_original__'; + function xa(s) { + const e = s.getContext('2d'); + if (!e) { + return !0; + } + const t = 50; + for (let r = 0; r < s.width; r += t) { + for (let i = 0; i < s.height; i += t) { + const n = e.getImageData, + o = Qs in n ? n[Qs] : n; + if ( + new Uint32Array( + o.call(e, r, i, Math.min(t, s.width - r), Math.min(t, s.height - i)) + .data.buffer + ).some((a) => a !== 0) + ) { + return !1; + } + } + } + return !0; + } + function zt(s) { + const e = s.type; + return s.hasAttribute('data-rr-is-password') + ? 'password' + : e + ? Se(e) + : null; + } + function Ki(s, e) { + let t; + try { + t = new URL(s, e ?? window.location.href); + } catch { + return null; + } + const r = /\.([0-9a-z]+)(?:$)/i, + i = t.pathname.match(r); + return i?.[1] ?? null; + } + function Ma(s) { + let e = ''; + return ( + s.indexOf('//') > -1 + ? (e = s.split('/').slice(0, 3).join('/')) + : (e = s.split('/')[0]), + (e = e.split('?')[0]), + e + ); + } + var Na = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, + Ra = /^(?:[a-z+]+:)?\/\//i, + Aa = /^www\..*/i, + Oa = /^(data:)([^,]*),(.*)/i; + function Vt(s, e) { + return (s || '').replace(Na, (t, r, i, n, o, l) => { + const a = i || o || l, + u = r || n || ''; + if (!a) { + return t; + } + if (Ra.test(a) || Aa.test(a)) { + return `url(${u}${a}${u})`; + } + if (Oa.test(a)) { + return `url(${u}${a}${u})`; + } + if (a[0] === '/') { + return `url(${u}${Ma(e) + a}${u})`; + } + const c = e.split('/'), + f = a.split('/'); + c.pop(); + for (const p of f) { + p !== '.' && (p === '..' ? c.pop() : c.push(p)); + } + return `url(${u}${c.join('/')}${u})`; + }); + } + function ft(s, e = !1) { + return e + ? s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, '') + : s.replace(/(\/\*[^*]*\*\/)|[\s;]/g, '').replace(/0px/g, '0'); + } + function Da(s, e, t = !1) { + let r = Array.from(e.childNodes), + i = [], + n = 0; + if (r.length > 1 && s && typeof s == 'string') { + let o = ft(s, t), + l = o.length / s.length; + for (let a = 1; a < r.length; a++) { + if (r[a].textContent && typeof r[a].textContent == 'string') { + let u = ft(r[a].textContent, t), + c = 100, + f = 3; + for ( + ; + f < u.length && + (u[f].match(/[a-zA-Z0-9]/) || + u.indexOf(u.substring(0, f), 1) !== -1); + f++ + ) {} + for (; f < u.length; f++) { + let p = u.substring(0, f), + g = o.split(p), + m = -1; + if (g.length === 2) { + m = g[0].length; + } else if ( + g.length > 2 && + g[0] === '' && + r[a - 1].textContent !== '' + ) { + m = o.indexOf(p, 1); + } else if (g.length === 1) { + if ( + ((p = p.substring(0, p.length - 1)), + (g = o.split(p)), + g.length <= 1) + ) { + return i.push(s), i; + } + f = c + 1; + } else { + f === u.length - 1 && (m = o.indexOf(p)); + } + if (g.length >= 2 && f > c) { + const d = r[a - 1].textContent; + if (d && typeof d == 'string') { + const h = ft(d).length; + m = o.indexOf(p, h); + } + m === -1 && (m = g[0].length); + } + if (m !== -1) { + let d = Math.floor(m / l); + while (d > 0 && d < s.length) { + if (((n += 1), n > 50 * r.length)) { + return i.push(s), i; + } + const h = ft(s.substring(0, d), t); + if (h.length === m) { + i.push(s.substring(0, d)), + (s = s.substring(d)), + (o = o.substring(m)); + break; + } + h.length < m + ? (d += Math.max(1, Math.floor((m - h.length) / l))) + : (d -= Math.max(1, Math.floor((h.length - m) * l))); + } + break; + } + } + } + } + } + return i.push(s), i; + } + function Ta(s, e) { + return Da(s, e).join('/* rr_split */'); + } + var _a = 1, + ka = /[^a-z0-9-_:]/, + Ze = -2; + function Qi() { + return _a++; + } + function Pa(s) { + if (s instanceof HTMLFormElement) { + return 'form'; + } + const e = Se(s.tagName); + return ka.test(e) ? 'div' : e; + } + var Ee, + qs, + $a = /^[^ \t\n\r\u000c]+/, + La = /^[, \t\n\r\u000c]+/; + function Fa(s, e) { + if (e.trim() === '') { + return e; + } + let t = 0; + function r(n) { + let o, + l = n.exec(e.substring(t)); + return l ? ((o = l[0]), (t += o.length), o) : ''; + } + const i = []; + while ((r(La), !(t >= e.length))) { + let n = r($a); + if (n.slice(-1) === ',') { + (n = Ne(s, n.substring(0, n.length - 1))), i.push(n); + } else { + let o = ''; + n = Ne(s, n); + let l = !1; + for (;;) { + const a = e.charAt(t); + if (a === '') { + i.push((n + o).trim()); + break; + } + if (l) { + a === ')' && (l = !1); + } else if (a === ',') { + (t += 1), i.push((n + o).trim()); + break; + } else { + a === '(' && (l = !0); + } + (o += a), (t += 1); + } + } + } + return i.join(', '); + } + var ei = new WeakMap(); + function Ne(s, e) { + return !e || e.trim() === '' ? e : Cs(s, e); + } + function Ua(s) { + return !!(s.tagName === 'svg' || s.ownerSVGElement); + } + function Cs(s, e) { + let t = ei.get(s); + if ((t || ((t = s.createElement('a')), ei.set(s, t)), !e)) { + e = ''; + } else if (e.startsWith('blob:') || e.startsWith('data:')) { + return e; + } + return t.setAttribute('href', e), t.href; + } + function qi(s, e, t, r) { + return ( + r && + (t === 'src' || + (t === 'href' && !(e === 'use' && r[0] === '#')) || + (t === 'xlink:href' && r[0] !== '#') || + (t === 'background' && ['table', 'td', 'th'].includes(e)) + ? Ne(s, r) + : t === 'srcset' + ? Fa(s, r) + : t === 'style' + ? Vt(r, Cs(s)) + : e === 'object' && t === 'data' + ? Ne(s, r) + : r) + ); + } + function en(s, e, t) { + return ['video', 'audio'].includes(s) && e === 'autoplay'; + } + function Ba(s, e, t) { + try { + if (typeof e == 'string') { + if (s.classList.contains(e)) { + return !0; + } + } else { + for (let r = s.classList.length; r--; ) { + const i = s.classList[r]; + if (e.test(i)) { + return !0; + } + } + } + if (t) { + return s.matches(t); + } + } catch {} + return !1; + } + function Gt(s, e, t) { + if (!s) { + return !1; + } + if (s.nodeType !== s.ELEMENT_NODE) { + return t ? Gt(Y.parentNode(s), e, t) : !1; + } + for (let r = s.classList.length; r--; ) { + const i = s.classList[r]; + if (e.test(i)) { + return !0; + } + } + return t ? Gt(Y.parentNode(s), e, t) : !1; + } + function tn(s, e, t, r) { + let i; + if (Xi(s)) { + if (((i = s), !Y.childNodes(i).length)) { + return !1; + } + } else { + if (Y.parentElement(s) === null) { + return !1; + } + i = Y.parentElement(s); + } + try { + if (typeof e == 'string') { + if (r) { + if (i.closest(`.${e}`)) { + return !0; + } + } else if (i.classList.contains(e)) { + return !0; + } + } else if (Gt(i, e, r)) { + return !0; + } + if (t) { + if (r) { + if (i.closest(t)) { + return !0; + } + } else if (i.matches(t)) { + return !0; + } + } + } catch {} + return !1; + } + function Wa(s, e, t) { + const r = s.contentWindow; + if (!r) { + return; + } + let i = !1, + n; + try { + n = r.document.readyState; + } catch { + return; + } + if (n !== 'complete') { + const l = setTimeout(() => { + i || (e(), (i = !0)); + }, t); + s.addEventListener('load', () => { + clearTimeout(l), (i = !0), e(); + }); + return; + } + const o = 'about:blank'; + if (r.location.href !== o || s.src === o || s.src === '') { + return setTimeout(e, 0), s.addEventListener('load', e); + } + s.addEventListener('load', e); + } + function za(s, e, t) { + let r = !1, + i; + try { + i = s.sheet; + } catch { + return; + } + if (i) { + return; + } + const n = setTimeout(() => { + r || (e(), (r = !0)); + }, t); + s.addEventListener('load', () => { + clearTimeout(n), (r = !0), e(); + }); + } + function Va(s, e) { + const { + doc: t, + mirror: r, + blockClass: i, + blockSelector: n, + needsMask: o, + inlineStylesheet: l, + maskInputOptions: a = {}, + maskTextFn: u, + maskInputFn: c, + dataURLOptions: f = {}, + inlineImages: p, + recordCanvas: g, + keepIframeSrcFn: m, + newlyAddedElement: d = !1, + cssCaptured: h = !1, + } = e, + b = Ga(t, r); + switch (s.nodeType) { + case s.DOCUMENT_NODE: + return s.compatMode !== 'CSS1Compat' + ? { type: j.Document, childNodes: [], compatMode: s.compatMode } + : { type: j.Document, childNodes: [] }; + case s.DOCUMENT_TYPE_NODE: + return { + type: j.DocumentType, + name: s.name, + publicId: s.publicId, + systemId: s.systemId, + rootId: b, + }; + case s.ELEMENT_NODE: + return Ha(s, { + doc: t, + blockClass: i, + blockSelector: n, + inlineStylesheet: l, + maskInputOptions: a, + maskInputFn: c, + dataURLOptions: f, + inlineImages: p, + recordCanvas: g, + keepIframeSrcFn: m, + newlyAddedElement: d, + rootId: b, + }); + case s.TEXT_NODE: + return ja(s, { + doc: t, + needsMask: o, + maskTextFn: u, + rootId: b, + cssCaptured: h, + }); + case s.CDATA_SECTION_NODE: + return { type: j.CDATA, textContent: '', rootId: b }; + case s.COMMENT_NODE: + return { + type: j.Comment, + textContent: Y.textContent(s) || '', + rootId: b, + }; + default: + return !1; + } + } + function Ga(s, e) { + if (!e.hasNode(s)) { + return; + } + const t = e.getId(s); + return t === 1 ? void 0 : t; + } + function ja(s, e) { + let { needsMask: t, maskTextFn: r, rootId: i, cssCaptured: n } = e, + o = Y.parentNode(s), + l = o && o.tagName, + a = '', + u = l === 'STYLE' ? !0 : void 0, + c = l === 'SCRIPT' ? !0 : void 0; + return ( + c + ? (a = 'SCRIPT_PLACEHOLDER') + : n || ((a = Y.textContent(s)), u && a && (a = Vt(a, Cs(e.doc)))), + !(u || c) && + a && + t && + (a = r ? r(a, Y.parentElement(s)) : a.replace(/[\S]/g, '*')), + { type: j.Text, textContent: a || '', rootId: i } + ); + } + function Ha(s, e) { + let { + doc: t, + blockClass: r, + blockSelector: i, + inlineStylesheet: n, + maskInputOptions: o = {}, + maskInputFn: l, + dataURLOptions: a = {}, + inlineImages: u, + recordCanvas: c, + keepIframeSrcFn: f, + newlyAddedElement: p = !1, + rootId: g, + } = e, + m = Ba(s, r, i), + d = Pa(s), + h = {}, + b = s.attributes.length; + for (let y = 0; y < b; y++) { + const v = s.attributes[y]; + en(d, v.name, v.value) || (h[v.name] = qi(t, d, Se(v.name), v.value)); + } + if (d === 'link' && n) { + let y = Array.from(t.styleSheets).find((N) => N.href === s.href), + v = null; + y && (v = Tr(y)), v && (delete h.rel, delete h.href, (h._cssText = v)); + } + if (d === 'style' && s.sheet) { + let y = Tr(s.sheet); + y && (s.childNodes.length > 1 && (y = Ta(y, s)), (h._cssText = y)); + } + if (['input', 'textarea', 'select'].includes(d)) { + const y = s.value, + v = s.checked; + h.type !== 'radio' && + h.type !== 'checkbox' && + h.type !== 'submit' && + h.type !== 'button' && + y + ? (h.value = Wt({ + element: s, + type: zt(s), + tagName: d, + value: y, + maskInputOptions: o, + maskInputFn: l, + })) + : v && (h.checked = v); + } + if ( + (d === 'option' && + (s.selected && !o.select ? (h.selected = !0) : delete h.selected), + d === 'dialog' && + s.open && + (h.rr_open_mode = s.matches('dialog:modal') ? 'modal' : 'non-modal'), + d === 'canvas' && c) + ) { + if (s.__context === '2d') { + xa(s) || (h.rr_dataURL = s.toDataURL(a.type, a.quality)); + } else if (!('__context' in s)) { + const y = s.toDataURL(a.type, a.quality), + v = t.createElement('canvas'); + (v.width = s.width), (v.height = s.height); + const N = v.toDataURL(a.type, a.quality); + y !== N && (h.rr_dataURL = y); + } + } + if (d === 'img' && u) { + Ee || ((Ee = t.createElement('canvas')), (qs = Ee.getContext('2d'))); + const y = s, + v = y.currentSrc || y.getAttribute('src') || '', + N = y.crossOrigin, + D = () => { + y.removeEventListener('load', D); + try { + (Ee.width = y.naturalWidth), + (Ee.height = y.naturalHeight), + qs.drawImage(y, 0, 0), + (h.rr_dataURL = Ee.toDataURL(a.type, a.quality)); + } catch (z) { + if (y.crossOrigin !== 'anonymous') { + (y.crossOrigin = 'anonymous'), + y.complete && y.naturalWidth !== 0 + ? D() + : y.addEventListener('load', D); + return; + } + console.warn(`Cannot inline img src=${v}! Error: ${z}`); + } + y.crossOrigin === 'anonymous' && + (N ? (h.crossOrigin = N) : y.removeAttribute('crossorigin')); + }; + y.complete && y.naturalWidth !== 0 ? D() : y.addEventListener('load', D); + } + if (['audio', 'video'].includes(d)) { + const y = h; + (y.rr_mediaState = s.paused ? 'paused' : 'played'), + (y.rr_mediaCurrentTime = s.currentTime), + (y.rr_mediaPlaybackRate = s.playbackRate), + (y.rr_mediaMuted = s.muted), + (y.rr_mediaLoop = s.loop), + (y.rr_mediaVolume = s.volume); + } + if ( + (p || + (s.scrollLeft && (h.rr_scrollLeft = s.scrollLeft), + s.scrollTop && (h.rr_scrollTop = s.scrollTop)), + m) + ) { + const { width: y, height: v } = s.getBoundingClientRect(); + h = { class: h.class, rr_width: `${y}px`, rr_height: `${v}px` }; + } + d === 'iframe' && + !f(h.src) && + (s.contentDocument || (h.rr_src = h.src), delete h.src); + let S; + try { + customElements.get(d) && (S = !0); + } catch {} + return { + type: j.Element, + tagName: d, + attributes: h, + childNodes: [], + isSVG: Ua(s) || void 0, + needBlock: m, + rootId: g, + isCustom: S, + }; + } + function k(s) { + return s == null ? '' : s.toLowerCase(); + } + function rn(s) { + return s === !0 || s === 'all' + ? { + script: !0, + comment: !0, + headFavicon: !0, + headWhitespace: !0, + headMetaSocial: !0, + headMetaRobots: !0, + headMetaHttpEquiv: !0, + headMetaVerification: !0, + headMetaAuthorship: s === 'all', + headMetaDescKeywords: s === 'all', + headTitleMutations: s === 'all', + } + : s || {}; + } + function Ya(s, e) { + if (e.comment && s.type === j.Comment) { + return !0; + } + if (s.type === j.Element) { + if ( + e.script && + (s.tagName === 'script' || + (s.tagName === 'link' && + ((s.attributes.rel === 'preload' && s.attributes.as === 'script') || + s.attributes.rel === 'modulepreload')) || + (s.tagName === 'link' && + s.attributes.rel === 'prefetch' && + typeof s.attributes.href == 'string' && + Ki(s.attributes.href) === 'js')) + ) { + return !0; + } + if ( + e.headFavicon && + ((s.tagName === 'link' && s.attributes.rel === 'shortcut icon') || + (s.tagName === 'meta' && + (k(s.attributes.name).match(/^msapplication-tile(image|color)$/) || + k(s.attributes.name) === 'application-name' || + k(s.attributes.rel) === 'icon' || + k(s.attributes.rel) === 'apple-touch-icon' || + k(s.attributes.rel) === 'shortcut icon'))) + ) { + return !0; + } + if (s.tagName === 'meta') { + if ( + e.headMetaDescKeywords && + k(s.attributes.name).match(/^description|keywords$/) + ) { + return !0; + } + if ( + e.headMetaSocial && + (k(s.attributes.property).match(/^(og|twitter|fb):/) || + k(s.attributes.name).match(/^(og|twitter):/) || + k(s.attributes.name) === 'pinterest') + ) { + return !0; + } + if ( + e.headMetaRobots && + (k(s.attributes.name) === 'robots' || + k(s.attributes.name) === 'googlebot' || + k(s.attributes.name) === 'bingbot') + ) { + return !0; + } + if (e.headMetaHttpEquiv && s.attributes['http-equiv'] !== void 0) { + return !0; + } + if ( + e.headMetaAuthorship && + (k(s.attributes.name) === 'author' || + k(s.attributes.name) === 'generator' || + k(s.attributes.name) === 'framework' || + k(s.attributes.name) === 'publisher' || + k(s.attributes.name) === 'progid' || + k(s.attributes.property).match(/^article:/) || + k(s.attributes.property).match(/^product:/)) + ) { + return !0; + } + if ( + e.headMetaVerification && + (k(s.attributes.name) === 'google-site-verification' || + k(s.attributes.name) === 'yandex-verification' || + k(s.attributes.name) === 'csrf-token' || + k(s.attributes.name) === 'p:domain_verify' || + k(s.attributes.name) === 'verify-v1' || + k(s.attributes.name) === 'verification' || + k(s.attributes.name) === 'shopify-checkout-api-token') + ) { + return !0; + } + } + } + return !1; + } + function Re(s, e) { + let { + doc: t, + mirror: r, + blockClass: i, + blockSelector: n, + maskTextClass: o, + maskTextSelector: l, + skipChild: a = !1, + inlineStylesheet: u = !0, + maskInputOptions: c = {}, + maskTextFn: f, + maskInputFn: p, + slimDOMOptions: g, + dataURLOptions: m = {}, + inlineImages: d = !1, + recordCanvas: h = !1, + onSerialize: b, + onIframeLoad: S, + iframeLoadTimeout: y = 5e3, + onStylesheetLoad: v, + stylesheetLoadTimeout: N = 5e3, + keepIframeSrcFn: D = () => !1, + newlyAddedElement: z = !1, + cssCaptured: _ = !1, + } = e, + { needsMask: V } = e, + { preserveWhiteSpace: H = !0 } = e; + V || (V = tn(s, o, l, V === void 0)); + const Q = Va(s, { + doc: t, + mirror: r, + blockClass: i, + blockSelector: n, + needsMask: V, + inlineStylesheet: u, + maskInputOptions: c, + maskTextFn: f, + maskInputFn: p, + dataURLOptions: m, + inlineImages: d, + recordCanvas: h, + keepIframeSrcFn: D, + newlyAddedElement: z, + cssCaptured: _, + }); + if (!Q) { + return console.warn(s, 'not serialized'), null; + } + let ne; + r.hasNode(s) + ? (ne = r.getId(s)) + : Ya(Q, g) || + (!H && + Q.type === j.Text && + !Q.textContent.replace(/^\s+|\s+$/gm, '').length) + ? (ne = Ze) + : (ne = Qi()); + const M = Object.assign(Q, { id: ne }); + if ((r.add(s, M), ne === Ze)) { + return null; + } + b && b(s); + let Fe = !a; + if (M.type === j.Element) { + (Fe = Fe && !M.needBlock), delete M.needBlock; + const G = Y.shadowRoot(s); + G && He(G) && (M.isShadowHost = !0); + } + if ((M.type === j.Document || M.type === j.Element) && Fe) { + g.headWhitespace && + M.type === j.Element && + M.tagName === 'head' && + (H = !1); + const G = { + doc: t, + mirror: r, + blockClass: i, + blockSelector: n, + needsMask: V, + maskTextClass: o, + maskTextSelector: l, + skipChild: a, + inlineStylesheet: u, + maskInputOptions: c, + maskTextFn: f, + maskInputFn: p, + slimDOMOptions: g, + dataURLOptions: m, + inlineImages: d, + recordCanvas: h, + preserveWhiteSpace: H, + onSerialize: b, + onIframeLoad: S, + iframeLoadTimeout: y, + onStylesheetLoad: v, + stylesheetLoadTimeout: N, + keepIframeSrcFn: D, + cssCaptured: !1, + }; + if ( + !( + M.type === j.Element && + M.tagName === 'textarea' && + M.attributes.value !== void 0 + ) + ) { + M.type === j.Element && + M.attributes._cssText !== void 0 && + typeof M.attributes._cssText == 'string' && + (G.cssCaptured = !0); + for (const ge of Array.from(Y.childNodes(s))) { + const oe = Re(ge, G); + oe && M.childNodes.push(oe); + } + } + let q = null; + if (Xi(s) && (q = Y.shadowRoot(s))) { + for (const ge of Array.from(Y.childNodes(q))) { + const oe = Re(ge, G); + oe && (He(q) && (oe.isShadow = !0), M.childNodes.push(oe)); + } + } + } + const Ue = Y.parentNode(s); + return ( + Ue && je(Ue) && He(Ue) && (M.isShadow = !0), + M.type === j.Element && + M.tagName === 'iframe' && + Wa( + s, + () => { + const G = s.contentDocument; + if (G && S) { + const q = Re(G, { + doc: G, + mirror: r, + blockClass: i, + blockSelector: n, + needsMask: V, + maskTextClass: o, + maskTextSelector: l, + skipChild: !1, + inlineStylesheet: u, + maskInputOptions: c, + maskTextFn: f, + maskInputFn: p, + slimDOMOptions: g, + dataURLOptions: m, + inlineImages: d, + recordCanvas: h, + preserveWhiteSpace: H, + onSerialize: b, + onIframeLoad: S, + iframeLoadTimeout: y, + onStylesheetLoad: v, + stylesheetLoadTimeout: N, + keepIframeSrcFn: D, + }); + q && S(s, q); + } + }, + y + ), + M.type === j.Element && + M.tagName === 'link' && + typeof M.attributes.rel == 'string' && + (M.attributes.rel === 'stylesheet' || + (M.attributes.rel === 'preload' && + typeof M.attributes.href == 'string' && + Ki(M.attributes.href) === 'css')) && + za( + s, + () => { + if (v) { + const G = Re(s, { + doc: t, + mirror: r, + blockClass: i, + blockSelector: n, + needsMask: V, + maskTextClass: o, + maskTextSelector: l, + skipChild: !1, + inlineStylesheet: u, + maskInputOptions: c, + maskTextFn: f, + maskInputFn: p, + slimDOMOptions: g, + dataURLOptions: m, + inlineImages: d, + recordCanvas: h, + preserveWhiteSpace: H, + onSerialize: b, + onIframeLoad: S, + iframeLoadTimeout: y, + onStylesheetLoad: v, + stylesheetLoadTimeout: N, + keepIframeSrcFn: D, + }); + G && v(s, G); + } + }, + N + ), + M + ); + } + function Za(s, e) { + const { + mirror: t = new Bt(), + blockClass: r = 'rr-block', + blockSelector: i = null, + maskTextClass: n = 'rr-mask', + maskTextSelector: o = null, + inlineStylesheet: l = !0, + inlineImages: a = !1, + recordCanvas: u = !1, + maskAllInputs: c = !1, + maskTextFn: f, + maskInputFn: p, + slimDOM: g = !1, + dataURLOptions: m, + preserveWhiteSpace: d, + onSerialize: h, + onIframeLoad: b, + iframeLoadTimeout: S, + onStylesheetLoad: y, + stylesheetLoadTimeout: v, + keepIframeSrcFn: N = () => !1, + } = e || {}, + D = + c === !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, + } + : c === !1 + ? { password: !0 } + : c, + z = rn(g); + return Re(s, { + doc: s, + mirror: t, + blockClass: r, + blockSelector: i, + maskTextClass: n, + maskTextSelector: o, + skipChild: !1, + inlineStylesheet: l, + maskInputOptions: D, + maskTextFn: f, + maskInputFn: p, + slimDOMOptions: z, + dataURLOptions: m, + inlineImages: a, + recordCanvas: u, + preserveWhiteSpace: d, + onSerialize: h, + onIframeLoad: b, + iframeLoadTimeout: S, + onStylesheetLoad: y, + stylesheetLoadTimeout: v, + keepIframeSrcFn: N, + newlyAddedElement: !1, + }); + } + var Xa = /(max|min)-device-(width|height)/, + xf = new RegExp(Xa.source, 'g'); + function Ja(s) { + return s && s.__esModule && Object.hasOwn(s, 'default') ? s.default : s; + } + function Ka(s) { + if (s.__esModule) { + return s; + } + var e = s.default; + if (typeof e == 'function') { + var t = function r() { + return this instanceof r + ? Reflect.construct(e, arguments, this.constructor) + : e.apply(this, arguments); + }; + t.prototype = e.prototype; + } else { + t = {}; + } + return ( + Object.defineProperty(t, '__esModule', { value: !0 }), + Object.keys(s).forEach((r) => { + var i = Object.getOwnPropertyDescriptor(s, r); + Object.defineProperty( + t, + r, + i.get + ? i + : { + enumerable: !0, + get() { + return s[r]; + }, + } + ); + }), + t + ); + } + var Is = { exports: {} }, + P = String, + sn = () => ({ + isColorSupported: !1, + reset: P, + bold: P, + dim: P, + italic: P, + underline: P, + inverse: P, + hidden: P, + strikethrough: P, + black: P, + red: P, + green: P, + yellow: P, + blue: P, + magenta: P, + cyan: P, + white: P, + gray: P, + bgBlack: P, + bgRed: P, + bgGreen: P, + bgYellow: P, + bgBlue: P, + bgMagenta: P, + bgCyan: P, + bgWhite: P, + }); + Is.exports = sn(); + Is.exports.createColors = sn; + var Qa = Is.exports, + qa = {}, + el = Object.freeze( + Object.defineProperty( + { __proto__: null, default: qa }, + Symbol.toStringTag, + { value: 'Module' } + ) + ), + se = Ka(el), + ti = Qa, + ri = se, + _r = class nn extends Error { + constructor(e, t, r, i, n, o) { + super(e), + (this.name = 'CssSyntaxError'), + (this.reason = e), + n && (this.file = n), + i && (this.source = i), + o && (this.plugin = o), + typeof t < 'u' && + typeof r < 'u' && + (typeof t == 'number' + ? ((this.line = t), (this.column = r)) + : ((this.line = t.line), + (this.column = t.column), + (this.endLine = r.line), + (this.endColumn = r.column))), + this.setMessage(), + Error.captureStackTrace && Error.captureStackTrace(this, nn); + } + setMessage() { + (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(e) { + if (!this.source) { + return ''; + } + let t = this.source; + e == null && (e = ti.isColorSupported), ri && e && (t = ri(t)); + let r = t.split(/\r?\n/), + i = Math.max(this.line - 3, 0), + n = Math.min(this.line + 2, r.length), + o = String(n).length, + l, + a; + if (e) { + const { bold: u, gray: c, red: f } = ti.createColors(!0); + (l = (p) => u(f(p))), (a = (p) => c(p)); + } else { + l = a = (u) => u; + } + return r + .slice(i, n) + .map((u, c) => { + const f = i + 1 + c, + p = ' ' + (' ' + f).slice(-o) + ' | '; + if (f === this.line) { + const g = + a(p.replace(/\d/g, ' ')) + + u.slice(0, this.column - 1).replace(/[^\t]/g, ' '); + return ( + l('>') + + a(p) + + u + + ` + ` + + g + + l('^') + ); + } + return ' ' + a(p) + u; + }) + .join(` +`); + } + toString() { + let e = this.showSourceCode(); + return ( + e && + (e = + ` -`+e+` -`),this.name+": "+this.message+e}},Es=_r;_r.default=_r;var it={};it.isClean=Symbol("isClean");it.my=Symbol("my");var si={after:` -`,beforeClose:` -`,beforeComment:` -`,beforeDecl:` -`,beforeOpen:" ",beforeRule:` -`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function tl(s){return s[0].toUpperCase()+s.slice(1)}var kr=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(` -`)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=si[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(` -`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(` -`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(` -`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(` -`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(` -`);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},on=kr;kr.default=kr;var rl=on;function Pr(s,e){new rl(e).stringify(s)}var sr=Pr;Pr.default=Pr;var{isClean:dt,my:sl}=it,il=Es,nl=on,ol=sr;function $r(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>$r(o,t)):(n==="object"&&i!==null&&(i=$r(i)),t[r]=i)}return t}var Lr=class{constructor(e={}){this.raws={},this[dt]=!1,this[sl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$r(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new il(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[dt]){this[dt]=!1;let e=this;for(;e=e.parent;)e[dt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;otypeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ol){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},ir=Lr;Lr.default=Lr;var al=ir,Fr=class extends al{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},nr=Fr;Fr.default=Fr;var ll="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ul=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},cl=(s=21)=>{let e="",t=s;for(;t--;)e+=ll[Math.random()*64|0];return e},hl={nanoid:cl,customAlphabet:ul},{SourceMapConsumer:ii,SourceMapGenerator:ni}=se,{existsSync:fl,readFileSync:dl}=se,{dirname:Sr,join:pl}=se;function ml(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var Ur=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Sr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ii(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return ml(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Sr(e),fl(e))return this.mapFile=e,dl(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof ii)return ni.fromSourceMap(t).toString();if(t instanceof ni)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=pl(Sr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},an=Ur;Ur.default=Ur;var{SourceMapConsumer:gl,SourceMapGenerator:yl}=se,{fileURLToPath:oi,pathToFileURL:pt}=se,{isAbsolute:Br,resolve:Wr}=se,{nanoid:wl}=hl,vr=se,ai=Es,bl=an,Cr=Symbol("fromOffsetCache"),Sl=!!(gl&&yl),li=!!(Wr&&Br),jt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!li||/^\w+:\/\//.test(t.from)||Br(t.from)?this.file=t.from:this.file=Wr(t.from)),li&&Sl){let r=new bl(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let f=this.fromOffset(u.offset);t=f.line,r=f.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let f=this.fromOffset(c.offset);o=f.line,l=f.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new ai(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new ai(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(pt&&(n.input.url=pt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Cr])r=this[Cr];else{let n=this.css.split(` -`);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l=t)i=r.length-1;else{let n=r.length-2,o;for(;i>1),e=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Wr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Br(o.source)?a=pt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||pt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(oi)u.file=oi(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},or=jt;jt.default=jt;vr&&vr.registerInput&&vr.registerInput(jt);var{SourceMapConsumer:ln,SourceMapGenerator:kt}=se,{dirname:Pt,relative:un,resolve:cn,sep:hn}=se,{pathToFileURL:ui}=se,vl=or,Cl=!!(ln&&kt),Il=!!(Pt&&cn&&un&&hn),El=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=` -`;this.css.includes(`\r -`)&&(t=`\r -`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Pt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new ln(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Il&&Cl&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=kt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new kt({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)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new kt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(` -`),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Pt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Pt(cn(r,this.mapOpts.annotation)));let i=un(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new vl(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ui){let r=ui(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;hn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},fn=El,xl=ir,zr=class extends xl{constructor(e){super(e),this.type="comment"}},ar=zr;zr.default=zr;var{isClean:dn,my:pn}=it,mn=nr,gn=ar,Ml=ir,yn,xs,Ms,wn;function bn(s){return s.map(e=>(e.nodes&&(e.nodes=bn(e.nodes)),delete e.source,e))}function Sn(s){if(s[dn]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Sn(e)}var ce=class vn extends Ml{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new mn(e)]}else if(e.selector)e=[new xs(e)];else if(e.name)e=[new Ms(e)];else if(e.text)e=[new gn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[pn]||vn.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[dn]&&Sn(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ce.registerParse=s=>{yn=s};ce.registerRule=s=>{xs=s};ce.registerAtRule=s=>{Ms=s};ce.registerRoot=s=>{wn=s};var ve=ce;ce.default=ce;ce.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Ms.prototype):s.type==="rule"?Object.setPrototypeOf(s,xs.prototype):s.type==="decl"?Object.setPrototypeOf(s,mn.prototype):s.type==="comment"?Object.setPrototypeOf(s,gn.prototype):s.type==="root"&&Object.setPrototypeOf(s,wn.prototype),s[pn]=!0,s.nodes&&s.nodes.forEach(e=>{ce.rebuild(e)})};var Nl=ve,Cn,In,Xe=class extends Nl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Cn(new In,this,e).stringify()}};Xe.registerLazyResult=s=>{Cn=s};Xe.registerProcessor=s=>{In=s};var Ns=Xe;Xe.default=Xe;var ci={},En=function(e){ci[e]||(ci[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))},Vr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},xn=Vr;Vr.default=Vr;var Rl=xn,Gr=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Rl(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Rs=Gr;Gr.default=Gr;var Ir=39,hi=34,mt=92,fi=47,gt=10,Be=32,yt=12,wt=9,bt=13,Al=91,Ol=93,Dl=40,Tl=41,_l=123,kl=125,Pl=59,$l=42,Ll=58,Fl=64,St=/[\t\n\f\r "#'()/;[\\\]{}]/g,vt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ul=/.[\r\n"'(/\\]/,di=/[\da-f]/i,Bl=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,f,p,g,m,d=r.length,h=0,b=[],S=[];function y(){return h}function v(_){throw e.error("Unclosed "+_,h)}function N(){return S.length===0&&h>=d}function D(_){if(S.length)return S.pop();if(h>=d)return;let V=_?_.ignoreUnclosed:!1;switch(n=r.charCodeAt(h),n){case gt:case Be:case wt:case bt:case yt:{o=h;do o+=1,n=r.charCodeAt(o);while(n===Be||n===gt||n===wt||n===bt||n===yt);m=["space",r.slice(h,o)],h=o-1;break}case Al:case Ol:case _l:case kl:case Ll:case Pl:case Tl:{let H=String.fromCharCode(n);m=[H,H,h];break}case Dl:{if(p=b.length?b.pop()[1]:"",g=r.charCodeAt(h+1),p==="url"&&g!==Ir&&g!==hi&&g!==Be&&g!==gt&&g!==wt&&g!==yt&&g!==bt){o=h;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||V){o=h;break}else v("bracket");for(f=o;r.charCodeAt(f-1)===mt;)f-=1,c=!c}while(c);m=["brackets",r.slice(h,o+1),h,o],h=o}else o=r.indexOf(")",h+1),a=r.slice(h,o+1),o===-1||Ul.test(a)?m=["(","(",h]:(m=["brackets",a,h,o],h=o);break}case Ir:case hi:{l=n===Ir?"'":'"',o=h;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||V){o=h+1;break}else v("string");for(f=o;r.charCodeAt(f-1)===mt;)f-=1,c=!c}while(c);m=["string",r.slice(h,o+1),h,o],h=o;break}case Fl:{St.lastIndex=h+1,St.test(r),St.lastIndex===0?o=r.length-1:o=St.lastIndex-2,m=["at-word",r.slice(h,o+1),h,o],h=o;break}case mt:{for(o=h,u=!0;r.charCodeAt(o+1)===mt;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==fi&&n!==Be&&n!==gt&&n!==wt&&n!==bt&&n!==yt&&(o+=1,di.test(r.charAt(o)))){for(;di.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===Be&&(o+=1)}m=["word",r.slice(h,o+1),h,o],h=o;break}default:{n===fi&&r.charCodeAt(h+1)===$l?(o=r.indexOf("*/",h+2)+1,o===0&&(i||V?o=r.length:v("comment")),m=["comment",r.slice(h,o+1),h,o],h=o):(vt.lastIndex=h+1,vt.test(r),vt.lastIndex===0?o=r.length-1:o=vt.lastIndex-2,m=["word",r.slice(h,o+1),h,o],b.push(m),h=o);break}}return h++,m}function z(_){S.push(_)}return{back:z,endOfFile:N,nextToken:D,position:y}},Mn=ve,Ht=class extends Mn{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},As=Ht;Ht.default=Ht;Mn.registerAtRule(Ht);var Nn=ve,Rn,An,Oe=class extends Nn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Rn(new An,this,e).stringify()}};Oe.registerLazyResult=s=>{Rn=s};Oe.registerProcessor=s=>{An=s};var nt=Oe;Oe.default=Oe;Nn.registerRoot(Oe);var Je={comma(s){return Je.split(s,[","],!0)},space(s){let e=[" ",` -`," "];return Je.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}},On=Je;Je.default=Je;var Dn=ve,Wl=On,Yt=class extends Dn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Wl.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}},Os=Yt;Yt.default=Yt;Dn.registerRule(Yt);var zl=nr,Vl=Bl,Gl=ar,jl=As,Hl=nt,pi=Os,mi={empty:!0,space:!0};function Yl(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Zl=class{constructor(e){this.input=e,this.root=new Hl,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new jl;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Gl;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Vl(this.input)}decl(e,t){let r=new zl;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Yl(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),f="";for(let p=u;p>0;p--){let g=c[p][0];if(f.trim().indexOf("!")===0&&g!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=f,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new pi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),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(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,f;for(let p=0;pg+m[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new pi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;ijr(e)),s}var Hr={},Te=class _n{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=jr(t);else if(t instanceof _n||t instanceof gi)i=jr(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=nu;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[ql]&&ru.rebuild(i)}this.result=new gi(e,i,r),this.helpers={...Hr,postcss:Hr,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!lu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uu[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let r=this.visitTick(t);if(We(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return We(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=tu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new eu(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 e of this.plugins){let t=this.runOnRoot(e);if(We(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ae];)e[ae]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||iu("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.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(We(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex{i[ae]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.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"}};Te.registerPostcss=s=>{Hr=s};var kn=Te;Te.default=Te;ou.registerLazyResult(Te);su.registerLazyResult(Te);var cu=fn,hu=sr,fu=En,du=Ds,pu=Rs,Yr=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=hu;this.result=new pu(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new cu(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||fu("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.")),this.async().then(e,t)}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 e,t=du;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},mu=Yr;Yr.default=Yr;var gu=mu,yu=kn,wu=Ns,bu=nt,Ke=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new 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 new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new gu(this,e,t):new yu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Su=Ke;Ke.default=Ke;bu.registerProcessor(Ke);wu.registerProcessor(Ke);var vu=nr,Cu=an,Iu=ar,Eu=As,xu=or,Mu=nt,Nu=Os;function Qe(s,e){if(Array.isArray(s))return s.map(i=>Qe(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:xu.prototype};n.map&&(n.map={...n.map,__proto__:Cu.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>Qe(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new Mu(r);if(r.type==="decl")return new vu(r);if(r.type==="rule")return new Nu(r);if(r.type==="comment")return new Iu(r);if(r.type==="atrule")return new Eu(r);throw new Error("Unknown node type: "+s.type)}var Ru=Qe;Qe.default=Qe;var Au=Es,Pn=nr,Ou=kn,Du=ve,Ts=Su,Tu=sr,_u=Ru,$n=Ns,ku=xn,Ln=ar,Fn=As,Pu=Rs,$u=or,Lu=Ds,Fu=On,Un=Os,Bn=nt,Uu=ir;function A(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Ts(s)}A.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide: -https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357: -https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Ts().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return A([i(a)]).process(o,l)},i};A.stringify=Tu;A.parse=Lu;A.fromJSON=_u;A.list=Fu;A.comment=s=>new Ln(s);A.atRule=s=>new Fn(s);A.decl=s=>new Pn(s);A.rule=s=>new Un(s);A.root=s=>new Bn(s);A.document=s=>new $n(s);A.CssSyntaxError=Au;A.Declaration=Pn;A.Container=Du;A.Processor=Ts;A.Document=$n;A.Comment=Ln;A.Warning=ku;A.AtRule=Fn;A.Result=Pu;A.Input=$u;A.Rule=Un;A.Root=Bn;A.Node=Uu;Ou.registerPostcss(A);var Bu=A;A.default=A;var L=Ja(Bu);L.stringify;L.fromJSON;L.plugin;L.parse;L.list;L.document;L.comment;L.atRule;L.rule;L.decl;L.root;L.CssSyntaxError;L.Declaration;L.Container;L.Processor;L.Document;L.Comment;L.Warning;L.AtRule;L.Result;L.Input;L.Rule;L.Root;L.Node;var Wu=Object.defineProperty,zu=(s,e,t)=>e in s?Wu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ee=(s,e,t)=>zu(s,typeof e!="symbol"?e+"":e,t);function Vu(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Gu(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var _s={exports:{}},$=String,Wn=function(){return{isColorSupported:!1,reset:$,bold:$,dim:$,italic:$,underline:$,inverse:$,hidden:$,strikethrough:$,black:$,red:$,green:$,yellow:$,blue:$,magenta:$,cyan:$,white:$,gray:$,bgBlack:$,bgRed:$,bgGreen:$,bgYellow:$,bgBlue:$,bgMagenta:$,bgCyan:$,bgWhite:$}};_s.exports=Wn();_s.exports.createColors=Wn;var ju=_s.exports,Hu={},Yu=Object.freeze(Object.defineProperty({__proto__:null,default:Hu},Symbol.toStringTag,{value:"Module"})),ie=Gu(Yu),wi=ju,bi=ie,Zr=class zn extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,zn)}setMessage(){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(e){if(!this.source)return"";let t=this.source;e==null&&(e=wi.isColorSupported),bi&&e&&(t=bi(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:f}=wi.createColors(!0);l=p=>u(f(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let f=i+1+c,p=" "+(" "+f).slice(-o)+" | ";if(f===this.line){let g=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+` - `+g+l("^")}return" "+a(p)+u}).join(` -`)}toString(){let e=this.showSourceCode();return e&&(e=` +` + + e + + ` +`), + this.name + ': ' + this.message + e + ); + } + }, + Es = _r; + _r.default = _r; + var it = {}; + it.isClean = Symbol('isClean'); + it.my = Symbol('my'); + var si = { + after: ` +`, + beforeClose: ` +`, + beforeComment: ` +`, + beforeDecl: ` +`, + beforeOpen: ' ', + beforeRule: ` +`, + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: !1, + }; + function tl(s) { + return s[0].toUpperCase() + s.slice(1); + } + var kr = class { + constructor(e) { + this.builder = e; + } + atrule(e, t) { + let r = '@' + e.name, + i = e.params ? this.rawValue(e, 'params') : ''; + if ( + (typeof e.raws.afterName < 'u' + ? (r += e.raws.afterName) + : i && (r += ' '), + e.nodes) + ) { + this.block(e, r + i); + } else { + const n = (e.raws.between || '') + (t ? ';' : ''); + this.builder(r + i + n, e); + } + } + beforeAfter(e, t) { + let r; + e.type === 'decl' + ? (r = this.raw(e, null, 'beforeDecl')) + : e.type === 'comment' + ? (r = this.raw(e, null, 'beforeComment')) + : t === 'before' + ? (r = this.raw(e, null, 'beforeRule')) + : (r = this.raw(e, null, 'beforeClose')); + let i = e.parent, + n = 0; + while (i && i.type !== 'root') { + (n += 1), (i = i.parent); + } + if ( + r.includes(` +`) + ) { + const o = this.raw(e, null, 'indent'); + if (o.length) { + for (let l = 0; l < n; l++) { + r += o; + } + } + } + return r; + } + block(e, t) { + const r = this.raw(e, 'between', 'beforeOpen'); + this.builder(t + r + '{', e, 'start'); + let i; + e.nodes && e.nodes.length + ? (this.body(e), (i = this.raw(e, 'after'))) + : (i = this.raw(e, 'after', 'emptyBody')), + i && this.builder(i), + this.builder('}', e, 'end'); + } + body(e) { + let t = e.nodes.length - 1; + while (t > 0 && e.nodes[t].type === 'comment') { + t -= 1; + } + const r = this.raw(e, 'semicolon'); + for (let i = 0; i < e.nodes.length; i++) { + const n = e.nodes[i], + o = this.raw(n, 'before'); + o && this.builder(o), this.stringify(n, t !== i || r); + } + } + comment(e) { + const t = this.raw(e, 'left', 'commentLeft'), + r = this.raw(e, 'right', 'commentRight'); + this.builder('/*' + t + e.text + r + '*/', e); + } + decl(e, t) { + let r = this.raw(e, 'between', 'colon'), + i = e.prop + r + this.rawValue(e, 'value'); + e.important && (i += e.raws.important || ' !important'), + t && (i += ';'), + this.builder(i, e); + } + document(e) { + this.body(e); + } + raw(e, t, r) { + let i; + if ((r || (r = t), t && ((i = e.raws[t]), typeof i < 'u'))) { + return i; + } + const n = e.parent; + if ( + r === 'before' && + (!n || + (n.type === 'root' && n.first === e) || + (n && n.type === 'document')) + ) { + return ''; + } + if (!n) { + return si[r]; + } + const o = e.root(); + if ((o.rawCache || (o.rawCache = {}), typeof o.rawCache[r] < 'u')) { + return o.rawCache[r]; + } + if (r === 'before' || r === 'after') { + return this.beforeAfter(e, r); + } + { + const l = 'raw' + tl(r); + this[l] + ? (i = this[l](o, e)) + : o.walk((a) => { + if (((i = a.raws[t]), typeof i < 'u')) { + return !1; + } + }); + } + return typeof i > 'u' && (i = si[r]), (o.rawCache[r] = i), i; + } + rawBeforeClose(e) { + let t; + return ( + e.walk((r) => { + if (r.nodes && r.nodes.length > 0 && typeof r.raws.after < 'u') { + return ( + (t = r.raws.after), + t.includes(` +`) && (t = t.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + t && (t = t.replace(/\S/g, '')), + t + ); + } + rawBeforeComment(e, t) { + let r; + return ( + e.walkComments((i) => { + if (typeof i.raws.before < 'u') { + return ( + (r = i.raws.before), + r.includes(` +`) && (r = r.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + typeof r > 'u' + ? (r = this.raw(t, null, 'beforeDecl')) + : r && (r = r.replace(/\S/g, '')), + r + ); + } + rawBeforeDecl(e, t) { + let r; + return ( + e.walkDecls((i) => { + if (typeof i.raws.before < 'u') { + return ( + (r = i.raws.before), + r.includes(` +`) && (r = r.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + typeof r > 'u' + ? (r = this.raw(t, null, 'beforeRule')) + : r && (r = r.replace(/\S/g, '')), + r + ); + } + rawBeforeOpen(e) { + let t; + return ( + e.walk((r) => { + if (r.type !== 'decl' && ((t = r.raws.between), typeof t < 'u')) { + return !1; + } + }), + t + ); + } + rawBeforeRule(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + (r.parent !== e || e.first !== r) && + typeof r.raws.before < 'u' + ) { + return ( + (t = r.raws.before), + t.includes(` +`) && (t = t.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + t && (t = t.replace(/\S/g, '')), + t + ); + } + rawColon(e) { + let t; + return ( + e.walkDecls((r) => { + if (typeof r.raws.between < 'u') { + return (t = r.raws.between.replace(/[^\s:]/g, '')), !1; + } + }), + t + ); + } + rawEmptyBody(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + r.nodes.length === 0 && + ((t = r.raws.after), typeof t < 'u') + ) { + return !1; + } + }), + t + ); + } + rawIndent(e) { + if (e.raws.indent) { + return e.raws.indent; + } + let t; + return ( + e.walk((r) => { + const i = r.parent; + if ( + i && + i !== e && + i.parent && + i.parent === e && + typeof r.raws.before < 'u' + ) { + const n = r.raws.before.split(` +`); + return (t = n[n.length - 1]), (t = t.replace(/\S/g, '')), !1; + } + }), + t + ); + } + rawSemicolon(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + r.nodes.length && + r.last.type === 'decl' && + ((t = r.raws.semicolon), typeof t < 'u') + ) { + return !1; + } + }), + t + ); + } + rawValue(e, t) { + const r = e[t], + i = e.raws[t]; + return i && i.value === r ? i.raw : r; + } + root(e) { + this.body(e), e.raws.after && this.builder(e.raws.after); + } + rule(e) { + this.block(e, this.rawValue(e, 'selector')), + e.raws.ownSemicolon && this.builder(e.raws.ownSemicolon, e, 'end'); + } + stringify(e, t) { + if (!this[e.type]) { + throw new Error( + 'Unknown AST node type ' + + e.type + + '. Maybe you need to change PostCSS stringifier.' + ); + } + this[e.type](e, t); + } + }, + on = kr; + kr.default = kr; + var rl = on; + function Pr(s, e) { + new rl(e).stringify(s); + } + var sr = Pr; + Pr.default = Pr; + var { isClean: dt, my: sl } = it, + il = Es, + nl = on, + ol = sr; + function $r(s, e) { + const t = new s.constructor(); + for (const r in s) { + if (!Object.hasOwn(s, r) || r === 'proxyCache') { + continue; + } + let i = s[r], + n = typeof i; + r === 'parent' && n === 'object' + ? e && (t[r] = e) + : r === 'source' + ? (t[r] = i) + : Array.isArray(i) + ? (t[r] = i.map((o) => $r(o, t))) + : (n === 'object' && i !== null && (i = $r(i)), (t[r] = i)); + } + return t; + } + var Lr = class { + constructor(e = {}) { + (this.raws = {}), (this[dt] = !1), (this[sl] = !0); + for (const t in e) { + if (t === 'nodes') { + this.nodes = []; + for (const r of e[t]) { + typeof r.clone == 'function' + ? this.append(r.clone()) + : this.append(r); + } + } else { + this[t] = e[t]; + } + } + } + addToError(e) { + if ( + ((e.postcssNode = this), + e.stack && this.source && /\n\s{4}at /.test(e.stack)) + ) { + const t = this.source; + e.stack = e.stack.replace( + /\n\s{4}at /, + `$&${t.input.from}:${t.start.line}:${t.start.column}$&` + ); + } + return e; + } + after(e) { + return this.parent.insertAfter(this, e), this; + } + assign(e = {}) { + for (const t in e) { + this[t] = e[t]; + } + return this; + } + before(e) { + return this.parent.insertBefore(this, e), this; + } + cleanRaws(e) { + delete this.raws.before, + delete this.raws.after, + e || delete this.raws.between; + } + clone(e = {}) { + const t = $r(this); + for (const r in e) { + t[r] = e[r]; + } + return t; + } + cloneAfter(e = {}) { + const t = this.clone(e); + return this.parent.insertAfter(this, t), t; + } + cloneBefore(e = {}) { + const t = this.clone(e); + return this.parent.insertBefore(this, t), t; + } + error(e, t = {}) { + if (this.source) { + const { end: r, start: i } = this.rangeBy(t); + return this.source.input.error( + e, + { column: i.column, line: i.line }, + { column: r.column, line: r.line }, + t + ); + } + return new il(e); + } + getProxyProcessor() { + return { + get(e, t) { + return t === 'proxyOf' + ? e + : t === 'root' + ? () => e.root().toProxy() + : e[t]; + }, + set(e, t, r) { + return ( + e[t] === r || + ((e[t] = r), + (t === 'prop' || + t === 'value' || + t === 'name' || + t === 'params' || + t === 'important' || + t === 'text') && + e.markDirty()), + !0 + ); + }, + }; + } + markDirty() { + if (this[dt]) { + this[dt] = !1; + let e = this; + while ((e = e.parent)) { + e[dt] = !1; + } + } + } + next() { + if (!this.parent) { + return; + } + const e = this.parent.index(this); + return this.parent.nodes[e + 1]; + } + positionBy(e, t) { + let r = this.source.start; + if (e.index) { + r = this.positionInside(e.index, t); + } else if (e.word) { + t = this.toString(); + const i = t.indexOf(e.word); + i !== -1 && (r = this.positionInside(i, t)); + } + return r; + } + positionInside(e, t) { + let r = t || this.toString(), + i = this.source.start.column, + n = this.source.start.line; + for (let o = 0; o < e; o++) { + r[o] === + ` +` + ? ((i = 1), (n += 1)) + : (i += 1); + } + return { column: i, line: n }; + } + prev() { + if (!this.parent) { + return; + } + const e = this.parent.index(this); + return this.parent.nodes[e - 1]; + } + rangeBy(e) { + let t = { + column: this.source.start.column, + line: this.source.start.line, + }, + r = this.source.end + ? { column: this.source.end.column + 1, line: this.source.end.line } + : { column: t.column + 1, line: t.line }; + if (e.word) { + const i = this.toString(), + n = i.indexOf(e.word); + n !== -1 && + ((t = this.positionInside(n, i)), + (r = this.positionInside(n + e.word.length, i))); + } else { + e.start + ? (t = { column: e.start.column, line: e.start.line }) + : e.index && (t = this.positionInside(e.index)), + e.end + ? (r = { column: e.end.column, line: e.end.line }) + : typeof e.endIndex == 'number' + ? (r = this.positionInside(e.endIndex)) + : e.index && (r = this.positionInside(e.index + 1)); + } + return ( + (r.line < t.line || (r.line === t.line && r.column <= t.column)) && + (r = { column: t.column + 1, line: t.line }), + { end: r, start: t } + ); + } + raw(e, t) { + return new nl().raw(this, e, t); + } + remove() { + return ( + this.parent && this.parent.removeChild(this), + (this.parent = void 0), + this + ); + } + replaceWith(...e) { + if (this.parent) { + let t = this, + r = !1; + for (const i of e) { + i === this + ? (r = !0) + : r + ? (this.parent.insertAfter(t, i), (t = i)) + : this.parent.insertBefore(t, i); + } + r || this.remove(); + } + return this; + } + root() { + let e = this; + while (e.parent && e.parent.type !== 'document') { + e = e.parent; + } + return e; + } + toJSON(e, t) { + const r = {}, + i = t == null; + t = t || new Map(); + let n = 0; + for (const o in this) { + if (!Object.hasOwn(this, o) || o === 'parent' || o === 'proxyCache') { + continue; + } + const l = this[o]; + if (Array.isArray(l)) { + r[o] = l.map((a) => + typeof a == 'object' && a.toJSON ? a.toJSON(null, t) : a + ); + } else if (typeof l == 'object' && l.toJSON) { + r[o] = l.toJSON(null, t); + } else if (o === 'source') { + let a = t.get(l.input); + a == null && ((a = n), t.set(l.input, n), n++), + (r[o] = { end: l.end, inputId: a, start: l.start }); + } else { + r[o] = l; + } + } + return i && (r.inputs = [...t.keys()].map((o) => o.toJSON())), r; + } + toProxy() { + return ( + this.proxyCache || + (this.proxyCache = new Proxy(this, this.getProxyProcessor())), + this.proxyCache + ); + } + toString(e = ol) { + e.stringify && (e = e.stringify); + let t = ''; + return ( + e(this, (r) => { + t += r; + }), + t + ); + } + warn(e, t, r) { + const i = { node: this }; + for (const n in r) { + i[n] = r[n]; + } + return e.warn(t, i); + } + get proxyOf() { + return this; + } + }, + ir = Lr; + Lr.default = Lr; + var al = ir, + Fr = class extends al { + constructor(e) { + e && + typeof e.value < 'u' && + typeof e.value != 'string' && + (e = { ...e, value: String(e.value) }), + super(e), + (this.type = 'decl'); + } + get variable() { + return this.prop.startsWith('--') || this.prop[0] === '$'; + } + }, + nr = Fr; + Fr.default = Fr; + var ll = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict', + ul = + (s, e = 21) => + (t = e) => { + let r = '', + i = t; + while (i--) { + r += s[(Math.random() * s.length) | 0]; + } + return r; + }, + cl = (s = 21) => { + let e = '', + t = s; + while (t--) { + e += ll[(Math.random() * 64) | 0]; + } + return e; + }, + hl = { nanoid: cl, customAlphabet: ul }, + { SourceMapConsumer: ii, SourceMapGenerator: ni } = se, + { existsSync: fl, readFileSync: dl } = se, + { dirname: Sr, join: pl } = se; + function ml(s) { + return Buffer ? Buffer.from(s, 'base64').toString() : window.atob(s); + } + var Ur = class { + constructor(e, t) { + if (t.map === !1) { + return; + } + this.loadAnnotation(e), + (this.inline = this.startWith(this.annotation, 'data:')); + const r = t.map ? t.map.prev : void 0, + i = this.loadMap(t.from, r); + !this.mapFile && t.from && (this.mapFile = t.from), + this.mapFile && (this.root = Sr(this.mapFile)), + i && (this.text = i); + } + consumer() { + return ( + this.consumerCache || (this.consumerCache = new ii(this.text)), + this.consumerCache + ); + } + decodeInline(e) { + const t = /^data:application\/json;charset=utf-?8;base64,/, + r = /^data:application\/json;base64,/, + i = /^data:application\/json;charset=utf-?8,/, + n = /^data:application\/json,/; + if (i.test(e) || n.test(e)) { + return decodeURIComponent(e.substr(RegExp.lastMatch.length)); + } + if (t.test(e) || r.test(e)) { + return ml(e.substr(RegExp.lastMatch.length)); + } + const o = e.match(/data:application\/json;([^,]+),/)[1]; + throw new Error('Unsupported source map encoding ' + o); + } + getAnnotationURL(e) { + return e.replace(/^\/\*\s*# sourceMappingURL=/, '').trim(); + } + isMap(e) { + return typeof e != 'object' + ? !1 + : typeof e.mappings == 'string' || + typeof e._mappings == 'string' || + Array.isArray(e.sections); + } + loadAnnotation(e) { + const t = e.match(/\/\*\s*# sourceMappingURL=/gm); + if (!t) { + return; + } + const r = e.lastIndexOf(t.pop()), + i = e.indexOf('*/', r); + r > -1 && + i > -1 && + (this.annotation = this.getAnnotationURL(e.substring(r, i))); + } + loadFile(e) { + if (((this.root = Sr(e)), fl(e))) { + return (this.mapFile = e), dl(e, 'utf-8').toString().trim(); + } + } + loadMap(e, t) { + if (t === !1) { + return !1; + } + if (t) { + if (typeof t == 'string') { + return t; + } + if (typeof t == 'function') { + const r = t(e); + if (r) { + const i = this.loadFile(r); + if (!i) { + throw new Error( + 'Unable to load previous source map: ' + r.toString() + ); + } + return i; + } + } else { + if (t instanceof ii) { + return ni.fromSourceMap(t).toString(); + } + if (t instanceof ni) { + return t.toString(); + } + if (this.isMap(t)) { + return JSON.stringify(t); + } + throw new Error( + 'Unsupported previous source map format: ' + t.toString() + ); + } + } else { + if (this.inline) { + return this.decodeInline(this.annotation); + } + if (this.annotation) { + let r = this.annotation; + return e && (r = pl(Sr(e), r)), this.loadFile(r); + } + } + } + startWith(e, t) { + return e ? e.substr(0, t.length) === t : !1; + } + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ); + } + }, + an = Ur; + Ur.default = Ur; + var { SourceMapConsumer: gl, SourceMapGenerator: yl } = se, + { fileURLToPath: oi, pathToFileURL: pt } = se, + { isAbsolute: Br, resolve: Wr } = se, + { nanoid: wl } = hl, + vr = se, + ai = Es, + bl = an, + Cr = Symbol('fromOffsetCache'), + Sl = !!(gl && yl), + li = !!(Wr && Br), + jt = class { + constructor(e, t = {}) { + if ( + e === null || + typeof e > 'u' || + (typeof e == 'object' && !e.toString) + ) { + throw new Error(`PostCSS received ${e} instead of CSS string`); + } + if ( + ((this.css = e.toString()), + this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE' + ? ((this.hasBOM = !0), (this.css = this.css.slice(1))) + : (this.hasBOM = !1), + t.from && + (!li || /^\w+:\/\//.test(t.from) || Br(t.from) + ? (this.file = t.from) + : (this.file = Wr(t.from))), + li && Sl) + ) { + const r = new bl(this.css, t); + if (r.text) { + this.map = r; + const i = r.consumer().file; + !this.file && i && (this.file = this.mapResolve(i)); + } + } + this.file || (this.id = ''), + this.map && (this.map.file = this.from); + } + error(e, t, r, i = {}) { + let n, o, l; + if (t && typeof t == 'object') { + const u = t, + c = r; + if (typeof u.offset == 'number') { + const f = this.fromOffset(u.offset); + (t = f.line), (r = f.col); + } else { + (t = u.line), (r = u.column); + } + if (typeof c.offset == 'number') { + const f = this.fromOffset(c.offset); + (o = f.line), (l = f.col); + } else { + (o = c.line), (l = c.column); + } + } else if (!r) { + const u = this.fromOffset(t); + (t = u.line), (r = u.col); + } + const a = this.origin(t, r, o, l); + return ( + a + ? (n = new ai( + e, + a.endLine === void 0 + ? a.line + : { column: a.column, line: a.line }, + a.endLine === void 0 + ? a.column + : { column: a.endColumn, line: a.endLine }, + a.source, + a.file, + i.plugin + )) + : (n = new ai( + e, + o === void 0 ? t : { column: r, line: t }, + o === void 0 ? r : { column: l, line: o }, + this.css, + this.file, + i.plugin + )), + (n.input = { + column: r, + endColumn: l, + endLine: o, + line: t, + source: this.css, + }), + this.file && + (pt && (n.input.url = pt(this.file).toString()), + (n.input.file = this.file)), + n + ); + } + fromOffset(e) { + let t, r; + if (this[Cr]) { + r = this[Cr]; + } else { + const n = this.css.split(` +`); + r = new Array(n.length); + let o = 0; + for (let l = 0, a = n.length; l < a; l++) { + (r[l] = o), (o += n[l].length + 1); + } + this[Cr] = r; + } + t = r[r.length - 1]; + let i = 0; + if (e >= t) { + i = r.length - 1; + } else { + let n = r.length - 2, + o; + while (i < n) { + if (((o = i + ((n - i) >> 1)), e < r[o])) { + n = o - 1; + } else if (e >= r[o + 1]) { + i = o + 1; + } else { + i = o; + break; + } + } + } + return { col: e - r[i] + 1, line: i + 1 }; + } + mapResolve(e) { + return /^\w+:\/\//.test(e) + ? e + : Wr(this.map.consumer().sourceRoot || this.map.root || '.', e); + } + origin(e, t, r, i) { + if (!this.map) { + return !1; + } + const n = this.map.consumer(), + o = n.originalPositionFor({ column: t, line: e }); + if (!o.source) { + return !1; + } + let l; + typeof r == 'number' && + (l = n.originalPositionFor({ column: i, line: r })); + let a; + Br(o.source) + ? (a = pt(o.source)) + : (a = new URL( + o.source, + this.map.consumer().sourceRoot || pt(this.map.mapFile) + )); + const u = { + column: o.column, + endColumn: l && l.column, + endLine: l && l.line, + line: o.line, + url: a.toString(), + }; + if (a.protocol === 'file:') { + if (oi) { + u.file = oi(a); + } else { + throw new Error( + 'file: protocol is not available in this PostCSS build' + ); + } + } + const c = n.sourceContentFor(o.source); + return c && (u.source = c), u; + } + toJSON() { + const e = {}; + for (const t of ['hasBOM', 'css', 'file', 'id']) { + this[t] != null && (e[t] = this[t]); + } + return ( + this.map && + ((e.map = { ...this.map }), + e.map.consumerCache && (e.map.consumerCache = void 0)), + e + ); + } + get from() { + return this.file || this.id; + } + }, + or = jt; + jt.default = jt; + vr && vr.registerInput && vr.registerInput(jt); + var { SourceMapConsumer: ln, SourceMapGenerator: kt } = se, + { dirname: Pt, relative: un, resolve: cn, sep: hn } = se, + { pathToFileURL: ui } = se, + vl = or, + Cl = !!(ln && kt), + Il = !!(Pt && cn && un && hn), + El = class { + constructor(e, t, r, i) { + (this.stringify = e), + (this.mapOpts = r.map || {}), + (this.root = t), + (this.opts = r), + (this.css = i), + (this.originalCSS = i), + (this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute), + (this.memoizedFileURLs = new Map()), + (this.memoizedPaths = new Map()), + (this.memoizedURLs = new Map()); + } + addAnnotation() { + let e; + this.isInline() + ? (e = + 'data:application/json;base64,' + + this.toBase64(this.map.toString())) + : typeof this.mapOpts.annotation == 'string' + ? (e = this.mapOpts.annotation) + : typeof this.mapOpts.annotation == 'function' + ? (e = this.mapOpts.annotation(this.opts.to, this.root)) + : (e = this.outputFile() + '.map'); + let t = ` +`; + this.css.includes(`\r +`) && + (t = `\r +`), + (this.css += t + '/*# sourceMappingURL=' + e + ' */'); + } + applyPrevMaps() { + for (const e of this.previous()) { + let t = this.toUrl(this.path(e.file)), + r = e.root || Pt(e.file), + i; + this.mapOpts.sourcesContent === !1 + ? ((i = new ln(e.text)), + i.sourcesContent && (i.sourcesContent = null)) + : (i = e.consumer()), + this.map.applySourceMap(i, t, this.toUrl(this.path(r))); + } + } + clearAnnotation() { + if (this.mapOpts.annotation !== !1) { + if (this.root) { + let e; + for (let t = this.root.nodes.length - 1; t >= 0; t--) { + (e = this.root.nodes[t]), + e.type === 'comment' && + e.text.indexOf('# sourceMappingURL=') === 0 && + this.root.removeChild(t); + } + } else { + this.css && + (this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, '')); + } + } + } + generate() { + if ((this.clearAnnotation(), Il && Cl && this.isMap())) { + return this.generateMap(); + } + { + let e = ''; + return ( + this.stringify(this.root, (t) => { + e += t; + }), + [e] + ); + } + } + generateMap() { + if (this.root) { + this.generateString(); + } else if (this.previous().length === 1) { + const e = this.previous()[0].consumer(); + (e.file = this.outputFile()), + (this.map = kt.fromSourceMap(e, { ignoreInvalidMapping: !0 })); + } else { + (this.map = new kt({ + 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)) + : '', + }); + } + return ( + this.isSourcesContent() && this.setSourcesContent(), + this.root && this.previous().length > 0 && this.applyPrevMaps(), + this.isAnnotation() && this.addAnnotation(), + this.isInline() ? [this.css] : [this.css, this.map] + ); + } + generateString() { + (this.css = ''), + (this.map = new kt({ + file: this.outputFile(), + ignoreInvalidMapping: !0, + })); + let e = 1, + t = 1, + r = '', + i = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '', + }, + n, + o; + this.stringify(this.root, (l, a, u) => { + if ( + ((this.css += l), + a && + u !== 'end' && + ((i.generated.line = e), + (i.generated.column = t - 1), + a.source && a.source.start + ? ((i.source = this.sourcePath(a)), + (i.original.line = a.source.start.line), + (i.original.column = a.source.start.column - 1), + this.map.addMapping(i)) + : ((i.source = r), + (i.original.line = 1), + (i.original.column = 0), + this.map.addMapping(i))), + (n = l.match(/\n/g)), + n + ? ((e += n.length), + (o = l.lastIndexOf(` +`)), + (t = l.length - o)) + : (t += l.length), + a && u !== 'start') + ) { + const c = a.parent || { raws: {} }; + (!(a.type === 'decl' || (a.type === 'atrule' && !a.nodes)) || + a !== c.last || + c.raws.semicolon) && + (a.source && a.source.end + ? ((i.source = this.sourcePath(a)), + (i.original.line = a.source.end.line), + (i.original.column = a.source.end.column - 1), + (i.generated.line = e), + (i.generated.column = t - 2), + this.map.addMapping(i)) + : ((i.source = r), + (i.original.line = 1), + (i.original.column = 0), + (i.generated.line = e), + (i.generated.column = t - 1), + this.map.addMapping(i))); + } + }); + } + isAnnotation() { + return this.isInline() + ? !0 + : typeof this.mapOpts.annotation < 'u' + ? this.mapOpts.annotation + : this.previous().length + ? this.previous().some((e) => e.annotation) + : !0; + } + isInline() { + if (typeof this.mapOpts.inline < 'u') { + return this.mapOpts.inline; + } + const e = this.mapOpts.annotation; + return typeof e < 'u' && e !== !0 + ? !1 + : this.previous().length + ? this.previous().some((t) => t.inline) + : !0; + } + isMap() { + return typeof this.opts.map < 'u' + ? !!this.opts.map + : this.previous().length > 0; + } + isSourcesContent() { + return typeof this.mapOpts.sourcesContent < 'u' + ? this.mapOpts.sourcesContent + : this.previous().length + ? this.previous().some((e) => e.withContent()) + : !0; + } + outputFile() { + return this.opts.to + ? this.path(this.opts.to) + : this.opts.from + ? this.path(this.opts.from) + : 'to.css'; + } + path(e) { + if ( + this.mapOpts.absolute || + e.charCodeAt(0) === 60 || + /^\w+:\/\//.test(e) + ) { + return e; + } + const t = this.memoizedPaths.get(e); + if (t) { + return t; + } + let r = this.opts.to ? Pt(this.opts.to) : '.'; + typeof this.mapOpts.annotation == 'string' && + (r = Pt(cn(r, this.mapOpts.annotation))); + const i = un(r, e); + return this.memoizedPaths.set(e, i), i; + } + previous() { + if (!this.previousMaps) { + if (((this.previousMaps = []), this.root)) { + this.root.walk((e) => { + if (e.source && e.source.input.map) { + const t = e.source.input.map; + this.previousMaps.includes(t) || this.previousMaps.push(t); + } + }); + } else { + const e = new vl(this.originalCSS, this.opts); + e.map && this.previousMaps.push(e.map); + } + } + return this.previousMaps; + } + setSourcesContent() { + const e = {}; + if (this.root) { + this.root.walk((t) => { + if (t.source) { + const r = t.source.input.from; + if (r && !e[r]) { + e[r] = !0; + const i = this.usesFileUrls + ? this.toFileUrl(r) + : this.toUrl(this.path(r)); + this.map.setSourceContent(i, t.source.input.css); + } + } + }); + } else if (this.css) { + const t = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : ''; + this.map.setSourceContent(t, this.css); + } + } + sourcePath(e) { + return this.mapOpts.from + ? this.toUrl(this.mapOpts.from) + : this.usesFileUrls + ? this.toFileUrl(e.source.input.from) + : this.toUrl(this.path(e.source.input.from)); + } + toBase64(e) { + return Buffer + ? Buffer.from(e).toString('base64') + : window.btoa(unescape(encodeURIComponent(e))); + } + toFileUrl(e) { + const t = this.memoizedFileURLs.get(e); + if (t) { + return t; + } + if (ui) { + const r = ui(e).toString(); + return this.memoizedFileURLs.set(e, r), r; + } + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ); + } + toUrl(e) { + const t = this.memoizedURLs.get(e); + if (t) { + return t; + } + hn === '\\' && (e = e.replace(/\\/g, '/')); + const r = encodeURI(e).replace(/[#?]/g, encodeURIComponent); + return this.memoizedURLs.set(e, r), r; + } + }, + fn = El, + xl = ir, + zr = class extends xl { + constructor(e) { + super(e), (this.type = 'comment'); + } + }, + ar = zr; + zr.default = zr; + var { isClean: dn, my: pn } = it, + mn = nr, + gn = ar, + Ml = ir, + yn, + xs, + Ms, + wn; + function bn(s) { + return s.map( + (e) => (e.nodes && (e.nodes = bn(e.nodes)), delete e.source, e) + ); + } + function Sn(s) { + if (((s[dn] = !1), s.proxyOf.nodes)) { + for (const e of s.proxyOf.nodes) { + Sn(e); + } + } + } + var ce = class vn extends Ml { + append(...e) { + for (const t of e) { + const r = this.normalize(t, this.last); + for (const i of r) { + this.proxyOf.nodes.push(i); + } + } + return this.markDirty(), this; + } + cleanRaws(e) { + if ((super.cleanRaws(e), this.nodes)) { + for (const t of this.nodes) { + t.cleanRaws(e); + } + } + } + each(e) { + if (!this.proxyOf.nodes) { + return; + } + let t = this.getIterator(), + r, + i; + while ( + this.indexes[t] < this.proxyOf.nodes.length && + ((r = this.indexes[t]), (i = e(this.proxyOf.nodes[r], r)), i !== !1) + ) { + this.indexes[t] += 1; + } + return delete this.indexes[t], i; + } + every(e) { + return this.nodes.every(e); + } + getIterator() { + this.lastEach || (this.lastEach = 0), + this.indexes || (this.indexes = {}), + (this.lastEach += 1); + const e = this.lastEach; + return (this.indexes[e] = 0), e; + } + getProxyProcessor() { + return { + get(e, t) { + return t === 'proxyOf' + ? e + : e[t] + ? t === 'each' || (typeof t == 'string' && t.startsWith('walk')) + ? (...r) => + e[t]( + ...r.map((i) => + typeof i == 'function' ? (n, o) => i(n.toProxy(), o) : i + ) + ) + : t === 'every' || t === 'some' + ? (r) => e[t]((i, ...n) => r(i.toProxy(), ...n)) + : t === 'root' + ? () => e.root().toProxy() + : t === 'nodes' + ? e.nodes.map((r) => r.toProxy()) + : t === 'first' || t === 'last' + ? e[t].toProxy() + : e[t] + : e[t]; + }, + set(e, t, r) { + return ( + e[t] === r || + ((e[t] = r), + (t === 'name' || t === 'params' || t === 'selector') && + e.markDirty()), + !0 + ); + }, + }; + } + index(e) { + return typeof e == 'number' + ? e + : (e.proxyOf && (e = e.proxyOf), this.proxyOf.nodes.indexOf(e)); + } + insertAfter(e, t) { + let r = this.index(e), + i = this.normalize(t, this.proxyOf.nodes[r]).reverse(); + r = this.index(e); + for (const o of i) { + this.proxyOf.nodes.splice(r + 1, 0, o); + } + let n; + for (const o in this.indexes) { + (n = this.indexes[o]), r < n && (this.indexes[o] = n + i.length); + } + return this.markDirty(), this; + } + insertBefore(e, t) { + let r = this.index(e), + i = r === 0 ? 'prepend' : !1, + n = this.normalize(t, this.proxyOf.nodes[r], i).reverse(); + r = this.index(e); + for (const l of n) { + this.proxyOf.nodes.splice(r, 0, l); + } + let o; + for (const l in this.indexes) { + (o = this.indexes[l]), r <= o && (this.indexes[l] = o + n.length); + } + return this.markDirty(), this; + } + normalize(e, t) { + if (typeof e == 'string') { + e = bn(yn(e).nodes); + } else if (typeof e > 'u') { + e = []; + } else if (Array.isArray(e)) { + e = e.slice(0); + for (const i of e) { + i.parent && i.parent.removeChild(i, 'ignore'); + } + } else if (e.type === 'root' && this.type !== 'document') { + e = e.nodes.slice(0); + for (const i of e) { + i.parent && i.parent.removeChild(i, 'ignore'); + } + } else if (e.type) { + e = [e]; + } else if (e.prop) { + if (typeof e.value > 'u') { + throw new Error('Value field is missed in node creation'); + } + typeof e.value != 'string' && (e.value = String(e.value)), + (e = [new mn(e)]); + } else if (e.selector) { + e = [new xs(e)]; + } else if (e.name) { + e = [new Ms(e)]; + } else if (e.text) { + e = [new gn(e)]; + } else { + throw new Error('Unknown node type in node creation'); + } + return e.map( + (i) => ( + i[pn] || vn.rebuild(i), + (i = i.proxyOf), + i.parent && i.parent.removeChild(i), + i[dn] && Sn(i), + typeof i.raws.before > 'u' && + t && + typeof t.raws.before < 'u' && + (i.raws.before = t.raws.before.replace(/\S/g, '')), + (i.parent = this.proxyOf), + i + ) + ); + } + prepend(...e) { + e = e.reverse(); + for (const t of e) { + const r = this.normalize(t, this.first, 'prepend').reverse(); + for (const i of r) { + this.proxyOf.nodes.unshift(i); + } + for (const i in this.indexes) { + this.indexes[i] = this.indexes[i] + r.length; + } + } + return this.markDirty(), this; + } + push(e) { + return (e.parent = this), this.proxyOf.nodes.push(e), this; + } + removeAll() { + for (const e of this.proxyOf.nodes) { + e.parent = void 0; + } + return (this.proxyOf.nodes = []), this.markDirty(), this; + } + removeChild(e) { + (e = this.index(e)), + (this.proxyOf.nodes[e].parent = void 0), + this.proxyOf.nodes.splice(e, 1); + let t; + for (const r in this.indexes) { + (t = this.indexes[r]), t >= e && (this.indexes[r] = t - 1); + } + return this.markDirty(), this; + } + replaceValues(e, t, r) { + return ( + r || ((r = t), (t = {})), + this.walkDecls((i) => { + (t.props && !t.props.includes(i.prop)) || + (t.fast && !i.value.includes(t.fast)) || + (i.value = i.value.replace(e, r)); + }), + this.markDirty(), + this + ); + } + some(e) { + return this.nodes.some(e); + } + walk(e) { + return this.each((t, r) => { + let i; + try { + i = e(t, r); + } catch (n) { + throw t.addToError(n); + } + return i !== !1 && t.walk && (i = t.walk(e)), i; + }); + } + walkAtRules(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'atrule' && e.test(r.name)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'atrule' && r.name === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'atrule') { + return t(r, i); + } + })); + } + walkComments(e) { + return this.walk((t, r) => { + if (t.type === 'comment') { + return e(t, r); + } + }); + } + walkDecls(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'decl' && e.test(r.prop)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'decl' && r.prop === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'decl') { + return t(r, i); + } + })); + } + walkRules(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'rule' && e.test(r.selector)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'rule' && r.selector === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'rule') { + return t(r, i); + } + })); + } + get first() { + if (this.proxyOf.nodes) { + return this.proxyOf.nodes[0]; + } + } + get last() { + if (this.proxyOf.nodes) { + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; + } + } + }; + ce.registerParse = (s) => { + yn = s; + }; + ce.registerRule = (s) => { + xs = s; + }; + ce.registerAtRule = (s) => { + Ms = s; + }; + ce.registerRoot = (s) => { + wn = s; + }; + var ve = ce; + ce.default = ce; + ce.rebuild = (s) => { + s.type === 'atrule' + ? Object.setPrototypeOf(s, Ms.prototype) + : s.type === 'rule' + ? Object.setPrototypeOf(s, xs.prototype) + : s.type === 'decl' + ? Object.setPrototypeOf(s, mn.prototype) + : s.type === 'comment' + ? Object.setPrototypeOf(s, gn.prototype) + : s.type === 'root' && Object.setPrototypeOf(s, wn.prototype), + (s[pn] = !0), + s.nodes && + s.nodes.forEach((e) => { + ce.rebuild(e); + }); + }; + var Nl = ve, + Cn, + In, + Xe = class extends Nl { + constructor(e) { + super({ type: 'document', ...e }), this.nodes || (this.nodes = []); + } + toResult(e = {}) { + return new Cn(new In(), this, e).stringify(); + } + }; + Xe.registerLazyResult = (s) => { + Cn = s; + }; + Xe.registerProcessor = (s) => { + In = s; + }; + var Ns = Xe; + Xe.default = Xe; + var ci = {}, + En = (e) => { + ci[e] || + ((ci[e] = !0), typeof console < 'u' && console.warn && console.warn(e)); + }, + Vr = class { + constructor(e, t = {}) { + if ( + ((this.type = 'warning'), (this.text = e), t.node && t.node.source) + ) { + const r = t.node.rangeBy(t); + (this.line = r.start.line), + (this.column = r.start.column), + (this.endLine = r.end.line), + (this.endColumn = r.end.column); + } + for (const r in t) { + this[r] = t[r]; + } + } + toString() { + return this.node + ? this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word, + }).message + : this.plugin + ? this.plugin + ': ' + this.text + : this.text; + } + }, + xn = Vr; + Vr.default = Vr; + var Rl = xn, + Gr = class { + constructor(e, t, r) { + (this.processor = e), + (this.messages = []), + (this.root = t), + (this.opts = r), + (this.css = void 0), + (this.map = void 0); + } + toString() { + return this.css; + } + warn(e, t = {}) { + t.plugin || + (this.lastPlugin && + this.lastPlugin.postcssPlugin && + (t.plugin = this.lastPlugin.postcssPlugin)); + const r = new Rl(e, t); + return this.messages.push(r), r; + } + warnings() { + return this.messages.filter((e) => e.type === 'warning'); + } + get content() { + return this.css; + } + }, + Rs = Gr; + Gr.default = Gr; + var Ir = 39, + hi = 34, + mt = 92, + fi = 47, + gt = 10, + Be = 32, + yt = 12, + wt = 9, + bt = 13, + Al = 91, + Ol = 93, + Dl = 40, + Tl = 41, + _l = 123, + kl = 125, + Pl = 59, + $l = 42, + Ll = 58, + Fl = 64, + St = /[\t\n\f\r "#'()/;[\\\]{}]/g, + vt = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, + Ul = /.[\r\n"'(/\\]/, + di = /[\da-f]/i, + Bl = (e, t = {}) => { + let r = e.css.valueOf(), + i = t.ignoreErrors, + n, + o, + l, + a, + u, + c, + f, + p, + g, + m, + d = r.length, + h = 0, + b = [], + S = []; + function y() { + return h; + } + function v(_) { + throw e.error('Unclosed ' + _, h); + } + function N() { + return S.length === 0 && h >= d; + } + function D(_) { + if (S.length) { + return S.pop(); + } + if (h >= d) { + return; + } + const V = _ ? _.ignoreUnclosed : !1; + switch (((n = r.charCodeAt(h)), n)) { + case gt: + case Be: + case wt: + case bt: + case yt: { + o = h; + do { + (o += 1), (n = r.charCodeAt(o)); + } while (n === Be || n === gt || n === wt || n === bt || n === yt); + (m = ['space', r.slice(h, o)]), (h = o - 1); + break; + } + case Al: + case Ol: + case _l: + case kl: + case Ll: + case Pl: + case Tl: { + const H = String.fromCharCode(n); + m = [H, H, h]; + break; + } + case Dl: { + if ( + ((p = b.length ? b.pop()[1] : ''), + (g = r.charCodeAt(h + 1)), + p === 'url' && + g !== Ir && + g !== hi && + g !== Be && + g !== gt && + g !== wt && + g !== yt && + g !== bt) + ) { + o = h; + do { + if (((c = !1), (o = r.indexOf(')', o + 1)), o === -1)) { + if (i || V) { + o = h; + break; + } + v('bracket'); + } + for (f = o; r.charCodeAt(f - 1) === mt; ) { + (f -= 1), (c = !c); + } + } while (c); + (m = ['brackets', r.slice(h, o + 1), h, o]), (h = o); + } else { + (o = r.indexOf(')', h + 1)), + (a = r.slice(h, o + 1)), + o === -1 || Ul.test(a) + ? (m = ['(', '(', h]) + : ((m = ['brackets', a, h, o]), (h = o)); + } + break; + } + case Ir: + case hi: { + (l = n === Ir ? "'" : '"'), (o = h); + do { + if (((c = !1), (o = r.indexOf(l, o + 1)), o === -1)) { + if (i || V) { + o = h + 1; + break; + } + v('string'); + } + for (f = o; r.charCodeAt(f - 1) === mt; ) { + (f -= 1), (c = !c); + } + } while (c); + (m = ['string', r.slice(h, o + 1), h, o]), (h = o); + break; + } + case Fl: { + (St.lastIndex = h + 1), + St.test(r), + St.lastIndex === 0 ? (o = r.length - 1) : (o = St.lastIndex - 2), + (m = ['at-word', r.slice(h, o + 1), h, o]), + (h = o); + break; + } + case mt: { + for (o = h, u = !0; r.charCodeAt(o + 1) === mt; ) { + (o += 1), (u = !u); + } + if ( + ((n = r.charCodeAt(o + 1)), + u && + n !== fi && + n !== Be && + n !== gt && + n !== wt && + n !== bt && + n !== yt && + ((o += 1), di.test(r.charAt(o)))) + ) { + while (di.test(r.charAt(o + 1))) { + o += 1; + } + r.charCodeAt(o + 1) === Be && (o += 1); + } + (m = ['word', r.slice(h, o + 1), h, o]), (h = o); + break; + } + default: { + n === fi && r.charCodeAt(h + 1) === $l + ? ((o = r.indexOf('*/', h + 2) + 1), + o === 0 && (i || V ? (o = r.length) : v('comment')), + (m = ['comment', r.slice(h, o + 1), h, o]), + (h = o)) + : ((vt.lastIndex = h + 1), + vt.test(r), + vt.lastIndex === 0 + ? (o = r.length - 1) + : (o = vt.lastIndex - 2), + (m = ['word', r.slice(h, o + 1), h, o]), + b.push(m), + (h = o)); + break; + } + } + return h++, m; + } + function z(_) { + S.push(_); + } + return { back: z, endOfFile: N, nextToken: D, position: y }; + }, + Mn = ve, + Ht = class extends Mn { + constructor(e) { + super(e), (this.type = 'atrule'); + } + append(...e) { + return this.proxyOf.nodes || (this.nodes = []), super.append(...e); + } + prepend(...e) { + return this.proxyOf.nodes || (this.nodes = []), super.prepend(...e); + } + }, + As = Ht; + Ht.default = Ht; + Mn.registerAtRule(Ht); + var Nn = ve, + Rn, + An, + Oe = class extends Nn { + constructor(e) { + super(e), (this.type = 'root'), this.nodes || (this.nodes = []); + } + normalize(e, t, r) { + const i = super.normalize(e); + if (t) { + if (r === 'prepend') { + this.nodes.length > 1 + ? (t.raws.before = this.nodes[1].raws.before) + : delete t.raws.before; + } else if (this.first !== t) { + for (const n of i) { + n.raws.before = t.raws.before; + } + } + } + return i; + } + removeChild(e, t) { + const r = this.index(e); + return ( + !t && + r === 0 && + this.nodes.length > 1 && + (this.nodes[1].raws.before = this.nodes[r].raws.before), + super.removeChild(e) + ); + } + toResult(e = {}) { + return new Rn(new An(), this, e).stringify(); + } + }; + Oe.registerLazyResult = (s) => { + Rn = s; + }; + Oe.registerProcessor = (s) => { + An = s; + }; + var nt = Oe; + Oe.default = Oe; + Nn.registerRoot(Oe); + var Je = { + comma(s) { + return Je.split(s, [','], !0); + }, + space(s) { + const e = [ + ' ', + ` +`, + ' ', + ]; + return Je.split(s, e); + }, + split(s, e, t) { + let r = [], + i = '', + n = !1, + o = 0, + l = !1, + a = '', + u = !1; + for (const c of s) { + u + ? (u = !1) + : c === '\\' + ? (u = !0) + : l + ? c === a && (l = !1) + : c === '"' || c === "'" + ? ((l = !0), (a = c)) + : c === '(' + ? (o += 1) + : c === ')' + ? o > 0 && (o -= 1) + : o === 0 && e.includes(c) && (n = !0), + n ? (i !== '' && r.push(i.trim()), (i = ''), (n = !1)) : (i += c); + } + return (t || i !== '') && r.push(i.trim()), r; + }, + }, + On = Je; + Je.default = Je; + var Dn = ve, + Wl = On, + Yt = class extends Dn { + constructor(e) { + super(e), (this.type = 'rule'), this.nodes || (this.nodes = []); + } + get selectors() { + return Wl.comma(this.selector); + } + set selectors(e) { + const t = this.selector ? this.selector.match(/,\s*/) : null, + r = t ? t[0] : ',' + this.raw('between', 'beforeOpen'); + this.selector = e.join(r); + } + }, + Os = Yt; + Yt.default = Yt; + Dn.registerRule(Yt); + var zl = nr, + Vl = Bl, + Gl = ar, + jl = As, + Hl = nt, + pi = Os, + mi = { empty: !0, space: !0 }; + function Yl(s) { + for (let e = s.length - 1; e >= 0; e--) { + const t = s[e], + r = t[3] || t[2]; + if (r) { + return r; + } + } + } + var Zl = class { + constructor(e) { + (this.input = e), + (this.root = new Hl()), + (this.current = this.root), + (this.spaces = ''), + (this.semicolon = !1), + this.createTokenizer(), + (this.root.source = { + input: e, + start: { column: 1, line: 1, offset: 0 }, + }); + } + atrule(e) { + const t = new jl(); + (t.name = e[1].slice(1)), + t.name === '' && this.unnamedAtrule(t, e), + this.init(t, e[2]); + let r, + i, + n, + o = !1, + l = !1, + a = [], + u = []; + while (!this.tokenizer.endOfFile()) { + if ( + ((e = this.tokenizer.nextToken()), + (r = e[0]), + r === '(' || r === '[' + ? u.push(r === '(' ? ')' : ']') + : r === '{' && u.length > 0 + ? u.push('}') + : r === u[u.length - 1] && u.pop(), + u.length === 0) + ) { + if (r === ';') { + (t.source.end = this.getPosition(e[2])), + t.source.end.offset++, + (this.semicolon = !0); + break; + } + if (r === '{') { + l = !0; + break; + } + if (r === '}') { + if (a.length > 0) { + for (n = a.length - 1, i = a[n]; i && i[0] === 'space'; ) { + i = a[--n]; + } + i && + ((t.source.end = this.getPosition(i[3] || i[2])), + t.source.end.offset++); + } + this.end(e); + break; + } + a.push(e); + } else { + a.push(e); + } + if (this.tokenizer.endOfFile()) { + o = !0; + break; + } + } + (t.raws.between = this.spacesAndCommentsFromEnd(a)), + a.length + ? ((t.raws.afterName = this.spacesAndCommentsFromStart(a)), + this.raw(t, 'params', a), + o && + ((e = a[a.length - 1]), + (t.source.end = this.getPosition(e[3] || e[2])), + t.source.end.offset++, + (this.spaces = t.raws.between), + (t.raws.between = ''))) + : ((t.raws.afterName = ''), (t.params = '')), + l && ((t.nodes = []), (this.current = t)); + } + checkMissedSemicolon(e) { + const t = this.colon(e); + if (t === !1) { + return; + } + let r = 0, + i; + for ( + let n = t - 1; + n >= 0 && ((i = e[n]), !(i[0] !== 'space' && ((r += 1), r === 2))); + n-- + ) {} + throw this.input.error( + 'Missed semicolon', + i[0] === 'word' ? i[3] + 1 : i[2] + ); + } + colon(e) { + let t = 0, + r, + i, + n; + for (const [o, l] of e.entries()) { + if ( + ((r = l), + (i = r[0]), + i === '(' && (t += 1), + i === ')' && (t -= 1), + t === 0 && i === ':') + ) { + if (n) { + if (n[0] === 'word' && n[1] === 'progid') { + continue; + } + return o; + } + this.doubleColon(r); + } + n = r; + } + return !1; + } + comment(e) { + const t = new Gl(); + this.init(t, e[2]), + (t.source.end = this.getPosition(e[3] || e[2])), + t.source.end.offset++; + const r = e[1].slice(2, -2); + if (/^\s*$/.test(r)) { + (t.text = ''), (t.raws.left = r), (t.raws.right = ''); + } else { + const i = r.match(/^(\s*)([^]*\S)(\s*)$/); + (t.text = i[2]), (t.raws.left = i[1]), (t.raws.right = i[3]); + } + } + createTokenizer() { + this.tokenizer = Vl(this.input); + } + decl(e, t) { + const r = new zl(); + this.init(r, e[0][2]); + const i = e[e.length - 1]; + for ( + i[0] === ';' && ((this.semicolon = !0), e.pop()), + r.source.end = this.getPosition(i[3] || i[2] || Yl(e)), + r.source.end.offset++; + e[0][0] !== 'word'; + ) { + e.length === 1 && this.unknownWord(e), + (r.raws.before += e.shift()[1]); + } + for ( + r.source.start = this.getPosition(e[0][2]), r.prop = ''; + e.length; + ) { + const u = e[0][0]; + if (u === ':' || u === 'space' || u === 'comment') { + break; + } + r.prop += e.shift()[1]; + } + r.raws.between = ''; + let n; + while (e.length) { + if (((n = e.shift()), n[0] === ':')) { + r.raws.between += n[1]; + break; + } + n[0] === 'word' && /\w/.test(n[1]) && this.unknownWord([n]), + (r.raws.between += n[1]); + } + (r.prop[0] === '_' || r.prop[0] === '*') && + ((r.raws.before += r.prop[0]), (r.prop = r.prop.slice(1))); + let o = [], + l; + while ( + e.length && + ((l = e[0][0]), !(l !== 'space' && l !== 'comment')) + ) { + o.push(e.shift()); + } + this.precheckMissedSemicolon(e); + for (let u = e.length - 1; u >= 0; u--) { + if (((n = e[u]), n[1].toLowerCase() === '!important')) { + r.important = !0; + let c = this.stringFrom(e, u); + (c = this.spacesFromEnd(e) + c), + c !== ' !important' && (r.raws.important = c); + break; + } + if (n[1].toLowerCase() === 'important') { + let c = e.slice(0), + f = ''; + for (let p = u; p > 0; p--) { + const g = c[p][0]; + if (f.trim().indexOf('!') === 0 && g !== 'space') { + break; + } + f = c.pop()[1] + f; + } + f.trim().indexOf('!') === 0 && + ((r.important = !0), (r.raws.important = f), (e = c)); + } + if (n[0] !== 'space' && n[0] !== 'comment') { + break; + } + } + e.some((u) => u[0] !== 'space' && u[0] !== 'comment') && + ((r.raws.between += o.map((u) => u[1]).join('')), (o = [])), + this.raw(r, 'value', o.concat(e), t), + r.value.includes(':') && !t && this.checkMissedSemicolon(e); + } + doubleColon(e) { + throw this.input.error( + 'Double colon', + { offset: e[2] }, + { offset: e[2] + e[1].length } + ); + } + emptyRule(e) { + const t = new pi(); + this.init(t, e[2]), + (t.selector = ''), + (t.raws.between = ''), + (this.current = t); + } + end(e) { + this.current.nodes && + this.current.nodes.length && + (this.current.raws.semicolon = this.semicolon), + (this.semicolon = !1), + (this.current.raws.after = + (this.current.raws.after || '') + this.spaces), + (this.spaces = ''), + this.current.parent + ? ((this.current.source.end = this.getPosition(e[2])), + this.current.source.end.offset++, + (this.current = this.current.parent)) + : this.unexpectedClose(e); + } + endFile() { + this.current.parent && this.unclosedBlock(), + 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(e) { + if (((this.spaces += e[1]), this.current.nodes)) { + const t = this.current.nodes[this.current.nodes.length - 1]; + t && + t.type === 'rule' && + !t.raws.ownSemicolon && + ((t.raws.ownSemicolon = this.spaces), (this.spaces = '')); + } + } + getPosition(e) { + const t = this.input.fromOffset(e); + return { column: t.col, line: t.line, offset: e }; + } + init(e, t) { + this.current.push(e), + (e.source = { input: this.input, start: this.getPosition(t) }), + (e.raws.before = this.spaces), + (this.spaces = ''), + e.type !== 'comment' && (this.semicolon = !1); + } + other(e) { + let t = !1, + r = null, + i = !1, + n = null, + o = [], + l = e[1].startsWith('--'), + a = [], + u = e; + while (u) { + if (((r = u[0]), a.push(u), r === '(' || r === '[')) { + n || (n = u), o.push(r === '(' ? ')' : ']'); + } else if (l && i && r === '{') { + n || (n = u), o.push('}'); + } else if (o.length === 0) { + if (r === ';') { + if (i) { + this.decl(a, l); + return; + } + break; + } + if (r === '{') { + this.rule(a); + return; + } + if (r === '}') { + this.tokenizer.back(a.pop()), (t = !0); + break; + } + r === ':' && (i = !0); + } else { + r === o[o.length - 1] && (o.pop(), o.length === 0 && (n = null)); + } + u = this.tokenizer.nextToken(); + } + if ( + (this.tokenizer.endOfFile() && (t = !0), + o.length > 0 && this.unclosedBracket(n), + t && i) + ) { + if (!l) { + while ( + a.length && + ((u = a[a.length - 1][0]), !(u !== 'space' && u !== 'comment')) + ) { + this.tokenizer.back(a.pop()); + } + } + this.decl(a, l); + } else { + this.unknownWord(a); + } + } + parse() { + let e; + while (!this.tokenizer.endOfFile()) { + switch (((e = this.tokenizer.nextToken()), e[0])) { + case 'space': + this.spaces += e[1]; + break; + case ';': + this.freeSemicolon(e); + break; + case '}': + this.end(e); + break; + case 'comment': + this.comment(e); + break; + case 'at-word': + this.atrule(e); + break; + case '{': + this.emptyRule(e); + break; + default: + this.other(e); + break; + } + } + this.endFile(); + } + precheckMissedSemicolon() {} + raw(e, t, r, i) { + let n, + o, + l = r.length, + a = '', + u = !0, + c, + f; + for (let p = 0; p < l; p += 1) { + (n = r[p]), + (o = n[0]), + o === 'space' && p === l - 1 && !i + ? (u = !1) + : o === 'comment' + ? ((f = r[p - 1] ? r[p - 1][0] : 'empty'), + (c = r[p + 1] ? r[p + 1][0] : 'empty'), + mi[f] || mi[c] + ? (u = !1) + : a.slice(-1) === ',' + ? (u = !1) + : (a += n[1])) + : (a += n[1]); + } + if (!u) { + const p = r.reduce((g, m) => g + m[1], ''); + e.raws[t] = { raw: p, value: a }; + } + e[t] = a; + } + rule(e) { + e.pop(); + const t = new pi(); + this.init(t, e[0][2]), + (t.raws.between = this.spacesAndCommentsFromEnd(e)), + this.raw(t, 'selector', e), + (this.current = t); + } + spacesAndCommentsFromEnd(e) { + let t, + r = ''; + while ( + e.length && + ((t = e[e.length - 1][0]), !(t !== 'space' && t !== 'comment')) + ) { + r = e.pop()[1] + r; + } + return r; + } + spacesAndCommentsFromStart(e) { + let t, + r = ''; + while ( + e.length && + ((t = e[0][0]), !(t !== 'space' && t !== 'comment')) + ) { + r += e.shift()[1]; + } + return r; + } + spacesFromEnd(e) { + let t, + r = ''; + while (e.length && ((t = e[e.length - 1][0]), t === 'space')) { + r = e.pop()[1] + r; + } + return r; + } + stringFrom(e, t) { + let r = ''; + for (let i = t; i < e.length; i++) { + r += e[i][1]; + } + return e.splice(t, e.length - t), r; + } + unclosedBlock() { + const e = this.current.source.start; + throw this.input.error('Unclosed block', e.line, e.column); + } + unclosedBracket(e) { + throw this.input.error( + 'Unclosed bracket', + { offset: e[2] }, + { offset: e[2] + 1 } + ); + } + unexpectedClose(e) { + throw this.input.error( + 'Unexpected }', + { offset: e[2] }, + { offset: e[2] + 1 } + ); + } + unknownWord(e) { + throw this.input.error( + 'Unknown word', + { offset: e[0][2] }, + { offset: e[0][2] + e[0][1].length } + ); + } + unnamedAtrule(e, t) { + throw this.input.error( + 'At-rule without name', + { offset: t[2] }, + { offset: t[2] + t[1].length } + ); + } + }, + Xl = Zl, + Jl = ve, + Kl = Xl, + Ql = or; + function Zt(s, e) { + const t = new Ql(s, e), + r = new Kl(t); + try { + r.parse(); + } catch (i) { + throw ( + (process.env.NODE_ENV !== 'production' && + i.name === 'CssSyntaxError' && + e && + e.from && + (/\.scss$/i.test(e.from) + ? (i.message += ` +You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`) + : /\.sass/i.test(e.from) + ? (i.message += ` +You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`) + : /\.less$/i.test(e.from) && + (i.message += ` +You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)), + i) + ); + } + return r.root; + } + var Ds = Zt; + Zt.default = Zt; + Jl.registerParse(Zt); + var { isClean: ae, my: ql } = it, + eu = fn, + tu = sr, + ru = ve, + su = Ns, + iu = En, + gi = Rs, + nu = Ds, + ou = nt, + au = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule', + }, + lu = { + 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, + }, + uu = { Once: !0, postcssPlugin: !0, prepare: !0 }, + De = 0; + function We(s) { + return typeof s == 'object' && typeof s.then == 'function'; + } + function Tn(s) { + let e = !1, + t = au[s.type]; + return ( + s.type === 'decl' + ? (e = s.prop.toLowerCase()) + : s.type === 'atrule' && (e = s.name.toLowerCase()), + e && s.append + ? [t, t + '-' + e, De, t + 'Exit', t + 'Exit-' + e] + : e + ? [t, t + '-' + e, t + 'Exit', t + 'Exit-' + e] + : s.append + ? [t, De, t + 'Exit'] + : [t, t + 'Exit'] + ); + } + function yi(s) { + let e; + return ( + s.type === 'document' + ? (e = ['Document', De, 'DocumentExit']) + : s.type === 'root' + ? (e = ['Root', De, 'RootExit']) + : (e = Tn(s)), + { + eventIndex: 0, + events: e, + iterator: 0, + node: s, + visitorIndex: 0, + visitors: [], + } + ); + } + function jr(s) { + return (s[ae] = !1), s.nodes && s.nodes.forEach((e) => jr(e)), s; + } + var Hr = {}, + Te = class _n { + constructor(e, t, r) { + (this.stringified = !1), (this.processed = !1); + let i; + if ( + typeof t == 'object' && + t !== null && + (t.type === 'root' || t.type === 'document') + ) { + i = jr(t); + } else if (t instanceof _n || t instanceof gi) { + (i = jr(t.root)), + t.map && + (typeof r.map > 'u' && (r.map = {}), + r.map.inline || (r.map.inline = !1), + (r.map.prev = t.map)); + } else { + let n = nu; + r.syntax && (n = r.syntax.parse), + r.parser && (n = r.parser), + n.parse && (n = n.parse); + try { + i = n(t, r); + } catch (o) { + (this.processed = !0), (this.error = o); + } + i && !i[ql] && ru.rebuild(i); + } + (this.result = new gi(e, i, r)), + (this.helpers = { ...Hr, postcss: Hr, result: this.result }), + (this.plugins = this.processor.plugins.map((n) => + typeof n == 'object' && n.prepare + ? { ...n, ...n.prepare(this.result) } + : n + )); + } + async() { + return this.error + ? Promise.reject(this.error) + : this.processed + ? Promise.resolve(this.result) + : (this.processing || (this.processing = this.runAsync()), + this.processing); + } + catch(e) { + return this.async().catch(e); + } + finally(e) { + return this.async().then(e, e); + } + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins'); + } + handleError(e, t) { + const r = this.result.lastPlugin; + try { + if ( + (t && t.addToError(e), + (this.error = e), + e.name === 'CssSyntaxError' && !e.plugin) + ) { + (e.plugin = r.postcssPlugin), e.setMessage(); + } else if ( + r.postcssVersion && + process.env.NODE_ENV !== 'production' + ) { + const i = r.postcssPlugin, + n = r.postcssVersion, + o = this.result.processor.version, + l = n.split('.'), + a = o.split('.'); + (l[0] !== a[0] || Number.parseInt(l[1]) > Number.parseInt(a[1])) && + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS version is ' + + o + + ', but ' + + i + + ' uses ' + + n + + '. Perhaps this is the source of the error below.' + ); + } + } catch (i) { + console && console.error && console.error(i); + } + return e; + } + prepareVisitors() { + this.listeners = {}; + const e = (t, r, i) => { + this.listeners[r] || (this.listeners[r] = []), + this.listeners[r].push([t, i]); + }; + for (const t of this.plugins) { + if (typeof t == 'object') { + for (const r in t) { + if (!lu[r] && /^[A-Z]/.test(r)) { + throw new Error( + `Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` + ); + } + if (!uu[r]) { + if (typeof t[r] == 'object') { + for (const i in t[r]) { + i === '*' + ? e(t, r, t[r][i]) + : e(t, r + '-' + i.toLowerCase(), t[r][i]); + } + } else { + typeof t[r] == 'function' && e(t, r, t[r]); + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0; + } + async runAsync() { + this.plugin = 0; + for (let e = 0; e < this.plugins.length; e++) { + const t = this.plugins[e], + r = this.runOnRoot(t); + if (We(r)) { + try { + await r; + } catch (i) { + throw this.handleError(i); + } + } + } + if ((this.prepareVisitors(), this.hasListener)) { + const e = this.result.root; + while (!e[ae]) { + e[ae] = !0; + const t = [yi(e)]; + while (t.length > 0) { + const r = this.visitTick(t); + if (We(r)) { + try { + await r; + } catch (i) { + const n = t[t.length - 1].node; + throw this.handleError(i, n); + } + } + } + } + if (this.listeners.OnceExit) { + for (const [t, r] of this.listeners.OnceExit) { + this.result.lastPlugin = t; + try { + if (e.type === 'document') { + const i = e.nodes.map((n) => r(n, this.helpers)); + await Promise.all(i); + } else { + await r(e, this.helpers); + } + } catch (i) { + throw this.handleError(i); + } + } + } + } + return (this.processed = !0), this.stringify(); + } + runOnRoot(e) { + this.result.lastPlugin = e; + try { + if (typeof e == 'object' && e.Once) { + if (this.result.root.type === 'document') { + const t = this.result.root.nodes.map((r) => + e.Once(r, this.helpers) + ); + return We(t[0]) ? Promise.all(t) : t; + } + return e.Once(this.result.root, this.helpers); + } + if (typeof e == 'function') { + return e(this.result.root, this.result); + } + } catch (t) { + throw this.handleError(t); + } + } + stringify() { + if (this.error) { + throw this.error; + } + if (this.stringified) { + return this.result; + } + (this.stringified = !0), this.sync(); + let e = this.result.opts, + t = tu; + e.syntax && (t = e.syntax.stringify), + e.stringifier && (t = e.stringifier), + t.stringify && (t = t.stringify); + const i = new eu(t, this.result.root, this.result.opts).generate(); + return (this.result.css = i[0]), (this.result.map = i[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 (const e of this.plugins) { + const t = this.runOnRoot(e); + if (We(t)) { + throw this.getAsyncError(); + } + } + if ((this.prepareVisitors(), this.hasListener)) { + const e = this.result.root; + while (!e[ae]) { + (e[ae] = !0), this.walkSync(e); + } + if (this.listeners.OnceExit) { + if (e.type === 'document') { + for (const t of e.nodes) { + this.visitSync(this.listeners.OnceExit, t); + } + } else { + this.visitSync(this.listeners.OnceExit, e); + } + } + } + return this.result; + } + then(e, t) { + return ( + process.env.NODE_ENV !== 'production' && + ('from' in this.opts || + iu( + '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.' + )), + this.async().then(e, t) + ); + } + toString() { + return this.css; + } + visitSync(e, t) { + for (const [r, i] of e) { + this.result.lastPlugin = r; + let n; + try { + n = i(t, this.helpers); + } catch (o) { + throw this.handleError(o, t.proxyOf); + } + if (t.type !== 'root' && t.type !== 'document' && !t.parent) { + return !0; + } + if (We(n)) { + throw this.getAsyncError(); + } + } + } + visitTick(e) { + const t = e[e.length - 1], + { node: r, visitors: i } = t; + if (r.type !== 'root' && r.type !== 'document' && !r.parent) { + e.pop(); + return; + } + if (i.length > 0 && t.visitorIndex < i.length) { + const [o, l] = i[t.visitorIndex]; + (t.visitorIndex += 1), + t.visitorIndex === i.length && + ((t.visitors = []), (t.visitorIndex = 0)), + (this.result.lastPlugin = o); + try { + return l(r.toProxy(), this.helpers); + } catch (a) { + throw this.handleError(a, r); + } + } + if (t.iterator !== 0) { + let o = t.iterator, + l; + while ((l = r.nodes[r.indexes[o]])) { + if (((r.indexes[o] += 1), !l[ae])) { + (l[ae] = !0), e.push(yi(l)); + return; + } + } + (t.iterator = 0), delete r.indexes[o]; + } + const n = t.events; + while (t.eventIndex < n.length) { + const o = n[t.eventIndex]; + if (((t.eventIndex += 1), o === De)) { + r.nodes && + r.nodes.length && + ((r[ae] = !0), (t.iterator = r.getIterator())); + return; + } + if (this.listeners[o]) { + t.visitors = this.listeners[o]; + return; + } + } + e.pop(); + } + walkSync(e) { + e[ae] = !0; + const t = Tn(e); + for (const r of t) { + if (r === De) { + e.nodes && + e.each((i) => { + i[ae] || this.walkSync(i); + }); + } else { + const i = this.listeners[r]; + if (i && this.visitSync(i, e.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'; + } + }; + Te.registerPostcss = (s) => { + Hr = s; + }; + var kn = Te; + Te.default = Te; + ou.registerLazyResult(Te); + su.registerLazyResult(Te); + var cu = fn, + hu = sr, + fu = En, + du = Ds, + pu = Rs, + Yr = class { + constructor(e, t, r) { + (t = t.toString()), + (this.stringified = !1), + (this._processor = e), + (this._css = t), + (this._opts = r), + (this._map = void 0); + let i, + n = hu; + (this.result = new pu(this._processor, i, this._opts)), + (this.result.css = t); + const o = this; + Object.defineProperty(this.result, 'root', { + get() { + return o.root; + }, + }); + const l = new cu(n, i, this._opts, t); + if (l.isMap()) { + const [a, u] = l.generate(); + a && (this.result.css = a), u && (this.result.map = u); + } else { + l.clearAnnotation(), (this.result.css = l.css); + } + } + async() { + return this.error + ? Promise.reject(this.error) + : Promise.resolve(this.result); + } + catch(e) { + return this.async().catch(e); + } + finally(e) { + return this.async().then(e, e); + } + sync() { + if (this.error) { + throw this.error; + } + return this.result; + } + then(e, t) { + return ( + process.env.NODE_ENV !== 'production' && + ('from' in this._opts || + fu( + '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.' + )), + this.async().then(e, t) + ); + } + 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 e, + t = du; + try { + e = t(this._css, this._opts); + } catch (r) { + this.error = r; + } + if (this.error) { + throw this.error; + } + return (this._root = e), e; + } + get [Symbol.toStringTag]() { + return 'NoWorkResult'; + } + }, + mu = Yr; + Yr.default = Yr; + var gu = mu, + yu = kn, + wu = Ns, + bu = nt, + Ke = class { + constructor(e = []) { + (this.version = '8.4.38'), (this.plugins = this.normalize(e)); + } + normalize(e) { + let t = []; + for (let r of e) { + if ( + (r.postcss === !0 ? (r = r()) : r.postcss && (r = r.postcss), + typeof r == 'object' && Array.isArray(r.plugins)) + ) { + t = t.concat(r.plugins); + } else if (typeof r == 'object' && r.postcssPlugin) { + t.push(r); + } else if (typeof r == 'function') { + t.push(r); + } else if (typeof r == 'object' && (r.parse || r.stringify)) { + if (process.env.NODE_ENV !== 'production') { + throw new 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 new Error(r + ' is not a PostCSS plugin'); + } + } + return t; + } + process(e, t = {}) { + return this.plugins.length || t.parser || t.stringifier || t.syntax + ? new yu(this, e, t) + : new gu(this, e, t); + } + use(e) { + return (this.plugins = this.plugins.concat(this.normalize([e]))), this; + } + }, + Su = Ke; + Ke.default = Ke; + bu.registerProcessor(Ke); + wu.registerProcessor(Ke); + var vu = nr, + Cu = an, + Iu = ar, + Eu = As, + xu = or, + Mu = nt, + Nu = Os; + function Qe(s, e) { + if (Array.isArray(s)) { + return s.map((i) => Qe(i)); + } + const { inputs: t, ...r } = s; + if (t) { + e = []; + for (const i of t) { + const n = { ...i, __proto__: xu.prototype }; + n.map && (n.map = { ...n.map, __proto__: Cu.prototype }), e.push(n); + } + } + if ((r.nodes && (r.nodes = s.nodes.map((i) => Qe(i, e))), r.source)) { + const { inputId: i, ...n } = r.source; + (r.source = n), i != null && (r.source.input = e[i]); + } + if (r.type === 'root') { + return new Mu(r); + } + if (r.type === 'decl') { + return new vu(r); + } + if (r.type === 'rule') { + return new Nu(r); + } + if (r.type === 'comment') { + return new Iu(r); + } + if (r.type === 'atrule') { + return new Eu(r); + } + throw new Error('Unknown node type: ' + s.type); + } + var Ru = Qe; + Qe.default = Qe; + var Au = Es, + Pn = nr, + Ou = kn, + Du = ve, + Ts = Su, + Tu = sr, + _u = Ru, + $n = Ns, + ku = xn, + Ln = ar, + Fn = As, + Pu = Rs, + $u = or, + Lu = Ds, + Fu = On, + Un = Os, + Bn = nt, + Uu = ir; + function A(...s) { + return s.length === 1 && Array.isArray(s[0]) && (s = s[0]), new Ts(s); + } + A.plugin = (e, t) => { + let r = !1; + function i(...o) { + console && + console.warn && + !r && + ((r = !0), + console.warn( + e + + `: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration` + ), + process.env.LANG && + process.env.LANG.startsWith('cn') && + console.warn( + e + + `: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357: +https://www.w3ctech.com/topic/2226` + )); + const l = t(...o); + return (l.postcssPlugin = e), (l.postcssVersion = new Ts().version), l; + } + let n; + return ( + Object.defineProperty(i, 'postcss', { + get() { + return n || (n = i()), n; + }, + }), + (i.process = (o, l, a) => A([i(a)]).process(o, l)), + i + ); + }; + A.stringify = Tu; + A.parse = Lu; + A.fromJSON = _u; + A.list = Fu; + A.comment = (s) => new Ln(s); + A.atRule = (s) => new Fn(s); + A.decl = (s) => new Pn(s); + A.rule = (s) => new Un(s); + A.root = (s) => new Bn(s); + A.document = (s) => new $n(s); + A.CssSyntaxError = Au; + A.Declaration = Pn; + A.Container = Du; + A.Processor = Ts; + A.Document = $n; + A.Comment = Ln; + A.Warning = ku; + A.AtRule = Fn; + A.Result = Pu; + A.Input = $u; + A.Rule = Un; + A.Root = Bn; + A.Node = Uu; + Ou.registerPostcss(A); + var Bu = A; + A.default = A; + var L = Ja(Bu); + L.stringify; + L.fromJSON; + L.plugin; + L.parse; + L.list; + L.document; + L.comment; + L.atRule; + L.rule; + L.decl; + L.root; + L.CssSyntaxError; + L.Declaration; + L.Container; + L.Processor; + L.Document; + L.Comment; + L.Warning; + L.AtRule; + L.Result; + L.Input; + L.Rule; + L.Root; + L.Node; + var Wu = Object.defineProperty, + zu = (s, e, t) => + e in s + ? Wu(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) + : (s[e] = t), + ee = (s, e, t) => zu(s, typeof e != 'symbol' ? e + '' : e, t); + function Vu(s) { + return s && s.__esModule && Object.hasOwn(s, 'default') ? s.default : s; + } + function Gu(s) { + if (s.__esModule) { + return s; + } + var e = s.default; + if (typeof e == 'function') { + var t = function r() { + return this instanceof r + ? Reflect.construct(e, arguments, this.constructor) + : e.apply(this, arguments); + }; + t.prototype = e.prototype; + } else { + t = {}; + } + return ( + Object.defineProperty(t, '__esModule', { value: !0 }), + Object.keys(s).forEach((r) => { + var i = Object.getOwnPropertyDescriptor(s, r); + Object.defineProperty( + t, + r, + i.get + ? i + : { + enumerable: !0, + get() { + return s[r]; + }, + } + ); + }), + t + ); + } + var _s = { exports: {} }, + $ = String, + Wn = () => ({ + isColorSupported: !1, + reset: $, + bold: $, + dim: $, + italic: $, + underline: $, + inverse: $, + hidden: $, + strikethrough: $, + black: $, + red: $, + green: $, + yellow: $, + blue: $, + magenta: $, + cyan: $, + white: $, + gray: $, + bgBlack: $, + bgRed: $, + bgGreen: $, + bgYellow: $, + bgBlue: $, + bgMagenta: $, + bgCyan: $, + bgWhite: $, + }); + _s.exports = Wn(); + _s.exports.createColors = Wn; + var ju = _s.exports, + Hu = {}, + Yu = Object.freeze( + Object.defineProperty( + { __proto__: null, default: Hu }, + Symbol.toStringTag, + { value: 'Module' } + ) + ), + ie = Gu(Yu), + wi = ju, + bi = ie, + Zr = class zn extends Error { + constructor(e, t, r, i, n, o) { + super(e), + (this.name = 'CssSyntaxError'), + (this.reason = e), + n && (this.file = n), + i && (this.source = i), + o && (this.plugin = o), + typeof t < 'u' && + typeof r < 'u' && + (typeof t == 'number' + ? ((this.line = t), (this.column = r)) + : ((this.line = t.line), + (this.column = t.column), + (this.endLine = r.line), + (this.endColumn = r.column))), + this.setMessage(), + Error.captureStackTrace && Error.captureStackTrace(this, zn); + } + setMessage() { + (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(e) { + if (!this.source) { + return ''; + } + let t = this.source; + e == null && (e = wi.isColorSupported), bi && e && (t = bi(t)); + let r = t.split(/\r?\n/), + i = Math.max(this.line - 3, 0), + n = Math.min(this.line + 2, r.length), + o = String(n).length, + l, + a; + if (e) { + const { bold: u, gray: c, red: f } = wi.createColors(!0); + (l = (p) => u(f(p))), (a = (p) => c(p)); + } else { + l = a = (u) => u; + } + return r + .slice(i, n) + .map((u, c) => { + const f = i + 1 + c, + p = ' ' + (' ' + f).slice(-o) + ' | '; + if (f === this.line) { + const g = + a(p.replace(/\d/g, ' ')) + + u.slice(0, this.column - 1).replace(/[^\t]/g, ' '); + return ( + l('>') + + a(p) + + u + + ` + ` + + g + + l('^') + ); + } + return ' ' + a(p) + u; + }) + .join(` +`); + } + toString() { + let e = this.showSourceCode(); + return ( + e && + (e = + ` -`+e+` -`),this.name+": "+this.message+e}},ks=Zr;Zr.default=Zr;var ot={};ot.isClean=Symbol("isClean");ot.my=Symbol("my");var Si={after:` -`,beforeClose:` -`,beforeComment:` -`,beforeDecl:` -`,beforeOpen:" ",beforeRule:` -`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Zu(s){return s[0].toUpperCase()+s.slice(1)}var Xr=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(` -`)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Si[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(` -`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(` -`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(` -`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(` -`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(` -`);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},Vn=Xr;Xr.default=Xr;var Xu=Vn;function Jr(s,e){new Xu(e).stringify(s)}var lr=Jr;Jr.default=Jr;var{isClean:Ct,my:Ju}=ot,Ku=ks,Qu=Vn,qu=lr;function Kr(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Kr(o,t)):(n==="object"&&i!==null&&(i=Kr(i)),t[r]=i)}return t}var Qr=class{constructor(e={}){this.raws={},this[Ct]=!1,this[Ju]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Kr(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Ku(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Ct]){this[Ct]=!1;let e=this;for(;e=e.parent;)e[Ct]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;otypeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=qu){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},ur=Qr;Qr.default=Qr;var ec=ur,qr=class extends ec{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},cr=qr;qr.default=qr;var tc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",rc=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},sc=(s=21)=>{let e="",t=s;for(;t--;)e+=tc[Math.random()*64|0];return e},ic={nanoid:sc,customAlphabet:rc},{SourceMapConsumer:vi,SourceMapGenerator:Ci}=ie,{existsSync:nc,readFileSync:oc}=ie,{dirname:Er,join:ac}=ie;function lc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var es=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Er(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new vi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return lc(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Er(e),nc(e))return this.mapFile=e,oc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof vi)return Ci.fromSourceMap(t).toString();if(t instanceof Ci)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=ac(Er(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Gn=es;es.default=es;var{SourceMapConsumer:uc,SourceMapGenerator:cc}=ie,{fileURLToPath:Ii,pathToFileURL:It}=ie,{isAbsolute:ts,resolve:rs}=ie,{nanoid:hc}=ic,xr=ie,Ei=ks,fc=Gn,Mr=Symbol("fromOffsetCache"),dc=!!(uc&&cc),xi=!!(rs&&ts),Xt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!xi||/^\w+:\/\//.test(t.from)||ts(t.from)?this.file=t.from:this.file=rs(t.from)),xi&&dc){let r=new fc(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let f=this.fromOffset(u.offset);t=f.line,r=f.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let f=this.fromOffset(c.offset);o=f.line,l=f.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Ei(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Ei(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(It&&(n.input.url=It(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Mr])r=this[Mr];else{let n=this.css.split(` -`);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l=t)i=r.length-1;else{let n=r.length-2,o;for(;i>1),e=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:rs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;ts(o.source)?a=It(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||It(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Ii)u.file=Ii(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},hr=Xt;Xt.default=Xt;xr&&xr.registerInput&&xr.registerInput(Xt);var{SourceMapConsumer:jn,SourceMapGenerator:$t}=ie,{dirname:Lt,relative:Hn,resolve:Yn,sep:Zn}=ie,{pathToFileURL:Mi}=ie,pc=hr,mc=!!(jn&&$t),gc=!!(Lt&&Yn&&Hn&&Zn),yc=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=` -`;this.css.includes(`\r -`)&&(t=`\r -`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Lt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new jn(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),gc&&mc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=$t.fromSourceMap(e,{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)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new $t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(` -`),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Lt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Lt(Yn(r,this.mapOpts.annotation)));let i=Hn(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new pc(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Mi){let r=Mi(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Zn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Xn=yc,wc=ur,ss=class extends wc{constructor(e){super(e),this.type="comment"}},fr=ss;ss.default=ss;var{isClean:Jn,my:Kn}=ot,Qn=cr,qn=fr,bc=ur,eo,Ps,$s,to;function ro(s){return s.map(e=>(e.nodes&&(e.nodes=ro(e.nodes)),delete e.source,e))}function so(s){if(s[Jn]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)so(e)}var he=class io extends bc{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Qn(e)]}else if(e.selector)e=[new Ps(e)];else if(e.name)e=[new $s(e)];else if(e.text)e=[new qn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Kn]||io.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Jn]&&so(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};he.registerParse=s=>{eo=s};he.registerRule=s=>{Ps=s};he.registerAtRule=s=>{$s=s};he.registerRoot=s=>{to=s};var Ce=he;he.default=he;he.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,$s.prototype):s.type==="rule"?Object.setPrototypeOf(s,Ps.prototype):s.type==="decl"?Object.setPrototypeOf(s,Qn.prototype):s.type==="comment"?Object.setPrototypeOf(s,qn.prototype):s.type==="root"&&Object.setPrototypeOf(s,to.prototype),s[Kn]=!0,s.nodes&&s.nodes.forEach(e=>{he.rebuild(e)})};var Sc=Ce,no,oo,qe=class extends Sc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new no(new oo,this,e).stringify()}};qe.registerLazyResult=s=>{no=s};qe.registerProcessor=s=>{oo=s};var Ls=qe;qe.default=qe;var Ni={},ao=function(e){Ni[e]||(Ni[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))},is=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},lo=is;is.default=is;var vc=lo,ns=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new vc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Fs=ns;ns.default=ns;var Nr=39,Ri=34,Et=92,Ai=47,xt=10,ze=32,Mt=12,Nt=9,Rt=13,Cc=91,Ic=93,Ec=40,xc=41,Mc=123,Nc=125,Rc=59,Ac=42,Oc=58,Dc=64,At=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ot=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Tc=/.[\r\n"'(/\\]/,Oi=/[\da-f]/i,_c=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,f,p,g,m,d=r.length,h=0,b=[],S=[];function y(){return h}function v(_){throw e.error("Unclosed "+_,h)}function N(){return S.length===0&&h>=d}function D(_){if(S.length)return S.pop();if(h>=d)return;let V=_?_.ignoreUnclosed:!1;switch(n=r.charCodeAt(h),n){case xt:case ze:case Nt:case Rt:case Mt:{o=h;do o+=1,n=r.charCodeAt(o);while(n===ze||n===xt||n===Nt||n===Rt||n===Mt);m=["space",r.slice(h,o)],h=o-1;break}case Cc:case Ic:case Mc:case Nc:case Oc:case Rc:case xc:{let H=String.fromCharCode(n);m=[H,H,h];break}case Ec:{if(p=b.length?b.pop()[1]:"",g=r.charCodeAt(h+1),p==="url"&&g!==Nr&&g!==Ri&&g!==ze&&g!==xt&&g!==Nt&&g!==Mt&&g!==Rt){o=h;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||V){o=h;break}else v("bracket");for(f=o;r.charCodeAt(f-1)===Et;)f-=1,c=!c}while(c);m=["brackets",r.slice(h,o+1),h,o],h=o}else o=r.indexOf(")",h+1),a=r.slice(h,o+1),o===-1||Tc.test(a)?m=["(","(",h]:(m=["brackets",a,h,o],h=o);break}case Nr:case Ri:{l=n===Nr?"'":'"',o=h;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||V){o=h+1;break}else v("string");for(f=o;r.charCodeAt(f-1)===Et;)f-=1,c=!c}while(c);m=["string",r.slice(h,o+1),h,o],h=o;break}case Dc:{At.lastIndex=h+1,At.test(r),At.lastIndex===0?o=r.length-1:o=At.lastIndex-2,m=["at-word",r.slice(h,o+1),h,o],h=o;break}case Et:{for(o=h,u=!0;r.charCodeAt(o+1)===Et;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==Ai&&n!==ze&&n!==xt&&n!==Nt&&n!==Rt&&n!==Mt&&(o+=1,Oi.test(r.charAt(o)))){for(;Oi.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===ze&&(o+=1)}m=["word",r.slice(h,o+1),h,o],h=o;break}default:{n===Ai&&r.charCodeAt(h+1)===Ac?(o=r.indexOf("*/",h+2)+1,o===0&&(i||V?o=r.length:v("comment")),m=["comment",r.slice(h,o+1),h,o],h=o):(Ot.lastIndex=h+1,Ot.test(r),Ot.lastIndex===0?o=r.length-1:o=Ot.lastIndex-2,m=["word",r.slice(h,o+1),h,o],b.push(m),h=o);break}}return h++,m}function z(_){S.push(_)}return{back:z,endOfFile:N,nextToken:D,position:y}},uo=Ce,Jt=class extends uo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Us=Jt;Jt.default=Jt;uo.registerAtRule(Jt);var co=Ce,ho,fo,_e=class extends co{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ho(new fo,this,e).stringify()}};_e.registerLazyResult=s=>{ho=s};_e.registerProcessor=s=>{fo=s};var at=_e;_e.default=_e;co.registerRoot(_e);var et={comma(s){return et.split(s,[","],!0)},space(s){let e=[" ",` -`," "];return et.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}},po=et;et.default=et;var mo=Ce,kc=po,Kt=class extends mo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return kc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}},Bs=Kt;Kt.default=Kt;mo.registerRule(Kt);var Pc=cr,$c=_c,Lc=fr,Fc=Us,Uc=at,Di=Bs,Ti={empty:!0,space:!0};function Bc(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Wc=class{constructor(e){this.input=e,this.root=new Uc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Fc;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Lc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=$c(this.input)}decl(e,t){let r=new Pc;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Bc(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),f="";for(let p=u;p>0;p--){let g=c[p][0];if(f.trim().indexOf("!")===0&&g!=="space")break;f=c.pop()[1]+f}f.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=f,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Di;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),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(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,f;for(let p=0;pg+m[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new Di;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;ios(e)),s}var as={},Pe=class yo{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=os(t);else if(t instanceof yo||t instanceof _i)i=os(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Qc;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Hc]&&Xc.rebuild(i)}this.result=new _i(e,i,r),this.helpers={...as,postcss:as,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!th[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!rh[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e0;){let r=this.visitTick(t);if(Ve(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return Ve(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Zc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Yc(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 e of this.plugins){let t=this.runOnRoot(e);if(Ve(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[le];)e[le]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Kc("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.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Ve(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex{i[le]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.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"}};Pe.registerPostcss=s=>{as=s};var wo=Pe;Pe.default=Pe;qc.registerLazyResult(Pe);Jc.registerLazyResult(Pe);var sh=Xn,ih=lr,nh=ao,oh=Ws,ah=Fs,ls=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=ih;this.result=new ah(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new sh(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||nh("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.")),this.async().then(e,t)}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 e,t=oh;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},lh=ls;ls.default=ls;var uh=lh,ch=wo,hh=Ls,fh=at,tt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new 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 new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new uh(this,e,t):new ch(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},dh=tt;tt.default=tt;fh.registerProcessor(tt);hh.registerProcessor(tt);var ph=cr,mh=Gn,gh=fr,yh=Us,wh=hr,bh=at,Sh=Bs;function rt(s,e){if(Array.isArray(s))return s.map(i=>rt(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:wh.prototype};n.map&&(n.map={...n.map,__proto__:mh.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>rt(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new bh(r);if(r.type==="decl")return new ph(r);if(r.type==="rule")return new Sh(r);if(r.type==="comment")return new gh(r);if(r.type==="atrule")return new yh(r);throw new Error("Unknown node type: "+s.type)}var vh=rt;rt.default=rt;var Ch=ks,bo=cr,Ih=wo,Eh=Ce,zs=dh,xh=lr,Mh=vh,So=Ls,Nh=lo,vo=fr,Co=Us,Rh=Fs,Ah=hr,Oh=Ws,Dh=po,Io=Bs,Eo=at,Th=ur;function O(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new zs(s)}O.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide: -https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357: -https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new zs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return O([i(a)]).process(o,l)},i};O.stringify=xh;O.parse=Oh;O.fromJSON=Mh;O.list=Dh;O.comment=s=>new vo(s);O.atRule=s=>new Co(s);O.decl=s=>new bo(s);O.rule=s=>new Io(s);O.root=s=>new Eo(s);O.document=s=>new So(s);O.CssSyntaxError=Ch;O.Declaration=bo;O.Container=Eh;O.Processor=zs;O.Document=So;O.Comment=vo;O.Warning=Nh;O.AtRule=Co;O.Result=Rh;O.Input=Ah;O.Rule=Io;O.Root=Eo;O.Node=Th;Ih.registerPostcss(O);var _h=O;O.default=O;var F=Vu(_h);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var us=class s{constructor(...e){ee(this,"parentElement",null),ee(this,"parentNode",null),ee(this,"ownerDocument"),ee(this,"firstChild",null),ee(this,"lastChild",null),ee(this,"previousSibling",null),ee(this,"nextSibling",null),ee(this,"ELEMENT_NODE",1),ee(this,"TEXT_NODE",3),ee(this,"nodeType"),ee(this,"nodeName"),ee(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var Pi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$i={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dt={},kh=()=>!!globalThis.Zone;function Vs(s){if(Dt[s])return Dt[s];let e=globalThis[s],t=e.prototype,r=s in Pi?Pi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in $i?$i[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!kh())return Dt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Dt[s]=u:t}catch{return t}}var Rr={};function de(s,e,t){var r;let i=`${s}.${String(t)}`;if(Rr[i])return Rr[i].call(e);let n=Vs(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Rr[i]=o,o.call(e)):e[t]}var Ar={};function xo(s,e,t){let r=`${s}.${String(t)}`;if(Ar[r])return Ar[r].bind(e);let n=Vs(s)[t];return typeof n!="function"?e[t]:(Ar[r]=n,n.bind(e))}function Ph(s){return de("Node",s,"ownerDocument")}function $h(s){return de("Node",s,"childNodes")}function Lh(s){return de("Node",s,"parentNode")}function Fh(s){return de("Node",s,"parentElement")}function Uh(s){return de("Node",s,"textContent")}function Bh(s,e){return xo("Node",s,"contains")(e)}function Wh(s){return xo("Node",s,"getRootNode")()}function zh(s){return!s||!("host"in s)?null:de("ShadowRoot",s,"host")}function Vh(s){return s.styleSheets}function Gh(s){return!s||!("shadowRoot"in s)?null:de("Element",s,"shadowRoot")}function jh(s,e){return de("Element",s,"querySelector")(e)}function Hh(s,e){return de("Element",s,"querySelectorAll")(e)}function Mo(){return Vs("MutationObserver").constructor}function Ie(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var C={ownerDocument:Ph,childNodes:$h,parentNode:Lh,parentElement:Fh,textContent:Uh,contains:Bh,getRootNode:Wh,host:zh,styleSheets:Vh,shadowRoot:Gh,querySelector:jh,querySelectorAll:Hh,mutationObserver:Mo,patch:Ie};function Z(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var xe=`Please stop import mirror directly. Instead of that,\r +` + + e + + ` +`), + this.name + ': ' + this.message + e + ); + } + }, + ks = Zr; + Zr.default = Zr; + var ot = {}; + ot.isClean = Symbol('isClean'); + ot.my = Symbol('my'); + var Si = { + after: ` +`, + beforeClose: ` +`, + beforeComment: ` +`, + beforeDecl: ` +`, + beforeOpen: ' ', + beforeRule: ` +`, + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: !1, + }; + function Zu(s) { + return s[0].toUpperCase() + s.slice(1); + } + var Xr = class { + constructor(e) { + this.builder = e; + } + atrule(e, t) { + let r = '@' + e.name, + i = e.params ? this.rawValue(e, 'params') : ''; + if ( + (typeof e.raws.afterName < 'u' + ? (r += e.raws.afterName) + : i && (r += ' '), + e.nodes) + ) { + this.block(e, r + i); + } else { + const n = (e.raws.between || '') + (t ? ';' : ''); + this.builder(r + i + n, e); + } + } + beforeAfter(e, t) { + let r; + e.type === 'decl' + ? (r = this.raw(e, null, 'beforeDecl')) + : e.type === 'comment' + ? (r = this.raw(e, null, 'beforeComment')) + : t === 'before' + ? (r = this.raw(e, null, 'beforeRule')) + : (r = this.raw(e, null, 'beforeClose')); + let i = e.parent, + n = 0; + while (i && i.type !== 'root') { + (n += 1), (i = i.parent); + } + if ( + r.includes(` +`) + ) { + const o = this.raw(e, null, 'indent'); + if (o.length) { + for (let l = 0; l < n; l++) { + r += o; + } + } + } + return r; + } + block(e, t) { + const r = this.raw(e, 'between', 'beforeOpen'); + this.builder(t + r + '{', e, 'start'); + let i; + e.nodes && e.nodes.length + ? (this.body(e), (i = this.raw(e, 'after'))) + : (i = this.raw(e, 'after', 'emptyBody')), + i && this.builder(i), + this.builder('}', e, 'end'); + } + body(e) { + let t = e.nodes.length - 1; + while (t > 0 && e.nodes[t].type === 'comment') { + t -= 1; + } + const r = this.raw(e, 'semicolon'); + for (let i = 0; i < e.nodes.length; i++) { + const n = e.nodes[i], + o = this.raw(n, 'before'); + o && this.builder(o), this.stringify(n, t !== i || r); + } + } + comment(e) { + const t = this.raw(e, 'left', 'commentLeft'), + r = this.raw(e, 'right', 'commentRight'); + this.builder('/*' + t + e.text + r + '*/', e); + } + decl(e, t) { + let r = this.raw(e, 'between', 'colon'), + i = e.prop + r + this.rawValue(e, 'value'); + e.important && (i += e.raws.important || ' !important'), + t && (i += ';'), + this.builder(i, e); + } + document(e) { + this.body(e); + } + raw(e, t, r) { + let i; + if ((r || (r = t), t && ((i = e.raws[t]), typeof i < 'u'))) { + return i; + } + const n = e.parent; + if ( + r === 'before' && + (!n || + (n.type === 'root' && n.first === e) || + (n && n.type === 'document')) + ) { + return ''; + } + if (!n) { + return Si[r]; + } + const o = e.root(); + if ((o.rawCache || (o.rawCache = {}), typeof o.rawCache[r] < 'u')) { + return o.rawCache[r]; + } + if (r === 'before' || r === 'after') { + return this.beforeAfter(e, r); + } + { + const l = 'raw' + Zu(r); + this[l] + ? (i = this[l](o, e)) + : o.walk((a) => { + if (((i = a.raws[t]), typeof i < 'u')) { + return !1; + } + }); + } + return typeof i > 'u' && (i = Si[r]), (o.rawCache[r] = i), i; + } + rawBeforeClose(e) { + let t; + return ( + e.walk((r) => { + if (r.nodes && r.nodes.length > 0 && typeof r.raws.after < 'u') { + return ( + (t = r.raws.after), + t.includes(` +`) && (t = t.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + t && (t = t.replace(/\S/g, '')), + t + ); + } + rawBeforeComment(e, t) { + let r; + return ( + e.walkComments((i) => { + if (typeof i.raws.before < 'u') { + return ( + (r = i.raws.before), + r.includes(` +`) && (r = r.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + typeof r > 'u' + ? (r = this.raw(t, null, 'beforeDecl')) + : r && (r = r.replace(/\S/g, '')), + r + ); + } + rawBeforeDecl(e, t) { + let r; + return ( + e.walkDecls((i) => { + if (typeof i.raws.before < 'u') { + return ( + (r = i.raws.before), + r.includes(` +`) && (r = r.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + typeof r > 'u' + ? (r = this.raw(t, null, 'beforeRule')) + : r && (r = r.replace(/\S/g, '')), + r + ); + } + rawBeforeOpen(e) { + let t; + return ( + e.walk((r) => { + if (r.type !== 'decl' && ((t = r.raws.between), typeof t < 'u')) { + return !1; + } + }), + t + ); + } + rawBeforeRule(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + (r.parent !== e || e.first !== r) && + typeof r.raws.before < 'u' + ) { + return ( + (t = r.raws.before), + t.includes(` +`) && (t = t.replace(/[^\n]+$/, '')), + !1 + ); + } + }), + t && (t = t.replace(/\S/g, '')), + t + ); + } + rawColon(e) { + let t; + return ( + e.walkDecls((r) => { + if (typeof r.raws.between < 'u') { + return (t = r.raws.between.replace(/[^\s:]/g, '')), !1; + } + }), + t + ); + } + rawEmptyBody(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + r.nodes.length === 0 && + ((t = r.raws.after), typeof t < 'u') + ) { + return !1; + } + }), + t + ); + } + rawIndent(e) { + if (e.raws.indent) { + return e.raws.indent; + } + let t; + return ( + e.walk((r) => { + const i = r.parent; + if ( + i && + i !== e && + i.parent && + i.parent === e && + typeof r.raws.before < 'u' + ) { + const n = r.raws.before.split(` +`); + return (t = n[n.length - 1]), (t = t.replace(/\S/g, '')), !1; + } + }), + t + ); + } + rawSemicolon(e) { + let t; + return ( + e.walk((r) => { + if ( + r.nodes && + r.nodes.length && + r.last.type === 'decl' && + ((t = r.raws.semicolon), typeof t < 'u') + ) { + return !1; + } + }), + t + ); + } + rawValue(e, t) { + const r = e[t], + i = e.raws[t]; + return i && i.value === r ? i.raw : r; + } + root(e) { + this.body(e), e.raws.after && this.builder(e.raws.after); + } + rule(e) { + this.block(e, this.rawValue(e, 'selector')), + e.raws.ownSemicolon && this.builder(e.raws.ownSemicolon, e, 'end'); + } + stringify(e, t) { + if (!this[e.type]) { + throw new Error( + 'Unknown AST node type ' + + e.type + + '. Maybe you need to change PostCSS stringifier.' + ); + } + this[e.type](e, t); + } + }, + Vn = Xr; + Xr.default = Xr; + var Xu = Vn; + function Jr(s, e) { + new Xu(e).stringify(s); + } + var lr = Jr; + Jr.default = Jr; + var { isClean: Ct, my: Ju } = ot, + Ku = ks, + Qu = Vn, + qu = lr; + function Kr(s, e) { + const t = new s.constructor(); + for (const r in s) { + if (!Object.hasOwn(s, r) || r === 'proxyCache') { + continue; + } + let i = s[r], + n = typeof i; + r === 'parent' && n === 'object' + ? e && (t[r] = e) + : r === 'source' + ? (t[r] = i) + : Array.isArray(i) + ? (t[r] = i.map((o) => Kr(o, t))) + : (n === 'object' && i !== null && (i = Kr(i)), (t[r] = i)); + } + return t; + } + var Qr = class { + constructor(e = {}) { + (this.raws = {}), (this[Ct] = !1), (this[Ju] = !0); + for (const t in e) { + if (t === 'nodes') { + this.nodes = []; + for (const r of e[t]) { + typeof r.clone == 'function' + ? this.append(r.clone()) + : this.append(r); + } + } else { + this[t] = e[t]; + } + } + } + addToError(e) { + if ( + ((e.postcssNode = this), + e.stack && this.source && /\n\s{4}at /.test(e.stack)) + ) { + const t = this.source; + e.stack = e.stack.replace( + /\n\s{4}at /, + `$&${t.input.from}:${t.start.line}:${t.start.column}$&` + ); + } + return e; + } + after(e) { + return this.parent.insertAfter(this, e), this; + } + assign(e = {}) { + for (const t in e) { + this[t] = e[t]; + } + return this; + } + before(e) { + return this.parent.insertBefore(this, e), this; + } + cleanRaws(e) { + delete this.raws.before, + delete this.raws.after, + e || delete this.raws.between; + } + clone(e = {}) { + const t = Kr(this); + for (const r in e) { + t[r] = e[r]; + } + return t; + } + cloneAfter(e = {}) { + const t = this.clone(e); + return this.parent.insertAfter(this, t), t; + } + cloneBefore(e = {}) { + const t = this.clone(e); + return this.parent.insertBefore(this, t), t; + } + error(e, t = {}) { + if (this.source) { + const { end: r, start: i } = this.rangeBy(t); + return this.source.input.error( + e, + { column: i.column, line: i.line }, + { column: r.column, line: r.line }, + t + ); + } + return new Ku(e); + } + getProxyProcessor() { + return { + get(e, t) { + return t === 'proxyOf' + ? e + : t === 'root' + ? () => e.root().toProxy() + : e[t]; + }, + set(e, t, r) { + return ( + e[t] === r || + ((e[t] = r), + (t === 'prop' || + t === 'value' || + t === 'name' || + t === 'params' || + t === 'important' || + t === 'text') && + e.markDirty()), + !0 + ); + }, + }; + } + markDirty() { + if (this[Ct]) { + this[Ct] = !1; + let e = this; + while ((e = e.parent)) { + e[Ct] = !1; + } + } + } + next() { + if (!this.parent) { + return; + } + const e = this.parent.index(this); + return this.parent.nodes[e + 1]; + } + positionBy(e, t) { + let r = this.source.start; + if (e.index) { + r = this.positionInside(e.index, t); + } else if (e.word) { + t = this.toString(); + const i = t.indexOf(e.word); + i !== -1 && (r = this.positionInside(i, t)); + } + return r; + } + positionInside(e, t) { + let r = t || this.toString(), + i = this.source.start.column, + n = this.source.start.line; + for (let o = 0; o < e; o++) { + r[o] === + ` +` + ? ((i = 1), (n += 1)) + : (i += 1); + } + return { column: i, line: n }; + } + prev() { + if (!this.parent) { + return; + } + const e = this.parent.index(this); + return this.parent.nodes[e - 1]; + } + rangeBy(e) { + let t = { + column: this.source.start.column, + line: this.source.start.line, + }, + r = this.source.end + ? { column: this.source.end.column + 1, line: this.source.end.line } + : { column: t.column + 1, line: t.line }; + if (e.word) { + const i = this.toString(), + n = i.indexOf(e.word); + n !== -1 && + ((t = this.positionInside(n, i)), + (r = this.positionInside(n + e.word.length, i))); + } else { + e.start + ? (t = { column: e.start.column, line: e.start.line }) + : e.index && (t = this.positionInside(e.index)), + e.end + ? (r = { column: e.end.column, line: e.end.line }) + : typeof e.endIndex == 'number' + ? (r = this.positionInside(e.endIndex)) + : e.index && (r = this.positionInside(e.index + 1)); + } + return ( + (r.line < t.line || (r.line === t.line && r.column <= t.column)) && + (r = { column: t.column + 1, line: t.line }), + { end: r, start: t } + ); + } + raw(e, t) { + return new Qu().raw(this, e, t); + } + remove() { + return ( + this.parent && this.parent.removeChild(this), + (this.parent = void 0), + this + ); + } + replaceWith(...e) { + if (this.parent) { + let t = this, + r = !1; + for (const i of e) { + i === this + ? (r = !0) + : r + ? (this.parent.insertAfter(t, i), (t = i)) + : this.parent.insertBefore(t, i); + } + r || this.remove(); + } + return this; + } + root() { + let e = this; + while (e.parent && e.parent.type !== 'document') { + e = e.parent; + } + return e; + } + toJSON(e, t) { + const r = {}, + i = t == null; + t = t || new Map(); + let n = 0; + for (const o in this) { + if (!Object.hasOwn(this, o) || o === 'parent' || o === 'proxyCache') { + continue; + } + const l = this[o]; + if (Array.isArray(l)) { + r[o] = l.map((a) => + typeof a == 'object' && a.toJSON ? a.toJSON(null, t) : a + ); + } else if (typeof l == 'object' && l.toJSON) { + r[o] = l.toJSON(null, t); + } else if (o === 'source') { + let a = t.get(l.input); + a == null && ((a = n), t.set(l.input, n), n++), + (r[o] = { end: l.end, inputId: a, start: l.start }); + } else { + r[o] = l; + } + } + return i && (r.inputs = [...t.keys()].map((o) => o.toJSON())), r; + } + toProxy() { + return ( + this.proxyCache || + (this.proxyCache = new Proxy(this, this.getProxyProcessor())), + this.proxyCache + ); + } + toString(e = qu) { + e.stringify && (e = e.stringify); + let t = ''; + return ( + e(this, (r) => { + t += r; + }), + t + ); + } + warn(e, t, r) { + const i = { node: this }; + for (const n in r) { + i[n] = r[n]; + } + return e.warn(t, i); + } + get proxyOf() { + return this; + } + }, + ur = Qr; + Qr.default = Qr; + var ec = ur, + qr = class extends ec { + constructor(e) { + e && + typeof e.value < 'u' && + typeof e.value != 'string' && + (e = { ...e, value: String(e.value) }), + super(e), + (this.type = 'decl'); + } + get variable() { + return this.prop.startsWith('--') || this.prop[0] === '$'; + } + }, + cr = qr; + qr.default = qr; + var tc = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict', + rc = + (s, e = 21) => + (t = e) => { + let r = '', + i = t; + while (i--) { + r += s[(Math.random() * s.length) | 0]; + } + return r; + }, + sc = (s = 21) => { + let e = '', + t = s; + while (t--) { + e += tc[(Math.random() * 64) | 0]; + } + return e; + }, + ic = { nanoid: sc, customAlphabet: rc }, + { SourceMapConsumer: vi, SourceMapGenerator: Ci } = ie, + { existsSync: nc, readFileSync: oc } = ie, + { dirname: Er, join: ac } = ie; + function lc(s) { + return Buffer ? Buffer.from(s, 'base64').toString() : window.atob(s); + } + var es = class { + constructor(e, t) { + if (t.map === !1) { + return; + } + this.loadAnnotation(e), + (this.inline = this.startWith(this.annotation, 'data:')); + const r = t.map ? t.map.prev : void 0, + i = this.loadMap(t.from, r); + !this.mapFile && t.from && (this.mapFile = t.from), + this.mapFile && (this.root = Er(this.mapFile)), + i && (this.text = i); + } + consumer() { + return ( + this.consumerCache || (this.consumerCache = new vi(this.text)), + this.consumerCache + ); + } + decodeInline(e) { + const t = /^data:application\/json;charset=utf-?8;base64,/, + r = /^data:application\/json;base64,/, + i = /^data:application\/json;charset=utf-?8,/, + n = /^data:application\/json,/; + if (i.test(e) || n.test(e)) { + return decodeURIComponent(e.substr(RegExp.lastMatch.length)); + } + if (t.test(e) || r.test(e)) { + return lc(e.substr(RegExp.lastMatch.length)); + } + const o = e.match(/data:application\/json;([^,]+),/)[1]; + throw new Error('Unsupported source map encoding ' + o); + } + getAnnotationURL(e) { + return e.replace(/^\/\*\s*# sourceMappingURL=/, '').trim(); + } + isMap(e) { + return typeof e != 'object' + ? !1 + : typeof e.mappings == 'string' || + typeof e._mappings == 'string' || + Array.isArray(e.sections); + } + loadAnnotation(e) { + const t = e.match(/\/\*\s*# sourceMappingURL=/gm); + if (!t) { + return; + } + const r = e.lastIndexOf(t.pop()), + i = e.indexOf('*/', r); + r > -1 && + i > -1 && + (this.annotation = this.getAnnotationURL(e.substring(r, i))); + } + loadFile(e) { + if (((this.root = Er(e)), nc(e))) { + return (this.mapFile = e), oc(e, 'utf-8').toString().trim(); + } + } + loadMap(e, t) { + if (t === !1) { + return !1; + } + if (t) { + if (typeof t == 'string') { + return t; + } + if (typeof t == 'function') { + const r = t(e); + if (r) { + const i = this.loadFile(r); + if (!i) { + throw new Error( + 'Unable to load previous source map: ' + r.toString() + ); + } + return i; + } + } else { + if (t instanceof vi) { + return Ci.fromSourceMap(t).toString(); + } + if (t instanceof Ci) { + return t.toString(); + } + if (this.isMap(t)) { + return JSON.stringify(t); + } + throw new Error( + 'Unsupported previous source map format: ' + t.toString() + ); + } + } else { + if (this.inline) { + return this.decodeInline(this.annotation); + } + if (this.annotation) { + let r = this.annotation; + return e && (r = ac(Er(e), r)), this.loadFile(r); + } + } + } + startWith(e, t) { + return e ? e.substr(0, t.length) === t : !1; + } + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ); + } + }, + Gn = es; + es.default = es; + var { SourceMapConsumer: uc, SourceMapGenerator: cc } = ie, + { fileURLToPath: Ii, pathToFileURL: It } = ie, + { isAbsolute: ts, resolve: rs } = ie, + { nanoid: hc } = ic, + xr = ie, + Ei = ks, + fc = Gn, + Mr = Symbol('fromOffsetCache'), + dc = !!(uc && cc), + xi = !!(rs && ts), + Xt = class { + constructor(e, t = {}) { + if ( + e === null || + typeof e > 'u' || + (typeof e == 'object' && !e.toString) + ) { + throw new Error(`PostCSS received ${e} instead of CSS string`); + } + if ( + ((this.css = e.toString()), + this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE' + ? ((this.hasBOM = !0), (this.css = this.css.slice(1))) + : (this.hasBOM = !1), + t.from && + (!xi || /^\w+:\/\//.test(t.from) || ts(t.from) + ? (this.file = t.from) + : (this.file = rs(t.from))), + xi && dc) + ) { + const r = new fc(this.css, t); + if (r.text) { + this.map = r; + const i = r.consumer().file; + !this.file && i && (this.file = this.mapResolve(i)); + } + } + this.file || (this.id = ''), + this.map && (this.map.file = this.from); + } + error(e, t, r, i = {}) { + let n, o, l; + if (t && typeof t == 'object') { + const u = t, + c = r; + if (typeof u.offset == 'number') { + const f = this.fromOffset(u.offset); + (t = f.line), (r = f.col); + } else { + (t = u.line), (r = u.column); + } + if (typeof c.offset == 'number') { + const f = this.fromOffset(c.offset); + (o = f.line), (l = f.col); + } else { + (o = c.line), (l = c.column); + } + } else if (!r) { + const u = this.fromOffset(t); + (t = u.line), (r = u.col); + } + const a = this.origin(t, r, o, l); + return ( + a + ? (n = new Ei( + e, + a.endLine === void 0 + ? a.line + : { column: a.column, line: a.line }, + a.endLine === void 0 + ? a.column + : { column: a.endColumn, line: a.endLine }, + a.source, + a.file, + i.plugin + )) + : (n = new Ei( + e, + o === void 0 ? t : { column: r, line: t }, + o === void 0 ? r : { column: l, line: o }, + this.css, + this.file, + i.plugin + )), + (n.input = { + column: r, + endColumn: l, + endLine: o, + line: t, + source: this.css, + }), + this.file && + (It && (n.input.url = It(this.file).toString()), + (n.input.file = this.file)), + n + ); + } + fromOffset(e) { + let t, r; + if (this[Mr]) { + r = this[Mr]; + } else { + const n = this.css.split(` +`); + r = new Array(n.length); + let o = 0; + for (let l = 0, a = n.length; l < a; l++) { + (r[l] = o), (o += n[l].length + 1); + } + this[Mr] = r; + } + t = r[r.length - 1]; + let i = 0; + if (e >= t) { + i = r.length - 1; + } else { + let n = r.length - 2, + o; + while (i < n) { + if (((o = i + ((n - i) >> 1)), e < r[o])) { + n = o - 1; + } else if (e >= r[o + 1]) { + i = o + 1; + } else { + i = o; + break; + } + } + } + return { col: e - r[i] + 1, line: i + 1 }; + } + mapResolve(e) { + return /^\w+:\/\//.test(e) + ? e + : rs(this.map.consumer().sourceRoot || this.map.root || '.', e); + } + origin(e, t, r, i) { + if (!this.map) { + return !1; + } + const n = this.map.consumer(), + o = n.originalPositionFor({ column: t, line: e }); + if (!o.source) { + return !1; + } + let l; + typeof r == 'number' && + (l = n.originalPositionFor({ column: i, line: r })); + let a; + ts(o.source) + ? (a = It(o.source)) + : (a = new URL( + o.source, + this.map.consumer().sourceRoot || It(this.map.mapFile) + )); + const u = { + column: o.column, + endColumn: l && l.column, + endLine: l && l.line, + line: o.line, + url: a.toString(), + }; + if (a.protocol === 'file:') { + if (Ii) { + u.file = Ii(a); + } else { + throw new Error( + 'file: protocol is not available in this PostCSS build' + ); + } + } + const c = n.sourceContentFor(o.source); + return c && (u.source = c), u; + } + toJSON() { + const e = {}; + for (const t of ['hasBOM', 'css', 'file', 'id']) { + this[t] != null && (e[t] = this[t]); + } + return ( + this.map && + ((e.map = { ...this.map }), + e.map.consumerCache && (e.map.consumerCache = void 0)), + e + ); + } + get from() { + return this.file || this.id; + } + }, + hr = Xt; + Xt.default = Xt; + xr && xr.registerInput && xr.registerInput(Xt); + var { SourceMapConsumer: jn, SourceMapGenerator: $t } = ie, + { dirname: Lt, relative: Hn, resolve: Yn, sep: Zn } = ie, + { pathToFileURL: Mi } = ie, + pc = hr, + mc = !!(jn && $t), + gc = !!(Lt && Yn && Hn && Zn), + yc = class { + constructor(e, t, r, i) { + (this.stringify = e), + (this.mapOpts = r.map || {}), + (this.root = t), + (this.opts = r), + (this.css = i), + (this.originalCSS = i), + (this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute), + (this.memoizedFileURLs = new Map()), + (this.memoizedPaths = new Map()), + (this.memoizedURLs = new Map()); + } + addAnnotation() { + let e; + this.isInline() + ? (e = + 'data:application/json;base64,' + + this.toBase64(this.map.toString())) + : typeof this.mapOpts.annotation == 'string' + ? (e = this.mapOpts.annotation) + : typeof this.mapOpts.annotation == 'function' + ? (e = this.mapOpts.annotation(this.opts.to, this.root)) + : (e = this.outputFile() + '.map'); + let t = ` +`; + this.css.includes(`\r +`) && + (t = `\r +`), + (this.css += t + '/*# sourceMappingURL=' + e + ' */'); + } + applyPrevMaps() { + for (const e of this.previous()) { + let t = this.toUrl(this.path(e.file)), + r = e.root || Lt(e.file), + i; + this.mapOpts.sourcesContent === !1 + ? ((i = new jn(e.text)), + i.sourcesContent && (i.sourcesContent = null)) + : (i = e.consumer()), + this.map.applySourceMap(i, t, this.toUrl(this.path(r))); + } + } + clearAnnotation() { + if (this.mapOpts.annotation !== !1) { + if (this.root) { + let e; + for (let t = this.root.nodes.length - 1; t >= 0; t--) { + (e = this.root.nodes[t]), + e.type === 'comment' && + e.text.indexOf('# sourceMappingURL=') === 0 && + this.root.removeChild(t); + } + } else { + this.css && + (this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, '')); + } + } + } + generate() { + if ((this.clearAnnotation(), gc && mc && this.isMap())) { + return this.generateMap(); + } + { + let e = ''; + return ( + this.stringify(this.root, (t) => { + e += t; + }), + [e] + ); + } + } + generateMap() { + if (this.root) { + this.generateString(); + } else if (this.previous().length === 1) { + const e = this.previous()[0].consumer(); + (e.file = this.outputFile()), + (this.map = $t.fromSourceMap(e, { 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)) + : '', + }); + } + return ( + this.isSourcesContent() && this.setSourcesContent(), + this.root && this.previous().length > 0 && this.applyPrevMaps(), + this.isAnnotation() && this.addAnnotation(), + this.isInline() ? [this.css] : [this.css, this.map] + ); + } + generateString() { + (this.css = ''), + (this.map = new $t({ + file: this.outputFile(), + ignoreInvalidMapping: !0, + })); + let e = 1, + t = 1, + r = '', + i = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '', + }, + n, + o; + this.stringify(this.root, (l, a, u) => { + if ( + ((this.css += l), + a && + u !== 'end' && + ((i.generated.line = e), + (i.generated.column = t - 1), + a.source && a.source.start + ? ((i.source = this.sourcePath(a)), + (i.original.line = a.source.start.line), + (i.original.column = a.source.start.column - 1), + this.map.addMapping(i)) + : ((i.source = r), + (i.original.line = 1), + (i.original.column = 0), + this.map.addMapping(i))), + (n = l.match(/\n/g)), + n + ? ((e += n.length), + (o = l.lastIndexOf(` +`)), + (t = l.length - o)) + : (t += l.length), + a && u !== 'start') + ) { + const c = a.parent || { raws: {} }; + (!(a.type === 'decl' || (a.type === 'atrule' && !a.nodes)) || + a !== c.last || + c.raws.semicolon) && + (a.source && a.source.end + ? ((i.source = this.sourcePath(a)), + (i.original.line = a.source.end.line), + (i.original.column = a.source.end.column - 1), + (i.generated.line = e), + (i.generated.column = t - 2), + this.map.addMapping(i)) + : ((i.source = r), + (i.original.line = 1), + (i.original.column = 0), + (i.generated.line = e), + (i.generated.column = t - 1), + this.map.addMapping(i))); + } + }); + } + isAnnotation() { + return this.isInline() + ? !0 + : typeof this.mapOpts.annotation < 'u' + ? this.mapOpts.annotation + : this.previous().length + ? this.previous().some((e) => e.annotation) + : !0; + } + isInline() { + if (typeof this.mapOpts.inline < 'u') { + return this.mapOpts.inline; + } + const e = this.mapOpts.annotation; + return typeof e < 'u' && e !== !0 + ? !1 + : this.previous().length + ? this.previous().some((t) => t.inline) + : !0; + } + isMap() { + return typeof this.opts.map < 'u' + ? !!this.opts.map + : this.previous().length > 0; + } + isSourcesContent() { + return typeof this.mapOpts.sourcesContent < 'u' + ? this.mapOpts.sourcesContent + : this.previous().length + ? this.previous().some((e) => e.withContent()) + : !0; + } + outputFile() { + return this.opts.to + ? this.path(this.opts.to) + : this.opts.from + ? this.path(this.opts.from) + : 'to.css'; + } + path(e) { + if ( + this.mapOpts.absolute || + e.charCodeAt(0) === 60 || + /^\w+:\/\//.test(e) + ) { + return e; + } + const t = this.memoizedPaths.get(e); + if (t) { + return t; + } + let r = this.opts.to ? Lt(this.opts.to) : '.'; + typeof this.mapOpts.annotation == 'string' && + (r = Lt(Yn(r, this.mapOpts.annotation))); + const i = Hn(r, e); + return this.memoizedPaths.set(e, i), i; + } + previous() { + if (!this.previousMaps) { + if (((this.previousMaps = []), this.root)) { + this.root.walk((e) => { + if (e.source && e.source.input.map) { + const t = e.source.input.map; + this.previousMaps.includes(t) || this.previousMaps.push(t); + } + }); + } else { + const e = new pc(this.originalCSS, this.opts); + e.map && this.previousMaps.push(e.map); + } + } + return this.previousMaps; + } + setSourcesContent() { + const e = {}; + if (this.root) { + this.root.walk((t) => { + if (t.source) { + const r = t.source.input.from; + if (r && !e[r]) { + e[r] = !0; + const i = this.usesFileUrls + ? this.toFileUrl(r) + : this.toUrl(this.path(r)); + this.map.setSourceContent(i, t.source.input.css); + } + } + }); + } else if (this.css) { + const t = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : ''; + this.map.setSourceContent(t, this.css); + } + } + sourcePath(e) { + return this.mapOpts.from + ? this.toUrl(this.mapOpts.from) + : this.usesFileUrls + ? this.toFileUrl(e.source.input.from) + : this.toUrl(this.path(e.source.input.from)); + } + toBase64(e) { + return Buffer + ? Buffer.from(e).toString('base64') + : window.btoa(unescape(encodeURIComponent(e))); + } + toFileUrl(e) { + const t = this.memoizedFileURLs.get(e); + if (t) { + return t; + } + if (Mi) { + const r = Mi(e).toString(); + return this.memoizedFileURLs.set(e, r), r; + } + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ); + } + toUrl(e) { + const t = this.memoizedURLs.get(e); + if (t) { + return t; + } + Zn === '\\' && (e = e.replace(/\\/g, '/')); + const r = encodeURI(e).replace(/[#?]/g, encodeURIComponent); + return this.memoizedURLs.set(e, r), r; + } + }, + Xn = yc, + wc = ur, + ss = class extends wc { + constructor(e) { + super(e), (this.type = 'comment'); + } + }, + fr = ss; + ss.default = ss; + var { isClean: Jn, my: Kn } = ot, + Qn = cr, + qn = fr, + bc = ur, + eo, + Ps, + $s, + to; + function ro(s) { + return s.map( + (e) => (e.nodes && (e.nodes = ro(e.nodes)), delete e.source, e) + ); + } + function so(s) { + if (((s[Jn] = !1), s.proxyOf.nodes)) { + for (const e of s.proxyOf.nodes) { + so(e); + } + } + } + var he = class io extends bc { + append(...e) { + for (const t of e) { + const r = this.normalize(t, this.last); + for (const i of r) { + this.proxyOf.nodes.push(i); + } + } + return this.markDirty(), this; + } + cleanRaws(e) { + if ((super.cleanRaws(e), this.nodes)) { + for (const t of this.nodes) { + t.cleanRaws(e); + } + } + } + each(e) { + if (!this.proxyOf.nodes) { + return; + } + let t = this.getIterator(), + r, + i; + while ( + this.indexes[t] < this.proxyOf.nodes.length && + ((r = this.indexes[t]), (i = e(this.proxyOf.nodes[r], r)), i !== !1) + ) { + this.indexes[t] += 1; + } + return delete this.indexes[t], i; + } + every(e) { + return this.nodes.every(e); + } + getIterator() { + this.lastEach || (this.lastEach = 0), + this.indexes || (this.indexes = {}), + (this.lastEach += 1); + const e = this.lastEach; + return (this.indexes[e] = 0), e; + } + getProxyProcessor() { + return { + get(e, t) { + return t === 'proxyOf' + ? e + : e[t] + ? t === 'each' || (typeof t == 'string' && t.startsWith('walk')) + ? (...r) => + e[t]( + ...r.map((i) => + typeof i == 'function' ? (n, o) => i(n.toProxy(), o) : i + ) + ) + : t === 'every' || t === 'some' + ? (r) => e[t]((i, ...n) => r(i.toProxy(), ...n)) + : t === 'root' + ? () => e.root().toProxy() + : t === 'nodes' + ? e.nodes.map((r) => r.toProxy()) + : t === 'first' || t === 'last' + ? e[t].toProxy() + : e[t] + : e[t]; + }, + set(e, t, r) { + return ( + e[t] === r || + ((e[t] = r), + (t === 'name' || t === 'params' || t === 'selector') && + e.markDirty()), + !0 + ); + }, + }; + } + index(e) { + return typeof e == 'number' + ? e + : (e.proxyOf && (e = e.proxyOf), this.proxyOf.nodes.indexOf(e)); + } + insertAfter(e, t) { + let r = this.index(e), + i = this.normalize(t, this.proxyOf.nodes[r]).reverse(); + r = this.index(e); + for (const o of i) { + this.proxyOf.nodes.splice(r + 1, 0, o); + } + let n; + for (const o in this.indexes) { + (n = this.indexes[o]), r < n && (this.indexes[o] = n + i.length); + } + return this.markDirty(), this; + } + insertBefore(e, t) { + let r = this.index(e), + i = r === 0 ? 'prepend' : !1, + n = this.normalize(t, this.proxyOf.nodes[r], i).reverse(); + r = this.index(e); + for (const l of n) { + this.proxyOf.nodes.splice(r, 0, l); + } + let o; + for (const l in this.indexes) { + (o = this.indexes[l]), r <= o && (this.indexes[l] = o + n.length); + } + return this.markDirty(), this; + } + normalize(e, t) { + if (typeof e == 'string') { + e = ro(eo(e).nodes); + } else if (typeof e > 'u') { + e = []; + } else if (Array.isArray(e)) { + e = e.slice(0); + for (const i of e) { + i.parent && i.parent.removeChild(i, 'ignore'); + } + } else if (e.type === 'root' && this.type !== 'document') { + e = e.nodes.slice(0); + for (const i of e) { + i.parent && i.parent.removeChild(i, 'ignore'); + } + } else if (e.type) { + e = [e]; + } else if (e.prop) { + if (typeof e.value > 'u') { + throw new Error('Value field is missed in node creation'); + } + typeof e.value != 'string' && (e.value = String(e.value)), + (e = [new Qn(e)]); + } else if (e.selector) { + e = [new Ps(e)]; + } else if (e.name) { + e = [new $s(e)]; + } else if (e.text) { + e = [new qn(e)]; + } else { + throw new Error('Unknown node type in node creation'); + } + return e.map( + (i) => ( + i[Kn] || io.rebuild(i), + (i = i.proxyOf), + i.parent && i.parent.removeChild(i), + i[Jn] && so(i), + typeof i.raws.before > 'u' && + t && + typeof t.raws.before < 'u' && + (i.raws.before = t.raws.before.replace(/\S/g, '')), + (i.parent = this.proxyOf), + i + ) + ); + } + prepend(...e) { + e = e.reverse(); + for (const t of e) { + const r = this.normalize(t, this.first, 'prepend').reverse(); + for (const i of r) { + this.proxyOf.nodes.unshift(i); + } + for (const i in this.indexes) { + this.indexes[i] = this.indexes[i] + r.length; + } + } + return this.markDirty(), this; + } + push(e) { + return (e.parent = this), this.proxyOf.nodes.push(e), this; + } + removeAll() { + for (const e of this.proxyOf.nodes) { + e.parent = void 0; + } + return (this.proxyOf.nodes = []), this.markDirty(), this; + } + removeChild(e) { + (e = this.index(e)), + (this.proxyOf.nodes[e].parent = void 0), + this.proxyOf.nodes.splice(e, 1); + let t; + for (const r in this.indexes) { + (t = this.indexes[r]), t >= e && (this.indexes[r] = t - 1); + } + return this.markDirty(), this; + } + replaceValues(e, t, r) { + return ( + r || ((r = t), (t = {})), + this.walkDecls((i) => { + (t.props && !t.props.includes(i.prop)) || + (t.fast && !i.value.includes(t.fast)) || + (i.value = i.value.replace(e, r)); + }), + this.markDirty(), + this + ); + } + some(e) { + return this.nodes.some(e); + } + walk(e) { + return this.each((t, r) => { + let i; + try { + i = e(t, r); + } catch (n) { + throw t.addToError(n); + } + return i !== !1 && t.walk && (i = t.walk(e)), i; + }); + } + walkAtRules(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'atrule' && e.test(r.name)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'atrule' && r.name === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'atrule') { + return t(r, i); + } + })); + } + walkComments(e) { + return this.walk((t, r) => { + if (t.type === 'comment') { + return e(t, r); + } + }); + } + walkDecls(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'decl' && e.test(r.prop)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'decl' && r.prop === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'decl') { + return t(r, i); + } + })); + } + walkRules(e, t) { + return t + ? e instanceof RegExp + ? this.walk((r, i) => { + if (r.type === 'rule' && e.test(r.selector)) { + return t(r, i); + } + }) + : this.walk((r, i) => { + if (r.type === 'rule' && r.selector === e) { + return t(r, i); + } + }) + : ((t = e), + this.walk((r, i) => { + if (r.type === 'rule') { + return t(r, i); + } + })); + } + get first() { + if (this.proxyOf.nodes) { + return this.proxyOf.nodes[0]; + } + } + get last() { + if (this.proxyOf.nodes) { + return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; + } + } + }; + he.registerParse = (s) => { + eo = s; + }; + he.registerRule = (s) => { + Ps = s; + }; + he.registerAtRule = (s) => { + $s = s; + }; + he.registerRoot = (s) => { + to = s; + }; + var Ce = he; + he.default = he; + he.rebuild = (s) => { + s.type === 'atrule' + ? Object.setPrototypeOf(s, $s.prototype) + : s.type === 'rule' + ? Object.setPrototypeOf(s, Ps.prototype) + : s.type === 'decl' + ? Object.setPrototypeOf(s, Qn.prototype) + : s.type === 'comment' + ? Object.setPrototypeOf(s, qn.prototype) + : s.type === 'root' && Object.setPrototypeOf(s, to.prototype), + (s[Kn] = !0), + s.nodes && + s.nodes.forEach((e) => { + he.rebuild(e); + }); + }; + var Sc = Ce, + no, + oo, + qe = class extends Sc { + constructor(e) { + super({ type: 'document', ...e }), this.nodes || (this.nodes = []); + } + toResult(e = {}) { + return new no(new oo(), this, e).stringify(); + } + }; + qe.registerLazyResult = (s) => { + no = s; + }; + qe.registerProcessor = (s) => { + oo = s; + }; + var Ls = qe; + qe.default = qe; + var Ni = {}, + ao = (e) => { + Ni[e] || + ((Ni[e] = !0), typeof console < 'u' && console.warn && console.warn(e)); + }, + is = class { + constructor(e, t = {}) { + if ( + ((this.type = 'warning'), (this.text = e), t.node && t.node.source) + ) { + const r = t.node.rangeBy(t); + (this.line = r.start.line), + (this.column = r.start.column), + (this.endLine = r.end.line), + (this.endColumn = r.end.column); + } + for (const r in t) { + this[r] = t[r]; + } + } + toString() { + return this.node + ? this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word, + }).message + : this.plugin + ? this.plugin + ': ' + this.text + : this.text; + } + }, + lo = is; + is.default = is; + var vc = lo, + ns = class { + constructor(e, t, r) { + (this.processor = e), + (this.messages = []), + (this.root = t), + (this.opts = r), + (this.css = void 0), + (this.map = void 0); + } + toString() { + return this.css; + } + warn(e, t = {}) { + t.plugin || + (this.lastPlugin && + this.lastPlugin.postcssPlugin && + (t.plugin = this.lastPlugin.postcssPlugin)); + const r = new vc(e, t); + return this.messages.push(r), r; + } + warnings() { + return this.messages.filter((e) => e.type === 'warning'); + } + get content() { + return this.css; + } + }, + Fs = ns; + ns.default = ns; + var Nr = 39, + Ri = 34, + Et = 92, + Ai = 47, + xt = 10, + ze = 32, + Mt = 12, + Nt = 9, + Rt = 13, + Cc = 91, + Ic = 93, + Ec = 40, + xc = 41, + Mc = 123, + Nc = 125, + Rc = 59, + Ac = 42, + Oc = 58, + Dc = 64, + At = /[\t\n\f\r "#'()/;[\\\]{}]/g, + Ot = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, + Tc = /.[\r\n"'(/\\]/, + Oi = /[\da-f]/i, + _c = (e, t = {}) => { + let r = e.css.valueOf(), + i = t.ignoreErrors, + n, + o, + l, + a, + u, + c, + f, + p, + g, + m, + d = r.length, + h = 0, + b = [], + S = []; + function y() { + return h; + } + function v(_) { + throw e.error('Unclosed ' + _, h); + } + function N() { + return S.length === 0 && h >= d; + } + function D(_) { + if (S.length) { + return S.pop(); + } + if (h >= d) { + return; + } + const V = _ ? _.ignoreUnclosed : !1; + switch (((n = r.charCodeAt(h)), n)) { + case xt: + case ze: + case Nt: + case Rt: + case Mt: { + o = h; + do { + (o += 1), (n = r.charCodeAt(o)); + } while (n === ze || n === xt || n === Nt || n === Rt || n === Mt); + (m = ['space', r.slice(h, o)]), (h = o - 1); + break; + } + case Cc: + case Ic: + case Mc: + case Nc: + case Oc: + case Rc: + case xc: { + const H = String.fromCharCode(n); + m = [H, H, h]; + break; + } + case Ec: { + if ( + ((p = b.length ? b.pop()[1] : ''), + (g = r.charCodeAt(h + 1)), + p === 'url' && + g !== Nr && + g !== Ri && + g !== ze && + g !== xt && + g !== Nt && + g !== Mt && + g !== Rt) + ) { + o = h; + do { + if (((c = !1), (o = r.indexOf(')', o + 1)), o === -1)) { + if (i || V) { + o = h; + break; + } + v('bracket'); + } + for (f = o; r.charCodeAt(f - 1) === Et; ) { + (f -= 1), (c = !c); + } + } while (c); + (m = ['brackets', r.slice(h, o + 1), h, o]), (h = o); + } else { + (o = r.indexOf(')', h + 1)), + (a = r.slice(h, o + 1)), + o === -1 || Tc.test(a) + ? (m = ['(', '(', h]) + : ((m = ['brackets', a, h, o]), (h = o)); + } + break; + } + case Nr: + case Ri: { + (l = n === Nr ? "'" : '"'), (o = h); + do { + if (((c = !1), (o = r.indexOf(l, o + 1)), o === -1)) { + if (i || V) { + o = h + 1; + break; + } + v('string'); + } + for (f = o; r.charCodeAt(f - 1) === Et; ) { + (f -= 1), (c = !c); + } + } while (c); + (m = ['string', r.slice(h, o + 1), h, o]), (h = o); + break; + } + case Dc: { + (At.lastIndex = h + 1), + At.test(r), + At.lastIndex === 0 ? (o = r.length - 1) : (o = At.lastIndex - 2), + (m = ['at-word', r.slice(h, o + 1), h, o]), + (h = o); + break; + } + case Et: { + for (o = h, u = !0; r.charCodeAt(o + 1) === Et; ) { + (o += 1), (u = !u); + } + if ( + ((n = r.charCodeAt(o + 1)), + u && + n !== Ai && + n !== ze && + n !== xt && + n !== Nt && + n !== Rt && + n !== Mt && + ((o += 1), Oi.test(r.charAt(o)))) + ) { + while (Oi.test(r.charAt(o + 1))) { + o += 1; + } + r.charCodeAt(o + 1) === ze && (o += 1); + } + (m = ['word', r.slice(h, o + 1), h, o]), (h = o); + break; + } + default: { + n === Ai && r.charCodeAt(h + 1) === Ac + ? ((o = r.indexOf('*/', h + 2) + 1), + o === 0 && (i || V ? (o = r.length) : v('comment')), + (m = ['comment', r.slice(h, o + 1), h, o]), + (h = o)) + : ((Ot.lastIndex = h + 1), + Ot.test(r), + Ot.lastIndex === 0 + ? (o = r.length - 1) + : (o = Ot.lastIndex - 2), + (m = ['word', r.slice(h, o + 1), h, o]), + b.push(m), + (h = o)); + break; + } + } + return h++, m; + } + function z(_) { + S.push(_); + } + return { back: z, endOfFile: N, nextToken: D, position: y }; + }, + uo = Ce, + Jt = class extends uo { + constructor(e) { + super(e), (this.type = 'atrule'); + } + append(...e) { + return this.proxyOf.nodes || (this.nodes = []), super.append(...e); + } + prepend(...e) { + return this.proxyOf.nodes || (this.nodes = []), super.prepend(...e); + } + }, + Us = Jt; + Jt.default = Jt; + uo.registerAtRule(Jt); + var co = Ce, + ho, + fo, + _e = class extends co { + constructor(e) { + super(e), (this.type = 'root'), this.nodes || (this.nodes = []); + } + normalize(e, t, r) { + const i = super.normalize(e); + if (t) { + if (r === 'prepend') { + this.nodes.length > 1 + ? (t.raws.before = this.nodes[1].raws.before) + : delete t.raws.before; + } else if (this.first !== t) { + for (const n of i) { + n.raws.before = t.raws.before; + } + } + } + return i; + } + removeChild(e, t) { + const r = this.index(e); + return ( + !t && + r === 0 && + this.nodes.length > 1 && + (this.nodes[1].raws.before = this.nodes[r].raws.before), + super.removeChild(e) + ); + } + toResult(e = {}) { + return new ho(new fo(), this, e).stringify(); + } + }; + _e.registerLazyResult = (s) => { + ho = s; + }; + _e.registerProcessor = (s) => { + fo = s; + }; + var at = _e; + _e.default = _e; + co.registerRoot(_e); + var et = { + comma(s) { + return et.split(s, [','], !0); + }, + space(s) { + const e = [ + ' ', + ` +`, + ' ', + ]; + return et.split(s, e); + }, + split(s, e, t) { + let r = [], + i = '', + n = !1, + o = 0, + l = !1, + a = '', + u = !1; + for (const c of s) { + u + ? (u = !1) + : c === '\\' + ? (u = !0) + : l + ? c === a && (l = !1) + : c === '"' || c === "'" + ? ((l = !0), (a = c)) + : c === '(' + ? (o += 1) + : c === ')' + ? o > 0 && (o -= 1) + : o === 0 && e.includes(c) && (n = !0), + n ? (i !== '' && r.push(i.trim()), (i = ''), (n = !1)) : (i += c); + } + return (t || i !== '') && r.push(i.trim()), r; + }, + }, + po = et; + et.default = et; + var mo = Ce, + kc = po, + Kt = class extends mo { + constructor(e) { + super(e), (this.type = 'rule'), this.nodes || (this.nodes = []); + } + get selectors() { + return kc.comma(this.selector); + } + set selectors(e) { + const t = this.selector ? this.selector.match(/,\s*/) : null, + r = t ? t[0] : ',' + this.raw('between', 'beforeOpen'); + this.selector = e.join(r); + } + }, + Bs = Kt; + Kt.default = Kt; + mo.registerRule(Kt); + var Pc = cr, + $c = _c, + Lc = fr, + Fc = Us, + Uc = at, + Di = Bs, + Ti = { empty: !0, space: !0 }; + function Bc(s) { + for (let e = s.length - 1; e >= 0; e--) { + const t = s[e], + r = t[3] || t[2]; + if (r) { + return r; + } + } + } + var Wc = class { + constructor(e) { + (this.input = e), + (this.root = new Uc()), + (this.current = this.root), + (this.spaces = ''), + (this.semicolon = !1), + this.createTokenizer(), + (this.root.source = { + input: e, + start: { column: 1, line: 1, offset: 0 }, + }); + } + atrule(e) { + const t = new Fc(); + (t.name = e[1].slice(1)), + t.name === '' && this.unnamedAtrule(t, e), + this.init(t, e[2]); + let r, + i, + n, + o = !1, + l = !1, + a = [], + u = []; + while (!this.tokenizer.endOfFile()) { + if ( + ((e = this.tokenizer.nextToken()), + (r = e[0]), + r === '(' || r === '[' + ? u.push(r === '(' ? ')' : ']') + : r === '{' && u.length > 0 + ? u.push('}') + : r === u[u.length - 1] && u.pop(), + u.length === 0) + ) { + if (r === ';') { + (t.source.end = this.getPosition(e[2])), + t.source.end.offset++, + (this.semicolon = !0); + break; + } + if (r === '{') { + l = !0; + break; + } + if (r === '}') { + if (a.length > 0) { + for (n = a.length - 1, i = a[n]; i && i[0] === 'space'; ) { + i = a[--n]; + } + i && + ((t.source.end = this.getPosition(i[3] || i[2])), + t.source.end.offset++); + } + this.end(e); + break; + } + a.push(e); + } else { + a.push(e); + } + if (this.tokenizer.endOfFile()) { + o = !0; + break; + } + } + (t.raws.between = this.spacesAndCommentsFromEnd(a)), + a.length + ? ((t.raws.afterName = this.spacesAndCommentsFromStart(a)), + this.raw(t, 'params', a), + o && + ((e = a[a.length - 1]), + (t.source.end = this.getPosition(e[3] || e[2])), + t.source.end.offset++, + (this.spaces = t.raws.between), + (t.raws.between = ''))) + : ((t.raws.afterName = ''), (t.params = '')), + l && ((t.nodes = []), (this.current = t)); + } + checkMissedSemicolon(e) { + const t = this.colon(e); + if (t === !1) { + return; + } + let r = 0, + i; + for ( + let n = t - 1; + n >= 0 && ((i = e[n]), !(i[0] !== 'space' && ((r += 1), r === 2))); + n-- + ) {} + throw this.input.error( + 'Missed semicolon', + i[0] === 'word' ? i[3] + 1 : i[2] + ); + } + colon(e) { + let t = 0, + r, + i, + n; + for (const [o, l] of e.entries()) { + if ( + ((r = l), + (i = r[0]), + i === '(' && (t += 1), + i === ')' && (t -= 1), + t === 0 && i === ':') + ) { + if (n) { + if (n[0] === 'word' && n[1] === 'progid') { + continue; + } + return o; + } + this.doubleColon(r); + } + n = r; + } + return !1; + } + comment(e) { + const t = new Lc(); + this.init(t, e[2]), + (t.source.end = this.getPosition(e[3] || e[2])), + t.source.end.offset++; + const r = e[1].slice(2, -2); + if (/^\s*$/.test(r)) { + (t.text = ''), (t.raws.left = r), (t.raws.right = ''); + } else { + const i = r.match(/^(\s*)([^]*\S)(\s*)$/); + (t.text = i[2]), (t.raws.left = i[1]), (t.raws.right = i[3]); + } + } + createTokenizer() { + this.tokenizer = $c(this.input); + } + decl(e, t) { + const r = new Pc(); + this.init(r, e[0][2]); + const i = e[e.length - 1]; + for ( + i[0] === ';' && ((this.semicolon = !0), e.pop()), + r.source.end = this.getPosition(i[3] || i[2] || Bc(e)), + r.source.end.offset++; + e[0][0] !== 'word'; + ) { + e.length === 1 && this.unknownWord(e), + (r.raws.before += e.shift()[1]); + } + for ( + r.source.start = this.getPosition(e[0][2]), r.prop = ''; + e.length; + ) { + const u = e[0][0]; + if (u === ':' || u === 'space' || u === 'comment') { + break; + } + r.prop += e.shift()[1]; + } + r.raws.between = ''; + let n; + while (e.length) { + if (((n = e.shift()), n[0] === ':')) { + r.raws.between += n[1]; + break; + } + n[0] === 'word' && /\w/.test(n[1]) && this.unknownWord([n]), + (r.raws.between += n[1]); + } + (r.prop[0] === '_' || r.prop[0] === '*') && + ((r.raws.before += r.prop[0]), (r.prop = r.prop.slice(1))); + let o = [], + l; + while ( + e.length && + ((l = e[0][0]), !(l !== 'space' && l !== 'comment')) + ) { + o.push(e.shift()); + } + this.precheckMissedSemicolon(e); + for (let u = e.length - 1; u >= 0; u--) { + if (((n = e[u]), n[1].toLowerCase() === '!important')) { + r.important = !0; + let c = this.stringFrom(e, u); + (c = this.spacesFromEnd(e) + c), + c !== ' !important' && (r.raws.important = c); + break; + } + if (n[1].toLowerCase() === 'important') { + let c = e.slice(0), + f = ''; + for (let p = u; p > 0; p--) { + const g = c[p][0]; + if (f.trim().indexOf('!') === 0 && g !== 'space') { + break; + } + f = c.pop()[1] + f; + } + f.trim().indexOf('!') === 0 && + ((r.important = !0), (r.raws.important = f), (e = c)); + } + if (n[0] !== 'space' && n[0] !== 'comment') { + break; + } + } + e.some((u) => u[0] !== 'space' && u[0] !== 'comment') && + ((r.raws.between += o.map((u) => u[1]).join('')), (o = [])), + this.raw(r, 'value', o.concat(e), t), + r.value.includes(':') && !t && this.checkMissedSemicolon(e); + } + doubleColon(e) { + throw this.input.error( + 'Double colon', + { offset: e[2] }, + { offset: e[2] + e[1].length } + ); + } + emptyRule(e) { + const t = new Di(); + this.init(t, e[2]), + (t.selector = ''), + (t.raws.between = ''), + (this.current = t); + } + end(e) { + this.current.nodes && + this.current.nodes.length && + (this.current.raws.semicolon = this.semicolon), + (this.semicolon = !1), + (this.current.raws.after = + (this.current.raws.after || '') + this.spaces), + (this.spaces = ''), + this.current.parent + ? ((this.current.source.end = this.getPosition(e[2])), + this.current.source.end.offset++, + (this.current = this.current.parent)) + : this.unexpectedClose(e); + } + endFile() { + this.current.parent && this.unclosedBlock(), + 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(e) { + if (((this.spaces += e[1]), this.current.nodes)) { + const t = this.current.nodes[this.current.nodes.length - 1]; + t && + t.type === 'rule' && + !t.raws.ownSemicolon && + ((t.raws.ownSemicolon = this.spaces), (this.spaces = '')); + } + } + getPosition(e) { + const t = this.input.fromOffset(e); + return { column: t.col, line: t.line, offset: e }; + } + init(e, t) { + this.current.push(e), + (e.source = { input: this.input, start: this.getPosition(t) }), + (e.raws.before = this.spaces), + (this.spaces = ''), + e.type !== 'comment' && (this.semicolon = !1); + } + other(e) { + let t = !1, + r = null, + i = !1, + n = null, + o = [], + l = e[1].startsWith('--'), + a = [], + u = e; + while (u) { + if (((r = u[0]), a.push(u), r === '(' || r === '[')) { + n || (n = u), o.push(r === '(' ? ')' : ']'); + } else if (l && i && r === '{') { + n || (n = u), o.push('}'); + } else if (o.length === 0) { + if (r === ';') { + if (i) { + this.decl(a, l); + return; + } + break; + } + if (r === '{') { + this.rule(a); + return; + } + if (r === '}') { + this.tokenizer.back(a.pop()), (t = !0); + break; + } + r === ':' && (i = !0); + } else { + r === o[o.length - 1] && (o.pop(), o.length === 0 && (n = null)); + } + u = this.tokenizer.nextToken(); + } + if ( + (this.tokenizer.endOfFile() && (t = !0), + o.length > 0 && this.unclosedBracket(n), + t && i) + ) { + if (!l) { + while ( + a.length && + ((u = a[a.length - 1][0]), !(u !== 'space' && u !== 'comment')) + ) { + this.tokenizer.back(a.pop()); + } + } + this.decl(a, l); + } else { + this.unknownWord(a); + } + } + parse() { + let e; + while (!this.tokenizer.endOfFile()) { + switch (((e = this.tokenizer.nextToken()), e[0])) { + case 'space': + this.spaces += e[1]; + break; + case ';': + this.freeSemicolon(e); + break; + case '}': + this.end(e); + break; + case 'comment': + this.comment(e); + break; + case 'at-word': + this.atrule(e); + break; + case '{': + this.emptyRule(e); + break; + default: + this.other(e); + break; + } + } + this.endFile(); + } + precheckMissedSemicolon() {} + raw(e, t, r, i) { + let n, + o, + l = r.length, + a = '', + u = !0, + c, + f; + for (let p = 0; p < l; p += 1) { + (n = r[p]), + (o = n[0]), + o === 'space' && p === l - 1 && !i + ? (u = !1) + : o === 'comment' + ? ((f = r[p - 1] ? r[p - 1][0] : 'empty'), + (c = r[p + 1] ? r[p + 1][0] : 'empty'), + Ti[f] || Ti[c] + ? (u = !1) + : a.slice(-1) === ',' + ? (u = !1) + : (a += n[1])) + : (a += n[1]); + } + if (!u) { + const p = r.reduce((g, m) => g + m[1], ''); + e.raws[t] = { raw: p, value: a }; + } + e[t] = a; + } + rule(e) { + e.pop(); + const t = new Di(); + this.init(t, e[0][2]), + (t.raws.between = this.spacesAndCommentsFromEnd(e)), + this.raw(t, 'selector', e), + (this.current = t); + } + spacesAndCommentsFromEnd(e) { + let t, + r = ''; + while ( + e.length && + ((t = e[e.length - 1][0]), !(t !== 'space' && t !== 'comment')) + ) { + r = e.pop()[1] + r; + } + return r; + } + spacesAndCommentsFromStart(e) { + let t, + r = ''; + while ( + e.length && + ((t = e[0][0]), !(t !== 'space' && t !== 'comment')) + ) { + r += e.shift()[1]; + } + return r; + } + spacesFromEnd(e) { + let t, + r = ''; + while (e.length && ((t = e[e.length - 1][0]), t === 'space')) { + r = e.pop()[1] + r; + } + return r; + } + stringFrom(e, t) { + let r = ''; + for (let i = t; i < e.length; i++) { + r += e[i][1]; + } + return e.splice(t, e.length - t), r; + } + unclosedBlock() { + const e = this.current.source.start; + throw this.input.error('Unclosed block', e.line, e.column); + } + unclosedBracket(e) { + throw this.input.error( + 'Unclosed bracket', + { offset: e[2] }, + { offset: e[2] + 1 } + ); + } + unexpectedClose(e) { + throw this.input.error( + 'Unexpected }', + { offset: e[2] }, + { offset: e[2] + 1 } + ); + } + unknownWord(e) { + throw this.input.error( + 'Unknown word', + { offset: e[0][2] }, + { offset: e[0][2] + e[0][1].length } + ); + } + unnamedAtrule(e, t) { + throw this.input.error( + 'At-rule without name', + { offset: t[2] }, + { offset: t[2] + t[1].length } + ); + } + }, + zc = Wc, + Vc = Ce, + Gc = zc, + jc = hr; + function Qt(s, e) { + const t = new jc(s, e), + r = new Gc(t); + try { + r.parse(); + } catch (i) { + throw ( + (process.env.NODE_ENV !== 'production' && + i.name === 'CssSyntaxError' && + e && + e.from && + (/\.scss$/i.test(e.from) + ? (i.message += ` +You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`) + : /\.sass/i.test(e.from) + ? (i.message += ` +You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`) + : /\.less$/i.test(e.from) && + (i.message += ` +You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)), + i) + ); + } + return r.root; + } + var Ws = Qt; + Qt.default = Qt; + Vc.registerParse(Qt); + var { isClean: le, my: Hc } = ot, + Yc = Xn, + Zc = lr, + Xc = Ce, + Jc = Ls, + Kc = ao, + _i = Fs, + Qc = Ws, + qc = at, + eh = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule', + }, + th = { + 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, + }, + rh = { Once: !0, postcssPlugin: !0, prepare: !0 }, + ke = 0; + function Ve(s) { + return typeof s == 'object' && typeof s.then == 'function'; + } + function go(s) { + let e = !1, + t = eh[s.type]; + return ( + s.type === 'decl' + ? (e = s.prop.toLowerCase()) + : s.type === 'atrule' && (e = s.name.toLowerCase()), + e && s.append + ? [t, t + '-' + e, ke, t + 'Exit', t + 'Exit-' + e] + : e + ? [t, t + '-' + e, t + 'Exit', t + 'Exit-' + e] + : s.append + ? [t, ke, t + 'Exit'] + : [t, t + 'Exit'] + ); + } + function ki(s) { + let e; + return ( + s.type === 'document' + ? (e = ['Document', ke, 'DocumentExit']) + : s.type === 'root' + ? (e = ['Root', ke, 'RootExit']) + : (e = go(s)), + { + eventIndex: 0, + events: e, + iterator: 0, + node: s, + visitorIndex: 0, + visitors: [], + } + ); + } + function os(s) { + return (s[le] = !1), s.nodes && s.nodes.forEach((e) => os(e)), s; + } + var as = {}, + Pe = class yo { + constructor(e, t, r) { + (this.stringified = !1), (this.processed = !1); + let i; + if ( + typeof t == 'object' && + t !== null && + (t.type === 'root' || t.type === 'document') + ) { + i = os(t); + } else if (t instanceof yo || t instanceof _i) { + (i = os(t.root)), + t.map && + (typeof r.map > 'u' && (r.map = {}), + r.map.inline || (r.map.inline = !1), + (r.map.prev = t.map)); + } else { + let n = Qc; + r.syntax && (n = r.syntax.parse), + r.parser && (n = r.parser), + n.parse && (n = n.parse); + try { + i = n(t, r); + } catch (o) { + (this.processed = !0), (this.error = o); + } + i && !i[Hc] && Xc.rebuild(i); + } + (this.result = new _i(e, i, r)), + (this.helpers = { ...as, postcss: as, result: this.result }), + (this.plugins = this.processor.plugins.map((n) => + typeof n == 'object' && n.prepare + ? { ...n, ...n.prepare(this.result) } + : n + )); + } + async() { + return this.error + ? Promise.reject(this.error) + : this.processed + ? Promise.resolve(this.result) + : (this.processing || (this.processing = this.runAsync()), + this.processing); + } + catch(e) { + return this.async().catch(e); + } + finally(e) { + return this.async().then(e, e); + } + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins'); + } + handleError(e, t) { + const r = this.result.lastPlugin; + try { + if ( + (t && t.addToError(e), + (this.error = e), + e.name === 'CssSyntaxError' && !e.plugin) + ) { + (e.plugin = r.postcssPlugin), e.setMessage(); + } else if ( + r.postcssVersion && + process.env.NODE_ENV !== 'production' + ) { + const i = r.postcssPlugin, + n = r.postcssVersion, + o = this.result.processor.version, + l = n.split('.'), + a = o.split('.'); + (l[0] !== a[0] || Number.parseInt(l[1]) > Number.parseInt(a[1])) && + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS version is ' + + o + + ', but ' + + i + + ' uses ' + + n + + '. Perhaps this is the source of the error below.' + ); + } + } catch (i) { + console && console.error && console.error(i); + } + return e; + } + prepareVisitors() { + this.listeners = {}; + const e = (t, r, i) => { + this.listeners[r] || (this.listeners[r] = []), + this.listeners[r].push([t, i]); + }; + for (const t of this.plugins) { + if (typeof t == 'object') { + for (const r in t) { + if (!th[r] && /^[A-Z]/.test(r)) { + throw new Error( + `Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` + ); + } + if (!rh[r]) { + if (typeof t[r] == 'object') { + for (const i in t[r]) { + i === '*' + ? e(t, r, t[r][i]) + : e(t, r + '-' + i.toLowerCase(), t[r][i]); + } + } else { + typeof t[r] == 'function' && e(t, r, t[r]); + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0; + } + async runAsync() { + this.plugin = 0; + for (let e = 0; e < this.plugins.length; e++) { + const t = this.plugins[e], + r = this.runOnRoot(t); + if (Ve(r)) { + try { + await r; + } catch (i) { + throw this.handleError(i); + } + } + } + if ((this.prepareVisitors(), this.hasListener)) { + const e = this.result.root; + while (!e[le]) { + e[le] = !0; + const t = [ki(e)]; + while (t.length > 0) { + const r = this.visitTick(t); + if (Ve(r)) { + try { + await r; + } catch (i) { + const n = t[t.length - 1].node; + throw this.handleError(i, n); + } + } + } + } + if (this.listeners.OnceExit) { + for (const [t, r] of this.listeners.OnceExit) { + this.result.lastPlugin = t; + try { + if (e.type === 'document') { + const i = e.nodes.map((n) => r(n, this.helpers)); + await Promise.all(i); + } else { + await r(e, this.helpers); + } + } catch (i) { + throw this.handleError(i); + } + } + } + } + return (this.processed = !0), this.stringify(); + } + runOnRoot(e) { + this.result.lastPlugin = e; + try { + if (typeof e == 'object' && e.Once) { + if (this.result.root.type === 'document') { + const t = this.result.root.nodes.map((r) => + e.Once(r, this.helpers) + ); + return Ve(t[0]) ? Promise.all(t) : t; + } + return e.Once(this.result.root, this.helpers); + } + if (typeof e == 'function') { + return e(this.result.root, this.result); + } + } catch (t) { + throw this.handleError(t); + } + } + stringify() { + if (this.error) { + throw this.error; + } + if (this.stringified) { + return this.result; + } + (this.stringified = !0), this.sync(); + let e = this.result.opts, + t = Zc; + e.syntax && (t = e.syntax.stringify), + e.stringifier && (t = e.stringifier), + t.stringify && (t = t.stringify); + const i = new Yc(t, this.result.root, this.result.opts).generate(); + return (this.result.css = i[0]), (this.result.map = i[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 (const e of this.plugins) { + const t = this.runOnRoot(e); + if (Ve(t)) { + throw this.getAsyncError(); + } + } + if ((this.prepareVisitors(), this.hasListener)) { + const e = this.result.root; + while (!e[le]) { + (e[le] = !0), this.walkSync(e); + } + if (this.listeners.OnceExit) { + if (e.type === 'document') { + for (const t of e.nodes) { + this.visitSync(this.listeners.OnceExit, t); + } + } else { + this.visitSync(this.listeners.OnceExit, e); + } + } + } + return this.result; + } + then(e, t) { + return ( + process.env.NODE_ENV !== 'production' && + ('from' in this.opts || + Kc( + '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.' + )), + this.async().then(e, t) + ); + } + toString() { + return this.css; + } + visitSync(e, t) { + for (const [r, i] of e) { + this.result.lastPlugin = r; + let n; + try { + n = i(t, this.helpers); + } catch (o) { + throw this.handleError(o, t.proxyOf); + } + if (t.type !== 'root' && t.type !== 'document' && !t.parent) { + return !0; + } + if (Ve(n)) { + throw this.getAsyncError(); + } + } + } + visitTick(e) { + const t = e[e.length - 1], + { node: r, visitors: i } = t; + if (r.type !== 'root' && r.type !== 'document' && !r.parent) { + e.pop(); + return; + } + if (i.length > 0 && t.visitorIndex < i.length) { + const [o, l] = i[t.visitorIndex]; + (t.visitorIndex += 1), + t.visitorIndex === i.length && + ((t.visitors = []), (t.visitorIndex = 0)), + (this.result.lastPlugin = o); + try { + return l(r.toProxy(), this.helpers); + } catch (a) { + throw this.handleError(a, r); + } + } + if (t.iterator !== 0) { + let o = t.iterator, + l; + while ((l = r.nodes[r.indexes[o]])) { + if (((r.indexes[o] += 1), !l[le])) { + (l[le] = !0), e.push(ki(l)); + return; + } + } + (t.iterator = 0), delete r.indexes[o]; + } + const n = t.events; + while (t.eventIndex < n.length) { + const o = n[t.eventIndex]; + if (((t.eventIndex += 1), o === ke)) { + r.nodes && + r.nodes.length && + ((r[le] = !0), (t.iterator = r.getIterator())); + return; + } + if (this.listeners[o]) { + t.visitors = this.listeners[o]; + return; + } + } + e.pop(); + } + walkSync(e) { + e[le] = !0; + const t = go(e); + for (const r of t) { + if (r === ke) { + e.nodes && + e.each((i) => { + i[le] || this.walkSync(i); + }); + } else { + const i = this.listeners[r]; + if (i && this.visitSync(i, e.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'; + } + }; + Pe.registerPostcss = (s) => { + as = s; + }; + var wo = Pe; + Pe.default = Pe; + qc.registerLazyResult(Pe); + Jc.registerLazyResult(Pe); + var sh = Xn, + ih = lr, + nh = ao, + oh = Ws, + ah = Fs, + ls = class { + constructor(e, t, r) { + (t = t.toString()), + (this.stringified = !1), + (this._processor = e), + (this._css = t), + (this._opts = r), + (this._map = void 0); + let i, + n = ih; + (this.result = new ah(this._processor, i, this._opts)), + (this.result.css = t); + const o = this; + Object.defineProperty(this.result, 'root', { + get() { + return o.root; + }, + }); + const l = new sh(n, i, this._opts, t); + if (l.isMap()) { + const [a, u] = l.generate(); + a && (this.result.css = a), u && (this.result.map = u); + } else { + l.clearAnnotation(), (this.result.css = l.css); + } + } + async() { + return this.error + ? Promise.reject(this.error) + : Promise.resolve(this.result); + } + catch(e) { + return this.async().catch(e); + } + finally(e) { + return this.async().then(e, e); + } + sync() { + if (this.error) { + throw this.error; + } + return this.result; + } + then(e, t) { + return ( + process.env.NODE_ENV !== 'production' && + ('from' in this._opts || + nh( + '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.' + )), + this.async().then(e, t) + ); + } + 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 e, + t = oh; + try { + e = t(this._css, this._opts); + } catch (r) { + this.error = r; + } + if (this.error) { + throw this.error; + } + return (this._root = e), e; + } + get [Symbol.toStringTag]() { + return 'NoWorkResult'; + } + }, + lh = ls; + ls.default = ls; + var uh = lh, + ch = wo, + hh = Ls, + fh = at, + tt = class { + constructor(e = []) { + (this.version = '8.4.38'), (this.plugins = this.normalize(e)); + } + normalize(e) { + let t = []; + for (let r of e) { + if ( + (r.postcss === !0 ? (r = r()) : r.postcss && (r = r.postcss), + typeof r == 'object' && Array.isArray(r.plugins)) + ) { + t = t.concat(r.plugins); + } else if (typeof r == 'object' && r.postcssPlugin) { + t.push(r); + } else if (typeof r == 'function') { + t.push(r); + } else if (typeof r == 'object' && (r.parse || r.stringify)) { + if (process.env.NODE_ENV !== 'production') { + throw new 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 new Error(r + ' is not a PostCSS plugin'); + } + } + return t; + } + process(e, t = {}) { + return this.plugins.length || t.parser || t.stringifier || t.syntax + ? new ch(this, e, t) + : new uh(this, e, t); + } + use(e) { + return (this.plugins = this.plugins.concat(this.normalize([e]))), this; + } + }, + dh = tt; + tt.default = tt; + fh.registerProcessor(tt); + hh.registerProcessor(tt); + var ph = cr, + mh = Gn, + gh = fr, + yh = Us, + wh = hr, + bh = at, + Sh = Bs; + function rt(s, e) { + if (Array.isArray(s)) { + return s.map((i) => rt(i)); + } + const { inputs: t, ...r } = s; + if (t) { + e = []; + for (const i of t) { + const n = { ...i, __proto__: wh.prototype }; + n.map && (n.map = { ...n.map, __proto__: mh.prototype }), e.push(n); + } + } + if ((r.nodes && (r.nodes = s.nodes.map((i) => rt(i, e))), r.source)) { + const { inputId: i, ...n } = r.source; + (r.source = n), i != null && (r.source.input = e[i]); + } + if (r.type === 'root') { + return new bh(r); + } + if (r.type === 'decl') { + return new ph(r); + } + if (r.type === 'rule') { + return new Sh(r); + } + if (r.type === 'comment') { + return new gh(r); + } + if (r.type === 'atrule') { + return new yh(r); + } + throw new Error('Unknown node type: ' + s.type); + } + var vh = rt; + rt.default = rt; + var Ch = ks, + bo = cr, + Ih = wo, + Eh = Ce, + zs = dh, + xh = lr, + Mh = vh, + So = Ls, + Nh = lo, + vo = fr, + Co = Us, + Rh = Fs, + Ah = hr, + Oh = Ws, + Dh = po, + Io = Bs, + Eo = at, + Th = ur; + function O(...s) { + return s.length === 1 && Array.isArray(s[0]) && (s = s[0]), new zs(s); + } + O.plugin = (e, t) => { + let r = !1; + function i(...o) { + console && + console.warn && + !r && + ((r = !0), + console.warn( + e + + `: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration` + ), + process.env.LANG && + process.env.LANG.startsWith('cn') && + console.warn( + e + + `: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357: +https://www.w3ctech.com/topic/2226` + )); + const l = t(...o); + return (l.postcssPlugin = e), (l.postcssVersion = new zs().version), l; + } + let n; + return ( + Object.defineProperty(i, 'postcss', { + get() { + return n || (n = i()), n; + }, + }), + (i.process = (o, l, a) => O([i(a)]).process(o, l)), + i + ); + }; + O.stringify = xh; + O.parse = Oh; + O.fromJSON = Mh; + O.list = Dh; + O.comment = (s) => new vo(s); + O.atRule = (s) => new Co(s); + O.decl = (s) => new bo(s); + O.rule = (s) => new Io(s); + O.root = (s) => new Eo(s); + O.document = (s) => new So(s); + O.CssSyntaxError = Ch; + O.Declaration = bo; + O.Container = Eh; + O.Processor = zs; + O.Document = So; + O.Comment = vo; + O.Warning = Nh; + O.AtRule = Co; + O.Result = Rh; + O.Input = Ah; + O.Rule = Io; + O.Root = Eo; + O.Node = Th; + Ih.registerPostcss(O); + var _h = O; + O.default = O; + var F = Vu(_h); + F.stringify; + F.fromJSON; + F.plugin; + F.parse; + F.list; + F.document; + F.comment; + F.atRule; + F.rule; + F.decl; + F.root; + F.CssSyntaxError; + F.Declaration; + F.Container; + F.Processor; + F.Document; + F.Comment; + F.Warning; + F.AtRule; + F.Result; + F.Input; + F.Rule; + F.Root; + F.Node; + var us = class s { + constructor(...e) { + ee(this, 'parentElement', null), + ee(this, 'parentNode', null), + ee(this, 'ownerDocument'), + ee(this, 'firstChild', null), + ee(this, 'lastChild', null), + ee(this, 'previousSibling', null), + ee(this, 'nextSibling', null), + ee(this, 'ELEMENT_NODE', 1), + ee(this, 'TEXT_NODE', 3), + ee(this, 'nodeType'), + ee(this, 'nodeName'), + ee(this, 'RRNodeType'); + } + get childNodes() { + let e = [], + t = this.firstChild; + while (t) { + e.push(t), (t = t.nextSibling); + } + return e; + } + contains(e) { + if (e instanceof s) { + if (e.ownerDocument !== this.ownerDocument) { + return !1; + } + if (e === this) { + return !0; + } + } else { + return !1; + } + while (e.parentNode) { + if (e.parentNode === this) { + return !0; + } + e = e.parentNode; + } + return !1; + } + appendChild(e) { + throw new Error( + "RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method." + ); + } + insertBefore(e, t) { + throw new Error( + "RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method." + ); + } + removeChild(e) { + throw new Error( + "RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method." + ); + } + toString() { + return 'RRNode'; + } + }; + var Pi = { + Node: [ + 'childNodes', + 'parentNode', + 'parentElement', + 'textContent', + 'ownerDocument', + ], + ShadowRoot: ['host', 'styleSheets'], + Element: ['shadowRoot', 'querySelector', 'querySelectorAll'], + MutationObserver: [], + }, + $i = { + Node: ['contains', 'getRootNode'], + ShadowRoot: ['getSelection'], + Element: [], + MutationObserver: ['constructor'], + }, + Dt = {}, + kh = () => !!globalThis.Zone; + function Vs(s) { + if (Dt[s]) { + return Dt[s]; + } + const e = globalThis[s], + t = e.prototype, + r = s in Pi ? Pi[s] : void 0, + i = !!( + r && + r.every((l) => { + var a, u; + return !!( + (u = + (a = Object.getOwnPropertyDescriptor(t, l)) == null + ? void 0 + : a.get) != null && u.toString().includes('[native code]') + ); + }) + ), + n = s in $i ? $i[s] : void 0, + o = !!( + n && + n.every((l) => { + var a; + return ( + typeof t[l] == 'function' && + ((a = t[l]) == null + ? void 0 + : a.toString().includes('[native code]')) + ); + }) + ); + if (i && o && !kh()) { + return (Dt[s] = e.prototype), e.prototype; + } + try { + const l = document.createElement('iframe'); + document.body.appendChild(l); + const a = l.contentWindow; + if (!a) { + return e.prototype; + } + const u = a[s].prototype; + return document.body.removeChild(l), u ? (Dt[s] = u) : t; + } catch { + return t; + } + } + var Rr = {}; + function de(s, e, t) { + var r; + const i = `${s}.${String(t)}`; + if (Rr[i]) { + return Rr[i].call(e); + } + const n = Vs(s), + o = (r = Object.getOwnPropertyDescriptor(n, t)) == null ? void 0 : r.get; + return o ? ((Rr[i] = o), o.call(e)) : e[t]; + } + var Ar = {}; + function xo(s, e, t) { + const r = `${s}.${String(t)}`; + if (Ar[r]) { + return Ar[r].bind(e); + } + const n = Vs(s)[t]; + return typeof n != 'function' ? e[t] : ((Ar[r] = n), n.bind(e)); + } + function Ph(s) { + return de('Node', s, 'ownerDocument'); + } + function $h(s) { + return de('Node', s, 'childNodes'); + } + function Lh(s) { + return de('Node', s, 'parentNode'); + } + function Fh(s) { + return de('Node', s, 'parentElement'); + } + function Uh(s) { + return de('Node', s, 'textContent'); + } + function Bh(s, e) { + return xo('Node', s, 'contains')(e); + } + function Wh(s) { + return xo('Node', s, 'getRootNode')(); + } + function zh(s) { + return s && 'host' in s ? de('ShadowRoot', s, 'host') : null; + } + function Vh(s) { + return s.styleSheets; + } + function Gh(s) { + return s && 'shadowRoot' in s ? de('Element', s, 'shadowRoot') : null; + } + function jh(s, e) { + return de('Element', s, 'querySelector')(e); + } + function Hh(s, e) { + return de('Element', s, 'querySelectorAll')(e); + } + function Mo() { + return Vs('MutationObserver').constructor; + } + function Ie(s, e, t) { + try { + if (!(e in s)) { + return () => {}; + } + const r = s[e], + i = t(r); + return ( + typeof i == 'function' && + ((i.prototype = i.prototype || {}), + Object.defineProperties(i, { + __rrweb_original__: { enumerable: !1, value: r }, + })), + (s[e] = i), + () => { + s[e] = r; + } + ); + } catch { + return () => {}; + } + } + var C = { + ownerDocument: Ph, + childNodes: $h, + parentNode: Lh, + parentElement: Fh, + textContent: Uh, + contains: Bh, + getRootNode: Wh, + host: zh, + styleSheets: Vh, + shadowRoot: Gh, + querySelector: jh, + querySelectorAll: Hh, + mutationObserver: Mo, + patch: Ie, + }; + function Z(s, e, t = document) { + const r = { capture: !0, passive: !0 }; + return t.addEventListener(s, e, r), () => t.removeEventListener(s, e, r); + } + var xe = `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.`,Li={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Li=new Proxy(Li,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function st(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(qt=()=>new Date().getTime());function No(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function Ro(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ao(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Oo(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=Oo(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Yh(s,e){return e.getId(s)!==-1}function Or(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ze}function Do(s,e){if(je(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Do(r,e):!0}function cs(s){return!!s.changedTouches}function Zh(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function To(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function _o(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function hs(s){return s?s instanceof us&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var fs=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(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 r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 ko(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function Xh(s){let e=s,t;for(;t=ko(e);)e=t;return e}function Jh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=Xh(s);return C.contains(e,t)}function Po(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Jh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(I||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ue=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ue||{}),$e=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))($e||{}),Me=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Me||{});var $o=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($o||{});function Fi(s){return"__ln"in s}var ds=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r`${s}@${e}`,ps=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ds,i=a=>{let u=a,c=Ze;for(;c===Ze;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!Po(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let f=je(u)?this.mirror.getId(ko(a)):this.mirror.getId(u),p=i(a);if(f===-1||p===-1)return r.addNode(a);let g=Re(a,{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:m=>{To(m,this.mirror)&&this.iframeManager.addIframe(m),_o(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),hs(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:f,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Bi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!Wi(this.droppedSet,a)&&!Bi(this.removesSubTreeCache,a,this.mirror)||Wi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let f=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(f!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),f=JSON.stringify(a._unchangedStyles);c.length!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(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(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Or(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:tn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Oo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!en(t.tagName,r))if(n.attributes[r]=qi(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(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 r=this.mirror.getId(t),i=je(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Or(t,this.mirror,this.slimDOMOptions)||!Yh(t,this.mirror)||(this.addedSet.has(t)?(ms(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Do(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ui(r,i)]?ms(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:je(e.target)&&He(e.target)?!0:void 0}),Kh(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Or(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Ui(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),hs(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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 ms(s,e){s.delete(e),C.childNodes(e).forEach(t=>ms(s,t))}function Kh(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Bi(s,e,t){return s.size===0?!1:Qh(s,e)}function Qh(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function Wi(s,e){return s.size===0?!1:Lo(s,e)}function Lo(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Lo(s,t):!1}var Ye;function qh(s){Ye=s}function ef(){Ye=void 0}var E=s=>Ye?(...t)=>{try{return s(...t)}catch(r){if(Ye&&Ye(r)===!0)return;throw r}}:s,be=[];function lt(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Fo(s,e){let t=new ps;be.push(t),t.init(s);let r=new(Mo())(E(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function tf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=st(E(f=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),f),o=[],l=null}),n),u=E(st(E(f=>{let p=lt(f),{clientX:g,clientY:m}=cs(f)?f.changedTouches[0]:f;l||(l=qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:qt()-l}),a(typeof DragEvent<"u"&&f instanceof DragEvent?I.Drag:f instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return E(()=>{c.forEach(f=>f())})}function rf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>f=>{let p=lt(f);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in f){switch(f.pointerType){case"mouse":g=ue.Mouse;break;case"touch":g=ue.Touch;break;case"pen":g=ue.Pen;break}g===ue.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ue.Pen}else cs(f)&&(g=ue.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ue.Touch||m.startsWith("Mouse")&&g===ue.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=cs(f)?f.changedTouches[0]:f;if(!d)return;let h=t.getId(p),{clientX:b,clientY:S}=d;E(s)({type:J[m],id:h,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let f=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:f=f.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(f,p,e))}),E(()=>{l.forEach(c=>c())})}function Uo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=E(st(E(l=>{let a=lt(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=No(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function sf({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=E(st(E(()=>{let n=Ro(),o=Ao();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var nf=["INPUT","TEXTAREA","SELECT"],zi=new WeakMap;function of({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function f(S){let y=lt(S),v=S.isTrusted,N=y&&y.tagName;if(y&&N==="OPTION"&&(y=C.parentElement(y)),!y||!N||nf.indexOf(N)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let D=y.value,z=!1,_=zt(y)||"";_==="radio"||_==="checkbox"?z=y.checked:(l[N.toLowerCase()]||l[_])&&(D=Wt({element:y,maskInputOptions:l,tagName:N,type:_,value:D,maskInputFn:a})),p(y,c?{text:D,isChecked:z,userTriggered:v}:{text:D,isChecked:z});let V=y.name;_==="radio"&&V&&z&&e.querySelectorAll(`input[type="radio"][name="${V}"]`).forEach(H=>{if(H!==y){let Q=H.value;p(H,c?{text:Q,isChecked:!z,userTriggered:!1}:{text:Q,isChecked:!z})}})}function p(S,y){let v=zi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){zi.set(S,y);let N=t.getId(S);E(s)({...y,id:N})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,E(f),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let h=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return h&&h.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){E(f)({target:this,isTrusted:!1})}},!1,d))),E(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function af({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:E((c,f,p)=>{let[g,m]=p,{id:d,styleId:h}=me(f,e,t.styleMirror);return(d&&d!==-1||h&&h!==-1)&&s({id:d,styleId:h,adds:[{rule:g,index:m}]}),c.apply(f,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,f,p=this.cssRules.length){let g=`${c} { ${f} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:E((c,f,p)=>{let[g]=p,{id:m,styleId:d}=me(f,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(f,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:E((c,f,p)=>{let[g]=p,{id:m,styleId:d}=me(f,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(f,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:E((c,f,p)=>{let[g]=p,{id:m,styleId:d}=me(f,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(f,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,f])=>{u[c]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(u[c].insertRule,{apply:E((p,g,m)=>{let[d,h]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),h||0]}]}),p.apply(g,m)})}),f.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:E((p,g,m)=>{let[d]=m,{id:h,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||b&&b!==-1)&&s({id:h,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),E(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,f])=>{f.prototype.insertRule=u[c].insertRule,f.prototype.deleteRule=u[c].deleteRule})})}function Bo({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let f=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return f}}),E(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function lf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:E((l,a,u)=>{var c;let[f,p,g]=u;if(t.has(f))return n.apply(a,[f,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:f,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:E((l,a,u)=>{var c;let[f]=u;if(t.has(f))return o.apply(a,[f]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:f},index:er(a.parentRule)}),l.apply(a,u)})}),E(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function uf({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=E(a=>st(E(u=>{let c=lt(u);if(!c||X(c,e,t,!0))return;let{currentTime:f,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:f,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Me.Play),n),Z("pause",o(Me.Pause),n),Z("seeked",o(Me.Seeked),n),Z("volumechange",o(Me.VolumeChange),n),Z("ratechange",o(Me.RateChange),n)];return E(()=>{l.forEach(a=>a())})}function cf({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let f=new n(a,u,c);return i.set(f,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),f};let o=Ie(e.fonts,"add",function(l){return function(a){return setTimeout(E(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),E(()=>{r.forEach(l=>l())})}function hf(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=E(()=>{let a=e.getSelection();if(!a||o&&a?.isCollapsed)return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let f=0;f{}:Ie(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function df(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:f,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),f(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function pf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};df(s,e);let r;s.recordDOM&&(r=Fo(s,s.doc));let i=tf(s),n=rf(s),o=Uo(s),l=sf(s,{win:t}),a=of(s),u=uf(s),c=()=>{},f=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=af(s,{win:t}),f=Bo(s,s.doc),p=lf(s,{win:t}),s.collectFonts&&(g=cf(s)));let m=hf(s),d=ff(s),h=[];for(let b of s.plugins)h.push(b.observer(b.callback,t,b.options));return E(()=>{be.forEach(b=>b.reset()),r?.disconnect(),i(),n(),o(),l(),a(),u(),c(),f(),p(),g(),m(),d(),h.forEach(b=>b())})}function Tt(s){return typeof window[s]<"u"}function _t(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}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);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},gs=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(Qi)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(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){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.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||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==$o.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ys=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(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(!He(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Fo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Uo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Bo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ie(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&Po(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ge=0;Ge>2],i+=Ae[(e[t]&3)<<4|e[t+1]>>4],i+=Ae[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ae[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Vi=new Map;function yf(s,e){let t=Vi.get(s);return t||(t=new Map,Vi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var Wo=(s,e,t)=>{if(!s||!(Vo(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=yf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=gf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(Vo(s,e)||typeof s=="object"){let r=s.constructor.name,i=Wo(s,e,t);return{rr_type:r,index:i}}}}return s}var zo=(s,e,t)=>s.map(r=>Ft(r,e,t)),Vo=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function wf(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ie(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=zo(u,e,this);s(this.canvas,{type:$e["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:$e["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function bf(s){return s==="experimental-webgl"?"webgl":s}function Gi(s,e,t,r){let i=[];try{let n=Ie(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=bf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ji(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ie(s,a,function(c){return function(...f){let p=c.apply(this,f);if(Wo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=zo(f,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch{let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Sf(s,e,t,r){let i=[];return i.push(...ji(e.WebGLRenderingContext.prototype,$e.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...ji(e.WebGL2RenderingContext.prototype,$e.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Go="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",vf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Hi=typeof window<"u"&&window.Blob&&new Blob([vf(Go)],{type:"text/javascript;charset=utf-8"});function Cf(s){let e;try{if(e=Hi&&(window.URL||window.webkitURL).createObjectURL(Hi),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Go,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var ws=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}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,r,i,n){let o=Gi(t,r,i,!0),l=new Map,a=new Cf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:h,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:b}]},0,0]}]})};let u=1e3/e,c=0,f,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c{var h;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((h=y?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),f=requestAnimationFrame(g)};f=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(f)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Gi(e,t,r,!1),n=wf(this.processMutation.bind(this),e,t,r),o=Sf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},bs=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new fs),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Ji(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Ss=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){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(){}},W,Ut,Dr,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Zs=s.contentWindow)==null?void 0:Zs.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=Ea();function pe(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:h,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:N=!0,recordCanvas:D=!1,recordCrossOriginIframes:z=!1,recordAfter:_=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:V=!1,collectFonts:H=!1,inlineImages:Q=!1,plugins:ne,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:Fe=new Set([]),errorHandler:Ue}=s;qh(Ue);let G=z?window.parent===window:!0,q=!1;if(!G)try{window.parent.document&&(q=!1)}catch{q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=f===!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}:p!==void 0?p:{password:!0},oe=rn(g);Zh();let Gs,pr=0,js=R=>{for(let te of ne||[])te.eventProcessor&&(R=te.eventProcessor(R));return b&&!q&&(R=b(R)),R};W=(R,te)=>{var U;let B=R;if(B.timestamp=qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===I.Mutation)&&be.forEach(K=>K.unfreeze()),G)e?.(js(B),te);else if(q){let K={type:"rrweb",event:js(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Gs=B,pr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===I.Mutation&&B.data.isAttachIframe)return;pr++;let K=r&&pr>=r,T=t&&B.timestamp-Gs.timestamp>t;(K||T)&&Ut(!0)}};let ut=R=>{W({type:x.IncrementalSnapshot,data:{source:I.Mutation,...R}})},Hs=R=>W({type:x.IncrementalSnapshot,data:{source:I.Scroll,...R}}),Ys=R=>W({type:x.IncrementalSnapshot,data:{source:I.CanvasMutation,...R}}),Yo=R=>W({type:x.IncrementalSnapshot,data:{source:I.AdoptedStyleSheet,...R}}),ye=new bs({mutationCb:ut,adoptedStyleSheetCb:Yo}),we=new gs({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:z,wrappedEmit:W});for(let R of ne||[])R.getMirror&&R.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let mr=new Ss;Dr=new ws({recordCanvas:D,mutationCb:Ys,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new ys({mutationCb:ut,scrollCb:Hs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:D,inlineImages:Q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:Dr,keepIframeSrcFn:M,processedNodeManager:mr},mirror:re});Ut=(R=!1)=>{if(!N)return;W({type:x.Meta,data:{href:window.location.href,width:Ao(),height:Ro()}},R),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=Za(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:D,inlineImages:Q,onSerialize:U=>{To(U,re)&&we.addIframe(U),_o(U,re)&&ye.trackLinkElement(U),hs(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:M});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:No(window)}},R),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let R=[],te=B=>{var K;return E(pf)({mutationCb:ut,mousemoveCb:(T,gr)=>W({type:x.IncrementalSnapshot,data:{source:gr,positions:T}}),mouseInteractionCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.MouseInteraction,...T}}),scrollCb:Hs,viewportResizeCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.ViewportResize,...T}}),inputCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.Input,...T}}),mediaInteractionCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.MediaInteraction,...T}}),styleSheetRuleCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.StyleSheetRule,...T}}),styleDeclarationCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.StyleDeclaration,...T}}),canvasMutationCb:Ys,fontCb:T=>W({type:x.IncrementalSnapshot,data:{source:I.Font,...T}}),selectionCb:T=>{W({type:x.IncrementalSnapshot,data:{source:I.Selection,...T}})},customElementCb:T=>{W({type:x.IncrementalSnapshot,data:{source:I.CustomElement,...T}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:N,recordCanvas:D,inlineImages:Q,userTriggeredOnInput:V,collectFonts:H,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:M,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:mr,canvasManager:Dr,ignoreCSSAttributes:Fe,plugins:((K=ne?.filter(T=>T.observer))==null?void 0:K.map(T=>({observer:T.observer,options:T.options,callback:gr=>W({type:x.Plugin,data:{plugin:T.name,payload:gr}})})))||[]},h)};we.addLoadListener(B=>{try{R.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),R.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(R.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),_==="DOMContentLoaded"&&U()})),R.push(Z("load",()=>{W({type:x.Load,data:{}}),_==="load"&&U()},window))),()=>{R.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),mr.destroy(),rr=!1,ef()}}catch(R){console.warn(R)}}pe.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};pe.freezePage=()=>{be.forEach(s=>s.freeze())};pe.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};pe.mirror=re;var Yi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Yi||(Yi={}));var id=5*1e3;var{addCustomEvent:nd}=pe,{freezePage:od}=pe,{takeFullSnapshot:ad}=pe;var Le=null;function jo(s,e){if(typeof document>"u"||typeof window>"u")return;Le&&Le();let t=s.maxEventsPerChunk??200,r=s.flushIntervalMs??1e4,i=s.maxPayloadBytes??1048576,n=[],o=0,l=null;function a(d){if(n.length===0)return;let h=JSON.stringify(n);if(new TextEncoder().encode(h).length>i){if(n.length>1){let v=Math.floor(n.length/2),N=n.slice(0,v),D=n.slice(v),z=d&&N.some(_=>_.type===2);n=N,a(z),n=D,a(!1);return}n=[];return}let S=n[0].timestamp,y=n[n.length-1].timestamp;try{e({chunk_index:o,events_count:n.length,is_full_snapshot:d,started_at:new Date(S).toISOString(),ended_at:new Date(y).toISOString(),payload:h}),o+=1,n=[]}catch(v){throw console.error("[ReplayRecorder] sendChunk failed",v),v}}function u(d){let h=d||n.some(b=>b.type===2);n.length>=t?a(h):d&&n.length>0&&a(!0)}let c=s.maskAllText!==!1,f=s.unmaskTextSelector,p=pe({emit(d,h){n.push(d),u(!!h)},checkoutEveryNms:r,maskAllInputs:s.maskAllInputs??!0,maskTextSelector:c?"*":"[data-openpanel-replay-mask]",maskTextFn:c&&f?(d,h)=>h?.closest(f)?d:d.replace(/\S/g,"*"):void 0,blockSelector:s.blockSelector??"[data-openpanel-replay-block]",blockClass:s.blockClass,ignoreSelector:s.ignoreSelector});l=setInterval(()=>{if(n.length>0){let d=n.some(h=>h.type===2);a(d)}},r);function g(){if(document.visibilityState==="hidden"&&n.length>0){let d=n.some(h=>h.type===2);a(d)}}function m(){if(n.length>0){let d=n.some(h=>h.type===2);a(d)}}document.addEventListener("visibilitychange",g),window.addEventListener("pagehide",m),Le=()=>{if(n.length>0){let d=n.some(h=>h.type===2);a(d)}l&&(clearInterval(l),l=null),document.removeEventListener("visibilitychange",g),window.removeEventListener("pagehide",m),p?.(),Le=null}}function Ho(){Le&&Le()}return qo(If);})(); +or you can use record.mirror to access the mirror instance during recording.`, + Li = { + map: {}, + getId() { + return console.error(xe), -1; + }, + getNode() { + return console.error(xe), null; + }, + removeNodeFromMap() { + console.error(xe); + }, + has() { + return console.error(xe), !1; + }, + reset() { + console.error(xe); + }, + }; + typeof window < 'u' && + window.Proxy && + window.Reflect && + (Li = new Proxy(Li, { + get(s, e, t) { + return e === 'map' && console.error(xe), Reflect.get(s, e, t); + }, + })); + function st(s, e, t = {}) { + let r = null, + i = 0; + return function (...n) { + const o = Date.now(); + !i && t.leading === !1 && (i = o); + const l = e - (o - i); + l <= 0 || l > e + ? (r && (clearTimeout(r), (r = null)), (i = o), s.apply(this, n)) + : !r && + t.trailing !== !1 && + (r = setTimeout(() => { + (i = t.leading === !1 ? 0 : Date.now()), + (r = null), + s.apply(this, n); + }, l)); + }; + } + function dr(s, e, t, r, i = window) { + const n = i.Object.getOwnPropertyDescriptor(s, e); + return ( + i.Object.defineProperty( + s, + e, + r + ? t + : { + set(o) { + setTimeout(() => { + t.set.call(this, o); + }, 0), + n && n.set && n.set.call(this, o); + }, + } + ), + () => dr(s, e, n || {}, !0) + ); + } + var qt = Date.now; + /[1-9][0-9]{12}/.test(Date.now().toString()) || + (qt = () => new Date().getTime()); + function No(s) { + var e, t, r, i; + const n = s.document; + return { + left: n.scrollingElement + ? n.scrollingElement.scrollLeft + : s.pageXOffset !== void 0 + ? s.pageXOffset + : n.documentElement.scrollLeft || + (n?.body && + ((e = C.parentElement(n.body)) == null + ? void 0 + : e.scrollLeft)) || + ((t = n?.body) == null ? void 0 : t.scrollLeft) || + 0, + top: n.scrollingElement + ? n.scrollingElement.scrollTop + : s.pageYOffset !== void 0 + ? s.pageYOffset + : n?.documentElement.scrollTop || + (n?.body && + ((r = C.parentElement(n.body)) == null ? void 0 : r.scrollTop)) || + ((i = n?.body) == null ? void 0 : i.scrollTop) || + 0, + }; + } + function Ro() { + return ( + window.innerHeight || + (document.documentElement && document.documentElement.clientHeight) || + (document.body && document.body.clientHeight) + ); + } + function Ao() { + return ( + window.innerWidth || + (document.documentElement && document.documentElement.clientWidth) || + (document.body && document.body.clientWidth) + ); + } + function Oo(s) { + return s ? (s.nodeType === s.ELEMENT_NODE ? s : C.parentElement(s)) : null; + } + function X(s, e, t, r) { + if (!s) { + return !1; + } + const i = Oo(s); + if (!i) { + return !1; + } + try { + if (typeof e == 'string') { + if (i.classList.contains(e) || (r && i.closest('.' + e) !== null)) { + return !0; + } + } else if (Gt(i, e, r)) { + return !0; + } + } catch {} + return !!(t && (i.matches(t) || (r && i.closest(t) !== null))); + } + function Yh(s, e) { + return e.getId(s) !== -1; + } + function Or(s, e, t) { + return s.tagName === 'TITLE' && t.headTitleMutations + ? !0 + : e.getId(s) === Ze; + } + function Do(s, e) { + if (je(s)) { + return !1; + } + const t = e.getId(s); + if (!e.has(t)) { + return !0; + } + const r = C.parentNode(s); + return r && r.nodeType === s.DOCUMENT_NODE ? !1 : r ? Do(r, e) : !0; + } + function cs(s) { + return !!s.changedTouches; + } + function Zh(s = window) { + 'NodeList' in s && + !s.NodeList.prototype.forEach && + (s.NodeList.prototype.forEach = Array.prototype.forEach), + 'DOMTokenList' in s && + !s.DOMTokenList.prototype.forEach && + (s.DOMTokenList.prototype.forEach = Array.prototype.forEach); + } + function To(s, e) { + return !!(s.nodeName === 'IFRAME' && e.getMeta(s)); + } + function _o(s, e) { + return !!( + s.nodeName === 'LINK' && + s.nodeType === s.ELEMENT_NODE && + s.getAttribute && + s.getAttribute('rel') === 'stylesheet' && + e.getMeta(s) + ); + } + function hs(s) { + return s + ? s instanceof us && 'shadowRoot' in s + ? !!s.shadowRoot + : !!C.shadowRoot(s) + : !1; + } + var fs = class { + constructor() { + w(this, 'id', 1), + w(this, 'styleIDMap', new WeakMap()), + w(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 r; + return ( + t === void 0 ? (r = this.id++) : (r = t), + this.styleIDMap.set(e, r), + this.idStyleMap.set(r, e), + r + ); + } + 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 ko(s) { + var e; + let t = null; + return ( + 'getRootNode' in s && + ((e = C.getRootNode(s)) == null ? void 0 : e.nodeType) === + Node.DOCUMENT_FRAGMENT_NODE && + C.host(C.getRootNode(s)) && + (t = C.host(C.getRootNode(s))), + t + ); + } + function Xh(s) { + let e = s, + t; + while ((t = ko(e))) { + e = t; + } + return e; + } + function Jh(s) { + const e = C.ownerDocument(s); + if (!e) { + return !1; + } + const t = Xh(s); + return C.contains(e, t); + } + function Po(s) { + const e = C.ownerDocument(s); + return e ? C.contains(e, s) || Jh(s) : !1; + } + var x = ((s) => ( + (s[(s.DomContentLoaded = 0)] = 'DomContentLoaded'), + (s[(s.Load = 1)] = 'Load'), + (s[(s.FullSnapshot = 2)] = 'FullSnapshot'), + (s[(s.IncrementalSnapshot = 3)] = 'IncrementalSnapshot'), + (s[(s.Meta = 4)] = 'Meta'), + (s[(s.Custom = 5)] = 'Custom'), + (s[(s.Plugin = 6)] = 'Plugin'), + s + ))(x || {}), + I = ((s) => ( + (s[(s.Mutation = 0)] = 'Mutation'), + (s[(s.MouseMove = 1)] = 'MouseMove'), + (s[(s.MouseInteraction = 2)] = 'MouseInteraction'), + (s[(s.Scroll = 3)] = 'Scroll'), + (s[(s.ViewportResize = 4)] = 'ViewportResize'), + (s[(s.Input = 5)] = 'Input'), + (s[(s.TouchMove = 6)] = 'TouchMove'), + (s[(s.MediaInteraction = 7)] = 'MediaInteraction'), + (s[(s.StyleSheetRule = 8)] = 'StyleSheetRule'), + (s[(s.CanvasMutation = 9)] = 'CanvasMutation'), + (s[(s.Font = 10)] = 'Font'), + (s[(s.Log = 11)] = 'Log'), + (s[(s.Drag = 12)] = 'Drag'), + (s[(s.StyleDeclaration = 13)] = 'StyleDeclaration'), + (s[(s.Selection = 14)] = 'Selection'), + (s[(s.AdoptedStyleSheet = 15)] = 'AdoptedStyleSheet'), + (s[(s.CustomElement = 16)] = 'CustomElement'), + s + ))(I || {}), + J = ((s) => ( + (s[(s.MouseUp = 0)] = 'MouseUp'), + (s[(s.MouseDown = 1)] = 'MouseDown'), + (s[(s.Click = 2)] = 'Click'), + (s[(s.ContextMenu = 3)] = 'ContextMenu'), + (s[(s.DblClick = 4)] = 'DblClick'), + (s[(s.Focus = 5)] = 'Focus'), + (s[(s.Blur = 6)] = 'Blur'), + (s[(s.TouchStart = 7)] = 'TouchStart'), + (s[(s.TouchMove_Departed = 8)] = 'TouchMove_Departed'), + (s[(s.TouchEnd = 9)] = 'TouchEnd'), + (s[(s.TouchCancel = 10)] = 'TouchCancel'), + s + ))(J || {}), + ue = ((s) => ( + (s[(s.Mouse = 0)] = 'Mouse'), + (s[(s.Pen = 1)] = 'Pen'), + (s[(s.Touch = 2)] = 'Touch'), + s + ))(ue || {}), + $e = ((s) => ( + (s[(s['2D'] = 0)] = '2D'), + (s[(s.WebGL = 1)] = 'WebGL'), + (s[(s.WebGL2 = 2)] = 'WebGL2'), + s + ))($e || {}), + Me = ((s) => ( + (s[(s.Play = 0)] = 'Play'), + (s[(s.Pause = 1)] = 'Pause'), + (s[(s.Seeked = 2)] = 'Seeked'), + (s[(s.VolumeChange = 3)] = 'VolumeChange'), + (s[(s.RateChange = 4)] = 'RateChange'), + s + ))(Me || {}); + var $o = ((s) => ( + (s[(s.Document = 0)] = 'Document'), + (s[(s.DocumentType = 1)] = 'DocumentType'), + (s[(s.Element = 2)] = 'Element'), + (s[(s.Text = 3)] = 'Text'), + (s[(s.CDATA = 4)] = 'CDATA'), + (s[(s.Comment = 5)] = 'Comment'), + s + ))($o || {}); + function Fi(s) { + return '__ln' in s; + } + var ds = class { + constructor() { + w(this, 'length', 0), w(this, 'head', null), w(this, 'tail', null); + } + get(e) { + if (e >= this.length) { + throw new Error('Position outside of list range'); + } + let t = this.head; + for (let r = 0; r < e; r++) { + t = t?.next || null; + } + return t; + } + addNode(e) { + const t = { value: e, previous: null, next: null }; + if (((e.__ln = t), e.previousSibling && Fi(e.previousSibling))) { + const r = e.previousSibling.__ln.next; + (t.next = r), + (t.previous = e.previousSibling.__ln), + (e.previousSibling.__ln.next = t), + r && (r.previous = t); + } else if ( + e.nextSibling && + Fi(e.nextSibling) && + e.nextSibling.__ln.previous + ) { + const r = e.nextSibling.__ln.previous; + (t.previous = r), + (t.next = e.nextSibling.__ln), + (e.nextSibling.__ln.previous = t), + r && (r.next = t); + } else { + this.head && (this.head.previous = t), + (t.next = this.head), + (this.head = t); + } + t.next === null && (this.tail = t), this.length++; + } + removeNode(e) { + const t = e.__ln; + this.head && + (t.previous + ? ((t.previous.next = t.next), + t.next + ? (t.next.previous = t.previous) + : (this.tail = t.previous)) + : ((this.head = t.next), + this.head ? (this.head.previous = null) : (this.tail = null)), + e.__ln && delete e.__ln, + this.length--); + } + }, + Ui = (s, e) => `${s}@${e}`, + ps = class { + constructor() { + w(this, 'frozen', !1), + w(this, 'locked', !1), + w(this, 'texts', []), + w(this, 'attributes', []), + w(this, 'attributeMap', new WeakMap()), + w(this, 'removes', []), + w(this, 'mapRemoves', []), + w(this, 'movedMap', {}), + w(this, 'addedSet', new Set()), + w(this, 'movedSet', new Set()), + w(this, 'droppedSet', new Set()), + w(this, 'removesSubTreeCache', new Set()), + w(this, 'mutationCb'), + w(this, 'blockClass'), + w(this, 'blockSelector'), + w(this, 'maskTextClass'), + w(this, 'maskTextSelector'), + w(this, 'inlineStylesheet'), + w(this, 'maskInputOptions'), + w(this, 'maskTextFn'), + w(this, 'maskInputFn'), + w(this, 'keepIframeSrcFn'), + w(this, 'recordCanvas'), + w(this, 'inlineImages'), + w(this, 'slimDOMOptions'), + w(this, 'dataURLOptions'), + w(this, 'doc'), + w(this, 'mirror'), + w(this, 'iframeManager'), + w(this, 'stylesheetManager'), + w(this, 'shadowDomManager'), + w(this, 'canvasManager'), + w(this, 'processedNodeManager'), + w(this, 'unattachedDoc'), + w(this, 'processMutations', (e) => { + e.forEach(this.processMutation), this.emit(); + }), + w(this, 'emit', () => { + if (this.frozen || this.locked) { + return; + } + const e = [], + t = new Set(), + r = new ds(), + i = (a) => { + let u = a, + c = Ze; + while (c === Ze) { + (u = u && u.nextSibling), (c = u && this.mirror.getId(u)); + } + return c; + }, + n = (a) => { + const u = C.parentNode(a); + if (!(u && Po(a))) { + return; + } + let c = !1; + if (a.nodeType === Node.TEXT_NODE) { + const m = u.tagName; + if (m === 'TEXTAREA') { + return; + } + m === 'STYLE' && this.addedSet.has(u) && (c = !0); + } + const f = je(u) + ? this.mirror.getId(ko(a)) + : this.mirror.getId(u), + p = i(a); + if (f === -1 || p === -1) { + return r.addNode(a); + } + const g = Re(a, { + 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: (m) => { + To(m, this.mirror) && this.iframeManager.addIframe(m), + _o(m, this.mirror) && + this.stylesheetManager.trackLinkElement(m), + hs(a) && + this.shadowDomManager.addShadowRoot( + C.shadowRoot(a), + this.doc + ); + }, + onIframeLoad: (m, d) => { + this.iframeManager.attachIframe(m, d), + this.shadowDomManager.observeAttachShadow(m); + }, + onStylesheetLoad: (m, d) => { + this.stylesheetManager.attachLinkElement(m, d); + }, + cssCaptured: c, + }); + g && (e.push({ parentId: f, nextId: p, node: g }), t.add(g.id)); + }; + while (this.mapRemoves.length) { + this.mirror.removeNodeFromMap(this.mapRemoves.shift()); + } + for (const a of this.movedSet) { + (Bi(this.removesSubTreeCache, a, this.mirror) && + !this.movedSet.has(C.parentNode(a))) || + n(a); + } + for (const a of this.addedSet) { + !( + Wi(this.droppedSet, a) || + Bi(this.removesSubTreeCache, a, this.mirror) + ) || Wi(this.movedSet, a) + ? n(a) + : this.droppedSet.add(a); + } + let o = null; + while (r.length) { + let a = null; + if (o) { + const u = this.mirror.getId(C.parentNode(o.value)), + c = i(o.value); + u !== -1 && c !== -1 && (a = o); + } + if (!a) { + let u = r.tail; + while (u) { + const c = u; + if (((u = u.previous), c)) { + const f = this.mirror.getId(C.parentNode(c.value)); + if (i(c.value) === -1) { + continue; + } + if (f !== -1) { + a = c; + break; + } + const g = c.value, + m = C.parentNode(g); + if (m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { + const d = C.host(m); + if (this.mirror.getId(d) !== -1) { + a = c; + break; + } + } + } + } + } + if (!a) { + while (r.head) { + r.removeNode(r.head.value); + } + break; + } + (o = a.previous), r.removeNode(a.value), n(a.value); + } + const l = { + texts: this.texts + .map((a) => { + const u = a.node, + c = C.parentNode(u); + return ( + c && + c.tagName === 'TEXTAREA' && + this.genTextAreaValueMutation(c), + { id: this.mirror.getId(u), value: a.value } + ); + }) + .filter((a) => !t.has(a.id)) + .filter((a) => this.mirror.has(a.id)), + attributes: this.attributes + .map((a) => { + const { attributes: u } = a; + if (typeof u.style == 'string') { + const c = JSON.stringify(a.styleDiff), + f = JSON.stringify(a._unchangedStyles); + c.length < u.style.length && + (c + f).split('var(').length === + u.style.split('var(').length && + (u.style = a.styleDiff); + } + return { id: this.mirror.getId(a.node), attributes: u }; + }) + .filter((a) => !t.has(a.id)) + .filter((a) => this.mirror.has(a.id)), + removes: this.removes, + adds: e, + }; + !( + l.texts.length || + l.attributes.length || + l.removes.length || + l.adds.length + ) || + ((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(l)); + }), + w(this, 'genTextAreaValueMutation', (e) => { + let t = this.attributeMap.get(e); + t || + ((t = { + node: e, + attributes: {}, + styleDiff: {}, + _unchangedStyles: {}, + }), + this.attributes.push(t), + this.attributeMap.set(e, t)); + const r = Array.from( + C.childNodes(e), + (i) => C.textContent(i) || '' + ).join(''); + t.attributes.value = Wt({ + element: e, + maskInputOptions: this.maskInputOptions, + tagName: e.tagName, + type: zt(e), + value: r, + maskInputFn: this.maskInputFn, + }); + }), + w(this, 'processMutation', (e) => { + if (!Or(e.target, this.mirror, this.slimDOMOptions)) { + switch (e.type) { + case 'characterData': { + const t = C.textContent(e.target); + !X(e.target, this.blockClass, this.blockSelector, !1) && + t !== e.oldValue && + this.texts.push({ + value: + tn( + e.target, + this.maskTextClass, + this.maskTextSelector, + !0 + ) && t + ? this.maskTextFn + ? this.maskTextFn(t, Oo(e.target)) + : t.replace(/[\S]/g, '*') + : t, + node: e.target, + }); + break; + } + case 'attributes': { + let t = e.target, + r = e.attributeName, + i = e.target.getAttribute(r); + if (r === 'value') { + const o = zt(t); + i = Wt({ + element: t, + maskInputOptions: this.maskInputOptions, + tagName: t.tagName, + type: o, + value: i, + maskInputFn: this.maskInputFn, + }); + } + if ( + X(e.target, this.blockClass, this.blockSelector, !1) || + i === e.oldValue + ) { + return; + } + let n = this.attributeMap.get(e.target); + if ( + t.tagName === 'IFRAME' && + r === 'src' && + !this.keepIframeSrcFn(i) + ) { + if (t.contentDocument) { + return; + } + r = 'rr_src'; + } + if ( + (n || + ((n = { + node: e.target, + attributes: {}, + styleDiff: {}, + _unchangedStyles: {}, + }), + this.attributes.push(n), + this.attributeMap.set(e.target, n)), + r === 'type' && + t.tagName === 'INPUT' && + (e.oldValue || '').toLowerCase() === 'password' && + t.setAttribute('data-rr-is-password', 'true'), + !en(t.tagName, r)) + ) { + if ( + ((n.attributes[r] = qi( + this.doc, + Se(t.tagName), + Se(r), + i + )), + r === 'style') + ) { + if (!this.unattachedDoc) { + try { + this.unattachedDoc = + document.implementation.createHTMLDocument(); + } catch { + this.unattachedDoc = this.doc; + } + } + const o = this.unattachedDoc.createElement('span'); + e.oldValue && o.setAttribute('style', e.oldValue); + for (const l of Array.from(t.style)) { + const a = t.style.getPropertyValue(l), + u = t.style.getPropertyPriority(l); + a !== o.style.getPropertyValue(l) || + u !== o.style.getPropertyPriority(l) + ? u === '' + ? (n.styleDiff[l] = a) + : (n.styleDiff[l] = [a, u]) + : (n._unchangedStyles[l] = [a, u]); + } + for (const l of Array.from(o.style)) { + t.style.getPropertyValue(l) === '' && + (n.styleDiff[l] = !1); + } + } else { + r === 'open' && + t.tagName === 'DIALOG' && + (t.matches('dialog:modal') + ? (n.attributes.rr_open_mode = 'modal') + : (n.attributes.rr_open_mode = 'non-modal')); + } + } + break; + } + case 'childList': { + if (X(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) => { + const r = this.mirror.getId(t), + i = je(e.target) + ? this.mirror.getId(C.host(e.target)) + : this.mirror.getId(e.target); + X(e.target, this.blockClass, this.blockSelector, !1) || + Or(t, this.mirror, this.slimDOMOptions) || + !Yh(t, this.mirror) || + (this.addedSet.has(t) + ? (ms(this.addedSet, t), this.droppedSet.add(t)) + : (this.addedSet.has(e.target) && r === -1) || + Do(e.target, this.mirror) || + (this.movedSet.has(t) && this.movedMap[Ui(r, i)] + ? ms(this.movedSet, t) + : (this.removes.push({ + parentId: i, + id: r, + isShadow: + je(e.target) && He(e.target) ? !0 : void 0, + }), + Kh(t, this.removesSubTreeCache))), + this.mapRemoves.push(t)); + }); + break; + } + } + } + }), + w(this, 'genAdds', (e, t) => { + if ( + !( + this.processedNodeManager.inOtherBuffer(e, this) || + this.addedSet.has(e) || + this.movedSet.has(e) + ) + ) { + if (this.mirror.hasNode(e)) { + if (Or(e, this.mirror, this.slimDOMOptions)) { + return; + } + this.movedSet.add(e); + let r = null; + t && this.mirror.hasNode(t) && (r = this.mirror.getId(t)), + r && + r !== -1 && + (this.movedMap[Ui(this.mirror.getId(e), r)] = !0); + } else { + this.addedSet.add(e), this.droppedSet.delete(e); + } + X(e, this.blockClass, this.blockSelector, !1) || + (C.childNodes(e).forEach((r) => this.genAdds(r)), + hs(e) && + C.childNodes(C.shadowRoot(e)).forEach((r) => { + this.processedNodeManager.add(r, this), this.genAdds(r, 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 ms(s, e) { + s.delete(e), C.childNodes(e).forEach((t) => ms(s, t)); + } + function Kh(s, e) { + const t = [s]; + while (t.length) { + const r = t.pop(); + e.has(r) || (e.add(r), C.childNodes(r).forEach((i) => t.push(i))); + } + } + function Bi(s, e, t) { + return s.size === 0 ? !1 : Qh(s, e); + } + function Qh(s, e, t) { + const r = C.parentNode(e); + return r ? s.has(r) : !1; + } + function Wi(s, e) { + return s.size === 0 ? !1 : Lo(s, e); + } + function Lo(s, e) { + const t = C.parentNode(e); + return t ? (s.has(t) ? !0 : Lo(s, t)) : !1; + } + var Ye; + function qh(s) { + Ye = s; + } + function ef() { + Ye = void 0; + } + var E = (s) => + Ye + ? (...t) => { + try { + return s(...t); + } catch (r) { + if (Ye && Ye(r) === !0) { + return; + } + throw r; + } + } + : s, + be = []; + function lt(s) { + try { + if ('composedPath' in s) { + const e = s.composedPath(); + if (e.length) { + return e[0]; + } + } else if ('path' in s && s.path.length) { + return s.path[0]; + } + } catch {} + return s && s.target; + } + function Fo(s, e) { + const t = new ps(); + be.push(t), t.init(s); + const r = new (Mo())(E(t.processMutations.bind(t))); + return ( + r.observe(e, { + attributes: !0, + attributeOldValue: !0, + characterData: !0, + characterDataOldValue: !0, + childList: !0, + subtree: !0, + }), + r + ); + } + function tf({ mousemoveCb: s, sampling: e, doc: t, mirror: r }) { + if (e.mousemove === !1) { + return () => {}; + } + let i = typeof e.mousemove == 'number' ? e.mousemove : 50, + n = typeof e.mousemoveCallback == 'number' ? e.mousemoveCallback : 500, + o = [], + l, + a = st( + E((f) => { + const p = Date.now() - l; + s( + o.map((g) => ((g.timeOffset -= p), g)), + f + ), + (o = []), + (l = null); + }), + n + ), + u = E( + st( + E((f) => { + const p = lt(f), + { clientX: g, clientY: m } = cs(f) ? f.changedTouches[0] : f; + l || (l = qt()), + o.push({ x: g, y: m, id: r.getId(p), timeOffset: qt() - l }), + a( + typeof DragEvent < 'u' && f instanceof DragEvent + ? I.Drag + : f instanceof MouseEvent + ? I.MouseMove + : I.TouchMove + ); + }), + i, + { trailing: !1 } + ) + ), + c = [Z('mousemove', u, t), Z('touchmove', u, t), Z('drag', u, t)]; + return E(() => { + c.forEach((f) => f()); + }); + } + function rf({ + mouseInteractionCb: s, + doc: e, + mirror: t, + blockClass: r, + blockSelector: i, + sampling: n, + }) { + if (n.mouseInteraction === !1) { + return () => {}; + } + let o = + n.mouseInteraction === !0 || n.mouseInteraction === void 0 + ? {} + : n.mouseInteraction, + l = [], + a = null, + u = (c) => (f) => { + const p = lt(f); + if (X(p, r, i, !0)) { + return; + } + let g = null, + m = c; + if ('pointerType' in f) { + switch (f.pointerType) { + case 'mouse': + g = ue.Mouse; + break; + case 'touch': + g = ue.Touch; + break; + case 'pen': + g = ue.Pen; + break; + } + g === ue.Touch + ? J[c] === J.MouseDown + ? (m = 'TouchStart') + : J[c] === J.MouseUp && (m = 'TouchEnd') + : ue.Pen; + } else { + cs(f) && (g = ue.Touch); + } + g !== null + ? ((a = g), + ((m.startsWith('Touch') && g === ue.Touch) || + (m.startsWith('Mouse') && g === ue.Mouse)) && + (g = null)) + : J[c] === J.Click && ((g = a), (a = null)); + const d = cs(f) ? f.changedTouches[0] : f; + if (!d) { + return; + } + const h = t.getId(p), + { clientX: b, clientY: S } = d; + E(s)({ + type: J[m], + id: h, + x: b, + y: S, + ...(g !== null && { pointerType: g }), + }); + }; + return ( + Object.keys(J) + .filter( + (c) => + Number.isNaN(Number(c)) && !c.endsWith('_Departed') && o[c] !== !1 + ) + .forEach((c) => { + let f = Se(c), + p = u(c); + if (window.PointerEvent) { + switch (J[c]) { + case J.MouseDown: + case J.MouseUp: + f = f.replace('mouse', 'pointer'); + break; + case J.TouchStart: + case J.TouchEnd: + return; + } + } + l.push(Z(f, p, e)); + }), + E(() => { + l.forEach((c) => c()); + }) + ); + } + function Uo({ + scrollCb: s, + doc: e, + mirror: t, + blockClass: r, + blockSelector: i, + sampling: n, + }) { + const o = E( + st( + E((l) => { + const a = lt(l); + if (!a || X(a, r, i, !0)) { + return; + } + const u = t.getId(a); + if (a === e && e.defaultView) { + const c = No(e.defaultView); + s({ id: u, x: c.left, y: c.top }); + } else { + s({ id: u, x: a.scrollLeft, y: a.scrollTop }); + } + }), + n.scroll || 100 + ) + ); + return Z('scroll', o, e); + } + function sf({ viewportResizeCb: s }, { win: e }) { + let t = -1, + r = -1, + i = E( + st( + E(() => { + const n = Ro(), + o = Ao(); + (t !== n || r !== o) && + (s({ width: Number(o), height: Number(n) }), (t = n), (r = o)); + }), + 200 + ) + ); + return Z('resize', i, e); + } + var nf = ['INPUT', 'TEXTAREA', 'SELECT'], + zi = new WeakMap(); + function of({ + inputCb: s, + doc: e, + mirror: t, + blockClass: r, + blockSelector: i, + ignoreClass: n, + ignoreSelector: o, + maskInputOptions: l, + maskInputFn: a, + sampling: u, + userTriggeredOnInput: c, + }) { + function f(S) { + let y = lt(S), + v = S.isTrusted, + N = y && y.tagName; + if ( + (y && N === 'OPTION' && (y = C.parentElement(y)), + !(y && N) || + nf.indexOf(N) < 0 || + X(y, r, i, !0) || + y.classList.contains(n) || + (o && y.matches(o))) + ) { + return; + } + let D = y.value, + z = !1, + _ = zt(y) || ''; + _ === 'radio' || _ === 'checkbox' + ? (z = y.checked) + : (l[N.toLowerCase()] || l[_]) && + (D = Wt({ + element: y, + maskInputOptions: l, + tagName: N, + type: _, + value: D, + maskInputFn: a, + })), + p( + y, + c + ? { text: D, isChecked: z, userTriggered: v } + : { text: D, isChecked: z } + ); + const V = y.name; + _ === 'radio' && + V && + z && + e.querySelectorAll(`input[type="radio"][name="${V}"]`).forEach((H) => { + if (H !== y) { + const Q = H.value; + p( + H, + c + ? { text: Q, isChecked: !z, userTriggered: !1 } + : { text: Q, isChecked: !z } + ); + } + }); + } + function p(S, y) { + const v = zi.get(S); + if (!v || v.text !== y.text || v.isChecked !== y.isChecked) { + zi.set(S, y); + const N = t.getId(S); + E(s)({ ...y, id: N }); + } + } + const m = (u.input === 'last' ? ['change'] : ['input', 'change']).map((S) => + Z(S, E(f), e) + ), + d = e.defaultView; + if (!d) { + return () => { + m.forEach((S) => S()); + }; + } + const h = d.Object.getOwnPropertyDescriptor( + d.HTMLInputElement.prototype, + 'value' + ), + b = [ + [d.HTMLInputElement.prototype, 'value'], + [d.HTMLInputElement.prototype, 'checked'], + [d.HTMLSelectElement.prototype, 'value'], + [d.HTMLTextAreaElement.prototype, 'value'], + [d.HTMLSelectElement.prototype, 'selectedIndex'], + [d.HTMLOptionElement.prototype, 'selected'], + ]; + return ( + h && + h.set && + m.push( + ...b.map((S) => + dr( + S[0], + S[1], + { + set() { + E(f)({ target: this, isTrusted: !1 }); + }, + }, + !1, + d + ) + ) + ), + E(() => { + m.forEach((S) => S()); + }) + ); + } + function er(s) { + const e = []; + function t(r, i) { + if ( + (Tt('CSSGroupingRule') && r.parentRule instanceof CSSGroupingRule) || + (Tt('CSSMediaRule') && r.parentRule instanceof CSSMediaRule) || + (Tt('CSSSupportsRule') && r.parentRule instanceof CSSSupportsRule) || + (Tt('CSSConditionRule') && r.parentRule instanceof CSSConditionRule) + ) { + const o = Array.from(r.parentRule.cssRules).indexOf(r); + i.unshift(o); + } else if (r.parentStyleSheet) { + const o = Array.from(r.parentStyleSheet.cssRules).indexOf(r); + i.unshift(o); + } + return i; + } + return t(s, e); + } + function me(s, e, t) { + let r, i; + return s + ? (s.ownerNode ? (r = e.getId(s.ownerNode)) : (i = t.getId(s)), + { styleId: i, id: r }) + : {}; + } + function af( + { styleSheetRuleCb: s, mirror: e, stylesheetManager: t }, + { win: r } + ) { + if (!(r.CSSStyleSheet && r.CSSStyleSheet.prototype)) { + return () => {}; + } + const i = r.CSSStyleSheet.prototype.insertRule; + (r.CSSStyleSheet.prototype.insertRule = new Proxy(i, { + apply: E((c, f, p) => { + const [g, m] = p, + { id: d, styleId: h } = me(f, e, t.styleMirror); + return ( + ((d && d !== -1) || (h && h !== -1)) && + s({ id: d, styleId: h, adds: [{ rule: g, index: m }] }), + c.apply(f, p) + ); + }), + })), + (r.CSSStyleSheet.prototype.addRule = function ( + c, + f, + p = this.cssRules.length + ) { + const g = `${c} { ${f} }`; + return r.CSSStyleSheet.prototype.insertRule.apply(this, [g, p]); + }); + const n = r.CSSStyleSheet.prototype.deleteRule; + (r.CSSStyleSheet.prototype.deleteRule = new Proxy(n, { + apply: E((c, f, p) => { + const [g] = p, + { id: m, styleId: d } = me(f, e, t.styleMirror); + return ( + ((m && m !== -1) || (d && d !== -1)) && + s({ id: m, styleId: d, removes: [{ index: g }] }), + c.apply(f, p) + ); + }), + })), + (r.CSSStyleSheet.prototype.removeRule = function (c) { + return r.CSSStyleSheet.prototype.deleteRule.apply(this, [c]); + }); + let o; + r.CSSStyleSheet.prototype.replace && + ((o = r.CSSStyleSheet.prototype.replace), + (r.CSSStyleSheet.prototype.replace = new Proxy(o, { + apply: E((c, f, p) => { + const [g] = p, + { id: m, styleId: d } = me(f, e, t.styleMirror); + return ( + ((m && m !== -1) || (d && d !== -1)) && + s({ id: m, styleId: d, replace: g }), + c.apply(f, p) + ); + }), + }))); + let l; + r.CSSStyleSheet.prototype.replaceSync && + ((l = r.CSSStyleSheet.prototype.replaceSync), + (r.CSSStyleSheet.prototype.replaceSync = new Proxy(l, { + apply: E((c, f, p) => { + const [g] = p, + { id: m, styleId: d } = me(f, e, t.styleMirror); + return ( + ((m && m !== -1) || (d && d !== -1)) && + s({ id: m, styleId: d, replaceSync: g }), + c.apply(f, p) + ); + }), + }))); + const a = {}; + _t('CSSGroupingRule') + ? (a.CSSGroupingRule = r.CSSGroupingRule) + : (_t('CSSMediaRule') && (a.CSSMediaRule = r.CSSMediaRule), + _t('CSSConditionRule') && (a.CSSConditionRule = r.CSSConditionRule), + _t('CSSSupportsRule') && (a.CSSSupportsRule = r.CSSSupportsRule)); + const u = {}; + return ( + Object.entries(a).forEach(([c, f]) => { + (u[c] = { + insertRule: f.prototype.insertRule, + deleteRule: f.prototype.deleteRule, + }), + (f.prototype.insertRule = new Proxy(u[c].insertRule, { + apply: E((p, g, m) => { + const [d, h] = m, + { id: b, styleId: S } = me( + g.parentStyleSheet, + e, + t.styleMirror + ); + return ( + ((b && b !== -1) || (S && S !== -1)) && + s({ + id: b, + styleId: S, + adds: [{ rule: d, index: [...er(g), h || 0] }], + }), + p.apply(g, m) + ); + }), + })), + (f.prototype.deleteRule = new Proxy(u[c].deleteRule, { + apply: E((p, g, m) => { + const [d] = m, + { id: h, styleId: b } = me( + g.parentStyleSheet, + e, + t.styleMirror + ); + return ( + ((h && h !== -1) || (b && b !== -1)) && + s({ id: h, styleId: b, removes: [{ index: [...er(g), d] }] }), + p.apply(g, m) + ); + }), + })); + }), + E(() => { + (r.CSSStyleSheet.prototype.insertRule = i), + (r.CSSStyleSheet.prototype.deleteRule = n), + o && (r.CSSStyleSheet.prototype.replace = o), + l && (r.CSSStyleSheet.prototype.replaceSync = l), + Object.entries(a).forEach(([c, f]) => { + (f.prototype.insertRule = u[c].insertRule), + (f.prototype.deleteRule = u[c].deleteRule); + }); + }) + ); + } + function Bo({ mirror: s, stylesheetManager: e }, t) { + var r, i, n; + let o = null; + t.nodeName === '#document' ? (o = s.getId(t)) : (o = s.getId(C.host(t))); + const l = + t.nodeName === '#document' + ? (r = t.defaultView) == null + ? void 0 + : r.Document + : (n = (i = t.ownerDocument) == null ? void 0 : i.defaultView) == null + ? void 0 + : n.ShadowRoot, + a = l?.prototype + ? Object.getOwnPropertyDescriptor(l?.prototype, 'adoptedStyleSheets') + : void 0; + return o === null || o === -1 || !l || !a + ? () => {} + : (Object.defineProperty(t, 'adoptedStyleSheets', { + configurable: a.configurable, + enumerable: a.enumerable, + get() { + var u; + return (u = a.get) == null ? void 0 : u.call(this); + }, + set(u) { + var c; + const f = (c = a.set) == null ? void 0 : c.call(this, u); + if (o !== null && o !== -1) { + try { + e.adoptStyleSheets(u, o); + } catch {} + } + return f; + }, + }), + E(() => { + Object.defineProperty(t, 'adoptedStyleSheets', { + configurable: a.configurable, + enumerable: a.enumerable, + get: a.get, + set: a.set, + }); + })); + } + function lf( + { + styleDeclarationCb: s, + mirror: e, + ignoreCSSAttributes: t, + stylesheetManager: r, + }, + { win: i } + ) { + const n = i.CSSStyleDeclaration.prototype.setProperty; + i.CSSStyleDeclaration.prototype.setProperty = new Proxy(n, { + apply: E((l, a, u) => { + var c; + const [f, p, g] = u; + if (t.has(f)) { + return n.apply(a, [f, p, g]); + } + const { id: m, styleId: d } = me( + (c = a.parentRule) == null ? void 0 : c.parentStyleSheet, + e, + r.styleMirror + ); + return ( + ((m && m !== -1) || (d && d !== -1)) && + s({ + id: m, + styleId: d, + set: { property: f, value: p, priority: g }, + index: er(a.parentRule), + }), + l.apply(a, u) + ); + }), + }); + const o = i.CSSStyleDeclaration.prototype.removeProperty; + return ( + (i.CSSStyleDeclaration.prototype.removeProperty = new Proxy(o, { + apply: E((l, a, u) => { + var c; + const [f] = u; + if (t.has(f)) { + return o.apply(a, [f]); + } + const { id: p, styleId: g } = me( + (c = a.parentRule) == null ? void 0 : c.parentStyleSheet, + e, + r.styleMirror + ); + return ( + ((p && p !== -1) || (g && g !== -1)) && + s({ + id: p, + styleId: g, + remove: { property: f }, + index: er(a.parentRule), + }), + l.apply(a, u) + ); + }), + })), + E(() => { + (i.CSSStyleDeclaration.prototype.setProperty = n), + (i.CSSStyleDeclaration.prototype.removeProperty = o); + }) + ); + } + function uf({ + mediaInteractionCb: s, + blockClass: e, + blockSelector: t, + mirror: r, + sampling: i, + doc: n, + }) { + const o = E((a) => + st( + E((u) => { + const c = lt(u); + if (!c || X(c, e, t, !0)) { + return; + } + const { + currentTime: f, + volume: p, + muted: g, + playbackRate: m, + loop: d, + } = c; + s({ + type: a, + id: r.getId(c), + currentTime: f, + volume: p, + muted: g, + playbackRate: m, + loop: d, + }); + }), + i.media || 500 + ) + ), + l = [ + Z('play', o(Me.Play), n), + Z('pause', o(Me.Pause), n), + Z('seeked', o(Me.Seeked), n), + Z('volumechange', o(Me.VolumeChange), n), + Z('ratechange', o(Me.RateChange), n), + ]; + return E(() => { + l.forEach((a) => a()); + }); + } + function cf({ fontCb: s, doc: e }) { + const t = e.defaultView; + if (!t) { + return () => {}; + } + const r = [], + i = new WeakMap(), + n = t.FontFace; + t.FontFace = (a, u, c) => { + const f = new n(a, u, c); + return ( + i.set(f, { + family: a, + buffer: typeof u != 'string', + descriptors: c, + fontSource: + typeof u == 'string' + ? u + : JSON.stringify(Array.from(new Uint8Array(u))), + }), + f + ); + }; + const o = Ie( + e.fonts, + 'add', + (l) => + function (a) { + return ( + setTimeout( + E(() => { + const u = i.get(a); + u && (s(u), i.delete(a)); + }), + 0 + ), + l.apply(this, [a]) + ); + } + ); + return ( + r.push(() => { + t.FontFace = n; + }), + r.push(o), + E(() => { + r.forEach((l) => l()); + }) + ); + } + function hf(s) { + let { + doc: e, + mirror: t, + blockClass: r, + blockSelector: i, + selectionCb: n, + } = s, + o = !0, + l = E(() => { + const a = e.getSelection(); + if (!a || (o && a?.isCollapsed)) { + return; + } + o = a.isCollapsed || !1; + const u = [], + c = a.rangeCount || 0; + for (let f = 0; f < c; f++) { + const p = a.getRangeAt(f), + { + startContainer: g, + startOffset: m, + endContainer: d, + endOffset: h, + } = p; + X(g, r, i, !0) || + X(d, r, i, !0) || + u.push({ + start: t.getId(g), + startOffset: m, + end: t.getId(d), + endOffset: h, + }); + } + n({ ranges: u }); + }); + return l(), Z('selectionchange', l); + } + function ff({ doc: s, customElementCb: e }) { + const t = s.defaultView; + return t && t.customElements + ? Ie( + t.customElements, + 'define', + (i) => + function (n, o, l) { + try { + e({ define: { name: n } }); + } catch { + console.warn(`Custom element callback failed for ${n}`); + } + return i.apply(this, [n, o, l]); + } + ) + : () => {}; + } + function df(s, e) { + const { + mutationCb: t, + mousemoveCb: r, + mouseInteractionCb: i, + scrollCb: n, + viewportResizeCb: o, + inputCb: l, + mediaInteractionCb: a, + styleSheetRuleCb: u, + styleDeclarationCb: c, + canvasMutationCb: f, + fontCb: p, + selectionCb: g, + customElementCb: m, + } = s; + (s.mutationCb = (...d) => { + e.mutation && e.mutation(...d), t(...d); + }), + (s.mousemoveCb = (...d) => { + e.mousemove && e.mousemove(...d), r(...d); + }), + (s.mouseInteractionCb = (...d) => { + e.mouseInteraction && e.mouseInteraction(...d), i(...d); + }), + (s.scrollCb = (...d) => { + e.scroll && e.scroll(...d), n(...d); + }), + (s.viewportResizeCb = (...d) => { + e.viewportResize && e.viewportResize(...d), o(...d); + }), + (s.inputCb = (...d) => { + e.input && e.input(...d), l(...d); + }), + (s.mediaInteractionCb = (...d) => { + e.mediaInteaction && e.mediaInteaction(...d), a(...d); + }), + (s.styleSheetRuleCb = (...d) => { + e.styleSheetRule && e.styleSheetRule(...d), u(...d); + }), + (s.styleDeclarationCb = (...d) => { + e.styleDeclaration && e.styleDeclaration(...d), c(...d); + }), + (s.canvasMutationCb = (...d) => { + e.canvasMutation && e.canvasMutation(...d), f(...d); + }), + (s.fontCb = (...d) => { + e.font && e.font(...d), p(...d); + }), + (s.selectionCb = (...d) => { + e.selection && e.selection(...d), g(...d); + }), + (s.customElementCb = (...d) => { + e.customElement && e.customElement(...d), m(...d); + }); + } + function pf(s, e = {}) { + const t = s.doc.defaultView; + if (!t) { + return () => {}; + } + df(s, e); + let r; + s.recordDOM && (r = Fo(s, s.doc)); + let i = tf(s), + n = rf(s), + o = Uo(s), + l = sf(s, { win: t }), + a = of(s), + u = uf(s), + c = () => {}, + f = () => {}, + p = () => {}, + g = () => {}; + s.recordDOM && + ((c = af(s, { win: t })), + (f = Bo(s, s.doc)), + (p = lf(s, { win: t })), + s.collectFonts && (g = cf(s))); + const m = hf(s), + d = ff(s), + h = []; + for (const b of s.plugins) { + h.push(b.observer(b.callback, t, b.options)); + } + return E(() => { + be.forEach((b) => b.reset()), + r?.disconnect(), + i(), + n(), + o(), + l(), + a(), + u(), + c(), + f(), + p(), + g(), + m(), + d(), + h.forEach((b) => b()); + }); + } + function Tt(s) { + return typeof window[s] < 'u'; + } + function _t(s) { + return !!( + typeof window[s] < 'u' && + window[s].prototype && + 'insertRule' in window[s].prototype && + 'deleteRule' in window[s].prototype + ); + } + var tr = class { + constructor(e) { + w(this, 'iframeIdToRemoteIdMap', new WeakMap()), + w(this, 'iframeRemoteIdToIdMap', new WeakMap()), + (this.generateIdFn = e); + } + getId(e, t, r, i) { + let n = r || this.getIdToRemoteIdMap(e), + o = i || this.getRemoteIdToIdMap(e), + l = n.get(t); + return l || ((l = this.generateIdFn()), n.set(t, l), o.set(l, t)), l; + } + getIds(e, t) { + const r = this.getIdToRemoteIdMap(e), + i = this.getRemoteIdToIdMap(e); + return t.map((n) => this.getId(e, n, r, i)); + } + getRemoteId(e, t, r) { + const i = r || this.getRemoteIdToIdMap(e); + if (typeof t != 'number') { + return t; + } + const n = i.get(t); + return n || -1; + } + getRemoteIds(e, t) { + const r = this.getRemoteIdToIdMap(e); + return t.map((i) => this.getRemoteId(e, i, r)); + } + 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); + return t || ((t = new Map()), this.iframeIdToRemoteIdMap.set(e, t)), t; + } + getRemoteIdToIdMap(e) { + let t = this.iframeRemoteIdToIdMap.get(e); + return t || ((t = new Map()), this.iframeRemoteIdToIdMap.set(e, t)), t; + } + }, + gs = class { + constructor(e) { + w(this, 'iframes', new WeakMap()), + w(this, 'crossOriginIframeMap', new WeakMap()), + w(this, 'crossOriginIframeMirror', new tr(Qi)), + w(this, 'crossOriginIframeStyleMirror'), + w(this, 'crossOriginIframeRootIdMap', new WeakMap()), + w(this, 'mirror'), + w(this, 'mutationCb'), + w(this, 'wrappedEmit'), + w(this, 'loadListener'), + w(this, 'stylesheetManager'), + w(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) { + this.iframes.set(e, !0), + e.contentWindow && this.crossOriginIframeMap.set(e.contentWindow, e); + } + addLoadListener(e) { + this.loadListener = e; + } + attachIframe(e, t) { + var r, i; + this.mutationCb({ + adds: [{ parentId: this.mirror.getId(e), nextId: null, node: t }], + removes: [], + texts: [], + attributes: [], + isAttachIframe: !0, + }), + this.recordCrossOriginIframes && + ((r = e.contentWindow) == null || + r.addEventListener('message', this.handleMessage.bind(this))), + (i = this.loadListener) == null || i.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) { + const t = e; + if ( + t.data.type !== 'rrweb' || + t.origin !== t.data.origin || + !e.source + ) { + return; + } + const i = this.crossOriginIframeMap.get(e.source); + if (!i) { + return; + } + const n = this.transformCrossOriginEvent(i, t.data.event); + n && this.wrappedEmit(n, t.data.isCheckout); + } + transformCrossOriginEvent(e, t) { + var r; + switch (t.type) { + case x.FullSnapshot: { + this.crossOriginIframeMirror.reset(e), + this.crossOriginIframeStyleMirror.reset(e), + this.replaceIdOnNode(t.data.node, e); + const i = t.data.node.id; + return ( + this.crossOriginIframeRootIdMap.set(e, i), + this.patchRootIdOnNode(t.data.node, i), + { + timestamp: t.timestamp, + type: x.IncrementalSnapshot, + data: { + source: I.Mutation, + adds: [ + { + parentId: this.mirror.getId(e), + nextId: null, + node: t.data.node, + }, + ], + removes: [], + texts: [], + attributes: [], + isAttachIframe: !0, + }, + } + ); + } + case x.Meta: + case x.Load: + case x.DomContentLoaded: + return !1; + case x.Plugin: + return t; + case x.Custom: + return ( + this.replaceIds(t.data.payload, e, [ + 'id', + 'parentId', + 'previousId', + 'nextId', + ]), + t + ); + case x.IncrementalSnapshot: + switch (t.data.source) { + case I.Mutation: + return ( + t.data.adds.forEach((i) => { + this.replaceIds(i, e, ['parentId', 'nextId', 'previousId']), + this.replaceIdOnNode(i.node, e); + const n = this.crossOriginIframeRootIdMap.get(e); + n && this.patchRootIdOnNode(i.node, n); + }), + t.data.removes.forEach((i) => { + this.replaceIds(i, e, ['parentId', 'id']); + }), + t.data.attributes.forEach((i) => { + this.replaceIds(i, e, ['id']); + }), + t.data.texts.forEach((i) => { + this.replaceIds(i, e, ['id']); + }), + t + ); + case I.Drag: + case I.TouchMove: + case I.MouseMove: + return ( + t.data.positions.forEach((i) => { + this.replaceIds(i, e, ['id']); + }), + t + ); + case I.ViewportResize: + return !1; + case I.MediaInteraction: + case I.MouseInteraction: + case I.Scroll: + case I.CanvasMutation: + case I.Input: + return this.replaceIds(t.data, e, ['id']), t; + case I.StyleSheetRule: + case I.StyleDeclaration: + return ( + this.replaceIds(t.data, e, ['id']), + this.replaceStyleIds(t.data, e, ['styleId']), + t + ); + case I.Font: + return t; + case I.Selection: + return ( + t.data.ranges.forEach((i) => { + this.replaceIds(i, e, ['start', 'end']); + }), + t + ); + case I.AdoptedStyleSheet: + return ( + this.replaceIds(t.data, e, ['id']), + this.replaceStyleIds(t.data, e, ['styleIds']), + (r = t.data.styles) == null || + r.forEach((i) => { + this.replaceStyleIds(i, e, ['styleId']); + }), + t + ); + } + } + return !1; + } + replace(e, t, r, i) { + for (const n of i) { + (!Array.isArray(t[n]) && typeof t[n] != 'number') || + (Array.isArray(t[n]) + ? (t[n] = e.getIds(r, t[n])) + : (t[n] = e.getId(r, t[n]))); + } + return t; + } + replaceIds(e, t, r) { + return this.replace(this.crossOriginIframeMirror, e, t, r); + } + replaceStyleIds(e, t, r) { + return this.replace(this.crossOriginIframeStyleMirror, e, t, r); + } + replaceIdOnNode(e, t) { + this.replaceIds(e, t, ['id', 'rootId']), + 'childNodes' in e && + e.childNodes.forEach((r) => { + this.replaceIdOnNode(r, t); + }); + } + patchRootIdOnNode(e, t) { + e.type !== $o.Document && !e.rootId && (e.rootId = t), + 'childNodes' in e && + e.childNodes.forEach((r) => { + this.patchRootIdOnNode(r, t); + }); + } + }, + ys = class { + constructor(e) { + w(this, 'shadowDoms', new WeakSet()), + w(this, 'mutationCb'), + w(this, 'scrollCb'), + w(this, 'bypassOptions'), + w(this, 'mirror'), + w(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 (!He(e) || this.shadowDoms.has(e)) { + return; + } + this.shadowDoms.add(e); + const r = Fo( + { + ...this.bypassOptions, + doc: t, + mutationCb: this.mutationCb, + mirror: this.mirror, + shadowDomManager: this, + }, + e + ); + this.restoreHandlers.push(() => r.disconnect()), + this.restoreHandlers.push( + Uo({ + ...this.bypassOptions, + scrollCb: this.scrollCb, + doc: e, + mirror: this.mirror, + }) + ), + setTimeout(() => { + e.adoptedStyleSheets && + e.adoptedStyleSheets.length > 0 && + this.bypassOptions.stylesheetManager.adoptStyleSheets( + e.adoptedStyleSheets, + this.mirror.getId(C.host(e)) + ), + this.restoreHandlers.push( + Bo( + { + mirror: this.mirror, + stylesheetManager: this.bypassOptions.stylesheetManager, + }, + e + ) + ); + }, 0); + } + observeAttachShadow(e) { + !(e.contentWindow && e.contentDocument) || + this.patchAttachShadow(e.contentWindow.Element, e.contentDocument); + } + patchAttachShadow(e, t) { + const r = this; + this.restoreHandlers.push( + Ie( + e.prototype, + 'attachShadow', + (i) => + function (n) { + const o = i.call(this, n), + l = C.shadowRoot(this); + return l && Po(this) && r.addShadowRoot(l, t), o; + } + ) + ); + } + reset() { + this.restoreHandlers.forEach((e) => { + try { + e(); + } catch {} + }), + (this.restoreHandlers = []), + (this.shadowDoms = new WeakSet()); + } + }, + Ae = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + mf = typeof Uint8Array > 'u' ? [] : new Uint8Array(256); + for (Ge = 0; Ge < Ae.length; Ge++) { + mf[Ae.charCodeAt(Ge)] = Ge; + } + var Ge, + gf = (s) => { + var e = new Uint8Array(s), + t, + r = e.length, + i = ''; + for (t = 0; t < r; t += 3) { + (i += Ae[e[t] >> 2]), + (i += Ae[((e[t] & 3) << 4) | (e[t + 1] >> 4)]), + (i += Ae[((e[t + 1] & 15) << 2) | (e[t + 2] >> 6)]), + (i += Ae[e[t + 2] & 63]); + } + return ( + r % 3 === 2 + ? (i = i.substring(0, i.length - 1) + '=') + : r % 3 === 1 && (i = i.substring(0, i.length - 2) + '=='), + i + ); + }; + var Vi = new Map(); + function yf(s, e) { + let t = Vi.get(s); + return ( + t || ((t = new Map()), Vi.set(s, t)), t.has(e) || t.set(e, []), t.get(e) + ); + } + var Wo = (s, e, t) => { + if (!(s && (Vo(s, e) || typeof s == 'object'))) { + return; + } + let r = s.constructor.name, + i = yf(t, r), + n = i.indexOf(s); + return n === -1 && ((n = i.length), i.push(s)), n; + }; + function Ft(s, e, t) { + if (s instanceof Array) { + return s.map((r) => Ft(r, e, t)); + } + if (s === null) { + return s; + } + if ( + s instanceof Float32Array || + s instanceof Float64Array || + s instanceof Int32Array || + s instanceof Uint32Array || + s instanceof Uint8Array || + s instanceof Uint16Array || + s instanceof Int16Array || + s instanceof Int8Array || + s instanceof Uint8ClampedArray + ) { + return { rr_type: s.constructor.name, args: [Object.values(s)] }; + } + if (s instanceof ArrayBuffer) { + const r = s.constructor.name, + i = gf(s); + return { rr_type: r, base64: i }; + } + if (s instanceof DataView) { + return { + rr_type: s.constructor.name, + args: [Ft(s.buffer, e, t), s.byteOffset, s.byteLength], + }; + } + if (s instanceof HTMLImageElement) { + const r = s.constructor.name, + { src: i } = s; + return { rr_type: r, src: i }; + } + if (s instanceof HTMLCanvasElement) { + const r = 'HTMLImageElement', + i = s.toDataURL(); + return { rr_type: r, src: i }; + } + if (s instanceof ImageData) { + return { + rr_type: s.constructor.name, + args: [Ft(s.data, e, t), s.width, s.height], + }; + } + if (Vo(s, e) || typeof s == 'object') { + const r = s.constructor.name, + i = Wo(s, e, t); + return { rr_type: r, index: i }; + } + return s; + } + var zo = (s, e, t) => s.map((r) => Ft(r, e, t)), + Vo = (s, e) => + !![ + 'WebGLActiveInfo', + 'WebGLBuffer', + 'WebGLFramebuffer', + 'WebGLProgram', + 'WebGLRenderbuffer', + 'WebGLShader', + 'WebGLShaderPrecisionFormat', + 'WebGLTexture', + 'WebGLUniformLocation', + 'WebGLVertexArrayObject', + 'WebGLVertexArrayObjectOES', + ] + .filter((i) => typeof e[i] == 'function') + .find((i) => s instanceof e[i]); + function wf(s, e, t, r) { + const i = [], + n = Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype); + for (const o of n) { + try { + if (typeof e.CanvasRenderingContext2D.prototype[o] != 'function') { + continue; + } + const l = Ie( + e.CanvasRenderingContext2D.prototype, + o, + (a) => + function (...u) { + return ( + X(this.canvas, t, r, !0) || + setTimeout(() => { + const c = zo(u, e, this); + s(this.canvas, { type: $e['2D'], property: o, args: c }); + }, 0), + a.apply(this, u) + ); + } + ); + i.push(l); + } catch { + const l = dr(e.CanvasRenderingContext2D.prototype, o, { + set(a) { + s(this.canvas, { + type: $e['2D'], + property: o, + args: [a], + setter: !0, + }); + }, + }); + i.push(l); + } + } + return () => { + i.forEach((o) => o()); + }; + } + function bf(s) { + return s === 'experimental-webgl' ? 'webgl' : s; + } + function Gi(s, e, t, r) { + const i = []; + try { + const n = Ie( + s.HTMLCanvasElement.prototype, + 'getContext', + (o) => + function (l, ...a) { + if (!X(this, e, t, !0)) { + const u = bf(l); + if ( + ('__context' in this || (this.__context = u), + r && ['webgl', 'webgl2'].includes(u)) + ) { + if (a[0] && typeof a[0] == 'object') { + const c = a[0]; + c.preserveDrawingBuffer || (c.preserveDrawingBuffer = !0); + } else { + a.splice(0, 1, { preserveDrawingBuffer: !0 }); + } + } + } + return o.apply(this, [l, ...a]); + } + ); + i.push(n); + } catch { + console.error('failed to patch HTMLCanvasElement.prototype.getContext'); + } + return () => { + i.forEach((n) => n()); + }; + } + function ji(s, e, t, r, i, n) { + const o = [], + l = Object.getOwnPropertyNames(s); + for (const a of l) { + if ( + ![ + 'isContextLost', + 'canvas', + 'drawingBufferWidth', + 'drawingBufferHeight', + ].includes(a) + ) { + try { + if (typeof s[a] != 'function') { + continue; + } + const u = Ie( + s, + a, + (c) => + function (...f) { + const p = c.apply(this, f); + if ( + (Wo(p, n, this), + 'tagName' in this.canvas && !X(this.canvas, r, i, !0)) + ) { + const g = zo(f, n, this), + m = { type: e, property: a, args: g }; + t(this.canvas, m); + } + return p; + } + ); + o.push(u); + } catch { + const u = dr(s, a, { + set(c) { + t(this.canvas, { type: e, property: a, args: [c], setter: !0 }); + }, + }); + o.push(u); + } + } + } + return o; + } + function Sf(s, e, t, r) { + const i = []; + return ( + i.push(...ji(e.WebGLRenderingContext.prototype, $e.WebGL, s, t, r, e)), + typeof e.WebGL2RenderingContext < 'u' && + i.push( + ...ji(e.WebGL2RenderingContext.prototype, $e.WebGL2, s, t, r, e) + ), + () => { + i.forEach((n) => n()); + } + ); + } + var Go = + 'KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=', + vf = (s) => Uint8Array.from(atob(s), (e) => e.charCodeAt(0)), + Hi = + typeof window < 'u' && + window.Blob && + new Blob([vf(Go)], { type: 'text/javascript;charset=utf-8' }); + function Cf(s) { + let e; + try { + if ( + ((e = Hi && (window.URL || window.webkitURL).createObjectURL(Hi)), !e) + ) { + throw ''; + } + const t = new Worker(e, { name: s?.name }); + return ( + t.addEventListener('error', () => { + (window.URL || window.webkitURL).revokeObjectURL(e); + }), + t + ); + } catch { + return new Worker('data:text/javascript;base64,' + Go, { name: s?.name }); + } finally { + e && (window.URL || window.webkitURL).revokeObjectURL(e); + } + } + var ws = class { + constructor(e) { + w(this, 'pendingCanvasMutations', new Map()), + w(this, 'rafStamps', { latestId: 0, invokeId: null }), + w(this, 'mirror'), + w(this, 'mutationCb'), + w(this, 'resetObservers'), + w(this, 'frozen', !1), + w(this, 'locked', !1), + w(this, 'processMutation', (a, u) => { + ((this.rafStamps.invokeId && + this.rafStamps.latestId !== this.rafStamps.invokeId) || + !this.rafStamps.invokeId) && + (this.rafStamps.invokeId = this.rafStamps.latestId), + this.pendingCanvasMutations.has(a) || + this.pendingCanvasMutations.set(a, []), + this.pendingCanvasMutations.get(a).push(u); + }); + const { + sampling: t = 'all', + win: r, + blockClass: i, + blockSelector: n, + recordCanvas: o, + dataURLOptions: l, + } = e; + (this.mutationCb = e.mutationCb), + (this.mirror = e.mirror), + o && t === 'all' && this.initCanvasMutationObserver(r, i, n), + o && + typeof t == 'number' && + this.initCanvasFPSObserver(t, r, i, n, { dataURLOptions: l }); + } + 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, r, i, n) { + const o = Gi(t, r, i, !0), + l = new Map(), + a = new Cf(); + a.onmessage = (m) => { + const { id: d } = m.data; + if ((l.set(d, !1), !('base64' in m.data))) { + return; + } + const { base64: h, type: b, width: S, height: y } = m.data; + this.mutationCb({ + id: d, + type: $e['2D'], + commands: [ + { property: 'clearRect', args: [0, 0, S, y] }, + { + property: 'drawImage', + args: [ + { + rr_type: 'ImageBitmap', + args: [ + { + rr_type: 'Blob', + data: [{ rr_type: 'ArrayBuffer', base64: h }], + type: b, + }, + ], + }, + 0, + 0, + ], + }, + ], + }); + }; + let u = 1e3 / e, + c = 0, + f, + p = () => { + const m = []; + return ( + t.document.querySelectorAll('canvas').forEach((d) => { + X(d, r, i, !0) || m.push(d); + }), + m + ); + }, + g = (m) => { + if (c && m - c < u) { + f = requestAnimationFrame(g); + return; + } + (c = m), + p().forEach(async (d) => { + var h; + const b = this.mirror.getId(d); + if (l.get(b) || d.width === 0 || d.height === 0) { + return; + } + if ((l.set(b, !0), ['webgl', 'webgl2'].includes(d.__context))) { + const y = d.getContext(d.__context); + ((h = y?.getContextAttributes()) == null + ? void 0 + : h.preserveDrawingBuffer) === !1 && + y.clear(y.COLOR_BUFFER_BIT); + } + const S = await createImageBitmap(d); + a.postMessage( + { + id: b, + bitmap: S, + width: d.width, + height: d.height, + dataURLOptions: n.dataURLOptions, + }, + [S] + ); + }), + (f = requestAnimationFrame(g)); + }; + (f = requestAnimationFrame(g)), + (this.resetObservers = () => { + o(), cancelAnimationFrame(f); + }); + } + initCanvasMutationObserver(e, t, r) { + this.startRAFTimestamping(), this.startPendingCanvasMutationFlusher(); + const i = Gi(e, t, r, !1), + n = wf(this.processMutation.bind(this), e, t, r), + o = Sf(this.processMutation.bind(this), e, t, r); + this.resetObservers = () => { + i(), n(), o(); + }; + } + startPendingCanvasMutationFlusher() { + requestAnimationFrame(() => this.flushPendingCanvasMutations()); + } + startRAFTimestamping() { + const e = (t) => { + (this.rafStamps.latestId = t), requestAnimationFrame(e); + }; + requestAnimationFrame(e); + } + flushPendingCanvasMutations() { + this.pendingCanvasMutations.forEach((e, t) => { + const r = this.mirror.getId(t); + this.flushPendingCanvasMutationFor(t, r); + }), + requestAnimationFrame(() => this.flushPendingCanvasMutations()); + } + flushPendingCanvasMutationFor(e, t) { + if (this.frozen || this.locked) { + return; + } + const r = this.pendingCanvasMutations.get(e); + if (!r || t === -1) { + return; + } + const i = r.map((o) => { + const { type: l, ...a } = o; + return a; + }), + { type: n } = r[0]; + this.mutationCb({ id: t, type: n, commands: i }), + this.pendingCanvasMutations.delete(e); + } + }, + bs = class { + constructor(e) { + w(this, 'trackedLinkElements', new WeakSet()), + w(this, 'mutationCb'), + w(this, 'adoptedStyleSheetCb'), + w(this, 'styleMirror', new fs()), + (this.mutationCb = e.mutationCb), + (this.adoptedStyleSheetCb = e.adoptedStyleSheetCb); + } + attachLinkElement(e, t) { + '_cssText' in t.attributes && + this.mutationCb({ + adds: [], + removes: [], + texts: [], + attributes: [{ id: t.id, attributes: t.attributes }], + }), + this.trackLinkElement(e); + } + trackLinkElement(e) { + this.trackedLinkElements.has(e) || + (this.trackedLinkElements.add(e), + this.trackStylesheetInLinkElement(e)); + } + adoptStyleSheets(e, t) { + if (e.length === 0) { + return; + } + const r = { id: t, styleIds: [] }, + i = []; + for (const n of e) { + let o; + this.styleMirror.has(n) + ? (o = this.styleMirror.getId(n)) + : ((o = this.styleMirror.add(n)), + i.push({ + styleId: o, + rules: Array.from(n.rules || CSSRule, (l, a) => ({ + rule: Ji(l, n.href), + index: a, + })), + })), + r.styleIds.push(o); + } + i.length > 0 && (r.styles = i), this.adoptedStyleSheetCb(r); + } + reset() { + this.styleMirror.reset(), (this.trackedLinkElements = new WeakSet()); + } + trackStylesheetInLinkElement(e) {} + }, + Ss = class { + constructor() { + w(this, 'nodeMap', new WeakMap()), w(this, 'active', !1); + } + inOtherBuffer(e, t) { + const r = this.nodeMap.get(e); + return r && Array.from(r).some((i) => i !== t); + } + add(e, t) { + 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() {} + }, + W, + Ut, + Dr, + rr = !1; + try { + if (Array.from([1], (s) => s * 2)[0] !== 2) { + const s = document.createElement('iframe'); + document.body.appendChild(s), + (Array.from = + ((Zs = s.contentWindow) == null ? void 0 : Zs.Array.from) || + Array.from), + document.body.removeChild(s); + } + } catch (s) { + console.debug('Unable to override Array.from', s); + } + var re = Ea(); + function pe(s = {}) { + const { + emit: e, + checkoutEveryNms: t, + checkoutEveryNth: r, + blockClass: i = 'rr-block', + blockSelector: n = null, + ignoreClass: o = 'rr-ignore', + ignoreSelector: l = null, + maskTextClass: a = 'rr-mask', + maskTextSelector: u = null, + inlineStylesheet: c = !0, + maskAllInputs: f, + maskInputOptions: p, + slimDOMOptions: g, + maskInputFn: m, + maskTextFn: d, + hooks: h, + packFn: b, + sampling: S = {}, + dataURLOptions: y = {}, + mousemoveWait: v, + recordDOM: N = !0, + recordCanvas: D = !1, + recordCrossOriginIframes: z = !1, + recordAfter: _ = s.recordAfter === 'DOMContentLoaded' + ? s.recordAfter + : 'load', + userTriggeredOnInput: V = !1, + collectFonts: H = !1, + inlineImages: Q = !1, + plugins: ne, + keepIframeSrcFn: M = () => !1, + ignoreCSSAttributes: Fe = new Set([]), + errorHandler: Ue, + } = s; + qh(Ue); + let G = z ? window.parent === window : !0, + q = !1; + if (!G) { + try { + window.parent.document && (q = !1); + } catch { + q = !0; + } + } + if (G && !e) { + throw new Error('emit function is required'); + } + if (!(G || q)) { + return () => {}; + } + v !== void 0 && S.mousemove === void 0 && (S.mousemove = v), re.reset(); + const ge = + f === !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, + } + : p !== void 0 + ? p + : { password: !0 }, + oe = rn(g); + Zh(); + let Gs, + pr = 0, + js = (R) => { + for (const te of ne || []) { + te.eventProcessor && (R = te.eventProcessor(R)); + } + return b && !q && (R = b(R)), R; + }; + W = (R, te) => { + var U; + const B = R; + if ( + ((B.timestamp = qt()), + (U = be[0]) != null && + U.isFrozen() && + B.type !== x.FullSnapshot && + !(B.type === x.IncrementalSnapshot && B.data.source === I.Mutation) && + be.forEach((K) => K.unfreeze()), + G) + ) { + e?.(js(B), te); + } else if (q) { + const K = { + type: 'rrweb', + event: js(B), + origin: window.location.origin, + isCheckout: te, + }; + window.parent.postMessage(K, '*'); + } + if (B.type === x.FullSnapshot) { + (Gs = B), (pr = 0); + } else if (B.type === x.IncrementalSnapshot) { + if (B.data.source === I.Mutation && B.data.isAttachIframe) { + return; + } + pr++; + const K = r && pr >= r, + T = t && B.timestamp - Gs.timestamp > t; + (K || T) && Ut(!0); + } + }; + const ut = (R) => { + W({ type: x.IncrementalSnapshot, data: { source: I.Mutation, ...R } }); + }, + Hs = (R) => + W({ type: x.IncrementalSnapshot, data: { source: I.Scroll, ...R } }), + Ys = (R) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.CanvasMutation, ...R }, + }), + Yo = (R) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.AdoptedStyleSheet, ...R }, + }), + ye = new bs({ mutationCb: ut, adoptedStyleSheetCb: Yo }), + we = new gs({ + mirror: re, + mutationCb: ut, + stylesheetManager: ye, + recordCrossOriginIframes: z, + wrappedEmit: W, + }); + for (const R of ne || []) { + R.getMirror && + R.getMirror({ + nodeMirror: re, + crossOriginIframeMirror: we.crossOriginIframeMirror, + crossOriginIframeStyleMirror: we.crossOriginIframeStyleMirror, + }); + } + const mr = new Ss(); + Dr = new ws({ + recordCanvas: D, + mutationCb: Ys, + win: window, + blockClass: i, + blockSelector: n, + mirror: re, + sampling: S.canvas, + dataURLOptions: y, + }); + const ct = new ys({ + mutationCb: ut, + scrollCb: Hs, + bypassOptions: { + blockClass: i, + blockSelector: n, + maskTextClass: a, + maskTextSelector: u, + inlineStylesheet: c, + maskInputOptions: ge, + dataURLOptions: y, + maskTextFn: d, + maskInputFn: m, + recordCanvas: D, + inlineImages: Q, + sampling: S, + slimDOMOptions: oe, + iframeManager: we, + stylesheetManager: ye, + canvasManager: Dr, + keepIframeSrcFn: M, + processedNodeManager: mr, + }, + mirror: re, + }); + Ut = (R = !1) => { + if (!N) { + return; + } + W( + { + type: x.Meta, + data: { href: window.location.href, width: Ao(), height: Ro() }, + }, + R + ), + ye.reset(), + ct.init(), + be.forEach((U) => U.lock()); + const te = Za(document, { + mirror: re, + blockClass: i, + blockSelector: n, + maskTextClass: a, + maskTextSelector: u, + inlineStylesheet: c, + maskAllInputs: ge, + maskTextFn: d, + maskInputFn: m, + slimDOM: oe, + dataURLOptions: y, + recordCanvas: D, + inlineImages: Q, + onSerialize: (U) => { + To(U, re) && we.addIframe(U), + _o(U, re) && ye.trackLinkElement(U), + hs(U) && ct.addShadowRoot(C.shadowRoot(U), document); + }, + onIframeLoad: (U, B) => { + we.attachIframe(U, B), ct.observeAttachShadow(U); + }, + onStylesheetLoad: (U, B) => { + ye.attachLinkElement(U, B); + }, + keepIframeSrcFn: M, + }); + if (!te) { + return console.warn('Failed to snapshot the document'); + } + W( + { type: x.FullSnapshot, data: { node: te, initialOffset: No(window) } }, + R + ), + be.forEach((U) => U.unlock()), + document.adoptedStyleSheets && + document.adoptedStyleSheets.length > 0 && + ye.adoptStyleSheets(document.adoptedStyleSheets, re.getId(document)); + }; + try { + const R = [], + te = (B) => { + var K; + return E(pf)( + { + mutationCb: ut, + mousemoveCb: (T, gr) => + W({ + type: x.IncrementalSnapshot, + data: { source: gr, positions: T }, + }), + mouseInteractionCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.MouseInteraction, ...T }, + }), + scrollCb: Hs, + viewportResizeCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.ViewportResize, ...T }, + }), + inputCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.Input, ...T }, + }), + mediaInteractionCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.MediaInteraction, ...T }, + }), + styleSheetRuleCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.StyleSheetRule, ...T }, + }), + styleDeclarationCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.StyleDeclaration, ...T }, + }), + canvasMutationCb: Ys, + fontCb: (T) => + W({ + type: x.IncrementalSnapshot, + data: { source: I.Font, ...T }, + }), + selectionCb: (T) => { + W({ + type: x.IncrementalSnapshot, + data: { source: I.Selection, ...T }, + }); + }, + customElementCb: (T) => { + W({ + type: x.IncrementalSnapshot, + data: { source: I.CustomElement, ...T }, + }); + }, + blockClass: i, + ignoreClass: o, + ignoreSelector: l, + maskTextClass: a, + maskTextSelector: u, + maskInputOptions: ge, + inlineStylesheet: c, + sampling: S, + recordDOM: N, + recordCanvas: D, + inlineImages: Q, + userTriggeredOnInput: V, + collectFonts: H, + doc: B, + maskInputFn: m, + maskTextFn: d, + keepIframeSrcFn: M, + blockSelector: n, + slimDOMOptions: oe, + dataURLOptions: y, + mirror: re, + iframeManager: we, + stylesheetManager: ye, + shadowDomManager: ct, + processedNodeManager: mr, + canvasManager: Dr, + ignoreCSSAttributes: Fe, + plugins: + ((K = ne?.filter((T) => T.observer)) == null + ? void 0 + : K.map((T) => ({ + observer: T.observer, + options: T.options, + callback: (gr) => + W({ + type: x.Plugin, + data: { plugin: T.name, payload: gr }, + }), + }))) || [], + }, + h + ); + }; + we.addLoadListener((B) => { + try { + R.push(te(B.contentDocument)); + } catch (K) { + console.warn(K); + } + }); + const U = () => { + Ut(), R.push(te(document)), (rr = !0); + }; + return ( + ['interactive', 'complete'].includes(document.readyState) + ? U() + : (R.push( + Z('DOMContentLoaded', () => { + W({ type: x.DomContentLoaded, data: {} }), + _ === 'DOMContentLoaded' && U(); + }) + ), + R.push( + Z( + 'load', + () => { + W({ type: x.Load, data: {} }), _ === 'load' && U(); + }, + window + ) + )), + () => { + R.forEach((B) => { + try { + B(); + } catch (K) { + String(K).toLowerCase().includes('cross-origin') || + console.warn(K); + } + }), + mr.destroy(), + (rr = !1), + ef(); + } + ); + } catch (R) { + console.warn(R); + } + } + pe.addCustomEvent = (s, e) => { + if (!rr) { + throw new Error('please add custom event after start recording'); + } + W({ type: x.Custom, data: { tag: s, payload: e } }); + }; + pe.freezePage = () => { + be.forEach((s) => s.freeze()); + }; + pe.takeFullSnapshot = (s) => { + if (!rr) { + throw new Error('please take full snapshot after start recording'); + } + Ut(s); + }; + pe.mirror = re; + var Yi; + ((s) => { + (s[(s.NotStarted = 0)] = 'NotStarted'), + (s[(s.Running = 1)] = 'Running'), + (s[(s.Stopped = 2)] = 'Stopped'); + })(Yi || (Yi = {})); + var id = 5 * 1e3; + var { addCustomEvent: nd } = pe, + { freezePage: od } = pe, + { takeFullSnapshot: ad } = pe; + var Le = null; + function jo(s, e) { + if (typeof document > 'u' || typeof window > 'u') { + return; + } + Le && Le(); + let t = s.maxEventsPerChunk ?? 200, + r = s.flushIntervalMs ?? 1e4, + i = s.maxPayloadBytes ?? 1_048_576, + n = [], + o = 0, + l = null; + function a(d) { + if (n.length === 0) { + return; + } + const h = JSON.stringify(n); + if (new TextEncoder().encode(h).length > i) { + if (n.length > 1) { + const v = Math.floor(n.length / 2), + N = n.slice(0, v), + D = n.slice(v), + z = d && N.some((_) => _.type === 2); + (n = N), a(z), (n = D), a(!1); + return; + } + n = []; + return; + } + const S = n[0].timestamp, + y = n[n.length - 1].timestamp; + try { + e({ + chunk_index: o, + events_count: n.length, + is_full_snapshot: d, + started_at: new Date(S).toISOString(), + ended_at: new Date(y).toISOString(), + payload: h, + }), + (o += 1), + (n = []); + } catch (v) { + throw (console.error('[ReplayRecorder] sendChunk failed', v), v); + } + } + function u(d) { + const h = d || n.some((b) => b.type === 2); + n.length >= t ? a(h) : d && n.length > 0 && a(!0); + } + const c = s.maskAllText !== !1, + f = s.unmaskTextSelector, + p = pe({ + emit(d, h) { + n.push(d), u(!!h); + }, + checkoutEveryNms: r, + maskAllInputs: s.maskAllInputs ?? !0, + maskTextSelector: c ? '*' : '[data-openpanel-replay-mask]', + maskTextFn: + c && f + ? (d, h) => (h?.closest(f) ? d : d.replace(/\S/g, '*')) + : void 0, + blockSelector: s.blockSelector ?? '[data-openpanel-replay-block]', + blockClass: s.blockClass, + ignoreSelector: s.ignoreSelector, + }); + l = setInterval(() => { + if (n.length > 0) { + const d = n.some((h) => h.type === 2); + a(d); + } + }, r); + function g() { + if (document.visibilityState === 'hidden' && n.length > 0) { + const d = n.some((h) => h.type === 2); + a(d); + } + } + function m() { + if (n.length > 0) { + const d = n.some((h) => h.type === 2); + a(d); + } + } + document.addEventListener('visibilitychange', g), + window.addEventListener('pagehide', m), + (Le = () => { + if (n.length > 0) { + const d = n.some((h) => h.type === 2); + a(d); + } + l && (clearInterval(l), (l = null)), + document.removeEventListener('visibilitychange', g), + window.removeEventListener('pagehide', m), + p?.(), + (Le = null); + }); + } + function Ho() { + Le && Le(); + } + return qo(If); +})(); /*! Bundled license information: rrweb/dist/rrweb.js: diff --git a/apps/public/public/op1.js b/apps/public/public/op1.js index 7a8dd24c..87b57ab3 100644 --- a/apps/public/public/op1.js +++ b/apps/public/public/op1.js @@ -1 +1,494 @@ -"use strict";(()=>{var y=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var w=(e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports);var b=(e,s,t,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of v(s))!k.call(e,n)&&n!==t&&c(e,n,{get:()=>s[n],enumerable:!(i=g(s,n))||i.enumerable});return e};var P=(e,s,t)=>(t=e!=null?y(m(e)):{},b(s||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e));var f=w((x,h)=>{"use strict";h.exports={}});var I=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":"application/json",...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[s,t]of Object.entries(this.headers)){let i=await t;i!==null&&(e[s]=i)}return e}addHeader(e,s){this.headers[e]=s}async post(e,s,t,i){try{let n=await fetch(e,{method:"POST",headers:await this.resolveHeaders(),body:s?JSON.stringify(s??{}):void 0,keepalive:!0,...t});if(n.status===401)return null;if(n.status!==200&&n.status!==202)throw new Error(`HTTP error! status: ${n.status}`);let r=await n.text();return r?JSON.parse(r):null}catch(n){if(isetTimeout(a,r)),this.post(e,s,t,i+1)}return console.error("Max retries reached:",n),null}}async fetch(e,s,t={}){let i=`${this.baseUrl}${e}`;return this.post(i,s,t,0)}},d=class{constructor(e){this.groups=[],this.queue=[],this.options=e;let s={"openpanel-client-id":e.clientId};e.clientSecret&&(s["openpanel-client-secret"]=e.clientSecret),s["openpanel-sdk-name"]=e.sdk||"node",s["openpanel-sdk-version"]=e.sdkVersion||"1.3.0",this.api=new I({baseUrl:e.apiUrl||"https://api.openpanel.dev",defaultHeaders:s})}init(){}ready(){this.options.disabled=!1,this.options.waitForProfile=!1,this.flush()}shouldQueue(e){return!!(this.options.disabled||this.options.waitForProfile&&!this.profileId||e.type==="replay"&&!this.sessionId)}addQueue(e){e.type==="track"&&(e.payload.properties={...e.payload.properties??{},__timestamp:new Date().toISOString()}),this.queue.push(e)}async send(e){if(this.options.filter&&!this.options.filter(e))return Promise.resolve();if(this.shouldQueue(e))return this.addQueue(e),Promise.resolve();let s=await this.api.fetch("/track",e,{keepalive:e.type!=="replay"});this.deviceId=s?.deviceId;let t=!!this.sessionId;return this.sessionId=s?.sessionId,!t&&this.sessionId&&this.flush(),s}setGlobalProperties(e){this.global={...this.global,...e}}track(e,s){this.log("track event",e,s);let{groups:t,profileId:i,...n}=s??{},r=[...new Set([...this.groups,...t??[]])];return this.send({type:"track",payload:{name:e,profileId:i??this.profileId,groups:r.length>0?r:void 0,properties:{...this.global??{},...n}}})}identify(e){if(this.log("identify user",e),e.profileId&&(this.profileId=e.profileId,this.flush()),Object.keys(e).length>1)return this.send({type:"identify",payload:{...e,properties:{...this.global,...e.properties}}})}upsertGroup(e){return this.log("upsert group",e),this.send({type:"group",payload:e})}setGroup(e){return this.log("set group",e),this.groups.includes(e)||(this.groups=[...this.groups,e]),this.send({type:"assign_group",payload:{groupIds:[e],profileId:this.profileId}})}setGroups(e){return this.log("set groups",e),this.groups=[...new Set([...this.groups,...e])],this.send({type:"assign_group",payload:{groupIds:e,profileId:this.profileId}})}alias(e){}increment(e){return this.send({type:"increment",payload:e})}decrement(e){return this.send({type:"decrement",payload:e})}revenue(e,s){let t=s?.deviceId;return delete s?.deviceId,this.track("revenue",{...s??{},...t?{__deviceId:t}:{},__revenue:e})}getDeviceId(){return this.deviceId??""}getSessionId(){return this.sessionId??""}fetchDeviceId(){return Promise.resolve(this.deviceId??"")}clear(){this.profileId=void 0,this.groups=[],this.deviceId=void 0,this.sessionId=void 0}buildFlushPayload(e){if(e.type==="replay")return e.payload;if(e.type==="track"){let s="groups"in e.payload?e.payload.groups??[]:[],t=[...new Set([...this.groups,...s])];return{...e.payload,profileId:e.payload.profileId??this.profileId,groups:t.length>0?t:void 0}}return e.type==="identify"||e.type==="increment"||e.type==="decrement"?{...e.payload,profileId:e.payload.profileId??this.profileId}:e.type==="assign_group"?{...e.payload,profileId:e.payload.profileId??this.profileId}:e.payload}flush(){let e=[];for(let s of this.queue){if(this.shouldQueue(s)){e.push(s);continue}let t=this.buildFlushPayload(s);this.send({...s,payload:t})}this.queue=e}log(...e){this.options.debug&&console.log("[OpenPanel.dev]",...e)}};var S=typeof document<"u"?document.currentScript:null;function R(e){return e.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace("-","").replace("_",""))}var l=class extends d{constructor(t){super({sdk:"web",sdkVersion:"1.3.0",...t});this.options=t;this.lastPath="";this.pendingRevenues=[];if(!this.isServer()){try{let i=sessionStorage.getItem("openpanel-pending-revenues");if(i){let n=JSON.parse(i);Array.isArray(n)&&(this.pendingRevenues=n)}}catch{this.pendingRevenues=[]}if(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&(this.trackScreenViews(),setTimeout(()=>this.screenView(),0)),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes(),this.options.sessionReplay?.enabled){let i=this.options.sessionReplay.sampleRate??1;Math.random(){r&&r.startReplayRecorder(this.options.sessionReplay,a=>{this.send({type:"replay",payload:{...a}})})})}}}async loadReplayModule(){try{{let t=S,i=this.options.sessionReplay?.scriptUrl||t?.src?.replace(".js","-replay.js")||"https://openpanel.dev/op1-replay.js";return window.__openpanel_replay?window.__openpanel_replay:new Promise(n=>{let r=document.createElement("script");r.src=i,r.onload=()=>{n(window.__openpanel_replay??null)},r.onerror=()=>{console.warn("[OpenPanel] Failed to load replay script from",i),n(null)},document.head.appendChild(r)})}return await Promise.resolve().then(()=>P(f(),1))}catch(t){return console.warn("[OpenPanel] Failed to load replay module",t),null}}debounce(t,i){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(t,i)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",t=>{let i=t.target,n=i.closest("a");if(n&&i){let r=n.getAttribute("href");if(r?.startsWith("http"))try{let a=new URL(r),o=window.location.hostname;a.hostname!==o&&super.track("link_out",{href:r,text:n.innerText||n.getAttribute("title")||i.getAttribute("alt")||i.getAttribute("title")})}catch{}}})}trackScreenViews(){if(this.isServer())return;let t=history.pushState;history.pushState=function(...a){let o=t.apply(this,a);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),o};let i=history.replaceState;history.replaceState=function(...a){let o=i.apply(this,a);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),o},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))});let n=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener("hashchange",n):window.addEventListener("locationchange",n)}trackAttributes(){this.isServer()||document.addEventListener("click",t=>{let i=t.target,n=i.closest("button"),r=i.closest("a"),a=n?.getAttribute("data-track")?n:r?.getAttribute("data-track")?r:null;if(a){let o={};for(let p of a.attributes)p.name.startsWith("data-")&&p.name!=="data-track"&&(o[R(p.name.replace(/^data-/,""))]=p.value);let u=a.getAttribute("data-track");u&&super.track(u,o)}})}track(t,i){return super.track(t,{...i,__path:this.lastPath})}screenView(t,i){if(this.isServer())return;let n,r;typeof t=="string"?(n=t,r=i):(n=window.location.href,r=t),this.lastPath!==n&&(this.lastPath=n,super.track("screen_view",{...r??{},__path:n,__title:document.title}))}async flushRevenue(){let t=this.pendingRevenues.map(i=>super.revenue(i.amount,i.properties));await Promise.all(t),this.clearRevenue()}clearRevenue(){if(this.pendingRevenues=[],!this.isServer())try{sessionStorage.removeItem("openpanel-pending-revenues")}catch{}}pendingRevenue(t,i){if(this.pendingRevenues.push({amount:t,properties:i}),!this.isServer())try{sessionStorage.setItem("openpanel-pending-revenues",JSON.stringify(this.pendingRevenues))}catch{}}};(e=>{if(e.op){let s=e.op.q||[],t=new l(s.shift()[1]);s.forEach(n=>{n[0]in t&&t[n[0]](...n.slice(1))});let i=new Proxy((n,...r)=>{let a=t[n]?t[n].bind(t):void 0;typeof a=="function"?a(...r):console.warn(`OpenPanel: ${n} is not a function`)},{get(n,r){if(r==="q")return;let a=t[r];return typeof a=="function"?a.bind(t):a}});e.op=i,e.openpanel=t}})(window);})(); +(() => { + var y = Object.create; + var c = Object.defineProperty; + var g = Object.getOwnPropertyDescriptor; + var v = Object.getOwnPropertyNames; + var m = Object.getPrototypeOf, + k = Object.prototype.hasOwnProperty; + var w = (e, s) => () => (s || e((s = { exports: {} }).exports, s), s.exports); + var b = (e, s, t, i) => { + if ((s && typeof s == 'object') || typeof s == 'function') { + for (const n of v(s)) { + !k.call(e, n) && + n !== t && + c(e, n, { + get: () => s[n], + enumerable: !(i = g(s, n)) || i.enumerable, + }); + } + } + return e; + }; + var P = (e, s, t) => ( + (t = e != null ? y(m(e)) : {}), + b( + s || !e || !e.__esModule + ? c(t, 'default', { value: e, enumerable: !0 }) + : t, + e + ) + ); + var f = w((x, h) => { + h.exports = {}; + }); + var I = class { + constructor(e) { + (this.baseUrl = e.baseUrl), + (this.headers = { + 'Content-Type': 'application/json', + ...e.defaultHeaders, + }), + (this.maxRetries = e.maxRetries ?? 3), + (this.initialRetryDelay = e.initialRetryDelay ?? 500); + } + async resolveHeaders() { + const e = {}; + for (const [s, t] of Object.entries(this.headers)) { + const i = await t; + i !== null && (e[s] = i); + } + return e; + } + addHeader(e, s) { + this.headers[e] = s; + } + async post(e, s, t, i) { + try { + const n = await fetch(e, { + method: 'POST', + headers: await this.resolveHeaders(), + body: s ? JSON.stringify(s ?? {}) : void 0, + keepalive: !0, + ...t, + }); + if (n.status === 401) { + return null; + } + if (n.status !== 200 && n.status !== 202) { + throw new Error(`HTTP error! status: ${n.status}`); + } + const r = await n.text(); + return r ? JSON.parse(r) : null; + } catch (n) { + if (i < this.maxRetries) { + const r = this.initialRetryDelay * 2 ** i; + return ( + await new Promise((a) => setTimeout(a, r)), + this.post(e, s, t, i + 1) + ); + } + return console.error('Max retries reached:', n), null; + } + } + async fetch(e, s, t = {}) { + const i = `${this.baseUrl}${e}`; + return this.post(i, s, t, 0); + } + }, + d = class { + constructor(e) { + (this.groups = []), (this.queue = []), (this.options = e); + const s = { 'openpanel-client-id': e.clientId }; + e.clientSecret && (s['openpanel-client-secret'] = e.clientSecret), + (s['openpanel-sdk-name'] = e.sdk || 'node'), + (s['openpanel-sdk-version'] = e.sdkVersion || '1.3.0'), + (this.api = new I({ + baseUrl: e.apiUrl || 'https://api.openpanel.dev', + defaultHeaders: s, + })); + } + init() {} + ready() { + (this.options.disabled = !1), + (this.options.waitForProfile = !1), + this.flush(); + } + shouldQueue(e) { + return !!( + this.options.disabled || + (this.options.waitForProfile && !this.profileId) || + (e.type === 'replay' && !this.sessionId) + ); + } + addQueue(e) { + e.type === 'track' && + (e.payload.properties = { + ...(e.payload.properties ?? {}), + __timestamp: new Date().toISOString(), + }), + this.queue.push(e); + } + async send(e) { + if (this.options.filter && !this.options.filter(e)) { + return Promise.resolve(); + } + if (this.shouldQueue(e)) { + return this.addQueue(e), Promise.resolve(); + } + const s = await this.api.fetch('/track', e, { + keepalive: e.type !== 'replay', + }); + this.deviceId = s?.deviceId; + const t = !!this.sessionId; + return ( + (this.sessionId = s?.sessionId), + !t && this.sessionId && this.flush(), + s + ); + } + setGlobalProperties(e) { + this.global = { ...this.global, ...e }; + } + track(e, s) { + this.log('track event', e, s); + const { groups: t, profileId: i, ...n } = s ?? {}, + r = [...new Set([...this.groups, ...(t ?? [])])]; + return this.send({ + type: 'track', + payload: { + name: e, + profileId: i ?? this.profileId, + groups: r.length > 0 ? r : void 0, + properties: { ...(this.global ?? {}), ...n }, + }, + }); + } + identify(e) { + if ( + (this.log('identify user', e), + e.profileId && ((this.profileId = e.profileId), this.flush()), + Object.keys(e).length > 1) + ) { + return this.send({ + type: 'identify', + payload: { ...e, properties: { ...this.global, ...e.properties } }, + }); + } + } + upsertGroup(e) { + return ( + this.log('upsert group', e), this.send({ type: 'group', payload: e }) + ); + } + setGroup(e) { + return ( + this.log('set group', e), + this.groups.includes(e) || (this.groups = [...this.groups, e]), + this.send({ + type: 'assign_group', + payload: { groupIds: [e], profileId: this.profileId }, + }) + ); + } + setGroups(e) { + return ( + this.log('set groups', e), + (this.groups = [...new Set([...this.groups, ...e])]), + this.send({ + type: 'assign_group', + payload: { groupIds: e, profileId: this.profileId }, + }) + ); + } + alias(e) {} + increment(e) { + return this.send({ type: 'increment', payload: e }); + } + decrement(e) { + return this.send({ type: 'decrement', payload: e }); + } + revenue(e, s) { + const t = s?.deviceId; + return ( + delete s?.deviceId, + this.track('revenue', { + ...(s ?? {}), + ...(t ? { __deviceId: t } : {}), + __revenue: e, + }) + ); + } + getDeviceId() { + return this.deviceId ?? ''; + } + getSessionId() { + return this.sessionId ?? ''; + } + fetchDeviceId() { + return Promise.resolve(this.deviceId ?? ''); + } + clear() { + (this.profileId = void 0), + (this.groups = []), + (this.deviceId = void 0), + (this.sessionId = void 0); + } + buildFlushPayload(e) { + if (e.type === 'replay') { + return e.payload; + } + if (e.type === 'track') { + const s = 'groups' in e.payload ? (e.payload.groups ?? []) : [], + t = [...new Set([...this.groups, ...s])]; + return { + ...e.payload, + profileId: e.payload.profileId ?? this.profileId, + groups: t.length > 0 ? t : void 0, + }; + } + return e.type === 'identify' || + e.type === 'increment' || + e.type === 'decrement' + ? { ...e.payload, profileId: e.payload.profileId ?? this.profileId } + : e.type === 'assign_group' + ? { ...e.payload, profileId: e.payload.profileId ?? this.profileId } + : e.payload; + } + flush() { + const e = []; + for (const s of this.queue) { + if (this.shouldQueue(s)) { + e.push(s); + continue; + } + const t = this.buildFlushPayload(s); + this.send({ ...s, payload: t }); + } + this.queue = e; + } + log(...e) { + this.options.debug && console.log('[OpenPanel.dev]', ...e); + } + }; + var S = typeof document < 'u' ? document.currentScript : null; + function R(e) { + return e.replace(/([-_][a-z])/gi, (s) => + s.toUpperCase().replace('-', '').replace('_', '') + ); + } + var l = class extends d { + constructor(t) { + super({ sdk: 'web', sdkVersion: '1.3.0', ...t }); + this.options = t; + this.lastPath = ''; + this.pendingRevenues = []; + if (!this.isServer()) { + try { + const i = sessionStorage.getItem('openpanel-pending-revenues'); + if (i) { + const n = JSON.parse(i); + Array.isArray(n) && (this.pendingRevenues = n); + } + } catch { + this.pendingRevenues = []; + } + if ( + (this.setGlobalProperties({ __referrer: document.referrer }), + this.options.trackScreenViews && + (this.trackScreenViews(), setTimeout(() => this.screenView(), 0)), + this.options.trackOutgoingLinks && this.trackOutgoingLinks(), + this.options.trackAttributes && this.trackAttributes(), + this.options.sessionReplay?.enabled) + ) { + const i = this.options.sessionReplay.sampleRate ?? 1; + Math.random() < i && + this.loadReplayModule().then((r) => { + r && + r.startReplayRecorder(this.options.sessionReplay, (a) => { + this.send({ type: 'replay', payload: { ...a } }); + }); + }); + } + } + } + async loadReplayModule() { + try { + { + const t = S, + i = + this.options.sessionReplay?.scriptUrl || + t?.src?.replace('.js', '-replay.js') || + 'https://openpanel.dev/op1-replay.js'; + return window.__openpanel_replay + ? window.__openpanel_replay + : new Promise((n) => { + const r = document.createElement('script'); + (r.src = i), + (r.onload = () => { + n(window.__openpanel_replay ?? null); + }), + (r.onerror = () => { + console.warn( + '[OpenPanel] Failed to load replay script from', + i + ), + n(null); + }), + document.head.appendChild(r); + }); + } + return await Promise.resolve().then(() => P(f(), 1)); + } catch (t) { + return ( + console.warn('[OpenPanel] Failed to load replay module', t), null + ); + } + } + debounce(t, i) { + clearTimeout(this.debounceTimer), (this.debounceTimer = setTimeout(t, i)); + } + isServer() { + return typeof document > 'u'; + } + trackOutgoingLinks() { + this.isServer() || + document.addEventListener('click', (t) => { + const i = t.target, + n = i.closest('a'); + if (n && i) { + const r = n.getAttribute('href'); + if (r?.startsWith('http')) { + try { + const a = new URL(r), + o = window.location.hostname; + a.hostname !== o && + super.track('link_out', { + href: r, + text: + n.innerText || + n.getAttribute('title') || + i.getAttribute('alt') || + i.getAttribute('title'), + }); + } catch {} + } + } + }); + } + trackScreenViews() { + if (this.isServer()) { + return; + } + const t = history.pushState; + history.pushState = function (...a) { + const o = t.apply(this, a); + return ( + window.dispatchEvent(new Event('pushstate')), + window.dispatchEvent(new Event('locationchange')), + o + ); + }; + const i = history.replaceState; + (history.replaceState = function (...a) { + const o = i.apply(this, a); + return ( + window.dispatchEvent(new Event('replacestate')), + window.dispatchEvent(new Event('locationchange')), + o + ); + }), + window.addEventListener('popstate', () => { + window.dispatchEvent(new Event('locationchange')); + }); + const n = () => this.debounce(() => this.screenView(), 50); + this.options.trackHashChanges + ? window.addEventListener('hashchange', n) + : window.addEventListener('locationchange', n); + } + trackAttributes() { + this.isServer() || + document.addEventListener('click', (t) => { + const i = t.target, + n = i.closest('button'), + r = i.closest('a'), + a = n?.getAttribute('data-track') + ? n + : r?.getAttribute('data-track') + ? r + : null; + if (a) { + const o = {}; + for (const p of a.attributes) { + p.name.startsWith('data-') && + p.name !== 'data-track' && + (o[R(p.name.replace(/^data-/, ''))] = p.value); + } + const u = a.getAttribute('data-track'); + u && super.track(u, o); + } + }); + } + track(t, i) { + return super.track(t, { ...i, __path: this.lastPath }); + } + screenView(t, i) { + if (this.isServer()) { + return; + } + let n, r; + typeof t == 'string' + ? ((n = t), (r = i)) + : ((n = window.location.href), (r = t)), + this.lastPath !== n && + ((this.lastPath = n), + super.track('screen_view', { + ...(r ?? {}), + __path: n, + __title: document.title, + })); + } + async flushRevenue() { + const t = this.pendingRevenues.map((i) => + super.revenue(i.amount, i.properties) + ); + await Promise.all(t), this.clearRevenue(); + } + clearRevenue() { + if (((this.pendingRevenues = []), !this.isServer())) { + try { + sessionStorage.removeItem('openpanel-pending-revenues'); + } catch {} + } + } + pendingRevenue(t, i) { + if ( + (this.pendingRevenues.push({ amount: t, properties: i }), + !this.isServer()) + ) { + try { + sessionStorage.setItem( + 'openpanel-pending-revenues', + JSON.stringify(this.pendingRevenues) + ); + } catch {} + } + } + }; + ((e) => { + if (e.op) { + const s = e.op.q || [], + t = new l(s.shift()[1]); + s.forEach((n) => { + n[0] in t && t[n[0]](...n.slice(1)); + }); + const i = new Proxy( + (n, ...r) => { + const a = t[n] ? t[n].bind(t) : void 0; + typeof a == 'function' + ? a(...r) + : console.warn(`OpenPanel: ${n} is not a function`); + }, + { + get(n, r) { + if (r === 'q') { + return; + } + const a = t[r]; + return typeof a == 'function' ? a.bind(t) : a; + }, + } + ); + (e.op = i), (e.openpanel = t); + } + })(window); +})(); diff --git a/apps/public/source.config.ts b/apps/public/source.config.ts index 552c64bd..af70a90a 100644 --- a/apps/public/source.config.ts +++ b/apps/public/source.config.ts @@ -49,7 +49,7 @@ const zGuide = z.object({ z.object({ name: z.string(), anchor: z.string(), - }), + }) ), }); diff --git a/apps/public/src/app/(content)/[...pages]/page.tsx b/apps/public/src/app/(content)/[...pages]/page.tsx index 63e72a76..bc2a29a8 100644 --- a/apps/public/src/app/(content)/[...pages]/page.tsx +++ b/apps/public/src/app/(content)/[...pages]/page.tsx @@ -1,12 +1,12 @@ +import type { Metadata } from 'next'; +import { notFound } from 'next/navigation'; +import Script from 'next/script'; import { HeroContainer } from '@/app/(home)/_sections/hero'; import { SectionHeader } from '@/components/section'; import { url } from '@/lib/layout.shared'; import { getOgImageUrl, getPageMetadata } from '@/lib/metadata'; import { pageSource } from '@/lib/source'; import { getMDXComponents } from '@/mdx-components'; -import type { Metadata } from 'next'; -import { notFound } from 'next/navigation'; -import Script from 'next/script'; export async function generateMetadata({ params, @@ -46,7 +46,7 @@ export default async function Page({ const page = await pageSource.getPage(pages); const Body = page?.data.body; - if (!page || !Body) { + if (!(page && Body)) { return notFound(); } @@ -70,16 +70,16 @@ export default async function Page({ return (