Repository: lmnr-ai/lmnr-python
Pull request #106: patchright
Author: login: skull8888888
Created: 2025-05-07T16:11:23Z | Merged: 2025-05-08T09:20:10Z


<!-- ELLIPSIS_HIDDEN -->


> [!IMPORTANT]
> Add `patchright` instrumentor and enhance focus tracking in `pw_utils.py` and `rrweb` script.
> 
>   - **Tracing**:
>     - Add `init_patchright_instrumentor()` in `tracing.py` to support `patchright` instrumentation.
>     - Similar structure to existing instrumentors like `playwright`.
>   - **Utilities**:
>     - Update `pw_utils.py` to track page focus state using `window.addEventListener` for `blur` and `focus`.
>     - Modify heartbeat events to check `window.lmnrPageIsFocused` instead of `document.visibilityState`.
>   - **Scripts**:
>     - Add `rrweb.umd.min.cjs` file, a bundled script for rrweb.
>     - Modify `rrweb` script to handle focus events and improve event batching.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> for 74b2d7e71bbed43a75c79b255dbfb3453d754d40. You can [customize](https://app.ellipsis.dev/lmnr-ai/settings/summaries) this summary. It will automatically update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->


Diff:
diff --git a/pyproject.toml b/pyproject.toml
index 1fb84f67..f3d4c88a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,7 +6,7 @@
 
 [project]
 name = "lmnr"
-version = "0.5.2"
+version = "0.5.3"
 description = "Python SDK for Laminar"
 authors = [
   { name = "lmnr.ai", email = "founders@lmnr.ai" }
diff --git a/src/lmnr/opentelemetry_lib/instruments.py b/src/lmnr/opentelemetry_lib/instruments.py
index 502f87cd..25548b78 100644
--- a/src/lmnr/opentelemetry_lib/instruments.py
+++ b/src/lmnr/opentelemetry_lib/instruments.py
@@ -24,6 +24,7 @@ class Instruments(Enum):
     OPENAI = "openai"
     PINECONE = "pinecone"
     PLAYWRIGHT = "playwright"
+    PATCHRIGHT = "patchright"
     QDRANT = "qdrant"
     REPLICATE = "replicate"
     SAGEMAKER = "sagemaker"
diff --git a/src/lmnr/opentelemetry_lib/tracing/tracing.py b/src/lmnr/opentelemetry_lib/tracing/tracing.py
index 606a12d3..ac7711d2 100644
--- a/src/lmnr/opentelemetry_lib/tracing/tracing.py
+++ b/src/lmnr/opentelemetry_lib/tracing/tracing.py
@@ -455,6 +455,9 @@ def init_instrumentations(
         elif instrument == Instruments.PLAYWRIGHT:
             if init_playwright_instrumentor(client, async_client):
                 instrument_set = True
+        elif instrument == Instruments.PATCHRIGHT:
+            if init_patchright_instrumentor(client, async_client):
+                instrument_set = True
         elif instrument == Instruments.BROWSER_USE:
             if init_browser_use_instrumentor():
                 instrument_set = True
@@ -499,6 +502,21 @@ def init_playwright_instrumentor(
         return False
 
 
+def init_patchright_instrumentor(
+    client: LaminarClient, async_client: AsyncLaminarClient
+):
+    try:
+        if is_package_installed("patchright"):
+            from lmnr.sdk.browser.patchright_otel import PatchrightInstrumentor
+
+            instrumentor = PatchrightInstrumentor(client, async_client)
+            instrumentor.instrument()
+        return True
+    except Exception as e:
+        module_logger.error(f"Error initializing patchright instrumentor: {e}")
+        return False
+
+
 def init_openai_instrumentor(should_enrich_metrics: bool):
     try:
         if is_package_installed("openai") and is_package_installed(
diff --git a/src/lmnr/sdk/browser/patchright_otel.py b/src/lmnr/sdk/browser/patchright_otel.py
new file mode 100644
index 00000000..016f3cc6
--- /dev/null
+++ b/src/lmnr/sdk/browser/patchright_otel.py
@@ -0,0 +1,177 @@
+from lmnr.sdk.browser.playwright_otel import (
+    _wrap_new_page,
+    _wrap_new_page_async,
+    _wrap_new_browser_sync,
+    _wrap_new_browser_async,
+    _wrap_new_context_sync,
+    _wrap_new_context_async,
+    _wrap_close_browser_sync,
+    _wrap_close_browser_async,
+)
+from lmnr.sdk.client.synchronous.sync_client import LaminarClient
+from lmnr.sdk.client.asynchronous.async_client import AsyncLaminarClient
+from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
+from opentelemetry.instrumentation.utils import unwrap
+from opentelemetry.trace import get_tracer
+from lmnr.version import __version__
+from typing import Collection
+from wrapt import wrap_function_wrapper
+
+_instruments = ("patchright >= 1.9.0",)
+
+WRAPPED_METHODS = [
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserContext",
+        "method": "new_page",
+        "wrapper": _wrap_new_page,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "new_page",
+        "wrapper": _wrap_new_page,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "launch",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "connect",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "connect_over_cdp",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "close",
+        "wrapper": _wrap_close_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "new_context",
+        "wrapper": _wrap_new_context_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "launch_persistent_context",
+        "wrapper": _wrap_new_context_sync,
+    },
+]
+
+WRAPPED_METHODS_ASYNC = [
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserContext",
+        "method": "new_page",
+        "wrapper": _wrap_new_page_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "new_page",
+        "wrapper": _wrap_new_page_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "launch",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "connect",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "connect_over_cdp",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "close",
+        "wrapper": _wrap_close_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "new_context",
+        "wrapper": _wrap_new_context_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "launch_persistent_context",
+        "wrapper": _wrap_new_context_async,
+    },
+]
+
+
+class PatchrightInstrumentor(BaseInstrumentor):
+    def __init__(self, client: LaminarClient, async_client: AsyncLaminarClient):
+        super().__init__()
+        self.client = client
+        self.async_client = async_client
+
+    def instrumentation_dependencies(self) -> Collection[str]:
+        return _instruments
+
+    def _instrument(self, **kwargs):
+        tracer_provider = kwargs.get("tracer_provider")
+        tracer = get_tracer(__name__, __version__, tracer_provider)
+
+        for wrapped_method in WRAPPED_METHODS:
+            wrap_package = wrapped_method.get("package")
+            wrap_object = wrapped_method.get("object")
+            wrap_method = wrapped_method.get("method")
+            try:
+                wrap_function_wrapper(
+                    wrap_package,
+                    f"{wrap_object}.{wrap_method}",
+                    wrapped_method.get("wrapper")(
+                        tracer,
+                        self.client,
+                        wrapped_method,
+                    ),
+                )
+            except ModuleNotFoundError:
+                pass
+
+        for wrapped_method in WRAPPED_METHODS_ASYNC:
+            wrap_package = wrapped_method.get("package")
+            wrap_object = wrapped_method.get("object")
+            wrap_method = wrapped_method.get("method")
+            try:
+                wrap_function_wrapper(
+                    wrap_package,
+                    f"{wrap_object}.{wrap_method}",
+                    wrapped_method.get("wrapper")(
+                        tracer,
+                        self.async_client,
+                        wrapped_method,
+                    ),
+                )
+            except ModuleNotFoundError:
+                pass
+
+    def _uninstrument(self, **kwargs):
+        for wrapped_method in WRAPPED_METHODS + WRAPPED_METHODS_ASYNC:
+            wrap_package = wrapped_method.get("package")
+            wrap_object = wrapped_method.get("object")
+            wrap_method = wrapped_method.get("method")
+            unwrap(wrap_package, f"{wrap_object}.{wrap_method}")
diff --git a/src/lmnr/sdk/browser/playwright_otel.py b/src/lmnr/sdk/browser/playwright_otel.py
index 5d36481d..153a343d 100644
--- a/src/lmnr/sdk/browser/playwright_otel.py
+++ b/src/lmnr/sdk/browser/playwright_otel.py
@@ -320,10 +320,10 @@ async def _wrap_close_browser_async(
         "wrapper": _wrap_new_context_async,
     },
     {
-        "package": "playwright.sync_api",
+        "package": "playwright.async_api",
         "object": "BrowserType",
         "method": "launch_persistent_context",
-        "wrapper": _wrap_new_context_sync,
+        "wrapper": _wrap_new_context_async,
     },
 ]
 
diff --git a/src/lmnr/sdk/browser/pw_utils.py b/src/lmnr/sdk/browser/pw_utils.py
index 0c36a28c..15e802bd 100644
--- a/src/lmnr/sdk/browser/pw_utils.py
+++ b/src/lmnr/sdk/browser/pw_utils.py
@@ -24,7 +24,7 @@
 logger = logging.getLogger(__name__)
 
 current_dir = os.path.dirname(os.path.abspath(__file__))
-with open(os.path.join(current_dir, "rrweb", "rrweb.min.js"), "r") as f:
+with open(os.path.join(current_dir, "rrweb", "rrweb.umd.min.cjs"), "r") as f:
     RRWEB_CONTENT = f"() => {{ {f.read()} }}"
 
 INJECT_PLACEHOLDER = """
@@ -32,6 +32,19 @@
     const BATCH_SIZE = 1000;  // Maximum events to store in memory
 
     window.lmnrRrwebEventsBatch = new Set();
+    
+    // Track page focus state
+    window.lmnrPageIsFocused = true;
+    
+    window.addEventListener('blur', () => {
+        window.lmnrPageIsFocused = false;
+        console.log('Page lost focus');
+    });
+    
+    window.addEventListener('focus', () => {
+        window.lmnrPageIsFocused = true;
+        console.log('Page gained focus');
+    });
 
     // Utility function to compress individual event data
     async function compressEventData(data) {
@@ -51,7 +64,7 @@
 
     // Add heartbeat events
     setInterval(async () => {
-        if (document.visibilityState === 'hidden' || document.hidden) {
+        if (!window.lmnrPageIsFocused) {
             return;
         }
 
@@ -64,10 +77,11 @@
 
     window.lmnrRrweb.record({
         async emit(event) {
-            // Ignore events from all tabs except the current one
-            if (document.visibilityState === 'hidden' || document.hidden) {
+            // Ignore events when page is not focused
+            if (!window.lmnrPageIsFocused) {
                 return;
             }
+            
             // Compress the data field
             const compressedEvent = {
                 ...event,
@@ -86,15 +100,15 @@ async def send_events_async(
     """Fetch events from the page and send them to the server"""
     try:
         # Check if function exists first
-        has_function = await page.evaluate(
-            """
-            () => typeof window.lmnrGetAndClearEvents === 'function'
-        """
-        )
-        if not has_function:
-            return
+        events = await page.evaluate("""
+        () => {
+            if (!window.lmnrPageIsFocused || typeof window.lmnrGetAndClearEvents !== 'function') {
+                return [];
+            }
+            return window.lmnrGetAndClearEvents();
+        }
+        """)
 
-        events = await page.evaluate("window.lmnrGetAndClearEvents()")
         if not events or len(events) == 0:
             return
 
@@ -105,7 +119,7 @@ async def send_events_async(
             await inject_rrweb_async(page)
             await send_events_async(page, session_id, trace_id, client)
         else:
-            logger.warn(f"Could not send events: {e}")
+            logger.debug(f"Could not send events: {e}")
 
 
 def send_events_sync(
@@ -113,16 +127,14 @@ def send_events_sync(
 ):
     """Synchronous version of send_events"""
     try:
-        # Check if function exists first
-        has_function = page.evaluate(
-            """
-            () => typeof window.lmnrGetAndClearEvents === 'function'
-        """
-        )
-        if not has_function:
-            return
-
-        events = page.evaluate("window.lmnrGetAndClearEvents()")
+        events = page.evaluate("""
+        () => {
+            if (!window.lmnrPageIsFocused || typeof window.lmnrGetAndClearEvents !== 'function') {
+                return [];
+            }
+            return window.lmnrGetAndClearEvents();
+        }
+        """)
         if not events or len(events) == 0:
             return
 
@@ -134,7 +146,7 @@ def send_events_sync(
             inject_rrweb_sync(page)
             send_events_sync(page, session_id, trace_id, client)
         else:
-            logger.warn(f"Could not send events: {e}")
+            logger.debug(f"Could not send events: {e}")
 
 
 def inject_rrweb_sync(page: SyncPage):
@@ -155,10 +167,6 @@ def inject_rrweb_sync(page: SyncPage):
             def load_rrweb():
                 try:
                     page.evaluate(RRWEB_CONTENT)
-                    page.wait_for_function(
-                        """(() => typeof window.lmnrRrweb !== 'undefined')""",
-                        timeout=5000,
-                    )
                     return True
                 except Exception as e:
                     logger.debug(f"Failed to load rrweb: {e}")
@@ -196,10 +204,6 @@ async def inject_rrweb_async(page: Page):
             async def load_rrweb():
                 try:
                     await page.evaluate(RRWEB_CONTENT)
-                    await page.wait_for_function(
-                        """(() => typeof window.lmnrRrweb !== 'undefined')""",
-                        timeout=5000,
-                    )
                     return True
                 except Exception as e:
                     logger.debug(f"Failed to load rrweb: {e}")
@@ -231,7 +235,11 @@ def bring_to_front():
         page.evaluate(
             """() => {
             if (window.lmnrRrweb) {
-                window.lmnrRrweb.record.takeFullSnapshot();
+                try {
+                    window.lmnrRrweb.record.takeFullSnapshot();
+                } catch (e) {
+                    console.error("Error taking full snapshot:", e);
+                }
             }
         }"""
         )
@@ -302,10 +310,15 @@ async def on_close():
 
     async def bring_to_front():
         await original_bring_to_front()
+
         await page.evaluate(
             """() => {
             if (window.lmnrRrweb) {
-                window.lmnrRrweb.record.takeFullSnapshot();
+                try {
+                    window.lmnrRrweb.record.takeFullSnapshot();
+                } catch (e) {
+                    console.error("Error taking full snapshot:", e);
+                }
             }
         }"""
         )
diff --git a/src/lmnr/sdk/browser/rrweb/rrweb.min.js b/src/lmnr/sdk/browser/rrweb/rrweb.min.js
deleted file mode 100644
index 1cabea8f..00000000
--- a/src/lmnr/sdk/browser/rrweb/rrweb.min.js
+++ /dev/null
@@ -1,18 +0,0 @@
-window.lmnrRrweb=function(ee){"use strict";var D;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(D||(D={}));function Tt(t){return t.nodeType===t.ELEMENT_NODE}function Oe(t){var e=t?.host;return Boolean(e?.shadowRoot===t)}function Le(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Kn(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function Je(t){try{var e=t.rules||t.cssRules;return e?Kn(Array.from(e).map(Mt).join("")):null}catch{return null}}function Mt(t){var e=t.cssText;if(Qn(t))try{e=Je(t.styleSheet)||e}catch{}return e}function Qn(t){return"styleSheet"in t}var qe=function(){function t(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return t.prototype.getId=function(e){var n;if(!e)return-1;var r=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return r??-1},t.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},t.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},t.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.prototype.removeNodeFromMap=function(e){var n=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},t.prototype.has=function(e){return this.idNodeMap.has(e)},t.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},t.prototype.add=function(e,n){var r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)},t.prototype.replace=function(e,n){var r=this.getNode(e);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)},t.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t}();function kt(){return new qe}function et(t){var e=t.maskInputOptions,n=t.tagName,r=t.type,o=t.value,a=t.maskInputFn,s=o||"";return(e[n.toLowerCase()]||e[r])&&(a?s=a(s):s="*".repeat(s.length)),s}var Dt="__rrweb_original__";function Jn(t){var e=t.getContext("2d");if(!e)return!0;for(var n=50,r=0;r<t.width;r+=n)for(var o=0;o<t.height;o+=n){var a=e.getImageData,s=Dt in a?a[Dt]:a,i=new Uint32Array(s.call(e,r,o,Math.min(n,t.width-r),Math.min(n,t.height-o)).data.buffer);if(i.some(function(l){return l!==0}))return!1}return!0}var qn=1,er=new RegExp("[^a-z0-9-_:]"),Ae=-2;function Rt(){return qn++}function tr(t){if(t instanceof HTMLFormElement)return"form";var e=t.tagName.toLowerCase().trim();return er.test(e)?"div":e}function nr(t){return t.cssRules?Array.from(t.cssRules).map(function(e){return e.cssText||""}).join(""):""}function rr(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var we,xt,or=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,ir=/^(data:)([^,]*),(.*)/i;function Ve(t,e){return(t||"").replace(or,function(n,r,o,a,s,i){var l=o||s||i,c=r||a||"";if(!l)return n;if(!sr.test(l)||ir.test(l))return"url(".concat(c).concat(l).concat(c,")");if(l[0]==="/")return"url(".concat(c).concat(rr(e)+l).concat(c,")");var u=e.split("/"),d=l.split("/");u.pop();for(var h=0,p=d;h<p.length;h++){var m=p[h];m!=="."&&(m===".."?u.pop():u.push(m))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}var ar=/^[^ \t\n\r\u000c]+/,lr=/^[, \t\n\r\u000c]+/;function cr(t,e){if(e.trim()==="")return e;var n=0;function r(c){var u,d=c.exec(e.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(lr),!(n>=e.length);){var a=r(ar);if(a.slice(-1)===",")a=Be(t,a.substring(0,a.length-1)),o.push(a);else{var s="";a=Be(t,a);for(var i=!1;;){var l=e.charAt(n);if(l===""){o.push((a+s).trim());break}else if(i)l===")"&&(i=!1);else if(l===","){n+=1,o.push((a+s).trim());break}else l==="("&&(i=!0);s+=l,n+=1}}}return o.join(", ")}function Be(t,e){if(!e||e.trim()==="")return e;var n=t.createElement("a");return n.href=e,n.href}function ur(t){return Boolean(t.tagName==="svg"||t.ownerSVGElement)}function tt(){var t=document.createElement("a");return t.href="",t.href}function Ot(t,e,n,r){return n==="src"||n==="href"&&r&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(e==="table"||e==="td"||e==="th")?Be(t,r):n==="srcset"&&r?cr(t,r):n==="style"&&r?Ve(r,tt()):e==="object"&&n==="data"&&r?Be(t,r):r}function dr(t,e,n){if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;){var o=t.classList[r];if(e.test(o))return!0}return n?t.matches(n):!1}function Ge(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return n?Ge(t.parentNode,e,n):!1;for(var r=t.classList.length;r--;){var o=t.classList[r];if(e.test(o))return!0}return n?Ge(t.parentNode,e,n):!1}function Lt(t,e,n){var r=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(r===null)return!1;if(typeof e=="string"){if(r.classList.contains(e)||r.closest(".".concat(e)))return!0}else if(Ge(r,e,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function hr(t,e,n){var r=t.contentWindow;if(r){var o=!1,a;try{a=r.document.readyState}catch{return}if(a!=="complete"){var s=setTimeout(function(){o||(e(),o=!0)},n);t.addEventListener("load",function(){clearTimeout(s),o=!0,e()});return}var i="about:blank";if(r.location.href!==i||t.src===i||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function pr(t,e,n){var r=!1,o;try{o=t.sheet}catch{return}if(!o){var a=setTimeout(function(){r||(e(),r=!0)},n);t.addEventListener("load",function(){clearTimeout(a),r=!0,e()})}}function mr(t,e){var n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,s=e.maskTextClass,i=e.maskTextSelector,l=e.inlineStylesheet,c=e.maskInputOptions,u=c===void 0?{}:c,d=e.maskTextFn,h=e.maskInputFn,p=e.dataURLOptions,m=p===void 0?{}:p,b=e.inlineImages,S=e.recordCanvas,f=e.keepIframeSrcFn,y=e.newlyAddedElement,g=y===void 0?!1:y,E=fr(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:D.Document,childNodes:[],compatMode:t.compatMode}:{type:D.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:D.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return gr(t,{doc:n,blockClass:o,blockSelector:a,inlineStylesheet:l,maskInputOptions:u,maskInputFn:h,dataURLOptions:m,inlineImages:b,recordCanvas:S,keepIframeSrcFn:f,newlyAddedElement:g,rootId:E});case t.TEXT_NODE:return yr(t,{maskTextClass:s,maskTextSelector:i,maskTextFn:d,rootId:E});case t.CDATA_SECTION_NODE:return{type:D.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:D.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function fr(t,e){if(e.hasNode(t)){var n=e.getId(t);return n===1?void 0:n}}function yr(t,e){var n,r=e.maskTextClass,o=e.maskTextSelector,a=e.maskTextFn,s=e.rootId,i=t.parentNode&&t.parentNode.tagName,l=t.textContent,c=i==="STYLE"?!0:void 0,u=i==="SCRIPT"?!0:void 0;if(c&&l){try{t.nextSibling||t.previousSibling||!((n=t.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(l=nr(t.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),t)}l=Ve(l,tt())}return u&&(l="SCRIPT_PLACEHOLDER"),!c&&!u&&l&&Lt(t,r,o)&&(l=a?a(l):l.replace(/[\S]/g,"*")),{type:D.Text,textContent:l||"",isStyle:c,rootId:s}}function gr(t,e){for(var n=e.doc,r=e.blockClass,o=e.blockSelector,a=e.inlineStylesheet,s=e.maskInputOptions,i=s===void 0?{}:s,l=e.maskInputFn,c=e.dataURLOptions,u=c===void 0?{}:c,d=e.inlineImages,h=e.recordCanvas,p=e.keepIframeSrcFn,m=e.newlyAddedElement,b=m===void 0?!1:m,S=e.rootId,f=dr(t,r,o),y=tr(t),g={},E=t.attributes.length,k=0;k<E;k++){var x=t.attributes[k];g[x.name]=Ot(n,y,x.name,x.value)}if(y==="link"&&a){var F=Array.from(n.styleSheets).find(function(v){return v.href===t.href}),_=null;F&&(_=Je(F)),_&&(delete g.rel,delete g.href,g._cssText=Ve(_,F.href))}if(y==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){var _=Je(t.sheet);_&&(g._cssText=Ve(_,tt()))}if(y==="input"||y==="textarea"||y==="select"){var J=t.value,Y=t.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&J?g.value=et({type:g.type,tagName:y,value:J,maskInputOptions:i,maskInputFn:l}):Y&&(g.checked=Y)}if(y==="option"&&(t.selected&&!i.select?g.selected=!0:delete g.selected),y==="canvas"&&h){if(t.__context==="2d")Jn(t)||(g.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var q=t.toDataURL(u.type,u.quality),z=document.createElement("canvas");z.width=t.width,z.height=t.height;var X=z.toDataURL(u.type,u.quality);q!==X&&(g.rr_dataURL=q)}}if(y==="img"&&d){we||(we=n.createElement("canvas"),xt=we.getContext("2d"));var $=t,Z=$.crossOrigin;$.crossOrigin="anonymous";var H=function(){try{we.width=$.naturalWidth,we.height=$.naturalHeight,xt.drawImage($,0,0),g.rr_dataURL=we.toDataURL(u.type,u.quality)}catch(v){console.warn("Cannot inline img src=".concat($.currentSrc,"! Error: ").concat(v))}Z?g.crossOrigin=Z:$.removeAttribute("crossorigin")};$.complete&&$.naturalWidth!==0?H():$.onload=H}if((y==="audio"||y==="video")&&(g.rr_mediaState=t.paused?"paused":"played",g.rr_mediaCurrentTime=t.currentTime),b||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop)),f){var L=t.getBoundingClientRect(),te=L.width,w=L.height;g={class:g.class,rr_width:"".concat(te,"px"),rr_height:"".concat(w,"px")}}return y==="iframe"&&!p(g.src)&&(t.contentDocument||(g.rr_src=g.src),delete g.src),{type:D.Element,tagName:y,attributes:g,childNodes:[],isSVG:ur(t)||void 0,needBlock:f,rootId:S}}function P(t){return t===void 0?"":t.toLowerCase()}function vr(t,e){return!!(e.comment&&t.type===D.Comment||t.type===D.Element&&(e.script&&(t.tagName==="script"||t.tagName==="link"&&t.attributes.rel==="preload"&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js"))||e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(P(t.attributes.name).match(/^msapplication-tile(image|color)$/)||P(t.attributes.name)==="application-name"||P(t.attributes.rel)==="icon"||P(t.attributes.rel)==="apple-touch-icon"||P(t.attributes.rel)==="shortcut icon"))||t.tagName==="meta"&&(e.headMetaDescKeywords&&P(t.attributes.name).match(/^description|keywords$/)||e.headMetaSocial&&(P(t.attributes.property).match(/^(og|twitter|fb):/)||P(t.attributes.name).match(/^(og|twitter):/)||P(t.attributes.name)==="pinterest")||e.headMetaRobots&&(P(t.attributes.name)==="robots"||P(t.attributes.name)==="googlebot"||P(t.attributes.name)==="bingbot")||e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0||e.headMetaAuthorship&&(P(t.attributes.name)==="author"||P(t.attributes.name)==="generator"||P(t.attributes.name)==="framework"||P(t.attributes.name)==="publisher"||P(t.attributes.name)==="progid"||P(t.attributes.property).match(/^article:/)||P(t.attributes.property).match(/^product:/))||e.headMetaVerification&&(P(t.attributes.name)==="google-site-verification"||P(t.attributes.name)==="yandex-verification"||P(t.attributes.name)==="csrf-token"||P(t.attributes.name)==="p:domain_verify"||P(t.attributes.name)==="verify-v1"||P(t.attributes.name)==="verification"||P(t.attributes.name)==="shopify-checkout-api-token"))))}function Ee(t,e){var n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,s=e.maskTextClass,i=e.maskTextSelector,l=e.skipChild,c=l===void 0?!1:l,u=e.inlineStylesheet,d=u===void 0?!0:u,h=e.maskInputOptions,p=h===void 0?{}:h,m=e.maskTextFn,b=e.maskInputFn,S=e.slimDOMOptions,f=e.dataURLOptions,y=f===void 0?{}:f,g=e.inlineImages,E=g===void 0?!1:g,k=e.recordCanvas,x=k===void 0?!1:k,F=e.onSerialize,_=e.onIframeLoad,J=e.iframeLoadTimeout,Y=J===void 0?5e3:J,q=e.onStylesheetLoad,z=e.stylesheetLoadTimeout,X=z===void 0?5e3:z,$=e.keepIframeSrcFn,Z=$===void 0?function(){return!1}:$,H=e.newlyAddedElement,L=H===void 0?!1:H,te=e.preserveWhiteSpace,w=te===void 0?!0:te,v=mr(t,{doc:n,mirror:r,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:i,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:b,dataURLOptions:y,inlineImages:E,recordCanvas:x,keepIframeSrcFn:Z,newlyAddedElement:L});if(!v)return console.warn(t,"not serialized"),null;var M;r.hasNode(t)?M=r.getId(t):vr(v,S)||!w&&v.type===D.Text&&!v.isStyle&&!v.textContent.replace(/^\s+|\s+$/gm,"").length?M=Ae:M=Rt();var T=Object.assign(v,{id:M});if(r.add(t,T),M===Ae)return null;F&&F(t);var W=!c;if(T.type===D.Element){W=W&&!T.needBlock,delete T.needBlock;var ne=t.shadowRoot;ne&&Le(ne)&&(T.isShadowHost=!0)}if((T.type===D.Document||T.type===D.Element)&&W){S.headWhitespace&&T.type===D.Element&&T.tagName==="head"&&(w=!1);for(var xe={doc:n,mirror:r,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:i,skipChild:c,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:b,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:x,preserveWhiteSpace:w,onSerialize:F,onIframeLoad:_,iframeLoadTimeout:Y,onStylesheetLoad:q,stylesheetLoadTimeout:X,keepIframeSrcFn:Z},I=0,oe=Array.from(t.childNodes);I<oe.length;I++){var ae=oe[I],B=Ee(ae,xe);B&&T.childNodes.push(B)}if(Tt(t)&&t.shadowRoot)for(var ue=0,A=Array.from(t.shadowRoot.childNodes);ue<A.length;ue++){var ae=A[ue],B=Ee(ae,xe);B&&(Le(t.shadowRoot)&&(B.isShadow=!0),T.childNodes.push(B))}}return t.parentNode&&Oe(t.parentNode)&&Le(t.parentNode)&&(T.isShadow=!0),T.type===D.Element&&T.tagName==="iframe"&&hr(t,function(){var ie=t.contentDocument;if(ie&&_){var Ue=Ee(ie,{doc:ie,mirror:r,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:b,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:x,preserveWhiteSpace:w,onSerialize:F,onIframeLoad:_,iframeLoadTimeout:Y,onStylesheetLoad:q,stylesheetLoadTimeout:X,keepIframeSrcFn:Z});Ue&&_(t,Ue)}},Y),T.type===D.Element&&T.tagName==="link"&&T.attributes.rel==="stylesheet"&&pr(t,function(){if(q){var ie=Ee(t,{doc:n,mirror:r,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:b,slimDOMOptions:S,dataURLOptions:y,inlineImages:E,recordCanvas:x,preserveWhiteSpace:w,onSerialize:F,onIframeLoad:_,iframeLoadTimeout:Y,onStylesheetLoad:q,stylesheetLoadTimeout:X,keepIframeSrcFn:Z});ie&&q(t,ie)}},X),T}function Sr(t,e){var n=e||{},r=n.mirror,o=r===void 0?new qe:r,a=n.blockClass,s=a===void 0?"rr-block":a,i=n.blockSelector,l=i===void 0?null:i,c=n.maskTextClass,u=c===void 0?"rr-mask":c,d=n.maskTextSelector,h=d===void 0?null:d,p=n.inlineStylesheet,m=p===void 0?!0:p,b=n.inlineImages,S=b===void 0?!1:b,f=n.recordCanvas,y=f===void 0?!1:f,g=n.maskAllInputs,E=g===void 0?!1:g,k=n.maskTextFn,x=n.maskInputFn,F=n.slimDOM,_=F===void 0?!1:F,J=n.dataURLOptions,Y=n.preserveWhiteSpace,q=n.onSerialize,z=n.onIframeLoad,X=n.iframeLoadTimeout,$=n.onStylesheetLoad,Z=n.stylesheetLoadTimeout,H=n.keepIframeSrcFn,L=H===void 0?function(){return!1}:H,te=E===!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}:E===!1?{password:!0}:E,w=_===!0||_==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:_==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:_===!1?{}:_;return Ee(t,{doc:t,mirror:o,blockClass:s,blockSelector:l,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:m,maskInputOptions:te,maskTextFn:k,maskInputFn:x,slimDOMOptions:w,dataURLOptions:J,inlineImages:S,recordCanvas:y,preserveWhiteSpace:Y,onSerialize:q,onIframeLoad:z,iframeLoadTimeout:X,onStylesheetLoad:$,stylesheetLoadTimeout:Z,keepIframeSrcFn:L,newlyAddedElement:!1})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function br(t,e){e===void 0&&(e={});var n=1,r=1;function o(w){var v=w.match(/\n/g);v&&(n+=v.length);var M=w.lastIndexOf(`
-`);r=M===-1?r+w.length:w.length-M}function a(){var w={line:n,column:r};return function(v){return v.position=new s(w),m(),v}}var s=function(){function w(v){this.start=v,this.end={line:n,column:r},this.source=e.source}return w}();s.prototype.content=t;var i=[];function l(w){var v=new Error("".concat(e.source||"",":").concat(n,":").concat(r,": ").concat(w));if(v.reason=w,v.filename=e.source,v.line=n,v.column=r,v.source=t,e.silent)i.push(v);else throw v}function c(){var w=h();return{type:"stylesheet",stylesheet:{source:e.source,rules:w,parsingErrors:i}}}function u(){return p(/^{\s*/)}function d(){return p(/^}/)}function h(){var w,v=[];for(m(),b(v);t.length&&t.charAt(0)!=="}"&&(w=L()||te());)w!==!1&&(v.push(w),b(v));return v}function p(w){var v=w.exec(t);if(v){var M=v[0];return o(M),t=t.slice(M.length),v}}function m(){p(/^\s*/)}function b(w){w===void 0&&(w=[]);for(var v;v=S();)v!==!1&&w.push(v),v=S();return w}function S(){var w=a();if(!(t.charAt(0)!=="/"||t.charAt(1)!=="*")){for(var v=2;t.charAt(v)!==""&&(t.charAt(v)!=="*"||t.charAt(v+1)!=="/");)++v;if(v+=2,t.charAt(v-1)==="")return l("End of comment missing");var M=t.slice(2,v-2);return r+=2,o(M),t=t.slice(v),r+=2,w({type:"comment",comment:M})}}function f(){var w=p(/^([^{]+)/);if(w)return he(w[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(v){return v.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(v){return v.replace(/\u200C/g,",")})}function y(){var w=a(),v=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(v){var M=he(v[0]);if(!p(/^:\s*/))return l("property missing ':'");var T=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),W=w({type:"declaration",property:M.replace(At,""),value:T?he(T[0]).replace(At,""):""});return p(/^[;\s]*/),W}}function g(){var w=[];if(!u())return l("missing '{'");b(w);for(var v;v=y();)v!==!1&&(w.push(v),b(w)),v=y();return d()?w:l("missing '}'")}function E(){for(var w,v=[],M=a();w=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)v.push(w[1]),p(/^,\s*/);if(v.length)return M({type:"keyframe",values:v,declarations:g()})}function k(){var w=a(),v=p(/^@([-\w]+)?keyframes\s*/);if(v){var M=v[1];if(v=p(/^([-\w]+)\s*/),!v)return l("@keyframes missing name");var T=v[1];if(!u())return l("@keyframes missing '{'");for(var W,ne=b();W=E();)ne.push(W),ne=ne.concat(b());return d()?w({type:"keyframes",name:T,vendor:M,keyframes:ne}):l("@keyframes missing '}'")}}function x(){var w=a(),v=p(/^@supports *([^{]+)/);if(v){var M=he(v[1]);if(!u())return l("@supports missing '{'");var T=b().concat(h());return d()?w({type:"supports",supports:M,rules:T}):l("@supports missing '}'")}}function F(){var w=a(),v=p(/^@host\s*/);if(v){if(!u())return l("@host missing '{'");var M=b().concat(h());return d()?w({type:"host",rules:M}):l("@host missing '}'")}}function _(){var w=a(),v=p(/^@media *([^{]+)/);if(v){var M=he(v[1]);if(!u())return l("@media missing '{'");var T=b().concat(h());return d()?w({type:"media",media:M,rules:T}):l("@media missing '}'")}}function J(){var w=a(),v=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(v)return w({type:"custom-media",name:he(v[1]),media:he(v[2])})}function Y(){var w=a(),v=p(/^@page */);if(v){var M=f()||[];if(!u())return l("@page missing '{'");for(var T=b(),W;W=y();)T.push(W),T=T.concat(b());return d()?w({type:"page",selectors:M,declarations:T}):l("@page missing '}'")}}function q(){var w=a(),v=p(/^@([-\w]+)?document *([^{]+)/);if(v){var M=he(v[1]),T=he(v[2]);if(!u())return l("@document missing '{'");var W=b().concat(h());return d()?w({type:"document",document:T,vendor:M,rules:W}):l("@document missing '}'")}}function z(){var w=a(),v=p(/^@font-face\s*/);if(v){if(!u())return l("@font-face missing '{'");for(var M=b(),T;T=y();)M.push(T),M=M.concat(b());return d()?w({type:"font-face",declarations:M}):l("@font-face missing '}'")}}var X=H("import"),$=H("charset"),Z=H("namespace");function H(w){var v=new RegExp("^@"+w+"\\s*([^;]+);");return function(){var M=a(),T=p(v);if(T){var W={type:w};return W[w]=T[1].trim(),M(W)}}}function L(){if(t[0]==="@")return k()||_()||J()||x()||X()||$()||Z()||q()||Y()||F()||z()}function te(){var w=a(),v=f();return v?(b(),w({type:"rule",selectors:v,declarations:g()})):l("selector missing")}return nt(c())}function he(t){return t?t.replace(/^\s+|\s+$/g,""):""}function nt(t,e){for(var n=t&&typeof t.type=="string",r=n?t:e,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],i=t[s];Array.isArray(i)?i.forEach(function(l){nt(l,r)}):i&&typeof i=="object"&&nt(i,r)}return n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:e||null}),t}var _t={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function wr(t){var e=_t[t.tagName]?_t[t.tagName]:t.tagName;return e==="link"&&t.attributes._cssText&&(e="style"),e}function Er(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ft=/([^\\]):hover/,Nr=new RegExp(Ft.source,"g");function Pt(t,e){var n=e?.stylesWithHoverClass.get(t);if(n)return n;var r=br(t,{silent:!0});if(!r.stylesheet)return t;var o=[];if(r.stylesheet.rules.forEach(function(i){"selectors"in i&&(i.selectors||[]).forEach(function(l){Ft.test(l)&&o.push(l)})}),o.length===0)return t;var a=new RegExp(o.filter(function(i,l){return o.indexOf(i)===l}).sort(function(i,l){return l.length-i.length}).map(function(i){return Er(i)}).join("|"),"g"),s=t.replace(a,function(i){var l=i.replace(Nr,"$1.\\:hover");return"".concat(i,", ").concat(l)});return e?.stylesWithHoverClass.set(t,s),s}function Wt(){var t=new Map;return{stylesWithHoverClass:t}}function Cr(t,e){var n=e.doc,r=e.hackCss,o=e.cache;switch(t.type){case D.Document:return n.implementation.createDocument(null,"",null);case D.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case D.Element:{var a=wr(t),s;t.isSVG?s=n.createElementNS("http://www.w3.org/2000/svg",a):s=n.createElement(a);var i={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var c=t.attributes[l];if(!(a==="option"&&l==="selected"&&c===!1)){if(c===!0&&(c=""),l.startsWith("rr_")){i[l]=c;continue}var u=a==="textarea"&&l==="value",d=a==="style"&&l==="_cssText";if(d&&r&&typeof c=="string"&&(c=Pt(c,o)),(u||d)&&typeof c=="string"){for(var h=n.createTextNode(c),p=0,m=Array.from(s.childNodes);p<m.length;p++){var b=m[p];b.nodeType===s.TEXT_NODE&&s.removeChild(b)}s.appendChild(h);continue}try{if(t.isSVG&&l==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",l,c.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")s.setAttribute("_"+l,c.toString());else if(a==="meta"&&t.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){s.setAttribute("csp-content",c.toString());continue}else a==="link"&&t.attributes.rel==="preload"&&t.attributes.as==="script"||a==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")||(a==="img"&&t.attributes.srcset&&t.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",t.attributes.srcset):s.setAttribute(l,c.toString()))}catch{}}}var S=function(y){var g=i[y];if(a==="canvas"&&y==="rr_dataURL"){var E=document.createElement("img");E.onload=function(){var x=s.getContext("2d");x&&x.drawImage(E,0,0,E.width,E.height)},E.src=g.toString(),s.RRNodeType&&(s.rr_dataURL=g.toString())}else if(a==="img"&&y==="rr_dataURL"){var k=s;k.currentSrc.startsWith("data:")||(k.setAttribute("rrweb-original-src",t.attributes.src),k.src=g.toString())}if(y==="rr_width")s.style.width=g.toString();else if(y==="rr_height")s.style.height=g.toString();else if(y==="rr_mediaCurrentTime"&&typeof g=="number")s.currentTime=g;else if(y==="rr_mediaState")switch(g){case"played":s.play().catch(function(x){return console.warn("media playback error",x)});break;case"paused":s.pause();break}};for(var f in i)S(f);if(t.isShadowHost)if(!s.shadowRoot)s.attachShadow({mode:"open"});else for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);return s}case D.Text:return n.createTextNode(t.isStyle&&r?Pt(t.textContent,o):t.textContent);case D.CDATA:return n.createCDATASection(t.textContent);case D.Comment:return n.createComment(t.textContent);default:return null}}function _e(t,e){var n=e.doc,r=e.mirror,o=e.skipChild,a=o===void 0?!1:o,s=e.hackCss,i=s===void 0?!0:s,l=e.afterAppend,c=e.cache,u=Cr(t,{doc:n,hackCss:i,cache:c});if(!u)return null;if(t.rootId&&r.getNode(t.rootId)!==n&&r.replace(t.rootId,n),t.type===D.Document&&(n.close(),n.open(),t.compatMode==="BackCompat"&&t.childNodes&&t.childNodes[0].type!==D.DocumentType&&(t.childNodes[0].type===D.Element&&"xmlns"in t.childNodes[0].attributes&&t.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,t),(t.type===D.Document||t.type===D.Element)&&!a)for(var d=0,h=t.childNodes;d<h.length;d++){var p=h[d],m=_e(p,{doc:n,mirror:r,skipChild:!1,hackCss:i,afterAppend:l,cache:c});if(!m){console.warn("Failed to rebuild",p);continue}p.isShadow&&Tt(u)&&u.shadowRoot?u.shadowRoot.appendChild(m):u.appendChild(m),l&&l(m,p.id)}return u}function Ir(t,e){function n(s){e(s)}for(var r=0,o=t.getIds();r<o.length;r++){var a=o[r];t.has(a)&&n(t.getNode(a))}}function Tr(t,e){var n=e.getMeta(t);if(n?.type===D.Element){var r=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var a=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=a),o==="rr_scrollTop"&&(r.scrollTop=a)}}}function Mr(t,e){var n=e.doc,r=e.onVisit,o=e.hackCss,a=o===void 0?!0:o,s=e.afterAppend,i=e.cache,l=e.mirror,c=l===void 0?new qe:l,u=_e(t,{doc:n,mirror:c,skipChild:!1,hackCss:a,afterAppend:s,cache:i});return Ir(c,function(d){r&&r(d),Tr(d,c)}),u}function K(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Ne=`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.`;ee.mirror={map:{},getId(){return console.error(Ne),-1},getNode(){return console.error(Ne),null},removeNodeFromMap(){console.error(Ne)},has(){return console.error(Ne),!1},reset(){console.error(Ne)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(ee.mirror=new Proxy(ee.mirror,{get(t,e,n){return e==="map"&&console.error(Ne),Reflect.get(t,e,n)}}));function Ce(t,e,n={}){let r=null,o=0;return function(...a){const s=Date.now();!o&&n.leading===!1&&(o=s);const i=e-(s-o),l=this;i<=0||i>e?(r&&(clearTimeout(r),r=null),o=s,t.apply(l,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(l,a)},i))}}function Fe(t,e,n,r,o=window){const a=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),a&&a.set&&a.set.call(this,s)}}),()=>Fe(t,e,a||{},!0)}function ge(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}function rt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Q(t,e,n,r){if(!t)return!1;const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!o)return!1;if(typeof e=="string"){if(o.classList.contains(e)||r&&o.closest("."+e)!==null)return!0}else if(Ge(o,e,r))return!0;return!!(n&&(t.matches(n)||r&&o.closest(n)!==null))}function $t(t,e){return e.getId(t)!==-1}function je(t,e){return e.getId(t)===Ae}function st(t,e){if(Oe(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?st(t.parentNode,e):!0:!0}function it(t){return Boolean(t.changedTouches)}function at(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ut(t){const e={},n=(o,a)=>{const s={value:o,parent:a,children:[]};return e[o.node.id]=s,s},r=[];for(const o of t){const{nextId:a,parentId:s}=o;if(a&&a in e){const i=e[a];if(i.parent){const l=i.parent.children.indexOf(i);i.parent.children.splice(l,0,n(o,i.parent))}else{const l=r.indexOf(i);r.splice(l,0,n(o,null))}continue}if(s in e){const i=e[s];i.children.push(n(o,i));continue}r.push(n(o,null))}return r}function lt(t,e){e(t.value);for(let n=t.children.length-1;n>=0;n--)lt(t.children[n],e)}function Ie(t,e){return Boolean(t.nodeName==="IFRAME"&&e.getMeta(t))}function ct(t,e){return Boolean(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function ut(t,e){var n,r;const o=(r=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const a=o.getBoundingClientRect(),s=ut(o,e),i=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:i,absoluteScale:s.absoluteScale*i}}function ve(t){return Boolean(t?.shadowRoot)}function Te(t,e){const n=t[e[0]];return e.length===1?n:Te(n.cssRules[e[1]].cssRules,e.slice(2))}function dt(t){const e=[...t],n=e.pop();return{positions:e,index:n}}function Vt(t){const e=new Set,n=[];for(let r=t.length;r--;){const o=t[r];e.has(o.id)||(n.push(o),e.add(o.id))}return n}class ht{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var n;return(n=this.styleIDMap.get(e))!=null?n:-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,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++}}var kr=Object.freeze({__proto__:null,on:K,get _mirror(){return ee.mirror},throttle:Ce,hookSetter:Fe,patch:ge,getWindowHeight:rt,getWindowWidth:ot,isBlocked:Q,isSerialized:$t,isIgnored:je,isAncestorRemoved:st,isTouchEvent:it,polyfill:at,queueToResolveTrees:Ut,iterateResolveTree:lt,isSerializedIframe:Ie,isSerializedStylesheet:ct,getBaseDimension:ut,hasShadowRoot:ve,getNestedRule:Te,getPositionsAndIndex:dt,uniqueTextMutations:Vt,StyleSheetMirror:ht}),C=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(C||{}),N=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t))(N||{}),j=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(j||{}),pe=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(pe||{}),me=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(me||{}),O=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t.Destroy="destroy",t))(O||{});function Bt(t){return"__ln"in t}class Dr{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&Bt(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&Bt(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(e){const n=e.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Gt=(t,e)=>`${t}@${e}`;class Rr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Dr,r=i=>{let l=i,c=Ae;for(;c===Ae;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},o=i=>{var l,c,u,d;let h=null;((c=(l=i.getRootNode)==null?void 0:l.call(i))==null?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&i.getRootNode().host&&(h=i.getRootNode().host);let p=h;for(;((d=(u=p?.getRootNode)==null?void 0:u.call(p))==null?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&p.getRootNode().host;)p=p.getRootNode().host;const m=!this.doc.contains(i)&&(!p||!this.doc.contains(p));if(!i.parentNode||m)return;const b=Oe(i.parentNode)?this.mirror.getId(h):this.mirror.getId(i.parentNode),S=r(i);if(b===-1||S===-1)return n.addNode(i);const f=Ee(i,{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:y=>{Ie(y,this.mirror)&&this.iframeManager.addIframe(y),ct(y,this.mirror)&&this.stylesheetManager.trackLinkElement(y),ve(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(y,g)=>{this.iframeManager.attachIframe(y,g),this.shadowDomManager.observeAttachShadow(y)},onStylesheetLoad:(y,g)=>{this.stylesheetManager.attachLinkElement(y,g)}});f&&e.push({parentId:b,nextId:S,node:f})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const i of Array.from(this.movedSet.values()))jt(this.removes,i,this.mirror)&&!this.movedSet.has(i.parentNode)||o(i);for(const i of Array.from(this.addedSet.values()))!Ht(this.droppedSet,i)&&!jt(this.removes,i,this.mirror)||Ht(this.movedSet,i)?o(i):this.droppedSet.add(i);let a=null;for(;n.length;){let i=null;if(a){const l=this.mirror.getId(a.value.parentNode),c=r(a.value);l!==-1&&c!==-1&&(i=a)}if(!i)for(let l=n.length-1;l>=0;l--){const c=n.get(l);if(c){const u=this.mirror.getId(c.value.parentNode);if(r(c.value)===-1)continue;if(u!==-1){i=c;break}else{const d=c.value;if(d.parentNode&&d.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=d.parentNode.host;if(this.mirror.getId(h)!==-1){i=c;break}}}}}if(!i){for(;n.head;)n.removeNode(n.head.value);break}a=i.previous,n.removeNode(i.value),o(i.value)}const s={texts:this.texts.map(i=>({id:this.mirror.getId(i.node),value:i.value})).filter(i=>this.mirror.has(i.id)),attributes:this.attributes.map(i=>({id:this.mirror.getId(i.node),attributes:i.attributes})).filter(i=>this.mirror.has(i.id)),removes:this.removes,adds:e};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!je(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Q(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Lt(e.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.target.getAttribute(e.attributeName);if(e.attributeName==="value"&&(r=et({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),Q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributes.find(a=>a.node===e.target);if(n.tagName==="IFRAME"&&e.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)e.attributeName="rr_src";else return;if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),e.attributeName==="style"){const a=this.doc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const s=o.attributes.style;for(const i of Array.from(n.style)){const l=n.style.getPropertyValue(i),c=n.style.getPropertyPriority(i);(l!==a.style.getPropertyValue(i)||c!==a.style.getPropertyPriority(i))&&(c===""?s[i]=l:s[i]=[l,c])}for(const i of Array.from(a.style))n.style.getPropertyValue(i)===""&&(s[i]=!1)}else o.attributes[e.attributeName]=Ot(this.doc,n.tagName,e.attributeName,r);break}case"childList":{if(Q(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Oe(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||je(n,this.mirror)||!$t(n,this.mirror)||(this.addedSet.has(n)?(pt(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||st(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Gt(r,o)]?pt(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Oe(e.target)&&Le(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(this.mirror.hasNode(e)){if(je(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Gt(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(r=>this.genAdds(r))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(n=>{this[n]=e[n]})}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 pt(t,e){t.delete(e),e.childNodes.forEach(n=>pt(t,n))}function jt(t,e,n){return t.length===0?!1:zt(t,e,n)}function zt(t,e,n){const{parentNode:r}=e;if(!r)return!1;const o=n.getId(r);return t.some(a=>a.id===o)?!0:zt(t,r,n)}function Ht(t,e){return t.size===0?!1:Yt(t,e)}function Yt(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:Yt(t,n):!1}var xr=Object.defineProperty,Or=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,Zt=(t,e,n)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Kt=(t,e)=>{for(var n in e||(e={}))Ar.call(e,n)&&Zt(t,n,e[n]);if(Xt)for(var n of Xt(e))_r.call(e,n)&&Zt(t,n,e[n]);return t},Fr=(t,e)=>Or(t,Lr(e));const Se=[],Qt=typeof CSSGroupingRule<"u",Jt=typeof CSSMediaRule<"u",qt=typeof CSSSupportsRule<"u",en=typeof CSSConditionRule<"u";function Pe(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch{return t.target}}function tn(t,e){var n,r;const o=new Rr;Se.push(o),o.init(t);let a=window.MutationObserver||window.__rrMutationObserver;const s=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");s&&window[s]&&(a=window[s]);const i=new a(o.processMutations.bind(o));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Pr({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const o=typeof e.mousemove=="number"?e.mousemove:50,a=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let s=[],i;const l=Ce(d=>{const h=Date.now()-i;t(s.map(p=>(p.timeOffset-=h,p)),d),s=[],i=null},a),c=Ce(d=>{const h=Pe(d),{clientX:p,clientY:m}=it(d)?d.changedTouches[0]:d;i||(i=Date.now()),s.push({x:p,y:m,id:r.getId(h),timeOffset:Date.now()-i}),l(typeof DragEvent<"u"&&d instanceof DragEvent?N.Drag:d instanceof MouseEvent?N.MouseMove:N.TouchMove)},o,{trailing:!1}),u=[K("mousemove",c,n),K("touchmove",c,n),K("drag",c,n)];return()=>{u.forEach(d=>d())}}function Wr({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const s=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,i=[],l=c=>u=>{const d=Pe(u);if(Q(d,r,o,!0))return;const h=it(u)?u.changedTouches[0]:u;if(!h)return;const p=n.getId(d),{clientX:m,clientY:b}=h;t({type:j[c],id:p,x:m,y:b})};return Object.keys(j).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const u=c.toLowerCase(),d=l(c);i.push(K(u,d,e))}),()=>{i.forEach(c=>c())}}function nn({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,sampling:a}){const s=Ce(i=>{const l=Pe(i);if(!l||Q(l,r,o,!0))return;const c=n.getId(l);if(l===e){const u=e.scrollingElement||e.documentElement;t({id:c,x:u.scrollLeft,y:u.scrollTop})}else t({id:c,x:l.scrollLeft,y:l.scrollTop})},a.scroll||100);return K("scroll",s,e)}function $r({viewportResizeCb:t}){let e=-1,n=-1;const r=Ce(()=>{const o=rt(),a=ot();(e!==o||n!==a)&&(t({width:Number(a),height:Number(o)}),e=o,n=a)},200);return K("resize",r,window)}function rn(t,e){const n=Kt({},t);return e||delete n.userTriggered,n}const Ur=["INPUT","TEXTAREA","SELECT"],on=new WeakMap;function Vr({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,ignoreClass:a,maskInputOptions:s,maskInputFn:i,sampling:l,userTriggeredOnInput:c}){function u(S){let f=Pe(S);const y=S.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||Ur.indexOf(f.tagName)<0||Q(f,r,o,!0))return;const g=f.type;if(f.classList.contains(a))return;let E=f.value,k=!1;g==="radio"||g==="checkbox"?k=f.checked:(s[f.tagName.toLowerCase()]||s[g])&&(E=et({maskInputOptions:s,tagName:f.tagName,type:g,value:E,maskInputFn:i})),d(f,rn({text:E,isChecked:k,userTriggered:y},c));const x=f.name;g==="radio"&&x&&k&&e.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(F=>{F!==f&&d(F,rn({text:F.value,isChecked:!k,userTriggered:!1},c))})}function d(S,f){const y=on.get(S);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){on.set(S,f);const g=n.getId(S);t(Fr(Kt({},f),{id:g}))}}const h=(l.input==="last"?["change"]:["input","change"]).map(S=>K(S,u,e)),p=e.defaultView;if(!p)return()=>{h.forEach(S=>S())};const m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),b=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&h.push(...b.map(S=>Fe(S[0],S[1],{set(){u({target:this})}},!1,p))),()=>{h.forEach(S=>S())}}function ze(t){const e=[];function n(r,o){if(Qt&&r.parentRule instanceof CSSGroupingRule||Jt&&r.parentRule instanceof CSSMediaRule||qt&&r.parentRule instanceof CSSSupportsRule||en&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(a)}return o}return n(t,e)}function fe(t,e,n){let r,o;return t?(t.ownerNode?r=e.getId(t.ownerNode):o=n.getId(t),{styleId:o,id:r}):{}}function Br({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(u,d){const{id:h,styleId:p}=fe(this,e,n.styleMirror);return(h&&h!==-1||p&&p!==-1)&&t({id:h,styleId:p,adds:[{rule:u,index:d}]}),o.apply(this,[u,d])};const a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(u){const{id:d,styleId:h}=fe(this,e,n.styleMirror);return(d&&d!==-1||h&&h!==-1)&&t({id:d,styleId:h,removes:[{index:u}]}),a.apply(this,[u])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(u){const{id:d,styleId:h}=fe(this,e,n.styleMirror);return(d&&d!==-1||h&&h!==-1)&&t({id:d,styleId:h,replace:u}),s.apply(this,[u])});let i;r.CSSStyleSheet.prototype.replaceSync&&(i=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(u){const{id:d,styleId:h}=fe(this,e,n.styleMirror);return(d&&d!==-1||h&&h!==-1)&&t({id:d,styleId:h,replaceSync:u}),i.apply(this,[u])});const l={};Qt?l.CSSGroupingRule=r.CSSGroupingRule:(Jt&&(l.CSSMediaRule=r.CSSMediaRule),en&&(l.CSSConditionRule=r.CSSConditionRule),qt&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(h,p){const{id:m,styleId:b}=fe(this.parentStyleSheet,e,n.styleMirror);return(m&&m!==-1||b&&b!==-1)&&t({id:m,styleId:b,adds:[{rule:h,index:[...ze(this),p||0]}]}),c[u].insertRule.apply(this,[h,p])},d.prototype.deleteRule=function(h){const{id:p,styleId:m}=fe(this.parentStyleSheet,e,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,removes:[{index:[...ze(this),h]}]}),c[u].deleteRule.apply(this,[h])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=a,s&&(r.CSSStyleSheet.prototype.replace=s),i&&(r.CSSStyleSheet.prototype.replaceSync=i),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})}}function sn({mirror:t,stylesheetManager:e},n){var r,o,a;let s=null;n.nodeName==="#document"?s=t.getId(n):s=t.getId(n.host);const i=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(a=(o=n.ownerDocument)==null?void 0:o.defaultView)==null?void 0:a.ShadowRoot,l=Object.getOwnPropertyDescriptor(i?.prototype,"adoptedStyleSheets");return s===null||s===-1||!i||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;const d=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{e.adoptStyleSheets(c,s)}catch{}return d}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})}function Gr({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var u;if(n.has(i))return a.apply(this,[i,l,c]);const{id:d,styleId:h}=fe((u=this.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return(d&&d!==-1||h&&h!==-1)&&t({id:d,styleId:h,set:{property:i,value:l,priority:c},index:ze(this.parentRule)}),a.apply(this,[i,l,c])};const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(i){var l;if(n.has(i))return s.apply(this,[i]);const{id:c,styleId:u}=fe((l=this.parentRule)==null?void 0:l.parentStyleSheet,e,r.styleMirror);return(c&&c!==-1||u&&u!==-1)&&t({id:c,styleId:u,remove:{property:i},index:ze(this.parentRule)}),s.apply(this,[i])},()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=s}}function jr({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:o}){const a=i=>Ce(l=>{const c=Pe(l);if(!c||Q(c,e,n,!0))return;const{currentTime:u,volume:d,muted:h,playbackRate:p}=c;t({type:i,id:r.getId(c),currentTime:u,volume:d,muted:h,playbackRate:p})},o.media||500),s=[K("play",a(me.Play)),K("pause",a(me.Pause)),K("seeked",a(me.Seeked)),K("volumechange",a(me.VolumeChange)),K("ratechange",a(me.RateChange))];return()=>{s.forEach(i=>i())}}function zr({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(i,l,c){const u=new a(i,l,c);return o.set(u,{family:i,buffer:typeof l!="string",descriptors:c,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};const s=ge(e.fonts,"add",function(i){return function(l){return setTimeout(()=>{const c=o.get(l);c&&(t(c),o.delete(l))},0),i.apply(this,[l])}});return r.push(()=>{n.FontFace=a}),r.push(s),()=>{r.forEach(i=>i())}}function Hr(t){const{doc:e,mirror:n,blockClass:r,blockSelector:o,selectionCb:a}=t;let s=!0;const i=()=>{const l=e.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;const c=[],u=l.rangeCount||0;for(let d=0;d<u;d++){const h=l.getRangeAt(d),{startContainer:p,startOffset:m,endContainer:b,endOffset:S}=h;Q(p,r,o,!0)||Q(b,r,o,!0)||c.push({start:n.getId(p),startOffset:m,end:n.getId(b),endOffset:S})}a({ranges:c})};return i(),K("selectionchange",i)}function Yr(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:a,viewportResizeCb:s,inputCb:i,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p}=t;t.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),n(...m)},t.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},t.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),o(...m)},t.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),a(...m)},t.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),s(...m)},t.inputCb=(...m)=>{e.input&&e.input(...m),i(...m)},t.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},t.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),c(...m)},t.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},t.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),d(...m)},t.fontCb=(...m)=>{e.font&&e.font(...m),h(...m)},t.selectionCb=(...m)=>{e.selection&&e.selection(...m),p(...m)}}function Xr(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};Yr(t,e);const r=tn(t,t.doc),o=Pr(t),a=Wr(t),s=nn(t),i=$r(t),l=Vr(t),c=jr(t),u=Br(t,{win:n}),d=sn(t,t.doc),h=Gr(t,{win:n}),p=t.collectFonts?zr(t):()=>{},m=Hr(t),b=[];for(const S of t.plugins)b.push(S.observer(S.callback,n,S.options));return()=>{Se.forEach(S=>S.reset()),r.disconnect(),o(),a(),s(),i(),l(),c(),u(),d(),h(),p(),m(),b.forEach(S=>S())}}class an{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,o){const a=r||this.getIdToRemoteIdMap(e),s=o||this.getRemoteIdToIdMap(e);let i=a.get(n);return i||(i=this.generateIdFn(),a.set(n,i),s.set(i,n)),i}getIds(e,n){const r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return n.map(a=>this.getId(e,a,r,o))}getRemoteId(e,n,r){const o=r||this.getRemoteIdToIdMap(e);return typeof n!="number"?n:o.get(n)||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(o=>this.getRemoteId(e,o,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 n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class Zr{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new an(Rt),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new an(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,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if(e.data.type==="rrweb"){if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,n){var r;switch(n.type){case C.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e),{timestamp:n.timestamp,type:C.IncrementalSnapshot,data:{source:N.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case C.Meta:case C.Load:case C.DomContentLoaded:return!1;case C.Plugin:return n;case C.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case C.IncrementalSnapshot:switch(n.data.source){case N.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,e)}),n.data.removes.forEach(o=>{this.replaceIds(o,e,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,e,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,e,["id"])}),n;case N.Drag:case N.TouchMove:case N.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,e,["id"])}),n;case N.ViewportResize:return!1;case N.MediaInteraction:case N.MouseInteraction:case N.Scroll:case N.CanvasMutation:case N.Input:return this.replaceIds(n.data,e,["id"]),n;case N.StyleSheetRule:case N.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case N.Font:return n;case N.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,e,["start","end"])}),n;case N.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(o=>{this.replaceStyleIds(o,e,["styleId"])}),n}}}replace(e,n,r,o){for(const a of o)!Array.isArray(n[a])&&typeof n[a]!="number"||(Array.isArray(n[a])?n[a]=e.getIds(r,n[a]):n[a]=e.getId(r,n[a]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}}var Kr=Object.defineProperty,Qr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptors,ln=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,cn=(t,e,n)=>e in t?Kr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,un=(t,e)=>{for(var n in e||(e={}))qr.call(e,n)&&cn(t,n,e[n]);if(ln)for(var n of ln(e))eo.call(e,n)&&cn(t,n,e[n]);return t},dn=(t,e)=>Qr(t,Jr(e));class to{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const n=this;this.restorePatches.push(ge(Element.prototype,"attachShadow",function(r){return function(o){const a=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),a}}))}addShadowRoot(e,n){!Le(e)||this.shadowDoms.has(e)||(this.shadowDoms.add(e),tn(dn(un({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),nn(dn(un({},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(e.host)),sn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0))}observeAttachShadow(e){if(e.contentWindow){const n=this;this.restorePatches.push(ge(e.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const a=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,e.contentDocument),a}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}for(var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",We=typeof Uint8Array>"u"?[]:new Uint8Array(256),He=0;He<Me.length;He++)We[Me.charCodeAt(He)]=He;var no=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Me[e[n]>>2],o+=Me[(e[n]&3)<<4|e[n+1]>>4],o+=Me[(e[n+1]&15)<<2|e[n+2]>>6],o+=Me[e[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ro=function(t){var e=t.length*.75,n=t.length,r,o=0,a,s,i,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(r=0;r<n;r+=4)a=We[t.charCodeAt(r)],s=We[t.charCodeAt(r+1)],i=We[t.charCodeAt(r+2)],l=We[t.charCodeAt(r+3)],u[o++]=a<<2|s>>4,u[o++]=(s&15)<<4|i>>2,u[o++]=(i&3)<<6|l&63;return c};const hn=new Map;function oo(t,e){let n=hn.get(t);return n||(n=new Map,hn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const pn=(t,e,n)=>{if(!t||!(fn(t,e)||typeof t=="object"))return;const r=t.constructor.name,o=oo(n,r);let a=o.indexOf(t);return a===-1&&(a=o.length,o.push(t)),a};function Ye(t,e,n){if(t instanceof Array)return t.map(r=>Ye(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,o=no(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Ye(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:o}=t;return{rr_type:r,src:o}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",o=t.toDataURL();return{rr_type:r,src:o}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[Ye(t.data,e,n),t.width,t.height]};if(fn(t,e)||typeof t=="object"){const r=t.constructor.name,o=pn(t,e,n);return{rr_type:r,index:o}}}}return t}const mn=(t,e,n)=>[...t].map(r=>Ye(r,e,n)),fn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof e[r]=="function");return Boolean(n.find(r=>t instanceof e[r]))};function so(t,e,n,r){const o=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const s of a)try{if(typeof e.CanvasRenderingContext2D.prototype[s]!="function")continue;const i=ge(e.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return Q(this.canvas,n,r,!0)||setTimeout(()=>{const u=mn([...c],e,this);t(this.canvas,{type:pe["2D"],property:s,args:u})},0),l.apply(this,c)}});o.push(i)}catch{const l=Fe(e.CanvasRenderingContext2D.prototype,s,{set(c){t(this.canvas,{type:pe["2D"],property:s,args:[c],setter:!0})}});o.push(l)}return()=>{o.forEach(s=>s())}}function yn(t,e,n){const r=[];try{const o=ge(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(s,...i){return Q(this,e,n,!0)||"__context"in this||(this.__context=s),a.apply(this,[s,...i])}});r.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(o=>o())}}function gn(t,e,n,r,o,a,s){const i=[],l=Object.getOwnPropertyNames(t);for(const c of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof t[c]!="function")continue;const u=ge(t,c,function(d){return function(...h){const p=d.apply(this,h);if(pn(p,s,this),!Q(this.canvas,r,o,!0)){const m=mn([...h],s,this),b={type:e,property:c,args:m};n(this.canvas,b)}return p}});i.push(u)}catch{const d=Fe(t,c,{set(h){n(this.canvas,{type:e,property:c,args:[h],setter:!0})}});i.push(d)}return i}function io(t,e,n,r,o){const a=[];return a.push(...gn(e.WebGLRenderingContext.prototype,pe.WebGL,t,n,r,o,e)),typeof e.WebGL2RenderingContext<"u"&&a.push(...gn(e.WebGL2RenderingContext.prototype,pe.WebGL2,t,n,r,o,e)),()=>{a.forEach(s=>s())}}function ao(t,e){var n=atob(t);if(e){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function lo(t,e,n){var r=e===void 0?null:e,o=n===void 0?!1:n,a=ao(t,o),s=a.indexOf(`
-`,10)+1,i=a.substring(s)+(r?"//# sourceMappingURL="+r:""),l=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(l)}function co(t,e,n){var r;return function(a){return r=r||lo(t,e,n),new Worker(r,a)}}var uo=co("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixwPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylwW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgdT1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCxsPW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gdihzLGUsbil7Y29uc3QgYT1gJHtzfS0ke2V9YDtpZigiT2Zmc2NyZWVuQ2FudmFzImluIGdsb2JhbFRoaXMpe2lmKGwuaGFzKGEpKXJldHVybiBsLmdldChhKTtjb25zdCB0PW5ldyBPZmZzY3JlZW5DYW52YXMocyxlKTt0LmdldENvbnRleHQoIjJkIik7Y29uc3QgZz1hd2FpdChhd2FpdCB0LmNvbnZlcnRUb0Jsb2IobikpLmFycmF5QnVmZmVyKCksZD11KGcpO3JldHVybiBsLnNldChhLGQpLGR9ZWxzZSByZXR1cm4iIn1jb25zdCBpPXNlbGY7aS5vbm1lc3NhZ2U9YXN5bmMgZnVuY3Rpb24ocyl7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtjb25zdHtpZDplLGJpdG1hcDpuLHdpZHRoOmEsaGVpZ2h0OnQsZGF0YVVSTE9wdGlvbnM6Z309cy5kYXRhLGQ9dihhLHQsZyksaD1uZXcgT2Zmc2NyZWVuQ2FudmFzKGEsdCk7aC5nZXRDb250ZXh0KCIyZCIpLmRyYXdJbWFnZShuLDAsMCksbi5jbG9zZSgpO2NvbnN0IHc9YXdhaXQgaC5jb252ZXJ0VG9CbG9iKGcpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89dShiKTtpZighYy5oYXMoZSkmJmF3YWl0IGQ9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX1lbHNlIHJldHVybiBpLnBvc3RNZXNzYWdlKHtpZDpzLmRhdGEuaWR9KX19KSgpOwoK",null,!1),vn=Object.getOwnPropertySymbols,ho=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,mo=(t,e)=>{var n={};for(var r in t)ho.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&vn)for(var r of vn(t))e.indexOf(r)<0&&po.call(t,r)&&(n[r]=t[r]);return n},fo=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});class yo{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:n="all",win:r,blockClass:o,blockSelector:a,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o,a),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o,a,{dataURLOptions:i})}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,n,r,o,a){const s=yn(n,r,o),i=new Map,l=new uo;l.onmessage=m=>{const{id:b}=m.data;if(i.set(b,!1),!("base64"in m.data))return;const{base64:S,type:f,width:y,height:g}=m.data;this.mutationCb({id:b,type:pe["2D"],commands:[{property:"clearRect",args:[0,0,y,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:S}],type:f}]},0,0]}]})};const c=1e3/e;let u=0,d;const h=()=>{const m=[];return n.document.querySelectorAll("canvas").forEach(b=>{Q(b,r,o,!0)||m.push(b)}),m},p=m=>{if(u&&m-u<c){d=requestAnimationFrame(p);return}u=m,h().forEach(b=>fo(this,null,function*(){var S;const f=this.mirror.getId(b);if(i.get(f))return;if(i.set(f,!0),["webgl","webgl2"].includes(b.__context)){const g=b.getContext(b.__context);((S=g?.getContextAttributes())==null?void 0:S.preserveDrawingBuffer)===!1&&g?.clear(g.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(b);l.postMessage({id:f,bitmap:y,width:b.width,height:b.height,dataURLOptions:a.dataURLOptions},[y])})),d=requestAnimationFrame(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=yn(e,n,r),a=so(this.processMutation.bind(this),e,n,r),s=io(this.processMutation.bind(this),e,n,r,this.mirror);this.resetObservers=()=>{o(),a(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const o=r.map(s=>mo(s,["type"])),{type:a}=r[0];this.mutationCb({id:n,type:a,commands:o}),this.pendingCanvasMutations.delete(e)}}class go{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ht,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},o=[];for(const a of e){let s;if(this.styleMirror.has(a))s=this.styleMirror.getId(a);else{s=this.styleMirror.add(a);const i=Array.from(a.rules||CSSRule);o.push({styleId:s,rules:i.map((l,c)=>({rule:Mt(l),index:c}))})}r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}var vo=Object.defineProperty,So=Object.defineProperties,bo=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,bn=(t,e,n)=>e in t?vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,se=(t,e)=>{for(var n in e||(e={}))wo.call(e,n)&&bn(t,n,e[n]);if(Sn)for(var n of Sn(e))Eo.call(e,n)&&bn(t,n,e[n]);return t},No=(t,e)=>So(t,bo(e));function G(t){return No(se({},t),{timestamp:Date.now()})}let V,Xe,mt,Ze=!1;const le=kt();function be(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:s="rr-ignore",maskTextClass:i="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:p,maskTextFn:m,hooks:b,packFn:S,sampling:f={},dataURLOptions:y={},mousemoveWait:g,recordCanvas:E=!1,recordCrossOriginIframes:k=!1,userTriggeredOnInput:x=!1,collectFonts:F=!1,inlineImages:_=!1,plugins:J,keepIframeSrcFn:Y=()=>!1,ignoreCSSAttributes:q=new Set([])}=t,z=k?window.parent===window:!0;let X=!1;if(!z)try{window.parent.document,X=!1}catch{X=!0}if(z&&!e)throw new Error("emit function is required");g!==void 0&&f.mousemove===void 0&&(f.mousemove=g),le.reset();const $=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},Z=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};at();let H,L=0;const te=I=>{for(const oe of J||[])oe.eventProcessor&&(I=oe.eventProcessor(I));return S&&(I=S(I)),I};V=(I,oe)=>{var ae;if(((ae=Se[0])==null?void 0:ae.isFrozen())&&I.type!==C.FullSnapshot&&!(I.type===C.IncrementalSnapshot&&I.data.source===N.Mutation)&&Se.forEach(B=>B.unfreeze()),z)e?.(te(I),oe);else if(X){const B={type:"rrweb",event:te(I),isCheckout:oe};window.parent.postMessage(B,"*")}if(I.type===C.FullSnapshot)H=I,L=0;else if(I.type===C.IncrementalSnapshot){if(I.data.source===N.Mutation&&I.data.isAttachIframe)return;L++;const B=r&&L>=r,ue=n&&I.timestamp-H.timestamp>n;(B||ue)&&Xe(!0)}};const w=I=>{V(G({type:C.IncrementalSnapshot,data:se({source:N.Mutation},I)}))},v=I=>V(G({type:C.IncrementalSnapshot,data:se({source:N.Scroll},I)})),M=I=>V(G({type:C.IncrementalSnapshot,data:se({source:N.CanvasMutation},I)})),T=I=>V(G({type:C.IncrementalSnapshot,data:se({source:N.AdoptedStyleSheet},I)})),W=new go({mutationCb:w,adoptedStyleSheetCb:T}),ne=new Zr({mirror:le,mutationCb:w,stylesheetManager:W,recordCrossOriginIframes:k,wrappedEmit:V});for(const I of J||[])I.getMirror&&I.getMirror({nodeMirror:le,crossOriginIframeMirror:ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:ne.crossOriginIframeStyleMirror});mt=new yo({recordCanvas:E,mutationCb:M,win:window,blockClass:o,blockSelector:a,mirror:le,sampling:f.canvas,dataURLOptions:y});const xe=new to({mutationCb:w,scrollCb:v,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:i,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:$,dataURLOptions:y,maskTextFn:m,maskInputFn:p,recordCanvas:E,inlineImages:_,sampling:f,slimDOMOptions:Z,iframeManager:ne,stylesheetManager:W,canvasManager:mt,keepIframeSrcFn:Y},mirror:le});Xe=(I=!1)=>{var oe,ae,B,ue,A,ie;V(G({type:C.Meta,data:{href:window.location.href,width:ot(),height:rt()}}),I),W.reset(),Se.forEach(re=>re.lock());const Ue=Sr(document,{mirror:le,blockClass:o,blockSelector:a,maskTextClass:i,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:$,maskTextFn:m,slimDOM:Z,dataURLOptions:y,recordCanvas:E,inlineImages:_,onSerialize:re=>{Ie(re,le)&&ne.addIframe(re),ct(re,le)&&W.trackLinkElement(re),ve(re)&&xe.addShadowRoot(re.shadowRoot,document)},onIframeLoad:(re,It)=>{ne.attachIframe(re,It),xe.observeAttachShadow(re)},onStylesheetLoad:(re,It)=>{W.attachLinkElement(re,It)},keepIframeSrcFn:Y});if(!Ue)return console.warn("Failed to snapshot the document");V(G({type:C.FullSnapshot,data:{node:Ue,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((ae=(oe=document?.body)==null?void 0:oe.parentElement)==null?void 0:ae.scrollLeft)||((B=document?.body)==null?void 0:B.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((A=(ue=document?.body)==null?void 0:ue.parentElement)==null?void 0:A.scrollTop)||((ie=document?.body)==null?void 0:ie.scrollTop)||0}}})),Se.forEach(re=>re.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,le.getId(document))};try{const I=[];I.push(K("DOMContentLoaded",()=>{V(G({type:C.DomContentLoaded,data:{}}))}));const oe=B=>{var ue;return Xr({mutationCb:w,mousemoveCb:(A,ie)=>V(G({type:C.IncrementalSnapshot,data:{source:ie,positions:A}})),mouseInteractionCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.MouseInteraction},A)})),scrollCb:v,viewportResizeCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.ViewportResize},A)})),inputCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.Input},A)})),mediaInteractionCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.MediaInteraction},A)})),styleSheetRuleCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.StyleSheetRule},A)})),styleDeclarationCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.StyleDeclaration},A)})),canvasMutationCb:M,fontCb:A=>V(G({type:C.IncrementalSnapshot,data:se({source:N.Font},A)})),selectionCb:A=>{V(G({type:C.IncrementalSnapshot,data:se({source:N.Selection},A)}))},blockClass:o,ignoreClass:s,maskTextClass:i,maskTextSelector:l,maskInputOptions:$,inlineStylesheet:c,sampling:f,recordCanvas:E,inlineImages:_,userTriggeredOnInput:x,collectFonts:F,doc:B,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:Y,blockSelector:a,slimDOMOptions:Z,dataURLOptions:y,mirror:le,iframeManager:ne,stylesheetManager:W,shadowDomManager:xe,canvasManager:mt,ignoreCSSAttributes:q,plugins:((ue=J?.filter(A=>A.observer))==null?void 0:ue.map(A=>({observer:A.observer,options:A.options,callback:ie=>V(G({type:C.Plugin,data:{plugin:A.name,payload:ie}}))})))||[]},b)};ne.addLoadListener(B=>{I.push(oe(B.contentDocument))});const ae=()=>{Xe(),I.push(oe(document)),Ze=!0};return document.readyState==="interactive"||document.readyState==="complete"?ae():I.push(K("load",()=>{V(G({type:C.Load,data:{}})),ae()},window)),()=>{I.forEach(B=>B()),Ze=!1}}catch(I){console.warn(I)}}be.addCustomEvent=(t,e)=>{if(!Ze)throw new Error("please add custom event after start recording");V(G({type:C.Custom,data:{tag:t,payload:e}}))},be.freezePage=()=>{Se.forEach(t=>t.freeze())},be.takeFullSnapshot=t=>{if(!Ze)throw new Error("please take full snapshot after start recording");Xe(t)},be.mirror=le;var R;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(R||(R={}));var Co=function(){function t(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return t.prototype.getId=function(e){var n;if(!e)return-1;var r=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return r??-1},t.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},t.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},t.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.prototype.removeNodeFromMap=function(e){var n=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},t.prototype.has=function(e){return this.idNodeMap.has(e)},t.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},t.prototype.add=function(e,n){var r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)},t.prototype.replace=function(e,n){var r=this.getNode(e);if(r){var o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)},t.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t}();function Io(){return new Co}function To(t){const e={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return t.replace(o,"").split(n).forEach(function(a){if(a){const s=a.split(r);s.length>1&&(e[ft(s[0].trim())]=s[1].trim())}}),e}function wn(t){const e=[];for(const n in t){const r=t[n];if(typeof r!="string")continue;const o=Ro(n);e.push(`${o}: ${r};`)}return e.join(" ")}const Mo=/-([a-z])/g,ko=/^--[a-zA-Z0-9-]+$/,ft=t=>ko.test(t)?t:t.replace(Mo,(e,n)=>n?n.toUpperCase():""),Do=/\B([A-Z])/g,Ro=t=>t.replace(Do,"-$1").toLowerCase();class ce{constructor(...e){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const e=this.parentNode;if(!e)return null;const n=e.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(e){if(e===this)return!0;for(const n of this.childNodes)if(n.contains(e))return!0;return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,n){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"}}function xo(t){return class Zn extends t{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=R.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===R.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===R.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===R.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===R.Element||r===R.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===R.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===R.Element||o===R.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===R.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const a=this.childNodes.indexOf(r);if(a==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(a,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new Zn}createDocumentType(n,r,o){const a=new(En(ce))(n,r,o);return a.ownerDocument=this,a}createElement(n){const r=new(Nn(ce))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Cn(ce))(n);return r.ownerDocument=this,r}createComment(n){const r=new(In(ce))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Tn(ce))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function En(t){return class extends t{constructor(e,n,r){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=R.DocumentType,this.textContent=null,this.name=e,this.publicId=n,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}}function Nn(t){return class extends t{constructor(e){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=R.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(n=>e+=n.textContent),e}set textContent(e){this.childNodes=[this.ownerDocument.createTextNode(e)]}get classList(){return new Lo(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?To(this.attributes.style):{},n=/\B([A-Z])/g;return e.setProperty=(r,o,a)=>{if(n.test(r))return;const s=ft(r);o?e[s]=o:delete e[s],a==="important"&&(e[s]+=" !important"),this.attributes.style=wn(e)},e.removeProperty=r=>{if(n.test(r))return"";const o=ft(r),a=e[o]||"";return delete e[o],this.attributes.style=wn(e),a},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,n){this.attributes[e]=n}setAttributeNS(e,n,r){this.setAttribute(n,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return this.childNodes.push(e),e.parentNode=this,e.parentElement=this,e}insertBefore(e,n){if(n===null)return this.appendChild(e);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,e),e.parentElement=this,e.parentNode=this,e}removeChild(e){const n=this.childNodes.indexOf(e);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),e.parentElement=null,e.parentNode=null,e}attachShadow(e){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(e){return!0}toString(){let e="";for(const n in this.attributes)e+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${e}`}}}function Oo(t){return class extends t{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Cn(t){return class extends t{constructor(e){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=R.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function In(t){return class extends t{constructor(e){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=R.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Tn(t){return class extends t{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=R.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Lo{constructor(e,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const a=String(o);this.classes.indexOf(a)>=0||this.classes.push(a)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var U;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const yt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Ao={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function de(t,e,n,r){const o=t.childNodes,a=e.childNodes;r=r||e.mirror||e.ownerDocument.mirror,(o.length>0||a.length>0)&&Mn(Array.from(o),a,t,n,r);let s=null,i=null;switch(e.RRNodeType){case R.Document:{i=e.scrollData;break}case R.Element:{const l=t,c=e;switch(_o(l,c,r),i=c.scrollData,s=c.inputData,c.tagName){case"AUDIO":case"VIDEO":{const u=t,d=c;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime),d.playbackRate!==void 0&&(u.playbackRate=d.playbackRate);break}case"CANVAS":{const u=e;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=l.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,t))}break;case"STYLE":{const u=l.sheet;u&&e.rules.forEach(d=>n.applyStyleSheetMutation(d,u))}break}if(c.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});const u=l.shadowRoot.childNodes,d=c.shadowRoot.childNodes;(u.length>0||d.length>0)&&Mn(Array.from(u),d,l.shadowRoot,n,r)}break}case R.Text:case R.Comment:case R.CDATA:t.textContent!==e.data&&(t.textContent=e.data);break}if(i&&n.applyScroll(i,!0),s&&n.applyInput(s),e.nodeName==="IFRAME"){const l=t.contentDocument,c=e;if(l){const u=r.getMeta(c.contentDocument);u&&n.mirror.add(l,Object.assign({},u)),de(l,c.contentDocument,n,r)}}}function _o(t,e,n){const r=t.attributes,o=e.attributes;for(const a in o){const s=o[a],i=n.getMeta(e);if(i&&"isSVG"in i&&i.isSVG&&yt[a])t.setAttributeNS(yt[a],a,s);else if(e.tagName==="CANVAS"&&a==="rr_dataURL"){const l=document.createElement("img");l.src=s,l.onload=()=>{const c=t.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else t.setAttribute(a,s)}for(const{name:a}of Array.from(r))a in o||t.removeAttribute(a);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Mn(t,e,n,r,o){var a;let s=0,i=t.length-1,l=0,c=e.length-1,u=t[s],d=t[i],h=e[l],p=e[c],m,b;for(;s<=i&&l<=c;){const S=r.mirror.getId(u),f=r.mirror.getId(d),y=o.getId(h),g=o.getId(p);if(u===void 0)u=t[++s];else if(d===void 0)d=t[--i];else if(S!==-1&&S===y)de(u,h,r,o),u=t[++s],h=e[++l];else if(f!==-1&&f===g)de(d,p,r,o),d=t[--i],p=e[--c];else if(S!==-1&&S===g)n.insertBefore(u,d.nextSibling),de(u,p,r,o),u=t[++s],p=e[--c];else if(f!==-1&&f===y)n.insertBefore(d,u),de(d,h,r,o),d=t[--i],h=e[++l];else{if(!m){m={};for(let E=s;E<=i;E++){const k=t[E];k&&r.mirror.hasNode(k)&&(m[r.mirror.getId(k)]=E)}}if(b=m[o.getId(h)],b){const E=t[b];n.insertBefore(E,u),de(E,h,r,o),t[b]=void 0}else{const E=gt(h,r.mirror,o);n.nodeName==="#document"&&((a=r.mirror.getMeta(E))===null||a===void 0?void 0:a.type)===R.Element&&n.documentElement&&(n.removeChild(n.documentElement),t[s]=void 0,u=void 0),n.insertBefore(E,u||null),de(E,h,r,o)}h=e[++l]}}if(s>i){const S=e[c+1];let f=null;for(S&&n.childNodes.forEach(y=>{r.mirror.getId(y)===o.getId(S)&&(f=y)});l<=c;++l){const y=gt(e[l],r.mirror,o);n.insertBefore(y,f),de(y,e[l],r,o)}}else if(l>c)for(;s<=i;s++){const S=t[s];S&&(n.removeChild(S),r.mirror.removeNodeFromMap(S))}}function gt(t,e,n){const r=n.getId(t),o=n.getMeta(t);let a=null;if(r>-1&&(a=e.getNode(r)),a!==null)return a;switch(t.RRNodeType){case R.Document:a=new Document;break;case R.DocumentType:a=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case R.Element:{let s=t.tagName.toLowerCase();s=Ao[s]||s,o&&"isSVG"in o&&o?.isSVG?a=document.createElementNS(yt.svg,s):a=document.createElement(t.tagName);break}case R.Text:a=document.createTextNode(t.data);break;case R.Comment:a=document.createComment(t.data);break;case R.CDATA:a=document.createCDATASection(t.data);break}return o&&e.add(a,Object.assign({},o)),a}class ke extends xo(ce){constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=Ho(),this.scrollData=null,e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,n,r){return new ke}createDocumentType(e,n,r){const o=new Fo(e,n,r);return o.ownerDocument=this,o}createElement(e){const n=e.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Po(n);break;case"IFRAME":r=new Uo(n,this.mirror);break;case"CANVAS":r=new Wo(n);break;case"STYLE":r=new $o(n);break;default:r=new $e(n);break}return r.ownerDocument=this,r}createComment(e){const n=new Bo(e);return n.ownerDocument=this,n}createCDATASection(e){const n=new Go(e);return n.ownerDocument=this,n}createTextNode(e){const n=new Vo(e);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Fo=En(ce);class $e extends Nn(ce){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Po extends Oo($e){}class Wo extends $e{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class $o extends $e{constructor(){super(...arguments),this.rules=[]}}class Uo extends $e{constructor(e,n){super(e),this.contentDocument=new ke,this.contentDocument.mirror=n}}const Vo=Cn(ce),Bo=In(ce),Go=Tn(ce);function jo(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function kn(t,e,n,r){let o;switch(t.nodeType){case U.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=e,o.compatMode=t.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const s=t;o=e.createDocumentType(s.name,s.publicId,s.systemId);break}case U.ELEMENT_NODE:{const s=t,i=jo(s);o=e.createElement(i);const l=o;for(const{name:c,value:u}of Array.from(s.attributes))l.attributes[c]=u;s.scrollLeft&&(l.scrollLeft=s.scrollLeft),s.scrollTop&&(l.scrollTop=s.scrollTop);break}case U.TEXT_NODE:o=e.createTextNode(t.textContent||"");break;case U.CDATA_SECTION_NODE:o=e.createCDATASection(t.data);break;case U.COMMENT_NODE:o=e.createComment(t.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let a=n.getMeta(t);return e instanceof ke&&(a||(a=Dn(o,e.unserializedId),n.add(t,a)),e.mirror.add(o,Object.assign({},a))),o}function zo(t,e=Io(),n=new ke){function r(o,a){const s=kn(o,n,e,a);if(s!==null)if(a?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(a?.appendChild(s),s.parentNode=a,s.parentElement=a),o.nodeName==="IFRAME"){const i=o.contentDocument;i&&r(i,s)}else(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,s),o.childNodes.forEach(i=>r(i,s)))}return r(t,null),n}function Ho(){return new Yo}class Yo{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var n;if(!e)return-1;const r=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return r??-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 n=this.getId(e);this.idNodeMap.delete(n),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,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Dn(t,e){switch(t.RRNodeType){case R.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case R.DocumentType:{const n=t;return{id:e,type:t.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case R.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case R.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case R.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case R.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function Rn(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(o){o(n)}),(r=t.get("*"))&&r.slice().map(function(o){o(e,n)})}}}var Xo=Object.freeze({__proto__:null,default:Rn});function Zo(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const n=t.HTMLElement||t.Element,r=468,o={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:n.prototype.scroll||l,scrollIntoView:n.prototype.scrollIntoView},a=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function s(f){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(f)}const i=s(t.navigator.userAgent)?1:0;function l(f,y){this.scrollLeft=f,this.scrollTop=y}function c(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(f,y){if(y==="Y")return f.clientHeight+i<f.scrollHeight;if(y==="X")return f.clientWidth+i<f.scrollWidth}function h(f,y){const g=t.getComputedStyle(f,null)["overflow"+y];return g==="auto"||g==="scroll"}function p(f){const y=d(f,"Y")&&h(f,"Y"),g=d(f,"X")&&h(f,"X");return y||g}function m(f){for(;f!==e.body&&p(f)===!1;)f=f.parentNode||f.host;return f}function b(f){const y=a();let g,E,k,x=(y-f.startTime)/r;x=x>1?1:x,g=c(x),E=f.startX+(f.x-f.startX)*g,k=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,E,k),(E!==f.x||k!==f.y)&&t.requestAnimationFrame(b.bind(t,f))}function S(f,y,g){let E,k,x,F;const _=a();f===e.body?(E=t,k=t.scrollX||t.pageXOffset,x=t.scrollY||t.pageYOffset,F=o.scroll):(E=f,k=f.scrollLeft,x=f.scrollTop,F=l),b({scrollable:E,method:F,startTime:_,startX:k,startY:x,x:y,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,y=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof y>"u"?this.scrollTop:~~y)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=m(this),y=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-y.left,f.scrollTop+g.top-y.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}class Ko{constructor(e=[],n){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=n.speed,this.liveMode=n.liveMode}addAction(e){if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay){this.actions.push(e);return}const n=this.findActionIndex(e);this.actions.splice(n,0,e)}start(){this.timeOffset=0;let e=performance.now();const n=()=>{const r=performance.now();for(this.timeOffset+=(r-e)*this.speed,e=r;this.actions.length;){const o=this.actions[0];if(this.timeOffset>=o.delay)this.actions.shift(),o.doAction();else break}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}toggleLiveMode(e){this.liveMode=e}isActive(){return this.raf!==null}findActionIndex(e){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<e.delay)n=o+1;else if(this.actions[o].delay>e.delay)r=o-1;else return o+1}return n}}function xn(t,e){if(t.type===C.IncrementalSnapshot&&t.data.source===N.MouseMove&&t.data.positions&&t.data.positions.length){const n=t.data.positions[0].timeOffset,r=t.timestamp+n;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}/*! *****************************************************************************
-    Copyright (c) Microsoft Corporation.
-
-    Permission to use, copy, modify, and/or distribute this software for any
-    purpose with or without fee is hereby granted.
-
-    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-    PERFORMANCE OF THIS SOFTWARE.
-    ***************************************************************************** */function On(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),s=[];try{for(;(e===void 0||e-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(i){o={error:i}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return s}var De;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(De||(De={}));var Ln={type:"xstate.init"};function vt(t){return t===void 0?[]:[].concat(t)}function Re(t){return{type:"xstate.assign",assignment:t}}function An(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function Ke(t){return function(e){return t===e}}function _n(t){return typeof t=="string"?{type:t}:t}function Fn(t,e){return{value:t,context:e,actions:[],changed:!1,matches:Ke(t)}}function Pn(t,e,n){var r=e,o=!1;return[t.filter(function(a){if(a.type==="xstate.assign"){o=!0;var s=Object.assign({},r);return typeof a.assignment=="function"?s=a.assignment(r,n):Object.keys(a.assignment).forEach(function(i){s[i]=typeof a.assignment[i]=="function"?a.assignment[i](r,n):a.assignment[i]}),r=s,!1}return!0}),r,o]}function Wn(t,e){e===void 0&&(e={});var n=On(Pn(vt(t.states[t.initial].entry).map(function(s){return An(s,e.actions)}),t.context,Ln),2),r=n[0],o=n[1],a={config:t,_options:e,initialState:{value:t.initial,actions:r,context:o,matches:Ke(t.initial)},transition:function(s,i){var l,c,u=typeof s=="string"?{value:s,context:t.context}:s,d=u.value,h=u.context,p=_n(i),m=t.states[d];if(m.on){var b=vt(m.on[p.type]);try{for(var S=function(L){var te=typeof Symbol=="function"&&Symbol.iterator,w=te&&L[te],v=0;if(w)return w.call(L);if(L&&typeof L.length=="number")return{next:function(){return L&&v>=L.length&&(L=void 0),{value:L&&L[v++],done:!L}}};throw new TypeError(te?"Object is not iterable.":"Symbol.iterator is not defined.")}(b),f=S.next();!f.done;f=S.next()){var y=f.value;if(y===void 0)return Fn(d,h);var g=typeof y=="string"?{target:y}:y,E=g.target,k=g.actions,x=k===void 0?[]:k,F=g.cond,_=F===void 0?function(){return!0}:F,J=E===void 0,Y=E??d,q=t.states[Y];if(_(h,p)){var z=On(Pn((J?vt(x):[].concat(m.exit,x,q.entry).filter(function(L){return L})).map(function(L){return An(L,a._options.actions)}),h,p),3),X=z[0],$=z[1],Z=z[2],H=E??d;return{value:H,context:$,actions:X,changed:E!==d||X.length>0||Z,matches:Ke(H)}}}}catch(L){l={error:L}}finally{try{f&&!f.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}}return Fn(d,h)}};return a}var $n=function(t,e){return t.actions.forEach(function(n){var r=n.exec;return r&&r(t.context,e)})};function Un(t){var e=t.initialState,n=De.NotStarted,r=new Set,o={_machine:t,send:function(a){n===De.Running&&(e=t.transition(e,a),$n(e,_n(a)),r.forEach(function(s){return s(e)}))},subscribe:function(a){return r.add(a),a(e),{unsubscribe:function(){return r.delete(a)}}},start:function(a){if(a){var s=typeof a=="object"?a:{context:t.config.context,value:a};e={value:s.value,actions:[],context:s.context,matches:Ke(s.value)}}return n=De.Running,$n(e,Ln),o},stop:function(){return n=De.Stopped,r.clear(),o},get state(){return e},get status(){return n}};return o}var Qo=Object.defineProperty,Jo=Object.defineProperties,qo=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable,Bn=(t,e,n)=>e in t?Qo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,St=(t,e)=>{for(var n in e||(e={}))es.call(e,n)&&Bn(t,n,e[n]);if(Vn)for(var n of Vn(e))ts.call(e,n)&&Bn(t,n,e[n]);return t},bt=(t,e)=>Jo(t,qo(e));function ns(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type===C.Meta&&r.timestamp<=e)return t.slice(n)}return t}function rs(t,{getCastFn:e,applyEventsSynchronously:n,emitter:r}){const o=Wn({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Re({lastPlayedEvent:(a,s)=>s.type==="CAST_EVENT"?s.payload.event:a.lastPlayedEvent}),recordTimeOffset:Re((a,s)=>{let i=a.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(i=s.payload.timeOffset),bt(St({},a),{timeOffset:i,baselineTime:a.events[0].timestamp+i})}),play(a){var s;const{timer:i,events:l,baselineTime:c,lastPlayedEvent:u}=a;i.clear();for(const m of l)xn(m,c);const d=ns(l,c);let h=u?.timestamp;u?.type===C.IncrementalSnapshot&&u.data.source===N.MouseMove&&(h=u.timestamp+((s=u.data.positions[0])==null?void 0:s.timeOffset)),c<(h||0)&&r.emit(O.PlayBack);const p=new Array;for(const m of d)if(!(h&&h<c&&(m.timestamp<=h||m===u)))if(m.timestamp<c)p.push(m);else{const b=e(m,!1);i.addAction({doAction:()=>{b()},delay:m.delay})}n(p),r.emit(O.Flush),i.start()},pause(a){a.timer.clear()},resetLastPlayedEvent:Re(a=>bt(St({},a),{lastPlayedEvent:null})),startLive:Re({baselineTime:(a,s)=>(a.timer.toggleLiveMode(!0),a.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:Re((a,s)=>{const{baselineTime:i,timer:l,events:c}=a;if(s.type==="ADD_EVENT"){const{event:u}=s.payload;xn(u,i);let d=c.length-1;if(!c[d]||c[d].timestamp<=u.timestamp)c.push(u);else{let m=-1,b=0;for(;b<=d;){const S=Math.floor((b+d)/2);c[S].timestamp<=u.timestamp?b=S+1:d=S-1}m===-1&&(m=b),c.splice(m,0,u)}const h=u.timestamp<i,p=e(u,h);h?p():l.isActive()&&l.addAction({doAction:()=>{p()},delay:u.delay})}return bt(St({},a),{events:c})})}});return Un(o)}function os(t){const e=Wn({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:Re({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Un(e)}const ss=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"];var is=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});const Gn=new Map;function jn(t,e){let n=Gn.get(t);return n||(n=new Map,Gn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}function ye(t,e,n){return r=>is(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield ye(t,e,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||e===null)return r;const{rr_type:o,index:a}=r;return jn(e,o)[a]}else if("args"in r){const{rr_type:o,args:a}=r,s=window[o];return new s(...yield Promise.all(a.map(ye(t,e,n))))}else{if("base64"in r)return ro(r.base64);if("src"in r){const o=t.get(r.src);if(o)return o;{const a=new Image;return a.src=r.src,t.set(r.src,a),a}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(ye(t,e,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(ye(t,e,n)));return r})}var as=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});function ls(t,e){try{return e===pe.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const cs=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function us(t,e){if(!(e!=null&&e.constructor))return;const{name:n}=e.constructor;if(!cs.includes(n))return;const r=jn(t,n);r.includes(e)||r.push(e)}function ds(t){return as(this,arguments,function*({mutation:e,target:n,type:r,imageMap:o,errorHandler:a}){try{const s=ls(n,r);if(!s)return;if(e.setter){s[e.property]=e.args[0];return}const i=s[e.property],l=yield Promise.all(e.args.map(ye(o,s))),c=i.apply(s,l);us(s,c)}catch(s){a(e,s)}})}var hs=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});function ps(t){return hs(this,arguments,function*({event:e,mutation:n,target:r,imageMap:o,errorHandler:a}){try{const s=r.getContext("2d");if(n.setter){s[n.property]=n.args[0];return}const i=s[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")o.get(e),i.apply(s,n.args);else{const l=yield Promise.all(n.args.map(ye(o,s)));i.apply(s,l)}}catch(s){a(n,s)}})}var ms=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});function zn(t){return ms(this,arguments,function*({event:e,mutation:n,target:r,imageMap:o,canvasEventMap:a,errorHandler:s}){try{const i=a.get(e)||n,l="commands"in i?i.commands:[i];if([pe.WebGL,pe.WebGL2].includes(n.type)){for(let c=0;c<l.length;c++){const u=l[c];yield ds({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:s})}return}for(let c=0;c<l.length;c++){const u=l[c];yield ps({event:e,mutation:u,target:r,imageMap:o,errorHandler:s})}}catch(i){s(n,i)}})}var fs=Object.defineProperty,ys=Object.defineProperties,gs=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertySymbols,vs=Object.prototype.hasOwnProperty,Ss=Object.prototype.propertyIsEnumerable,Yn=(t,e,n)=>e in t?fs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qe=(t,e)=>{for(var n in e||(e={}))vs.call(e,n)&&Yn(t,n,e[n]);if(Hn)for(var n of Hn(e))Ss.call(e,n)&&Yn(t,n,e[n]);return t},wt=(t,e)=>ys(t,gs(e)),Et=(t,e,n)=>new Promise((r,o)=>{var a=l=>{try{i(n.next(l))}catch(c){o(c)}},s=l=>{try{i(n.throw(l))}catch(c){o(c)}},i=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);i((n=n.apply(t,e)).next())});const bs=10*1e3,ws=5*1e3,Es=Rn||Xo,Nt="[replayer]",Ct={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Xn(t){return t.type==C.IncrementalSnapshot&&(t.data.source==N.TouchMove||t.data.source==N.MouseInteraction&&t.data.type==j.TouchStart)}class Ns{constructor(e,n){if(this.usingVirtualDom=!1,this.virtualDom=new ke,this.mouseTail=null,this.tailPositions=[],this.emitter=Es(),this.legacy_missingNodeRetryMap={},this.cache=Wt(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=kt(),this.styleMirror=new ht,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=i=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])!l||(l.setAttribute("width",String(i.width)),l.setAttribute("height",String(i.height)))},this.applyEventsSynchronously=i=>{for(const l of i){switch(l.type){case C.DomContentLoaded:case C.Load:case C.Custom:continue;case C.FullSnapshot:case C.Meta:case C.Plugin:case C.IncrementalSnapshot:break}this.getCastFn(l,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(i,l=!1)=>{let c;switch(i.type){case C.DomContentLoaded:case C.Load:break;case C.Custom:c=()=>{this.emitter.emit(O.CustomEvent,i)};break;case C.Meta:c=()=>this.emitter.emit(O.Resize,{width:i.data.width,height:i.data.height});break;case C.FullSnapshot:c=()=>{var u;if(this.firstFullSnapshot){if(this.firstFullSnapshot===i){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(i,l),(u=this.iframe.contentWindow)==null||u.scrollTo(i.data.initialOffset),this.styleMirror.reset()};break;case C.IncrementalSnapshot:c=()=>{if(this.applyIncremental(i,l),!l&&(i===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=i.timestamp)&&this.isUserInteraction(u)){u.delay-i.delay>bs*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-i.delay,d={speed:Math.min(Math.round(u/ws),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(O.SkipStart,d)}}};break}return()=>{c&&c();for(const d of this.config.plugins||[])d.handler&&d.handler(i,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:i}});const u=this.service.state.context.events.length-1;if(i===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};i.type===C.IncrementalSnapshot&&i.data.source===N.MouseMove&&i.data.positions.length?setTimeout(()=>{d()},Math.max(0,-i.data.positions[0].timeOffset+50)):d()}this.emitter.emit(O.EventCast,i)}},!(n!=null&&n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Ct,useVirtualDom:!0};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom();for(const i of this.config.plugins||[])i.getMirror&&i.getMirror({nodeMirror:this.mirror});this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const i={mirror:this.mirror,applyCanvas:(l,c,u)=>{zn({event:l,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===N.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===N.StyleDeclaration&&this.applyStyleDeclaration(l,c)}};if(this.iframe.contentDocument&&de(this.iframe.contentDocument,this.virtualDom,i,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],u=gt(c.node,this.mirror,this.virtualDom.mirror);de(u,c.node,i,this.virtualDom.mirror),c.node=u}catch(c){this.config.showWarning&&console.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});const o=new Ko([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=rs({events:e.map(i=>n&&n.unpackFn?n.unpackFn(i):i).sort((i,l)=>i.timestamp-l.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(i=>{this.emitter.emit(O.StateChange,{player:i})}),this.speedService=os({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(i=>{this.emitter.emit(O.StateChange,{speed:i})});const a=this.service.state.context.events.find(i=>i.type===C.Meta),s=this.service.state.context.events.find(i=>i.type===C.FullSnapshot);if(a){const{width:i,height:l}=a.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:i,height:l})},0)}s&&setTimeout(()=>{var i;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(i=this.iframe.contentWindow)==null||i.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(Xn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,n){return this.emitter.on(e,n),this}off(e,n){return this.emitter.off(e,n),this}setConfig(e){Object.keys(e).forEach(n=>{e[n],this.config[n]=e[n]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:n.timestamp,totalTime:n.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:n}=this.service.state.context;return e-n[0].timestamp}getMirror(){return this.mirror}play(e=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start)}pause(e){var n,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(e=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(O.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(O.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const n=this.config.unpackFn?this.config.unpackFn(e):e;Xn(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Wt()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Zo(this.iframe.contentWindow,this.iframe.contentDocument),at(this.iframe.contentWindow))}rebuildFullSnapshot(e,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],o=(i,l)=>{this.collectIframeAndAttachDocument(r,i);for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(i,{id:l,replayer:this})};Mr(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:i,builtNode:l}of r)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i);const{documentElement:a,head:s}=this.iframe.contentDocument;this.insertStyleRules(a,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,e),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,n){var r;const o=ss(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const a=this.virtualDom.createElement("style");this.virtualDom.mirror.add(a,Dn(a,this.virtualDom.unserializedId)),e.insertBefore(a,n),a.rules.push({source:N.StyleSheetRule,adds:o.map((s,i)=>({rule:s,index:i}))})}else{const a=document.createElement("style");e.insertBefore(a,n);for(let s=0;s<o.length;s++)(r=a.sheet)==null||r.insertRule(o[s],s)}}attachDocumentToIframe(e,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[],a=(s,i)=>{this.collectIframeAndAttachDocument(o,s);const l=r.getMeta(s);if(l?.type===D.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:u}=n.contentDocument;this.insertStyleRules(c,u)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:i,replayer:this})};_e(e.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(n.contentDocument,e.node.id);for(const{mutationInQueue:s,builtNode:i}of o)this.attachDocumentToIframe(s,i),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(e,n){if(Ie(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&e.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var e;const n=(e=this.iframe.contentDocument)==null?void 0:e.head;if(n){const r=new Set;let o,a=this.service.state;const s=()=>{a=this.service.state};this.emitter.on(O.Start,s),this.emitter.on(O.Pause,s);const i=()=>{this.emitter.off(O.Start,s),this.emitter.off(O.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&o!==-1&&(a.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),i())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{a.matches("playing")&&this.play(this.getCurrentTime()),o=-1,i()},this.config.loadTimeout))}}preloadAllImages(){return Et(this,null,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(O.Start,e),this.emitter.on(O.Pause,e);const n=[];for(const r of this.service.state.context.events)r.type===C.IncrementalSnapshot&&r.data.source===N.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(e,n){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),a=o?.createImageData(r.width,r.height);a?.data,JSON.parse(e.args[0]),o?.putImageData(a,0,0)}}deserializeAndPreloadCanvasEvents(e,n){return Et(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in e){const o=yield Promise.all(e.commands.map(a=>Et(this,null,function*(){const s=yield Promise.all(a.args.map(ye(this.imageMap,null,r)));return wt(Qe({},a),{args:s})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,wt(Qe({},e),{commands:o}))}else{const o=yield Promise.all(e.args.map(ye(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,wt(Qe({},e),{args:o}))}}})}applyIncremental(e,n){var r,o,a;const{data:s}=e;switch(s.source){case N.Mutation:{try{this.applyMutation(s,n)}catch(i){this.warn(`Exception in mutation ${i.message||i}`,s)}break}case N.Drag:case N.TouchMove:case N.MouseMove:if(n){const i=s.positions[s.positions.length-1];this.mousePos={x:i.x,y:i.y,id:i.id,debugData:s}}else s.positions.forEach(i=>{const l={doAction:()=>{this.moveAndHover(i.x,i.y,i.id,n,s)},delay:i.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case N.MouseInteraction:{if(s.id===-1||n)break;const i=new Event(j[s.type].toLowerCase()),l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);this.emitter.emit(O.MouseInteraction,{type:s.type,target:l});const{triggerFocus:c}=this.config;switch(s.type){case j.Blur:"blur"in l&&l.blur();break;case j.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case j.Click:case j.TouchStart:case j.TouchEnd:n?(s.type===j.TouchStart?this.touchActive=!0:s.type===j.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===j.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===j.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===j.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===j.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case j.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(i)}break}case N.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const i=this.virtualDom.mirror.getNode(s.id);if(!i)return this.debugNodeNotFound(s,s.id);i.scrollData=s;break}this.applyScroll(s,n);break}case N.ViewportResize:this.emitter.emit(O.Resize,{width:s.width,height:s.height});break;case N.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const i=this.virtualDom.mirror.getNode(s.id);if(!i)return this.debugNodeNotFound(s,s.id);i.inputData=s;break}this.applyInput(s);break}case N.MediaInteraction:{const i=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!i)return this.debugNodeNotFound(s,s.id);const l=i;try{s.currentTime&&(l.currentTime=s.currentTime),s.volume&&(l.volume=s.volume),s.muted&&(l.muted=s.muted),s.type===me.Pause&&l.pause(),s.type===me.Play&&l.play(),s.type===me.RateChange&&(l.playbackRate=s.playbackRate)}catch(c){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case N.StyleSheetRule:case N.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((o=this.virtualDom.mirror.getNode(s.id))==null||o.rules.push(s)):this.applyStyleSheetMutation(s);break}case N.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const i=this.virtualDom.mirror.getNode(s.id);if(!i)return this.debugNodeNotFound(s,s.id);i.canvasMutations.push({event:e,mutation:s})}else{const i=this.mirror.getNode(s.id);if(!i)return this.debugNodeNotFound(s,s.id);zn({event:e,mutation:s,target:i,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case N.Font:{try{const i=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(i)}catch(i){this.config.showWarning&&console.warn(i)}break}case N.Selection:{if(n){this.lastSelectionData=s;break}this.applySelection(s);break}case N.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(e,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,zo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],d=kn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return e.removes.find(p=>p.id===c.parentId)?void 0:this.warnNodeNotFound(e,c.id);let h=r.getNode(c.parentId);if(!h)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&ve(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(p){if(p instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,e);else throw p}});const o=Qe({},this.legacy_missingNodeRetryMap),a=[],s=c=>{let u=null;return c.nextId&&(u=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},i=c=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(c.parentId);if(!d)return c.node.type===D.Document?this.newDocumentQueue.push(c):a.push(c);c.node.isShadow&&(ve(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,p=null;if(c.previousId&&(h=r.getNode(c.previousId)),c.nextId&&(p=r.getNode(c.nextId)),s(c))return a.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;const m=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ie(d,r)){this.attachDocumentToIframe(c,d);return}const b=(y,g)=>{for(const E of this.config.plugins||[])E.onBuild&&E.onBuild(y,{id:g,replayer:this})},S=_e(c.node,{doc:m,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:b});if(c.previousId===-1||c.nextId===-1){o[c.node.id]={node:S,mutation:c};return}const f=r.getMeta(d);if(f&&f.type===D.Element&&f.tagName==="textarea"&&c.node.type===D.Text){const y=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const g of y)g.nodeType===d.TEXT_NODE&&d.removeChild(g)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(S,h.nextSibling);else if(p&&p.parentNode)d.contains(p)?d.insertBefore(S,p):d.insertBefore(S,null);else{if(d===m)for(;m.firstChild;)m.removeChild(m.firstChild);d.appendChild(S)}if(b(S,c.node.id),this.usingVirtualDom&&S.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ie(S,this.mirror)){const y=this.mirror.getId(S),g=this.newDocumentQueue.find(E=>E.parentId===y);g&&(this.attachDocumentToIframe(g,S),this.newDocumentQueue=this.newDocumentQueue.filter(E=>E!==g))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(o,d,S,c)};e.adds.forEach(c=>{i(c)});const l=Date.now();for(;a.length;){const c=Ut(a);if(a.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)r.getNode(u.value.parentId)?lt(u,d=>{i(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Vt(e.texts).forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return e.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);if(d.textContent=c.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),e.attributes.forEach(c=>{const u=r.getNode(c.id);if(!u)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const h=c.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{if(d==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{const p=r.getMeta(u);Object.assign(p.attributes,c.attributes);const m=_e(p,{doc:u.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),b=u.nextSibling,S=u.parentNode;if(m&&S){S.removeChild(u),S.insertBefore(m,b),r.replace(c.id,m);break}}catch{}u.setAttribute(d,h)}catch(p){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",p)}else if(d==="style"){const p=h,m=u;for(const b in p)if(p[b]===!1)m.style.removeProperty(b);else if(p[b]instanceof Array){const S=p[b];m.style.setProperty(b,S[0],S[1])}else{const S=p[b];m.style.setProperty(b,S)}}}})}applyScroll(e,n){var r,o;const a=this.mirror.getNode(e.id);if(!a)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(a);if(a===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if(s?.type===D.Document)(o=a.defaultView)==null||o.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{a.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(e){const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);try{n.checked=e.isChecked,n.value=e.text}catch{}}applySelection(e){try{const n=new Set,r=e.ranges.map(({start:o,startOffset:a,end:s,endOffset:i})=>{const l=this.mirror.getNode(o),c=this.mirror.getNode(s);if(!l||!c)return;const u=new Range;u.setStart(l,a),u.setEnd(c,i);const d=l.ownerDocument,h=d?.getSelection();return h&&n.add(h),{range:u,selection:h}});n.forEach(o=>o.removeAllRanges()),r.forEach(o=>{var a;return o&&((a=o.selection)==null?void 0:a.addRange(o.range))})}catch{}}applyStyleSheetMutation(e){var n;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((n=this.mirror.getNode(e.id))==null?void 0:n.sheet)||null),r&&(e.source===N.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===N.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,n){var r,o,a,s;if((r=e.adds)==null||r.forEach(({rule:i,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:u}=dt(l);Te(n.cssRules,c).insertRule(i,u)}else{const c=l===void 0?void 0:Math.min(l,n.cssRules.length);n?.insertRule(i,c)}}catch{}}),(o=e.removes)==null||o.forEach(({index:i})=>{try{if(Array.isArray(i)){const{positions:l,index:c}=dt(i);Te(n.cssRules,l).deleteRule(c||0)}else n?.deleteRule(i)}catch{}}),e.replace)try{(a=n.replace)==null||a.call(n,e.replace)}catch{}if(e.replaceSync)try{(s=n.replaceSync)==null||s.call(n,e.replaceSync)}catch{}}applyStyleDeclaration(e,n){e.set&&Te(n.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Te(n.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var n;const r=this.mirror.getNode(e.id);if(!r)return;(n=e.styles)==null||n.forEach(i=>{var l;let c=null,u=null;if(ve(r)?u=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(u=r.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,i.styleId),this.applyStyleSheetRule({source:N.StyleSheetRule,adds:i.rules},c)}catch{}});const o=10;let a=0;const s=(i,l)=>{const c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);ve(i)?i.shadowRoot.adoptedStyleSheets=c:i.nodeName==="#document"&&(i.adoptedStyleSheets=c),c.length!==l.length&&a<o&&(setTimeout(()=>s(i,l),0+100*a),a++)};s(r,e.styleIds)}legacy_resolveMissingNode(e,n,r,o){const{previousId:a,nextId:s}=o,i=a&&e[a],l=s&&e[s];if(i){const{node:c,mutation:u}=i;n.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}if(l){const{node:c,mutation:u}=l;n.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}}moveAndHover(e,n,r,o,a){const s=this.mirror.getNode(r);if(!s)return this.debugNodeNotFound(a,r);const i=ut(s,this.iframe),l=e*i.absoluteScale+i.x,c=n*i.absoluteScale+i.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,o||this.drawMouseTail({x:l,y:c}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:a}=this.config.mouseTail===!0?Ct:Object.assign({},Ct,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const i=this.mouseTail.getContext("2d");!i||!this.tailPositions.length||(i.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),i.beginPath(),i.lineWidth=r,i.lineCap=n,i.strokeStyle=o,i.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>i.lineTo(l.x,l.y)),i.stroke())};this.tailPositions.push(e),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(i=>i!==e),s()},a/this.speedService.state.context.timer.speed)}hoverElements(e){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==C.IncrementalSnapshot?!1:e.data.source>N.Mutation&&e.data.source<=N.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,n){this.warn(`Node with id '${n}' not found. `,e)}warnCanvasMutationFailed(e,n){this.warn("Has error on canvas update",n,"canvas mutation:",e)}debugNodeNotFound(e,n){this.debug(Nt,`Node with id '${n}' not found. `,e)}warn(...e){!this.config.showWarning||console.warn(Nt,...e)}debug(...e){!this.config.showDebug||console.log(Nt,...e)}}const{addCustomEvent:Cs}=be,{freezePage:Is}=be;return ee.EventType=C,ee.IncrementalSource=N,ee.MouseInteractions=j,ee.Replayer=Ns,ee.ReplayerEvents=O,ee.addCustomEvent=Cs,ee.freezePage=Is,ee.record=be,ee.utils=kr,Object.defineProperty(ee,"__esModule",{value:!0}),ee}({});
\ No newline at end of file
diff --git a/src/lmnr/sdk/browser/rrweb/rrweb.umd.min.cjs b/src/lmnr/sdk/browser/rrweb/rrweb.umd.min.cjs
new file mode 100644
index 00000000..4bea70f3
--- /dev/null
+++ b/src/lmnr/sdk/browser/rrweb/rrweb.umd.min.cjs
@@ -0,0 +1,98 @@
+(function (g, f) {
+    if ("object" == typeof exports && "object" == typeof module) {
+      module.exports = f();
+    } else if ("function" == typeof define && define.amd) {
+      define("lmnrRrweb", [], f);
+    } else if ("object" == typeof exports) {
+      exports["lmnrRrweb"] = f();
+    } else {
+      g["lmnrRrweb"] = f();
+    }
+  }(this, () => {
+var exports = {};
+var module = { exports };
+"use strict";var Xa=Object.defineProperty,Ja=Object.defineProperties;var Ka=Object.getOwnPropertyDescriptors;var Dt=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable;var Oi=(s,e,t)=>e in s?Xa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,M=(s,e)=>{for(var t in e||(e={}))Di.call(e,t)&&Oi(s,t,e[t]);if(Dt)for(var t of Dt(e))Ti.call(e,t)&&Oi(s,t,e[t]);return s},q=(s,e)=>Ja(s,Ka(e));var Fe=(s,e)=>{var t={};for(var r in s)Di.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&Dt)for(var r of Dt(s))e.indexOf(r)<0&&Ti.call(s,r)&&(t[r]=s[r]);return t};var Qa=Object.defineProperty,qa=(s,e,t)=>e in s?Qa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,b=(s,e,t)=>qa(s,typeof e!="symbol"?e+"":e,t),_i;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var el=Object.defineProperty,tl=(s,e,t)=>e in s?el(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ki=(s,e,t)=>tl(s,typeof e!="symbol"?e+"":e,t),R=(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))(R||{});const $i={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Pi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tt={},rl=()=>!!globalThis.Zone;function Bs(s){if(Tt[s])return Tt[s];const e=globalThis[s],t=e.prototype,r=s in $i?$i[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=s in Pi?Pi[s]:void 0,n=!!(o&&o.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&n&&!rl())return Tt[s]=e.prototype,e.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return e.prototype;const u=l[s].prototype;return document.body.removeChild(a),u?Tt[s]=u:t}catch(a){return t}}const Wr={};function Re(s,e,t){var r;const i=`${s}.${String(t)}`;if(Wr[i])return Wr[i].call(e);const o=Bs(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(Wr[i]=n,n.call(e)):e[t]}const zr={};function jn(s,e,t){const r=`${s}.${String(t)}`;if(zr[r])return zr[r].bind(e);const o=Bs(s)[t];return typeof o!="function"?e[t]:(zr[r]=o,o.bind(e))}function sl(s){return Re("Node",s,"childNodes")}function il(s){return Re("Node",s,"parentNode")}function nl(s){return Re("Node",s,"parentElement")}function ol(s){return Re("Node",s,"textContent")}function al(s,e){return jn("Node",s,"contains")(e)}function ll(s){return jn("Node",s,"getRootNode")()}function ul(s){return!s||!("host"in s)?null:Re("ShadowRoot",s,"host")}function cl(s){return s.styleSheets}function hl(s){return!s||!("shadowRoot"in s)?null:Re("Element",s,"shadowRoot")}function fl(s,e){return Re("Element",s,"querySelector")(e)}function dl(s,e){return Re("Element",s,"querySelectorAll")(e)}function pl(){return Bs("MutationObserver").constructor}const ee={childNodes:sl,parentNode:il,parentElement:nl,textContent:ol,contains:al,getRootNode:ll,host:ul,styleSheets:cl,shadowRoot:hl,querySelector:fl,querySelectorAll:dl,mutationObserver:pl};function Us(s){return s.nodeType===s.ELEMENT_NODE}function ut(s){const e=s&&"host"in s&&"mode"in s&&ee.host(s)||null;return!!(e&&"shadowRoot"in e&&ee.shadowRoot(e)===s)}function ct(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function ml(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 gl(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 ss(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>Yn(i,t)).join("");return ml(r)}catch(e){return null}}function Yn(s,e){if(wl(s)){let t;try{t=ss(s.styleSheet)||gl(s)}catch(r){t=s.cssText}return s.styleSheet.href?ur(t,s.styleSheet.href):t}else{let t=s.cssText;return bl(s)&&s.selectorText.includes(":")&&(t=yl(t)),e?ur(t,e):t}}function yl(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function wl(s){return"styleSheet"in s}function bl(s){return"selectorText"in s}class Ws{constructor(){ki(this,"idNodeMap",new Map),ki(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-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 Hn(){return new Ws}function zs({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:o}){let n=i||"";const a=r&&Me(r);return(e[t.toLowerCase()]||a&&e[a])&&(o?n=o(n,s):n="*".repeat(n.length)),n}function Me(s){return s.toLowerCase()}const Li="__rrweb_original__";function Sl(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 o=e.getImageData,n=Li in o?o[Li]:o;if(new Uint32Array(n.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function vl(s,e){return!s||!e||s.type!==e.type?!1:s.type===R.Document?s.compatMode===e.compatMode:s.type===R.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===R.Comment||s.type===R.Text||s.type===R.CDATA?s.textContent===e.textContent:s.type===R.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function Vs(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Me(e):null}function Zn(s,e){var o;let t;try{t=new URL(s,e!=null?e:window.location.href)}catch(n){return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(o=i==null?void 0:i[1])!=null?o:null}function Cl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const El=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Il=/^(?:[a-z+]+:)?\/\//i,xl=/^www\..*/i,Ml=/^(data:)([^,]*),(.*)/i;function ur(s,e){return(s||"").replace(El,(t,r,i,o,n,a)=>{const l=i||n||a,u=r||o||"";if(!l)return t;if(Il.test(l)||xl.test(l))return`url(${u}${l}${u})`;if(Ml.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${Cl(e)+l}${u})`;const c=e.split("/"),h=l.split("/");c.pop();for(const f of h)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Vr(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Rl(s,e){const t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){const i=Vr(s);for(let o=1;o<t.length;o++)if(t[o].textContent&&typeof t[o].textContent=="string"){const n=Vr(t[o].textContent);for(let a=3;a<n.length;a++){const l=n.substring(0,a);if(i.split(l).length===2){const u=i.indexOf(l);for(let c=u;c<s.length;c++)if(Vr(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function Nl(s,e){return Rl(s,e).join("/* rr_split */")}let Al=1;const Ol=new RegExp("[^a-z0-9-_:]"),dt=-2;function Xn(){return Al++}function Dl(s){if(s instanceof HTMLFormElement)return"form";const e=Me(s.tagName);return Ol.test(e)?"div":e}let Be,Fi;const Tl=/^[^ \t\n\r\u000c]+/,_l=/^[, \t\n\r\u000c]+/;function kl(s,e){if(e.trim()==="")return e;let t=0;function r(o){let n;const a=o.exec(e.substring(t));return a?(n=a[0],t+=n.length,n):""}const i=[];for(;r(_l),!(t>=e.length);){let o=r(Tl);if(o.slice(-1)===",")o=Ve(s,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Ve(s,o);let a=!1;for(;;){const l=e.charAt(t);if(l===""){i.push((o+n).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,i.push((o+n).trim());break}else l==="("&&(a=!0);n+=l,t+=1}}}return i.join(", ")}const Bi=new WeakMap;function Ve(s,e){return!e||e.trim()===""?e:Gs(s,e)}function $l(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Gs(s,e){let t=Bi.get(s);if(t||(t=s.createElement("a"),Bi.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Jn(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ve(s,r):t==="srcset"?kl(s,r):t==="style"?ur(r,Gs(s)):e==="object"&&t==="data"?Ve(s,r):r)}function Kn(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Pl(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(r){}return!1}function cr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?cr(ee.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?cr(ee.parentNode(s),e,t):!1}function Qn(s,e,t,r){let i;if(Us(s)){if(i=s,!ee.childNodes(i).length)return!1}else{if(ee.parentElement(s)===null)return!1;i=ee.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(cr(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch(o){}return!1}function Ll(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch(a){return}if(o!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const n="about:blank";if(r.location.href!==n||s.src===n||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Fl(s,e,t){let r=!1,i;try{i=s.sheet}catch(n){return}if(i)return;const o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function Bl(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:n,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:f,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:p=!1,cssCaptured:d=!1}=e,y=Ul(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:s.compatMode}:{type:R.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:y};case s.ELEMENT_NODE:return zl(s,{doc:t,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:f,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:p,rootId:y});case s.TEXT_NODE:return Wl(s,{doc:t,needsMask:n,maskTextFn:u,rootId:y,cssCaptured:d});case s.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:y};case s.COMMENT_NODE:return{type:R.Comment,textContent:ee.textContent(s)||"",rootId:y};default:return!1}}function Ul(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function Wl(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:o}=e,n=ee.parentNode(s),a=n&&n.tagName;let l="";const u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=ee.textContent(s),u&&l&&(l=ur(l,Gs(e.doc)))),!u&&!c&&l&&t&&(l=r?r(l,ee.parentElement(s)):l.replace(/[\S]/g,"*")),{type:R.Text,textContent:l||"",rootId:i}}function zl(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:n={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:f=!1,rootId:m}=e,g=Pl(s,r,i),p=Dl(s);let d={};const y=s.attributes.length;for(let w=0;w<y;w++){const v=s.attributes[w];Kn(p,v.name,v.value)||(d[v.name]=Jn(t,p,Me(v.name),v.value))}if(p==="link"&&o){const w=Array.from(t.styleSheets).find(x=>x.href===s.href);let v=null;w&&(v=ss(w)),v&&(delete d.rel,delete d.href,d._cssText=v)}if(p==="style"&&s.sheet){let w=ss(s.sheet);w&&(s.childNodes.length>1&&(w=Nl(w,s)),d._cssText=w)}if(p==="input"||p==="textarea"||p==="select"){const w=s.value,v=s.checked;d.type!=="radio"&&d.type!=="checkbox"&&d.type!=="submit"&&d.type!=="button"&&w?d.value=zs({element:s,type:Vs(s),tagName:p,value:w,maskInputOptions:n,maskInputFn:a}):v&&(d.checked=v)}if(p==="option"&&(s.selected&&!n.select?d.selected=!0:delete d.selected),p==="dialog"&&s.open&&(d.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),p==="canvas"&&c){if(s.__context==="2d")Sl(s)||(d.rr_dataURL=s.toDataURL(l.type,l.quality));else if(!("__context"in s)){const w=s.toDataURL(l.type,l.quality),v=t.createElement("canvas");v.width=s.width,v.height=s.height;const x=v.toDataURL(l.type,l.quality);w!==x&&(d.rr_dataURL=w)}}if(p==="img"&&u){Be||(Be=t.createElement("canvas"),Fi=Be.getContext("2d"));const w=s,v=w.currentSrc||w.getAttribute("src")||"<unknown-src>",x=w.crossOrigin,N=()=>{w.removeEventListener("load",N);try{Be.width=w.naturalWidth,Be.height=w.naturalHeight,Fi.drawImage(w,0,0),d.rr_dataURL=Be.toDataURL(l.type,l.quality)}catch(z){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?N():w.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${v}! Error: ${z}`)}w.crossOrigin==="anonymous"&&(x?d.crossOrigin=x:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?N():w.addEventListener("load",N)}if(p==="audio"||p==="video"){const w=d;w.rr_mediaState=s.paused?"paused":"played",w.rr_mediaCurrentTime=s.currentTime,w.rr_mediaPlaybackRate=s.playbackRate,w.rr_mediaMuted=s.muted,w.rr_mediaLoop=s.loop,w.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(d.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(d.rr_scrollTop=s.scrollTop)),g){const{width:w,height:v}=s.getBoundingClientRect();d={class:d.class,rr_width:`${w}px`,rr_height:`${v}px`}}p==="iframe"&&!h(d.src)&&(s.contentDocument||(d.rr_src=d.src),delete d.src);let S;try{customElements.get(p)&&(S=!0)}catch(w){}return{type:R.Element,tagName:p,attributes:d,childNodes:[],isSVG:$l(s)||void 0,needBlock:g,rootId:m,isCustom:S}}function W(s){return s==null?"":s.toLowerCase()}function Vl(s,e){if(e.comment&&s.type===R.Comment)return!0;if(s.type===R.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Zn(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(W(s.attributes.name).match(/^msapplication-tile(image|color)$/)||W(s.attributes.name)==="application-name"||W(s.attributes.rel)==="icon"||W(s.attributes.rel)==="apple-touch-icon"||W(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&W(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(W(s.attributes.property).match(/^(og|twitter|fb):/)||W(s.attributes.name).match(/^(og|twitter):/)||W(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(W(s.attributes.name)==="robots"||W(s.attributes.name)==="googlebot"||W(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(W(s.attributes.name)==="author"||W(s.attributes.name)==="generator"||W(s.attributes.name)==="framework"||W(s.attributes.name)==="publisher"||W(s.attributes.name)==="progid"||W(s.attributes.property).match(/^article:/)||W(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(W(s.attributes.name)==="google-site-verification"||W(s.attributes.name)==="yandex-verification"||W(s.attributes.name)==="csrf-token"||W(s.attributes.name)==="p:domain_verify"||W(s.attributes.name)==="verify-v1"||W(s.attributes.name)==="verification"||W(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ge(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:n,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g={},inlineImages:p=!1,recordCanvas:d=!1,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:z=!1,cssCaptured:B=!1}=e;let{needsMask:H}=e,{preserveWhiteSpace:Q=!0}=e;H||(H=Qn(s,n,a,H===void 0));const se=Bl(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:H,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,dataURLOptions:g,inlineImages:p,recordCanvas:d,keepIframeSrcFn:N,newlyAddedElement:z,cssCaptured:B});if(!se)return console.warn(s,"not serialized"),null;let ie;r.hasNode(s)?ie=r.getId(s):Vl(se,m)||!Q&&se.type===R.Text&&!se.textContent.replace(/^\s+|\s+$/gm,"").length?ie=dt:ie=Xn();const O=Object.assign(se,{id:ie});if(r.add(s,O),ie===dt)return null;y&&y(s);let Oe=!l;if(O.type===R.Element){Oe=Oe&&!O.needBlock,delete O.needBlock;const Z=ee.shadowRoot(s);Z&&ct(Z)&&(O.isShadowHost=!0)}if((O.type===R.Document||O.type===R.Element)&&Oe){m.headWhitespace&&O.type===R.Element&&O.tagName==="head"&&(Q=!1);const Z={doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:H,maskTextClass:n,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:p,recordCanvas:d,preserveWhiteSpace:Q,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:N,cssCaptured:!1};if(!(O.type===R.Element&&O.tagName==="textarea"&&O.attributes.value!==void 0)){O.type===R.Element&&O.attributes._cssText!==void 0&&typeof O.attributes._cssText=="string"&&(Z.cssCaptured=!0);for(const ae of Array.from(ee.childNodes(s))){const ne=Ge(ae,Z);ne&&O.childNodes.push(ne)}}let P=null;if(Us(s)&&(P=ee.shadowRoot(s)))for(const ae of Array.from(ee.childNodes(P))){const ne=Ge(ae,Z);ne&&(ct(P)&&(ne.isShadow=!0),O.childNodes.push(ne))}}const De=ee.parentNode(s);return De&&ut(De)&&ct(De)&&(O.isShadow=!0),O.type===R.Element&&O.tagName==="iframe"&&Ll(s,()=>{const Z=s.contentDocument;if(Z&&S){const P=Ge(Z,{doc:Z,mirror:r,blockClass:i,blockSelector:o,needsMask:H,maskTextClass:n,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:p,recordCanvas:d,preserveWhiteSpace:Q,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:N});P&&S(s,P)}},w),O.type===R.Element&&O.tagName==="link"&&typeof O.attributes.rel=="string"&&(O.attributes.rel==="stylesheet"||O.attributes.rel==="preload"&&typeof O.attributes.href=="string"&&Zn(O.attributes.href)==="css")&&Fl(s,()=>{if(v){const Z=Ge(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:H,maskTextClass:n,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:m,dataURLOptions:g,inlineImages:p,recordCanvas:d,preserveWhiteSpace:Q,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:N});Z&&v(s,Z)}},x),O}function Gl(s,e){const{mirror:t=new Ws,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:n=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:f,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:p,onSerialize:d,onIframeLoad:y,iframeLoadTimeout:S,onStylesheetLoad:w,stylesheetLoadTimeout:v,keepIframeSrcFn:x=()=>!1}=e||{};return Ge(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:n,skipChild:!1,inlineStylesheet:a,maskInputOptions: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,maskTextFn:h,maskInputFn:f,slimDOMOptions:m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m===!1?{}:m,dataURLOptions:g,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:d,onIframeLoad:y,iframeLoadTimeout:S,onStylesheetLoad:w,stylesheetLoadTimeout:v,keepIframeSrcFn:x,newlyAddedElement:!1})}const jl=/(max|min)-device-(width|height)/,Ui=new RegExp(jl.source,"g"),Yl={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(Ui)&&(s.params=s.params.replace(Ui,"$1-$2"))}}}},Hl={postcssPlugin:"postcss-hover-classes",prepare:function(){const s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
+`+t.replace(/:hover/g,".\\:hover"))}))}}}};function Zl(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Xl(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 js={exports:{}},V=String,qn=function(){return{isColorSupported:!1,reset:V,bold:V,dim:V,italic:V,underline:V,inverse:V,hidden:V,strikethrough:V,black:V,red:V,green:V,yellow:V,blue:V,magenta:V,cyan:V,white:V,gray:V,bgBlack:V,bgRed:V,bgGreen:V,bgYellow:V,bgBlue:V,bgMagenta:V,bgCyan:V,bgWhite:V}};js.exports=qn();js.exports.createColors=qn;var Jl=js.exports;const Kl={},Ql=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"})),ce=Xl(Ql);let Wi=Jl,zi=ce,is=class eo extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(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,eo)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(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),zi&&e&&(t=zi(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=Wi.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let m=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
+ `+m+a("^")}return" "+l(f)+u}).join(`
+`)}toString(){let e=this.showSourceCode();return e&&(e=`
+
+`+e+`
+`),this.name+": "+this.message+e}};var Ys=is;is.default=is;var Et={};Et.isClean=Symbol("isClean");Et.my=Symbol("my");const Vi={after:`
+`,beforeClose:`
+`,beforeComment:`
+`,beforeDecl:`
+`,beforeOpen:" ",beforeRule:`
+`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function ql(s){return s[0].toUpperCase()+s.slice(1)}let ns=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!="undefined"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+i+o,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,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
+`)){let n=this.raw(e,null,"indent");if(n.length)for(let a=0;a<o;a++)r+=n}return r}block(e,t){let 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;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let o=e.nodes[i],n=this.raw(o,"before");n&&this.builder(n),this.stringify(o,t!==i||r)}}comment(e){let 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!="undefined"))return i;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Vi[r];let n=e.root();if(n.rawCache||(n.rawCache={}),typeof n.rawCache[r]!="undefined")return n.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+ql(r);this[a]?i=this[a](n,e):n.walk(l=>{if(i=l.raws[t],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=Vi[r]),n.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after!="undefined")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!="undefined")return r=i.raws.before,r.includes(`
+`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?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!="undefined")return r=i.raws.before,r.includes(`
+`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?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!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before!="undefined")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!="undefined")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!="undefined"))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!="undefined"){let o=r.raws.before.split(`
+`);return t=o[o.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!="undefined"))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)}};var to=ns;ns.default=ns;let eu=to;function os(s,e){new eu(e).stringify(s)}var xr=os;os.default=os;let{isClean:_t,my:tu}=Et,ru=Ys,su=to,iu=xr;function as(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],o=typeof i;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(n=>as(n,t)):(o==="object"&&i!==null&&(i=as(i)),t[r]=i)}return t}let ls=class{constructor(e={}){this.raws={},this[_t]=!1,this[tu]=!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=as(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 ru(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[_t]){this[_t]=!1;let e=this;for(;e=e.parent;)e[_t]=!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,o=this.source.start.line;for(let n=0;n<e;n++)r[n]===`
+`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let 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){let i=this.toString(),o=i.indexOf(e.word);o!==-1&&(t=this.positionInside(o,i),r=this.positionInside(o+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 su().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(let 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;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let a=this[n];if(Array.isArray(a))r[n]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)r[n]=a.toJSON(null,t);else if(n==="source"){let l=t.get(a.input);l==null&&(l=o,t.set(a.input,o),o++),r[n]={end:a.end,inputId:l,start:a.start}}else r[n]=a}return i&&(r.inputs=[...t.keys()].map(n=>n.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=iu){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let o in r)i[o]=r[o];return e.warn(t,i)}get proxyOf(){return this}};var Mr=ls;ls.default=ls;let nu=Mr,us=class extends nu{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=q(M({},e),{value:String(e.value)})),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Rr=us;us.default=us;let ou="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",au=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},lu=(s=21)=>{let e="",t=s;for(;t--;)e+=ou[Math.random()*64|0];return e};var uu={nanoid:lu,customAlphabet:au};let{SourceMapConsumer:Gi,SourceMapGenerator:ji}=ce,{existsSync:cu,readFileSync:hu}=ce,{dirname:Gr,join:fu}=ce;function du(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let cs=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=Gr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Gi(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,/,o=/^data:application\/json,/;if(i.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return du(e.substr(RegExp.lastMatch.length));let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}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=Gr(e),cu(e))return this.mapFile=e,hu(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 Gi)return ji.fromSourceMap(t).toString();if(t instanceof ji)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=fu(Gr(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)}};var ro=cs;cs.default=cs;let{SourceMapConsumer:pu,SourceMapGenerator:mu}=ce,{fileURLToPath:Yi,pathToFileURL:kt}=ce,{isAbsolute:hs,resolve:fs}=ce,{nanoid:gu}=uu,jr=ce,Hi=Ys,yu=ro,Yr=Symbol("fromOffsetCache"),wu=!!(pu&&mu),Zi=!!(fs&&hs),hr=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||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&&(!Zi||/^\w+:\/\//.test(t.from)||hs(t.from)?this.file=t.from:this.file=fs(t.from)),Zi&&wu){let r=new yu(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="<input css "+gu(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,n,a;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);n=h.line,a=h.col}else n=c.line,a=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let l=this.origin(t,r,n,a);return l?o=new Hi(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Hi(e,n===void 0?t:{column:r,line:t},n===void 0?r:{column:a,line:n},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:n,line:t,source:this.css},this.file&&(kt&&(o.input.url=kt(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[Yr])r=this[Yr];else{let o=this.css.split(`
+`);r=new Array(o.length);let n=0;for(let a=0,l=o.length;a<l;a++)r[a]=n,n+=o[a].length+1;this[Yr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let o=r.length-2,n;for(;i<o;)if(n=i+(o-i>>1),e<r[n])o=n-1;else if(e>=r[n+1])i=n+1;else{i=n;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:fs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let o=this.map.consumer(),n=o.originalPositionFor({column:t,line:e});if(!n.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;hs(n.source)?l=kt(n.source):l=new URL(n.source,this.map.consumer().sourceRoot||kt(this.map.mapFile));let u={column:n.column,endColumn:a&&a.column,endLine:a&&a.line,line:n.line,url:l.toString()};if(l.protocol==="file:")if(Yi)u.file=Yi(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(n.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=M({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Nr=hr;hr.default=hr;jr&&jr.registerInput&&jr.registerInput(hr);let{SourceMapConsumer:so,SourceMapGenerator:rr}=ce,{dirname:sr,relative:io,resolve:no,sep:oo}=ce,{pathToFileURL:Xi}=ce,bu=Nr,Su=!!(so&&rr),vu=!!(sr&&no&&io&&oo),Cu=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||sr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new so(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(),vu&&Su&&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=rr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new rr({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)):"<no source>"});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 rr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,n;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(`
+`),t=a.length-n):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.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!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?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?sr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=sr(no(r,this.mapOpts.annotation)));let i=io(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 bu(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)):"<no source>";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(Xi){let r=Xi(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;oo==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var ao=Cu;let Eu=Mr,ds=class extends Eu{constructor(e){super(e),this.type="comment"}};var Ar=ds;ds.default=ds;let{isClean:lo,my:uo}=Et,co=Rr,ho=Ar,Iu=Mr,fo,Hs,Zs,po;function mo(s){return s.map(e=>(e.nodes&&(e.nodes=mo(e.nodes)),delete e.source,e))}function go(s){if(s[lo]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)go(e)}let be=class yo extends Iu{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]<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;let 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"?(o,n)=>i(o.toProxy(),n):i)):t==="every"||t==="some"?r=>e[t]((i,...o)=>r(i.toProxy(),...o)):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 n of i)this.proxyOf.nodes.splice(r+1,0,n);let o;for(let n in this.indexes)o=this.indexes[n],r<o&&(this.indexes[n]=o+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let n;for(let a in this.indexes)n=this.indexes[a],r<=n&&(this.indexes[a]=n+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=mo(fo(e).nodes);else if(typeof e=="undefined")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=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new co(e)]}else if(e.selector)e=[new Hs(e)];else if(e.name)e=[new Zs(e)];else if(e.text)e=[new ho(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[uo]||yo.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[lo]&&go(i),typeof i.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(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(o){throw t.addToError(o)}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]}};be.registerParse=s=>{fo=s};be.registerRule=s=>{Hs=s};be.registerAtRule=s=>{Zs=s};be.registerRoot=s=>{po=s};var $e=be;be.default=be;be.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Zs.prototype):s.type==="rule"?Object.setPrototypeOf(s,Hs.prototype):s.type==="decl"?Object.setPrototypeOf(s,co.prototype):s.type==="comment"?Object.setPrototypeOf(s,ho.prototype):s.type==="root"&&Object.setPrototypeOf(s,po.prototype),s[uo]=!0,s.nodes&&s.nodes.forEach(e=>{be.rebuild(e)})};let xu=$e,wo,bo,pt=class extends xu{constructor(e){super(M({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new wo(new bo,this,e).stringify()}};pt.registerLazyResult=s=>{wo=s};pt.registerProcessor=s=>{bo=s};var Xs=pt;pt.default=pt;let ps=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}};var So=ps;ps.default=ps;let Mu=So,ms=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 Mu(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Js=ms;ms.default=ms;const Hr=39,Ji=34,$t=92,Ki=47,Pt=10,it=32,Lt=12,Ft=9,Bt=13,Ru=91,Nu=93,Au=40,Ou=41,Du=123,Tu=125,_u=59,ku=42,$u=58,Pu=64,Ut=/[\t\n\f\r "#'()/;[\\\]{}]/g,Wt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Lu=/.[\r\n"'(/\\]/,Qi=/[\da-f]/i;var Fu=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,o,n,a,l,u,c,h,f,m,g,p=r.length,d=0,y=[],S=[];function w(){return d}function v(B){throw e.error("Unclosed "+B,d)}function x(){return S.length===0&&d>=p}function N(B){if(S.length)return S.pop();if(d>=p)return;let H=B?B.ignoreUnclosed:!1;switch(o=r.charCodeAt(d),o){case Pt:case it:case Ft:case Bt:case Lt:{n=d;do n+=1,o=r.charCodeAt(n);while(o===it||o===Pt||o===Ft||o===Bt||o===Lt);g=["space",r.slice(d,n)],d=n-1;break}case Ru:case Nu:case Du:case Tu:case $u:case _u:case Ou:{let Q=String.fromCharCode(o);g=[Q,Q,d];break}case Au:{if(f=y.length?y.pop()[1]:"",m=r.charCodeAt(d+1),f==="url"&&m!==Hr&&m!==Ji&&m!==it&&m!==Pt&&m!==Ft&&m!==Lt&&m!==Bt){n=d;do{if(c=!1,n=r.indexOf(")",n+1),n===-1)if(i||H){n=d;break}else v("bracket");for(h=n;r.charCodeAt(h-1)===$t;)h-=1,c=!c}while(c);g=["brackets",r.slice(d,n+1),d,n],d=n}else n=r.indexOf(")",d+1),l=r.slice(d,n+1),n===-1||Lu.test(l)?g=["(","(",d]:(g=["brackets",l,d,n],d=n);break}case Hr:case Ji:{a=o===Hr?"'":'"',n=d;do{if(c=!1,n=r.indexOf(a,n+1),n===-1)if(i||H){n=d+1;break}else v("string");for(h=n;r.charCodeAt(h-1)===$t;)h-=1,c=!c}while(c);g=["string",r.slice(d,n+1),d,n],d=n;break}case Pu:{Ut.lastIndex=d+1,Ut.test(r),Ut.lastIndex===0?n=r.length-1:n=Ut.lastIndex-2,g=["at-word",r.slice(d,n+1),d,n],d=n;break}case $t:{for(n=d,u=!0;r.charCodeAt(n+1)===$t;)n+=1,u=!u;if(o=r.charCodeAt(n+1),u&&o!==Ki&&o!==it&&o!==Pt&&o!==Ft&&o!==Bt&&o!==Lt&&(n+=1,Qi.test(r.charAt(n)))){for(;Qi.test(r.charAt(n+1));)n+=1;r.charCodeAt(n+1)===it&&(n+=1)}g=["word",r.slice(d,n+1),d,n],d=n;break}default:{o===Ki&&r.charCodeAt(d+1)===ku?(n=r.indexOf("*/",d+2)+1,n===0&&(i||H?n=r.length:v("comment")),g=["comment",r.slice(d,n+1),d,n],d=n):(Wt.lastIndex=d+1,Wt.test(r),Wt.lastIndex===0?n=r.length-1:n=Wt.lastIndex-2,g=["word",r.slice(d,n+1),d,n],y.push(g),d=n);break}}return d++,g}function z(B){S.push(B)}return{back:z,endOfFile:x,nextToken:N,position:w}};let vo=$e,fr=class extends vo{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)}};var Ks=fr;fr.default=fr;vo.registerAtRule(fr);let Co=$e,Eo,Io,Xe=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 o of i)o.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 Eo(new Io,this,e).stringify()}};Xe.registerLazyResult=s=>{Eo=s};Xe.registerProcessor=s=>{Io=s};var It=Xe;Xe.default=Xe;Co.registerRoot(Xe);let mt={comma(s){return mt.split(s,[","],!0)},space(s){let e=[" ",`
+`,"	"];return mt.split(s,e)},split(s,e,t){let r=[],i="",o=!1,n=0,a=!1,l="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?n+=1:c===")"?n>0&&(n-=1):n===0&&e.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var xo=mt;mt.default=mt;let Mo=$e,Bu=xo,dr=class extends Mo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Bu.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)}};var Qs=dr;dr.default=dr;Mo.registerRule(dr);let Uu=Rr,Wu=Fu,zu=Ar,Vu=Ks,Gu=It,qi=Qs;const en={empty:!0,space:!0};function ju(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Yu=class{constructor(e){this.input=e,this.root=new Gu,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 Vu;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,o,n=!1,a=!1,l=[],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==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),n&&(e=l[l.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=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let o=t-1;o>=0&&(i=e[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,o;for(let[n,a]of e.entries()){if(r=a,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return n}o=r}return!1}comment(e){let t=new zu;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=Wu(this.input)}decl(e,t){let r=new Uu;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]||ju(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 o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let n=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)n.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[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(o[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let f=u;f>0;f--){let m=c[f][0];if(h.trim().indexOf("!")===0&&m!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=n.map(u=>u[1]).join(""),n=[]),this.raw(r,"value",n.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 qi;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,o=null,n=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),n.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),n.push("}");else if(n.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(i=!0);else r===n[n.length-1]&&(n.pop(),n.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(o),t&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}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 o,n,a=r.length,l="",u=!0,c,h;for(let f=0;f<a;f+=1)o=r[f],n=o[0],n==="space"&&f===a-1&&!i?u=!1:n==="comment"?(h=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!en[h]&&!en[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:f,value:l}}e[t]=l}rule(e){e.pop();let t=new qi;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;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let 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})}};var Hu=Yu;let Zu=$e,Xu=Hu,Ju=Nr;function pr(s,e){let t=new Ju(s,e),r=new Xu(t);try{r.parse()}catch(i){throw i}return r.root}var qs=pr;pr.default=pr;Zu.registerParse(pr);let{isClean:pe,my:Ku}=Et,Qu=ao,qu=xr,ec=$e,tc=Xs;let tn=Js,rc=qs,sc=It;const ic={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},nc={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},oc={Once:!0,postcssPlugin:!0,prepare:!0},Je=0;function nt(s){return typeof s=="object"&&typeof s.then=="function"}function Ro(s){let e=!1,t=ic[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,Je,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,Je,t+"Exit"]:[t,t+"Exit"]}function rn(s){let e;return s.type==="document"?e=["Document",Je,"DocumentExit"]:s.type==="root"?e=["Root",Je,"RootExit"]:e=Ro(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function gs(s){return s[pe]=!1,s.nodes&&s.nodes.forEach(e=>gs(e)),s}let ys={},Ke=class No{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=gs(t);else if(t instanceof No||t instanceof tn)i=gs(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=rc;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(t,r)}catch(n){this.processed=!0,this.error=n}i&&!i[Ku]&&ec.rebuild(i)}this.result=new tn(e,i,r),this.helpers=q(M({},ys),{postcss:ys,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?M(M({},o),o.prepare(this.result)):o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}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(!nc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!oc[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;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(nt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[pe];){e[pe]=!0;let t=[rn(e)];for(;t.length>0;){let r=this.visitTick(t);if(nt(r))try{await r}catch(i){let o=t[t.length-1].node;throw this.handleError(i,o)}}}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(o=>r(o,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 nt(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=qu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Qu(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(nt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[pe];)e[pe]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(nt(o))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.length){let[n,a]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let n=t.iterator,a;for(;a=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!a[pe]){a[pe]=!0,e.push(rn(a));return}t.iterator=0,delete r.indexes[n]}let o=t.events;for(;t.eventIndex<o.length;){let n=o[t.eventIndex];if(t.eventIndex+=1,n===Je){r.nodes&&r.nodes.length&&(r[pe]=!0,t.iterator=r.getIterator());return}else if(this.listeners[n]){t.visitors=this.listeners[n];return}}e.pop()}walkSync(e){e[pe]=!0;let t=Ro(e);for(let r of t)if(r===Je)e.nodes&&e.each(i=>{i[pe]||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"}};Ke.registerPostcss=s=>{ys=s};var Ao=Ke;Ke.default=Ke;sc.registerLazyResult(Ke);tc.registerLazyResult(Ke);let ac=ao,lc=xr;let uc=qs;const cc=Js;let ws=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,o=lc;this.result=new cc(this._processor,i,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let a=new ac(o,i,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.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 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=uc;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"}};var hc=ws;ws.default=ws;let fc=hc,dc=Ao,pc=Xs,mc=It,gt=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)))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 fc(this,e,t):new dc(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var gc=gt;gt.default=gt;mc.registerProcessor(gt);pc.registerProcessor(gt);let yc=Rr,wc=ro,bc=Ar,Sc=Ks,vc=Nr,Cc=It,Ec=Qs;function yt(s,e){if(Array.isArray(s))return s.map(n=>yt(n));let i=s,{inputs:t}=i,r=Fe(i,["inputs"]);if(t){e=[];for(let n of t){let a=q(M({},n),{__proto__:vc.prototype});a.map&&(a.map=q(M({},a.map),{__proto__:wc.prototype})),e.push(a)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>yt(n,e))),r.source){let o=r.source,{inputId:n}=o,a=Fe(o,["inputId"]);r.source=a,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new Cc(r);if(r.type==="decl")return new yc(r);if(r.type==="rule")return new Ec(r);if(r.type==="comment")return new bc(r);if(r.type==="atrule")return new Sc(r);throw new Error("Unknown node type: "+s.type)}var Ic=yt;yt.default=yt;let xc=Ys,Oo=Rr,Mc=Ao,Rc=$e,ei=gc,Nc=xr,Ac=Ic,Do=Xs,Oc=So,To=Ar,_o=Ks,Dc=Js,Tc=Nr,_c=qs,kc=xo,ko=Qs,$o=It,$c=Mr;function L(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new ei(s)}L.plugin=function(e,t){let r=!1;function i(...n){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 a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new ei().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return L([i(l)]).process(n,a)},i};L.stringify=Nc;L.parse=_c;L.fromJSON=Ac;L.list=kc;L.comment=s=>new To(s);L.atRule=s=>new _o(s);L.decl=s=>new Oo(s);L.rule=s=>new ko(s);L.root=s=>new $o(s);L.document=s=>new Do(s);L.CssSyntaxError=xc;L.Declaration=Oo;L.Container=Rc;L.Processor=ei;L.Document=Do;L.Comment=To;L.Warning=Oc;L.AtRule=_o;L.Result=Dc;L.Input=Tc;L.Rule=ko;L.Root=$o;L.Node=$c;Mc.registerPostcss(L);var Pc=L;L.default=L;const j=Zl(Pc);j.stringify;j.fromJSON;j.plugin;j.parse;j.list;j.document;j.comment;j.atRule;j.rule;j.decl;j.root;j.CssSyntaxError;j.Declaration;j.Container;j.Processor;j.Document;j.Comment;j.Warning;j.AtRule;j.Result;j.Input;j.Rule;j.Root;j.Node;const sn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Lc(s){let e=sn[s.tagName]?sn[s.tagName]:s.tagName;return e==="link"&&s.attributes._cssText&&(e="style"),e}function Or(s,e){const t=e==null?void 0:e.stylesWithHoverClass.get(s);if(t)return t;const i=j([Yl,Hl]).process(s).css;return e==null||e.stylesWithHoverClass.set(s,i),i}function nn(){return{stylesWithHoverClass:new Map}}function Fc(s,e,t,r){const i=[];for(const n of s.childNodes)n.type===R.Text&&i.push(n);const o=e.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));for(let n=0;n<i.length;n++){const a=i[n],l=o[n];a&&l&&(a.textContent=t?Or(l,r):l)}}function Bc(s,e,t,r){const{doc:i,hackCss:o,cache:n}=r;s.childNodes.length?Fc(s,t,o,n):(o&&(t=Or(t,n)),e.appendChild(i.createTextNode(t)))}function Uc(s,e){var t;const{doc:r,hackCss:i,cache:o}=e;switch(s.type){case R.Document:return r.implementation.createDocument(null,"",null);case R.DocumentType:return r.implementation.createDocumentType(s.name||"html",s.publicId,s.systemId);case R.Element:{const n=Lc(s);let a;s.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",n):(s.isCustom&&((t=r.defaultView)!=null&&t.customElements)&&!r.defaultView.customElements.get(s.tagName)&&r.defaultView.customElements.define(s.tagName,class extends r.defaultView.HTMLElement{}),a=r.createElement(n));const l={};for(const u in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,u))continue;let c=s.attributes[u];if(!(n==="option"&&u==="selected"&&c===!1)&&c!==null){if(c===!0&&(c=""),u.startsWith("rr_")){l[u]=c;continue}if(typeof c=="string"){if(n==="style"&&u==="_cssText"){Bc(s,a,c,e);continue}else if(n==="textarea"&&u==="value"){a.appendChild(r.createTextNode(c)),s.childNodes=[];continue}}try{if(s.isSVG&&u==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",u,c.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")a.setAttribute("_"+u,c.toString());else if(n==="meta"&&s.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){a.setAttribute("csp-content",c.toString());continue}else n==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||n==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&s.attributes.href.endsWith(".js")||(n==="img"&&s.attributes.srcset&&s.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",s.attributes.srcset):a.setAttribute(u,c.toString()))}catch(h){}}}for(const u in l){const c=l[u];if(n==="canvas"&&u==="rr_dataURL"){const h=r.createElement("img");h.onload=()=>{const f=a.getContext("2d");f&&f.drawImage(h,0,0,h.width,h.height)},h.src=c.toString(),a.RRNodeType&&(a.rr_dataURL=c.toString())}else if(n==="img"&&u==="rr_dataURL"){const h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",s.attributes.src),h.src=c.toString())}if(u==="rr_width")a.style.setProperty("width",c.toString());else if(u==="rr_height")a.style.setProperty("height",c.toString());else if(u==="rr_mediaCurrentTime"&&typeof c=="number")a.currentTime=c;else if(u==="rr_mediaState")switch(c){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else u==="rr_mediaPlaybackRate"&&typeof c=="number"?a.playbackRate=c:u==="rr_mediaMuted"&&typeof c=="boolean"?a.muted=c:u==="rr_mediaLoop"&&typeof c=="boolean"?a.loop=c:u==="rr_mediaVolume"&&typeof c=="number"?a.volume=c:u==="rr_open_mode"&&a.setAttribute("rr_open_mode",c)}if(s.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case R.Text:return s.isStyle&&i?r.createTextNode(Or(s.textContent,o)):r.createTextNode(s.textContent);case R.CDATA:return r.createCDATASection(s.textContent);case R.Comment:return r.createComment(s.textContent);default:return null}}function ht(s,e){const{doc:t,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:n,cache:a}=e;if(r.has(s.id)){const u=r.getNode(s.id),c=r.getMeta(u);if(vl(c,s))return r.getNode(s.id)}let l=Uc(s,{doc:t,hackCss:o,cache:a});if(!l)return null;if(s.rootId&&r.getNode(s.rootId)!==t&&r.replace(s.rootId,t),s.type===R.Document&&(t.close(),t.open(),s.compatMode==="BackCompat"&&s.childNodes&&s.childNodes[0].type!==R.DocumentType&&(s.childNodes[0].type===R.Element&&"xmlns"in s.childNodes[0].attributes&&s.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=t),r.add(l,s),(s.type===R.Document||s.type===R.Element)&&!i)for(const u of s.childNodes){const c=ht(u,{doc:t,mirror:r,skipChild:!1,hackCss:o,afterAppend:n,cache:a});if(!c){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&Us(l)&&l.shadowRoot)l.shadowRoot.appendChild(c);else if(s.type===R.Document&&u.type==R.Element){const h=c;let f=null;h.childNodes.forEach(m=>{m.nodeName==="BODY"&&(f=m)}),f?(h.removeChild(f),l.appendChild(c),h.appendChild(f)):l.appendChild(c)}else l.appendChild(c);n&&n(c,u.id)}return l}function Wc(s,e){function t(r){e(r)}for(const r of s.getIds())s.has(r)&&t(s.getNode(r))}function zc(s,e){const t=e.getMeta(s);if((t==null?void 0:t.type)!==R.Element)return;const r=s;for(const i in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,i)&&i.startsWith("rr_")))continue;const o=t.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function Vc(s,e){const{doc:t,onVisit:r,hackCss:i=!0,afterAppend:o,cache:n,mirror:a=new Ws}=e,l=ht(s,{doc:t,mirror:a,skipChild:!1,hackCss:i,afterAppend:o,cache:n});return Wc(a,u=>{r&&r(u),zc(u,a)}),l}var Gc=Object.defineProperty,jc=(s,e,t)=>e in s?Gc(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,C=(s,e,t)=>jc(s,typeof e!="symbol"?e+"":e,t),Yc=Object.defineProperty,Hc=(s,e,t)=>e in s?Yc(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,on=(s,e,t)=>Hc(s,typeof e!="symbol"?e+"":e,t);let Zc=class{constructor(){on(this,"idNodeMap",new Map),on(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-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 Xc(){return new Zc}function Jc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Kc(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 ti={exports:{}},G=String,Po=function(){return{isColorSupported:!1,reset:G,bold:G,dim:G,italic:G,underline:G,inverse:G,hidden:G,strikethrough:G,black:G,red:G,green:G,yellow:G,blue:G,magenta:G,cyan:G,white:G,gray:G,bgBlack:G,bgRed:G,bgGreen:G,bgYellow:G,bgBlue:G,bgMagenta:G,bgCyan:G,bgWhite:G}};ti.exports=Po();ti.exports.createColors=Po;var Qc=ti.exports;const qc={},eh=Object.freeze(Object.defineProperty({__proto__:null,default:qc},Symbol.toStringTag,{value:"Module"})),he=Kc(eh);let an=Qc,ln=he,bs=class Lo extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(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,Lo)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=an.isColorSupported),ln&&e&&(t=ln(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=an.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let m=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
+ `+m+a("^")}return" "+l(f)+u}).join(`
+`)}toString(){let e=this.showSourceCode();return e&&(e=`
+
+`+e+`
+`),this.name+": "+this.message+e}};var ri=bs;bs.default=bs;var xt={};xt.isClean=Symbol("isClean");xt.my=Symbol("my");const un={after:`
+`,beforeClose:`
+`,beforeComment:`
+`,beforeDecl:`
+`,beforeOpen:" ",beforeRule:`
+`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function th(s){return s[0].toUpperCase()+s.slice(1)}let Ss=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!="undefined"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+i+o,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,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
+`)){let n=this.raw(e,null,"indent");if(n.length)for(let a=0;a<o;a++)r+=n}return r}block(e,t){let 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;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let o=e.nodes[i],n=this.raw(o,"before");n&&this.builder(n),this.stringify(o,t!==i||r)}}comment(e){let 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!="undefined"))return i;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return un[r];let n=e.root();if(n.rawCache||(n.rawCache={}),typeof n.rawCache[r]!="undefined")return n.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+th(r);this[a]?i=this[a](n,e):n.walk(l=>{if(i=l.raws[t],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=un[r]),n.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after!="undefined")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!="undefined")return r=i.raws.before,r.includes(`
+`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?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!="undefined")return r=i.raws.before,r.includes(`
+`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?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!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before!="undefined")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!="undefined")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!="undefined"))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!="undefined"){let o=r.raws.before.split(`
+`);return t=o[o.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!="undefined"))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)}};var Fo=Ss;Ss.default=Ss;let rh=Fo;function vs(s,e){new rh(e).stringify(s)}var Dr=vs;vs.default=vs;let{isClean:zt,my:sh}=xt,ih=ri,nh=Fo,oh=Dr;function Cs(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],o=typeof i;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(n=>Cs(n,t)):(o==="object"&&i!==null&&(i=Cs(i)),t[r]=i)}return t}let Es=class{constructor(e={}){this.raws={},this[zt]=!1,this[sh]=!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=Cs(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 ih(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[zt]){this[zt]=!1;let e=this;for(;e=e.parent;)e[zt]=!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,o=this.source.start.line;for(let n=0;n<e;n++)r[n]===`
+`?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let 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){let i=this.toString(),o=i.indexOf(e.word);o!==-1&&(t=this.positionInside(o,i),r=this.positionInside(o+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 nh().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(let 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;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let a=this[n];if(Array.isArray(a))r[n]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)r[n]=a.toJSON(null,t);else if(n==="source"){let l=t.get(a.input);l==null&&(l=o,t.set(a.input,o),o++),r[n]={end:a.end,inputId:l,start:a.start}}else r[n]=a}return i&&(r.inputs=[...t.keys()].map(n=>n.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=oh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let o in r)i[o]=r[o];return e.warn(t,i)}get proxyOf(){return this}};var Tr=Es;Es.default=Es;let ah=Tr,Is=class extends ah{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=q(M({},e),{value:String(e.value)})),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var _r=Is;Is.default=Is;let lh="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",uh=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},ch=(s=21)=>{let e="",t=s;for(;t--;)e+=lh[Math.random()*64|0];return e};var hh={nanoid:ch,customAlphabet:uh};let{SourceMapConsumer:cn,SourceMapGenerator:hn}=he,{existsSync:fh,readFileSync:dh}=he,{dirname:Zr,join:ph}=he;function mh(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let xs=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=Zr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new cn(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,/,o=/^data:application\/json,/;if(i.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return mh(e.substr(RegExp.lastMatch.length));let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}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=Zr(e),fh(e))return this.mapFile=e,dh(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 cn)return hn.fromSourceMap(t).toString();if(t instanceof hn)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=ph(Zr(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)}};var Bo=xs;xs.default=xs;let{SourceMapConsumer:gh,SourceMapGenerator:yh}=he,{fileURLToPath:fn,pathToFileURL:Vt}=he,{isAbsolute:Ms,resolve:Rs}=he,{nanoid:wh}=hh,Xr=he,dn=ri,bh=Bo,Jr=Symbol("fromOffsetCache"),Sh=!!(gh&&yh),pn=!!(Rs&&Ms),mr=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||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&&(!pn||/^\w+:\/\//.test(t.from)||Ms(t.from)?this.file=t.from:this.file=Rs(t.from)),pn&&Sh){let r=new bh(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="<input css "+wh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,n,a;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);n=h.line,a=h.col}else n=c.line,a=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let l=this.origin(t,r,n,a);return l?o=new dn(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new dn(e,n===void 0?t:{column:r,line:t},n===void 0?r:{column:a,line:n},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:n,line:t,source:this.css},this.file&&(Vt&&(o.input.url=Vt(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[Jr])r=this[Jr];else{let o=this.css.split(`
+`);r=new Array(o.length);let n=0;for(let a=0,l=o.length;a<l;a++)r[a]=n,n+=o[a].length+1;this[Jr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let o=r.length-2,n;for(;i<o;)if(n=i+(o-i>>1),e<r[n])o=n-1;else if(e>=r[n+1])i=n+1;else{i=n;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 o=this.map.consumer(),n=o.originalPositionFor({column:t,line:e});if(!n.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;Ms(n.source)?l=Vt(n.source):l=new URL(n.source,this.map.consumer().sourceRoot||Vt(this.map.mapFile));let u={column:n.column,endColumn:a&&a.column,endLine:a&&a.line,line:n.line,url:l.toString()};if(l.protocol==="file:")if(fn)u.file=fn(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(n.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=M({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var kr=mr;mr.default=mr;Xr&&Xr.registerInput&&Xr.registerInput(mr);let{SourceMapConsumer:Uo,SourceMapGenerator:ir}=he,{dirname:nr,relative:Wo,resolve:zo,sep:Vo}=he,{pathToFileURL:mn}=he,vh=kr,Ch=!!(Uo&&ir),Eh=!!(nr&&zo&&Wo&&Vo),Ih=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||nr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Uo(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(),Eh&&Ch&&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=ir.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ir({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)):"<no source>"});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 ir({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,n;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(`
+`),t=a.length-n):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.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!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?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?nr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=nr(zo(r,this.mapOpts.annotation)));let i=Wo(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 vh(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)):"<no source>";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(mn){let r=mn(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;Vo==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var Go=Ih;let xh=Tr,Ns=class extends xh{constructor(e){super(e),this.type="comment"}};var $r=Ns;Ns.default=Ns;let{isClean:jo,my:Yo}=xt,Ho=_r,Zo=$r,Mh=Tr,Xo,si,ii,Jo;function Ko(s){return s.map(e=>(e.nodes&&(e.nodes=Ko(e.nodes)),delete e.source,e))}function Qo(s){if(s[jo]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Qo(e)}let Se=class qo extends Mh{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]<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;let 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"?(o,n)=>i(o.toProxy(),n):i)):t==="every"||t==="some"?r=>e[t]((i,...o)=>r(i.toProxy(),...o)):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 n of i)this.proxyOf.nodes.splice(r+1,0,n);let o;for(let n in this.indexes)o=this.indexes[n],r<o&&(this.indexes[n]=o+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let n;for(let a in this.indexes)n=this.indexes[a],r<=n&&(this.indexes[a]=n+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ko(Xo(e).nodes);else if(typeof e=="undefined")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=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ho(e)]}else if(e.selector)e=[new si(e)];else if(e.name)e=[new ii(e)];else if(e.text)e=[new Zo(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Yo]||qo.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[jo]&&Qo(i),typeof i.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(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(o){throw t.addToError(o)}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]}};Se.registerParse=s=>{Xo=s};Se.registerRule=s=>{si=s};Se.registerAtRule=s=>{ii=s};Se.registerRoot=s=>{Jo=s};var Pe=Se;Se.default=Se;Se.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,ii.prototype):s.type==="rule"?Object.setPrototypeOf(s,si.prototype):s.type==="decl"?Object.setPrototypeOf(s,Ho.prototype):s.type==="comment"?Object.setPrototypeOf(s,Zo.prototype):s.type==="root"&&Object.setPrototypeOf(s,Jo.prototype),s[Yo]=!0,s.nodes&&s.nodes.forEach(e=>{Se.rebuild(e)})};let Rh=Pe,ea,ta,wt=class extends Rh{constructor(e){super(M({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new ea(new ta,this,e).stringify()}};wt.registerLazyResult=s=>{ea=s};wt.registerProcessor=s=>{ta=s};var ni=wt;wt.default=wt;let As=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}};var ra=As;As.default=As;let Nh=ra,Os=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 Nh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var oi=Os;Os.default=Os;const Kr=39,gn=34,Gt=92,yn=47,jt=10,ot=32,Yt=12,Ht=9,Zt=13,Ah=91,Oh=93,Dh=40,Th=41,_h=123,kh=125,$h=59,Ph=42,Lh=58,Fh=64,Xt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Jt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Bh=/.[\r\n"'(/\\]/,wn=/[\da-f]/i;var Uh=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,o,n,a,l,u,c,h,f,m,g,p=r.length,d=0,y=[],S=[];function w(){return d}function v(B){throw e.error("Unclosed "+B,d)}function x(){return S.length===0&&d>=p}function N(B){if(S.length)return S.pop();if(d>=p)return;let H=B?B.ignoreUnclosed:!1;switch(o=r.charCodeAt(d),o){case jt:case ot:case Ht:case Zt:case Yt:{n=d;do n+=1,o=r.charCodeAt(n);while(o===ot||o===jt||o===Ht||o===Zt||o===Yt);g=["space",r.slice(d,n)],d=n-1;break}case Ah:case Oh:case _h:case kh:case Lh:case $h:case Th:{let Q=String.fromCharCode(o);g=[Q,Q,d];break}case Dh:{if(f=y.length?y.pop()[1]:"",m=r.charCodeAt(d+1),f==="url"&&m!==Kr&&m!==gn&&m!==ot&&m!==jt&&m!==Ht&&m!==Yt&&m!==Zt){n=d;do{if(c=!1,n=r.indexOf(")",n+1),n===-1)if(i||H){n=d;break}else v("bracket");for(h=n;r.charCodeAt(h-1)===Gt;)h-=1,c=!c}while(c);g=["brackets",r.slice(d,n+1),d,n],d=n}else n=r.indexOf(")",d+1),l=r.slice(d,n+1),n===-1||Bh.test(l)?g=["(","(",d]:(g=["brackets",l,d,n],d=n);break}case Kr:case gn:{a=o===Kr?"'":'"',n=d;do{if(c=!1,n=r.indexOf(a,n+1),n===-1)if(i||H){n=d+1;break}else v("string");for(h=n;r.charCodeAt(h-1)===Gt;)h-=1,c=!c}while(c);g=["string",r.slice(d,n+1),d,n],d=n;break}case Fh:{Xt.lastIndex=d+1,Xt.test(r),Xt.lastIndex===0?n=r.length-1:n=Xt.lastIndex-2,g=["at-word",r.slice(d,n+1),d,n],d=n;break}case Gt:{for(n=d,u=!0;r.charCodeAt(n+1)===Gt;)n+=1,u=!u;if(o=r.charCodeAt(n+1),u&&o!==yn&&o!==ot&&o!==jt&&o!==Ht&&o!==Zt&&o!==Yt&&(n+=1,wn.test(r.charAt(n)))){for(;wn.test(r.charAt(n+1));)n+=1;r.charCodeAt(n+1)===ot&&(n+=1)}g=["word",r.slice(d,n+1),d,n],d=n;break}default:{o===yn&&r.charCodeAt(d+1)===Ph?(n=r.indexOf("*/",d+2)+1,n===0&&(i||H?n=r.length:v("comment")),g=["comment",r.slice(d,n+1),d,n],d=n):(Jt.lastIndex=d+1,Jt.test(r),Jt.lastIndex===0?n=r.length-1:n=Jt.lastIndex-2,g=["word",r.slice(d,n+1),d,n],y.push(g),d=n);break}}return d++,g}function z(B){S.push(B)}return{back:z,endOfFile:x,nextToken:N,position:w}};let sa=Pe,gr=class extends sa{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)}};var ai=gr;gr.default=gr;sa.registerAtRule(gr);let ia=Pe,na,oa,Qe=class extends ia{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 o of i)o.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 na(new oa,this,e).stringify()}};Qe.registerLazyResult=s=>{na=s};Qe.registerProcessor=s=>{oa=s};var Mt=Qe;Qe.default=Qe;ia.registerRoot(Qe);let bt={comma(s){return bt.split(s,[","],!0)},space(s){let e=[" ",`
+`,"	"];return bt.split(s,e)},split(s,e,t){let r=[],i="",o=!1,n=0,a=!1,l="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?n+=1:c===")"?n>0&&(n-=1):n===0&&e.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var aa=bt;bt.default=bt;let la=Pe,Wh=aa,yr=class extends la{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Wh.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)}};var li=yr;yr.default=yr;la.registerRule(yr);let zh=_r,Vh=Uh,Gh=$r,jh=ai,Yh=Mt,bn=li;const Sn={empty:!0,space:!0};function Hh(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Zh=class{constructor(e){this.input=e,this.root=new Yh,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 jh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,o,n=!1,a=!1,l=[],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==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,i=l[o];i&&i[0]==="space";)i=l[--o];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),n&&(e=l[l.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=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let o=t-1;o>=0&&(i=e[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,o;for(let[n,a]of e.entries()){if(r=a,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return n}o=r}return!1}comment(e){let t=new Gh;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=Vh(this.input)}decl(e,t){let r=new zh;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]||Hh(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 o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let n=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)n.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[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(o[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let f=u;f>0;f--){let m=c[f][0];if(h.trim().indexOf("!")===0&&m!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=n.map(u=>u[1]).join(""),n=[]),this.raw(r,"value",n.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 bn;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,o=null,n=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),n.push(r==="("?")":"]");else if(a&&i&&r==="{")o||(o=u),n.push("}");else if(n.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(i=!0);else r===n[n.length-1]&&(n.pop(),n.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(o),t&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}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 o,n,a=r.length,l="",u=!0,c,h;for(let f=0;f<a;f+=1)o=r[f],n=o[0],n==="space"&&f===a-1&&!i?u=!1:n==="comment"?(h=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Sn[h]&&!Sn[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let f=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:f,value:l}}e[t]=l}rule(e){e.pop();let t=new bn;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;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let 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})}};var Xh=Zh;let Jh=Pe,Kh=Xh,Qh=kr;function wr(s,e){let t=new Qh(s,e),r=new Kh(t);try{r.parse()}catch(i){throw i}return r.root}var ui=wr;wr.default=wr;Jh.registerParse(wr);let{isClean:me,my:qh}=xt,ef=Go,tf=Dr,rf=Pe,sf=ni;let vn=oi,nf=ui,of=Mt;const af={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lf={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},uf={Once:!0,postcssPlugin:!0,prepare:!0},qe=0;function at(s){return typeof s=="object"&&typeof s.then=="function"}function ua(s){let e=!1,t=af[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,qe,t+"Exit"]:[t,t+"Exit"]}function Cn(s){let e;return s.type==="document"?e=["Document",qe,"DocumentExit"]:s.type==="root"?e=["Root",qe,"RootExit"]:e=ua(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Ds(s){return s[me]=!1,s.nodes&&s.nodes.forEach(e=>Ds(e)),s}let Ts={},et=class ca{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=Ds(t);else if(t instanceof ca||t instanceof vn)i=Ds(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=nf;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(t,r)}catch(n){this.processed=!0,this.error=n}i&&!i[qh]&&rf.rebuild(i)}this.result=new vn(e,i,r),this.helpers=q(M({},Ts),{postcss:Ts,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?M(M({},o),o.prepare(this.result)):o)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}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(!lf[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uf[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;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(at(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[me];){e[me]=!0;let t=[Cn(e)];for(;t.length>0;){let r=this.visitTick(t);if(at(r))try{await r}catch(i){let o=t[t.length-1].node;throw this.handleError(i,o)}}}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(o=>r(o,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 at(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=tf;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new ef(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(at(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[me];)e[me]=!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 this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(at(o))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.length){let[n,a]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let n=t.iterator,a;for(;a=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!a[me]){a[me]=!0,e.push(Cn(a));return}t.iterator=0,delete r.indexes[n]}let o=t.events;for(;t.eventIndex<o.length;){let n=o[t.eventIndex];if(t.eventIndex+=1,n===qe){r.nodes&&r.nodes.length&&(r[me]=!0,t.iterator=r.getIterator());return}else if(this.listeners[n]){t.visitors=this.listeners[n];return}}e.pop()}walkSync(e){e[me]=!0;let t=ua(e);for(let r of t)if(r===qe)e.nodes&&e.each(i=>{i[me]||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"}};et.registerPostcss=s=>{Ts=s};var ha=et;et.default=et;of.registerLazyResult(et);sf.registerLazyResult(et);let cf=Go,hf=Dr;let ff=ui;const df=oi;let _s=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,o=hf;this.result=new df(this._processor,i,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let a=new cf(o,i,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.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 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=ff;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"}};var pf=_s;_s.default=_s;let mf=pf,gf=ha,yf=ni,wf=Mt,St=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)))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 mf(this,e,t):new gf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var bf=St;St.default=St;wf.registerProcessor(St);yf.registerProcessor(St);let Sf=_r,vf=Bo,Cf=$r,Ef=ai,If=kr,xf=Mt,Mf=li;function vt(s,e){if(Array.isArray(s))return s.map(n=>vt(n));let i=s,{inputs:t}=i,r=Fe(i,["inputs"]);if(t){e=[];for(let n of t){let a=q(M({},n),{__proto__:If.prototype});a.map&&(a.map=q(M({},a.map),{__proto__:vf.prototype})),e.push(a)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>vt(n,e))),r.source){let o=r.source,{inputId:n}=o,a=Fe(o,["inputId"]);r.source=a,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new xf(r);if(r.type==="decl")return new Sf(r);if(r.type==="rule")return new Mf(r);if(r.type==="comment")return new Cf(r);if(r.type==="atrule")return new Ef(r);throw new Error("Unknown node type: "+s.type)}var Rf=vt;vt.default=vt;let Nf=ri,fa=_r,Af=ha,Of=Pe,ci=bf,Df=Dr,Tf=Rf,da=ni,_f=ra,pa=$r,ma=ai,kf=oi,$f=kr,Pf=ui,Lf=aa,ga=li,ya=Mt,Ff=Tr;function F(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new ci(s)}F.plugin=function(e,t){let r=!1;function i(...n){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 a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new ci().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return F([i(l)]).process(n,a)},i};F.stringify=Df;F.parse=Pf;F.fromJSON=Tf;F.list=Lf;F.comment=s=>new pa(s);F.atRule=s=>new ma(s);F.decl=s=>new fa(s);F.rule=s=>new ga(s);F.root=s=>new ya(s);F.document=s=>new da(s);F.CssSyntaxError=Nf;F.Declaration=fa;F.Container=Of;F.Processor=ci;F.Document=da;F.Comment=pa;F.Warning=_f;F.AtRule=ma;F.Result=kf;F.Input=$f;F.Rule=ga;F.Root=ya;F.Node=Ff;Af.registerPostcss(F);var Bf=F;F.default=F;const Y=Jc(Bf);Y.stringify;Y.fromJSON;Y.plugin;Y.parse;Y.list;Y.document;Y.comment;Y.atRule;Y.rule;Y.decl;Y.root;Y.CssSyntaxError;Y.Declaration;Y.Container;Y.Processor;Y.Document;Y.Comment;Y.Warning;Y.AtRule;Y.Result;Y.Input;Y.Rule;Y.Root;Y.Node;var D=(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))(D||{});function Uf(s){const e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(o){if(o){const n=o.split(r);n.length>1&&(e[ks(n[0].trim())]=n[1].trim())}}),e}function En(s){const e=[];for(const t in s){const r=s[t];if(typeof r!="string")continue;const i=Gf(t);e.push(`${i}: ${r};`)}return e.join(" ")}const Wf=/-([a-z])/g,zf=/^--[a-zA-Z0-9-]+$/,ks=s=>zf.test(s)?s:s.replace(Wf,(e,t)=>t?t.toUpperCase():""),Vf=/\B([A-Z])/g,Gf=s=>s.replace(Vf,"-$1").toLowerCase();class fe{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof fe){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"}}class hi extends fe{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",D.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===D.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===D.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===D.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===D.Element||t===D.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=fi(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===D.Element||r===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Ca(this,e,t);return i.parentElement=null,i}removeChild(e){return Ea(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new hi}createDocumentType(e,t,r){const i=new wa(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=new Pr(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new ba(e);return t.ownerDocument=this,t}createComment(e){const t=new Sa(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new va(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class wa extends fe{constructor(e,t,r){super(),C(this,"nodeType",10),C(this,"RRNodeType",D.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Pr extends fe{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",D.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Hf(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Uf(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(t.test(r))return;const n=ks(r);i?e[n]=i:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=En(e)},e.removeProperty=r=>{if(t.test(r))return"";const i=ks(r),o=e[i]||"";return delete e[i],this.attributes.style=En(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return fi(this,e)}insertBefore(e,t){return Ca(this,e,t)}removeChild(e){return Ea(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class jf extends Pr{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class Yf extends Pr{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class ba extends fe{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",D.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class Sa extends fe{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",D.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class va extends fe{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",D.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Hf{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}}function fi(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function Ca(s,e,t){if(!t)return fi(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function Ea(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var oe=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(oe||{});const $s={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Zf={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let ge=null;function br(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=Xf(s,e,t,r),Ia(s,e,t,r),Jf(s,e,t)}function Xf(s,e,t,r){var i;if(t.afterAppend&&!ge&&(ge=new WeakSet,setTimeout(()=>{ge=null},0)),!di(s,e)){const o=Sr(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(o,s),s=o}switch(e.RRNodeType){case D.Document:{if(!Ue(s,e,t.mirror,r)){const o=r.getMeta(e);o&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,o),ge==null||ge.add(s))}break}case D.Element:{const o=s,n=e;switch(n.tagName){case"IFRAME":{const a=s.contentDocument;if(!a)break;br(a,e.contentDocument,t,r);break}}n.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Ia(o.shadowRoot,n.shadowRoot,t,r)),Kf(o,n,r);break}}return s}function Jf(s,e,t){var r;switch(e.RRNodeType){case D.Document:{const i=e.scrollData;i&&t.applyScroll(i,!0);break}case D.Element:{const i=s,o=e;switch(o.scrollData&&t.applyScroll(o.scrollData,!0),o.inputData&&t.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const n=s,a=o;a.paused!==void 0&&(a.paused?n.pause():n.play()),a.muted!==void 0&&(n.muted=a.muted),a.volume!==void 0&&(n.volume=a.volume),a.currentTime!==void 0&&(n.currentTime=a.currentTime),a.playbackRate!==void 0&&(n.playbackRate=a.playbackRate),a.loop!==void 0&&(n.loop=a.loop);break}case"CANVAS":{const n=e;if(n.rr_dataURL!==null){const a=document.createElement("img");a.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=n.rr_dataURL}n.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,s));break}case"STYLE":{const n=i.sheet;n&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,n));break}case"DIALOG":{const n=i,a=o,l=n.open,u=n.matches("dialog:modal"),c=a.open,h=a.isModal,f=u!==h,m=l!==c;if((f||l&&m)&&n.close(),c&&(m||f))try{h?n.showModal():n.show()}catch(g){console.warn(g)}break}}break}case D.Text:case D.Comment:case D.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}ge!=null&&ge.has(s)&&(ge.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function Kf(s,e,t){const r=s.attributes,i=e.attributes;for(const o in i){const n=i[o],a=t.getMeta(e);if(a!=null&&a.isSVG&&$s[o])s.setAttributeNS($s[o],o,n);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=n,l.onload=()=>{const u=s.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;try{s.setAttribute(o,n)}catch(l){console.warn(l)}}}for(const{name:o}of Array.from(r))o in i||s.removeAttribute(o);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function Ia(s,e,t,r){const i=Array.from(s.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let n=0,a=i.length-1,l=0,u=o.length-1,c=i[n],h=i[a],f=o[l],m=o[u],g,p;for(;n<=a&&l<=u;)if(c===void 0)c=i[++n];else if(h===void 0)h=i[--a];else if(Ue(c,f,t.mirror,r))c=i[++n],f=o[++l];else if(Ue(h,m,t.mirror,r))h=i[--a],m=o[--u];else if(Ue(c,m,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(S){console.warn(S)}c=i[++n],m=o[--u]}else if(Ue(h,f,t.mirror,r)){try{s.insertBefore(h,c)}catch(S){console.warn(S)}h=i[--a],f=o[++l]}else{if(!g){g={};for(let w=n;w<=a;w++){const v=i[w];v&&t.mirror.hasNode(v)&&(g[t.mirror.getId(v)]=w)}}p=g[r.getId(f)];const S=i[p];if(p!==void 0&&S&&Ue(S,f,t.mirror,r)){try{s.insertBefore(S,c)}catch(w){console.warn(w)}i[p]=void 0}else{const w=Sr(f,t.mirror,r);s.nodeName==="#document"&&c&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++n]);try{s.insertBefore(w,c||null)}catch(v){console.warn(v)}}f=o[++l]}if(n>a){const S=o[u+1];let w=null;for(S&&(w=t.mirror.getNode(r.getId(S)));l<=u;++l){const v=Sr(o[l],t.mirror,r);try{s.insertBefore(v,w)}catch(x){console.warn(x)}}}else if(l>u)for(;n<=a;n++){const S=i[n];if(!(!S||S.parentNode!==s))try{s.removeChild(S),t.mirror.removeNodeFromMap(S)}catch(w){console.warn(w)}}let d=s.firstChild,y=e.firstChild;for(;d!==null&&y!==null;)br(d,y,t,r),d=d.nextSibling,y=y.nextSibling}function Sr(s,e,t){const r=t.getId(s),i=t.getMeta(s);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&di(o,s))return o;switch(s.RRNodeType){case D.Document:o=new Document;break;case D.DocumentType:o=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case D.Element:{let n=s.tagName.toLowerCase();n=Zf[n]||n,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS($s.svg,n):o=document.createElement(s.tagName);break}case D.Text:o=document.createTextNode(s.data);break;case D.Comment:o=document.createComment(s.data);break;case D.CDATA:o=document.createCDATASection(s.data);break}i&&e.add(o,M({},i));try{ge==null||ge.add(o)}catch(n){}return o}function di(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ue(s,e,t,r){const i=t.getId(s),o=r.getId(e);return i===-1||i!==o?!1:di(s,e)}class rt extends hi{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",ud()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new rt}createDocumentType(e,t,r){const i=new Qf(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new qf(t);break;case"IFRAME":r=new sd(t,this.mirror);break;case"CANVAS":r=new td(t);break;case"STYLE":r=new rd(t);break;case"DIALOG":r=new ed(t);break;default:r=new Lr(t);break}return r.ownerDocument=this,r}createComment(e){const t=new nd(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new od(e);return t.ownerDocument=this,t}createTextNode(e){const t=new id(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Qf=wa;class Lr extends Pr{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}}class qf extends jf{}class ed extends Yf{}class td extends Lr{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}}class rd extends Lr{constructor(){super(...arguments),C(this,"rules",[])}}class sd extends Lr{constructor(e,t){super(e),C(this,"contentDocument",new rt),this.contentDocument.mirror=t}}const id=ba,nd=Sa,od=va;function ad(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function xa(s,e,t,r){let i;switch(s.nodeType){case oe.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case oe.DOCUMENT_TYPE_NODE:{const n=s;i=e.createDocumentType(n.name,n.publicId,n.systemId);break}case oe.ELEMENT_NODE:{const n=s,a=ad(n);i=e.createElement(a);const l=i;for(const{name:u,value:c}of Array.from(n.attributes))l.attributes[u]=c;n.scrollLeft&&(l.scrollLeft=n.scrollLeft),n.scrollTop&&(l.scrollTop=n.scrollTop);break}case oe.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case oe.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case oe.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case oe.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(s);return e instanceof rt&&(o||(o=Ma(i,e.unserializedId),t.add(s,o)),e.mirror.add(i,M({},o))),i}function ld(s,e=Xc(),t=new rt){function r(i,o){const n=xa(i,t,e,o);if(n!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==oe.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(n),n.parentNode=o,n.parentElement=o),i.nodeName==="IFRAME"){const a=i.contentDocument;a&&r(a,n)}else(i.nodeType===oe.DOCUMENT_NODE||i.nodeType===oe.ELEMENT_NODE||i.nodeType===oe.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===oe.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,n),i.childNodes.forEach(a=>r(a,n)))}return r(s,null),t}function ud(){return new cd}class cd{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-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 Ma(s,e){switch(s.RRNodeType){case D.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case D.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case D.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case D.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case D.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const In={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},xn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Kt={},hd=()=>!!globalThis.Zone;function pi(s){if(Kt[s])return Kt[s];const e=globalThis[s],t=e.prototype,r=s in In?In[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=s in xn?xn[s]:void 0,n=!!(o&&o.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&n&&!hd())return Kt[s]=e.prototype,e.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return e.prototype;const u=l[s].prototype;return document.body.removeChild(a),u?Kt[s]=u:t}catch(a){return t}}const Qr={};function Ne(s,e,t){var r;const i=`${s}.${String(t)}`;if(Qr[i])return Qr[i].call(e);const o=pi(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(Qr[i]=n,n.call(e)):e[t]}const qr={};function Ra(s,e,t){const r=`${s}.${String(t)}`;if(qr[r])return qr[r].bind(e);const o=pi(s)[t];return typeof o!="function"?e[t]:(qr[r]=o,o.bind(e))}function fd(s){return Ne("Node",s,"childNodes")}function dd(s){return Ne("Node",s,"parentNode")}function pd(s){return Ne("Node",s,"parentElement")}function md(s){return Ne("Node",s,"textContent")}function gd(s,e){return Ra("Node",s,"contains")(e)}function yd(s){return Ra("Node",s,"getRootNode")()}function wd(s){return!s||!("host"in s)?null:Ne("ShadowRoot",s,"host")}function bd(s){return s.styleSheets}function Sd(s){return!s||!("shadowRoot"in s)?null:Ne("Element",s,"shadowRoot")}function vd(s,e){return Ne("Element",s,"querySelector")(e)}function Cd(s,e){return Ne("Element",s,"querySelectorAll")(e)}function Na(){return pi("MutationObserver").constructor}const A={childNodes:fd,parentNode:dd,parentElement:pd,textContent:md,contains:gd,getRootNode:yd,host:wd,styleSheets:bd,shadowRoot:Sd,querySelector:vd,querySelectorAll:Cd,mutationObserver:Na};function te(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const We=`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.`;exports.mirror={map:{},getId(){return console.error(We),-1},getNode(){return console.error(We),null},removeNodeFromMap(){console.error(We)},has(){return console.error(We),!1},reset(){console.error(We)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(We),Reflect.get(s,e,t)}}));function tt(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const a=e-(n-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(l,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,o)},a))}}function Rt(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>Rt(s,e,o||{},!0)}function Le(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(r){return()=>{}}}let Ct=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ct=()=>new Date().getTime());function mi(s){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=A.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=A.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function gi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wi(s){return s?s.nodeType===s.ELEMENT_NODE?s:A.parentElement(s):null}function re(s,e,t,r){if(!s)return!1;const i=wi(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(cr(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Aa(s,e){return e.getId(s)!==-1}function or(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===dt}function bi(s,e){if(ut(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=A.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?bi(r,e):!0}function vr(s){return!!s.changedTouches}function Si(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 Oa(s){const e={},t=(i,o)=>{const n={value:i,parent:o,children:[]};return e[i.node.id]=n,n},r=[];for(const i of s){const{nextId:o,parentId:n}=i;if(o&&o in e){const a=e[o];if(a.parent){const l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{const l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(n in e){const a=e[n];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function vi(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)vi(s.children[t],e)}function Ze(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Ci(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ei(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),n=Ei(i,e),a=o.height/i.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function Ie(s){return s?s instanceof fe&&"shadowRoot"in s?!!s.shadowRoot:!!A.shadowRoot(s):!1}function je(s,e){const t=s[e[0]];return e.length===1?t:je(t.cssRules[e[1]].cssRules,e.slice(2))}function Ps(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Da(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class Ii{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-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 xi(s){var e;let t=null;return"getRootNode"in s&&((e=A.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&A.host(A.getRootNode(s))&&(t=A.host(A.getRootNode(s))),t}function Ta(s){let e=s,t;for(;t=xi(e);)e=t;return e}function _a(s){const e=s.ownerDocument;if(!e)return!1;const t=Ta(s);return A.contains(e,t)}function Mi(s){const e=s.ownerDocument;return e?A.contains(e,s)||_a(s):!1}const Ed=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Ii,get _mirror(){return exports.mirror},closestElementOfNode:wi,getBaseDimension:Ei,getNestedRule:je,getPositionsAndIndex:Ps,getRootShadowHost:Ta,getShadowHost:xi,getWindowHeight:gi,getWindowScroll:mi,getWindowWidth:yi,hasShadowRoot:Ie,hookSetter:Rt,inDom:Mi,isAncestorRemoved:bi,isBlocked:re,isIgnored:or,isSerialized:Aa,isSerializedIframe:Ze,isSerializedStylesheet:Ci,iterateResolveTree:vi,legacy_isTouchEvent:vr,get nowTimestamp(){return Ct},on:te,patch:Le,polyfill:Si,queueToResolveTrees:Oa,shadowHostInDom:_a,throttle:tt,uniqueTextMutations:Da},Symbol.toStringTag,{value:"Module"}));var I=(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))(I||{}),E=(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))(E||{}),k=(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))(k||{}),ye=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ye||{}),ve=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(ve||{}),Ee=(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))(Ee||{}),_=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(_||{}),we=(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))(we||{});function Mn(s){return"__ln"in s}class Id{constructor(){b(this,"length",0),b(this,"head",null),b(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==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Mn(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&&Mn(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--)}}const Rn=(s,e)=>`${s}@${e}`;class xd{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Id,i=l=>{let u=l,c=dt;for(;c===dt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=A.parentNode(l);if(!u||!Mi(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=ut(u)?this.mirror.getId(xi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const m=Ge(l,{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:g=>{Ze(g,this.mirror)&&this.iframeManager.addIframe(g),Ci(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Ie(l)&&this.shadowDomManager.addShadowRoot(A.shadowRoot(l),this.doc)},onIframeLoad:(g,p)=>{this.iframeManager.attachIframe(g,p),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,p)=>{this.stylesheetManager.attachLinkElement(g,p)},cssCaptured:c});m&&(e.push({parentId:h,nextId:f,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Nn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(A.parentNode(l))||o(l);for(const l of this.addedSet)!An(this.droppedSet,l)&&!Nn(this.removesSubTreeCache,l,this.mirror)||An(this.movedSet,l)?o(l):this.droppedSet.add(l);let n=null;for(;r.length;){let l=null;if(n){const u=this.mirror.getId(A.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(l=n)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(A.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const m=c.value,g=A.parentNode(m);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=A.host(g);if(this.mirror.getId(p)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}n=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const u=l.node,c=A.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))}),b(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)),t.attributes.value=Array.from(A.childNodes(e),r=>A.textContent(r)||"").join("")}),b(this,"processMutation",e=>{if(!or(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=A.textContent(e.target);!re(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Qn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const n=Vs(t);i=zs({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:n,value:i,maskInputFn:this.maskInputFn})}if(re(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Kn(t.tagName,r))if(o.attributes[r]=Jn(this.doc,Me(t.tagName),Me(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const a of Array.from(t.style)){const l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==n.style.getPropertyValue(a)||u!==n.style.getPropertyPriority(a)?u===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,u]:o._unchangedStyles[a]=[l,u]}for(const a of Array.from(n.style))t.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(re(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=ut(e.target)?this.mirror.getId(A.host(e.target)):this.mirror.getId(e.target);re(e.target,this.blockClass,this.blockSelector,!1)||or(t,this.mirror,this.slimDOMOptions)||!Aa(t,this.mirror)||(this.addedSet.has(t)?(Ls(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||bi(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Rn(r,i)]?Ls(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:ut(e.target)&&ct(e.target)?!0:void 0}),Md(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),b(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[Rn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);re(e,this.blockClass,this.blockSelector,!1)||(A.childNodes(e).forEach(r=>this.genAdds(r)),Ie(e)&&A.childNodes(A.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 Ls(s,e){s.delete(e),A.childNodes(e).forEach(t=>Ls(s,t))}function Md(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),A.childNodes(r).forEach(i=>t.push(i)))}}function Nn(s,e,t){return s.size===0?!1:Rd(s,e)}function Rd(s,e,t){const r=A.parentNode(e);return r?s.has(r):!1}function An(s,e){return s.size===0?!1:ka(s,e)}function ka(s,e){const t=A.parentNode(e);return t?s.has(t)?!0:ka(s,t):!1}let ft;function Nd(s){ft=s}function Ad(){ft=void 0}const T=s=>ft?(...t)=>{try{return s(...t)}catch(r){if(ft&&ft(r)===!0)return;throw r}}:s,ke=[];function Nt(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(e){}return s&&s.target}function $a(s,e){const t=new xd;ke.push(t),t.init(s);const r=new(Na())(T(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Od({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],a;const l=tt(T(h=>{const f=Date.now()-a;s(n.map(m=>(m.timeOffset-=f,m)),h),n=[],a=null}),o),u=T(tt(T(h=>{const f=Nt(h),{clientX:m,clientY:g}=vr(h)?h.changedTouches[0]:h;a||(a=Ct()),n.push({x:m,y:g,id:r.getId(f),timeOffset:Ct()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[te("mousemove",u,t),te("touchmove",u,t),te("drag",u,t)];return T(()=>{c.forEach(h=>h())})}function Dd({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=c=>h=>{const f=Nt(h);if(re(f,r,i,!0))return;let m=null,g=c;if("pointerType"in h){switch(h.pointerType){case"mouse":m=ye.Mouse;break;case"touch":m=ye.Touch;break;case"pen":m=ye.Pen;break}m===ye.Touch?k[c]===k.MouseDown?g="TouchStart":k[c]===k.MouseUp&&(g="TouchEnd"):ye.Pen}else vr(h)&&(m=ye.Touch);m!==null?(l=m,(g.startsWith("Touch")&&m===ye.Touch||g.startsWith("Mouse")&&m===ye.Mouse)&&(m=null)):k[c]===k.Click&&(m=l,l=null);const p=vr(h)?h.changedTouches[0]:h;if(!p)return;const d=t.getId(f),{clientX:y,clientY:S}=p;T(s)(M({type:k[g],id:d,x:y,y:S},m!==null&&{pointerType:m}))};return Object.keys(k).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let h=Me(c);const f=u(c);if(window.PointerEvent)switch(k[c]){case k.MouseDown:case k.MouseUp:h=h.replace("mouse","pointer");break;case k.TouchStart:case k.TouchEnd:return}a.push(te(h,f,e))}),T(()=>{a.forEach(c=>c())})}function Pa({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=T(tt(T(a=>{const l=Nt(a);if(!l||re(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=mi(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return te("scroll",n,e)}function Td({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=T(tt(T(()=>{const o=gi(),n=yi();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return te("resize",i,e)}const _d=["INPUT","TEXTAREA","SELECT"],On=new WeakMap;function kd({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(S){let w=Nt(S);const v=S.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=A.parentElement(w)),!w||!x||_d.indexOf(x)<0||re(w,r,i,!0)||w.classList.contains(o)||n&&w.matches(n))return;let N=w.value,z=!1;const B=Vs(w)||"";B==="radio"||B==="checkbox"?z=w.checked:(a[x.toLowerCase()]||a[B])&&(N=zs({element:w,maskInputOptions:a,tagName:x,type:B,value:N,maskInputFn:l})),f(w,c?{text:N,isChecked:z,userTriggered:v}:{text:N,isChecked:z});const H=w.name;B==="radio"&&H&&z&&e.querySelectorAll(`input[type="radio"][name="${H}"]`).forEach(Q=>{if(Q!==w){const se=Q.value;f(Q,c?{text:se,isChecked:!z,userTriggered:!1}:{text:se,isChecked:!z})}})}function f(S,w){const v=On.get(S);if(!v||v.text!==w.text||v.isChecked!==w.isChecked){On.set(S,w);const x=t.getId(S);T(s)(q(M({},w),{id:x}))}}const g=(u.input==="last"?["change"]:["input","change"]).map(S=>te(S,T(h),e)),p=e.defaultView;if(!p)return()=>{g.forEach(S=>S())};const d=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),y=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&g.push(...y.map(S=>Rt(S[0],S[1],{set(){T(h)({target:this,isTrusted:!1})}},!1,p))),T(()=>{g.forEach(S=>S())})}function Cr(s){const e=[];function t(r,i){if(Qt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Qt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Qt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Qt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function Ce(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function $d({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:T((c,h,f)=>{const[m,g]=f,{id:p,styleId:d}=Ce(h,e,t.styleMirror);return(p&&p!==-1||d&&d!==-1)&&s({id:p,styleId:d,adds:[{rule:m,index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){const m=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,f])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:T((c,h,f)=>{const[m]=f,{id:g,styleId:p}=Ce(h,e,t.styleMirror);return(g&&g!==-1||p&&p!==-1)&&s({id:g,styleId:p,removes:[{index:m}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:T((c,h,f)=>{const[m]=f,{id:g,styleId:p}=Ce(h,e,t.styleMirror);return(g&&g!==-1||p&&p!==-1)&&s({id:g,styleId:p,replace:m}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:T((c,h,f)=>{const[m]=f,{id:g,styleId:p}=Ce(h,e,t.styleMirror);return(g&&g!==-1||p&&p!==-1)&&s({id:g,styleId:p,replaceSync:m}),c.apply(h,f)})}));const l={};qt("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(qt("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),qt("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),qt("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:T((f,m,g)=>{const[p,d]=g,{id:y,styleId:S}=Ce(m.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||S&&S!==-1)&&s({id:y,styleId:S,adds:[{rule:p,index:[...Cr(m),d||0]}]}),f.apply(m,g)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:T((f,m,g)=>{const[p]=g,{id:d,styleId:y}=Ce(m.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...Cr(m),p]}]}),f.apply(m,g)})})}),T(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function La({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(A.host(t));const a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=l.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(f){}return h}}),T(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Pd({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:T((a,l,u)=>{var c;const[h,f,m]=u;if(t.has(h))return o.apply(l,[h,f,m]);const{id:g,styleId:p}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||p&&p!==-1)&&s({id:g,styleId:p,set:{property:h,value:f,priority:m},index:Cr(l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:T((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:m}=Ce((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&s({id:f,styleId:m,remove:{property:h},index:Cr(l.parentRule)}),a.apply(l,u)})}),T(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function Ld({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=T(l=>tt(T(u=>{const c=Nt(u);if(!c||re(c,e,t,!0))return;const{currentTime:h,volume:f,muted:m,playbackRate:g,loop:p}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:m,playbackRate:g,loop:p})}),i.media||500)),a=[te("play",n(Ee.Play),o),te("pause",n(Ee.Pause),o),te("seeked",n(Ee.Seeked),o),te("volumechange",n(Ee.VolumeChange),o),te("ratechange",n(Ee.RateChange),o)];return T(()=>{a.forEach(l=>l())})}function Fd({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(l,u,c){const h=new o(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const n=Le(e.fonts,"add",function(a){return function(l){return setTimeout(T(()=>{const u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=o}),r.push(n),T(()=>{r.forEach(a=>a())})}function Bd(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=T(()=>{const l=e.getSelection();if(!l||n&&(l!=null&&l.isCollapsed))return;n=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){const f=l.getRangeAt(h),{startContainer:m,startOffset:g,endContainer:p,endOffset:d}=f;re(m,r,i,!0)||re(p,r,i,!0)||u.push({start:t.getId(m),startOffset:g,end:t.getId(p),endOffset:d})}o({ranges:u})});return a(),te("selectionchange",a)}function Ud({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Le(t.customElements,"define",function(i){return function(o,n,a){try{e({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,a])}})}function Wd(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:m,customElementCb:g}=s;s.mutationCb=(...p)=>{e.mutation&&e.mutation(...p),t(...p)},s.mousemoveCb=(...p)=>{e.mousemove&&e.mousemove(...p),r(...p)},s.mouseInteractionCb=(...p)=>{e.mouseInteraction&&e.mouseInteraction(...p),i(...p)},s.scrollCb=(...p)=>{e.scroll&&e.scroll(...p),o(...p)},s.viewportResizeCb=(...p)=>{e.viewportResize&&e.viewportResize(...p),n(...p)},s.inputCb=(...p)=>{e.input&&e.input(...p),a(...p)},s.mediaInteractionCb=(...p)=>{e.mediaInteaction&&e.mediaInteaction(...p),l(...p)},s.styleSheetRuleCb=(...p)=>{e.styleSheetRule&&e.styleSheetRule(...p),u(...p)},s.styleDeclarationCb=(...p)=>{e.styleDeclaration&&e.styleDeclaration(...p),c(...p)},s.canvasMutationCb=(...p)=>{e.canvasMutation&&e.canvasMutation(...p),h(...p)},s.fontCb=(...p)=>{e.font&&e.font(...p),f(...p)},s.selectionCb=(...p)=>{e.selection&&e.selection(...p),m(...p)},s.customElementCb=(...p)=>{e.customElement&&e.customElement(...p),g(...p)}}function zd(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Wd(s,e);let r;s.recordDOM&&(r=$a(s,s.doc));const i=Od(s),o=Dd(s),n=Pa(s),a=Td(s,{win:t}),l=kd(s),u=Ld(s);let c=()=>{},h=()=>{},f=()=>{},m=()=>{};s.recordDOM&&(c=$d(s,{win:t}),h=La(s,s.doc),f=Pd(s,{win:t}),s.collectFonts&&(m=Fd(s)));const g=Bd(s),p=Ud(s),d=[];for(const y of s.plugins)d.push(y.observer(y.callback,t,y.options));return T(()=>{ke.forEach(y=>y.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),m(),g(),p(),d.forEach(y=>y())})}function Qt(s){return typeof window[s]!="undefined"}function qt(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Dn{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),n.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-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}}class Vd{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Dn(Xn)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dn(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 o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.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:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),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 E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.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 o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));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!==we.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Gd{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(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(!ct(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=$a(q(M({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Pa(q(M({},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(A.host(e))),this.restoreHandlers.push(La({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(Le(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=A.shadowRoot(this);return a&&Mi(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var er=0;er<Ye.length;er++)lt[Ye.charCodeAt(er)]=er;var jd=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ye[e[t]>>2],i+=Ye[(e[t]&3)<<4|e[t+1]>>4],i+=Ye[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ye[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},Yd=function(s){var e=s.length*.75,t=s.length,r,i=0,o,n,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)o=lt[s.charCodeAt(r)],n=lt[s.charCodeAt(r+1)],a=lt[s.charCodeAt(r+2)],l=lt[s.charCodeAt(r+3)],c[i++]=o<<2|n>>4,c[i++]=(n&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u};const Tn=new Map;function Hd(s,e){let t=Tn.get(s);return t||(t=new Map,Tn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const Fa=(s,e,t)=>{if(!s||!(Ua(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Hd(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function ar(s,e,t){if(s instanceof Array)return s.map(r=>ar(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=jd(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[ar(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}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[ar(s.data,e,t),s.width,s.height]};if(Ua(s,e)||typeof s=="object"){const r=s.constructor.name,i=Fa(s,e,t);return{rr_type:r,index:i}}}}return s}const Ba=(s,e,t)=>s.map(r=>ar(r,e,t)),Ua=(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 Zd(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const a=Le(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return re(this.canvas,t,r,!0)||setTimeout(()=>{const c=Ba(u,e,this);s(this.canvas,{type:ve["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=Rt(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:ve["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function Xd(s){return s==="experimental-webgl"?"webgl":s}function _n(s,e,t,r){const i=[];try{const o=Le(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!re(this,e,t,!0)){const u=Xd(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[a,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function kn(s,e,t,r,i,o){const n=[],a=Object.getOwnPropertyNames(s);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;const u=Le(s,l,function(c){return function(...h){const f=c.apply(this,h);if(Fa(f,o,this),"tagName"in this.canvas&&!re(this.canvas,r,i,!0)){const m=Ba(h,o,this),g={type:e,property:l,args:m};t(this.canvas,g)}return f}});n.push(u)}catch(u){const c=Rt(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function Jd(s,e,t,r){const i=[];return i.push(...kn(e.WebGLRenderingContext.prototype,ve.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...kn(e.WebGL2RenderingContext.prototype,ve.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const Wa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Kd=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),$n=typeof window!="undefined"&&window.Blob&&new Blob([Kd(Wa)],{type:"text/javascript;charset=utf-8"});function Qd(s){let e;try{if(e=$n&&(window.URL||window.webkitURL).createObjectURL($n),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+Wa,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class qd{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:a})}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,o){const n=_n(t,r,i,!0),a=new Map,l=new Qd;l.onmessage=g=>{const{id:p}=g.data;if(a.set(p,!1),!("base64"in g.data))return;const{base64:d,type:y,width:S,height:w}=g.data;this.mutationCb({id:p,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(p=>{re(p,r,i,!0)||g.push(p)}),g},m=g=>{if(c&&g-c<u){h=requestAnimationFrame(m);return}c=g,f().forEach(async p=>{var d;const y=this.mirror.getId(p);if(a.get(y)||p.width===0||p.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(p.__context)){const w=p.getContext(p.__context);((d=w==null?void 0:w.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}const S=await createImageBitmap(p);l.postMessage({id:y,bitmap:S,width:p.width,height:p.height,dataURLOptions:o.dataURLOptions},[S])}),h=requestAnimationFrame(m)};h=requestAnimationFrame(m),this.resetObservers=()=>{n(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=_n(e,t,r,!1),o=Zd(this.processMutation.bind(this),e,t,r),n=Jd(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}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(n=>{const u=n,{type:a}=u;return Fe(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class ep{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new Ii),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 o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:Yn(a,o.href),index:l}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class tp{constructor(){b(this,"nodeMap",new WeakMap),b(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(){}}let K,lr,es,Er=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((_i=s.contentWindow)==null?void 0:_i.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ue=Hn();function Ae(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:n="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:m,maskInputFn:g,maskTextFn:p,hooks:d,packFn:y,sampling:S={},dataURLOptions:w={},mousemoveWait:v,recordDOM:x=!0,recordCanvas:N=!1,recordCrossOriginIframes:z=!1,recordAfter:B=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:Q=!1,inlineImages:se=!1,plugins:ie,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:Oe=new Set([]),errorHandler:De}=s;Nd(De);const Z=z?window.parent===window:!0;let P=!1;if(!Z)try{window.parent.document&&(P=!1)}catch($){P=!0}if(Z&&!e)throw new Error("emit function is required");if(!Z&&!P)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),ue.reset();const ae=h===!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}:f!==void 0?f:{password:!0},ne=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all",headTitleMutations:m==="all"}:m||{};Si();let st,Fr=0;const Ri=$=>{for(const le of ie||[])le.eventProcessor&&($=le.eventProcessor($));return y&&!P&&($=y($)),$};K=($,le)=>{var X;const J=$;if(J.timestamp=Ct(),(X=ke[0])!=null&&X.isFrozen()&&J.type!==I.FullSnapshot&&!(J.type===I.IncrementalSnapshot&&J.data.source===E.Mutation)&&ke.forEach(de=>de.unfreeze()),Z)e==null||e(Ri(J),le);else if(P){const de={type:"rrweb",event:Ri(J),origin:window.location.origin,isCheckout:le};window.parent.postMessage(de,"*")}if(J.type===I.FullSnapshot)st=J,Fr=0;else if(J.type===I.IncrementalSnapshot){if(J.data.source===E.Mutation&&J.data.isAttachIframe)return;Fr++;const de=r&&Fr>=r,U=t&&J.timestamp-st.timestamp>t;(de||U)&&lr(!0)}};const At=$=>{K({type:I.IncrementalSnapshot,data:M({source:E.Mutation},$)})},Ni=$=>K({type:I.IncrementalSnapshot,data:M({source:E.Scroll},$)}),Ai=$=>K({type:I.IncrementalSnapshot,data:M({source:E.CanvasMutation},$)}),Za=$=>K({type:I.IncrementalSnapshot,data:M({source:E.AdoptedStyleSheet},$)}),Te=new ep({mutationCb:At,adoptedStyleSheetCb:Za}),_e=new Vd({mirror:ue,mutationCb:At,stylesheetManager:Te,recordCrossOriginIframes:z,wrappedEmit:K});for(const $ of ie||[])$.getMirror&&$.getMirror({nodeMirror:ue,crossOriginIframeMirror:_e.crossOriginIframeMirror,crossOriginIframeStyleMirror:_e.crossOriginIframeStyleMirror});const Br=new tp;es=new qd({recordCanvas:N,mutationCb:Ai,win:window,blockClass:i,blockSelector:o,mirror:ue,sampling:S.canvas,dataURLOptions:w});const Ot=new Gd({mutationCb:At,scrollCb:Ni,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ae,dataURLOptions:w,maskTextFn:p,maskInputFn:g,recordCanvas:N,inlineImages:se,sampling:S,slimDOMOptions:ne,iframeManager:_e,stylesheetManager:Te,canvasManager:es,keepIframeSrcFn:O,processedNodeManager:Br},mirror:ue});lr=($=!1)=>{if(!x)return;K({type:I.Meta,data:{href:window.location.href,width:yi(),height:gi()}},$),Te.reset(),Ot.init(),ke.forEach(X=>X.lock());const le=Gl(document,{mirror:ue,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ae,maskTextFn:p,maskInputFn:g,slimDOM:ne,dataURLOptions:w,recordCanvas:N,inlineImages:se,onSerialize:X=>{Ze(X,ue)&&_e.addIframe(X),Ci(X,ue)&&Te.trackLinkElement(X),Ie(X)&&Ot.addShadowRoot(A.shadowRoot(X),document)},onIframeLoad:(X,J)=>{_e.attachIframe(X,J),Ot.observeAttachShadow(X)},onStylesheetLoad:(X,J)=>{Te.attachLinkElement(X,J)},keepIframeSrcFn:O});if(!le)return console.warn("Failed to snapshot the document");K({type:I.FullSnapshot,data:{node:le,initialOffset:mi(window)}},$),ke.forEach(X=>X.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Te.adoptStyleSheets(document.adoptedStyleSheets,ue.getId(document))};try{const $=[],le=J=>{var de;return T(zd)({mutationCb:At,mousemoveCb:(U,Ur)=>K({type:I.IncrementalSnapshot,data:{source:Ur,positions:U}}),mouseInteractionCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.MouseInteraction},U)}),scrollCb:Ni,viewportResizeCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.ViewportResize},U)}),inputCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.Input},U)}),mediaInteractionCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.MediaInteraction},U)}),styleSheetRuleCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.StyleSheetRule},U)}),styleDeclarationCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.StyleDeclaration},U)}),canvasMutationCb:Ai,fontCb:U=>K({type:I.IncrementalSnapshot,data:M({source:E.Font},U)}),selectionCb:U=>{K({type:I.IncrementalSnapshot,data:M({source:E.Selection},U)})},customElementCb:U=>{K({type:I.IncrementalSnapshot,data:M({source:E.CustomElement},U)})},blockClass:i,ignoreClass:n,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:ae,inlineStylesheet:c,sampling:S,recordDOM:x,recordCanvas:N,inlineImages:se,userTriggeredOnInput:H,collectFonts:Q,doc:J,maskInputFn:g,maskTextFn:p,keepIframeSrcFn:O,blockSelector:o,slimDOMOptions:ne,dataURLOptions:w,mirror:ue,iframeManager:_e,stylesheetManager:Te,shadowDomManager:Ot,processedNodeManager:Br,canvasManager:es,ignoreCSSAttributes:Oe,plugins:((de=ie==null?void 0:ie.filter(U=>U.observer))==null?void 0:de.map(U=>({observer:U.observer,options:U.options,callback:Ur=>K({type:I.Plugin,data:{plugin:U.name,payload:Ur}})})))||[]},d)};_e.addLoadListener(J=>{try{$.push(le(J.contentDocument))}catch(de){console.warn(de)}});const X=()=>{lr(),$.push(le(document)),Er=!0};return document.readyState==="interactive"||document.readyState==="complete"?X():($.push(te("DOMContentLoaded",()=>{K({type:I.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&X()})),$.push(te("load",()=>{K({type:I.Load,data:{}}),B==="load"&&X()},window))),()=>{$.forEach(J=>J()),Br.destroy(),Er=!1,Ad()}}catch($){console.warn($)}}Ae.addCustomEvent=(s,e)=>{if(!Er)throw new Error("please add custom event after start recording");K({type:I.Custom,data:{tag:s,payload:e}})};Ae.freezePage=()=>{ke.forEach(s=>s.freeze())};Ae.takeFullSnapshot=s=>{if(!Er)throw new Error("please take full snapshot after start recording");lr(s)};Ae.mirror=ue;function za(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const rp=Object.freeze(Object.defineProperty({__proto__:null,default:za},Symbol.toStringTag,{value:"Module"}));function sp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(y){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(y)}const a=n(s.navigator.userAgent)?1:0;function l(y,S){this.scrollLeft=y,this.scrollTop=S}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,S){if(S==="Y")return y.clientHeight+a<y.scrollHeight;if(S==="X")return y.clientWidth+a<y.scrollWidth}function f(y,S){const w=s.getComputedStyle(y,null)["overflow"+S];return w==="auto"||w==="scroll"}function m(y){const S=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return S||w}function g(y){for(;y!==e.body&&m(y)===!1;)y=y.parentNode||y.host;return y}function p(y){const S=o();let w,v,x,N=(S-y.startTime)/r;N=N>1?1:N,w=u(N),v=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,v,x),(v!==y.x||x!==y.y)&&s.requestAnimationFrame(p.bind(s,y))}function d(y,S,w){let v,x,N,z;const B=o();y===e.body?(v=s,x=s.scrollX||s.pageXOffset,N=s.scrollY||s.pageYOffset,z=i.scroll):(v=y,x=y.scrollLeft,N=y.scrollTop,z=l),p({scrollable:v,method:z,startTime:B,startX:x,startY:N,x:S,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const y=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof y=="undefined"?this.scrollLeft:~~y,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const y=g(this),S=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-S.left,y.scrollTop+w.top-S.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class ip{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function Pn(s,e){if(s.type===I.IncrementalSnapshot&&s.data.source===E.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */function Ln(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)n.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return n}var He;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(He||(He={}));var Va={type:"xstate.init"};function ts(s){return s===void 0?[]:[].concat(s)}function ze(s){return{type:"xstate.assign",assignment:s}}function Fn(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Ir(s){return function(e){return s===e}}function Ga(s){return typeof s=="string"?{type:s}:s}function Bn(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Ir(s)}}function Un(s,e,t){var r=e,i=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){i=!0;var n=Object.assign({},r);return typeof o.assignment=="function"?n=o.assignment(r,t):Object.keys(o.assignment).forEach(function(a){n[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,t):o.assignment[a]}),r=n,!1}return!0}),r,i]}function ja(s,e){e===void 0&&(e={});var t=Ln(Un(ts(s.states[s.initial].entry).map(function(n){return Fn(n,e.actions)}),s.context,Va),2),r=t[0],i=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Ir(s.initial)},transition:function(n,a){var l,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,m=Ga(a),g=s.states[h];if(g.on){var p=ts(g.on[m.type]);try{for(var d=function(P){var ae=typeof Symbol=="function"&&Symbol.iterator,ne=ae&&P[ae],st=0;if(ne)return ne.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&st>=P.length&&(P=void 0),{value:P&&P[st++],done:!P}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),y=d.next();!y.done;y=d.next()){var S=y.value;if(S===void 0)return Bn(h,f);var w=typeof S=="string"?{target:S}:S,v=w.target,x=w.actions,N=x===void 0?[]:x,z=w.cond,B=z===void 0?function(){return!0}:z,H=v===void 0,Q=v!=null?v:h,se=s.states[Q];if(B(f,m)){var ie=Ln(Un((H?ts(N):[].concat(g.exit,N,se.entry).filter(function(P){return P})).map(function(P){return Fn(P,o._options.actions)}),f,m),3),O=ie[0],Oe=ie[1],De=ie[2],Z=v!=null?v:h;return{value:Z,context:Oe,actions:O,changed:v!==h||O.length>0||De,matches:Ir(Z)}}}}catch(P){l={error:P}}finally{try{y&&!y.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return Bn(h,f)}};return o}var Wn=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function Ya(s){var e=s.initialState,t=He.NotStarted,r=new Set,i={_machine:s,send:function(o){t===He.Running&&(e=s.transition(e,o),Wn(e,Ga(o)),r.forEach(function(n){return n(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:Ir(n.value)}}return t=He.Running,Wn(e,Va),i},stop:function(){return t=He.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function np(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===I.Meta&&r.timestamp<=e)return s.slice(t)}return s}function op(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=ja({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ze({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:ze((o,n)=>{let a=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),q(M({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var n;const{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=o;a.clear();for(const g of l)Pn(g,u);const h=np(l,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===I.IncrementalSnapshot&&c.data.source===E.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&r.emit(_.PlayBack);const m=new Array;for(const g of h)if(!(f&&f<u&&(g.timestamp<=f||g===c)))if(g.timestamp<u)m.push(g);else{const p=e(g,!1);a.addAction({doAction:()=>{p()},delay:g.delay})}t(m),r.emit(_.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:ze(o=>q(M({},o),{lastPlayedEvent:null})),startLive:ze({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:ze((o,n)=>{const{baselineTime:a,timer:l,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;Pn(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let g=-1,p=0;for(;p<=h;){const d=Math.floor((p+h)/2);u[d].timestamp<=c.timestamp?p=d+1:h=d-1}g===-1&&(g=p),u.splice(g,0,c)}const f=c.timestamp<a,m=e(c,f);f?m():l.isActive()&&l.addAction({doAction:()=>{m()},delay:c.delay})}return q(M({},o),{events:u})})}});return Ya(i)}function ap(s){const e=ja({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:ze({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Ya(e)}const lp=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],zn=new Map;function Ha(s,e){let t=zn.get(s);return t||(t=new Map,zn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function xe(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await xe(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:o}=r;return Ha(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,n=window[i];return new n(...await Promise.all(o.map(xe(s,e,t))))}else{if("base64"in r)return Yd(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,s.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(xe(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(xe(s,e,t)));return r}}function up(s,e){try{return e===ve.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const cp=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function hp(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!cp.includes(t))return;const r=Ha(s,t);r.includes(e)||r.push(e)}async function fp({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const o=up(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],a=await Promise.all(s.args.map(xe(r,o))),l=n.apply(o,a);hp(o,l);const u=!1}catch(o){i(s,o)}}async function dp({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const n=e.map(async l=>Promise.all(l.args.map(xe(r,o))));(await Promise.all(n)).forEach((l,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(o,c.args)):h.apply(o,l)}catch(h){i(c,h)}})}async function Fs({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const n=i.get(s)||e,a="commands"in n?n.commands:[n];if([ve.WebGL,ve.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const u=a[l];await fp({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await dp({event:s,mutations:a,target:t,imageMap:r,errorHandler:o})}catch(n){o(e,n)}}class pp{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(_.Start,this.start.bind(this)),this.emitter.on(_.SkipStart,this.start.bind(this)),this.emitter.on(_.Pause,this.pause.bind(this)),this.emitter.on(_.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(a=a%n),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var m,g,p,d,y;const i=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:o===Ee.Play||o!==Ee.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(m=a!=null?a:i==null?void 0:i.currentTimeAtLastInteraction)!=null?m:0,lastInteractionTimeOffset:t,playbackRate:(g=n!=null?n:i==null?void 0:i.playbackRate)!=null?g:1,volume:(p=u!=null?u:i==null?void 0:i.volume)!=null?p:1,muted:(d=l!=null?l:i==null?void 0:i.muted)!=null?d:e.getAttribute("muted")===null,loop:(y=c!=null?c:i==null?void 0:i.loop)!=null?y:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:o,isPlaying:n}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),n&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),a=o.attributes;let l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&n&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let m=0;typeof a.rr_mediaCurrentTime=="number"&&(m=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function tr(s,e){if(s.nodeName!=="DIALOG"||s instanceof fe)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),n&&(a?t.showModal():t.show())}}function mp(s,e){if(s.nodeName!=="DIALOG"||s instanceof fe)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const gp=5*1e3,yp=za||rp,Vn="[replayer]",rs={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Gn(s){return s.type==I.IncrementalSnapshot&&(s.data.source==E.TouchMove||s.data.source==E.MouseInteraction&&s.data.type==k.TouchStart)}class wp{constructor(e,t){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new rt),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",yp()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",nn()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",Hn()),b(this,"styleMirror",new Ii),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),b(this,"applyEventsSynchronously",a=>{for(const l of a){switch(l.type){case I.DomContentLoaded:case I.Load:case I.Custom:continue;case I.FullSnapshot:case I.Meta:case I.Plugin:case I.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),b(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case I.DomContentLoaded:case I.Load:break;case I.Custom:u=()=>{this.emitter.emit(_.CustomEvent,a)};break;case I.Meta:u=()=>this.emitter.emit(_.Resize,{width:a.data.width,height:a.data.height});break;case I.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case I.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/gp),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(_.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(_.Finish))};let m=50;a.type===I.IncrementalSnapshot&&a.data.source===E.MouseMove&&a.data.positions.length&&(m+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,m)}this.emitter.emit(_.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:rs,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(_.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(_.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Fs({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===E.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===E.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{br(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],c=Sr(u.node,this.mirror,this.virtualDom.mirror);br(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(_.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new ip([],{speed:this.config.speed});this.service=op({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(_.StateChange,{player:a})}),this.speedService=ap({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(_.StateChange,{speed:a})}),this.mediaManager=new pp({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(a=>a.type===I.Meta),n=this.service.state.context.events.find(a=>a.type===I.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(_.Resize,{width:a,height:l})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(Gn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(_.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(_.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(_.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(_.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Gn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=nn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(sp(this.iframe.contentWindow,this.iframe.contentDocument),Si(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,o=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Vc(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),i.forEach(l=>tr(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(_.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=lp(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Ma(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:E.StyleSheetRule,adds:i.map((n,a)=>({rule:n,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<i.length;n++)(r=o.sheet)==null||r.insertRule(i[n],n)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,n=(a,l)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===we.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};ht(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>tr(a))}collectIframeAndAttachDocument(e,t){if(Ze(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(_.Start,n),this.emitter.on(_.Pause,n);const a=()=>{this.emitter.off(_.Start,n),this.emitter.off(_.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(_.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(_.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===I.IncrementalSnapshot&&t.data.source===E.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(xe(this.imageMap,null,r)));return q(M({},o),{args:n})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(M({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(xe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(M({},e),{args:i}))}}}applyIncremental(e,t){var r,i,o;const{data:n}=e;switch(n.source){case E.Mutation:{try{this.applyMutation(n,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(t){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,n)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=n.positions[0])==null?void 0:r.timeOffset)});break;case E.MouseInteraction:{if(n.id===-1)break;const a=new Event(Me(k[n.type])),l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);this.emitter.emit(_.MouseInteraction,{type:n.type,target:l});const{triggerFocus:u}=this.config;switch(n.type){case k.Blur:"blur"in l&&l.blur();break;case k.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case k.Click:case k.TouchStart:case k.TouchEnd:case k.MouseDown:case k.MouseUp:t?(n.type===k.TouchStart?this.touchActive=!0:n.type===k.TouchEnd&&(this.touchActive=!1),n.type===k.MouseDown?this.lastMouseDownEvent=[l,a]:n.type===k.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===k.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===k.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===k.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===k.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case k.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case E.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,t);break}case E.ViewportResize:this.emitter.emit(_.Resize,{width:n.width,height:n.height});break;case E.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case E.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((i=this.virtualDom.mirror.getNode(n.id))==null||i.rules.push(n)):this.applyStyleSheetMutation(n);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:e,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Fs({event:e,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case E.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,ld(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=xa(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Ie(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw m}});const i=M({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===we.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Ie(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let m=null,g=null;if(u.previousId&&(m=r.getNode(u.previousId)),u.nextId&&(g=r.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;const p=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ze(f,r)){this.attachDocumentToIframe(u,f);return}const d=(w,v)=>{if(!this.usingVirtualDom){tr(w);for(const x of this.config.plugins||[])x.onBuild&&x.onBuild(w,{id:v,replayer:this})}},y=ht(u.node,{doc:p,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:y,mutation:u};return}const S=r.getMeta(f);if(S&&S.type===we.Element&&u.node.type===we.Text){const w=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(const v of w)v.nodeType===f.TEXT_NODE&&f.removeChild(v);else if(S.tagName==="style"&&w.length===1)for(const v of w)v.nodeType===f.TEXT_NODE&&!r.hasNode(v)&&(y.textContent=v.textContent,f.removeChild(v))}else if((S==null?void 0:S.type)===we.Document){const w=f;u.node.type===we.DocumentType&&((c=w.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),y.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?f.insertBefore(y,m.nextSibling):g&&g.parentNode?f.contains(g)?f.insertBefore(y,g):f.insertBefore(y,null):f.appendChild(y),d(y,u.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),Ze(y,this.mirror)){const w=this.mirror.getId(y),v=this.newDocumentQueue.find(x=>x.parentId===w);v&&(this.attachDocumentToIframe(v,y),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==v))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,y,u)};e.adds.forEach(u=>{a(u)});const l=Date.now();for(;o.length;){const u=Oa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)r.getNode(c.value.parentId)?vi(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Da(e.texts).forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(m=>m.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Or(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const m=h.parentNode;((c=m==null?void 0:m.rules)==null?void 0:c.length)>0&&(m.rules=[])}}),e.attributes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const m=u.attributes[f];if(m===null)h.removeAttribute(f),f==="open"&&mp(h,u);else if(typeof m=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const g=r.getMeta(h);Object.assign(g.attributes,u.attributes);const p=ht(g,{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),d=h.nextSibling,y=h.parentNode;if(p&&y){y.removeChild(h),y.insertBefore(p,d),r.replace(u.id,p);break}}catch(g){}if(f==="value"&&h.nodeName==="TEXTAREA"){const g=h;g.childNodes.forEach(d=>g.removeChild(d));const p=(c=h.ownerDocument)==null?void 0:c.createTextNode(m);p&&g.appendChild(p)}else h.setAttribute(f,m);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&tr(h,u)}catch(g){this.warn("An error occurred may due to the checkout feature.",g)}else if(f==="style"){const g=m,p=h;for(const d in g)if(g[d]===!1)p.style.removeProperty(d);else if(g[d]instanceof Array){const y=g[d];p.style.setProperty(d,y[0],y[1])}else{const y=g[d];p.style.setProperty(d,y)}}}})}applyScroll(e,t){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===we.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:n,endOffset:a})=>{const l=this.mirror.getNode(i),u=this.mirror.getNode(n);if(!l||!u)return;const c=new Range;c.setStart(l,o),c.setEnd(u,a);const h=l.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===E.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===E.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,n;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:c}=Ps(l);je(t.cssRules,u).insertRule(a,c)}else{const u=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,u)}}catch(u){}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:u}=Ps(a);je(t.cssRules,l).deleteRule(u||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&je(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&je(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Ie(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:a.rules},u)}catch(h){}});const i=10;let o=0;const n=(a,l)=>{const u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Ie(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&o<i&&(setTimeout(()=>n(a,l),0+100*o),o++)};n(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:o,nextId:n}=i,a=o&&e[o],l=n&&e[n];if(a){const{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){const{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,o){const n=this.mirror.getNode(r);if(!n)return this.debugNodeNotFound(o,r);const a=Ei(n,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?rs:Object.assign({},rs,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==I.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(_.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Vn,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Vn,...e)}}const{addCustomEvent:bp}=Ae,{freezePage:Sp}=Ae,{takeFullSnapshot:vp}=Ae;exports.EventType=I;exports.IncrementalSource=E;exports.MouseInteractions=k;exports.Replayer=wp;exports.ReplayerEvents=_;exports.addCustomEvent=bp;exports.canvasMutation=Fs;exports.freezePage=Sp;exports.record=Ae;exports.takeFullSnapshot=vp;exports.utils=Ed;
+if (typeof module.exports == "object" && typeof exports == "object") {
+  var __cp = (to, from, except, desc) => {
+    if ((from && typeof from === "object") || typeof from === "function") {
+      for (let key of Object.getOwnPropertyNames(from)) {
+        if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
+        Object.defineProperty(to, key, {
+          get: () => from[key],
+          enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
+        });
+      }
+    }
+    return to;
+  };
+  module.exports = __cp(module.exports, exports);
+}
+return module.exports;
+}))
+//# sourceMappingURL=rrweb.umd.min.cjs.map
diff --git a/src/lmnr/version.py b/src/lmnr/version.py
index 4e21d60c..9e1984ec 100644
--- a/src/lmnr/version.py
+++ b/src/lmnr/version.py
@@ -3,7 +3,7 @@
 from packaging import version
 
 
-__version__ = "0.5.2"
+__version__ = "0.5.3"
 PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"
 
 
diff --git a/tests/test_browser_events.py b/tests/test_browser_events.py
new file mode 100644
index 00000000..90d65214
--- /dev/null
+++ b/tests/test_browser_events.py
@@ -0,0 +1,198 @@
+import pytest
+import asyncio
+import uuid
+from unittest.mock import MagicMock, AsyncMock, patch, call, PropertyMock
+
+from lmnr.sdk.client.synchronous.sync_client import LaminarClient
+from lmnr.sdk.client.asynchronous.async_client import AsyncLaminarClient
+from lmnr.sdk.browser.playwright_otel import PlaywrightInstrumentor
+
+
+class TestBrowserEvents:
+    @pytest.fixture
+    def mock_sync_client(self):
+        client = MagicMock(spec=LaminarClient)
+        client._browser_events = MagicMock()
+        client._browser_events.send = MagicMock()
+        return client
+
+    @pytest.fixture
+    def mock_async_client(self):
+        client = AsyncMock(spec=AsyncLaminarClient)
+        client._browser_events = AsyncMock()
+        client._browser_events.send = AsyncMock()
+        return client
+    
+    @pytest.fixture
+    def mock_sync_page(self):
+        page = MagicMock(name="SyncPage")
+        page.evaluate.return_value = True
+        page.goto.return_value = None
+        page.click.return_value = None
+        page.is_closed.side_effect = [False, False, True]  # Return False twice, then True
+        return page
+    
+    @pytest.fixture
+    def mock_async_page(self):
+        page = AsyncMock(name="AsyncPage")
+        page.evaluate.return_value = True
+        page.goto.return_value = None
+        page.click.return_value = None
+        page.is_closed.side_effect = [False, False, True]  # Return False twice, then True
+        return page
+
+    @patch('time.sleep')  # Mock sleep to speed up tests
+    def test_sync_browser_events(self, mock_sleep, mock_sync_client, mock_sync_page):
+        """Test that browser events are captured and sent to Laminar in synchronous mode"""
+        # Set up the evaluate method to return events
+        def evaluate_side_effect(js_code):
+            if "lmnrGetAndClearEvents" in js_code:
+                # Return mock events on the second call
+                return [{"data": [1, 2, 3, 4]}]
+            return True
+            
+        mock_sync_page.evaluate.side_effect = evaluate_side_effect
+        
+        # Directly test the send_events_sync function
+        from lmnr.sdk.browser.pw_utils import send_events_sync
+        
+        # Create test session_id and trace_id
+        session_id = str(uuid.uuid4().hex)
+        trace_id = format(12345, "032x")  # Simple trace ID for testing
+        
+        # Send events
+        send_events_sync(mock_sync_page, session_id, trace_id, mock_sync_client)
+        
+        # Verify events were sent
+        assert mock_sync_client._browser_events.send.called, "No events were sent to Laminar"
+        
+        # Verify call arguments
+        args = mock_sync_client._browser_events.send.call_args[0]
+        assert len(args) == 3, "send() should receive 3 arguments: session_id, trace_id, events"
+        
+        # Verify data format
+        sent_session_id, sent_trace_id, events = args
+        assert sent_session_id == session_id, "session_id mismatch"
+        assert sent_trace_id == trace_id, "trace_id mismatch"
+        assert isinstance(events, list), "events should be a list"
+        assert len(events) > 0, "events list should not be empty"
+
+    @patch('asyncio.sleep')  # Mock sleep to speed up tests
+    @pytest.mark.asyncio
+    async def test_async_browser_events(self, mock_sleep, mock_async_client, mock_async_page):
+        """Test that browser events are captured and sent to Laminar in asynchronous mode"""
+        # Set up the evaluate method to return events
+        async def evaluate_side_effect(js_code):
+            if "lmnrGetAndClearEvents" in js_code:
+                # Return mock events
+                return [{"data": [1, 2, 3, 4]}]
+            return True
+            
+        mock_async_page.evaluate.side_effect = evaluate_side_effect
+        
+        # Directly test the send_events_async function
+        from lmnr.sdk.browser.pw_utils import send_events_async
+        
+        # Create test session_id and trace_id
+        session_id = str(uuid.uuid4().hex)
+        trace_id = format(67890, "032x")  # Simple trace ID for testing
+        
+        # Send events
+        await send_events_async(mock_async_page, session_id, trace_id, mock_async_client)
+        
+        # Verify events were sent
+        assert mock_async_client._browser_events.send.called, "No events were sent to Laminar"
+        
+        # Verify call arguments
+        args = mock_async_client._browser_events.send.call_args.args
+        assert len(args) == 3, "send() should receive 3 arguments: session_id, trace_id, events"
+        
+        # Verify data format
+        sent_session_id, sent_trace_id, events = args
+        assert sent_session_id == session_id, "session_id mismatch"
+        assert sent_trace_id == trace_id, "trace_id mismatch"
+        assert isinstance(events, list), "events should be a list"
+        assert len(events) > 0, "events list should not be empty"
+            
+    @patch('time.sleep')  # Mock sleep to speed up tests
+    def test_multiple_pages(self, mock_sleep, mock_sync_client):
+        """Test that events are properly captured from multiple pages"""
+        # Create two mock pages
+        mock_page1 = MagicMock(name="Page1")
+        mock_page1.evaluate.return_value = [{"data": [1, 2, 3, 4]}]
+        mock_page1.goto.return_value = None
+        mock_page1.is_closed.return_value = False
+        
+        mock_page2 = MagicMock(name="Page2")
+        mock_page2.evaluate.return_value = [{"data": [5, 6, 7, 8]}]
+        mock_page2.goto.return_value = None
+        mock_page2.is_closed.return_value = False
+        
+        # Directly test the send_events_sync function
+        from lmnr.sdk.browser.pw_utils import send_events_sync
+        
+        # Create test session_id and trace_id
+        session_id = str(uuid.uuid4().hex)
+        trace_id = "0" * 32  # Simplified trace ID for testing
+        
+        # Send events from both pages
+        send_events_sync(mock_page1, session_id, trace_id, mock_sync_client)
+        send_events_sync(mock_page2, session_id, trace_id, mock_sync_client)
+        
+        # Verify events were sent twice
+        assert mock_sync_client._browser_events.send.call_count == 2, "Events should be sent twice"
+        
+        # Verify the session_id was consistent across calls
+        session_ids = set()
+        for call_args in mock_sync_client._browser_events.send.call_args_list:
+            session_ids.add(call_args[0][0])  # First positional arg is session_id
+        
+        assert len(session_ids) == 1, "There should be exactly one session ID used"
+    
+    def test_instrumentor_structure(self, mock_sync_client):
+        """Test the structure of the instrumentor and its wrapped methods"""
+        # Import the wrapped methods data structures
+        from lmnr.sdk.browser.playwright_otel import WRAPPED_METHODS, WRAPPED_METHODS_ASYNC
+        
+        # Verify that the wrapped methods have the expected structure
+        expected_methods = [
+            'new_page', 'launch', 'new_context', 'close', 
+            'connect', 'connect_over_cdp', 'launch_persistent_context'
+        ]
+        
+        expected_objects = ['BrowserContext', 'Browser', 'BrowserType']
+        
+        # Check sync methods
+        sync_methods = set()
+        for method in WRAPPED_METHODS:
+            assert method['package'] == 'playwright.sync_api', f"Unexpected package for {method['method']}"
+            assert method['object'] in expected_objects, f"Unexpected object for {method['method']}"
+            assert method['method'] in expected_methods, f"Unexpected method: {method['method']}"
+            assert callable(method['wrapper']), f"Wrapper for {method['method']} is not callable"
+            sync_methods.add(method['method'])
+        
+        # Check async methods
+        async_methods = set()
+        for method in WRAPPED_METHODS_ASYNC:
+            assert method['package'] == 'playwright.async_api', f"Unexpected package for {method['method']}"
+            assert method['object'] in expected_objects, f"Unexpected object for {method['method']}"
+            assert method['method'] in expected_methods, f"Unexpected method: {method['method']}"
+            assert callable(method['wrapper']), f"Wrapper for {method['method']} is not callable"
+            async_methods.add(method['method'])
+        
+        # Verify all expected methods are covered
+        for method in expected_methods:
+            assert method in sync_methods, f"Missing sync method: {method}"
+            assert method in async_methods, f"Missing async method: {method}"
+        
+        # Verify the instrumentor is initialized correctly
+        instrumentor = PlaywrightInstrumentor(
+            client=mock_sync_client,
+            async_client=AsyncMock()
+        )
+        
+        # Check client references
+        assert instrumentor.client == mock_sync_client, "Client reference mismatch"
+        
+        # Verify instrumentation dependencies
+        assert instrumentor.instrumentation_dependencies() == ("playwright >= 1.9.0",), "Unexpected instrumentation dependencies" 
\ No newline at end of file


Reviews:
user: login: ellipsis-dev[bot]
body: > [!CAUTION]
> **Changes requested  :x:**
> <details>
> <summary>Reviewed everything up to 05f1e614cae9cd370170165bc9b1795eab89a7ba in <ellipsistime>2 minutes and 48 seconds</ellipsistime>. Click for details.</summary> 
> 
> - Reviewed `380` lines of code in `5` files
> - Skipped `0` files when reviewing.
> - Skipped posting `4` draft comments. View those below.
> - Modify your [settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review) and [rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules) to customize what types of comments Ellipsis leaves. And don't forget to react with :+1: or :-1: to teach Ellipsis.
> 
> <details>
> <summary>1. <code>src/lmnr/opentelemetry_lib/tracing/tracing.py:456</code></summary>
> 
> - **Draft comment:** 
> New PATCHRIGHT branch: Ensure returning True even when the package isn’t installed is intended (consistent with other instrumentors).
> - **Reason this comment was not posted:**
> Comment looked like it was already resolved.
> 
> 
> </details>
> 
> <details>
> <summary>2. <code>src/lmnr/sdk/browser/pw_utils.py:27</code></summary>
> 
> - **Draft comment:** 
> The rrweb file name change to 'rrweb.umd.min.cjs' looks fine; also, ensure that commenting out the wait_for_function in async injection is intentional.
> - **Reason this comment was not posted:**
> Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment violates the rule about not asking authors to confirm their intention. The comment is phrased as "Ensure that..." which is explicitly called out as likely not useful. Additionally, the code has error handling and retry mechanisms in place, so a failure would be caught and handled appropriately. Maybe removing the wait_for_function could cause race conditions or timing issues that would be hard to debug. The sync version still has this check. The code has comprehensive error handling and retry logic. If rrweb fails to load, it will be detected through the error handlers and retried. Delete the comment as it violates the rule about asking authors to confirm their intentions, and the code has sufficient error handling in place.
> 
> 
> </details>
> 
> <details>
> <summary>3. <code>src/lmnr/sdk/browser/pw_utils.py:24</code></summary>
> 
> - **Draft comment:** 
> The file name has been changed from 'rrweb.min.js' to 'rrweb.umd.min.cjs'. Please ensure that the new UMD build is fully compatible with the rest of the code (e.g. it exposes the expected functions) and that its interface remains stable. It might be useful to extract the file path into a constant to ease future maintenance.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `50%` <= threshold `50%` The comment is asking the PR author to ensure compatibility and stability, which violates the rules. However, it also suggests extracting the file path into a constant, which is a valid code suggestion.
> 
> 
> </details>
> 
> <details>
> <summary>4. <code>src/lmnr/sdk/browser/rrweb/rrweb.umd.min.cjs:1</code></summary>
> 
> - **Draft comment:** 
> A new minified UMD module has been added. Verify that the UMD wrapper correctly detects CommonJS, AMD, and global environments. In particular, note the deprecation warning related to importing the mirror directly; ensure that developers are informed via documentation about using replayer.getMirror() or record.mirror instead. Also, confirm that the sourceMappingURL comment at the end points to the correct map file and that all licensing/copyright notices are preserved.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `0%` <= threshold `50%` The comment is asking the PR author to verify multiple aspects of the new UMD module, which violates the rule against asking the author to confirm or ensure things. It also includes a request to ensure developers are informed via documentation, which is not specific enough to be actionable. The comment does not provide specific code suggestions or ask for specific tests to be written.
> 
> 
> </details>
> 
> 
> Workflow ID: <workflowid>`wflow_3IgoDcXOaNc1q6x5`</workflowid>
> </details>
> 
> <sup>You can customize </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> by changing your [verbosity settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review), reacting with :+1: or :-1:, [replying to comments](https://docs.ellipsis.dev/features/code-review#teaching-ellipsis), or adding [code review rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules).</sup>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T16:14:15Z
user: login: ellipsis-dev[bot]
body: > [!IMPORTANT]
> **Looks good to me!  :+1:**
> <details>
> <summary>Reviewed 50034af435bca8ca32f0a0de85fe24e03b2b3ba5 in <ellipsistime>1 minute and 35 seconds</ellipsistime>. Click for details.</summary> 
> 
> - Reviewed `46` lines of code in `3` files
> - Skipped `0` files when reviewing.
> - Skipped posting `7` draft comments. View those below.
> - Modify your [settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review) and [rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules) to customize what types of comments Ellipsis leaves. And don't forget to react with :+1: or :-1: to teach Ellipsis.
> 
> <details>
> <summary>1. <code>src/lmnr/opentelemetry_lib/tracing/tracing.py:360</code></summary>
> 
> - **Draft comment:** 
> Removed debug logging. Ensure removal of 'module_logger.error("instruments", instruments)' was intentional.
> - **Reason this comment was not posted:**
> Comment looked like it was already resolved.
> 
> 
> </details>
> 
> <details>
> <summary>2. <code>src/lmnr/sdk/browser/patchright_otel.py:22</code></summary>
> 
> - **Draft comment:** 
> Changed package from 'patchright.sync_api' to 'patchright.async_api' and switched wrapper from sync to async. Confirm that the instrumentation should target the async API only.
> - **Reason this comment was not posted:**
> Comment was not on a location in the diff, so it can't be submitted as a review comment.
> 
> 
> </details>
> 
> <details>
> <summary>3. <code>src/lmnr/sdk/browser/playwright_otel.py:242</code></summary>
> 
> - **Draft comment:** 
> Changed package from 'playwright.sync_api' to 'playwright.async_api' and switched wrapper from sync to async for 'launch_persistent_context'. Verify this is the intended change for async usage.
> - **Reason this comment was not posted:**
> Comment was not on a location in the diff, so it can't be submitted as a review comment.
> 
> 
> </details>
> 
> <details>
> <summary>4. <code>src/lmnr/opentelemetry_lib/tracing/tracing.py:360</code></summary>
> 
> - **Draft comment:** 
> Removed error log for 'instruments'. Ensure that this debug log removal doesn’t affect error monitoring if needed.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>5. <code>src/lmnr/sdk/browser/patchright_otel.py:24</code></summary>
> 
> - **Draft comment:** 
> Changed package from 'patchright.sync_api' to 'patchright.async_api' and wrapper to _wrap_new_context_async. Confirm this aligns with the intended async API usage.
> - **Reason this comment was not posted:**
> Comment was not on a location in the diff, so it can't be submitted as a review comment.
> 
> 
> </details>
> 
> <details>
> <summary>6. <code>src/lmnr/sdk/browser/playwright_otel.py:320</code></summary>
> 
> - **Draft comment:** 
> Switched package from 'playwright.sync_api' to 'playwright.async_api' and updated wrapper to _wrap_new_context_async for launch_persistent_context. Ensure consistency with the async implementation.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `40%` <= threshold `50%` The comment is informative and suggests ensuring consistency with the async implementation. It doesn't ask for confirmation or testing, but it does imply a need for consistency, which is a valid concern. However, it doesn't provide a specific suggestion or point out a specific issue.
> 
> 
> </details>
> 
> <details>
> <summary>7. <code>src/lmnr/opentelemetry_lib/tracing/tracing.py:640</code></summary>
> 
> - **Draft comment:** 
> Typographical error: In the init_google_generativeai_instrumentor function, the error message currently says "Error initializing Gemini instrumentor:" when it should refer to the Google GenerativeAI instrumentor. Please update this error message to properly reflect the correct instrumentor name.
> - **Reason this comment was not posted:**
> Comment was not on a location in the diff, so it can't be submitted as a review comment.
> 
> 
> </details>
> 
> 
> Workflow ID: <workflowid>`wflow_n6ihLoq6uOPvt1k4`</workflowid>
> </details>
> 
> <sup>You can customize </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> by changing your [verbosity settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review), reacting with :+1: or :-1:, [replying to comments](https://docs.ellipsis.dev/features/code-review#teaching-ellipsis), or adding [code review rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules).</sup>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T16:38:54Z
user: login: ellipsis-dev[bot]
body: > [!IMPORTANT]
> **Looks good to me!  :+1:**
> <details>
> <summary>Reviewed 3d0fd22692d4721d66db61f0a95d1605602b4df7 in <ellipsistime>1 minute and 17 seconds</ellipsistime>. Click for details.</summary> 
> 
> - Reviewed `28` lines of code in `1` files
> - Skipped `0` files when reviewing.
> - Skipped posting `4` draft comments. View those below.
> - Modify your [settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review) and [rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules) to customize what types of comments Ellipsis leaves. And don't forget to react with :+1: or :-1: to teach Ellipsis.
> 
> <details>
> <summary>1. <code>src/lmnr/sdk/browser/pw_utils.py:157</code></summary>
> 
> - **Draft comment:** 
> Removing the assignment to 'out' is cleaner if the result is unused. Consider using '_' if the return value is intentionally discarded.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>2. <code>src/lmnr/sdk/browser/pw_utils.py:196</code></summary>
> 
> - **Draft comment:** 
> Uncommenting the wait_for_function ensures rrweb is fully loaded before proceeding, which is good to maintain proper initialization order.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>3. <code>src/lmnr/sdk/browser/pw_utils.py:157</code></summary>
> 
> - **Draft comment:** 
> Removed assignment of the evaluation result since it's unused. Directly calling page.evaluate(RRWEB_CONTENT) is cleaner.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>4. <code>src/lmnr/sdk/browser/pw_utils.py:198</code></summary>
> 
> - **Draft comment:** 
> Uncommenting and activating wait_for_function in async load_rrweb ensures rrweb loads before proceeding. Confirm the 5000ms timeout is suitable for all environments.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> 
> Workflow ID: <workflowid>`wflow_O5BtV9cpYitdcXxF`</workflowid>
> </details>
> 
> <sup>You can customize </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> by changing your [verbosity settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review), reacting with :+1: or :-1:, [replying to comments](https://docs.ellipsis.dev/features/code-review#teaching-ellipsis), or adding [code review rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules).</sup>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T18:01:39Z
user: login: ellipsis-dev[bot]
body: > [!IMPORTANT]
> **Looks good to me!  :+1:**
> <details>
> <summary>Reviewed c785693a2a1ae10f41b3eccc990587e78c0311ca in <ellipsistime>3 minutes and 0 seconds</ellipsistime>. Click for details.</summary> 
> 
> - Reviewed `70` lines of code in `1` files
> - Skipped `0` files when reviewing.
> - Skipped posting `12` draft comments. View those below.
> - Modify your [settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review) and [rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules) to customize what types of comments Ellipsis leaves. And don't forget to react with :+1: or :-1: to teach Ellipsis.
> 
> <details>
> <summary>1. <code>src/lmnr/sdk/browser/pw_utils.py:105</code></summary>
> 
> - **Draft comment:** 
> Changed logger.warn to logger.debug. Verify that downgrading the log level won't hide important errors.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `30%` <= threshold `50%` The comment is asking the PR author to verify the change, which violates the rule against asking for confirmation or verification. However, it does point out a potential issue with changing the log level, which could be useful if rephrased as a suggestion or observation.
> 
> 
> </details>
> 
> <details>
> <summary>2. <code>src/lmnr/sdk/browser/pw_utils.py:134</code></summary>
> 
> - **Draft comment:** 
> Logger level changed to debug in the sync version; ensure this matches the intended error reporting policy.
> - **Reason this comment was not posted:**
> Comment looked like it was already resolved.
> 
> 
> </details>
> 
> <details>
> <summary>3. <code>src/lmnr/sdk/browser/pw_utils.py:155</code></summary>
> 
> - **Draft comment:** 
> Removed the wait_for_function call after loading rrweb. Confirm that this doesn't lead to race conditions if rrweb isn't fully loaded.
> - **Reason this comment was not posted:**
> Comment looked like it was already resolved.
> 
> 
> </details>
> 
> <details>
> <summary>4. <code>src/lmnr/sdk/browser/pw_utils.py:196</code></summary>
> 
> - **Draft comment:** 
> Removed wait_for_function in the async rrweb loader. Ensure this change doesn't introduce timing issues.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `0%` <= threshold `50%` The comment is asking the author to ensure that the change doesn't introduce timing issues, which is a form of asking the author to double-check their work. This violates the rule against asking the PR author to ensure the behavior is intended or to double-check things.
> 
> 
> </details>
> 
> <details>
> <summary>5. <code>src/lmnr/sdk/browser/pw_utils.py:231</code></summary>
> 
> - **Draft comment:** 
> Wrapping takeFullSnapshot in a try-catch is a good defensive pattern. Confirm that any errors logged via console.error meet logging conventions.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>6. <code>src/lmnr/sdk/browser/pw_utils.py:305</code></summary>
> 
> - **Draft comment:** 
> Asynchronously wrapping takeFullSnapshot with try-catch is a sensible addition. Ensure consistency with sync counterpart.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>7. <code>src/lmnr/sdk/browser/pw_utils.py:108</code></summary>
> 
> - **Draft comment:** 
> Changed logger.warn to logger.debug in send_events_async; confirm if this lower log level is intentional.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>8. <code>src/lmnr/sdk/browser/pw_utils.py:137</code></summary>
> 
> - **Draft comment:** 
> Changed logger.warn to logger.debug in send_events_sync; verify if lowering log level is desired.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>9. <code>src/lmnr/sdk/browser/pw_utils.py:157</code></summary>
> 
> - **Draft comment:** 
> Removed wait_for_function in load_rrweb_sync; ensure this change does not introduce race conditions if rrweb isn't fully initialized.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `40%` <= threshold `50%` The comment is asking the author to ensure that the change does not introduce race conditions, which violates the rule against asking the author to ensure behavior is intended or tested. However, it does point out a potential issue with the removal of `wait_for_function`, which could be useful for the author to consider. The comment could be rephrased to suggest checking for race conditions without directly asking the author to ensure it.
> 
> 
> </details>
> 
> <details>
> <summary>10. <code>src/lmnr/sdk/browser/pw_utils.py:197</code></summary>
> 
> - **Draft comment:** 
> Removed await page.wait_for_function in load_rrweb_async; confirm that rrweb initialization timing is handled properly.
> - **Reason this comment was not posted:**
> Comment did not seem useful. Confidence is useful = `30%` <= threshold `50%` The comment is asking the PR author to confirm that the rrweb initialization timing is handled properly after removing an `await` statement. This falls under asking the author to ensure behavior is intended, which is against the rules. However, it does point out a specific change that could have implications, which might be useful for the author to consider. Still, it doesn't provide a specific suggestion or ask for a test, so it seems to violate the rules.
> 
> 
> </details>
> 
> <details>
> <summary>11. <code>src/lmnr/sdk/browser/pw_utils.py:230</code></summary>
> 
> - **Draft comment:** 
> Added try/catch around takeFullSnapshot in bring_to_front (sync); good defensive practice.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>12. <code>src/lmnr/sdk/browser/pw_utils.py:306</code></summary>
> 
> - **Draft comment:** 
> Added try/catch around takeFullSnapshot in bring_to_front (async); ensures graceful error handling.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> 
> Workflow ID: <workflowid>`wflow_leBmMSjBzJZr2SpW`</workflowid>
> </details>
> 
> <sup>You can customize </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> by changing your [verbosity settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review), reacting with :+1: or :-1:, [replying to comments](https://docs.ellipsis.dev/features/code-review#teaching-ellipsis), or adding [code review rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules).</sup>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T18:52:28Z
user: login: dinmukhamedm
body: Left a small comment. Also, should we remove the old rrweb min.js file?
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-07T19:33:35Z
user: login: ellipsis-dev[bot]
body: > [!IMPORTANT]
> **Looks good to me!  :+1:**
> <details>
> <summary>Reviewed 74b2d7e71bbed43a75c79b255dbfb3453d754d40 in <ellipsistime>2 minutes and 8 seconds</ellipsistime>. Click for details.</summary> 
> 
> - Reviewed `104` lines of code in `1` files
> - Skipped `0` files when reviewing.
> - Skipped posting `10` draft comments. View those below.
> - Modify your [settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review) and [rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules) to customize what types of comments Ellipsis leaves. And don't forget to react with :+1: or :-1: to teach Ellipsis.
> 
> <details>
> <summary>1. <code>src/lmnr/sdk/browser/pw_utils.py:36</code></summary>
> 
> - **Draft comment:** 
> Avoid using console.log for debug messages in production; consider replacing with a proper logging mechanism if needed.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>2. <code>src/lmnr/sdk/browser/pw_utils.py:44</code></summary>
> 
> - **Draft comment:** 
> Consider using consistent logging for focus events. Using console.log in both focus and blur events might expose internal state in production logs.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>3. <code>src/lmnr/sdk/browser/pw_utils.py:67</code></summary>
> 
> - **Draft comment:** 
> Ensure that replacing document visibility checks with lmnrPageIsFocused matches the desired behavior during background activity.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>4. <code>src/lmnr/sdk/browser/pw_utils.py:81</code></summary>
> 
> - **Draft comment:** 
> Verify that ignoring events when the page isn’t focused (using lmnrPageIsFocused) is acceptable for all use cases; this replaces the previous document visibility check.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>5. <code>src/lmnr/sdk/browser/pw_utils.py:104</code></summary>
> 
> - **Draft comment:** 
> Check that combining focus state with function existence (lmnrGetAndClearEvents) in evaluation logic is the intended behavior across both async and sync event sending functions.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>6. <code>src/lmnr/sdk/browser/pw_utils.py:37</code></summary>
> 
> - **Draft comment:** 
> Consider using document.hasFocus() instead of a custom global flag to track page focus. This leverages a native API and simplifies the code.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>7. <code>src/lmnr/sdk/browser/pw_utils.py:41</code></summary>
> 
> - **Draft comment:** 
> Avoid using console.log for logging focus events in production; consider using a proper logging mechanism.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>8. <code>src/lmnr/sdk/browser/pw_utils.py:105</code></summary>
> 
> - **Draft comment:** 
> Consolidating the focus check with the function existence check inside page.evaluate is clear and concise.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>9. <code>src/lmnr/sdk/browser/pw_utils.py:132</code></summary>
> 
> - **Draft comment:** 
> Consistent use of the custom focus check in send_events_sync is good. No issues here.
> - **Reason this comment was not posted:**
> Confidence changes required: `0%` <= threshold `50%` None
> 
> 
> </details>
> 
> <details>
> <summary>10. <code>src/lmnr/sdk/browser/pw_utils.py:311</code></summary>
> 
> - **Draft comment:** 
> An extra newline was added in the bring_to_front function; consider removing it for consistent formatting.
> - **Reason this comment was not posted:**
> Confidence changes required: `33%` <= threshold `50%` None
> 
> 
> </details>
> 
> 
> Workflow ID: <workflowid>`wflow_dHmOcs5PC1XJxxic`</workflowid>
> </details>
> 
> <sup>You can customize </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=lmnr-ai%2Flmnr-python&utm_source=github&utm_medium=referral)<sup> by changing your [verbosity settings](https://app.ellipsis.dev/lmnr-ai/settings/code-review), reacting with :+1: or :-1:, [replying to comments](https://docs.ellipsis.dev/features/code-review#teaching-ellipsis), or adding [code review rules](https://app.ellipsis.dev/lmnr-ai/code-review/rules).</sup>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T22:38:23Z
user: login: skull8888888
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-07T22:41:04Z
user: login: ellipsis-dev[bot]
body: Skipped PR review on a03db9de91f9397702bec132338b0fcfe32df4c9 because no changed files had a supported extension. If you think this was in error, please [contact us](https://docs.ellipsis.dev/contact) and we'll fix it right away.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T08:23:10Z

Review comments:
diff_hunk: @@ -0,0 +1,177 @@
+from lmnr.sdk.browser.playwright_otel import (
+    _wrap_new_page,
+    _wrap_new_page_async,
+    _wrap_new_browser_sync,
+    _wrap_new_browser_async,
+    _wrap_new_context_sync,
+    _wrap_new_context_async,
+    _wrap_close_browser_sync,
+    _wrap_close_browser_async,
+)
+from lmnr.sdk.client.synchronous.sync_client import LaminarClient
+from lmnr.sdk.client.asynchronous.async_client import AsyncLaminarClient
+from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
+from opentelemetry.instrumentation.utils import unwrap
+from opentelemetry.trace import get_tracer
+from lmnr.version import __version__
+from typing import Collection
+from wrapt import wrap_function_wrapper
+
+_instruments = ("patchright >= 1.9.0",)
+
+WRAPPED_METHODS = [
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserContext",
+        "method": "new_page",
+        "wrapper": _wrap_new_page,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "new_page",
+        "wrapper": _wrap_new_page,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "launch",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "connect",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "connect_over_cdp",
+        "wrapper": _wrap_new_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "close",
+        "wrapper": _wrap_close_browser_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "Browser",
+        "method": "new_context",
+        "wrapper": _wrap_new_context_sync,
+    },
+    {
+        "package": "patchright.sync_api",
+        "object": "BrowserType",
+        "method": "launch_persistent_context",
+        "wrapper": _wrap_new_context_sync,
+    },
+]
+
+WRAPPED_METHODS_ASYNC = [
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserContext",
+        "method": "new_page",
+        "wrapper": _wrap_new_page_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "new_page",
+        "wrapper": _wrap_new_page_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "launch",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "connect",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "BrowserType",
+        "method": "connect_over_cdp",
+        "wrapper": _wrap_new_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "close",
+        "wrapper": _wrap_close_browser_async,
+    },
+    {
+        "package": "patchright.async_api",
+        "object": "Browser",
+        "method": "new_context",
+        "wrapper": _wrap_new_context_async,
+    },
+    {
+        "package": "patchright.sync_api",
path: src/lmnr/sdk/browser/patchright_otel.py
user: login: ellipsis-dev[bot]
body: In `WRAPPED_METHODS_ASYNC`, the last entry uses the sync API (package `patchright.sync_api`)—verify if this is intended for async instrumentation.

created_at: 2025-05-07T16:14:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -360,6 +360,7 @@ def init_instrumentations(
     # Remove any instruments that were explicitly blocked
     instruments = instruments - block_instruments
 
+    module_logger.error("instruments", instruments)
path: src/lmnr/opentelemetry_lib/tracing/tracing.py
user: login: ellipsis-dev[bot]
body: The log statement `module_logger.error("instruments", instruments)` may not work as intended because it doesn’t include a placeholder for the instruments variable. Consider using a formatted string (e.g., `module_logger.error(f"Instruments: {instruments}")`) or a placeholder (e.g., `module_logger.error("Instruments: %s", instruments)`) so that the list of instruments is clearly logged.
```suggestion
    module_logger.error(f"Instruments: {instruments}")
```

created_at: 2025-05-07T16:14:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -155,10 +155,6 @@ def inject_rrweb_sync(page: SyncPage):
             def load_rrweb():
                 try:
                     page.evaluate(RRWEB_CONTENT)
-                    page.wait_for_function(
-                        """(() => typeof window.lmnrRrweb !== 'undefined')""",
-                        timeout=5000,
-                    )
path: src/lmnr/sdk/browser/pw_utils.py
user: login: dinmukhamedm
body: why are we sure we can remove this?
created_at: 2025-05-07T19:32:50Z
author_association: MEMBER
diff_hunk: @@ -196,10 +192,6 @@ async def inject_rrweb_async(page: Page):
             async def load_rrweb():
                 try:
                     await page.evaluate(RRWEB_CONTENT)
-                    await page.wait_for_function(
-                        """(() => typeof window.lmnrRrweb !== 'undefined')""",
-                        timeout=5000,
-                    )
path: src/lmnr/sdk/browser/pw_utils.py
user: login: dinmukhamedm
body: ditto
created_at: 2025-05-07T19:33:02Z
author_association: MEMBER
diff_hunk: @@ -155,10 +155,6 @@ def inject_rrweb_sync(page: SyncPage):
             def load_rrweb():
                 try:
                     page.evaluate(RRWEB_CONTENT)
-                    page.wait_for_function(
-                        """(() => typeof window.lmnrRrweb !== 'undefined')""",
-                        timeout=5000,
-                    )
path: src/lmnr/sdk/browser/pw_utils.py
user: login: skull8888888
body: for some reason it kept breaking patchright. I think outer try is enough, if page.evaluate on rrweb script doesn't fail, then we're good, otherwise it will trigger try
created_at: 2025-05-07T22:41:04Z
author_association: MEMBER

PR comments:
user: login: ellipsis-dev[bot]
created_at: 2025-05-08T09:13:57Z
body: :warning: This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at help@ellipsis.dev

<!--
Workflow ID: <workflowid>`wflow_i977rXmeujvFnPDm`</workflowid>
-->




----
Generated with :heart: by [ellipsis.dev](https://www.ellipsis.dev)

author_association: CONTRIBUTOR
user: login: ellipsis-dev[bot]
created_at: 2025-05-08T09:18:45Z
body: :warning: This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at help@ellipsis.dev

<!--
Workflow ID: <workflowid>`wflow_pirJuy8Ix18dAf97`</workflowid>
-->




----
Generated with :heart: by [ellipsis.dev](https://www.ellipsis.dev)

author_association: CONTRIBUTOR
user: login: ellipsis-dev[bot]
created_at: 2025-05-08T09:19:35Z
body: :warning: This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at help@ellipsis.dev

<!--
Workflow ID: <workflowid>`wflow_Cn7TfAipdJsqBYx9`</workflowid>
-->




----
Generated with :heart: by [ellipsis.dev](https://www.ellipsis.dev)

author_association: CONTRIBUTOR